From 9d488beac4ff8bdb47f90e2ddd5fd9d907371797 Mon Sep 17 00:00:00 2001 From: 郑永安 <zyazyz250@sina.com> Date: 星期一, 19 六月 2023 15:18:27 +0800 Subject: [PATCH] remove and commit --- src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationPha.java | 193 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportPersonAppUpdateBO.java | 92 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/SysDepartmentAppDTO.java | 35 src/main/java/com/gkhy/labRiskManage/config/license/LicenseTypeEnum.java | 47 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateRsServiceImpl.java | 344 src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertDeviceBOConverter.java | 17 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessAppQueryBO.java | 36 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentStuffRepository.java | 44 src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/RoleBindMenuApiDTO.java | 36 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLsSRepository.java | 26 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndEmergencyRespDTO.java | 30 src/main/java/com/gkhy/labRiskManage/api/controller/account/RoleController.java | 45 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesE.java | 64 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicRiskUnitRepository.java | 50 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/MesInsertDTO.java | 88 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserRoleBindAppRespDTO.java | 15 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskUnitQueryRespDTO.java | 103 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateMesService.java | 47 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/RiskAssessPlanQueryBO.java | 31 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStatusEnum.java | 62 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/converter/ExperimentApiConverter.java | 95 src/main/java/com/gkhy/labRiskManage/application/account/service/AccountAppService.java | 46 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskUnitListRespDTO.java | 80 src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndDevice.java | 151 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndDeviceServiceImpl.java | 84 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesMListRespDTO.java | 45 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateLs.java | 160 src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserIdentityApiDTO.java | 15 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/MethodUpdateReqDTO.java | 18 src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/CreateNewUserAppReqDTO.java | 32 src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicRiskUnitController.java | 126 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessQueryRespDTO_0223bak.java | 897 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceUpdateReqBO.java | 161 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanUpdateReqBO.java | 57 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndPersonService.java | 14 src/main/java/com/gkhy/labRiskManage/domain/account/converter/SysDeparmentConverter.java | 43 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationHazopServiceImpl.java | 200 src/main/java/com/gkhy/labRiskManage/config/license/LicenseInit.java | 27 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessIdentificationQueryBO.java | 34 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesSListRespDTO.java | 81 src/main/java/com/gkhy/labRiskManage/config/license/LicenseFilter.java | 65 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorRsR.java | 64 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceAppInsertBO.java | 85 src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonUpdateBO.java | 127 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppIdentificationBO.java | 137 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitBasicDeleteDTO.java | 138 src/main/java/com/gkhy/labRiskManage/api/controller/basic/FactorController.java | 195 src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/SysDeparmentRepository.java | 29 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentRiskSourceTypeService.java | 32 src/main/java/com/gkhy/labRiskManage/config/license/CompanyLicenseDataCache.java | 403 src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentInfo.java | 253 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessLecInsertBO.java | 146 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitListReqBO.java | 16 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorRsSDTO.java | 68 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentDeviceServiceImpl.java | 407 src/main/java/com/gkhy/labRiskManage/domain/account/entity/Role.java | 69 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndDeviceRespDTO.java | 104 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteTypeDTO.java | 28 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskUnitService.java | 73 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportPersonQueryRespDTO.java | 116 src/main/java/com/gkhy/labRiskManage/config/license/LicenseDataCon.java | 34 src/main/java/com/gkhy/labRiskManage/interface/sysManage/LicenseManage.java | 64 pom.xml | 158 src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/FactorAppServiceImpl.java | 172 src/main/resources/config/redisson-dev.yml | 42 src/main/java/com/gkhy/labRiskManage/domain/account/enums/UserStatusEnum.java | 57 src/main/java/com/gkhy/labRiskManage/commons/enums/MethodEnum.java | 52 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffInsertDTO.java | 82 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesEAppListDTO.java | 57 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndPersonAppInsertBO.java | 116 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessInfoServiceImpl.java | 885 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppUpdateBO.java | 41 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndStuffServiceImpl.java | 81 src/main/resources/config/application-dev.yaml | 85 src/main/java/com/gkhy/labRiskManage/api/controller/account/converter/UserIdentityApiConverter.java | 27 src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/AddAndUpdateMenuItemAppDTO.java | 185 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportQueryBO.java | 42 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesSAppListDTO.java | 81 src/main/java/com/gkhy/labRiskManage/config/serializa/JavaTimeAutoConfiguration.java | 30 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportPersonInsertReqBO.java | 92 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppInsertBO.java | 152 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecL.java | 52 src/main/java/com/gkhy/labRiskManage/application/account/converter/UserIndentityAppConverter.java | 28 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndSiteRespDTO.java | 40 src/main/java/com/gkhy/labRiskManage/commons/utils/PageUtils.java | 30 src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceInsertBO.java | 189 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffQueryReqBO.java | 65 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserInfoAppRespDTO.java | 49 src/main/java/com/gkhy/labRiskManage/api/controller/account/query/UserQuery.java | 22 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecCRepository.java | 25 src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentHazardousWasteDTO.java | 119 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicTipServiceImpl.java | 33 src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/UpdateUserAppReqDTO.java | 32 src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToQueryPersonBOConverter.java | 17 src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentInfoRepository.java | 48 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateMesRepository.java | 47 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationAnalogyServiceImpl.java | 180 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitListDTO.java | 78 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentApprovalStatusEnum.java | 63 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AnalogyQueryDTO.java | 48 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceTypeInsertReqBO.java | 54 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportExperimentRiskSourceController.java | 15 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppUpdateBO.java | 127 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteDeleteDTO.java | 201 src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndSiteDTO.java | 41 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/bo/ModifyMenuItemBO.java | 196 src/main/resources/config/application.yaml | 6 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppUpdateBO.java | 128 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanIdentificationDTO.java | 4 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationUpdateReqBO.java | 142 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanInsertReqBO.java | 56 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecLAppListDTO.java | 45 src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndPerson.java | 209 src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/ModRoleApiDTO.java | 24 src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UserBindRoleBO.java | 15 src/main/java/com/gkhy/labRiskManage/domain/account/service/UserDomainService.java | 136 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonInsertDTO.java | 129 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecE.java | 53 src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/resp/MenuItemAppDTO.java | 217 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateLecService.java | 46 src/main/java/com/gkhy/labRiskManage/application/sysAdmin/convert/MenuItemAppConvert.java | 39 src/main/java/com/gkhy/labRiskManage/commons/enums/UserRoleEnum.java | 43 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/RoleRespDTO.java | 24 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportQueryRespDTO.java | 156 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessInfoController.java | 143 src/main/java/com/gkhy/labRiskManage/application/basic/service/FactorAppService.java | 52 src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/RoleMenuBindRepository.java | 30 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLsL.java | 52 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportReqBO.java | 41 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportPersonUpdateReqBO.java | 92 src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/SysUserIdentityBindReposity.java | 28 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitUpdateDTO.java | 138 src/main/java/com/gkhy/labRiskManage/domain/experiment/converter/ExperimentInfoDomainConverter.java | 134 src/main/java/com/gkhy/labRiskManage/domain/attachment/entity/AttachmentInfo.java | 64 src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndStuffRepository.java | 23 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentHazardousWasteServiceImpl.java | 73 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceInsertBO.java | 85 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/SclInsertDTO.java | 156 src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/LoginReqAppDTO.java | 34 src/main/java/com/gkhy/labRiskManage/domain/account/converter/SysUserIndentityBindConverter.java | 44 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ExecStatusSubmitBO.java | 26 src/main/java/com/gkhy/labRiskManage/domain/account/service/RoleMenuDomainService.java | 18 src/main/java/com/gkhy/labRiskManage/Application.java | 15 src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentInfoDTO.java | 212 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppVo.java | 28 src/main/java/com/gkhy/labRiskManage/config/cache/RedisUtils.java | 261 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskUnitListQueryRespDTO.java | 35 src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToUpdatePersonBOConverter.java | 17 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceTypeAppInsertBO.java | 46 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteListDTO.java | 150 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/PertitionConditionEnum.java | 61 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportSourceTypeQueryDTO.java | 107 src/main/java/com/gkhy/labRiskManage/domain/experiment/model/bo/ExperimentDevelopUpdateBO.java | 58 src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndStuff.java | 152 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationSclRepository.java | 34 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskSourceTypeListRespDTO.java | 30 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserRoleBindRespDTO.java | 15 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentType.java | 100 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceInsertDTO.java | 174 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentInfoAppQueryBO.java | 48 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskValueReqBO.java | 36 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/ReportAppQueryDTO.java | 159 src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserInfoDomainConverter.java | 92 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentDeviceService.java | 51 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/IdentificationMethodDeleteDTO.java | 16 src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/converter/MenuInfoApiConverter.java | 119 src/main/java/com/gkhy/labRiskManage/config/authorization/WebSecurityConfig.java | 76 src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndStuffDTO.java | 97 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessMesInsertBO.java | 142 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteTypeEnum.java | 67 src/main/java/com/gkhy/labRiskManage/commons/model/PageQuery.java | 49 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffListDTO.java | 80 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppUpdateBO.java | 126 src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysUserIdentityBind.java | 26 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanDeleteDTO.java | 417 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndPersonAppQueryDTO.java | 107 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationHazopRepository.java | 34 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/repository/jpa/MenuItemRepository.java | 52 src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/SysDepartmentBO.java | 30 src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserInfoApiDTO.java | 42 src/main/java/com/gkhy/labRiskManage/config/file/InitConfig.java | 41 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/SafeInformationSystemEnum.java | 61 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecLListRespDTO.java | 45 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RsQueryDTO.java | 147 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicRiskUnitService.java | 46 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentRiskSourceTypeServiceImpl.java | 38 src/main/java/com/gkhy/labRiskManage/application/attachment/service/impl/AttachmentAppServiceImpl.java | 245 src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/RiskSourceTypeUtils.java | 62 src/main/java/com/gkhy/labRiskManage/domain/account/service/SysDepartmentDomainService.java | 25 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationDeleteReqBO.java | 65 src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/SysDepartmentAppAddReqDTO.java | 34 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecERepository.java | 24 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorRsRRepository.java | 26 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceQueryDTO.java | 244 src/main/java/com/gkhy/labRiskManage/commons/domain/Result.java | 111 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentHazardousWasteAppQueryDTO.java | 77 src/main/java/com/gkhy/labRiskManage/domain/account/enums/UserIdTypeEnum.java | 54 src/main/java/com/gkhy/labRiskManage/domain/account/enums/IdentityStatusEnum.java | 50 src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/MenuItemBindRoleBO.java | 36 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentSite.java | 221 src/main/java/com/gkhy/labRiskManage/application/account/service/TokenAppService.java | 15 src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicDictionaryController.java | 100 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportInfoUpdateReqBO.java | 73 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportRiskSourceQueryRespDTO.java | 93 src/main/java/com/gkhy/labRiskManage/api/controller/account/UserController.java | 116 src/main/java/com/gkhy/labRiskManage/application/riskReport/service/ReportAppService.java | 36 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateLecRepository.java | 48 src/main/java/com/gkhy/labRiskManage/commons/utils/BeanCopyUtils.java | 186 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppUpdateBO.java | 161 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentDeviceQueryRespDTO.java | 235 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentRectifyStatusEnum.java | 63 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/entity/MenuItem.java | 261 src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonQueryBO.java | 64 src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/ReportAppServiceImpl.java | 205 src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentSiteController.java | 128 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorRsSRepository.java | 26 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportAppUpdateBO.java | 31 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitQueryDTO.java | 89 src/main/java/com/gkhy/labRiskManage/application/account/service/AccountMenuAppService.java | 9 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicTip.java | 96 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentTypeServiceImpl.java | 31 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationJhaService.java | 39 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/enums/MenuItemTypeEnum.java | 55 src/main/java/com/gkhy/labRiskManage/domain/account/entity/RoleMenuBind.java | 65 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationJhaRepository.java | 34 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserIdentityBindAppRespDTO.java | 15 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportInsertDTO.java | 333 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportRiskAssessPersonService.java | 44 src/main/java/com/gkhy/labRiskManage/application/attachment/service/dto/req/AttachmentAppReq.java | 48 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentTypeListRespDTO.java | 32 src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentStuffController.java | 127 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/InherentRiskUnitInsertBO.java | 51 src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountMenuAppServiceImpl.java | 123 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLsSDTO.java | 93 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorRsRListRespDTO.java | 57 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessQueryDTO_0223bak.java | 896 src/main/java/com/gkhy/labRiskManage/infra/cache/service/impl/UserCacheInfraServiceImpl.java | 62 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationSclServiceImpl.java | 185 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanIdentificationAppUpdateBO.java | 415 src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/RoleMenuDomainServiceImpl.java | 151 src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysUserRoleBindDomainDTO.java | 17 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentSiteTypeService.java | 21 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskAssessPlanQueryDTO.java | 165 src/main/java/com/gkhy/labRiskManage/config/license/LicenseBizWhiteEnum.java | 51 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesM.java | 52 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportRiskAssessInfoRepository.java | 38 src/main/java/com/gkhy/labRiskManage/application/basic/service/BasicAppService.java | 126 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessQueryDTO.java | 125 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentDeviceListRespDTO.java | 161 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentHazardousWasteService.java | 15 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecCListRespDTO.java | 93 src/main/java/com/gkhy/labRiskManage/application/account/service/impl/RoleAppServiceImpl.java | 88 src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentHazardousWasteRepository.java | 23 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessPersonServiceImpl.java | 239 src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserIdentityBindApiDTO.java | 15 src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserIdentityDomainServiceImpl.java | 37 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecLRepository.java | 25 src/main/java/com/gkhy/labRiskManage/config/file/FilePathConfig.java | 33 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitListAppQueryDTO.java | 33 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/UpdateExperimentInfoBO.java | 13 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskUnit.java | 93 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentRiskSourceTypeRepository.java | 24 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskUnitServiceImpl.java | 497 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLsLDTO.java | 45 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentHazardousWasteInsertReqBO.java | 46 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentDeviceAppListDTO.java | 161 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicRiskUnitServiceImpl.java | 347 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppEvaluateBO.java | 207 src/main/java/com/gkhy/labRiskManage/commons/enums/ResultCode.java | 88 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportRiskAssessInfo.java | 136 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndStuffInsertReqBO.java | 89 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentPerson.java | 196 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteStorageEnum.java | 65 src/main/resources/config/application-online-uat.yaml | 68 src/main/java/com/gkhy/labRiskManage/commons/exception/BusinessException.java | 74 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffDeleteDTO.java | 128 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLsLAppListDTO.java | 45 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/EvaluateMethodDeleteDTO.java | 16 src/main/java/com/gkhy/labRiskManage/infra/cache/service/UserCacheInfraService.java | 12 src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserRoleBindApiDTO.java | 15 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentPersonListRespDTO.java | 129 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateLec.java | 166 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndDeviceController.java | 15 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationAnalogyRepository.java | 34 src/main/java/com/gkhy/labRiskManage/config/authorization/TokenCheckWhiteListEnum.java | 79 src/main/java/com/gkhy/labRiskManage/domain/attachment/service/impl/AttachmentDomainServiceImpl.java | 68 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentPersonRepository.java | 53 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LecInsertDTO.java | 86 src/main/java/com/gkhy/labRiskManage/config/cache/RedisConfig.java | 36 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLsSAppListDTO.java | 93 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffUpdateDTO.java | 78 src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysDepartmentDomainDTO.java | 34 src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndPersonDTO.java | 128 src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentDeviceController.java | 161 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/LoginRespDto.java | 21 src/main/java/com/gkhy/labRiskManage/domain/account/entity/User.java | 88 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentRiskSourceTypeServiceImpl.java | 164 src/main/java/com/gkhy/labRiskManage/config/authorization/TokenAuthenticationFilter.java | 140 src/main/java/com/gkhy/labRiskManage/application/attachment/service/AttachmentAppService.java | 27 src/main/java/com/gkhy/labRiskManage/application/account/converter/UserInfoAppConverter.java | 69 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationAnalogy.java | 206 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppInsertBO.java | 38 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesMDTO.java | 45 src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateAndIdentificationNewUtils.java | 416 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentSiteTypeServiceImpl.java | 40 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/TimeoutEnum.java | 61 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/HazopInsertDTO.java | 197 src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/AddAndUpdateMenuItemApiDTO.java | 104 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitBasicQueryDTO.java | 223 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/CloseConditionEnum.java | 61 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlan.java | 165 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLsLRepository.java | 26 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationAnalogyService.java | 39 src/main/java/com/gkhy/labRiskManage/application/account/service/RoleAppService.java | 18 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportPersonInsertBO.java | 85 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesSDTO.java | 81 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportPersonInsertDTO.java | 164 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndDeviceAppQueryDTO.java | 106 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/bo/CreateNewMenuItemBO.java | 177 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceTypeAppUpdateBO.java | 55 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentTypeRepository.java | 24 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppQueryBO.java | 28 src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserRepository.java | 58 src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndDeviceDTO.java | 111 src/main/java/com/gkhy/labRiskManage/commons/domain/SearchResult.java | 86 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationScl.java | 206 src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentTypeController.java | 44 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLsLListRespDTO.java | 46 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentSiteRepository.java | 45 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportRiskAssessPersonRepository.java | 30 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessQueryReqBO.java | 39 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecCDTO.java | 91 src/main/java/com/gkhy/labRiskManage/domain/attachment/repository/jpa/AttachmentReposity.java | 30 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicRiskUnitType.java | 96 src/main/java/com/gkhy/labRiskManage/api/controller/account/SysDepartmentController.java | 42 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoVoRespDTO.java | 32 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceUpdateDTO.java | 178 src/main/java/com/gkhy/labRiskManage/api/controller/common/BaseController.java | 36 src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysUserIdentityBindDomainDTO.java | 15 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentStuffAppQueryDTO.java | 151 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentTypeEnum.java | 67 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportSourceTypeQueryRespDTO.java | 56 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndStuffController.java | 14 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportExperimentSiteQueryRespDTO.java | 65 src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/UserSearchReqDTO.java | 64 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLsSListRespDTO.java | 93 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndSiteInsertReqBO.java | 27 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorRsSAppListDTO.java | 68 src/main/java/com/gkhy/labRiskManage/application/account/service/impl/SysDepartmentAppServiceImpl.java | 87 src/main/java/com/gkhy/labRiskManage/config/authorization/TokenConfig.java | 52 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanAppQueryDTO.java | 166 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateRs.java | 158 src/main/java/com/gkhy/labRiskManage/domain/basic/service/FactorService.java | 51 src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/AddRoleApiDTO.java | 14 src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndDeviceRepository.java | 25 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceUpdateReqBO.java | 91 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentPersonService.java | 51 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentPersonServiceImpl.java | 357 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteQueryReqBO.java | 65 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/EvaluateInsertDTO.java | 23 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppInsertBO.java | 118 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanRepository.java | 67 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInfoQueryReqBO.java | 48 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndSiteServiceImpl.java | 80 src/main/java/com/gkhy/labRiskManage/api/controller/account/converter/UserInfoApiConverter.java | 54 src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountAppServiceImpl.java | 409 src/main/java/com/gkhy/labRiskManage/commons/enums/SystemCacheKeyEnum.java | 35 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndEmergencyServiceImpl.java | 59 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentStuffListRespDTO.java | 81 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AnalogyInsertDTO.java | 156 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/InherentRiskUnitInsertReqBO.java | 29 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentInfoService.java | 52 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanQueryRespDTO.java | 165 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteInsertReqBO.java | 141 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanListRespDTO.java | 34 src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/GetRoleTagUtils.java | 27 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LecQueryDTO.java | 159 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateRsService.java | 47 src/main/java/com/gkhy/labRiskManage/application/account/service/impl/UserIdentityAppServiceImpl.java | 31 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportUpdateDTO.java | 333 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonListDTO.java | 127 src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/SiteInsertBO.java | 64 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteUpdateReqBO.java | 151 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecCAppListDTO.java | 92 src/main/java/com/gkhy/labRiskManage/domain/account/service/UserIdentityDomainService.java | 18 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndDeviceService.java | 17 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoRespDTO.java | 217 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/TipDTO.java | 30 src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndEmergency.java | 71 src/main/java/com/gkhy/labRiskManage/domain/account/converter/RoleInfoConverter.java | 18 src/main/java/com/gkhy/labRiskManage/api/controller/attachment/converter/AttachmentApiConverter.java | 28 src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/UserIdentityDomainDTO.java | 19 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppDevelopUpdateBO.java | 58 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportExperimentRiskSourceTypeController.java | 14 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessQueryRespDTO.java | 127 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateInsertReqBO.java | 205 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentDeviceType.java | 96 src/main/java/com/gkhy/labRiskManage/commons/enums/UserTagEnum.java | 37 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonInsertReqBO.java | 118 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicRiskUnitTypeService.java | 16 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanUpdateDTO.java | 417 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/service/MenuDomainService.java | 33 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndEmergencyInsertReqBO.java | 35 src/main/java/com/gkhy/labRiskManage/application/account/service/impl/TokenAppServiceImpl.java | 121 src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java | 916 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserIndentityAppDTO.java | 18 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndDeviceAppInsertBO.java | 37 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportRiskAssessInfoService.java | 52 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateMesServiceImpl.java | 360 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentPersonAppListDTO.java | 129 src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/ModifyMenuItemApiDTO.java | 104 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndEmergencyService.java | 16 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationPhaRepository.java | 34 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitInsertReqBO.java | 37 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecC.java | 99 src/main/java/com/gkhy/labRiskManage/domain/account/service/UserRoleDomainService.java | 21 src/main/java/com/gkhy/labRiskManage/domain/attachment/enums/FileProjectConstants.java | 20 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentRiskSourceType.java | 99 src/main/java/com/gkhy/labRiskManage/domain/account/entity/UserIdentity.java | 24 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentSiteServiceImpl.java | 29 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentDeviceTypeRepository.java | 32 src/main/java/com/gkhy/labRiskManage/application/basic/service/DictionaryAppService.java | 31 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentStuffServiceImpl.java | 314 src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/ModifyMenuItemAppDTO.java | 185 src/main/java/com/gkhy/labRiskManage/commons/exception/ExceptionInfo.java | 46 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentInfoServiceImpl.java | 652 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationJha.java | 193 src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndEmergencyRepository.java | 21 src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/MenuItemMetaDTO.java | 117 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportDTO.java | 29 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/converter/MenuItemConverter.java | 18 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteUpdateDTO.java | 204 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceTypeUpdateBO.java | 55 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndPersonServiceImpl.java | 74 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentRiskSourceServiceImpl.java | 169 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentSite.java | 83 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceInsertReqBO.java | 91 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessPersonController.java | 14 src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndSite.java | 42 src/main/java/com/gkhy/labRiskManage/application/attachment/service/dto/resp/AttachmentAppRespDTO.java | 48 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndSiteService.java | 19 src/main/java/com/gkhy/labRiskManage/commons/enums/StatusEnum.java | 99 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndSiteAppQueryDTO.java | 40 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/RiskAssessPlanIdentificationInsertReqBO.java | 370 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessRsInsertBO.java | 134 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceDeleteDTO.java | 178 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/FactorQueryDTO.java | 329 src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserDomainServiceImpl.java | 647 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessEvaluateQueryBO.java | 33 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecLDTO.java | 45 src/main/java/com/gkhy/labRiskManage/config/license/LicenseManageService.java | 63 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LsQueryDTO.java | 150 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportAppQueryBO.java | 42 src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/MenuManageController.java | 91 src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/RoleDomainServiceImpl.java | 148 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentDevice.java | 244 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationSclService.java | 39 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/service/impl/MenuDomainServiceImpl.java | 374 src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/MenuItemBindRoleApiDTO.java | 36 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskSourceTypeAppListDTO.java | 30 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteEnum.java | 61 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffInsertReqBO.java | 72 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/FactorServiceImpl.java | 132 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppQueryBO.java | 87 src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/CreateUserBO.java | 25 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentStuffQueryRespDTO.java | 151 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorRsSListRespDTO.java | 68 src/main/java/com/gkhy/labRiskManage/api/controller/model/dto/resp/MenuItemApiDTO.java | 148 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecEAppListDTO.java | 46 src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertSiteBOConverter.java | 17 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentHazardousWasteAppInsertBO.java | 56 src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToQueryDeviceBOConverter.java | 17 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndEmergencyAppQueryDTO.java | 31 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessAppQueryDTO.java | 127 src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentPersonController.java | 134 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentSiteRepository.java | 16 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesMAppListDTO.java | 45 src/main/java/com/gkhy/labRiskManage/domain/account/service/RoleDomainService.java | 33 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessAppQueryDTO_0223bak.java | 896 src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentRiskSourceTypeController.java | 41 src/main/java/com/gkhy/labRiskManage/application/experiment/converter/ExperimentAppConverter.java | 94 src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/RoleRepository.java | 35 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentDevelopUpdateReqBO.java | 64 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateDeleteReqBO.java | 58 src/main/java/com/gkhy/labRiskManage/domain/account/service/SysUserIdentityBindDomainService.java | 17 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateUpdateReqBO.java | 209 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateRsRepository.java | 47 src/main/java/com/gkhy/labRiskManage/config/license/LicenseInfo.java | 48 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonDeleteDTO.java | 176 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/JhaInsertDTO.java | 144 src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndEmergencyDTO.java | 30 src/main/java/com/gkhy/labRiskManage/commons/utils/SpringUtils.java | 18 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitDeleteDTO.java | 72 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/repository/jpa/SysConfigRepository.java | 9 src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndPersonRepository.java | 23 src/main/java/com/gkhy/labRiskManage/application/attachment/converter/AttachmentAppConverter.java | 24 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorRsRAppListDTO.java | 57 src/main/java/com/gkhy/labRiskManage/config/serializa/JacksonConfiguration.java | 32 src/main/java/com/gkhy/labRiskManage/api/controller/attachment/dto/resp/AttachmentApiRespDTO.java | 48 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentDeviceTypeServiceImpl.java | 46 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentRiskSourceTypeRepository.java | 27 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppInsertBO.java | 153 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PhaInsertDTO.java | 149 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecEListRespDTO.java | 47 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportPersonAppInsertBO.java | 83 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentRiskSourceRepository.java | 29 src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToBasicDeviceInfoConverter.java | 17 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateLsRepository.java | 47 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppInsertBO.java | 70 src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/RoleInfoDoaminDTO.java | 25 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/RiskUnitController.java | 165 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentRiskSourceType.java | 124 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentTagEnum.java | 62 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceAppUpdateBO.java | 92 src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/SysDepartmentAppUpdateReqDTO.java | 27 src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonInsertBO.java | 118 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppQueryBO.java | 64 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonQueryReqBO.java | 64 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanQueryDTO.java | 168 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndEmergencyAppInsertBO.java | 35 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonUpdateReqBO.java | 127 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesMRepository.java | 25 src/main/java/com/gkhy/labRiskManage/infra/cache/domain/CacheUserInfo.java | 83 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffUpdateReqBO.java | 80 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorRsS.java | 75 src/main/java/com/gkhy/labRiskManage/domain/attachment/converter/AttachmentDomainConverter.java | 25 src/main/java/com/gkhy/labRiskManage/config/cors/CorsConfig.java | 39 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicTipService.java | 14 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitUpdateReqBO.java | 126 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceTypeDTO.java | 29 src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskUnitRepository.java | 68 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/HazopQueryDTO.java | 67 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentSiteService.java | 11 src/main/java/com/gkhy/labRiskManage/commons/enums/SystemConfigKeyEnum.java | 31 src/main/java/com/gkhy/labRiskManage/application/account/service/UserIdentityAppService.java | 16 src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToUpdateDeviceBOConverter.java | 17 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentStuff.java | 148 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationJhaServiceImpl.java | 172 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStageEnum.java | 62 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LsInsertDTO.java | 196 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateMes.java | 167 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PhaQueryDTO.java | 49 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanQueryReqBO.java | 29 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppInsertBO.java | 59 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateLecServiceImpl.java | 377 src/main/java/com/gkhy/labRiskManage/config/exception/GlobalExceptionHandler.java | 133 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/TokenInfoDto.java | 34 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitQueryReqBO.java | 64 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessLSInsertBO.java | 135 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportSourceTypeInsertDTO.java | 46 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentPersonAppQueryDTO.java | 176 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationInsertReqBO.java | 135 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitInsertDTO.java | 74 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/RiskAssessPlanController.java | 426 src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/SysUserIdentityBindDomainServiceImpl.java | 116 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndDeviceInsertReqBO.java | 41 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationPhaService.java | 40 src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceUpdateBO.java | 167 src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateAndIdentificationUtils.java | 824 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskUnitAppQueryDTO.java | 101 src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/NewMenuItemAppDTO.java | 175 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentTypeService.java | 17 src/main/java/com/gkhy/labRiskManage/domain/experiment/model/bo/ExperimentInfoQueryBO.java | 23 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceTypeInsertBO.java | 46 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentSiteListRespDTO.java | 152 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppQueryDTO.java | 219 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateLsService.java | 43 src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/SysDepartmentDomainServiceImpl.java | 166 src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/EmergencyDrillStatusEnum.java | 62 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceQueryReqBO.java | 85 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentSiteAppListDTO.java | 150 src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndStuffService.java | 15 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInsertReqBO.java | 167 src/main/java/com/gkhy/labRiskManage/config/license/LicenseKCon.java | 22 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesSRepository.java | 25 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppQueryBO.java | 84 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentDeviceTypeService.java | 23 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppInsertBO.java | 141 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentHazardousWasteRespDTO.java | 57 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppUpdateBO.java | 149 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentRiskSourceService.java | 30 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationHazopService.java | 40 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceTypeUpdateReqBO.java | 55 src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysDepartment.java | 68 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentTypeAppListDTO.java | 30 src/main/java/com/gkhy/labRiskManage/application/riskReport/service/RiskAccessAppService.java | 129 src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserIdentityConverter.java | 30 src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserRoleBindReposity.java | 30 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentRiskSource.java | 160 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndPersonInsertReqBO.java | 115 src/main/java/com/gkhy/labRiskManage/application/account/converter/RoleInfoAppConverter.java | 18 src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/DictionaryAppServiceImpl.java | 59 src/main/java/com/gkhy/labRiskManage/application/sysAdmin/service/impl/MenuAppServiceImpl.java | 298 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppQueryBO.java | 64 src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/IdentificationMethodCheck.java | 79 src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/UserMenuController.java | 48 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLsS.java | 100 src/main/java/com/gkhy/labRiskManage/config/authorization/MyWebMvcConfigurerAdapter.java | 27 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecEDTO.java | 47 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentSiteTypeRepository.java | 31 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesERepository.java | 25 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/SclQueryDTO.java | 49 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicTipRepository.java | 20 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndStuffAppQueryDTO.java | 95 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanEvaluateAppUpdateBO.java | 252 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesS.java | 88 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitTypeDTO.java | 33 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffQueryDTO.java | 151 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskUnitAppQueryDTO.java | 221 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicRiskUnit.java | 208 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentSiteServiceImpl.java | 369 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/MesQueryDTO.java | 156 src/main/resources/config/redisson-online-uat.yml | 42 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentSiteService.java | 52 src/main/java/com/gkhy/labRiskManage/api/controller/account/AuthController.java | 33 src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/RoleBindMenuItemBO.java | 36 src/main/java/com/gkhy/labRiskManage/api/controller/attachment/AttachmentController.java | 133 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentPersonQueryRespDTO.java | 199 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentDeviceRepository.java | 61 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentRiskSourceTypeService.java | 17 src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndSiteRepository.java | 26 src/main/java/com/gkhy/labRiskManage/domain/attachment/service/AttachmentDomainService.java | 20 src/main/java/com/gkhy/labRiskManage/api/controller/model/dto/resp/MenuItemMetaApiDTO.java | 124 src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysUserRoleBind.java | 31 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportQueryDTO.java | 141 src/main/java/com/gkhy/labRiskManage/domain/attachment/dto/resp/AttachmentDomainDTO.java | 53 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PlanInsertDTO.java | 418 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentApplyUpdateReqBO.java | 46 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/AppointUserReBO.java | 19 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanListAppDTO.java | 31 src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/BasicAppServiceImpl.java | 491 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationHazop.java | 241 src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndStuffAppInsertBO.java | 17 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitInsertReqBO.java | 122 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportRiskSourceDTO.java | 141 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationPhaServiceImpl.java | 174 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java | 2097 + src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentSiteAppQueryDTO.java | 223 src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserRoleDomainServiceImpl.java | 127 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndPersonController.java | 15 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceUpdateBO.java | 92 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanEvaluateDTO.java | 4 src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/UserInfoDomainDTO.java | 55 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonQueryDTO.java | 199 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportQueryReqBO.java | 42 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/JhaQueryDTO.java | 43 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppUpdateBO.java | 80 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentStuffAppListDTO.java | 79 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskUnitAppListDTO.java | 78 src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserRoleBindConverter.java | 45 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskSourceTypeDTO.java | 30 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndStuffRespDTO.java | 92 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceInsertReqBO.java | 151 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanService.java | 111 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonUpdateDTO.java | 127 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RsInsertDTO.java | 209 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppInsertBO.java | 118 src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserIdentityRepository.java | 15 src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UpdateUserBO.java | 31 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentHazardousWasteController.java | 15 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/TypeListDTO.java | 87 src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppQueryBO.java | 65 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportUpdateReqBO.java | 58 src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/MenuItemBindRoleAppDTO.java | 36 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitQueryReqBO.java | 28 src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentHazardousWaste.java | 147 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskUnitQueryRespDTO.java | 221 src/main/java/com/gkhy/labRiskManage/api/controller/account/UserIndentityController.java | 48 src/main/java/com/gkhy/labRiskManage/application/experiment/service/ExperimentAppService.java | 34 src/main/java/com/gkhy/labRiskManage/application/experiment/service/impl/ExperimentAppServiceImpl.java | 358 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateLsServiceImpl.java | 341 src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/ContextUserDto.java | 57 src/main/java/com/gkhy/labRiskManage/application/sysAdmin/service/MenuAppService.java | 39 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitInsertDTO.java | 140 src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessQueryBO.java | 35 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/entity/SysConfig.java | 50 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentInfoController.java | 258 src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicRiskUnitTypeServiceImpl.java | 39 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentSiteQueryRespDTO.java | 223 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/InherentRiskUnitAppInsertBO.java | 125 src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/dto/MenuItemDomainDTO.java | 207 src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/ChangePasswdReqDto.java | 34 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteQueryDTO.java | 223 src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndPersonRespDTO.java | 108 src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateCheckUtils.java | 217 src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceQueryBO.java | 72 src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportRiskAssessPerson.java | 184 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesEDTO.java | 58 src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/LoginReqDTO.java | 24 src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesEListRespDTO.java | 57 src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppQueryBO.java | 29 src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicRiskUnitTypeRepository.java | 25 src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/RoleBindMenuAppDTO.java | 36 src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitUpdateReqBO.java | 41 src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentDeviceAppQueryDTO.java | 233 src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorRsRDTO.java | 57 src/main/java/com/gkhy/labRiskManage/application/account/service/SysDepartmentAppService.java | 22 src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentSiteType.java | 96 src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentStuffService.java | 45 src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertPersonBOConverter.java | 17 700 files changed, 71,217 insertions(+), 0 deletions(-) diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..e6d57e9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,158 @@ +<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>com.gkhy</groupId> + <artifactId>LaboratoryRiskManage.Server</artifactId> + <version>1.0-SNAPSHOT</version> + + <properties> + <springboot.version>2.7.5</springboot.version> + <druid.version>1.2.14</druid.version> + <redisson.version>3.17.7</redisson.version> + </properties> + + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>2.7.5</version> + </parent> + + <dependencies> + <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> + <artifactId>logback-classic</artifactId> + <groupId>ch.qos.logback</groupId> + </exclusion> + <!-- <exclusion>--> + <!-- <groupId>org.springframework.boot</groupId>--> + <!-- <artifactId>spring-boot-starter-tomcat</artifactId>--> + <!-- </exclusion>--> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-data-jpa</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-security</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-configuration-processor</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-log4j2</artifactId> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>5.3.23</version> + </dependency> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>8.0.31</version> + </dependency> +<!-- <dependency>--> +<!-- <groupId>com.baomidou</groupId>--> +<!-- <artifactId>mybatis-plus-boot-starter</artifactId>--> +<!-- <version>3.5.2</version>--> +<!-- </dependency>--> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>1.9.9.1</version> + <!-- <scope>runtime</scope>--> + </dependency> + <dependency> + <groupId>com.alibaba</groupId> + <artifactId>druid-spring-boot-starter</artifactId> + <version>${druid.version}</version> + </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>31.1-jre</version> + </dependency> + <dependency> + <groupId>org.redisson</groupId> + <artifactId>redisson-spring-boot-starter</artifactId> + <version>${redisson.version}</version> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-validation</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <version>${springboot.version}</version> + </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </dependency> + + <!--Jackson LocalDateTime支持--> + <dependency> + <groupId>com.fasterxml.jackson.datatype</groupId> + <artifactId>jackson-datatype-jsr310</artifactId> + <version>2.14.0</version> + </dependency> + + <dependency> + <groupId>cn.hutool</groupId> + <artifactId>hutool-all</artifactId> + <version>5.8.10</version> + </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.10.1</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <!-- 该项目的启动入口 --> + <mainClass>com.gkhy.labRiskManage.Application</mainClass> + </configuration> + <executions> + <execution> + <goals> + <!--把依赖的所有包都打包生成的Jar包中--> + <goal>repackage</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + +</project> \ No newline at end of file diff --git a/src/main/java/com/gkhy/labRiskManage/Application.java b/src/main/java/com/gkhy/labRiskManage/Application.java new file mode 100644 index 0000000..92a409f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/Application.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; + +@EnableJpaAuditing +@SpringBootApplication +public class Application { + + public static void main(String[] args){ +// SpringApplication.run(Application.class); + SpringApplication.run(Application.class,args); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/AuthController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/AuthController.java new file mode 100644 index 0000000..052bf67 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/AuthController.java @@ -0,0 +1,33 @@ +package com.gkhy.labRiskManage.api.controller.account; + +import com.gkhy.labRiskManage.api.controller.account.dto.req.LoginReqDTO; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.application.account.dto.repDto.LoginReqAppDTO; +import com.gkhy.labRiskManage.application.account.service.AccountAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/account/auth") +public class AuthController extends BaseController { + + @Autowired + private AccountAppService accountAppService; + + @PostMapping("/login") + public Result login(@RequestBody LoginReqDTO loginReqDTO){ + LoginReqAppDTO loginReqAppDTO = new LoginReqAppDTO(); + loginReqAppDTO.setName(loginReqDTO.getName()); + loginReqAppDTO.setPwd(loginReqDTO.getPwd()); + Result result = accountAppService.login(loginReqAppDTO); + return result; + } + + @GetMapping("/logout") + public Result logout(){ + Long userId = getCurrentUserId(); + Result result = accountAppService.logout(userId); + return result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/RoleController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/RoleController.java new file mode 100644 index 0000000..d41dc30 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/RoleController.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.api.controller.account; + +import com.gkhy.labRiskManage.api.controller.account.dto.req.AddRoleApiDTO; +import com.gkhy.labRiskManage.api.controller.account.dto.req.ModRoleApiDTO; +import com.gkhy.labRiskManage.application.account.service.RoleAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/account/role") +public class RoleController { + + @Autowired + private RoleAppService roleAppService; + + @PostMapping("/new") + @Transactional + public Result createNewRole(@RequestBody AddRoleApiDTO dto){ + Result result = roleAppService.newRole(dto.getName()); + return result; + } + + @PostMapping("/mod/name") + @Transactional + public Result updateRoleName(@RequestBody ModRoleApiDTO dto){ + Result result = roleAppService.updateRoleName(dto.getRoleId(), dto.getName()); + return result; + } + + @PostMapping("/del") + @Transactional + public Result delNewRole(@RequestBody ModRoleApiDTO dto){ + Result result = roleAppService.deleteRole(dto.getRoleId()); + return result; + } + + @GetMapping("/find/all/active") + public SearchResult findAllRoleList(){ + SearchResult result = roleAppService.findAllRoleList(); + return result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/SysDepartmentController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/SysDepartmentController.java new file mode 100644 index 0000000..3b7eddb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/SysDepartmentController.java @@ -0,0 +1,42 @@ +package com.gkhy.labRiskManage.api.controller.account; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.application.account.dto.repDto.SysDepartmentAppAddReqDTO; +import com.gkhy.labRiskManage.application.account.dto.repDto.SysDepartmentAppUpdateReqDTO; +import com.gkhy.labRiskManage.application.account.service.SysDepartmentAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/7 + * @time: 16:34 + */ +@RestController +@RequestMapping("account/department") +public class SysDepartmentController extends BaseController { + @Autowired + private SysDepartmentAppService sysDepartmentAppService; + + @PostMapping("/save") + public Result save(@RequestBody SysDepartmentAppAddReqDTO req){ + + return sysDepartmentAppService.save(req,getCurrentUserId()); + } + @PostMapping("/update") + public Result update(@RequestBody SysDepartmentAppUpdateReqDTO req){ + return sysDepartmentAppService.update(req,getCurrentUserId()); + } + @PostMapping("/delete") + public Result delete(@RequestBody JSONObject jsonObject){ + return sysDepartmentAppService.delete(jsonObject.getLong("id"),getCurrentUserId()); + } + @GetMapping("/list") + public Result list(){ + return sysDepartmentAppService.list(); + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/UserController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/UserController.java new file mode 100644 index 0000000..e1e473f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/UserController.java @@ -0,0 +1,116 @@ +package com.gkhy.labRiskManage.api.controller.account; + +import com.gkhy.labRiskManage.api.controller.account.converter.UserInfoApiConverter; +import com.gkhy.labRiskManage.api.controller.account.dto.req.LoginReqDTO; +import com.gkhy.labRiskManage.api.controller.account.dto.req.UserSearchReqDTO; +import com.gkhy.labRiskManage.api.controller.account.dto.resp.UserInfoApiDTO; +import com.gkhy.labRiskManage.api.controller.account.query.UserQuery; +import com.gkhy.labRiskManage.application.account.dto.repDto.ChangePasswdReqDto; +import com.gkhy.labRiskManage.application.account.dto.repDto.CreateNewUserAppReqDTO; +import com.gkhy.labRiskManage.application.account.dto.repDto.LoginReqAppDTO; +import com.gkhy.labRiskManage.application.account.dto.repDto.UpdateUserAppReqDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserInfoAppRespDTO; +import com.gkhy.labRiskManage.application.account.service.AccountAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.commons.utils.PageUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.parameters.P; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/account/user") +public class UserController { + + @Autowired + private AccountAppService accountAppService; + + @Autowired + private UserInfoApiConverter userInfoApiConverter; + + @PostMapping("/add") + public Result createNewUser(@RequestBody CreateNewUserAppReqDTO reqDto){ + Result result = accountAppService.createNewUser(reqDto); + return result; + } + + @GetMapping("/find/list/realName") + public SearchResult findUsersByName(@RequestParam String name){ + SearchResult<List<UserInfoApiDTO>> result = new SearchResult<>(); + result.setSuccess(); + SearchResult sr = accountAppService.findUserByRealName(name); + if(sr.getData() != null && sr.getCount() > 0){ + result.setData(userInfoApiConverter.toApiDtoList((List<UserInfoAppRespDTO>) sr.getData())); + result.setCount(sr.getCount()); + } + return result; + } + @PostMapping("/find/user/list") + public SearchResult findUser(@RequestBody PageQuery<UserQuery> pageQuery){ + SearchResult<List<UserInfoApiDTO>> result = new SearchResult<>(); + result.setSuccess(); + SearchResult<List<UserInfoAppRespDTO>> sr = accountAppService.findUser(pageQuery); + PageUtils.checkCheck(pageQuery); + if(sr != null){ + BeanUtils.copyProperties(sr,result); + result.setData(userInfoApiConverter.toApiDtoList((List<UserInfoAppRespDTO>) sr.getData())); + } + return result; + } + + /** + * 专家库 + * @param pageQuery + * @return + */ + @PostMapping("/find/expert/list") + public SearchResult findExpert(@RequestBody PageQuery<UserQuery> pageQuery){ + SearchResult<List<UserInfoApiDTO>> result = new SearchResult<>(); + result.setSuccess(); + SearchResult<List<UserInfoAppRespDTO>> sr = accountAppService.findExpert(pageQuery); + PageUtils.checkCheck(pageQuery); + if(sr != null){ + BeanUtils.copyProperties(sr,result); + result.setData(userInfoApiConverter.toApiDtoList((List<UserInfoAppRespDTO>) sr.getData())); + } + return result; + } + + @PostMapping("/find/list/roleId") + public SearchResult findUserByRole(@RequestBody UserSearchReqDTO searchReqDTO){ + SearchResult<List<UserInfoApiDTO>> result = new SearchResult<>(); + result.setSuccess(); + SearchResult<List<UserInfoAppRespDTO>> sr = accountAppService.findUserByRole(searchReqDTO.getRoleId(), + searchReqDTO.getUsePage(),searchReqDTO.getPageIndex(),searchReqDTO.getPageSize()); + if(sr != null){ + BeanUtils.copyProperties(sr,result); + result.setData(userInfoApiConverter.toApiDtoList((List<UserInfoAppRespDTO>) sr.getData())); + } + return result; + } + + @GetMapping("/deleteUser") + public Result deleteUser(@RequestParam Long userId){ + Result result = accountAppService.deleteUser(userId); + return result; + } + + @PostMapping("/update/info") + public Result updateUserInfo(@RequestBody UpdateUserAppReqDTO updateDto){ + Result result = accountAppService.updateUser(updateDto); + return result; + } + /** + * 修改用户密码 + */ + @PostMapping("/update/password") + public Result updatePassword(@RequestBody ChangePasswdReqDto changePasswdReqDto){ + Result result = accountAppService.updateUserPassword(changePasswdReqDto); + return result; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/UserIndentityController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/UserIndentityController.java new file mode 100644 index 0000000..1cf9606 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/UserIndentityController.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.api.controller.account; + +import com.gkhy.labRiskManage.api.controller.account.converter.UserIdentityApiConverter; +import com.gkhy.labRiskManage.api.controller.account.dto.resp.UserIdentityApiDTO; +import com.gkhy.labRiskManage.api.controller.account.dto.resp.UserInfoApiDTO; +import com.gkhy.labRiskManage.api.controller.account.query.UserQuery; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserIndentityAppDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserInfoAppRespDTO; +import com.gkhy.labRiskManage.application.account.service.UserIdentityAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.commons.utils.PageUtils; +import com.gkhy.labRiskManage.domain.account.converter.UserIdentityConverter; +import com.gkhy.labRiskManage.domain.account.entity.UserIdentity; +import org.springframework.beans.BeanUtils; +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; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 13:40 + */ +@RestController +@RequestMapping("/account/user/identity") +public class UserIndentityController { + + @Autowired + private UserIdentityApiConverter userIdentityApiConverter; + @Autowired + private UserIdentityAppService userIdentityAppService; + + @PostMapping("/list") + public Result findUser(){ + Result<List<UserIdentityApiDTO>> result = new Result<>(); + result.setSuccess(); + List<UserIndentityAppDTO> list = userIdentityAppService.list(); + result.setData(userIdentityApiConverter.toApiDtoList(list)); + return result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/converter/UserIdentityApiConverter.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/converter/UserIdentityApiConverter.java new file mode 100644 index 0000000..a4cb622 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/converter/UserIdentityApiConverter.java @@ -0,0 +1,27 @@ +package com.gkhy.labRiskManage.api.controller.account.converter; + +import com.gkhy.labRiskManage.api.controller.account.dto.resp.UserIdentityApiDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserIndentityAppDTO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 13:44 + */ +@Component +public class UserIdentityApiConverter { + public List<UserIdentityApiDTO> toApiDtoList(List<UserIndentityAppDTO> list) { + List<UserIdentityApiDTO> respList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(list)){ + respList = BeanCopyUtils.copyBeanList(list,UserIdentityApiDTO.class); + } + return respList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/converter/UserInfoApiConverter.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/converter/UserInfoApiConverter.java new file mode 100644 index 0000000..a45019c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/converter/UserInfoApiConverter.java @@ -0,0 +1,54 @@ +package com.gkhy.labRiskManage.api.controller.account.converter; + +import com.gkhy.labRiskManage.api.controller.account.dto.resp.UserIdentityBindApiDTO; +import com.gkhy.labRiskManage.api.controller.account.dto.resp.UserInfoApiDTO; +import com.gkhy.labRiskManage.api.controller.account.dto.resp.UserRoleBindApiDTO; +import com.gkhy.labRiskManage.api.controller.attachment.dto.resp.AttachmentApiRespDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserInfoAppRespDTO; +import com.gkhy.labRiskManage.application.attachment.service.dto.resp.AttachmentAppRespDTO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class UserInfoApiConverter { + + public UserInfoApiDTO toApiDto(UserInfoAppRespDTO appDto){ + if(appDto == null) + return null; + UserInfoApiDTO apiDTO = new UserInfoApiDTO(); + BeanUtils.copyProperties(appDto,apiDTO); + //角色 + List<UserRoleBindApiDTO> userRoleBindApiDTOS = new ArrayList<>(); + if(appDto.getRoles() != null){ + userRoleBindApiDTOS = BeanCopyUtils.copyBeanList(appDto.getRoles(), UserRoleBindApiDTO.class); + } + apiDTO.setRoles(userRoleBindApiDTOS); + //身份 + List<UserIdentityBindApiDTO> userIdentityBindApiDTOS = new ArrayList<>(); + if(appDto.getUserIdentities() != null){ + userIdentityBindApiDTOS = BeanCopyUtils.copyBeanList(appDto.getUserIdentities(), UserIdentityBindApiDTO.class); + } + //资质附件 + if(appDto.getQualificationAttaAppRespDTO() != null){ + AttachmentApiRespDTO attachmentApiRespDTO = new AttachmentApiRespDTO(); + BeanUtils.copyProperties(appDto.getQualificationAttaAppRespDTO(),attachmentApiRespDTO); + apiDTO.setQualificationAttApiRespDTO(attachmentApiRespDTO); + } + apiDTO.setUserIdentities(userIdentityBindApiDTOS); + return apiDTO; + } + + public List<UserInfoApiDTO> toApiDtoList(List<UserInfoAppRespDTO> appDtoList){ + if(appDtoList == null || appDtoList.isEmpty()) + return null; + List<UserInfoApiDTO> apiDtoList = new ArrayList<>(); + appDtoList.forEach(appDto -> { + apiDtoList.add(toApiDto(appDto)); + }); + return apiDtoList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/AddRoleApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/AddRoleApiDTO.java new file mode 100644 index 0000000..df882b9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/AddRoleApiDTO.java @@ -0,0 +1,14 @@ +package com.gkhy.labRiskManage.api.controller.account.dto.req; + +public class AddRoleApiDTO { + + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/LoginReqDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/LoginReqDTO.java new file mode 100644 index 0000000..d32c447 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/LoginReqDTO.java @@ -0,0 +1,24 @@ +package com.gkhy.labRiskManage.api.controller.account.dto.req; + +public class LoginReqDTO { + + private String name; + + private String pwd; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPwd() { + return pwd; + } + + public void setPwd(String pwd) { + this.pwd = pwd; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/ModRoleApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/ModRoleApiDTO.java new file mode 100644 index 0000000..1feb565 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/ModRoleApiDTO.java @@ -0,0 +1,24 @@ +package com.gkhy.labRiskManage.api.controller.account.dto.req; + +public class ModRoleApiDTO { + + private Long roleId; + + private String name; + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/UserSearchReqDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/UserSearchReqDTO.java new file mode 100644 index 0000000..f2152fa --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/req/UserSearchReqDTO.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.api.controller.account.dto.req; + +public class UserSearchReqDTO { + + private String name; + + private String realName; + + private Long roleId; + + private Boolean usePage; + + private Integer pageSize; + + private Integer pageIndex; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public Boolean getUsePage() { + return usePage; + } + + public void setUsePage(Boolean usePage) { + this.usePage = usePage; + } + + 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; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserIdentityApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserIdentityApiDTO.java new file mode 100644 index 0000000..ebb4c97 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserIdentityApiDTO.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.api.controller.account.dto.resp; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 13:42 + */ +@Data +public class UserIdentityApiDTO { + private Long id ; + private String identity; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserIdentityBindApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserIdentityBindApiDTO.java new file mode 100644 index 0000000..4ab6048 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserIdentityBindApiDTO.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.api.controller.account.dto.resp; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 10:32 + */ +@Data +public class UserIdentityBindApiDTO { + private Long userIdentityId; + private String userIdentity; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserInfoApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserInfoApiDTO.java new file mode 100644 index 0000000..cc6a939 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserInfoApiDTO.java @@ -0,0 +1,42 @@ +package com.gkhy.labRiskManage.api.controller.account.dto.resp; + +import com.gkhy.labRiskManage.api.controller.attachment.dto.resp.AttachmentApiRespDTO; +import lombok.Data; + +import java.util.List; +@Data +public class UserInfoApiDTO { + + private Long id; + + //所属角色ID + /* private Long roleId;*/ + + private String name; + + //真实姓名 + private String realName; + + private String phone; + + private Byte idType; + + private String idSerial; + + private Long depId; + private String depName; + /** + * 身份(0专家,1非专家) + */ + private Byte identityStatus; + //资质证书id + private Long qualificationAttId; + + private List<UserRoleBindApiDTO> roles; + + private List<UserIdentityBindApiDTO> userIdentities; + + private AttachmentApiRespDTO qualificationAttApiRespDTO; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserRoleBindApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserRoleBindApiDTO.java new file mode 100644 index 0000000..b7a9c06 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/dto/resp/UserRoleBindApiDTO.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.api.controller.account.dto.resp; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 10:46 + */ +@Data +public class UserRoleBindApiDTO { + private Long roleId; + private String roleName; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/account/query/UserQuery.java b/src/main/java/com/gkhy/labRiskManage/api/controller/account/query/UserQuery.java new file mode 100644 index 0000000..0770e06 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/account/query/UserQuery.java @@ -0,0 +1,22 @@ +package com.gkhy.labRiskManage.api.controller.account.query; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/21 + * @time: 9:39 + */ +@Data +public class UserQuery { + + private String name; + + private String realName; + + private Long roleId; + + private Long userIndentityId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/attachment/AttachmentController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/attachment/AttachmentController.java new file mode 100644 index 0000000..1e0784b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/attachment/AttachmentController.java @@ -0,0 +1,133 @@ +package com.gkhy.labRiskManage.api.controller.attachment; +import com.gkhy.labRiskManage.api.controller.attachment.converter.AttachmentApiConverter; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.application.attachment.service.AttachmentAppService; +import com.gkhy.labRiskManage.application.attachment.service.dto.resp.AttachmentAppRespDTO; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.domain.attachment.enums.FileProjectConstants; +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; + + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/6 + * @time: 14:22 + */ +@RestController +@RequestMapping("/attachment") +public class AttachmentController extends BaseController { + + @Autowired + private AttachmentAppService attachmentAppService; + @Autowired + private AttachmentApiConverter converter; + + /** + * 根据标识查询文件具体信息 + * @param key + * @return + */ + @GetMapping("/get/{key}") + public Result get(@PathVariable String key) { + AttachmentAppRespDTO byKey = attachmentAppService.findByKey(key); + return new Result(ResultCode.OK, converter.getApiRespDTO(byKey)); + } + + /** + * 根据id获取文件 + * @param id + * @return + */ + @GetMapping("/get/{id}") + public Result get(@PathVariable Long id) { + AttachmentAppRespDTO byId = attachmentAppService.findById(id); + return new Result(ResultCode.OK,converter.getApiRespDTO(byId)); + } + + + /** + * 删除文件数据 + * @param id + * @return + */ + @DeleteMapping("/delete/{id}") + public Result delete(@PathVariable Long id) { + attachmentAppService.delete(id); + return Result.success(); + } + + + + /** + * @Description 上传文件(返回文件标识) + * @Param [file, module] + **/ + @PostMapping("/upload/key") + public Result uploadReturnKey(@RequestParam("file") MultipartFile + file, @RequestParam("module") String module) { + Object returnStr = attachmentAppService.saveFileToPath(file, module, FileProjectConstants.ReturnType.KEY,getCurrentUserId()); + return new Result(ResultCode.OK,returnStr); + } + + /** + * @Description 上传文件(返回文件信息) + * @Param [file, module] + **/ + @PostMapping("/upload/detail") + public Result uploadReturnDetail(@RequestParam("file") MultipartFile + file, @RequestParam("module") String module) { + Object detail = attachmentAppService.saveFileToPath(file, module, FileProjectConstants.ReturnType.DETAIL,getCurrentUserId()); + return new Result(ResultCode.OK,detail); + } + /** + * @Description 上传文件(返回访问路径) + * @Date 2021/4/20 19:28 + * @Param [file, module] + **/ + @PostMapping("/upload/url") + public Result uploadReturnUrl(@RequestParam("file") MultipartFile file, @RequestParam("module") String module) { + Object returnStr = attachmentAppService.saveFileToPath(file, module, FileProjectConstants.ReturnType.URL,getCurrentUserId()); + return new Result(ResultCode.OK,returnStr); + } + + /** + * @return org.springframework.http.ResponseEntity<byte [ ]> + * @Description 获取下载文件流 + * @Param [key] + **/ + @GetMapping("/downloadFile/{key}") + public void download(@PathVariable String key, HttpServletResponse response) { + attachmentAppService.downloadForStream(response, key); + } + + /** + * @return void + * @Description 文件下载(改写) + * @Param [key, response, request] + **/ + @RequestMapping(value = "/downloadFileByKey/{key}", method = {RequestMethod.POST, RequestMethod.GET}) + public void downloadFileByKey(@PathVariable String key, HttpServletResponse response, HttpServletRequest + request) { + attachmentAppService.downloadByKey(response, request, key); + } + + + /** + * @Description 获取下载文件路径 + * @Param [key] + **/ + @GetMapping("/downloadUrl/{key}") + public Result downLoad( @PathVariable String key) { + AttachmentAppRespDTO byKey = attachmentAppService.findByKey(key); + return new Result(ResultCode.OK,byKey.getFileUrl()); + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/attachment/converter/AttachmentApiConverter.java b/src/main/java/com/gkhy/labRiskManage/api/controller/attachment/converter/AttachmentApiConverter.java new file mode 100644 index 0000000..06d86ab --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/attachment/converter/AttachmentApiConverter.java @@ -0,0 +1,28 @@ +package com.gkhy.labRiskManage.api.controller.attachment.converter; + +import com.gkhy.labRiskManage.api.controller.attachment.dto.resp.AttachmentApiRespDTO; +import com.gkhy.labRiskManage.application.attachment.service.dto.resp.AttachmentAppRespDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 16:55 + */ +@Component +public class AttachmentApiConverter { + + public AttachmentApiRespDTO getApiRespDTO(AttachmentAppRespDTO appRespDTO){ + if (appRespDTO == null){ + return null; + } + AttachmentApiRespDTO attachmentApiRespDTO = new AttachmentApiRespDTO(); + BeanUtils.copyProperties(appRespDTO,attachmentApiRespDTO); + return attachmentApiRespDTO; + } + + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/attachment/dto/resp/AttachmentApiRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/attachment/dto/resp/AttachmentApiRespDTO.java new file mode 100644 index 0000000..3bccb45 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/attachment/dto/resp/AttachmentApiRespDTO.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.api.controller.attachment.dto.resp; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 16:54 + */ +@Data +public class AttachmentApiRespDTO { + private Long id; + //文件标识 + private String fileKey; + //文件本地址 + private String filePath; + //文件访问路径 + private String fileUrl; + //文件名称 + private String fileName; + //文件后缀 + private String fileSuffix; + //文件描述 + private String fileDesc; + //文件大小 + private Long fileSize; + //文件类型 + private String fileType; + //模块 + private String module; + //删除标识 0-未删除,1-删除 + private Integer delFlag; + //创建时间 + private LocalDateTime createTime; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime updateTime; + //修改人id + private Long updateUid; + //修改人姓名 + private String updateUname; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicDictionaryController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicDictionaryController.java new file mode 100644 index 0000000..2632b3b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicDictionaryController.java @@ -0,0 +1,100 @@ +package com.gkhy.labRiskManage.api.controller.basic; + +import com.gkhy.labRiskManage.application.basic.service.DictionaryAppService; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceTypeDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitTypeDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteTypeDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.TipDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 基础字典 + * */ +@RestController +@RequestMapping("basic") +public class BasicDictionaryController { + + @Autowired + private DictionaryAppService dictionaryService; + + + /** + * 基础字典 - 场所类型 + * */ + @GetMapping("/select/listSiteType") + public SearchResult<SiteTypeDTO> listSiteType(){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + List<SiteTypeDTO> siteTypeDTO = dictionaryService.listSiteType(); + + result.setData(siteTypeDTO); + result.setCount(siteTypeDTO.size()); + + return result; + } + + /** + * 基础字典 - 风险类型 + * */ + @GetMapping("/select/listRiskUnitType") + public SearchResult<RiskUnitTypeDTO> listRiskUnitType(){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + List<RiskUnitTypeDTO> riskUnitTypeDTOS = dictionaryService.listRiskUnitType(); + + result.setData(riskUnitTypeDTOS); + result.setCount(riskUnitTypeDTOS.size()); + + return result; + } + + /** + * 基础字典 - 设备类型 + * */ + @GetMapping("/select/listDeviceType") + public SearchResult<DeviceTypeDTO> listDeviceType(){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + List<DeviceTypeDTO> deviceTypeDTOS = dictionaryService.listDeviceType(); + + result.setData(deviceTypeDTOS); + result.setCount(deviceTypeDTOS.size()); + + return result; + } + + + /** + * 基础字典 - 友情提示 + * */ + @GetMapping("/select/listTip") + public SearchResult<TipDTO> listTip(){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + List<TipDTO> tipDTO = dictionaryService.listTip(); + + result.setData(tipDTO); + result.setCount(tipDTO.size()); + + return result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentDeviceController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentDeviceController.java new file mode 100644 index 0000000..1ba8053 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentDeviceController.java @@ -0,0 +1,161 @@ +package com.gkhy.labRiskManage.api.controller.basic; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentDeviceInsertReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentDeviceQueryReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentDeviceUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentDeviceQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentDeviceAppQueryDTO; +import com.gkhy.labRiskManage.application.basic.service.BasicAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceQueryDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentDeviceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 基础仪器设备表 + * */ +@RestController +@RequestMapping("basic") +public class BasicExperimentDeviceController extends BaseController { + + @Autowired + private BasicAppService basicAppService; + + + @Autowired + private BasicExperimentDeviceService basicExperimentDeviceService; + + /** + * 基础仪器设备表 - 新增 + * */ + @PostMapping("/insert/insertDevice") + public Result insertBasicExperimentDevice(@RequestBody BasicExperimentDeviceInsertReqBO basicDeviceReqDO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + + int insertResult = basicAppService.insertBasicExperimentDevice(getCurrentUserId(), basicDeviceReqDO); + + result.setCount(insertResult); + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("新增失败"); + } + result.setCount(insertResult); + + return result; + } + + /** + * 基础仪器设备表 - 分页查询 + * */ + @PostMapping("/select/getDevicePage") + public SearchResult<BasicExperimentDeviceQueryRespDTO> getBasicExperimentDevicePage(@RequestBody BasicExperimentDeviceQueryReqBO queryReqDO){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicExperimentDeviceAppQueryDTO> deviceAppQueryDTO = basicAppService.getBasicExperimentDevicePage(getCurrentUserId(), queryReqDO); + + Object data = deviceAppQueryDTO.getData(); + + result.setPageIndex(deviceAppQueryDTO.getPageIndex()); + result.setPageSize(deviceAppQueryDTO.getPageSize()); + result.setTotal(deviceAppQueryDTO.getTotal()); + result.setCount(deviceAppQueryDTO.getTotal().intValue()); + + result.setData(BeanCopyUtils.copyDeviceQueryRespList(data, BasicExperimentDeviceQueryRespDTO.class)); + + return result; + } + + /** + * 基础仪器设备表 - 修改 + * */ + @PostMapping("/update/updateDevice") + public Result updateBasicExperimentDevice(@RequestBody BasicExperimentDeviceUpdateReqBO deviceUpdateReqDO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("修改成功"); + + int updateResult = basicAppService.updateBasicExperimentDevice(getCurrentUserId(), deviceUpdateReqDO); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改失败"); + } + result.setCount(updateResult); + + return result; + } + + /** + * 基础仪器设备表 - 删除 + * */ + @PostMapping("/delete/deleteDevice") + public Result deleteBasicExperimentDevice(@RequestBody JSONObject jsonObject){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("删除成功"); + + int deleteResult = basicAppService.deleteBasicExperimentDevice(getCurrentUserId(), jsonObject.getLong("id")); + + if (deleteResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("删除失败"); + } + result.setCount(deleteResult); + + return result; + } + + /** + * 基础仪器设备表 - 设备列表 + * */ + @GetMapping("/select/listDevice") + public SearchResult<BasicExperimentDeviceQueryRespDTO> listBasicExperimentDevice(){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicExperimentDeviceAppQueryDTO> deviceAppListResp = basicAppService.listBasicExperimentDevice(getCurrentUserId()); + Object data = deviceAppListResp.getData(); + + result.setData(BeanCopyUtils.copyDeviceListRespList(data, BasicExperimentDeviceQueryRespDTO.class)); + result.setCount(deviceAppListResp.getCount()); + + return result; + } + + + /** + * 基础仪器设备表 - 设备列表 + * */ + @PostMapping("/select/testBatch") + public SearchResult<BasicExperimentDeviceQueryRespDTO> testBatch(@RequestBody List<Long> ids){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + List<DeviceQueryDTO> list = basicExperimentDeviceService.getBasicExperimentDeviceByIdList(ids); + + result.setData(list); + return result; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentPersonController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentPersonController.java new file mode 100644 index 0000000..c1b563a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentPersonController.java @@ -0,0 +1,134 @@ +package com.gkhy.labRiskManage.api.controller.basic; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentPersonInsertReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentPersonQueryReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentPersonUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentPersonListRespDTO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentPersonQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentPersonAppListDTO; +import com.gkhy.labRiskManage.application.basic.service.BasicAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 基础实验人员管理 + */ +@RestController +@RequestMapping("basic") +public class BasicExperimentPersonController extends BaseController { + + @Autowired + private BasicAppService basicAppService; + + /** + * 基础实验人员 - 插入 + * */ + @PostMapping("/insert/insertPerson") + public Result insertBasicExperimentPerson(@RequestBody BasicExperimentPersonInsertReqBO insertReqDO){ + Result result = new Result<>(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + + int insertResult = basicAppService.insertBasicExperimentPerson(getCurrentUserId(), insertReqDO); + result.setCount(insertResult); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("新增失败"); + } + result.setCount(insertResult); + + return result; + } + + /** + * 基础实验人员 - 分页查询 + * */ + @PostMapping("/select/selectPersonPage") + public SearchResult<BasicExperimentPersonQueryRespDTO> getBasicExperimentPersonPage(@RequestBody BasicExperimentPersonQueryReqBO queryReqDO){ + SearchResult result = new SearchResult<>(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicExperimentPersonAppQueryBO> personPage = basicAppService.getBasicExperimentPersonPage(getCurrentUserId(), queryReqDO); + + Object data = personPage.getData(); + + result.setData(BeanCopyUtils.copyPersonQueryRespList(data, BasicExperimentPersonQueryRespDTO.class)); + result.setPageIndex(personPage.getPageIndex()); + result.setPageSize(personPage.getPageSize()); + result.setTotal(personPage.getTotal()); + result.setCount(personPage.getTotal().intValue()); + + return result; + } + + /** + * 基础实验人员 - 修改 + * */ + @PostMapping("/update/updatePerson") + public Result updateBasicExperimentPerson(@RequestBody BasicExperimentPersonUpdateReqBO updateReqDO){ + Result result = new Result<>(); + result.setCode(ResultCode.OK); + result.setMsg("修改成功"); + + int updateResult = basicAppService.updateBasicExperimentPerson(getCurrentUserId(), updateReqDO); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改失败"); + } + result.setCount(updateResult); + + return result; + } + + /** + * 基础实验人员 - 删除 + * */ + @PostMapping("/delete/deletePerson") + public Result deleteBasicExperimentPerson(@RequestBody JSONObject jsonObject){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("删除成功"); + + int deleteResult = basicAppService.deleteBasicExperimentPerson(getCurrentUserId(), jsonObject.getLong("id")); + + result.setCount(deleteResult); + if (deleteResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("删除失败"); + } + result.setCount(deleteResult); + + return result; + } + + /** + * 基础实验人员 - 列表 + * */ + @GetMapping("/select/listPerson") + public SearchResult<BasicExperimentPersonListRespDTO> listBasicExperimentPerson(){ + SearchResult result = new SearchResult<>(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicExperimentPersonAppListDTO> listResult = basicAppService.listBasicExperimentPerson(getCurrentUserId()); + Object data = listResult.getData(); + + result.setData(BeanCopyUtils.copyPersonListQueryList(data, BasicExperimentPersonListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentRiskSourceTypeController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentRiskSourceTypeController.java new file mode 100644 index 0000000..c6a1f8e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentRiskSourceTypeController.java @@ -0,0 +1,41 @@ +package com.gkhy.labRiskManage.api.controller.basic; + +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentPersonListRespDTO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicRiskSourceTypeListRespDTO; +import com.gkhy.labRiskManage.application.basic.service.BasicAppService; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 基础实验风险类型 + */ +@RestController +@RequestMapping("basic") +public class BasicExperimentRiskSourceTypeController { + + @Autowired + private BasicAppService basicAppService; + + /** + * 基础实验风险 - 列表 + * */ + @GetMapping("/select/listRiskSourceType") + public SearchResult<BasicExperimentPersonListRespDTO> listRiskSourceType(){ + SearchResult result = new SearchResult<>(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicRiskSourceTypeListRespDTO> listResult = basicAppService.listRiskSourceType(); + Object data = listResult.getData(); + + result.setData(BeanCopyUtils.copyPersonListQueryList(data, BasicExperimentPersonListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentSiteController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentSiteController.java new file mode 100644 index 0000000..1e4df1f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentSiteController.java @@ -0,0 +1,128 @@ +package com.gkhy.labRiskManage.api.controller.basic; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentSiteInsertReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentSiteQueryReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentSiteUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentSiteListRespDTO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentSiteQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentSiteAppListDTO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentSiteAppQueryDTO; +import com.gkhy.labRiskManage.application.basic.service.BasicAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.redisson.api.redisnode.RedisSlave; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 基础实验场所管理 + */ +@RestController +@RequestMapping("basic") +public class BasicExperimentSiteController extends BaseController { + + @Autowired + private BasicAppService basicAppService; + + /** + * 基础场所管理 - 新增 + * */ + @PostMapping("/insert/insertSite") + public Result insertBasicExperimentSite(@RequestBody BasicExperimentSiteInsertReqBO insertReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + + int insertResult = basicAppService.insertBasicExperimentSite(getCurrentUserId(), insertReqBO); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("新增失败"); + } + result.setCount(insertResult); + return result; + } + + /** + * 基础场所管理 - 分页查询 + * */ + @PostMapping("/select/selectSitePage") + public SearchResult<BasicExperimentSiteQueryRespDTO> selectBasicExperimentSitePage(@RequestBody BasicExperimentSiteQueryReqBO queryReqBO){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicExperimentSiteAppQueryDTO> queryResult = basicAppService.selectBasicExperimentSitePage(getCurrentUserId(), queryReqBO); + + result.setData(BeanCopyUtils.copySiteQueryRespList(queryResult.getData(), BasicExperimentSiteQueryRespDTO.class)); + + result.setPageIndex(queryResult.getPageIndex()); + result.setPageSize(queryResult.getPageSize()); + result.setTotal(queryResult.getTotal()); + result.setCount(queryResult.getTotal().intValue()); + + return result; + } + + /** + * 基础场所管理 - 修改 + * */ + @PostMapping("/update/updateSite") + public Result updateBasicExperimentSite(@RequestBody BasicExperimentSiteUpdateReqBO updateReqBO){ + + Result result = new Result<>(); + result.setCode(ResultCode.OK); + result.setMsg("修改成功"); + + int updateResult = basicAppService.updateBasicExperimentSite(getCurrentUserId(), updateReqBO); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改失败"); + } + result.setCount(updateResult); + + return result; + } + + /** + * 基础场所管理 - 删除 + * */ + @PostMapping("/delete/deleteSite") + public Result deleteBasicExperimentSite(@RequestBody JSONObject jsonObject){ + Result result = new Result<>(); + result.setCode(ResultCode.OK); + result.setMsg("删除成功"); + + int deleteResult = basicAppService.deleteBasicExperimentSite(getCurrentUserId(), jsonObject.getLong("id")); + if (deleteResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("删除失败"); + } + result.setCount(deleteResult); + return result; + } + /** + * 基础场所管理 - 列表 + * */ + @GetMapping("/select/listSite") + public SearchResult<BasicExperimentSiteListRespDTO> listBasicExperimentSite(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicExperimentSiteAppListDTO> listResult = basicAppService.listBasicExperimentSite(getCurrentUserId()); + + result.setData(BeanCopyUtils.copySiteListQueryResp(listResult.getData(), BasicExperimentSiteListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentStuffController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentStuffController.java new file mode 100644 index 0000000..1caf648 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentStuffController.java @@ -0,0 +1,127 @@ +package com.gkhy.labRiskManage.api.controller.basic; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentStuffInsertReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentStuffQueryReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentStuffUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentSiteListRespDTO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentStuffListRespDTO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentStuffQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentStuffAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentStuffAppListDTO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentStuffAppQueryDTO; +import com.gkhy.labRiskManage.application.basic.service.BasicAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 基础实验耗材管理 + */ +@RestController +@RequestMapping("basic") +public class BasicExperimentStuffController extends BaseController { + + @Autowired + private BasicAppService basicAppService; + + /** + * 基础实验耗材管理 - 新增 + */ + @PostMapping("/insert/insertStuff") + public Result insertBasicExperimentStuff(@RequestBody BasicExperimentStuffInsertReqBO insertReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + + int insertResult = basicAppService.insertBasicExperimentStuff(getCurrentUserId(), insertReqBO); + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("新增失败"); + } + result.setCount(insertResult); + return result; + } + + /** + * 基础实验耗材管理 -分页查询 + */ + @PostMapping("/select/selectStuffPage") + public SearchResult<BasicExperimentStuffQueryRespDTO> selectBasicExperimentStuffPage(@RequestBody BasicExperimentStuffQueryReqBO queryReqBO){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicExperimentStuffAppQueryDTO> queryResult = basicAppService.selectBasicExperimentStuffPage(getCurrentUserId(), queryReqBO); + + result.setData(BeanCopyUtils.copyStuffQueryRespList(queryResult.getData(), BasicExperimentStuffQueryRespDTO.class)); + + result.setPageIndex(queryResult.getPageIndex()); + result.setPageSize(queryResult.getPageSize()); + result.setTotal(queryResult.getTotal()); + result.setCount(queryResult.getTotal().intValue()); + + return result; + } + + /** + * 基础实验耗材管理 - 修改 + */ + @PostMapping("/update/updateStuff") + public Result updateBasicExperimentStuff(@RequestBody BasicExperimentStuffUpdateReqBO updateReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("修改成功"); + + int updateResult = basicAppService.updateBasicExperimentStuff(getCurrentUserId(), updateReqBO); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改失败"); + } + result.setCount(updateResult); + return result; + } + + /** + * 基础实验耗材管理 - 删除 + */ + @PostMapping("/delete/deleteStuff") + public Result deleteBasicExperimentStuff(@RequestBody JSONObject jsonObject){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + int deleteResult = basicAppService.deleteBasicExperimentStuff(getCurrentUserId(), jsonObject.getLong("id")); + + if (deleteResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改失败"); + } + result.setCount(deleteResult); + return result; + } + + /** + * 基础实验耗材管理 - 列表 + */ + @GetMapping("/select/listStuff") + public SearchResult<BasicExperimentStuffListRespDTO> listBasicExperimentStuff(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicExperimentStuffAppListDTO> listResult= basicAppService.listBasicExperimentStuff(getCurrentUserId()); + + result.setData(BeanCopyUtils.copyStuffListQueryResp(listResult.getData(), BasicExperimentStuffListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentTypeController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentTypeController.java new file mode 100644 index 0000000..c0bd2c3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicExperimentTypeController.java @@ -0,0 +1,44 @@ +package com.gkhy.labRiskManage.api.controller.basic; + +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentStuffListRespDTO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentTypeListRespDTO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentTypeAppListDTO; +import com.gkhy.labRiskManage.application.basic.service.BasicAppService; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + + +/** + * 基础实验类型 + */ +@RestController +@RequestMapping("basic") +public class BasicExperimentTypeController { + + @Autowired + private BasicAppService basicAppService; + + /** + * 基础实验类型 - 列表 + */ + @GetMapping("/select/listExperimentType") + public SearchResult<BasicExperimentTypeListRespDTO> listBasicExperimentType(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicExperimentTypeAppListDTO> listResult= basicAppService.listBasicExperimentType(); + + result.setData(BeanCopyUtils.copyStuffListQueryResp(listResult.getData(), BasicExperimentStuffListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicRiskUnitController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicRiskUnitController.java new file mode 100644 index 0000000..ecdab20 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/BasicRiskUnitController.java @@ -0,0 +1,126 @@ +package com.gkhy.labRiskManage.api.controller.basic; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicRiskUnitInsertReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicRiskUnitQueryReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicRiskUnitUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicRiskUnitListRespDTO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicRiskUnitQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicRiskUnitAppListDTO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicRiskUnitAppQueryDTO; +import com.gkhy.labRiskManage.application.basic.service.BasicAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 基础风险单元管理 + */ +@RestController +@RequestMapping("basic") +public class BasicRiskUnitController extends BaseController { + + @Autowired + private BasicAppService basicAppService; + + /** + * 基础风险单元管理 - 插入 + */ // todo 此处部门信息?手输汉字? + @PostMapping("/insert/insertRiskUnit") + public Result insertBasicRiskUnit(@RequestBody BasicRiskUnitInsertReqBO insertReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + + int insertResult = basicAppService.insertBasicRiskUnit(getCurrentUserId(), insertReqBO); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("新增失败"); + } + result.setCount(insertResult); + return result; + } + + /** + * 基础风险单元管理 - 分页查询 + */ + @PostMapping("/select/selectRiskUnitPage") + public SearchResult<BasicRiskUnitQueryRespDTO> selectBasicRiskUnitPage(@RequestBody BasicRiskUnitQueryReqBO queryReqBO){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicRiskUnitAppQueryDTO> queryResult = basicAppService.selectBasicRiskUnitPage(getCurrentUserId(), queryReqBO); + result.setData(BeanCopyUtils.copyRiskUnitListQueryResp(queryResult.getData(), BasicRiskUnitQueryRespDTO.class)); + + result.setPageIndex(queryResult.getPageIndex()); + result.setPageSize(queryResult.getPageSize()); + result.setTotal(queryResult.getTotal()); + result.setCount(queryResult.getTotal().intValue()); + + return result; + } + + /** + * 基础风险单元管理 - 修改 + */ + @PostMapping("/update/updateRiskUnit") + public Result updateBasicRiskUnit(@RequestBody BasicRiskUnitUpdateReqBO updateReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("修改成功"); + + int updateResult = basicAppService.updateBasicRiskUnit(getCurrentUserId(), updateReqBO); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改失败"); + } + result.setCount(updateResult); + return result; + } + + /** + * 基础风险单元管理 - 删除 + */ + @PostMapping("/delete/deleteRiskUnit") + public Result deleteBasicRiskUnit(@RequestBody JSONObject jsonObject){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("删除成功"); + + int updateResult = basicAppService.deleteBasicRiskUnit(getCurrentUserId(), jsonObject.getLong("id")); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("删除失败"); + } + result.setCount(updateResult); + return result; + } + + /** + * 基础风险单元管理 - 列表 + */ + @GetMapping("/select/listRiskUnit") + public SearchResult<BasicRiskUnitListRespDTO> listBasicRiskUnit(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<BasicRiskUnitAppListDTO> listResult= basicAppService.listBasicRiskUnit(getCurrentUserId()); + + result.setData(BeanCopyUtils.copyRiskUnitRespList(listResult.getData(), BasicRiskUnitListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/FactorController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/FactorController.java new file mode 100644 index 0000000..b4d6e97 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/FactorController.java @@ -0,0 +1,195 @@ +package com.gkhy.labRiskManage.api.controller.basic; + +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.*; +import com.gkhy.labRiskManage.application.basic.dto.dto.*; +import com.gkhy.labRiskManage.application.basic.service.FactorAppService; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.dto.FactorMesSDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 风险评价因子 + */ +@RestController +@RequestMapping("basic") +public class FactorController { + + @Autowired + private FactorAppService factorAppService; + + /** + * 评价因子LEC-L 列表 + */ + @GetMapping("/select/listLecL") + public SearchResult<FactorLecLListRespDTO> listLecL(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorLecLAppListDTO> listResult= factorAppService.listLecL(); + + result.setData(BeanCopyUtils.copyFactorLecLQueryResp(listResult.getData(), FactorLecLListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + /** + * 评价因子LEC-E 列表 + */ + @GetMapping("/select/listLecE") + public SearchResult<FactorLecEListRespDTO> listLecE(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorLecEAppListDTO> listResult= factorAppService.listLecE(); + + result.setData(BeanCopyUtils.copyFactorLecEQueryResp(listResult.getData(), FactorLecEListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + /** + * 评价因子LEC-C 列表 + */ + @GetMapping("/select/listLecC") + public SearchResult<FactorLecCListRespDTO> listLecC(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorLecCAppListDTO> listResult= factorAppService.listLecC(); + + result.setData(BeanCopyUtils.copyFactorLecCQueryResp(listResult.getData(), FactorLecCListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + /** + * 评价因子LS-L 列表 + */ + @GetMapping("/select/listLsL") + public SearchResult<FactorLsLListRespDTO> listLsL(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorLsLAppListDTO> listResult= factorAppService.listLsL(); + + result.setData(BeanCopyUtils.copyFactorLsLQueryResp(listResult.getData(), FactorLsLListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + /** + * 评价因子LS-S 列表 + */ + @GetMapping("/select/listLsS") + public SearchResult<FactorLsSListRespDTO> listLsS(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorLsSAppListDTO> listResult= factorAppService.listLsS(); + + result.setData(BeanCopyUtils.copyFactorLsSQueryResp(listResult.getData(), FactorLsSListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + /** + * 评价因子Mes-M 列表 + */ + @GetMapping("/select/listMesM") + public SearchResult<FactorMesMListRespDTO> listMesM(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorMesMAppListDTO> listResult= factorAppService.listMesM(); + + result.setData(BeanCopyUtils.copyFactorMesMQueryResp(listResult.getData(), FactorMesMListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + /** + * 评价因子Mes-E 列表 + */ + @GetMapping("/select/listMesE") + public SearchResult<FactorMesEListRespDTO> listMesE(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorMesEAppListDTO> listResult= factorAppService.listMesE(); + + result.setData(BeanCopyUtils.copyFactorMesEQueryResp(listResult.getData(), FactorMesEListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + /** + * 评价因子Mes-S 列表 + */ + @GetMapping("/select/listMesS") + public SearchResult<FactorMesSListRespDTO> listMesS(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorMesSAppListDTO> listResult= factorAppService.listMesS(); + + result.setData(BeanCopyUtils.copyFactorMesSQueryResp(listResult.getData(), FactorMesSListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + /** + * 评价因子Rs-R 列表 + */ + @GetMapping("/select/listRsR") + public SearchResult<FactorRsRListRespDTO> listRsR(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorRsRAppListDTO> listResult= factorAppService.listRsR(); + + result.setData(BeanCopyUtils.copyFactorRsRQueryResp(listResult.getData(), FactorRsRListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + + /** + * 评价因子Rs-S 列表 + */ + @GetMapping("/select/listRsS") + public SearchResult<FactorRsSListRespDTO> listRsS(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<FactorRsSAppListDTO> listResult= factorAppService.listRsS(); + + result.setData(BeanCopyUtils.copyFactorRsSQueryResp(listResult.getData(), FactorRsSListRespDTO.class)); + result.setCount(listResult.getCount()); + + return result; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceInsertReqBO.java new file mode 100644 index 0000000..6a370bf --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceInsertReqBO.java @@ -0,0 +1,151 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +import java.time.LocalDateTime; + +public class BasicExperimentDeviceInsertReqBO { + + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceQueryReqBO.java new file mode 100644 index 0000000..967ae0b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceQueryReqBO.java @@ -0,0 +1,85 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +public class BasicExperimentDeviceQueryReqBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + 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 getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceUpdateReqBO.java new file mode 100644 index 0000000..cf07502 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentDeviceUpdateReqBO.java @@ -0,0 +1,161 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +import java.time.LocalDateTime; + +public class BasicExperimentDeviceUpdateReqBO { + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonInsertReqBO.java new file mode 100644 index 0000000..7a42600 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonInsertReqBO.java @@ -0,0 +1,118 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonInsertReqBO { + + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonQueryReqBO.java new file mode 100644 index 0000000..ebf8157 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonQueryReqBO.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonQueryReqBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 人员 + */ + private String personName; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + + 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 getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonUpdateReqBO.java new file mode 100644 index 0000000..1b10a07 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentPersonUpdateReqBO.java @@ -0,0 +1,127 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonUpdateReqBO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteInsertReqBO.java new file mode 100644 index 0000000..805e74d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteInsertReqBO.java @@ -0,0 +1,141 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteInsertReqBO { + + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteQueryReqBO.java new file mode 100644 index 0000000..7bade27 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteQueryReqBO.java @@ -0,0 +1,65 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteQueryReqBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + + 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 getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteUpdateReqBO.java new file mode 100644 index 0000000..4b62fbe --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentSiteUpdateReqBO.java @@ -0,0 +1,151 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteUpdateReqBO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffInsertReqBO.java new file mode 100644 index 0000000..d4989ae --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffInsertReqBO.java @@ -0,0 +1,72 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +import java.time.LocalDateTime; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentStuffInsertReqBO { + + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffQueryReqBO.java new file mode 100644 index 0000000..bb885ab --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffQueryReqBO.java @@ -0,0 +1,65 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentStuffQueryReqBO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + + 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 getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffUpdateReqBO.java new file mode 100644 index 0000000..01d2418 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicExperimentStuffUpdateReqBO.java @@ -0,0 +1,80 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentStuffUpdateReqBO { + + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitInsertReqBO.java new file mode 100644 index 0000000..2007f66 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitInsertReqBO.java @@ -0,0 +1,122 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 基础风险单元管理 + */ +public class BasicRiskUnitInsertReqBO{ + + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitQueryReqBO.java new file mode 100644 index 0000000..f27349a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitQueryReqBO.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础风险单元管理 + */ +public class BasicRiskUnitQueryReqBO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + + 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 getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitUpdateReqBO.java new file mode 100644 index 0000000..bac7e7d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/repDto/BasicRiskUnitUpdateReqBO.java @@ -0,0 +1,126 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.repDto; + +/** + * 基础风险单元管理 + */ +public class BasicRiskUnitUpdateReqBO { + + private Long id; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentDeviceListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentDeviceListRespDTO.java new file mode 100644 index 0000000..03f615d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentDeviceListRespDTO.java @@ -0,0 +1,161 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +public class BasicExperimentDeviceListRespDTO { + + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentDeviceQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentDeviceQueryRespDTO.java new file mode 100644 index 0000000..a380c95 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentDeviceQueryRespDTO.java @@ -0,0 +1,235 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.time.LocalDateTime; +import java.util.Date; + +public class BasicExperimentDeviceQueryRespDTO { + + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentPersonListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentPersonListRespDTO.java new file mode 100644 index 0000000..7ce71a4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentPersonListRespDTO.java @@ -0,0 +1,129 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonListRespDTO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentPersonQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentPersonQueryRespDTO.java new file mode 100644 index 0000000..f185c10 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentPersonQueryRespDTO.java @@ -0,0 +1,199 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonQueryRespDTO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentSiteListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentSiteListRespDTO.java new file mode 100644 index 0000000..70ae7e7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentSiteListRespDTO.java @@ -0,0 +1,152 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteListRespDTO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentSiteQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentSiteQueryRespDTO.java new file mode 100644 index 0000000..400ac20 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentSiteQueryRespDTO.java @@ -0,0 +1,223 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteQueryRespDTO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentStuffListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentStuffListRespDTO.java new file mode 100644 index 0000000..8b3feb4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentStuffListRespDTO.java @@ -0,0 +1,81 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class BasicExperimentStuffListRespDTO { + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentStuffQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentStuffQueryRespDTO.java new file mode 100644 index 0000000..d585845 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentStuffQueryRespDTO.java @@ -0,0 +1,151 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class BasicExperimentStuffQueryRespDTO { + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentTypeListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentTypeListRespDTO.java new file mode 100644 index 0000000..6ef62e4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicExperimentTypeListRespDTO.java @@ -0,0 +1,32 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class BasicExperimentTypeListRespDTO { + + private Long id; + /** + * 1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private String experimentType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getExperimentType() { + return experimentType; + } + + public void setExperimentType(String experimentType) { + this.experimentType = experimentType; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskSourceTypeListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskSourceTypeListRespDTO.java new file mode 100644 index 0000000..e92dc34 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskSourceTypeListRespDTO.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +/** + * 基本危险因素类型 + */ +public class BasicRiskSourceTypeListRespDTO { + + private Long id; + /** + * 危险源种类 + */ + private String riskSourceType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(String riskSourceType) { + this.riskSourceType = riskSourceType; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskUnitListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskUnitListRespDTO.java new file mode 100644 index 0000000..6ca1139 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskUnitListRespDTO.java @@ -0,0 +1,80 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class BasicRiskUnitListRespDTO { + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险单元描述 + */ + private String description; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskUnitQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskUnitQueryRespDTO.java new file mode 100644 index 0000000..b010647 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/BasicRiskUnitQueryRespDTO.java @@ -0,0 +1,221 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class BasicRiskUnitQueryRespDTO { + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 新建人姓名 + */ + private String liabilityUserName; + + public String getLiabilityUserName() { + return liabilityUserName; + } + + public void setLiabilityUserName(String liabilityUserName) { + this.liabilityUserName = liabilityUserName; + } + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getEvaluateStatus() { + return evaluateStatus; + } + + public void setEvaluateStatus(Byte evaluateStatus) { + this.evaluateStatus = evaluateStatus; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecCListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecCListRespDTO.java new file mode 100644 index 0000000..a078205 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecCListRespDTO.java @@ -0,0 +1,93 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + + +import java.math.BigDecimal; + +/** + * 评价因子LEC-C + */ +public class FactorLecCListRespDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-S-法律,法规及其它要求 + */ + private String desc; + /** + * LS-S-人员伤亡 + */ + private String person; + /** + * LS-S-直接经济损失 + */ + private String money; + /** + * LS-S-停工 + */ + private String stopWork; + /** + * LS-S-企业形象 + */ + private String company; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecEListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecEListRespDTO.java new file mode 100644 index 0000000..1009056 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecEListRespDTO.java @@ -0,0 +1,47 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子LEC-E + */ +public class FactorLecEListRespDTO implements Serializable { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-E-标准 + */ + private String desc; + + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecLListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecLListRespDTO.java new file mode 100644 index 0000000..f4a8116 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLecLListRespDTO.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.math.BigDecimal; + +/** + * 评价因子LEC—L + */ +public class FactorLecLListRespDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-L-事故发生的可能性 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLsLListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLsLListRespDTO.java new file mode 100644 index 0000000..b3d9ad1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLsLListRespDTO.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + + +import java.math.BigDecimal; + +/** + * 评价因子LS-L + */ +public class FactorLsLListRespDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-L-标准 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLsSListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLsSListRespDTO.java new file mode 100644 index 0000000..5a76c4b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorLsSListRespDTO.java @@ -0,0 +1,93 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.math.BigDecimal; + +/** + * 评价因子LS-S + */ +public class FactorLsSListRespDTO{ + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-S-法律,法规及其它要求 + */ + private String desc; + /** + * LS-S-人员伤亡 + */ + private String person; + /** + * LS-S-直接经济损失 + */ + private String money; + /** + * LS-S-停工 + */ + private String stopWork; + /** + * LS-S-企业形象 + */ + private String company; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesEListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesEListRespDTO.java new file mode 100644 index 0000000..21b9424 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesEListRespDTO.java @@ -0,0 +1,57 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.math.BigDecimal; + +/** + * 评价因子MES-E + */ +public class FactorMesEListRespDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-E-E1 + */ + private String e1Desc; + /** + * MES-E-E2 + */ + private String e2Desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getE1Desc() { + return e1Desc; + } + + public void setE1Desc(String e1Desc) { + this.e1Desc = e1Desc; + } + + public String getE2Desc() { + return e2Desc; + } + + public void setE2Desc(String e2Desc) { + this.e2Desc = e2Desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesMListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesMListRespDTO.java new file mode 100644 index 0000000..14e8627 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesMListRespDTO.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.math.BigDecimal; + +/** + * 评价因子MES-M + */ +public class FactorMesMListRespDTO{ + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-M-标准 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesSListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesSListRespDTO.java new file mode 100644 index 0000000..4962af1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorMesSListRespDTO.java @@ -0,0 +1,81 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.math.BigDecimal; + +/** + * 评价因子MES-S + */ +public class FactorMesSListRespDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-S-法律法规及其他要求 + */ + private String desc; + /** + * MES-S-人员伤亡 + */ + private String person; + /** + * MES-S-直接经济损失(万元) + */ + private String money; + /** + * MES-S-停工 + */ + private String stopWork; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorRsRListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorRsRListRespDTO.java new file mode 100644 index 0000000..79caa88 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorRsRListRespDTO.java @@ -0,0 +1,57 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + +import java.math.BigDecimal; + +/** + * 评价因子RS-R + */ +public class FactorRsRListRespDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-C-法律法规及其他要求 + */ + private String desc; + /** + * 区间,定量描述 + */ + private String section; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getSection() { + return section; + } + + public void setSection(String section) { + this.section = section; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorRsSListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorRsSListRespDTO.java new file mode 100644 index 0000000..dcab4db --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/basic/dto/respDto/FactorRsSListRespDTO.java @@ -0,0 +1,68 @@ +package com.gkhy.labRiskManage.api.controller.basic.dto.respDto; + + +/** + * 评价因子RS-S + */ +public class FactorRsSListRespDTO { + + private Long id; + /** + * 分值 + */ + private String value; + /** + * LEC-C-人员伤亡 + */ + private String person; + /** + * LEC-C-直接经济损失(万元) + */ + private String money; + /** + * LEC-C-法律法规及其他要求 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/common/BaseController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/common/BaseController.java new file mode 100644 index 0000000..685756f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/common/BaseController.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.api.controller.common; + +import com.gkhy.labRiskManage.config.authorization.TokenConfig; +import com.google.common.net.HttpHeaders; +import org.springframework.web.bind.annotation.ModelAttribute; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class BaseController { + + @Resource + protected TokenConfig tokenConfig; + + protected HttpServletRequest request; + protected HttpServletResponse response; + + @ModelAttribute + public void setReqAndResp(HttpServletRequest request, HttpServletResponse response){ + this.request = request; + this.response = response; + } + + protected Long getCurrentUserId(){ + String userId = this.request.getHeader(tokenConfig.getLoginUserHeader()); + if(userId == null || userId.isEmpty()) + return -1L; + try { + Long uid = Long.parseLong(userId); + return uid; + } catch (NumberFormatException e) { + return -1L; + } + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndDeviceController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndDeviceController.java new file mode 100644 index 0000000..714af0e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndDeviceController.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.api.controller.experiment; + +import org.springframework.web.bind.annotation.*; + + +/** + * 实验与设备 + */ +@RestController +@RequestMapping("experimentAndDevice") +public class ExperimentAndDeviceController { + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndPersonController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndPersonController.java new file mode 100644 index 0000000..c634555 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndPersonController.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.api.controller.experiment; + +import org.springframework.web.bind.annotation.*; + + +/** + * 实验与实验人员 + */ +@RestController +@RequestMapping("experimentAndPerson") +public class ExperimentAndPersonController { + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndStuffController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndStuffController.java new file mode 100644 index 0000000..bb2ee1e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentAndStuffController.java @@ -0,0 +1,14 @@ +package com.gkhy.labRiskManage.api.controller.experiment; + +import org.springframework.web.bind.annotation.*; + +/** + * 实验与耗材 + */ +@RestController +@RequestMapping("experimentAndStuff") +public class ExperimentAndStuffController { + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentHazardousWasteController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentHazardousWasteController.java new file mode 100644 index 0000000..e2f4dab --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentHazardousWasteController.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.api.controller.experiment; + +import org.springframework.web.bind.annotation.*; + + +/** + * 实验危废物 + */ +@RestController +@RequestMapping("experimentHazardousWaste") +public class ExperimentHazardousWasteController { + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentInfoController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentInfoController.java new file mode 100644 index 0000000..d9f28ad --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/ExperimentInfoController.java @@ -0,0 +1,258 @@ +package com.gkhy.labRiskManage.api.controller.experiment; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.api.controller.experiment.converter.ExperimentApiConverter; +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentDevelopUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentInfoQueryReqBO; +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentInsertReqBO; +import com.gkhy.labRiskManage.api.controller.experiment.dto.resp.*; +import com.gkhy.labRiskManage.application.experiment.dto.bo.*; +import com.gkhy.labRiskManage.application.experiment.dto.dto.*; +import com.gkhy.labRiskManage.application.experiment.service.ExperimentAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentInfo; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 实验信息 + */ +@RestController + @RequestMapping("experimentInfo") +public class ExperimentInfoController extends BaseController { + + @Autowired + private ExperimentAppService experimentAppService; + @Autowired + private ExperimentApiConverter converter; + + /** + * 录入信息 + * @param experimentInsertReqBO + * @return + */ + @PostMapping(value = "/save") + public Result save(@RequestBody ExperimentInsertReqBO experimentInsertReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + experimentAppService.save(getCurrentUserId(),experimentInsertReqBO); + return result; + } + /** + * 录入信息 + * @param experimentInsertReqBO + * @return + */ + @PostMapping(value = "develop/save") + public Result developSave(@RequestBody ExperimentInsertReqBO experimentInsertReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + experimentAppService.developSave(getCurrentUserId(),experimentInsertReqBO); + return result; + } + + @PostMapping(value = "rectify/save") + public Result rectifySave(@RequestBody ExperimentInsertReqBO experimentInsertReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("已申请整改"); + + int insertResult = experimentAppService.rectifySave(getCurrentUserId(),experimentInsertReqBO); + + result.setCount(insertResult); + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("申请整改失败"); + } + result.setCount(insertResult); + + return result; + } + /** + * 开展实验 + * @param developUpdateReqBOList + * @return + */ + @PostMapping(value = "/update/develop") + public Result updateDevelop(@RequestBody List<ExperimentDevelopUpdateReqBO> developUpdateReqBOList){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("实验开展成功"); + List<ExperimentAppDevelopUpdateBO> appDevelopUpdateBOList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(developUpdateReqBOList)) { + appDevelopUpdateBOList = BeanCopyUtils.copyBeanList(developUpdateReqBOList,ExperimentAppDevelopUpdateBO.class); + } + + int updateResult = experimentAppService.updateDevelop(getCurrentUserId(),appDevelopUpdateBOList); + result.setCount(updateResult); + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("实验开展失败"); + } + result.setCount(updateResult); + + return result; + } + + /** + * 申请评估 + * @param ids + * @return + */ + @PostMapping(value = "/update/apply/evaluation") + public Result applyEvaluation(@RequestBody List<Long> ids){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("申请成功"); + + int insertResult = experimentAppService.applyEvaluation(getCurrentUserId(),ids); + result.setCount(insertResult); + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("申请失败"); + } + result.setCount(insertResult); + + return result; + } + @PostMapping(value = "/update/revoke/apply/evaluation") + public Result revokeApplyEvaluation(@RequestBody List<Long> ids){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("撤销申请成功"); + + int insertResult = experimentAppService.revokeApplyEvaluation(getCurrentUserId(),ids); + result.setCount(insertResult); + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("撤销申请失败"); + } + result.setCount(insertResult); + + return result; + } + /** + * 删除 + * @param jsonObject + * @return + */ + @PostMapping(value = "/delete") + public Result delete(@RequestBody JSONObject jsonObject){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("删除成功"); + + int deleteResult = experimentAppService.deleteById(jsonObject.getLong("id"),getCurrentUserId()); + result.setCount(deleteResult); + if (deleteResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("删除失败"); + } + result.setCount(deleteResult); + return result; + } + + /** + * 新立项 + * @param pageQueryReqBO + * @return + */ + @PostMapping("/list/page/project") + public SearchResult<ExperimentInfoRespDTO> projectListByPage(@RequestBody PageQuery<ExperimentInfoQueryReqBO> pageQueryReqBO){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<List<ExperimentInfoAppQueryDTO>> searchResult = experimentAppService.projectListByPage(converter.getAppPageQuery(pageQueryReqBO),getCurrentUserId()); + List<ExperimentInfoAppQueryDTO> experimentInfoAppQueryDTOList = (List<ExperimentInfoAppQueryDTO>)searchResult.getData(); + result.setPageIndex(searchResult.getPageIndex()); + result.setPageSize(searchResult.getPageSize()); + result.setTotal(searchResult.getTotal()); + result.setCount(searchResult.getTotal().intValue()); + result.setPages(searchResult.getPages()); + + result.setData(converter.getExperimentInfoRespDTO(experimentInfoAppQueryDTOList)); + + return result; + } + + /** + * 已开展 + * @param pageQueryReqBO + * @return + */ + @PostMapping("/list/page/develop") + public SearchResult<ExperimentInfoRespDTO> developListByPage(@RequestBody PageQuery<ExperimentInfoQueryReqBO> pageQueryReqBO){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<List<ExperimentInfoAppQueryDTO>> searchResult = experimentAppService.developListByPage(converter.getAppPageQuery(pageQueryReqBO),getCurrentUserId()); + List<ExperimentInfoAppQueryDTO> experimentInfoAppQueryDTOList = (List<ExperimentInfoAppQueryDTO>)searchResult.getData(); + result.setPageIndex(searchResult.getPageIndex()); + result.setPageSize(searchResult.getPageSize()); + result.setTotal(searchResult.getTotal()); + result.setCount(searchResult.getTotal().intValue()); + result.setPages(searchResult.getPages()); + + result.setData(converter.getExperimentInfoRespDTO(experimentInfoAppQueryDTOList)); + + return result; + } + /** + * 获取实验列表 + */ + @GetMapping("/list") + public Result<ExperimentInfoVoRespDTO> getExperimentInfoList(){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + List<ExperimentInfoAppVo> experimentInfoAppVos = experimentAppService.getExperimentInfoList(getCurrentUserId()); + result.setData(converter.getExperimentInfoVoRespDTO(experimentInfoAppVos)); + return result; + } + /** + * 已申请评估分页 + * @param pageQueryReqBO + * @return + */ + @PostMapping("/list/page/apply/evaluation") + public SearchResult<ExperimentInfoRespDTO> applyEvaluationListByPage(@RequestBody PageQuery<ExperimentInfoQueryReqBO> pageQueryReqBO){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<List<ExperimentInfoAppQueryDTO>> searchResult = experimentAppService.applyEvaluationListByPage(converter.getAppPageQuery(pageQueryReqBO),getCurrentUserId()); + List<ExperimentInfoAppQueryDTO> experimentInfoAppQueryDTOList = (List<ExperimentInfoAppQueryDTO>)searchResult.getData(); + result.setPageIndex(searchResult.getPageIndex()); + result.setPageSize(searchResult.getPageSize()); + result.setTotal(searchResult.getTotal()); + result.setCount(searchResult.getTotal().intValue()); + result.setPages(searchResult.getPages()); + + result.setData(converter.getExperimentInfoRespDTO(experimentInfoAppQueryDTOList)); + + return result; + } + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/converter/ExperimentApiConverter.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/converter/ExperimentApiConverter.java new file mode 100644 index 0000000..4862bf5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/converter/ExperimentApiConverter.java @@ -0,0 +1,95 @@ +package com.gkhy.labRiskManage.api.controller.experiment.converter; + +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentInfoQueryReqBO; +import com.gkhy.labRiskManage.api.controller.experiment.dto.resp.*; +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentInfoAppQueryBO; +import com.gkhy.labRiskManage.application.experiment.dto.dto.ExperimentInfoAppQueryDTO; +import com.gkhy.labRiskManage.application.experiment.dto.dto.ExperimentInfoAppVo; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndEmergency; +import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentAndEmergencyDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/22 + * @time: 10:48 + */ +@Service +public class ExperimentApiConverter { + public List<ExperimentInfoRespDTO> getExperimentInfoRespDTO(List<ExperimentInfoAppQueryDTO> experimentInfoAppQueryDTOList){ + List<ExperimentInfoRespDTO> experimentInfoRespDTOS = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoAppQueryDTOList)){ + for (ExperimentInfoAppQueryDTO experimentInfoAppQueryDTO:experimentInfoAppQueryDTOList){ + ExperimentInfoRespDTO experimentInfoRespDTO = new ExperimentInfoRespDTO(); + BeanUtils.copyProperties(experimentInfoAppQueryDTO,experimentInfoRespDTO); + //实验场所 + List<ExperimentAndSiteRespDTO> siteRespDTOs = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoAppQueryDTO.getSites())){ + siteRespDTOs = BeanCopyUtils.copyBeanList(experimentInfoAppQueryDTO.getSites(),ExperimentAndSiteRespDTO.class); + } + experimentInfoRespDTO.setSiteList(siteRespDTOs); + //人员 + List<ExperimentAndPersonRespDTO> personRespDTOList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoAppQueryDTO.getPersons())){ + personRespDTOList = BeanCopyUtils.copyBeanList(experimentInfoAppQueryDTO.getPersons(),ExperimentAndPersonRespDTO.class); + } + experimentInfoRespDTO.setPersons(personRespDTOList); + //设备 + List<ExperimentAndDeviceRespDTO> deviceRespDTOList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoAppQueryDTO.getDevices())){ + deviceRespDTOList = BeanCopyUtils.copyBeanList(experimentInfoAppQueryDTO.getDevices(),ExperimentAndDeviceRespDTO.class); + } + experimentInfoRespDTO.setDeviceList(deviceRespDTOList); + //材料 + List<ExperimentAndStuffRespDTO> stuffRespDTOList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoAppQueryDTO.getStuffs())){ + stuffRespDTOList = BeanCopyUtils.copyBeanList(experimentInfoAppQueryDTO.getStuffs(),ExperimentAndStuffRespDTO.class); + } + experimentInfoRespDTO.setStuffList(stuffRespDTOList); + //危废 + List<ExperimentHazardousWasteRespDTO> wasteRespDTOList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoAppQueryDTO.getWastes())){ + wasteRespDTOList = BeanCopyUtils.copyBeanList(experimentInfoAppQueryDTO.getWastes(),ExperimentHazardousWasteRespDTO.class); + } + experimentInfoRespDTO.setHazardousWasteList(wasteRespDTOList); + + //应急演练 + List<ExperimentAndEmergencyRespDTO> emergencies = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoAppQueryDTO.getEmergencies())){ + emergencies = BeanCopyUtils.copyBeanList(experimentInfoAppQueryDTO.getEmergencies(),ExperimentAndEmergencyRespDTO.class); + } + experimentInfoRespDTO.setEmergencyList(emergencies); + experimentInfoRespDTOS.add(experimentInfoRespDTO); + } + } + return experimentInfoRespDTOS; + } + + public List<ExperimentInfoVoRespDTO> getExperimentInfoVoRespDTO(List<ExperimentInfoAppVo> experimentInfoAppVos) { + List<ExperimentInfoVoRespDTO> respDTOList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoAppVos)){ + respDTOList = BeanCopyUtils.copyBeanList(experimentInfoAppVos,ExperimentInfoVoRespDTO.class); + } + return respDTOList; + } + + public PageQuery<ExperimentInfoAppQueryBO> getAppPageQuery(PageQuery<ExperimentInfoQueryReqBO> pageQueryReqBO) { + PageQuery<ExperimentInfoAppQueryBO> appPageQuery = new PageQuery<>(); + appPageQuery.setPageIndex(pageQueryReqBO.getPageIndex()); + appPageQuery.setPageSize(pageQueryReqBO.getPageSize()); + ExperimentInfoAppQueryBO experimentInfoAppQueryBO = new ExperimentInfoAppQueryBO(); + if(!ObjectUtils.isEmpty(pageQueryReqBO.getSearchParams())){ + BeanUtils.copyProperties(pageQueryReqBO.getSearchParams(),experimentInfoAppQueryBO); + } + appPageQuery.setSearchParams(experimentInfoAppQueryBO); + return appPageQuery; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndDeviceInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndDeviceInsertReqBO.java new file mode 100644 index 0000000..8e24095 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndDeviceInsertReqBO.java @@ -0,0 +1,41 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:10 + */ +@Data +public class ExperimentAndDeviceInsertReqBO { + private Long deviceId; + + private Integer deviceUseCount; + + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * + */ + private Byte deviceUnit; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + + private String safeProtect; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndEmergencyInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndEmergencyInsertReqBO.java new file mode 100644 index 0000000..03065f3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndEmergencyInsertReqBO.java @@ -0,0 +1,35 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 13:16 + */ +@Data +public class ExperimentAndEmergencyInsertReqBO { + + private Long id; + /** + * 有无应急预案 + */ + private String emergencyPlan; + /** + * 预案名称 + */ + private String emergencyPlanName; + /** + * 是否演练 + */ + private String emergencyDrillStatus; + /** + * 应急演练情况 + */ + private String emergencyDrill; + /** + * 实验信息 + */ + private Long experimentId; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndPersonInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndPersonInsertReqBO.java new file mode 100644 index 0000000..16028a3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndPersonInsertReqBO.java @@ -0,0 +1,115 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +/** + * 基础实验人员管理 + */ +public class ExperimentAndPersonInsertReqBO { + + private Long personId; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 手机号 + */ + private Long phone; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + + public Long getPersonId() { + return personId; + } + + public void setPersonId(Long personId) { + this.personId = personId; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndSiteInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndSiteInsertReqBO.java new file mode 100644 index 0000000..2de93f6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndSiteInsertReqBO.java @@ -0,0 +1,27 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/20 + * @time: 14:54 + */ +@Data +public class ExperimentAndSiteInsertReqBO { + + private Long siteId; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndStuffInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndStuffInsertReqBO.java new file mode 100644 index 0000000..4587726 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentAndStuffInsertReqBO.java @@ -0,0 +1,89 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 16:14 + */ +public class ExperimentAndStuffInsertReqBO { + private Long stuffId; + private Integer stuffUseCount; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + public Long getStuffId() { + return stuffId; + } + + public void setStuffId(Long stuffId) { + this.stuffId = stuffId; + } + + public Integer getStuffUseCount() { + return stuffUseCount; + } + + public void setStuffUseCount(Integer stuffUseCount) { + this.stuffUseCount = stuffUseCount; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentApplyUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentApplyUpdateReqBO.java new file mode 100644 index 0000000..3d7da0e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentApplyUpdateReqBO.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 15:25 + */ +public class ExperimentApplyUpdateReqBO { + /** + * 实验id + */ + private Long id; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getSisStatus() { + return sisStatus; + } + + public void setSisStatus(Byte sisStatus) { + this.sisStatus = sisStatus; + } + + public String getSafeInformationSystem() { + return safeInformationSystem; + } + + public void setSafeInformationSystem(String safeInformationSystem) { + this.safeInformationSystem = safeInformationSystem; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentDevelopUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentDevelopUpdateReqBO.java new file mode 100644 index 0000000..2b9802b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentDevelopUpdateReqBO.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 15:25 + */ +public class ExperimentDevelopUpdateReqBO { + /** + * 实验id + */ + private Long id; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + + /** + * 开展时间 + * + */ + private LocalDateTime startTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getSisStatus() { + return sisStatus; + } + + public void setSisStatus(Byte sisStatus) { + this.sisStatus = sisStatus; + } + + public String getSafeInformationSystem() { + return safeInformationSystem; + } + + public void setSafeInformationSystem(String safeInformationSystem) { + this.safeInformationSystem = safeInformationSystem; + } + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentHazardousWasteInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentHazardousWasteInsertReqBO.java new file mode 100644 index 0000000..99b0de5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentHazardousWasteInsertReqBO.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 16:09 + */ +public class ExperimentHazardousWasteInsertReqBO { + /** + * 废弃物分类:1-有机;2-酸;3-碱性;4-固体废弃物;5-医疗废弃物;6-过期化学品;7-其他; + */ + private Byte classify; + /** + * 废弃物存储方式:1-吨袋;2-吨桶;3-小桶;4-托盘;5-其他; + */ + private Byte wasteStorage; + /** + * 预估处理量(计量单位:kg) + */ + private Double handAmount; + + public Byte getClassify() { + return classify; + } + + public void setClassify(Byte classify) { + this.classify = classify; + } + + public Byte getWasteStorage() { + return wasteStorage; + } + + public void setWasteStorage(Byte wasteStorage) { + this.wasteStorage = wasteStorage; + } + + public Double getHandAmount() { + return handAmount; + } + + public void setHandAmount(Double handAmount) { + this.handAmount = handAmount; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInfoQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInfoQueryReqBO.java new file mode 100644 index 0000000..b4fc567 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInfoQueryReqBO.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/26 + * @time: 14:46 + */ +public class ExperimentInfoQueryReqBO { + private LocalDateTime startTime; + private LocalDateTime endTime; + private Byte experimentType; + private String experimentName; + + 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 getExperimentType() { + return experimentType; + } + + public void setExperimentType(Byte experimentType) { + this.experimentType = experimentType; + } + + public String getExperimentName() { + return experimentName; + } + + public void setExperimentName(String experimentName) { + this.experimentName = experimentName; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInsertReqBO.java new file mode 100644 index 0000000..393ba27 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/req/ExperimentInsertReqBO.java @@ -0,0 +1,167 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.req; + +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndEmergency; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 15:25 + */ +@Data +public class ExperimentInsertReqBO { + private Long id; + + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long liabilityUserId; + private String liabilityUserPhone; + + /** + * 安全负责人id + */ + private Long safeLiabilityUserId; + private String safeLiabilityUser; + + private String safeLiabilityUserPhone; + + /** + * 部门 + */ + private String dep; + + /** + * 实验开始时间 + */ + private LocalDateTime startTime; + /** + * 实验立项时间 + */ + private LocalDateTime createExperimentTime; + /** + * 实验步骤 + */ + private String experimentStep; + /** + * 实验操作方法 + */ + private String experimentMethod; + /** + * 工艺流程 + */ + private String process; + /** + * 关键过程 + */ + private String keyProcess; + /** + * 是否存在过夜、老化实验。1-存在;2-不存在 + */ + private Byte timeout; + /** + * 过夜、老化实验保障管理措施 + */ + private String timeoutManager; + /** + * 是否在密闭条件下。1-密闭;2-不密闭 + */ + private Byte closed; + /** + * 非密闭实验保障管理措施 + */ + private String unclosedManager; + /** + * 实验场所防爆措施条件和设施情况 + */ + private String explosionProof; + /** + * 实验场所防火措施条件和设施情况 + */ + private String fireProof; + /** + * 实验场所防毒措施条件和设施情况 + */ + private String poisonProof; + /** + * 安全管理制度 + */ + private String safeManagerMethod; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + /** + * 分区隔断情况 + */ + private Byte partitionCondition; + /** + * 其他基础信息 + */ + private String note; + /** + * 实验评估状态:1-未评估;2-评估中;3-评估完成 + */ + private Byte stage; + /** + * 实验申请状态:1-未申请;2-已申请 + */ + private Byte status; + /** + * 实验标签:1-新立项;2-已开展 + */ + private Byte experimentTag; + /** + * 实验预期时间 + */ + private LocalDateTime create; + /** + * 措施 + */ + private String measure; + + /** + * 危废情况 + */ + private List<ExperimentHazardousWasteInsertReqBO> hazardousWasteList; + /** + * 实验耗材 + */ + private List<ExperimentAndStuffInsertReqBO> stuffList; + /** + * 试验设备 + */ + private List<ExperimentAndDeviceInsertReqBO> deviceList; + /** + * 实验人员 + */ + private List<ExperimentAndPersonInsertReqBO> persons; + + /** + * 实验场所 + * @return + */ + + private List<ExperimentAndSiteInsertReqBO> siteList; + + /** + * 演练情况 + */ + private List<ExperimentAndEmergencyInsertReqBO> emergencyList; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndDeviceRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndDeviceRespDTO.java new file mode 100644 index 0000000..e01ed5f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndDeviceRespDTO.java @@ -0,0 +1,104 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.resp; + +/** + * 实验与设备 + */ + +public class ExperimentAndDeviceRespDTO { + + + private Long deviceId; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 使用数量 + */ + private Integer deviceUseCount; + + public Long getDeviceId() { + return deviceId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + + public Integer getDeviceUseCount() { + return deviceUseCount; + } + + public void setDeviceUseCount(Integer deviceUseCount) { + this.deviceUseCount = deviceUseCount; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndEmergencyRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndEmergencyRespDTO.java new file mode 100644 index 0000000..d77d2f4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndEmergencyRespDTO.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.resp; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 16:07 + */ +@Data +public class ExperimentAndEmergencyRespDTO { + private Long id; + /** + * 有无应急预案 + */ + private String emergencyPlan; + /** + * 预案名称 + */ + private String emergencyPlanName; + /** + * 是否演练 + */ + private String emergencyDrillStatus; + /** + * 应急演练情况 + */ + private String emergencyDrill; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndPersonRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndPersonRespDTO.java new file mode 100644 index 0000000..2756c43 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndPersonRespDTO.java @@ -0,0 +1,108 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.resp; + +/** + * 实验与实验人员 + */ + +public class ExperimentAndPersonRespDTO { + + // private Long id; + /** + * 人员(此信息不在修改) + */ + private String personName; + /** + * 年龄(此信息不在修改) + */ + private Integer personAge; + + /** + * 1-男;2-女(此信息不在修改) + */ + private Byte personGender; + + /** + * 专业(此信息不在修改) + */ + private String personMajor; + /** + * 部门名称(与基础部门无关)(此信息不在修改) + */ + private String depName; + /** + * 相关资质(此信息不在修改) + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训(此信息不在修改) + */ + private Byte training; + + private Long personId; + + public Long getPersonId() { + return personId; + } + + public void setPersonId(Long personId) { + this.personId = personId; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndSiteRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndSiteRespDTO.java new file mode 100644 index 0000000..a860a6e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndSiteRespDTO.java @@ -0,0 +1,40 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.resp; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/28 + * @time: 15:24 + */ +@Data +public class ExperimentAndSiteRespDTO { + private Long siteId; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + + /** + * 场所性质 + */ + private String siteType; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndStuffRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndStuffRespDTO.java new file mode 100644 index 0000000..fb7d8e1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentAndStuffRespDTO.java @@ -0,0 +1,92 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.resp; + +/** + * 实验与耗材 + */ + +public class ExperimentAndStuffRespDTO { + + private Long stuffId; + + /** + * 名称 + */ + private String stuffName; + /** + * 类型 + */ + private Byte stuffType; + /** + * 编号 + */ + private String stuffCode; + /** + * 存储方式 + */ + private Byte stuffStorage; + /** + * 计量单位 + */ + private Byte stuffUnit; + /** + * 使用数量 + */ + private Integer stuffUseCount; + + public Long getStuffId() { + return stuffId; + } + + public void setStuffId(Long stuffId) { + this.stuffId = stuffId; + } + + public Integer getStuffUseCount() { + return stuffUseCount; + } + + public void setStuffUseCount(Integer stuffUseCount) { + this.stuffUseCount = stuffUseCount; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentHazardousWasteRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentHazardousWasteRespDTO.java new file mode 100644 index 0000000..0004c94 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentHazardousWasteRespDTO.java @@ -0,0 +1,57 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.resp; + +/** + * 实验危废物 + */ +public class ExperimentHazardousWasteRespDTO { + + private Long id; + + /** + * 废弃物分类:1-有机;2-酸;3-碱性;4-固体废弃物;5-医疗废弃物;6-过期化学品;7-其他; + */ + private Byte classify; + /** + * 废弃物存储方式:1-吨袋;2-吨桶;3-小桶;4-托盘;5-其他; + */ + private Byte wasteStorage; + /** + * 预估处理量(计量单位:kg) + */ + private Double handAmount; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getClassify() { + return classify; + } + + public void setClassify(Byte classify) { + this.classify = classify; + } + + public Byte getWasteStorage() { + return wasteStorage; + } + + public void setWasteStorage(Byte wasteStorage) { + this.wasteStorage = wasteStorage; + } + + public Double getHandAmount() { + return handAmount; + } + + public void setHandAmount(Double handAmount) { + this.handAmount = handAmount; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoRespDTO.java new file mode 100644 index 0000000..c0f3f32 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoRespDTO.java @@ -0,0 +1,217 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.resp; + + +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentAndEmergencyInsertReqBO; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 实验信息 + */ +@Data +public class ExperimentInfoRespDTO { + private Long id; + /** + * 实验编号 + */ + private String experimentCode; + /** + * 自定义试验编号 + */ + private String experimentCustomCode; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long liabilityUserId; + /** + * 实验负责人 + * (文字描述可能不再修改) + */ + private String liabilityUser; + /** + * 安全负责人id + */ + private Long safeLiabilityUserId; + + private String liabilityUserPhone; + + private String safeLiabilityUserPhone; + /** + * 安全负责人(文字描述可能不再修改) + */ + private String safeLiabilityUser; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + + /** + * 实验开始时间 + */ + private LocalDateTime startTime; + /** + * 实验步骤 + */ + private String experimentStep; + /** + * 实验操作方法 + */ + private String experimentMethod; + /** + * 工艺流程 + */ + private String process; + /** + * 关键过程 + */ + private String keyProcess; + /** + * 是否存在过夜、老化实验。1-存在;2-不存在 + */ + private Byte timeout; + /** + * 过夜、老化实验保障管理措施 + */ + private String timeoutManager; + /** + * 是否在密闭条件下。1-密闭;2-不密闭 + */ + private Byte closed; + /** + * 非密闭实验保障管理措施 + */ + private String unclosedManager; + /** + * 实验场所防爆措施条件和设施情况 + */ + private String explosionProof; + /** + * 实验场所防火措施条件和设施情况 + */ + private String fireProof; + /** + * 实验场所防毒措施条件和设施情况 + */ + private String poisonProof; + /** + * 危废产生情况:1-有危废;2-无危废 + */ + private Byte hazardousWaste; + /** + * 安全管理制度 + */ + private String safeManagerMethod; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + /** + * 分区隔断情况 + */ + private Byte partitionCondition; + /** + * 其他基础信息 + */ + private String note; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Integer updateByUserId; + /** + * 新建人 + */ + private Integer createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 实验评估状态:1-未评估;2-评估中;3-评估完成 + */ + private Byte stage; + /** + * 实验申请状态:1-未申请;2-已申请 + */ + private Byte status; + /** + * 实验标签:1-新立项;2-已开展 + */ + private Byte experimentTag; + /** + * 实验预期时间 + */ + private LocalDateTime createExperimentTime; + /** + * 风险评估等级 + */ + private Byte assessLevel; + /** + * 评估时间 + */ + private LocalDateTime assessTime; + + /** + * 评估申请时间 + */ + private LocalDateTime assessApplyTime; + /** + * 措施 + */ + private String measure; + /** + * 整改 + */ + private Byte rectifyStatus; + /** + * 审核结果 + */ + private Byte approvalStatus; + /** + * 填报人 + */ + private String informant; + /** + * 填报人 + */ + private String assessPerson; + + private List<ExperimentAndSiteRespDTO> siteList; + + private List<ExperimentAndPersonRespDTO> persons; + private List<ExperimentAndDeviceRespDTO> deviceList; + private List<ExperimentAndStuffRespDTO> stuffList; + private List<ExperimentHazardousWasteRespDTO> hazardousWasteList; + /** + * 演练情况 + */ + private List<ExperimentAndEmergencyRespDTO> emergencyList; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoVoRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoVoRespDTO.java new file mode 100644 index 0000000..90ec768 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/experiment/dto/resp/ExperimentInfoVoRespDTO.java @@ -0,0 +1,32 @@ +package com.gkhy.labRiskManage.api.controller.experiment.dto.resp; + + +/** + * 实验信息 + */ + +public class ExperimentInfoVoRespDTO { + private Long id; + + /** + * 实验名称 + */ + private String experimentName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getExperimentName() { + return experimentName; + } + + public void setExperimentName(String experimentName) { + this.experimentName = experimentName; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/model/dto/resp/MenuItemApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/model/dto/resp/MenuItemApiDTO.java new file mode 100644 index 0000000..8b19f54 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/model/dto/resp/MenuItemApiDTO.java @@ -0,0 +1,148 @@ +package com.gkhy.labRiskManage.api.controller.model.dto.resp; + +import java.util.ArrayList; +import java.util.List; + +public class MenuItemApiDTO { + + private Long id; + + //菜单级别 + private Integer level; + + //父级菜单 + private Long parentId; + + + //菜单项描述信息 + private String description; + + //菜单项名称 + private String name; + + //路径 + private String path; + + //重定向路径 + private String redirect; + + + private Byte priority; + + private Boolean isPublic; + + private String component; + + private MenuItemMetaApiDTO meta; + + private List<Long> menuSuperior; + + private List<MenuItemApiDTO> children; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getLevel() { + return level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + public Boolean getPublic() { + return isPublic; + } + + public void setPublic(Boolean aPublic) { + isPublic = aPublic; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public MenuItemMetaApiDTO getMeta() { + return meta; + } + + public void setMeta(MenuItemMetaApiDTO meta) { + this.meta = meta; + } + + public List<Long> getMenuSuperior() { + return menuSuperior; + } + + public void setMenuSuperior(List<Long> menuSuperior) { + this.menuSuperior = menuSuperior; + } + + public List<MenuItemApiDTO> getChildren() { + if(children == null) + children = new ArrayList<>(0); + return children; + } + + public void setChildren(List<MenuItemApiDTO> children) { + this.children = children; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/model/dto/resp/MenuItemMetaApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/model/dto/resp/MenuItemMetaApiDTO.java new file mode 100644 index 0000000..ed847f5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/model/dto/resp/MenuItemMetaApiDTO.java @@ -0,0 +1,124 @@ +package com.gkhy.labRiskManage.api.controller.model.dto.resp; + +import java.io.Serializable; +import java.util.List; + +/** +* @Description: 菜单基本属性 +*/ +public class MenuItemMetaApiDTO implements Serializable { + + private static final long serialVersionUID = 3278913464169090683L; + + private String title; + + private String isLink; + + private Boolean isHide; + + private Boolean isKeepAlive; + + private Boolean isAffix; + + private Boolean isIframe; + + private String icon; + + private List<Long> roles; + + public void setTitle(String title) { + this.title = title; + } + + public String getTitle() { + return title; + } + + public String getIsLink() { + return isLink; + } + + public void setIsLink(String isLink) { + this.isLink = isLink; + } + + public Boolean getIsHide() { + return isHide; + } + + public void setIsHide(Boolean isHide) { + this.isHide = isHide; + } + + public Boolean getIsKeepAlive() { + return isKeepAlive; + } + + public void setIsKeepAlive(Boolean isKeepAlive) { + this.isKeepAlive = isKeepAlive; + } + + public Boolean getIsAffix() { + return isAffix; + } + + public void setIsAffix(Boolean isAffix) { + this.isAffix = isAffix; + } + + public Boolean getIsIframe() { + return isIframe; + } + + public void setIsIframe(Boolean isIframe) { + this.isIframe = isIframe; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Boolean getHide() { + return isHide; + } + + public void setHide(Boolean hide) { + isHide = hide; + } + + public Boolean getKeepAlive() { + return isKeepAlive; + } + + public void setKeepAlive(Boolean keepAlive) { + isKeepAlive = keepAlive; + } + + public Boolean getAffix() { + return isAffix; + } + + public void setAffix(Boolean affix) { + isAffix = affix; + } + + public Boolean getIframe() { + return isIframe; + } + + public void setIframe(Boolean iframe) { + isIframe = iframe; + } + + public List<Long> getRoles() { + return roles; + } + + public void setRoles(List<Long> roles) { + this.roles = roles; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportExperimentRiskSourceController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportExperimentRiskSourceController.java new file mode 100644 index 0000000..ee09f58 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportExperimentRiskSourceController.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.api.controller.riskReport; + +import org.springframework.web.bind.annotation.*; + + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +@RestController +@RequestMapping("risk") +public class ReportExperimentRiskSourceController { + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportExperimentRiskSourceTypeController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportExperimentRiskSourceTypeController.java new file mode 100644 index 0000000..155f183 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportExperimentRiskSourceTypeController.java @@ -0,0 +1,14 @@ +package com.gkhy.labRiskManage.api.controller.riskReport; + +import org.springframework.web.bind.annotation.*; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +@RestController +@RequestMapping("risk") +public class ReportExperimentRiskSourceTypeController { + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessInfoController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessInfoController.java new file mode 100644 index 0000000..93deed6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessInfoController.java @@ -0,0 +1,143 @@ +package com.gkhy.labRiskManage.api.controller.riskReport; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportInfoUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportQueryReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.service.ReportAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 风险评估报告 + */ +@RestController +@RequestMapping("report") +public class ReportRiskAssessInfoController extends BaseController { + + @Autowired + private ReportAppService reportAppService; + + /** + * 风险评估报告 - 查询 + */ + @PostMapping("/select/selectRiskReportPage") + public SearchResult<ReportQueryRespDTO> selectRiskReportPage(@RequestBody ReportQueryReqBO queryReqBO){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<ReportQueryRespDTO> queryResult = reportAppService.selectRiskReportPage(getCurrentUserId(), queryReqBO); + result.setData(BeanCopyUtils.copyReportQueryResp(queryResult.getData(), ReportQueryRespDTO.class)); + + result.setPageIndex(queryResult.getPageIndex()); + result.setPageSize(queryResult.getPageSize()); + result.setTotal(queryResult.getTotal()); + result.setCount(queryResult.getTotal().intValue()); + + return result; + } + + /** + * 风险评估报告 - 生成报告信息 + */ + @PostMapping("/insert/insertRiskReport") + public Result insertRiskReport(@RequestBody JSONObject jsonObject){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("生成报告基本信息成功"); + + int insertResult = reportAppService.insertRiskReport(getCurrentUserId(), jsonObject.getLong("id")); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("生成报告基本信息失败"); + } + result.setCount(insertResult); + return result; + } + + /** + * 风险评估报告 - 填写报告信息 + */ + @PostMapping("/update/updateRiskReport") + public Result updateRiskReport(@RequestBody ReportUpdateReqBO updateReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("填写报告成功"); + + int insertResult = reportAppService.updateRiskReport(getCurrentUserId(), updateReqBO); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("填写报告失败"); + } + result.setCount(insertResult); + return result; + } + + /** + * 风险评估报告 - 修改报告信息 + */ + @PostMapping("/update/updateRiskReportInfo") + public Result updateReportInfo(@RequestBody ReportInfoUpdateReqBO reportInfoUpdateReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("修改报告成功"); + + int insertResult = reportAppService.updateReportInfo(getCurrentUserId(), reportInfoUpdateReqBO); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改报告失败"); + } + result.setCount(insertResult); + return result; + } + /** + * 风险评估报告 - 报告审核 - 旧 - 两层审核 + */ + @PostMapping("/update/report") + public Result report(@RequestBody ReportReqBO reportReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("审核成功"); + + int insertResult = reportAppService.report(getCurrentUserId(), reportReqBO); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("审核失败"); + } + result.setCount(insertResult); + return result; + } + + /** + * 风险评估报告 - 报告审核 - 新 - 单次审核 + */ + @PostMapping("/update/reportNew") + public Result reportNew(@RequestBody ReportReqBO reportReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("审核成功"); + + int insertResult = reportAppService.reportNew(getCurrentUserId(), reportReqBO); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("审核失败"); + } + result.setCount(insertResult); + return result; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessPersonController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessPersonController.java new file mode 100644 index 0000000..2935e63 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/ReportRiskAssessPersonController.java @@ -0,0 +1,14 @@ +package com.gkhy.labRiskManage.api.controller.riskReport; + +import org.springframework.web.bind.annotation.*; + + +/** + * 风险评估报告-评估专家 + */ +@RestController +@RequestMapping("risk") +public class ReportRiskAssessPersonController { + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/RiskAssessPlanController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/RiskAssessPlanController.java new file mode 100644 index 0000000..6c0b788 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/RiskAssessPlanController.java @@ -0,0 +1,426 @@ +package com.gkhy.labRiskManage.api.controller.riskReport; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.*; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.RiskAssessPlanListRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.RiskAssessPlanQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.RiskAssessQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessPlanAppQueryDTO; +import com.gkhy.labRiskManage.application.riskReport.service.RiskAccessAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.AssessPlanUpdateDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.FactorQueryDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; + + +/** + * 风险评估计划 + */ +@RestController +@RequestMapping("risk") +public class RiskAssessPlanController extends BaseController { + + @Autowired + private RiskAccessAppService riskAccessAppService; + + /** + * 风险评估计划 - 插入 + */ + @PostMapping("/insert/insertAssessPlan") + public Result insertAssessPlan(@RequestBody RiskAssessPlanInsertReqBO assessPlanInsertReqDTO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + + int insertResult = riskAccessAppService.insertAssessPlan(getCurrentUserId(), assessPlanInsertReqDTO); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("新增失败"); + } + result.setCount(insertResult); + return result; + } + + /** + * 风险评估计划 - 查询 + */ + @PostMapping("/select/selectAssessPlanPage") + public SearchResult<RiskAssessPlanQueryRespDTO> selectAssessPlanPage(@RequestBody RiskAssessPlanQueryReqBO queryReqBO){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<RiskAssessPlanAppQueryDTO> queryResult = riskAccessAppService.selectAssessPlanPage(getCurrentUserId(), queryReqBO); + result.setData(BeanCopyUtils.copyRiskAssessPlanQueryResp(queryResult.getData(), RiskAssessPlanQueryRespDTO.class)); + + result.setPageIndex(queryResult.getPageIndex()); + result.setPageSize(queryResult.getPageSize()); + result.setTotal(queryResult.getTotal()); + result.setCount(queryResult.getTotal().intValue()); + + return result; + } + + /** + * 风险评估计划 - 修改 + */ + @PostMapping("/update/updateAssessPlan") + public Result updateAssessPlan(@RequestBody RiskAssessPlanUpdateReqBO updateReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("修改成功"); + + int updateResult = riskAccessAppService.updateAssessPlan(getCurrentUserId(), updateReqBO); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改失败"); + } + result.setCount(updateResult); + return result; + } + + /** + * 风险评估计划 - 删除 + */ + @PostMapping("/delete/deleteAssessPlan") + public Result deleteAssessPlan(@RequestBody JSONObject jsonObject){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("删除成功"); + + int deleteResult = riskAccessAppService.deleteAssessPlan(getCurrentUserId(), jsonObject.getLong("id")); + + if (deleteResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("删除失败"); + } + result.setCount(deleteResult); + return result; + } + + /** + * 风险评估计划 - 派发任务 + */ + @PostMapping("/update/sellAssessPlan") + public Result sellAssessPlan(@RequestBody JSONObject jsonObject){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("派发任务成功"); + + int updateResult = riskAccessAppService.sellAssessPlan(getCurrentUserId(), jsonObject.getLong("id")); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("派发任务失败"); + } + result.setCount(updateResult); + return result; + } + + /** + * 风险评估计划 - 辨识专家拒绝 + */ + @PostMapping("/update/identificationRefuse") + public Result identificationRefuse(@RequestBody JSONObject jsonObject){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("已拒绝辨识任务"); + + AssessPlanUpdateDTO assessPlanUpdateDTO = riskAccessAppService.identificationRefuse(getCurrentUserId(), jsonObject.getLong("id")); + if (ObjectUtils.isEmpty(assessPlanUpdateDTO)){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("拒绝辨识任务失败"); + return result; + } + return result; + } + + /** + * 风险评估计划 - 修改辨识方法 + */ + @PostMapping("/update/identificationUpdateMethod") + public Result identificationUpdateMethod(@RequestBody MethodUpdateReqDTO updateReqDTO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("修改辨识方法成功"); + + AssessPlanUpdateDTO assessPlanUpdateDTO = riskAccessAppService.identificationUpdateMethod(getCurrentUserId(),updateReqDTO); + if (ObjectUtils.isEmpty(assessPlanUpdateDTO)){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改辨识方法失败"); + return result; + } + return result; + } + /** + * 风险评估计划 - 辨识 + */ + @PostMapping("/update/identification") + public Result identification(@RequestBody RiskAssessPlanIdentificationInsertReqBO identificationReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("辨识成功"); + + FactorQueryDTO identification = riskAccessAppService.identification(getCurrentUserId(), identificationReqBO); + + result.setData(identification); + return result; + } + + /** + * 风险评估计划 - 辨识修改 + */ + @PostMapping("/update/updateIdentification") + public Result updateIdentification(@RequestBody RiskAssessPlanIdentificationUpdateReqBO updateReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("辨识修改成功"); + + FactorQueryDTO identification = riskAccessAppService.updateIdentification(getCurrentUserId(), updateReqBO); + + result.setData(identification); + return result; + } + + /** + * 风险评估计划 - 辨识删除 + */ + @PostMapping("/delete/deleteIdentification") + public Result deleteIdentification(@RequestBody RiskAssessPlanIdentificationDeleteReqBO deleteReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("辨识删除成功"); + + int updateResult = riskAccessAppService.deleteIdentification(getCurrentUserId(), deleteReqBO); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("辨识删除失败"); + } + result.setCount(updateResult); + return result; + } + + /** + * 风险评估计划 - 辨识结果提交 + */ + @PostMapping("/update/identificationSubmit") + public Result identificationSubmit(@RequestBody JSONObject jsonObject){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("辨识结果提交成功"); + + int updateResult = riskAccessAppService.identificationSubmit(getCurrentUserId(), jsonObject.getLong("id")); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("辨识结果提交失败"); + } + result.setCount(updateResult); + return result; + } + + /** + * 风险评估计划 - 评价 + */ + @PostMapping("/update/evaluate") + public Result evaluate(@RequestBody RiskAssessPlanEvaluateInsertReqBO evaluateReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("评价成功"); + + FactorQueryDTO evaluate = riskAccessAppService.evaluate(getCurrentUserId(), evaluateReqBO); + + result.setData(evaluate); + return result; + } + + /** + * 风险评估计划 - 评价专家拒绝 + */ + @PostMapping("/update/evaluateRefuse") + public Result evaluateRefuse(@RequestBody JSONObject jsonObject){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("已拒绝评价任务"); + + AssessPlanUpdateDTO assessPlanUpdateDTO = riskAccessAppService.evaluateRefuse(getCurrentUserId(), jsonObject.getLong("id")); + + if (ObjectUtils.isEmpty(assessPlanUpdateDTO)){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("拒绝辨识任务失败"); + return result; + } + return result; + } + + /** + * 风险评估计划 - 评价方法修改 + */ + @PostMapping("/update/evaluateUpdateMethod") + public Result evaluateUpdateMethod(@RequestBody MethodUpdateReqDTO updateReqDTO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("修改评价方法成功"); + + AssessPlanUpdateDTO assessPlanUpdateDTO = riskAccessAppService.evaluateUpdateMethod(getCurrentUserId(),updateReqDTO); + if (ObjectUtils.isEmpty(assessPlanUpdateDTO)){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改评价方法失败"); + return result; + } + return result; + } + /** + * 风险评估计划 - 评价修改 + */ + @PostMapping("/update/updateEvaluate") + public Result updateEvaluate(@RequestBody RiskAssessPlanEvaluateUpdateReqBO updateReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("评价修改成功"); + + FactorQueryDTO factorQueryDTO = riskAccessAppService.updateEvaluate(getCurrentUserId(), updateReqBO); + + result.setData(factorQueryDTO); + return result; + } + + /** + * 风险评估计划 - 评价删除 + */ + @PostMapping("/delete/deleteEvaluate") + public Result deleteEvaluate(@RequestBody RiskAssessPlanEvaluateDeleteReqBO deleteReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("评价删除成功"); + + int updateResult = riskAccessAppService.deleteEvaluate(getCurrentUserId(), deleteReqBO); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("评价删除失败"); + } + result.setCount(updateResult); + return result; + } + + /** + * 风险评估计划 - 评价结果提交 + */ + @PostMapping("/update/evaluateSubmit") + public Result evaluateSubmit(@RequestBody JSONObject jsonObject){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("评价结果提交成功"); + + int updateResult = riskAccessAppService.evaluateSubmit(getCurrentUserId(), jsonObject.getLong("id")); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("评价结果提交失败"); + } + + result.setCount(updateResult); + return result; + } + + /** + * 风险评估计划 - 重新指定专家 + */ + @PostMapping("/update/appoint") + public Result appoint(@RequestBody AppointUserReBO appointUserReBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("已经重新指定专家"); + + AssessPlanUpdateDTO assessPlanUpdateDTO = riskAccessAppService.appoint(getCurrentUserId(), appointUserReBO); + if (ObjectUtils.isEmpty(assessPlanUpdateDTO)){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("重新指定专家失败"); + return result; + } + return result; + } + + /** + * 风险辨识与评价 - 查询 + */ + @PostMapping("/select/selectAssessPage") + public SearchResult<RiskAssessQueryRespDTO> selectAssessPage(@RequestBody RiskAssessQueryReqBO queryReqBO){ + + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<RiskAssessQueryRespDTO> queryResult = riskAccessAppService.selectAssessPage(getCurrentUserId(), queryReqBO); + + result.setData(BeanCopyUtils.copyRiskAssessQueryResp(queryResult.getData(), RiskAssessQueryRespDTO.class)); + result.setPageIndex(queryResult.getPageIndex()); + result.setPageSize(queryResult.getPageSize()); + result.setCount(queryResult.getCount()); + result.setTotal(queryResult.getTotal()); + + return result; + } + + /** + * 评估计划 - 列表查询 + */ + @GetMapping("/select/listAssessPlan") + public SearchResult<RiskAssessPlanListRespDTO> listAssessPlan(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<RiskAssessPlanListRespDTO> searchResult = riskAccessAppService.listAssessPlan(); + + result.setData(searchResult.getData()); + result.setCount(searchResult.getCount()); + + return result; + } + /** + * 评估计划 - 风险值计算 + */ + @PostMapping("/select/riskValue") + public Result riskValue(@RequestBody RiskValueReqBO valueReqBO){ + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("计算成功"); + + BigDecimal riskValue = riskAccessAppService.riskValue(valueReqBO); + + result.setData(riskValue); + + return result; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/RiskUnitController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/RiskUnitController.java new file mode 100644 index 0000000..12df6ec --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/RiskUnitController.java @@ -0,0 +1,165 @@ +package com.gkhy.labRiskManage.api.controller.riskReport; + +import cn.hutool.json.JSONObject; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicRiskUnitListRespDTO; +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.*; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.RiskUnitListQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.RiskUnitQueryRespDTO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicRiskUnitAppListDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskUnitAppQueryDTO; +import com.gkhy.labRiskManage.application.riskReport.service.RiskAccessAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.*; + + +/** + * 实验风险单元 + */ +@RestController +@RequestMapping("risk") +public class RiskUnitController extends BaseController { + + @Autowired + private RiskAccessAppService riskAccessAppService; + + /** + * 实验风险单元 - 插入 + */ + @PostMapping("/insert/insertRiskUnit") + public Result insertRiskUnit(@RequestBody RiskUnitInsertReqBO riskUnitInsertReqBO) { + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + + int insertResult = riskAccessAppService.insertRiskUnit(getCurrentUserId(), riskUnitInsertReqBO); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("新增失败"); + } + result.setCount(insertResult); + return result; + } + + /** + * 固有风险单元 - 插入 + */ + @PostMapping("/insert/insertInherentRiskUnit") + public Result insertInherentRiskUnit(@RequestBody InherentRiskUnitInsertReqBO insertReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功"); + + int insertResult = riskAccessAppService.insertInherentRiskUnit(getCurrentUserId(), insertReqBO); + + if (insertResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("新增失败"); + } + result.setCount(insertResult); + return result; + } + + /** + * 风险单元管理 - 分页查询 + */ + @PostMapping("/select/selectRiskUnitPage") + public SearchResult<RiskUnitQueryRespDTO> selectRiskUnitPage(@RequestBody RiskUnitQueryReqBO queryReqBO){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<RiskUnitAppQueryDTO> queryResult = riskAccessAppService.selectRiskUnitPage(getCurrentUserId(), queryReqBO); + result.setData(BeanCopyUtils.copyExperimentRiskUnitListQueryResp(queryResult.getData(), RiskUnitQueryRespDTO.class)); + + result.setPageIndex(queryResult.getPageIndex()); + result.setPageSize(queryResult.getPageSize()); + result.setTotal(queryResult.getTotal()); + result.setCount(queryResult.getTotal().intValue()); + + return result; + } + + /** + * 风险单元管理 - 修改 + */ + @PostMapping("/update/updateRiskUnit") + public Result updateRiskUnit(@RequestBody RiskUnitUpdateReqBO updateReqBO){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("修改成功"); + + int updateResult = riskAccessAppService.updateRiskUnit(getCurrentUserId(), updateReqBO); + + if (updateResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改失败"); + } + result.setCount(updateResult); + return result; + } + + /** + * 风险单元管理 - 删除 + */ + @PostMapping("/delete/deleteRiskUnit") + public Result deleteRiskUnit(@RequestBody JSONObject jsonObject){ + + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("删除成功"); + + int deleteResult = riskAccessAppService.deleteRiskUnit(getCurrentUserId(), jsonObject.getLong("id")); + + if (deleteResult < 1){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("删除失败"); + } + result.setCount(deleteResult); + return result; + } + + /** + * 单元管理 - 列表查询 + */ + @GetMapping("/select/listRiskUnit") + public SearchResult<RiskUnitListQueryRespDTO> listRiskUnit(){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<RiskUnitListQueryRespDTO> searchResult = riskAccessAppService.listRiskUnit(getCurrentUserId()); + + result.setData(searchResult.getData()); + result.setCount(searchResult.getCount()); + + return result; + } + + /** + * 单元管理 - 列表查询 todo --此接口改为Post RiskUnitListReqBO参数,根据实验id查询风险单元 + */ + @PostMapping("/select/listRiskUnitByExperiment") + public SearchResult<RiskUnitListQueryRespDTO> listRiskUnitByExperiment(@RequestBody RiskUnitListReqBO reqBO){ + SearchResult result = new SearchResult(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功"); + + SearchResult<RiskUnitListQueryRespDTO> searchResult = riskAccessAppService.listRiskUnitByExperiment(getCurrentUserId(), reqBO); + + result.setData(searchResult.getData()); + result.setCount(searchResult.getCount()); + + return result; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/AppointUserReBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/AppointUserReBO.java new file mode 100644 index 0000000..1d03134 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/AppointUserReBO.java @@ -0,0 +1,19 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + + +@Data +public class AppointUserReBO { + + private Long id; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 评价专家id + */ + private Long evaluateUserId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/InherentRiskUnitInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/InherentRiskUnitInsertReqBO.java new file mode 100644 index 0000000..7fe0ffd --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/InherentRiskUnitInsertReqBO.java @@ -0,0 +1,29 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +public class InherentRiskUnitInsertReqBO { + + /** + * 实验id + */ + private Long experimentId; + /** + * 基础风险单元id + */ + private Long basicRiskUnitId; + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Long getBasicRiskUnitId() { + return basicRiskUnitId; + } + + public void setBasicRiskUnitId(Long basicRiskUnitId) { + this.basicRiskUnitId = basicRiskUnitId; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/MethodUpdateReqDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/MethodUpdateReqDTO.java new file mode 100644 index 0000000..8bdb873 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/MethodUpdateReqDTO.java @@ -0,0 +1,18 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +@Data +public class MethodUpdateReqDTO { + + private Long id; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethodId; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethodId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportInfoUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportInfoUpdateReqBO.java new file mode 100644 index 0000000..12bd88a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportInfoUpdateReqBO.java @@ -0,0 +1,73 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +import java.util.List; + +/** + * 风险评估报告 + */ +@Data +public class ReportInfoUpdateReqBO { + + private Long id; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 评估人 + */ + private String assessPerson; + /** + * 评级依据 + */ + private String description; +// /** +// * 安全风险分析 +// */ +// private String safeRiskAnalysis; + +// /** +// * 实验概况 +// */ +// private String experimentDesc; +// /** +// * 部门ID +// */ +// private Long depId; +// /** +// * 部门(文字描述可能不再修改) +// */ +// private String dep; +// /** +// * 实验涉及到的风险源 --暂时不用 +// */ +// private String experimentRiskSource; +// /** +// * 应急措施 +// */ +// private String emergencyMeasure; +// /** +// * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; +// */ +// private Byte assessLevel; +// /** +// * 审核人 +// */ +// List<ReportPersonInsertReqBO> person; +// /** +// * 风险源类型 +// */ +// List<ReportSourceTypeInsertReqBO> riskSourceType; +// /** +// * 风险源信息 +// */ +// List<ReportSourceInsertReqBO> riskSource; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportPersonInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportPersonInsertReqBO.java new file mode 100644 index 0000000..783b3a7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportPersonInsertReqBO.java @@ -0,0 +1,92 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import java.time.LocalDateTime; + +/** + * 风险评估报告-评估专家 + */ +public class ReportPersonInsertReqBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 审批阶段排序 + */ + private Integer approveIndex; + /** + * 审批阶段名称 + */ + private String approveStage; + /** + * 审批意见说明 + */ + private String approveDesc; + /** + * 审批时间 + */ + private LocalDateTime approveTime; + /** + * 审批人id + */ + private Long approvePersonId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public LocalDateTime getApproveTime() { + return approveTime; + } + + public void setApproveTime(LocalDateTime approveTime) { + this.approveTime = approveTime; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getApproveIndex() { + return approveIndex; + } + + public void setApproveIndex(Integer approveIndex) { + this.approveIndex = approveIndex; + } + + public String getApproveStage() { + return approveStage; + } + + public void setApproveStage(String approveStage) { + this.approveStage = approveStage; + } + + public String getApproveDesc() { + return approveDesc; + } + + public void setApproveDesc(String approveDesc) { + this.approveDesc = approveDesc; + } + + public Long getApprovePersonId() { + return approvePersonId; + } + + public void setApprovePersonId(Long approvePersonId) { + this.approvePersonId = approvePersonId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportPersonUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportPersonUpdateReqBO.java new file mode 100644 index 0000000..4dd0232 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportPersonUpdateReqBO.java @@ -0,0 +1,92 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import java.time.LocalDateTime; + +/** + * 风险评估报告-评估专家 + */ +public class ReportPersonUpdateReqBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 审批阶段排序 + */ + private Integer approveIndex; + /** + * 审批阶段名称 + */ + private String approveStage; + /** + * 审批意见说明 + */ + private String approveDesc; + /** + * 审批时间 + */ + private LocalDateTime approveTime; + /** + * 审批人id + */ + private Long approvePersonId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public LocalDateTime getApproveTime() { + return approveTime; + } + + public void setApproveTime(LocalDateTime approveTime) { + this.approveTime = approveTime; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getApproveIndex() { + return approveIndex; + } + + public void setApproveIndex(Integer approveIndex) { + this.approveIndex = approveIndex; + } + + public String getApproveStage() { + return approveStage; + } + + public void setApproveStage(String approveStage) { + this.approveStage = approveStage; + } + + public String getApproveDesc() { + return approveDesc; + } + + public void setApproveDesc(String approveDesc) { + this.approveDesc = approveDesc; + } + + public Long getApprovePersonId() { + return approvePersonId; + } + + public void setApprovePersonId(Long approvePersonId) { + this.approvePersonId = approvePersonId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportQueryReqBO.java new file mode 100644 index 0000000..d000141 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportQueryReqBO.java @@ -0,0 +1,42 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + + +import lombok.Data; + +/** + * 风险评估报告 + */ +@Data +public class ReportQueryReqBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * tag:1-查询未填写的报告;2-已填写的报告;3-查询所有报告 + */ + private Byte tag; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + * (文字描述可能不再修改) + */ + private Byte experimentType; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approvePlanStatus; + /** + * 实验 + */ + private Long experimentId; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportReqBO.java new file mode 100644 index 0000000..31a336d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportReqBO.java @@ -0,0 +1,41 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +public class ReportReqBO { + + /** + * 报告id + */ + private Long id; + /** + * 审批状态:1-未审批;2-已通过;3-不通过 + */ + private Byte approveStatus; + /** + * 审批意见说明 + */ + private String approveDesc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getApproveStatus() { + return approveStatus; + } + + public void setApproveStatus(Byte approveStatus) { + this.approveStatus = approveStatus; + } + + public String getApproveDesc() { + return approveDesc; + } + + public void setApproveDesc(String approveDesc) { + this.approveDesc = approveDesc; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceInsertReqBO.java new file mode 100644 index 0000000..542342a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceInsertReqBO.java @@ -0,0 +1,91 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +public class ReportSourceInsertReqBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 排序 + */ + private Integer riskSourceIndex; + /** + * 危险源 + */ + private String riskSource; + /** + * 危险特性 + */ + private String riskCharacteristic; + /** + * 数量 + */ + private Integer number; + /** + * 说明 + */ + private String description; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getRiskSourceIndex() { + return riskSourceIndex; + } + + public void setRiskSourceIndex(Integer riskSourceIndex) { + this.riskSourceIndex = riskSourceIndex; + } + + public String getRiskSource() { + return riskSource; + } + + public void setRiskSource(String riskSource) { + this.riskSource = riskSource; + } + + public String getRiskCharacteristic() { + return riskCharacteristic; + } + + public void setRiskCharacteristic(String riskCharacteristic) { + this.riskCharacteristic = riskCharacteristic; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceTypeInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceTypeInsertReqBO.java new file mode 100644 index 0000000..c0bd4ba --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceTypeInsertReqBO.java @@ -0,0 +1,54 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public class ReportSourceTypeInsertReqBO { + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private Long riskSourceTypeId; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Long getRiskSourceTypeId() { + return riskSourceTypeId; + } + + public void setRiskSourceTypeId(Long riskSourceTypeId) { + this.riskSourceTypeId = riskSourceTypeId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceTypeUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceTypeUpdateReqBO.java new file mode 100644 index 0000000..c0f3a1b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceTypeUpdateReqBO.java @@ -0,0 +1,55 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public class ReportSourceTypeUpdateReqBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private Long riskSourceTypeId; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Long getRiskSourceTypeId() { + return riskSourceTypeId; + } + + public void setRiskSourceTypeId(Long riskSourceTypeId) { + this.riskSourceTypeId = riskSourceTypeId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceUpdateReqBO.java new file mode 100644 index 0000000..901a331 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportSourceUpdateReqBO.java @@ -0,0 +1,91 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +public class ReportSourceUpdateReqBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 排序 + */ + private Integer riskSourceIndex; + /** + * 危险源 + */ + private String riskSource; + /** + * 危险特性 + */ + private String riskCharacteristic; + /** + * 数量 + */ + private Integer number; + /** + * 说明 + */ + private String description; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getRiskSourceIndex() { + return riskSourceIndex; + } + + public void setRiskSourceIndex(Integer riskSourceIndex) { + this.riskSourceIndex = riskSourceIndex; + } + + public String getRiskSource() { + return riskSource; + } + + public void setRiskSource(String riskSource) { + this.riskSource = riskSource; + } + + public String getRiskCharacteristic() { + return riskCharacteristic; + } + + public void setRiskCharacteristic(String riskCharacteristic) { + this.riskCharacteristic = riskCharacteristic; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportUpdateReqBO.java new file mode 100644 index 0000000..4585e73 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/ReportUpdateReqBO.java @@ -0,0 +1,58 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 风险评估报告 + */ +@Data +public class ReportUpdateReqBO { + + private Long id; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 评估人 + */ + private String assessPerson; + /** + * 评级依据 + */ + private String description; +// /** +// * 部门ID +// */ +// private Long depId; + +// /** +// * 实验概况 +// */ +// private String experimentDesc; +// /** +// * 应急措施 +// */ +// private String emergencyMeasure; +// /** +// * 审核人 +// */ +// List<ReportPersonUpdateReqBO> person; +// /** +// * 风险源类型 +// */ +// List<ReportSourceTypeInsertReqBO> riskSourceType; + /** + * 风险源信息 + */ + List<ReportSourceUpdateReqBO> riskSource; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateDeleteReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateDeleteReqBO.java new file mode 100644 index 0000000..f45b10e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateDeleteReqBO.java @@ -0,0 +1,58 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import java.math.BigDecimal; + +public class RiskAssessPlanEvaluateDeleteReqBO { + + private Long id; + + private Long LecId; + + private Long LsId; + + private Long MesId; + + private Long RsId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getLecId() { + return LecId; + } + + public void setLecId(Long lecId) { + LecId = lecId; + } + + public Long getLsId() { + return LsId; + } + + public void setLsId(Long lsId) { + LsId = lsId; + } + + public Long getMesId() { + return MesId; + } + + public void setMesId(Long mesId) { + MesId = mesId; + } + + public Long getRsId() { + return RsId; + } + + public void setRsId(Long rsId) { + RsId = rsId; + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateInsertReqBO.java new file mode 100644 index 0000000..7a1d991 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateInsertReqBO.java @@ -0,0 +1,205 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +import java.math.BigDecimal; +@Data +public class RiskAssessPlanEvaluateInsertReqBO { + + private Long id; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 评价专家意见 + */ + private String evaluateDesc; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + + + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + + + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + + + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + + + /** + * LEC_L的数值(评价) + */ + private BigDecimal originalLecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecE; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecC; + /** + * LS_L的数值(评价) + */ + private BigDecimal originalLsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal originalLsS; + /** + * MES_M的数值(评价) + */ + private BigDecimal originalMesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal originalMesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal originalMesS; + /** + * RS_R的数值(评价) + */ + private BigDecimal originalRsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal originalRsS; + + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateUpdateReqBO.java new file mode 100644 index 0000000..d31c8a0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanEvaluateUpdateReqBO.java @@ -0,0 +1,209 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class RiskAssessPlanEvaluateUpdateReqBO { + + private Long id; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + + /** + * LEC_L的数值(评价) + */ + private BigDecimal originalLecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecE; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecC; + /** + * LS_L的数值(评价) + */ + private BigDecimal originalLsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal originalLsS; + /** + * MES_M的数值(评价) + */ + private BigDecimal originalMesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal originalMesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal originalMesS; + /** + * RS_R的数值(评价) + */ + private BigDecimal originalRsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal originalRsS; + + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + + + private Long lecId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + + + private Long lsId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + + private Long mesId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + + + private Long rsId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + /** + * 评价专家意见 + */ + private String evaluateDesc; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationDeleteReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationDeleteReqBO.java new file mode 100644 index 0000000..db65b83 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationDeleteReqBO.java @@ -0,0 +1,65 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +public class RiskAssessPlanIdentificationDeleteReqBO { + + private Long id; + + + private Long analogyId; + + private Long hazopId; + + private Long jhaId; + + private Long phaId; + + private Long sclId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getHazopId() { + return hazopId; + } + + public void setHazopId(Long hazopId) { + this.hazopId = hazopId; + } + + public Long getAnalogyId() { + return analogyId; + } + + public void setAnalogyId(Long analogyId) { + this.analogyId = analogyId; + } + + public Long getJhaId() { + return jhaId; + } + + public void setJhaId(Long jhaId) { + this.jhaId = jhaId; + } + + public Long getPhaId() { + return phaId; + } + + public void setPhaId(Long phaId) { + this.phaId = phaId; + } + + public Long getSclId() { + return sclId; + } + + public void setSclId(Long sclId) { + this.sclId = sclId; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationInsertReqBO.java new file mode 100644 index 0000000..2f06e8f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationInsertReqBO.java @@ -0,0 +1,135 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +@Data +public class RiskAssessPlanIdentificationInsertReqBO { + + private Long id; +// /** +// * 技术措施 +// */ +// private String technologyMeasure; +// /** +// * 管理措施 +// */ +// private String manageMeasure; +// /** +// * 教育措施 +// */ +// private String educationMeasure; +// /** +// * 个体防护措施 +// */ +// private String personalProtectionMeasure; +// /** +// * 应急措施 +// */ +// private String emergencyMeasure; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + + + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + + + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + + + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationUpdateReqBO.java new file mode 100644 index 0000000..9b96f95 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanIdentificationUpdateReqBO.java @@ -0,0 +1,142 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +@Data +public class RiskAssessPlanIdentificationUpdateReqBO { + + private Long id; +// /** +// * 技术措施 +// */ +// private String technologyMeasure; +// /** +// * 管理措施 +// */ +// private String manageMeasure; +// /** +// * 教育措施 +// */ +// private String educationMeasure; +// /** +// * 个体防护措施 +// */ +// private String personalProtectionMeasure; +// /** +// * 应急措施 +// */ +// private String emergencyMeasure; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + + private Long analogyId; + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + + + private Long hazopId; + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + + private Long jhaId; + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + + + private Long phaId; + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + + + private Long sclId; + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanInsertReqBO.java new file mode 100644 index 0000000..ce2edde --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanInsertReqBO.java @@ -0,0 +1,56 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * + */ +@Data +public class RiskAssessPlanInsertReqBO { + + /** + * 风险分析单元id --传 + */ + private Long riskUnitId; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Long riskType; + /** + * 评估计划名称 --传 + */ + private String assessPlanName; + /** + * 计划制定人 --传 + */ + private Long planUserId; + /** + * 评估开始时间 --传 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 --传 + */ + private LocalDateTime assessEndTime; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 评价专家id + */ + private Long evaluateUserId; + + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; ----弃用 + */ + private Byte evaluateMethod; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 ----弃用 + */ + private Byte identificationMethod; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanQueryReqBO.java new file mode 100644 index 0000000..e6dbbd7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanQueryReqBO.java @@ -0,0 +1,29 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + + +/** + * + */ +@Data +public class RiskAssessPlanQueryReqBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 风险单元 + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 实验 + */ + private Long experimentId; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanUpdateReqBO.java new file mode 100644 index 0000000..fd838dd --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessPlanUpdateReqBO.java @@ -0,0 +1,57 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * + */ +@Data +public class RiskAssessPlanUpdateReqBO { + + private Long id; + /** + * 风险分析单元id --传 + */ + private Long riskUnitId; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Long riskType; + /** + * 评估计划名称 --传 + */ + private String assessPlanName; + /** + * 计划制定人 --传 + */ + private Long planUserId; + /** + * 评估开始时间 --传 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 --传 + */ + private LocalDateTime assessEndTime; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 -----弃用 + */ + private Byte identificationMethod; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; -----弃用 + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessQueryReqBO.java new file mode 100644 index 0000000..2ac0f13 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskAssessQueryReqBO.java @@ -0,0 +1,39 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + + +import lombok.Data; + +/** + * 风险辨识与评价 + * */ +@Data +public class RiskAssessQueryReqBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 实验 + */ + private String experimentName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 辨识后标识 :1-查询所有,2-查询辨识提交,3-查询评价提交 + */ + private Integer tag; + /** + * 实验 + */ + private Long experimentId; + /** + * 实验 + */ + private Long assessPlanId; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 --5-查询3和4状态数据 + */ + private Byte planExecStatus; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitInsertReqBO.java new file mode 100644 index 0000000..432935b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitInsertReqBO.java @@ -0,0 +1,37 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +@Data +public class RiskUnitInsertReqBO { + + /** + * 实验id + */ + private Long experimentId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 风险单元描述 + */ + private String description; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitListReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitListReqBO.java new file mode 100644 index 0000000..d05eed6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitListReqBO.java @@ -0,0 +1,16 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + + +import lombok.Data; + +/** + * 风险辨识与评价 + * */ +@Data +public class RiskUnitListReqBO { + + /** + * 实验 + */ + private Long experimentId; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitQueryReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitQueryReqBO.java new file mode 100644 index 0000000..76a2942 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitQueryReqBO.java @@ -0,0 +1,28 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +@Data +public class RiskUnitQueryReqBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 实验 + */ + private String experimentName; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 实验 + */ + private Long experimentId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitUpdateReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitUpdateReqBO.java new file mode 100644 index 0000000..d9eb87d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskUnitUpdateReqBO.java @@ -0,0 +1,41 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import lombok.Data; + +@Data +public class RiskUnitUpdateReqBO { + + /** + * id + */ + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 风险单元描述 + */ + private String description; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskValueReqBO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskValueReqBO.java new file mode 100644 index 0000000..bb8a3a2 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/repDto/RiskValueReqBO.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto; + +import java.math.BigDecimal; + +public class RiskValueReqBO { + + private BigDecimal value1; + + private BigDecimal value2; + + private BigDecimal value3; + + public BigDecimal getValue1() { + return value1; + } + + public void setValue1(BigDecimal value1) { + this.value1 = value1; + } + + public BigDecimal getValue2() { + return value2; + } + + public void setValue2(BigDecimal value2) { + this.value2 = value2; + } + + public BigDecimal getValue3() { + return value3; + } + + public void setValue3(BigDecimal value3) { + this.value3 = value3; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportExperimentSiteQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportExperimentSiteQueryRespDTO.java new file mode 100644 index 0000000..67039e6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportExperimentSiteQueryRespDTO.java @@ -0,0 +1,65 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + +import lombok.Data; + +@Data +public class ReportExperimentSiteQueryRespDTO { + + private Long id; + /** + * 报告ID + */ + private Long reportId; + /** + * D + */ + private Long siteId; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 实验室所在房间 + */ + private String description; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportPersonQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportPersonQueryRespDTO.java new file mode 100644 index 0000000..cf3b8f1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportPersonQueryRespDTO.java @@ -0,0 +1,116 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 风险评估报告-评估专家 + */ +public class ReportPersonQueryRespDTO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 审批阶段排序 + */ + private Integer approveIndex; + /** + * 审批阶段名称 + */ + private String approveStage; + /** + * 审批意见说明 + */ + private String approveDesc; + /** + * 审批时间 + */ + private LocalDateTime approveTime; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approveStatus; + /** + * 审批人(一旦结束,此信息不再修改) + */ + private String approvePerson; + /** + * 审批人id + */ + private Long approvePersonId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getApproveIndex() { + return approveIndex; + } + + public void setApproveIndex(Integer approveIndex) { + this.approveIndex = approveIndex; + } + + public String getApproveStage() { + return approveStage; + } + + public void setApproveStage(String approveStage) { + this.approveStage = approveStage; + } + + public String getApproveDesc() { + return approveDesc; + } + + public void setApproveDesc(String approveDesc) { + this.approveDesc = approveDesc; + } + + public LocalDateTime getApproveTime() { + return approveTime; + } + + public void setApproveTime(LocalDateTime approveTime) { + this.approveTime = approveTime; + } + + public Byte getApproveStatus() { + return approveStatus; + } + + public void setApproveStatus(Byte approveStatus) { + this.approveStatus = approveStatus; + } + + public String getApprovePerson() { + return approvePerson; + } + + public void setApprovePerson(String approvePerson) { + this.approvePerson = approvePerson; + } + + public Long getApprovePersonId() { + return approvePersonId; + } + + public void setApprovePersonId(Long approvePersonId) { + this.approvePersonId = approvePersonId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportQueryRespDTO.java new file mode 100644 index 0000000..6562c49 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportQueryRespDTO.java @@ -0,0 +1,156 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 风险评估报告 + */ +@Data +public class ReportQueryRespDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + * (文字描述可能不再修改) + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long personUserId; + /** + * 实验负责人(文字描述可能不再修改) + */ + private String personUser; + /** + * 实验负责人手机 + */ + private Long personUserPhone; + /** + * 安全负责人id + */ + private Long safePersonUserId; + /** + * 安全负责人((文字描述可能不再修改) + */ + private String safePersonUser; + /** + * 安全负责人手机 + */ + private Long safePersonUserPhone; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + /** + * 评估人id + */ + private Long assessPersonId; + /** + * 评估人 + */ + private String assessPerson; + /** + * 评估时间 + */ + private LocalDateTime assessTime; + /** + * 实验概况 + */ + private String experimentDesc; + /** + * 实验涉及到的风险源 - 暂时不用 + */ +// private String experimentRiskSource; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approvePlanStatus; + /** + * 实验室id + */ + private Long siteId; + /** + * 实验室 + */ + private String site; + /** + * 最后修改人 + */ + private String updateByUserName; + /** + * 新建人 + */ + private String createByUserName; + /** + * 评级依据 + */ + private String description; + /** + * + */ + private String experimentCode; + /** + * + */ + private LocalDateTime evaluateTime; + + List<ReportPersonQueryRespDTO> person; + /** + * 风险源类型 + */ + List<ReportSourceTypeQueryRespDTO> riskSourceType; + /** + * 风险源信息 + */ + List<ReportRiskSourceQueryRespDTO> riskSource; + /** + * + */ + List<ReportExperimentSiteQueryRespDTO> experimentSite; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportRiskSourceQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportRiskSourceQueryRespDTO.java new file mode 100644 index 0000000..3045c6e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportRiskSourceQueryRespDTO.java @@ -0,0 +1,93 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + + +import java.time.LocalDateTime; + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +public class ReportRiskSourceQueryRespDTO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 排序 + */ + private Integer riskSourceIndex; + /** + * 危险源 + */ + private String riskSource; + /** + * 危险特性 + */ + private String riskCharacteristic; + /** + * 数量 + */ + private Integer number; + /** + * 说明 + */ + private String description; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getRiskSourceIndex() { + return riskSourceIndex; + } + + public void setRiskSourceIndex(Integer riskSourceIndex) { + this.riskSourceIndex = riskSourceIndex; + } + + public String getRiskSource() { + return riskSource; + } + + public void setRiskSource(String riskSource) { + this.riskSource = riskSource; + } + + public String getRiskCharacteristic() { + return riskCharacteristic; + } + + public void setRiskCharacteristic(String riskCharacteristic) { + this.riskCharacteristic = riskCharacteristic; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportSourceTypeQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportSourceTypeQueryRespDTO.java new file mode 100644 index 0000000..fcd3077 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/ReportSourceTypeQueryRespDTO.java @@ -0,0 +1,56 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + +import java.time.LocalDateTime; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public class ReportSourceTypeQueryRespDTO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private String riskSourceType; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public String getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(String riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanListRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanListRespDTO.java new file mode 100644 index 0000000..2adff38 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanListRespDTO.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * + */ +public class RiskAssessPlanListRespDTO { + + private Long id; + + /** + * 评估计划名称 + */ + private String assessPlanName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getAssessPlanName() { + return assessPlanName; + } + + public void setAssessPlanName(String assessPlanName) { + this.assessPlanName = assessPlanName; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanQueryRespDTO.java new file mode 100644 index 0000000..52efd59 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessPlanQueryRespDTO.java @@ -0,0 +1,165 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * + */ +@Data +public class RiskAssessPlanQueryRespDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 风险分析单元id + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 计划制定人人姓名 + */ + private String planUserName; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessQueryRespDTO.java new file mode 100644 index 0000000..26c0682 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessQueryRespDTO.java @@ -0,0 +1,127 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + + +import com.gkhy.labRiskManage.domain.riskReport.model.dto.FactorQueryDTO; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 风险辨识与评价 + * */ +@Data +public class RiskAssessQueryRespDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 风险分析单元id + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + + private List<FactorQueryDTO> factorQueryDTOList; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessQueryRespDTO_0223bak.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessQueryRespDTO_0223bak.java new file mode 100644 index 0000000..410d988 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskAssessQueryRespDTO_0223bak.java @@ -0,0 +1,897 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 风险辨识与评价 + * */ +public class RiskAssessQueryRespDTO_0223bak { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 风险分析单元 + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 类比法_检查项目id + */ + private Long analogyId; + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + + private Long hazopId; + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + private Long jhaId; + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + + private Long phaId; + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + + private Long sclId; + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + + + + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + + private Long LecId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + + private Long LsId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + private Long MesId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + + private Long RsId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public Long getAnalogyId() { + return analogyId; + } + + public void setAnalogyId(Long analogyId) { + this.analogyId = analogyId; + } + + public String getAnalogyCheckItem() { + return analogyCheckItem; + } + + public void setAnalogyCheckItem(String analogyCheckItem) { + this.analogyCheckItem = analogyCheckItem; + } + + public String getAnalogyRiskFactor() { + return analogyRiskFactor; + } + + public void setAnalogyRiskFactor(String analogyRiskFactor) { + this.analogyRiskFactor = analogyRiskFactor; + } + + public String getAnalogyResult() { + return analogyResult; + } + + public void setAnalogyResult(String analogyResult) { + this.analogyResult = analogyResult; + } + + public String getAnalogyReference() { + return analogyReference; + } + + public void setAnalogyReference(String analogyReference) { + this.analogyReference = analogyReference; + } + + public Long getHazopId() { + return hazopId; + } + + public void setHazopId(Long hazopId) { + this.hazopId = hazopId; + } + + public String getHazopNode() { + return hazopNode; + } + + public void setHazopNode(String hazopNode) { + this.hazopNode = hazopNode; + } + + public String getHazopParam() { + return hazopParam; + } + + public void setHazopParam(String hazopParam) { + this.hazopParam = hazopParam; + } + + public String getHazopParamDesc() { + return hazopParamDesc; + } + + public void setHazopParamDesc(String hazopParamDesc) { + this.hazopParamDesc = hazopParamDesc; + } + + public String getHazopGuide() { + return hazopGuide; + } + + public void setHazopGuide(String hazopGuide) { + this.hazopGuide = hazopGuide; + } + + public String getHazopDeviation() { + return hazopDeviation; + } + + public void setHazopDeviation(String hazopDeviation) { + this.hazopDeviation = hazopDeviation; + } + + public String getHazopPossibleCauses() { + return hazopPossibleCauses; + } + + public void setHazopPossibleCauses(String hazopPossibleCauses) { + this.hazopPossibleCauses = hazopPossibleCauses; + } + + public String getHazopResult() { + return hazopResult; + } + + public void setHazopResult(String hazopResult) { + this.hazopResult = hazopResult; + } + + public Long getJhaId() { + return jhaId; + } + + public void setJhaId(Long jhaId) { + this.jhaId = jhaId; + } + + public String getJhaCheckItem() { + return jhaCheckItem; + } + + public void setJhaCheckItem(String jhaCheckItem) { + this.jhaCheckItem = jhaCheckItem; + } + + public String getJhaRiskFactor() { + return jhaRiskFactor; + } + + public void setJhaRiskFactor(String jhaRiskFactor) { + this.jhaRiskFactor = jhaRiskFactor; + } + + public String getJhaResult() { + return jhaResult; + } + + public void setJhaResult(String jhaResult) { + this.jhaResult = jhaResult; + } + + public Long getPhaId() { + return phaId; + } + + public void setPhaId(Long phaId) { + this.phaId = phaId; + } + + public String getPhaCheckItem() { + return phaCheckItem; + } + + public void setPhaCheckItem(String phaCheckItem) { + this.phaCheckItem = phaCheckItem; + } + + public String getPhaRiskFactor() { + return phaRiskFactor; + } + + public void setPhaRiskFactor(String phaRiskFactor) { + this.phaRiskFactor = phaRiskFactor; + } + + public String getPhaResult() { + return phaResult; + } + + public void setPhaResult(String phaResult) { + this.phaResult = phaResult; + } + + public Long getSclId() { + return sclId; + } + + public void setSclId(Long sclId) { + this.sclId = sclId; + } + + public String getSclCheckItem() { + return sclCheckItem; + } + + public void setSclCheckItem(String sclCheckItem) { + this.sclCheckItem = sclCheckItem; + } + + public String getSclCheckStandard() { + return sclCheckStandard; + } + + public void setSclCheckStandard(String sclCheckStandard) { + this.sclCheckStandard = sclCheckStandard; + } + + public String getSclCheckUnstandard() { + return sclCheckUnstandard; + } + + public void setSclCheckUnstandard(String sclCheckUnstandard) { + this.sclCheckUnstandard = sclCheckUnstandard; + } + + public String getSclCheckResult() { + return sclCheckResult; + } + + public void setSclCheckResult(String sclCheckResult) { + this.sclCheckResult = sclCheckResult; + } + + public BigDecimal getRiskValue() { + return riskValue; + } + + public void setRiskValue(BigDecimal riskValue) { + this.riskValue = riskValue; + } + + public Byte getRiskLevelValue() { + return riskLevelValue; + } + + public void setRiskLevelValue(Byte riskLevelValue) { + this.riskLevelValue = riskLevelValue; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getRiskColor() { + return riskColor; + } + + public void setRiskColor(Byte riskColor) { + this.riskColor = riskColor; + } + + public Byte getManageLevel() { + return manageLevel; + } + + public void setManageLevel(Byte manageLevel) { + this.manageLevel = manageLevel; + } + + public Long getLecId() { + return LecId; + } + + public void setLecId(Long lecId) { + LecId = lecId; + } + + public BigDecimal getLecL() { + return lecL; + } + + public void setLecL(BigDecimal lecL) { + this.lecL = lecL; + } + + public BigDecimal getLecE() { + return lecE; + } + + public void setLecE(BigDecimal lecE) { + this.lecE = lecE; + } + + public BigDecimal getLecC() { + return lecC; + } + + public void setLecC(BigDecimal lecC) { + this.lecC = lecC; + } + + public Long getLsId() { + return LsId; + } + + public void setLsId(Long lsId) { + LsId = lsId; + } + + public BigDecimal getLsL() { + return lsL; + } + + public void setLsL(BigDecimal lsL) { + this.lsL = lsL; + } + + public BigDecimal getLsS() { + return lsS; + } + + public void setLsS(BigDecimal lsS) { + this.lsS = lsS; + } + + public Long getMesId() { + return MesId; + } + + public void setMesId(Long mesId) { + MesId = mesId; + } + + public BigDecimal getMesM() { + return mesM; + } + + public void setMesM(BigDecimal mesM) { + this.mesM = mesM; + } + + public BigDecimal getMesE() { + return mesE; + } + + public void setMesE(BigDecimal mesE) { + this.mesE = mesE; + } + + public BigDecimal getMesS() { + return mesS; + } + + public void setMesS(BigDecimal mesS) { + this.mesS = mesS; + } + + public Long getRsId() { + return RsId; + } + + public void setRsId(Long rsId) { + RsId = rsId; + } + + public BigDecimal getRsR() { + return rsR; + } + + public void setRsR(BigDecimal rsR) { + this.rsR = rsR; + } + + public BigDecimal getRsS() { + return rsS; + } + + public void setRsS(BigDecimal rsS) { + this.rsS = rsS; + } + + 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 getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getAssessPlanName() { + return assessPlanName; + } + + public void setAssessPlanName(String assessPlanName) { + this.assessPlanName = assessPlanName; + } + + public Byte getRiskType() { + return riskType; + } + + public void setRiskType(Byte riskType) { + this.riskType = riskType; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Long getPlanUserId() { + return planUserId; + } + + public void setPlanUserId(Long planUserId) { + this.planUserId = planUserId; + } + + public LocalDateTime getAssessStartTime() { + return assessStartTime; + } + + public void setAssessStartTime(LocalDateTime assessStartTime) { + this.assessStartTime = assessStartTime; + } + + public LocalDateTime getAssessEndTime() { + return assessEndTime; + } + + public void setAssessEndTime(LocalDateTime assessEndTime) { + this.assessEndTime = assessEndTime; + } + + public LocalDateTime getIdentificationTime() { + return identificationTime; + } + + public void setIdentificationTime(LocalDateTime identificationTime) { + this.identificationTime = identificationTime; + } + + public LocalDateTime getEvaluateTime() { + return evaluateTime; + } + + public void setEvaluateTime(LocalDateTime evaluateTime) { + this.evaluateTime = evaluateTime; + } + + public Byte getPlanSellStatus() { + return planSellStatus; + } + + public void setPlanSellStatus(Byte planSellStatus) { + this.planSellStatus = planSellStatus; + } + + public LocalDateTime getPlanSellTime() { + return planSellTime; + } + + public void setPlanSellTime(LocalDateTime planSellTime) { + this.planSellTime = planSellTime; + } + + public Byte getPlanExecStatus() { + return planExecStatus; + } + + public void setPlanExecStatus(Byte planExecStatus) { + this.planExecStatus = planExecStatus; + } + + public Byte getPlanTimeStatus() { + return planTimeStatus; + } + + public void setPlanTimeStatus(Byte planTimeStatus) { + this.planTimeStatus = planTimeStatus; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + + public String getIdentificationUser() { + return identificationUser; + } + + public void setIdentificationUser(String identificationUser) { + this.identificationUser = identificationUser; + } + + public Long getIdentificationUserId() { + return identificationUserId; + } + + public void setIdentificationUserId(Long identificationUserId) { + this.identificationUserId = identificationUserId; + } + + public Byte getEvaluateMethod() { + return evaluateMethod; + } + + public void setEvaluateMethod(Byte evaluateMethod) { + this.evaluateMethod = evaluateMethod; + } + + public Long getEvaluateUserId() { + return evaluateUserId; + } + + public void setEvaluateUserId(Long evaluateUserId) { + this.evaluateUserId = evaluateUserId; + } + + public String getEvaluateUser() { + return evaluateUser; + } + + public void setEvaluateUser(String evaluateUser) { + this.evaluateUser = evaluateUser; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskUnitListQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskUnitListQueryRespDTO.java new file mode 100644 index 0000000..aeacffa --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskUnitListQueryRespDTO.java @@ -0,0 +1,35 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + + +import lombok.Data; + +@Data +public class RiskUnitListQueryRespDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 风险单元描述 + */ + private String description; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + /** + * 风险单元类型id + */ + private String riskUnitType; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskUnitQueryRespDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskUnitQueryRespDTO.java new file mode 100644 index 0000000..86108fc --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/riskReport/dto/respDto/RiskUnitQueryRespDTO.java @@ -0,0 +1,103 @@ +package com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto; + + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class RiskUnitQueryRespDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 实验名称 + */ + private String experimentName; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Byte riskType; + + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 负责人 + */ + private String liabilityUser; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 最后修改人名称 + */ + private String updateByUser; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 新建人名称 + */ + private String createByUser; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + /** + * 风险单元类型 + */ + private String riskUnitType; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/MenuManageController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/MenuManageController.java new file mode 100644 index 0000000..1e88e1f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/MenuManageController.java @@ -0,0 +1,91 @@ +package com.gkhy.labRiskManage.api.controller.sysAdmin; + +import com.gkhy.labRiskManage.api.controller.sysAdmin.converter.MenuInfoApiConverter; +import com.gkhy.labRiskManage.api.controller.model.dto.resp.MenuItemApiDTO; +import com.gkhy.labRiskManage.api.controller.sysAdmin.dto.req.AddAndUpdateMenuItemApiDTO; +import com.gkhy.labRiskManage.api.controller.sysAdmin.dto.req.MenuItemBindRoleApiDTO; +import com.gkhy.labRiskManage.api.controller.sysAdmin.dto.req.RoleBindMenuApiDTO; +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.req.*; +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.resp.MenuItemAppDTO; +import com.gkhy.labRiskManage.application.sysAdmin.service.MenuAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping("/sys/console/menu") +public class MenuManageController { + + @Autowired + private MenuAppService menuAppService; + + @Autowired + private MenuInfoApiConverter menuInfoApiConverter; + + @PostMapping("/add") + public Result addMenuItems(@RequestBody AddAndUpdateMenuItemApiDTO addAndUpdateMenuItemApiDTO){ + Result result = new Result<>(); + NewMenuItemAppDTO appDTO = menuInfoApiConverter.toCreateMenuDto(addAndUpdateMenuItemApiDTO); + result = menuAppService.addMenuItem(appDTO); + return result; + } + + + @PostMapping("/mod") + public Result modifyMenuItem(@RequestBody AddAndUpdateMenuItemApiDTO addAndUpdateMenuItemApiDTO){ + Result result = new Result(); + AddAndUpdateMenuItemAppDTO appDTO = menuInfoApiConverter.toAddAndUpdateAppDTO(addAndUpdateMenuItemApiDTO); + result = menuAppService.modifyMenuItem(appDTO); + return result; + } + + @GetMapping("/get/all") + public SearchResult getAll(){ + SearchResult result = new SearchResult<>(); + SearchResult<MenuItemDomainDTO> rs = menuAppService.getAllMenuItems(); + BeanUtils.copyProperties(rs,result); + if(rs.isSuccess() && rs.getData() != null){ + List<MenuItemAppDTO> dtoList = (List<MenuItemAppDTO>) rs.getData(); + if(dtoList != null && !dtoList.isEmpty()){ + List<MenuItemApiDTO> apiDTOList = new ArrayList<>(); + dtoList.forEach(d -> { + apiDTOList.add(menuInfoApiConverter.toMenuItemApiDTO(d)); + }); + result.setData(apiDTOList); + } + } +// result = menuAppService.getAllMenuItems(); + return result; + } + + @GetMapping("/del") + public Result deleteOne(Long menuItemId){ + Result result = menuAppService.deleteMenuItem(menuItemId); + return result; + } + + @PostMapping("/bind/role2menu") + public Result roleBindMenu(@RequestBody RoleBindMenuApiDTO bindMenuApiDTO){ + Result result = new Result<>(); + RoleBindMenuAppDTO bindAppDTO = new RoleBindMenuAppDTO(); + BeanUtils.copyProperties(bindMenuApiDTO,bindAppDTO); + result = menuAppService.roleBindMenu(bindAppDTO); + return result; + } + + @PostMapping("/bind/menu2role") + public Result menuBindRole(@RequestBody MenuItemBindRoleApiDTO bindRoleApiDTO){ + Result result = new Result<>(); + MenuItemBindRoleAppDTO bindAppDTO = new MenuItemBindRoleAppDTO(); + BeanUtils.copyProperties(bindRoleApiDTO,bindAppDTO); + result = menuAppService.menuBindRole(bindAppDTO); + return result; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/UserMenuController.java b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/UserMenuController.java new file mode 100644 index 0000000..696a386 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/UserMenuController.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.api.controller.sysAdmin; + +import com.gkhy.labRiskManage.api.controller.common.BaseController; +import com.gkhy.labRiskManage.api.controller.sysAdmin.converter.MenuInfoApiConverter; +import com.gkhy.labRiskManage.api.controller.model.dto.resp.MenuItemApiDTO; +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.resp.MenuItemAppDTO; +import com.gkhy.labRiskManage.application.account.service.impl.AccountMenuAppServiceImpl; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping("/sys/menu") +public class UserMenuController extends BaseController { + + @Autowired + private AccountMenuAppServiceImpl accountMenuAppService; + + @Autowired + private MenuInfoApiConverter menuInfoApiConverter; + + + @GetMapping("/get/u") + Result<List<MenuItemAppDTO>> getAllMenuList(){ + SearchResult result = new SearchResult<>(); + SearchResult<MenuItemAppDTO> rs = accountMenuAppService.findAllMenuItemByUserId(getCurrentUserId()); + BeanUtils.copyProperties(rs,result); + if(rs.isSuccess() && rs.getData() != null){ + List<MenuItemAppDTO> dtoList = (List<MenuItemAppDTO>) rs.getData(); + if(dtoList != null && !dtoList.isEmpty()){ + List<MenuItemApiDTO> apiDTOList = new ArrayList<>(); + dtoList.forEach(d -> { + apiDTOList.add(menuInfoApiConverter.toMenuItemApiDTO(d)); + }); + result.setData(apiDTOList); + } + } + return result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/converter/MenuInfoApiConverter.java b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/converter/MenuInfoApiConverter.java new file mode 100644 index 0000000..930d863 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/converter/MenuInfoApiConverter.java @@ -0,0 +1,119 @@ +package com.gkhy.labRiskManage.api.controller.sysAdmin.converter; + +import com.gkhy.labRiskManage.api.controller.model.dto.resp.MenuItemApiDTO; +import com.gkhy.labRiskManage.api.controller.model.dto.resp.MenuItemMetaApiDTO; +import com.gkhy.labRiskManage.api.controller.sysAdmin.dto.req.AddAndUpdateMenuItemApiDTO; +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.req.AddAndUpdateMenuItemAppDTO; +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.req.NewMenuItemAppDTO; +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.resp.MenuItemAppDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class MenuInfoApiConverter { + + public MenuItemApiDTO toMenuItemApiDTO(MenuItemAppDTO menuItemAppDTO){ + if(menuItemAppDTO == null) + return null; + MenuItemApiDTO apiDTO = new MenuItemApiDTO(); + copyMenuItemInfoProperities(menuItemAppDTO,apiDTO); + apiDTO.setChildren(toMenuItemApiDTOList(menuItemAppDTO.getSubMenuItemList())); + return apiDTO; + } + + private List<MenuItemApiDTO> toMenuItemApiDTOList(List<MenuItemAppDTO> dtoList){ + if(dtoList == null) + return null; + List<MenuItemApiDTO> targetList = new ArrayList<>(); + dtoList.forEach(d -> { + MenuItemApiDTO apiDTO = new MenuItemApiDTO(); + copyMenuItemInfoProperities(d,apiDTO); + if(d.getSubMenuItemList() != null){ + apiDTO.setChildren(toMenuItemApiDTOList(d.getSubMenuItemList())); + } + targetList.add(apiDTO); + }); + return targetList; + } + + private void copyMenuItemInfoProperities(MenuItemAppDTO orignDTO, MenuItemApiDTO targetDTO){ + if(orignDTO == null || targetDTO == null) + return; + targetDTO.setId(orignDTO.getId()); + targetDTO.setLevel(orignDTO.getLevel()); + targetDTO.setParentId(orignDTO.getParentId()); + targetDTO.setName(orignDTO.getName()); + targetDTO.setPath(orignDTO.getPath()); + targetDTO.setRedirect(orignDTO.getRedirect()); + targetDTO.setDescription(orignDTO.getDescInfo()); + targetDTO.setComponent(orignDTO.getComponent()); + targetDTO.setPriority(orignDTO.getPriority()); + targetDTO.setPublic(orignDTO.getPublicable()); + MenuItemMetaApiDTO meta = new MenuItemMetaApiDTO(); + meta.setTitle(orignDTO.getTitle()); + meta.setIcon(orignDTO.getIcon()); + meta.setIsHide(orignDTO.getVisiable()); + meta.setIsAffix(orignDTO.getAffixable()); + meta.setIsIframe(orignDTO.getIframeable()); + meta.setIsKeepAlive(orignDTO.getAliveable()); + meta.setIsLink(orignDTO.getLink()); + meta.setRoles(orignDTO.getRoles()); + if(meta.getIsLink() == null) + meta.setIsLink(""); + targetDTO.setMeta(meta); + if(orignDTO.getSubMenuItemList() != null && !orignDTO.getSubMenuItemList().isEmpty()){ + List<MenuItemApiDTO> childs = new ArrayList<>(); + orignDTO.getSubMenuItemList().forEach(orign -> { + MenuItemApiDTO dd = new MenuItemApiDTO(); + copyMenuItemInfoProperities(orign,dd); + childs.add(dd); + }); + targetDTO.setChildren(childs); + } + } + + public NewMenuItemAppDTO toCreateMenuDto(AddAndUpdateMenuItemApiDTO addAndUpdateMenuItemApiDTO){ + if(addAndUpdateMenuItemApiDTO == null) + return null; + NewMenuItemAppDTO dto = new NewMenuItemAppDTO(); + BeanUtils.copyProperties(addAndUpdateMenuItemApiDTO,dto); + // + dto.setDescInfo(addAndUpdateMenuItemApiDTO.getDescription()); + // + if(addAndUpdateMenuItemApiDTO.getMeta() != null){ + dto.setLink(addAndUpdateMenuItemApiDTO.getMeta().getIsLink()); + dto.setTitle(addAndUpdateMenuItemApiDTO.getMeta().getTitle()); + dto.setVisiable(addAndUpdateMenuItemApiDTO.getMeta().getIsHide()); + dto.setIframeable(addAndUpdateMenuItemApiDTO.getMeta().getIsIframe()); + dto.setAliveable(addAndUpdateMenuItemApiDTO.getMeta().getIsKeepAlive()); + dto.setAffixable(addAndUpdateMenuItemApiDTO.getMeta().getIsAffix()); + dto.setIcon(addAndUpdateMenuItemApiDTO.getMeta().getIcon()); + dto.setRoles(addAndUpdateMenuItemApiDTO.getMeta().getRoles()); + } + // + return dto; + } + + public AddAndUpdateMenuItemAppDTO toAddAndUpdateAppDTO(AddAndUpdateMenuItemApiDTO addAndUpdateMenuItemApiDTO){ + if(addAndUpdateMenuItemApiDTO == null) + return null; + AddAndUpdateMenuItemAppDTO appDTO = new AddAndUpdateMenuItemAppDTO(); + BeanUtils.copyProperties(addAndUpdateMenuItemApiDTO,appDTO); + appDTO.setMenuItemId(addAndUpdateMenuItemApiDTO.getId()); + appDTO.setDescInfo(addAndUpdateMenuItemApiDTO.getDescription()); + if(addAndUpdateMenuItemApiDTO.getMeta() != null){ + appDTO.setLink(addAndUpdateMenuItemApiDTO.getMeta().getIsLink()); + appDTO.setTitle(addAndUpdateMenuItemApiDTO.getMeta().getTitle()); + appDTO.setVisiable(addAndUpdateMenuItemApiDTO.getMeta().getIsHide()); + appDTO.setIframeable(addAndUpdateMenuItemApiDTO.getMeta().getIsIframe()); + appDTO.setAliveable(addAndUpdateMenuItemApiDTO.getMeta().getIsKeepAlive()); + appDTO.setAffixable(addAndUpdateMenuItemApiDTO.getMeta().getIsAffix()); + appDTO.setIcon(addAndUpdateMenuItemApiDTO.getMeta().getIcon()); + appDTO.setRoles(addAndUpdateMenuItemApiDTO.getMeta().getRoles()); + } + return appDTO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/AddAndUpdateMenuItemApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/AddAndUpdateMenuItemApiDTO.java new file mode 100644 index 0000000..c9af709 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/AddAndUpdateMenuItemApiDTO.java @@ -0,0 +1,104 @@ +package com.gkhy.labRiskManage.api.controller.sysAdmin.dto.req; + +public class AddAndUpdateMenuItemApiDTO { + + private Long id; + + private Long parentId; + + private String description; + + private String name; + + private String path; + + private String redirect; + + private Byte priority; + + private String component; + + private Boolean publicable; + + private MenuItemMetaDTO meta; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public MenuItemMetaDTO getMeta() { + return meta; + } + + public void setMeta(MenuItemMetaDTO meta) { + this.meta = meta; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/MenuItemBindRoleApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/MenuItemBindRoleApiDTO.java new file mode 100644 index 0000000..5ed5cb5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/MenuItemBindRoleApiDTO.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.api.controller.sysAdmin.dto.req; + +import java.util.List; + +public class MenuItemBindRoleApiDTO { + + private Long menuItemId; + + private List<Long> bindRoleIdList; + + private List<Long> unbindRoleIdList; + + public Long getMenuItemId() { + return menuItemId; + } + + public void setMenuItemId(Long menuItemId) { + this.menuItemId = menuItemId; + } + + public List<Long> getBindRoleIdList() { + return bindRoleIdList; + } + + public void setBindRoleIdList(List<Long> bindRoleIdList) { + this.bindRoleIdList = bindRoleIdList; + } + + public List<Long> getUnbindRoleIdList() { + return unbindRoleIdList; + } + + public void setUnbindRoleIdList(List<Long> unbindRoleIdList) { + this.unbindRoleIdList = unbindRoleIdList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/MenuItemMetaDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/MenuItemMetaDTO.java new file mode 100644 index 0000000..73a3f73 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/MenuItemMetaDTO.java @@ -0,0 +1,117 @@ +package com.gkhy.labRiskManage.api.controller.sysAdmin.dto.req; + +import java.util.List; + +public class MenuItemMetaDTO { + private String title; + + private String isLink; + + private Boolean isHide; + + private Boolean isKeepAlive; + + private Boolean isAffix; + + private Boolean isIframe; + + private String icon; + + private List<Long> roles; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getIsLink() { + return isLink; + } + + public void setIsLink(String isLink) { + this.isLink = isLink; + } + + public Boolean getIsHide() { + return isHide; + } + + public void setIsHide(Boolean hide) { + isHide = hide; + } + + public Boolean getIsKeepAlive() { + return isKeepAlive; + } + + public void setIsKeepAlive(Boolean keepAlive) { + isKeepAlive = keepAlive; + } + + public Boolean getIsAffix() { + return isAffix; + } + + public void setIsAffix(Boolean affix) { + isAffix = affix; + } + + public Boolean getIsIframe() { + return isIframe; + } + + public void setIsIframe(Boolean iframe) { + isIframe = iframe; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Boolean getHide() { + return isHide; + } + + public void setHide(Boolean hide) { + isHide = hide; + } + + public Boolean getKeepAlive() { + return isKeepAlive; + } + + public void setKeepAlive(Boolean keepAlive) { + isKeepAlive = keepAlive; + } + + public Boolean getAffix() { + return isAffix; + } + + public void setAffix(Boolean affix) { + isAffix = affix; + } + + public Boolean getIframe() { + return isIframe; + } + + public void setIframe(Boolean iframe) { + isIframe = iframe; + } + + public List<Long> getRoles() { + return roles; + } + + public void setRoles(List<Long> roles) { + this.roles = roles; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/ModifyMenuItemApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/ModifyMenuItemApiDTO.java new file mode 100644 index 0000000..4a590ba --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/ModifyMenuItemApiDTO.java @@ -0,0 +1,104 @@ +package com.gkhy.labRiskManage.api.controller.sysAdmin.dto.req; + +public class ModifyMenuItemApiDTO { + + private Long id; + + private Long parentId; + + private String description; + + private String name; + + private String path; + + private String redirect; + + private Byte priority; + + private String component; + + private Boolean publicable; + + private MenuItemMetaDTO meta; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public MenuItemMetaDTO getMeta() { + return meta; + } + + public void setMeta(MenuItemMetaDTO meta) { + this.meta = meta; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/RoleBindMenuApiDTO.java b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/RoleBindMenuApiDTO.java new file mode 100644 index 0000000..d791e88 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/api/controller/sysAdmin/dto/req/RoleBindMenuApiDTO.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.api.controller.sysAdmin.dto.req; + +import java.util.List; + +public class RoleBindMenuApiDTO { + + private Long roleId; + + private List<Long> bindMenuItemIdList; + + private List<Long> unbindMenuItemIdList; + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public List<Long> getBindMenuItemIdList() { + return bindMenuItemIdList; + } + + public void setBindMenuItemIdList(List<Long> bindMenuItemIdList) { + this.bindMenuItemIdList = bindMenuItemIdList; + } + + public List<Long> getUnbindMenuItemIdList() { + return unbindMenuItemIdList; + } + + public void setUnbindMenuItemIdList(List<Long> unbindMenuItemIdList) { + this.unbindMenuItemIdList = unbindMenuItemIdList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/converter/RoleInfoAppConverter.java b/src/main/java/com/gkhy/labRiskManage/application/account/converter/RoleInfoAppConverter.java new file mode 100644 index 0000000..c087142 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/converter/RoleInfoAppConverter.java @@ -0,0 +1,18 @@ +package com.gkhy.labRiskManage.application.account.converter; + +import com.gkhy.labRiskManage.application.account.dto.respDto.RoleRespDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.RoleInfoDoaminDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +@Service +public class RoleInfoAppConverter { + + public RoleRespDTO toRoleRespDTO(RoleInfoDoaminDTO roleInfoDoaminDTO){ + if(roleInfoDoaminDTO == null) + return null; + RoleRespDTO respDTO = new RoleRespDTO(); + BeanUtils.copyProperties(roleInfoDoaminDTO,respDTO); + return respDTO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/converter/UserIndentityAppConverter.java b/src/main/java/com/gkhy/labRiskManage/application/account/converter/UserIndentityAppConverter.java new file mode 100644 index 0000000..3a1be6a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/converter/UserIndentityAppConverter.java @@ -0,0 +1,28 @@ +package com.gkhy.labRiskManage.application.account.converter; + +import com.gkhy.labRiskManage.application.account.dto.respDto.UserIndentityAppDTO; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.UserIdentityDomainDTO; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 14:08 + */ +@Component +public class UserIndentityAppConverter { + public List<UserIndentityAppDTO> toUserIndentityAppDTO(List<UserIdentityDomainDTO> list) { + List<UserIndentityAppDTO> respList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(list)){ + respList = BeanCopyUtils.copyBeanList(list,UserIndentityAppDTO.class); + } + return respList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/converter/UserInfoAppConverter.java b/src/main/java/com/gkhy/labRiskManage/application/account/converter/UserInfoAppConverter.java new file mode 100644 index 0000000..32f3e02 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/converter/UserInfoAppConverter.java @@ -0,0 +1,69 @@ +package com.gkhy.labRiskManage.application.account.converter; + + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.api.controller.account.dto.resp.UserIdentityBindApiDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserIdentityBindAppRespDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserInfoAppRespDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserRoleBindAppRespDTO; +import com.gkhy.labRiskManage.application.attachment.service.dto.resp.AttachmentAppRespDTO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.attachment.dto.resp.AttachmentDomainDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class UserInfoAppConverter { + + public List<UserInfoAppRespDTO> toAppDtoList(List<UserInfoDomainDTO> domainDtoList){ + if(domainDtoList == null || domainDtoList.isEmpty()) + return null; + List<UserInfoAppRespDTO> appRespDTOList = new ArrayList<>(); + domainDtoList.forEach(d -> { + appRespDTOList.add(toAppDto(d)); + }); + return appRespDTOList; + } + + public UserInfoAppRespDTO toAppDto(UserInfoDomainDTO domainDto){ + if(domainDto == null) + return null; + UserInfoAppRespDTO appDto = new UserInfoAppRespDTO(); + BeanUtils.copyProperties(domainDto,appDto); + List<UserRoleBindAppRespDTO> userRoleBindAppRespDTOS = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(domainDto.getRoles())){ + domainDto.getRoles().forEach(role -> { + userRoleBindAppRespDTOS.add(toUserRoleAppRestDTO(role)); + }); + } + appDto.setRoles(userRoleBindAppRespDTOS); + //身份 + List<UserIdentityBindAppRespDTO> userIdentityBindAppDTOS = new ArrayList<>(); + if(domainDto.getUserIdentities() != null){ + userIdentityBindAppDTOS = BeanCopyUtils.copyBeanList(domainDto.getUserIdentities(), UserIdentityBindAppRespDTO.class); + } + //资质附件 + if(domainDto.getQualificationAttDomainDTO() != null){ + AttachmentAppRespDTO attachmentAppRespDTO = new AttachmentAppRespDTO(); + BeanUtils.copyProperties(domainDto.getQualificationAttDomainDTO(),attachmentAppRespDTO); + appDto.setQualificationAttaAppRespDTO(attachmentAppRespDTO); + } + appDto.setUserIdentities(userIdentityBindAppDTOS); + return appDto; + } + + private UserRoleBindAppRespDTO toUserRoleAppRestDTO(SysUserRoleBindDomainDTO role) { + if(role == null){ + return null; + } + UserRoleBindAppRespDTO userRoleBindAppRespDTO = new UserRoleBindAppRespDTO(); + BeanUtils.copyProperties(role,userRoleBindAppRespDTO); + return userRoleBindAppRespDTO; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/ChangePasswdReqDto.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/ChangePasswdReqDto.java new file mode 100644 index 0000000..afc408b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/ChangePasswdReqDto.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.application.account.dto.repDto; + +public class ChangePasswdReqDto { + + public Long uid; + + private String oldPwd; + + private String newPwd; + + public Long getUid() { + return uid; + } + + public void setUid(Long uid) { + this.uid = uid; + } + + public String getOldPwd() { + return oldPwd; + } + + public void setOldPwd(String oldPwd) { + this.oldPwd = oldPwd; + } + + public String getNewPwd() { + return newPwd; + } + + public void setNewPwd(String newPwd) { + this.newPwd = newPwd; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/CreateNewUserAppReqDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/CreateNewUserAppReqDTO.java new file mode 100644 index 0000000..b073b0b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/CreateNewUserAppReqDTO.java @@ -0,0 +1,32 @@ +package com.gkhy.labRiskManage.application.account.dto.repDto; + +import lombok.Data; + +import java.util.List; + +@Data +public class CreateNewUserAppReqDTO { + + private String name; + + private String realName; + + private String pwd; + + private List<Long> roleIds; + + + private String phone; + + private Byte idType; + + private String idSerial; + + private Long depId; + + private Byte identityStatus; + + private List<Long> identityIds; + + private Long qualificationAttId; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/LoginReqAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/LoginReqAppDTO.java new file mode 100644 index 0000000..4b12e8f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/LoginReqAppDTO.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.application.account.dto.repDto; + +public class LoginReqAppDTO { + + private String name; + + private String phone; + + private String pwd; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getPwd() { + return pwd; + } + + public void setPwd(String pwd) { + this.pwd = pwd; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/SysDepartmentAppAddReqDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/SysDepartmentAppAddReqDTO.java new file mode 100644 index 0000000..cfc82ec --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/SysDepartmentAppAddReqDTO.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.application.account.dto.repDto; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; + + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/7 + * @time: 17:00 + */ +@Data +public class SysDepartmentAppAddReqDTO { + + private Long id; + /** + * 部门 + */ + private String depName; + /** + * 等级 + */ + private Byte level; + /** + * 父级id + */ + private Long parentId; + /** + * 描述 + */ + private String info; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/SysDepartmentAppUpdateReqDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/SysDepartmentAppUpdateReqDTO.java new file mode 100644 index 0000000..8a1fda0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/SysDepartmentAppUpdateReqDTO.java @@ -0,0 +1,27 @@ +package com.gkhy.labRiskManage.application.account.dto.repDto; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/7 + * @time: 13:25 + */ +@Data +public class SysDepartmentAppUpdateReqDTO { + + private Long id; + /** + * 部门 + */ + private String depName; + /** + * 描述 + */ + private String info; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/UpdateUserAppReqDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/UpdateUserAppReqDTO.java new file mode 100644 index 0000000..62a0b85 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/repDto/UpdateUserAppReqDTO.java @@ -0,0 +1,32 @@ +package com.gkhy.labRiskManage.application.account.dto.repDto; + +import lombok.Data; + +import java.util.List; +@Data +public class UpdateUserAppReqDTO { + + private Long id; + + private String name; + + private String realName; + + private List<Long> roleIds; + + + private String phone; + + private Byte idType; + + private String idSerial; + + private Long depId; + + private Byte identityStatus; + + private List<Long> identityIds; + + private Long qualificationAttId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/ContextUserDto.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/ContextUserDto.java new file mode 100644 index 0000000..5527e06 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/ContextUserDto.java @@ -0,0 +1,57 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +public class ContextUserDto { + + private Long id; + + //用户账号状态 + private Byte status; + + //所属角色ID + private Long roleId; + + private String name; + + //真实姓名 + private String realName; + + 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 Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/LoginRespDto.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/LoginRespDto.java new file mode 100644 index 0000000..ecd961b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/LoginRespDto.java @@ -0,0 +1,21 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +import lombok.Data; + +import java.util.List; + +@Data +public class LoginRespDto { + + private Long uid; + + private String name; + + private String realName; + + private String tk; + + private List<UserRoleBindRespDTO> roles; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/RoleRespDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/RoleRespDTO.java new file mode 100644 index 0000000..68f37ab --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/RoleRespDTO.java @@ -0,0 +1,24 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +public class RoleRespDTO { + + 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/gkhy/labRiskManage/application/account/dto/respDto/SysDepartmentAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/SysDepartmentAppDTO.java new file mode 100644 index 0000000..aff56f5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/SysDepartmentAppDTO.java @@ -0,0 +1,35 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +import com.gkhy.labRiskManage.domain.account.model.dto.SysDepartmentDomainDTO; +import lombok.Data; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/9 + * @time: 10:10 + */ +@Data +public class SysDepartmentAppDTO { + private Long id; + /** + * 部门 + */ + private String depName; + /** + * 等级 + */ + private Byte level; + /** + * 父级id + */ + private Long parentId; + /** + * 描述 + */ + private String info; + + private List<SysDepartmentAppDTO> children; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/TokenInfoDto.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/TokenInfoDto.java new file mode 100644 index 0000000..12c2a7c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/TokenInfoDto.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +public class TokenInfoDto { + + private Long uid; + + private String tk; + + private Long remainSecond; + + public Long getUid() { + return uid; + } + + public void setUid(Long uid) { + this.uid = uid; + } + + public String getTk() { + return tk; + } + + public void setTk(String tk) { + this.tk = tk; + } + + public Long getRemainSecond() { + return remainSecond; + } + + public void setRemainSecond(Long remainSecond) { + this.remainSecond = remainSecond; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserIdentityBindAppRespDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserIdentityBindAppRespDTO.java new file mode 100644 index 0000000..4d04c9d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserIdentityBindAppRespDTO.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 10:16 + */ +@Data +public class UserIdentityBindAppRespDTO { + private Long userIdentityId; + private String userIdentity; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserIndentityAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserIndentityAppDTO.java new file mode 100644 index 0000000..f5a91db --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserIndentityAppDTO.java @@ -0,0 +1,18 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 13:48 + */ +@Data +public class UserIndentityAppDTO { + + private Long id ; + private String identity; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserInfoAppRespDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserInfoAppRespDTO.java new file mode 100644 index 0000000..344de8b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserInfoAppRespDTO.java @@ -0,0 +1,49 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +import com.gkhy.labRiskManage.application.attachment.service.dto.resp.AttachmentAppRespDTO; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; +@Data +public class UserInfoAppRespDTO { + + private Long id; + + //用户账号状态 + private Byte status; + + //创建时间 + private LocalDateTime gmtCreate; + + //修改时间 + private LocalDateTime gmtModified; + + private String name; + + //真实姓名 + private String realName; + + private String phone; + + private Byte idType; + + private String idSerial; + private Long depId; + + private String depName; + /** + * 身份(0专家,1非专家) + */ + private Byte identityStatus; + //资质证书id + private Long qualificationAttId; + + private List<UserRoleBindAppRespDTO> roles; + + private List<UserIdentityBindAppRespDTO> userIdentities; + + private AttachmentAppRespDTO qualificationAttaAppRespDTO; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserRoleBindAppRespDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserRoleBindAppRespDTO.java new file mode 100644 index 0000000..22473e9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserRoleBindAppRespDTO.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 10:46 + */ +@Data +public class UserRoleBindAppRespDTO { + private Long roleId; + private String roleName; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserRoleBindRespDTO.java b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserRoleBindRespDTO.java new file mode 100644 index 0000000..ea3060e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/dto/respDto/UserRoleBindRespDTO.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.application.account.dto.respDto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/13 + * @time: 10:35 + */ +@Data +public class UserRoleBindRespDTO { + private Long roleId; + private String roleName; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/AccountAppService.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/AccountAppService.java new file mode 100644 index 0000000..f5c8e23 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/AccountAppService.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.application.account.service; + +import com.gkhy.labRiskManage.api.controller.account.dto.req.UserSearchReqDTO; +import com.gkhy.labRiskManage.api.controller.account.query.UserQuery; +import com.gkhy.labRiskManage.application.account.dto.repDto.ChangePasswdReqDto; +import com.gkhy.labRiskManage.application.account.dto.repDto.CreateNewUserAppReqDTO; +import com.gkhy.labRiskManage.application.account.dto.repDto.LoginReqAppDTO; +import com.gkhy.labRiskManage.application.account.dto.repDto.UpdateUserAppReqDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserInfoAppRespDTO; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.model.PageQuery; + +import java.util.List; + +public interface AccountAppService { + SearchResult<UserInfoAppRespDTO> findUserByLoginName(String loginName); + SearchResult<List<UserInfoAppRespDTO>> findUserByRealName(String name); + SearchResult<List<UserInfoAppRespDTO>> findUserByRole(Long roleId,boolean usePage,Integer page,Integer pageSize); + + + + SearchResult<UserInfoAppRespDTO> findUserByUserId(Long userId); + + SearchResult<List<UserInfoAppRespDTO>> findUserListByUserIdList(List<Long> userIdList); + + Result updateUserPassword(ChangePasswdReqDto changePasswdReqDto); + + Result updateUserStatus(Long userId, Byte status); + + Result updateUserRole(Long userId, List<Long> roleId); + + Result login(LoginReqAppDTO loginReqAppDTO); + + Result logout(Long userId); + + Result createNewUser(CreateNewUserAppReqDTO createNewUserAppReqDTO); + + Result updateUser(UpdateUserAppReqDTO updateUserAppReqDTO); + + Result deleteUser(Long userId); + + SearchResult<List<UserInfoAppRespDTO>> findUser(PageQuery<UserQuery> pageQuery); + + SearchResult<List<UserInfoAppRespDTO>> findExpert(PageQuery<UserQuery> pageQuery); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/AccountMenuAppService.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/AccountMenuAppService.java new file mode 100644 index 0000000..8a0ab5a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/AccountMenuAppService.java @@ -0,0 +1,9 @@ +package com.gkhy.labRiskManage.application.account.service; + +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.resp.MenuItemAppDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; + +public interface AccountMenuAppService { + + SearchResult<MenuItemAppDTO> findAllMenuItemByUserId(Long userId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/RoleAppService.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/RoleAppService.java new file mode 100644 index 0000000..a5915f6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/RoleAppService.java @@ -0,0 +1,18 @@ +package com.gkhy.labRiskManage.application.account.service; + +import com.gkhy.labRiskManage.application.account.dto.respDto.RoleRespDTO; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; + +import java.util.List; + +public interface RoleAppService { + + Result newRole(String roleName); + + Result deleteRole(Long roleId); + + SearchResult<List<RoleRespDTO>> findAllRoleList(); + + Result updateRoleName(Long roleId,String name); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/SysDepartmentAppService.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/SysDepartmentAppService.java new file mode 100644 index 0000000..fc48dae --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/SysDepartmentAppService.java @@ -0,0 +1,22 @@ +package com.gkhy.labRiskManage.application.account.service; + +import com.gkhy.labRiskManage.application.account.dto.repDto.SysDepartmentAppAddReqDTO; +import com.gkhy.labRiskManage.application.account.dto.repDto.SysDepartmentAppUpdateReqDTO; +import com.gkhy.labRiskManage.commons.domain.Result; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/7 + * @time: 17:12 + */ +public interface SysDepartmentAppService { + + Result save(SysDepartmentAppAddReqDTO req, Long currentUserId); + + Result update(SysDepartmentAppUpdateReqDTO req,Long currentUserId); + + Result delete(Long id, Long currentUserId); + + Result list(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/TokenAppService.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/TokenAppService.java new file mode 100644 index 0000000..59c2e57 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/TokenAppService.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.application.account.service; + +import com.gkhy.labRiskManage.application.account.dto.respDto.TokenInfoDto; +import com.gkhy.labRiskManage.commons.domain.Result; + +public interface TokenAppService { + + Result<TokenInfoDto> setToken(Long uid); + + Result resetTokenTime(Long uid); + + Result removeToken(Long uid); + + Result<TokenInfoDto> getToken(Long uid); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/UserIdentityAppService.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/UserIdentityAppService.java new file mode 100644 index 0000000..b134304 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/UserIdentityAppService.java @@ -0,0 +1,16 @@ +package com.gkhy.labRiskManage.application.account.service; + +import com.gkhy.labRiskManage.application.account.dto.respDto.UserIndentityAppDTO; +import com.gkhy.labRiskManage.commons.domain.Result; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 13:49 + */ +public interface UserIdentityAppService { + List<UserIndentityAppDTO> list(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountAppServiceImpl.java new file mode 100644 index 0000000..a1a49b1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountAppServiceImpl.java @@ -0,0 +1,409 @@ +package com.gkhy.labRiskManage.application.account.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.gkhy.labRiskManage.api.controller.account.dto.req.UserSearchReqDTO; +import com.gkhy.labRiskManage.api.controller.account.query.UserQuery; +import com.gkhy.labRiskManage.application.account.converter.UserInfoAppConverter; +import com.gkhy.labRiskManage.application.account.dto.repDto.CreateNewUserAppReqDTO; +import com.gkhy.labRiskManage.application.account.dto.repDto.UpdateUserAppReqDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.RoleRespDTO; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.domain.account.converter.UserInfoDomainConverter; +import com.gkhy.labRiskManage.application.account.dto.repDto.ChangePasswdReqDto; +import com.gkhy.labRiskManage.application.account.dto.repDto.LoginReqAppDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.LoginRespDto; +import com.gkhy.labRiskManage.application.account.dto.respDto.TokenInfoDto; +import com.gkhy.labRiskManage.domain.account.converter.UserRoleBindConverter; +import com.gkhy.labRiskManage.domain.account.enums.IdentityStatusEnum; +import com.gkhy.labRiskManage.domain.account.enums.UserStatusEnum; +import com.gkhy.labRiskManage.application.account.service.AccountAppService; +import com.gkhy.labRiskManage.application.account.service.TokenAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserInfoAppRespDTO; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.domain.account.model.bo.CreateUserBO; +import com.gkhy.labRiskManage.domain.account.model.bo.UpdateUserBO; + +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.SysUserIdentityBindDomainService; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserRoleDomainService; +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 org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class AccountAppServiceImpl implements AccountAppService { + + @Autowired + private RedissonClient redissonClient; + + @Autowired + private ObjectMapper objectMapper; + + @Autowired + private TokenAppService tokenService; + + @Autowired + private UserDomainService userDomainService; + + @Autowired + private UserInfoAppConverter userInfoAppConverter; + + @Autowired + private UserRoleDomainService userRoleDomainService; + + @Autowired + private SysUserIdentityBindDomainService identityBindDomainService; + + @Autowired + private UserRoleBindConverter converter; + + @Override + public SearchResult<UserInfoAppRespDTO> findUserByLoginName(String loginName){ + SearchResult<UserInfoAppRespDTO> result = new SearchResult<>(); + result.execSuccess(); + if(loginName == null || loginName.isEmpty()) + return result; + UserInfoDomainDTO userInfoDomainDTO = userDomainService.getUserInfoByName(loginName); + if(userInfoDomainDTO != null){ + UserInfoAppRespDTO userInfoAppRespDTO = new UserInfoDomainConverter().toUserInfoRespDTO(userInfoDomainDTO); + result.setCount(1); + result.setData(userInfoAppRespDTO); + } + return result; + } + + @Override + public SearchResult<List<UserInfoAppRespDTO>> findUserByRealName(String name) { + SearchResult<List<UserInfoAppRespDTO>> result = new SearchResult<>(); + result.setSuccess(); + List<UserInfoDomainDTO> userInfoDomainDTOS = userDomainService.findUserListByRealName(name); + if(userInfoDomainDTOS != null && !userInfoDomainDTOS.isEmpty()){ + List<UserInfoAppRespDTO> appRespDTOS = userInfoAppConverter.toAppDtoList(userInfoDomainDTOS); + result.setCount(appRespDTOS.size()); + result.setData(appRespDTOS); + } + return result; + } + + @Override + public SearchResult<List<UserInfoAppRespDTO>> findUserByRole(Long roleId, boolean usePage, Integer page, Integer pageSize) { + SearchResult<List<UserInfoAppRespDTO>> searchResult = new SearchResult<>(); + searchResult.setSuccess(); + searchResult.setUsePage(usePage); + if(usePage){ + searchResult.setPageIndex(page); + searchResult.setPageSize(pageSize); + } + SearchResult<List<UserInfoDomainDTO>> userResult = userDomainService.findUserListByRole(roleId,usePage,page, + pageSize); + BeanUtils.copyProperties(userResult,searchResult); + searchResult.setData(userInfoAppConverter.toAppDtoList((List<UserInfoDomainDTO>) userResult.getData())); + return searchResult; + } + + @Override + public SearchResult<UserInfoAppRespDTO> findUserByUserId(Long userId) { + SearchResult<UserInfoAppRespDTO> result = new SearchResult<>(); + result.execSuccess(); + if(userId == null || userId < 0) + return result; + UserInfoDomainDTO userInfoDomainDTO = userDomainService.getUserInfoById(userId); + if(userInfoDomainDTO == null){ + result.setCount(1); + return result; + } + UserInfoAppRespDTO respDTO = new UserInfoDomainConverter().toUserInfoRespDTO(userInfoDomainDTO); + result.setCount(1); + result.setData(respDTO); + return result; + } + + @Override + public SearchResult<List<UserInfoAppRespDTO>> findUserListByUserIdList(List<Long> userIdList) { + SearchResult<List<UserInfoAppRespDTO>> result = new SearchResult<>(); + result.execSuccess(); + if(userIdList == null || userIdList.isEmpty()) + return result; + List<UserInfoDomainDTO> userInfoDomainDTOList = userDomainService.getUserInfoListByIds(userIdList); + if(userInfoDomainDTOList != null && userInfoDomainDTOList.size() > 0){ + UserInfoDomainConverter userInfoDomainConverter = new UserInfoDomainConverter(); + List<UserInfoAppRespDTO> userInfoAppRespDTOList = new ArrayList<>(); + for(UserInfoDomainDTO userInfoDomainDTO : userInfoDomainDTOList){ + UserInfoAppRespDTO dto = userInfoDomainConverter.toUserInfoRespDTO(userInfoDomainDTO); + userInfoAppRespDTOList.add(dto); + } + result.setCount(userInfoAppRespDTOList.size()); + result.setData(userInfoAppRespDTOList); + } + return result; + } + + @Override + @Transactional + public Result updateUserPassword(ChangePasswdReqDto dto) { + Result result = new Result<>(); + if(userDomainService.updateUserPwd(dto.getUid(),dto.getOldPwd(),dto.getNewPwd()) == true){ + result.setSuccess(); + }else { + result.setCode(ResultCode.SYSTEM_ERROR.getCode()); + result.setMsg("修改密码失败"); + } + return result; + } + + @Override + @Transactional + public Result updateUserStatus(Long userId, Byte status) { + Result result = new Result<>(); + if(userId == null || userId < 1 || status == null){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("参数缺失"); + return result; + } + if(UserStatusEnum.prase(status) == null){ + result.setCode(ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode()); + result.setMsg("状态不支持"); + return result; + } + if(userDomainService.updateUserStatus(userId,status) == true){ + result.setSuccess(); + }else { + result.setCode(ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode()); + result.setMsg("数据库更新失败"); + } + return result; + } + + @Override + @Transactional + public Result updateUserRole(Long userId, List<Long> roleIds) { + Result result = new Result<>(); + if(userId == null || userId < 1 || roleIds == null || roleIds.size() == 0){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("参数缺失"); + return result; + } + userRoleDomainService.updateUserRole(userId,roleIds); + result.setSuccess(); + return result; + } + + @Override + public Result login(LoginReqAppDTO loginReqAppDTO) { + Result result = new Result<>(); + //1、参数校验 + if(loginReqAppDTO == null || loginReqAppDTO.getName() == null || loginReqAppDTO.getPwd() == null){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("用户名或密码不全"); + return result; + } + //2、密码校验 + UserInfoDomainDTO userInfoDomainDTO = userDomainService.getUserInfoByName(loginReqAppDTO.getName()); + if(userInfoDomainDTO == null){ + result.setCode(ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST.getCode()); + result.setMsg("用户不存在"); + return result; + } + + if(!userDomainService.checkPassword(loginReqAppDTO.getPwd(), userInfoDomainDTO.getHash(), userInfoDomainDTO.getSalt())){ + result.setCode(ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode()); + result.setMsg("密码错误"); + return result; + } + //检查用户状态 + if(userInfoDomainDTO.getStatus().equals(UserStatusEnum.STATUS_FROZEN.getStatus())){ + result.setCode(ResultCode.BUSINESS_ERROR_ACCOUNT_STATU_ABNORMAL.getCode()); + result.setMsg("该账号已被冻结"); + return result; + } + if(userInfoDomainDTO.getStatus().equals(UserStatusEnum.STATUS_DELETE.getStatus())){ + result.setCode(ResultCode.BUSINESS_ERROR_ACCOUNT_STATU_ABNORMAL.getCode()); + result.setMsg("账号无效"); + return result; + } + //设置token + Result<TokenInfoDto> setTokenResult = tokenService.setToken(userInfoDomainDTO.getId()); + if(!setTokenResult.isSuccess()){ + result.setCode(ResultCode.BUSINESS_ERROR.getCode()); + result.setMsg("系统出错"); + return result; + } + TokenInfoDto tokenInfoDto = (TokenInfoDto) setTokenResult.getData(); + if(tokenInfoDto == null || tokenInfoDto.getTk() == null || tokenInfoDto.getTk().isEmpty()){ + result.setCode(ResultCode.BUSINESS_ERROR.getCode()); + result.setMsg("系统出错"); + return result; + } + LoginRespDto loginRespDto = new LoginRespDto(); + loginRespDto.setUid(userInfoDomainDTO.getId()); + loginRespDto.setName(userInfoDomainDTO.getName()); + loginRespDto.setRealName(userInfoDomainDTO.getRealName()); + loginRespDto.setTk(tokenInfoDto.getTk()); + loginRespDto.setRoles(converter.userRoleBindConverter(userInfoDomainDTO.getRoles())); + //todo:获取其他需返回的信息 + + result.setSuccess(); + result.setData(loginRespDto); + + return result; + } + + @Override + public Result logout(Long userId) { + Result result = new Result<>(); + if(userId == null){ + result.setCode(ResultCode.PARAM_ERROR_NULL); + return result; + } + result = tokenService.removeToken(userId); + return result; + } + + @Override + @Transactional + public Result createNewUser(CreateNewUserAppReqDTO createNewUserAppReqDTO) { + Result result = new Result(); + //校验参数 + if(createNewUserAppReqDTO == null || createNewUserAppReqDTO.getName() == null || createNewUserAppReqDTO.getName().isEmpty() + || createNewUserAppReqDTO.getRealName() == null || createNewUserAppReqDTO.getRealName().isEmpty() + || createNewUserAppReqDTO.getRoleIds() == null || createNewUserAppReqDTO.getRoleIds().size() == 0 || createNewUserAppReqDTO.getIdentityStatus() == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR.getCode(),"用户信息不全"); + } + if(IdentityStatusEnum.prase(createNewUserAppReqDTO.getIdentityStatus()) == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"用户用户身份不合法"); + } + if(createNewUserAppReqDTO.getIdentityStatus().equals(IdentityStatusEnum.EXPERT.getStatus()) && createNewUserAppReqDTO.getIdentityIds() == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请选择用户身份!"); + } + //校验角色信息 + CreateUserBO createUserBO = new CreateUserBO(); + createUserBO.setName(createNewUserAppReqDTO.getName()); + createUserBO.setRealName(createNewUserAppReqDTO.getRealName()); + //如果没有提供密码,初始密码为“123456” + if(createNewUserAppReqDTO.getPwd() == null || createNewUserAppReqDTO.getPwd().isEmpty()){ + createNewUserAppReqDTO.setPwd("123456"); + } + createUserBO.setPwd(createNewUserAppReqDTO.getPwd()); + createUserBO.setPhone(createNewUserAppReqDTO.getPhone()); + createUserBO.setIdType(createNewUserAppReqDTO.getIdType()); + createUserBO.setIdSerial(createNewUserAppReqDTO.getIdSerial()); + createUserBO.setDepId(createNewUserAppReqDTO.getDepId()); + createUserBO.setIdentityStatus(createNewUserAppReqDTO.getIdentityStatus()); + createUserBO.setQualificationAttId(createNewUserAppReqDTO.getQualificationAttId()); + UserInfoDomainDTO userInfoDomainDTO = userDomainService.newUser(createUserBO); + //绑定角色 + List<SysUserRoleBindDomainDTO> sysUserRoleBindDomainDTOS = userRoleDomainService.insertBatchUserBindRole(createNewUserAppReqDTO.getRoleIds(), userInfoDomainDTO.getId()); + //绑定身份 + if(createNewUserAppReqDTO.getIdentityStatus().equals(IdentityStatusEnum.EXPERT.getStatus()) && ObjectUtil.isNotEmpty(createNewUserAppReqDTO.getIdentityIds())){ + identityBindDomainService.insertBatchUserIndentityBind(createNewUserAppReqDTO.getIdentityIds(), userInfoDomainDTO.getId()); + } + + if(userInfoDomainDTO != null){ + result.setSuccess(); + result.setCount(1); + UserInfoAppRespDTO userInfoAppRespDTO = new UserInfoDomainConverter().toUserInfoRespDTO(userInfoDomainDTO); + userInfoAppRespDTO.setRoles(converter.userRoleBindAppConverter(sysUserRoleBindDomainDTOS)); + result.setData(userInfoAppRespDTO); + }else { + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR.getCode(),"创建新用户失败"); + } + return result; + } + + @Transactional + @Override + public Result updateUser(UpdateUserAppReqDTO updateUserAppReqDTO) { + Result result = new Result<>(); + if(updateUserAppReqDTO == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR.getCode(),"参数缺失"); + } + if(IdentityStatusEnum.prase(updateUserAppReqDTO.getIdentityStatus()) == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"用户用户身份不合法"); + } + if(updateUserAppReqDTO.getIdentityStatus().equals(IdentityStatusEnum.EXPERT.getStatus()) && CollectionUtils.isEmpty(updateUserAppReqDTO.getIdentityIds())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请选择用户身份!"); + } + UpdateUserBO bo = new UpdateUserBO(); + bo.setId(updateUserAppReqDTO.getId()); + bo.setName(updateUserAppReqDTO.getName()); + bo.setRealName(updateUserAppReqDTO.getRealName()); + bo.setIdType(updateUserAppReqDTO.getIdType()); + bo.setIdSerial(updateUserAppReqDTO.getIdSerial()); + bo.setPhone(updateUserAppReqDTO.getPhone()); + bo.setDepId(updateUserAppReqDTO.getDepId()); + bo.setIdentityStatus(updateUserAppReqDTO.getIdentityStatus()); + bo.setQualificationAttId(updateUserAppReqDTO.getQualificationAttId()); + UserInfoDomainDTO updateRs = userDomainService.updateUserInfo(bo); + //修改用户绑定角色 + userRoleDomainService.updateUserRole(updateUserAppReqDTO.getId(), updateUserAppReqDTO.getRoleIds()); + //绑定身份 + if(updateUserAppReqDTO.getIdentityStatus().equals(IdentityStatusEnum.EXPERT.getStatus())){ + identityBindDomainService.updateBatchUserIndentityBind(updateUserAppReqDTO.getIdentityIds(), updateUserAppReqDTO.getId()); + } + if(updateUserAppReqDTO.getIdentityStatus().equals(IdentityStatusEnum.NOT_EXPERT.getStatus())){ + identityBindDomainService.deleteByUser(updateUserAppReqDTO.getId()); + } + + if(updateRs != null){ + result.setSuccess(); + result.setCount(1); + result.setData(updateRs); + }else { + result.setCode(ResultCode.BUSINESS_ERROR); + } + return result; + } + + @Transactional + @Override + public Result deleteUser(Long userId) { + Result result = new Result<>(); + if(userId == null){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("参数缺失"); + return result; + } + if(userDomainService.deleteUser(userId) == true && userRoleDomainService.deleteByUser(userId) == true && identityBindDomainService.deleteByUser(userId) == true){ + result.setCode(ResultCode.OK); + result.setMsg("数据库更新成功"); + }else { + result.setCode(ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode()); + result.setMsg("数据库更新失败"); + } + return result; + } + + @Override + public SearchResult<List<UserInfoAppRespDTO>> findUser(PageQuery<UserQuery> pageQuery) { + SearchResult<List<UserInfoAppRespDTO>> searchResult = new SearchResult<>(); + searchResult.setSuccess(); + SearchResult<List<UserInfoDomainDTO>> userResult = userDomainService.findUserList(pageQuery); + BeanUtils.copyProperties(userResult,searchResult); + searchResult.setData(userInfoAppConverter.toAppDtoList((List<UserInfoDomainDTO>) userResult.getData())); + return searchResult; + } + + @Override + public SearchResult<List<UserInfoAppRespDTO>> findExpert(PageQuery<UserQuery> pageQuery) { + SearchResult<List<UserInfoAppRespDTO>> searchResult = new SearchResult<>(); + searchResult.setSuccess(); + SearchResult<List<UserInfoDomainDTO>> userResult = userDomainService.findExpertList(pageQuery); + BeanUtils.copyProperties(userResult,searchResult); + searchResult.setData(userInfoAppConverter.toAppDtoList((List<UserInfoDomainDTO>) userResult.getData())); + return searchResult; + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountMenuAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountMenuAppServiceImpl.java new file mode 100644 index 0000000..af8a8bf --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/AccountMenuAppServiceImpl.java @@ -0,0 +1,123 @@ +package com.gkhy.labRiskManage.application.account.service.impl; + +import com.gkhy.labRiskManage.application.account.service.AccountMenuAppService; +import com.gkhy.labRiskManage.application.sysAdmin.convert.MenuItemAppConvert; +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.resp.MenuItemAppDTO; +import com.gkhy.labRiskManage.application.sysAdmin.service.MenuAppService; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.RoleMenuDomainService; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; +import com.gkhy.labRiskManage.domain.sysAdmin.service.MenuDomainService; +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 +public class AccountMenuAppServiceImpl implements AccountMenuAppService { + + @Autowired + private UserDomainService userDomainService; + + @Autowired + private MenuDomainService menuDomainService; + + + @Autowired + private RoleMenuDomainService roleMenuDomainService; + + @Autowired + private MenuItemAppConvert menuItemAppConvert; + + //@Override + /*public SearchResult<MenuItemAppDTO> findAllMenuItemByUserId1(Long userId) { + SearchResult result = new SearchResult<>(); + UserInfoDomainDTO userInfo = userDomainService.getUserInfoById(userId); + if(userInfo == null){ + result.setCode(ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST); + result.setMsg("用户不存在"); + return result; + } + + if(userInfo.getRoles() == null || userInfo.getRoles().size() == 0){ + result.setCode(ResultCode.BUSINESS_ERROR_NOT_ALLOWED); + result.setMsg("用户未绑定角色"); + return result; + } + //获取用户角色id + List<Long> roleIds = userInfo.getRoles().stream().map(SysUserRoleBindDomainDTO::getRoleId).collect(Collectors.toList()); + List<MenuItemDomainDTO> menuList = roleMenuDomainService.getMenuInfoByRole(roleIds); + List<MenuItemAppDTO> appDTOList = menuItemAppConvert.toAppDtoList(menuList); + if(appDTOList != null && !appDTOList.isEmpty()){ + result.setData(appDTOList); + result.setCount(appDTOList.size()); + } + result.setSuccess(); + return result; + }*/ + + @Override + public SearchResult<MenuItemAppDTO> findAllMenuItemByUserId(Long userId) { + SearchResult result = new SearchResult<>(); + UserInfoDomainDTO userInfo = userDomainService.getUserInfoById(userId); + if(userInfo == null){ + result.setCode(ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST); + result.setMsg("用户不存在"); + return result; + } + //获取用户角色 + List<SysUserRoleBindDomainDTO> roles = userInfo.getRoles(); + if(roles == null || roles.size() == 0){ + result.setCode(ResultCode.BUSINESS_ERROR_NOT_ALLOWED); + result.setMsg("用户未绑定角色"); + return result; + } + Boolean flag = false; + for(SysUserRoleBindDomainDTO role : roles){ + if ("超级管理员".equals(role.getRoleName()) || "管理员".equals(role.getRoleName())){ + flag = true; + } + } + List<MenuItemDomainDTO> menuList = new ArrayList<>(); + if(flag){ + //管理员 + menuList = menuDomainService.getAllActiveMenuItems(); + + }else { + //非管理员 + //获取用户角色id + List<Long> roleIds = roles.stream().map(SysUserRoleBindDomainDTO::getRoleId).collect(Collectors.toList()); + menuList = roleMenuDomainService.getMenuInfoByRole(roleIds); + } + + List<MenuItemAppDTO> appDTOList = convertToMenuItemAppDtos(menuList); + if(appDTOList != null && !appDTOList.isEmpty()){ + result.setData(appDTOList); + result.setCount(appDTOList.size()); + } + result.setSuccess(); + return result; + } + + private List<MenuItemAppDTO> convertToMenuItemAppDtos(List<MenuItemDomainDTO> orignList){ + if(orignList == null || orignList.isEmpty()) + return null; + List<MenuItemAppDTO> targetList = new ArrayList<>(); + orignList.forEach(o -> { + MenuItemAppDTO appDTO = menuItemAppConvert.toAppDto(o); + List<Long> bindRoles = roleMenuDomainService.getBindRolesByMenuItemId(o.getId()); + appDTO.setRoles(bindRoles); + if(o.getSubMenuItemList() != null && !o.getSubMenuItemList().isEmpty()){ + appDTO.setSubMenuItemList(convertToMenuItemAppDtos(o.getSubMenuItemList())); + } + targetList.add(appDTO); + }); + return targetList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/RoleAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/RoleAppServiceImpl.java new file mode 100644 index 0000000..77fcd6f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/RoleAppServiceImpl.java @@ -0,0 +1,88 @@ +package com.gkhy.labRiskManage.application.account.service.impl; + +import com.gkhy.labRiskManage.application.account.converter.RoleInfoAppConverter; +import com.gkhy.labRiskManage.application.account.dto.respDto.RoleRespDTO; +import com.gkhy.labRiskManage.application.account.service.RoleAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.domain.account.model.dto.RoleInfoDoaminDTO; +import com.gkhy.labRiskManage.domain.account.service.RoleDomainService; +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 RoleAppServiceImpl implements RoleAppService { + + @Autowired + private RoleDomainService roleDomainService; + + @Autowired + private RoleInfoAppConverter roleInfoAppConverter; + + @Override + @Transactional + public Result newRole(String roleName) { + Result result = new Result<>(); + if(roleName == null || roleName.isEmpty()){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("参数缺失"); + return result; + } + RoleInfoDoaminDTO roleInfoDoaminDTO = roleDomainService.createNewRole(roleName); + if(roleInfoDoaminDTO == null){ + result.setCode(ResultCode.BUSINESS_ERROR.getCode()); + result.setMsg("创建角色失败"); + return result; + } + result.setSuccess(); + return result; + } + + @Override + @Transactional + public Result deleteRole(Long roleId) { + Result result = new Result<>(); + if(roleDomainService.deleteRole(roleId) == true){ + result.setSuccess(); + return result; + }else { + result.setCode(ResultCode.BUSINESS_ERROR); + result.setMsg("删除菜单出错"); + } + return result; + } + + @Override + public SearchResult<List<RoleRespDTO>> findAllRoleList() { + SearchResult<List<RoleRespDTO>> result = new SearchResult<>(false); + result.setSuccess(); + List<RoleInfoDoaminDTO> roleInfoDoaminDTOList = roleDomainService.findAllActiveRoleList(); + if(roleInfoDoaminDTOList != null && !roleInfoDoaminDTOList.isEmpty()){ + List<RoleRespDTO> list = new ArrayList<>(); + roleInfoDoaminDTOList.forEach(d -> { + list.add(roleInfoAppConverter.toRoleRespDTO(d)); + }); + result.setData(list); + result.setCount(list.size()); + } + return result; + } + + @Override + @Transactional + public Result updateRoleName(Long roleId, String name) { + Result result = new Result(); + if(roleDomainService.updateRoleName(roleId,name) == true){ + result.setSuccess(); + }else { + result.setCode(ResultCode.BUSINESS_ERROR.getCode()); + result.setMsg("更新出错"); + } + return result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/SysDepartmentAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/SysDepartmentAppServiceImpl.java new file mode 100644 index 0000000..841c333 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/SysDepartmentAppServiceImpl.java @@ -0,0 +1,87 @@ +package com.gkhy.labRiskManage.application.account.service.impl; + + +import com.gkhy.labRiskManage.application.account.dto.repDto.SysDepartmentAppAddReqDTO; +import com.gkhy.labRiskManage.application.account.dto.repDto.SysDepartmentAppUpdateReqDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.SysDepartmentAppDTO; +import com.gkhy.labRiskManage.application.account.service.SysDepartmentAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.domain.account.converter.SysDeparmentConverter; +import com.gkhy.labRiskManage.domain.account.model.bo.SysDepartmentBO; +import com.gkhy.labRiskManage.domain.account.model.dto.SysDepartmentDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.SysDepartmentDomainService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/7 + * @time: 17:13 + */ +@Service +public class SysDepartmentAppServiceImpl implements SysDepartmentAppService { + + @Autowired + private SysDepartmentDomainService sysDepartmentDomainService; + @Autowired + private SysDeparmentConverter converter; + + @Override + public Result save(SysDepartmentAppAddReqDTO req, Long currentUserId) { + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("新增成功!"); + SysDepartmentBO sysDepartmentBO = new SysDepartmentBO(); + sysDepartmentBO.setDepName(req.getDepName()); + sysDepartmentBO.setParentId(req.getParentId()); + sysDepartmentBO.setLevel(req.getLevel()); + sysDepartmentBO.setInfo(req.getInfo()); + if(null == sysDepartmentDomainService.save(sysDepartmentBO,currentUserId)){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("新增失败!"); + } + return result; + } + + @Override + public Result update(SysDepartmentAppUpdateReqDTO req,Long currentUserId) { + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("修改成功!"); + SysDepartmentBO sysDepartmentBO = new SysDepartmentBO(); + sysDepartmentBO.setId(req.getId()); + sysDepartmentBO.setInfo(req.getInfo()); + sysDepartmentBO.setDepName(req.getDepName()); + if(null == sysDepartmentDomainService.update(sysDepartmentBO,currentUserId)){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("修改失败!"); + } + return result; + } + + @Override + public Result delete(Long id, Long currentUserId) { + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("删除成功!"); + if(null == sysDepartmentDomainService.delete(id,currentUserId)){ + result.setCode(ResultCode.NOT_OK); + result.setMsg("删除失败!"); + } + return result; + } + + @Override + public Result<SysDepartmentAppDTO> list() { + Result result = new Result(); + result.setCode(ResultCode.OK); + result.setMsg("查询成功!"); + List<SysDepartmentAppDTO> appDTOList = converter.sysDepAppDTOListConverter(sysDepartmentDomainService.list()); + result.setData(appDTOList); + return result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/TokenAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/TokenAppServiceImpl.java new file mode 100644 index 0000000..3e1c360 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/TokenAppServiceImpl.java @@ -0,0 +1,121 @@ +package com.gkhy.labRiskManage.application.account.service.impl; + +import com.gkhy.labRiskManage.application.account.dto.respDto.TokenInfoDto; +import com.gkhy.labRiskManage.application.account.service.TokenAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.SystemCacheKeyEnum; +import com.google.common.collect.Range; +import com.google.common.hash.Hashing; +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; + +@Service +public class TokenAppServiceImpl implements TokenAppService { + + @Autowired + private RedissonClient redissonClient; + + @Override + public Result<TokenInfoDto> setToken(Long uid) { + Result result = new Result<>(); + if(uid == null){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("参数缺失"); + return result; + } + String loginUserId = ""+uid; + //生成Token + String seed = loginUserId+ Range.atLeast(1) +System.nanoTime(); + String hash = String.valueOf(Hashing.hmacMd5(loginUserId.getBytes(StandardCharsets.UTF_8)).hashString(seed, + StandardCharsets.UTF_8)); + //存入redis + String accessTokenKey = SystemCacheKeyEnum.KEY_USER_TOKEN.getKey(); + try { + RMapCache<String,Object> tokenCacheMap = redissonClient.getMapCache(accessTokenKey); + tokenCacheMap.remove(loginUserId); + tokenCacheMap.put(loginUserId,hash,120, TimeUnit.MINUTES); + result.setSuccess(); + TokenInfoDto tokenInfoDto = new TokenInfoDto(); + tokenInfoDto.setTk(hash); + tokenInfoDto.setUid(uid); + tokenInfoDto.setRemainSecond(tokenCacheMap.remainTimeToLive(loginUserId)); + result.setData(tokenInfoDto); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + @Override + public Result resetTokenTime(Long uid) { + Result result = new Result<>(); + if(uid == null){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("参数缺失"); + return result; + } + String loginUserId = ""+uid; + String accessTokenKey = SystemCacheKeyEnum.KEY_USER_TOKEN.getKey(); + try { + RMapCache<String,Object> tokenCacheMap = redissonClient.getMapCache(accessTokenKey); + String tk = (String) tokenCacheMap.get(loginUserId); + tokenCacheMap.put(loginUserId,tk,120, TimeUnit.MINUTES); + result.setSuccess(); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + @Override + public Result removeToken(Long uid) { + Result result = new Result<>(); + if(uid == null){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("参数缺失"); + return result; + } + String loginUserId = ""+uid; + String accessTokenKey = SystemCacheKeyEnum.KEY_USER_TOKEN.getKey(); + RMapCache<String,Object> tokenCacheMap = redissonClient.getMapCache(accessTokenKey); + tokenCacheMap.remove(loginUserId); + result.setSuccess(); + return result; + } + + @Override + public Result<TokenInfoDto> getToken(Long uid) { + Result<TokenInfoDto> result = new Result<>(); + result.setCode(ResultCode.BUSINESS_ERROR_PERMISSION_DENIALED.getCode()); + result.setMsg("TOKEN不存在"); + if(uid == null){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("参数缺失"); + return result; + } + String loginUserId = ""+uid; + String accessTokenKey = SystemCacheKeyEnum.KEY_USER_TOKEN.getKey(); + RMapCache<String,Object> tokenCacheMap = redissonClient.getMapCache(accessTokenKey); + Object tokenObject = tokenCacheMap.get(loginUserId); + String cacheToken; + if(tokenObject != null){ + cacheToken = (String) tokenObject; + Long tokenRemainTimeToLive = tokenCacheMap.remainTimeToLive(loginUserId); + if(cacheToken != null && !cacheToken.isEmpty()){ + result.setSuccess(); + TokenInfoDto tokenInfoDto = new TokenInfoDto(); + tokenInfoDto.setUid(uid); + tokenInfoDto.setTk(cacheToken); + tokenInfoDto.setRemainSecond(tokenRemainTimeToLive/1000); + result.setData(tokenInfoDto); + } + } + return result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/UserIdentityAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/UserIdentityAppServiceImpl.java new file mode 100644 index 0000000..924ee6a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/account/service/impl/UserIdentityAppServiceImpl.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.application.account.service.impl; + +import com.gkhy.labRiskManage.application.account.converter.UserIndentityAppConverter; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserIndentityAppDTO; +import com.gkhy.labRiskManage.application.account.service.UserIdentityAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.domain.account.model.dto.UserIdentityDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserIdentityDomainService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 13:49 + */ +@Service +public class UserIdentityAppServiceImpl implements UserIdentityAppService { + @Autowired + private UserIdentityDomainService userIdentityDomainService; + @Autowired + private UserIndentityAppConverter userIndentityAppConverter; + @Override + public List<UserIndentityAppDTO> list() { + List<UserIdentityDomainDTO> list = userIdentityDomainService.getList(); + return userIndentityAppConverter.toUserIndentityAppDTO(list); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/attachment/converter/AttachmentAppConverter.java b/src/main/java/com/gkhy/labRiskManage/application/attachment/converter/AttachmentAppConverter.java new file mode 100644 index 0000000..ab5a17e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/attachment/converter/AttachmentAppConverter.java @@ -0,0 +1,24 @@ +package com.gkhy.labRiskManage.application.attachment.converter; + +import com.gkhy.labRiskManage.application.attachment.service.dto.resp.AttachmentAppRespDTO; +import com.gkhy.labRiskManage.domain.attachment.dto.resp.AttachmentDomainDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 17:12 + */ +@Component +public class AttachmentAppConverter { + public AttachmentAppRespDTO getAppRespDTO(AttachmentDomainDTO attachmentDomainDTO){ + if(attachmentDomainDTO == null){ + return null; + } + AttachmentAppRespDTO appRespDTO = new AttachmentAppRespDTO(); + BeanUtils.copyProperties(attachmentDomainDTO,appRespDTO); + return appRespDTO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/attachment/service/AttachmentAppService.java b/src/main/java/com/gkhy/labRiskManage/application/attachment/service/AttachmentAppService.java new file mode 100644 index 0000000..fcd1d9e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/attachment/service/AttachmentAppService.java @@ -0,0 +1,27 @@ +package com.gkhy.labRiskManage.application.attachment.service; + +import com.gkhy.labRiskManage.application.attachment.service.dto.resp.AttachmentAppRespDTO; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 13:38 + */ +public interface AttachmentAppService { + Object saveFileToPath(MultipartFile file, String module, Integer detail,Long currentUserId); + + AttachmentAppRespDTO findByKey(String key); + AttachmentAppRespDTO findById(Long id); + + + void delete(Long id); + + void downloadByKey(HttpServletResponse response, HttpServletRequest request, String key); + + void downloadForStream(HttpServletResponse response, String key); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/attachment/service/dto/req/AttachmentAppReq.java b/src/main/java/com/gkhy/labRiskManage/application/attachment/service/dto/req/AttachmentAppReq.java new file mode 100644 index 0000000..4d4fd0a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/attachment/service/dto/req/AttachmentAppReq.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.application.attachment.service.dto.req; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 15:00 + */ +@Data +public class AttachmentAppReq { + private Long id; + //文件标识 + private String fileKey; + //文件本地址 + private String filePath; + //文件访问路径 + private String fileUrl; + //文件名称 + private String fileName; + //文件后缀 + private String fileSuffix; + //文件描述 + private String fileDesc; + //文件大小 + private Long fileSize; + //文件类型 + private String fileType; + //模块 + private String module; + //删除标识 0-未删除,1-删除 + private Integer delFlag; + //创建时间 + private LocalDateTime createTime; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime updateTime; + //修改人id + private Long updateUid; + //修改人姓名 + private String updateUname; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/attachment/service/dto/resp/AttachmentAppRespDTO.java b/src/main/java/com/gkhy/labRiskManage/application/attachment/service/dto/resp/AttachmentAppRespDTO.java new file mode 100644 index 0000000..8dbd1fb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/attachment/service/dto/resp/AttachmentAppRespDTO.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.application.attachment.service.dto.resp; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 16:56 + */ +@Data +public class AttachmentAppRespDTO { + private Long id; + //文件标识 + private String fileKey; + //文件本地址 + private String filePath; + //文件访问路径 + private String fileUrl; + //文件名称 + private String fileName; + //文件后缀 + private String fileSuffix; + //文件描述 + private String fileDesc; + //文件大小 + private Long fileSize; + //文件类型 + private String fileType; + //模块 + private String module; + //删除标识 0-未删除,1-删除 + private Integer delFlag; + //创建时间 + private LocalDateTime createTime; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime updateTime; + //修改人id + private Long updateUid; + //修改人姓名 + private String updateUname; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/attachment/service/impl/AttachmentAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/attachment/service/impl/AttachmentAppServiceImpl.java new file mode 100644 index 0000000..fd76e86 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/attachment/service/impl/AttachmentAppServiceImpl.java @@ -0,0 +1,245 @@ +package com.gkhy.labRiskManage.application.attachment.service.impl; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.servlet.ServletUtil; +import com.alibaba.druid.util.StringUtils; +import com.gkhy.labRiskManage.application.attachment.converter.AttachmentAppConverter; +import com.gkhy.labRiskManage.application.attachment.service.AttachmentAppService; +import com.gkhy.labRiskManage.application.attachment.service.dto.req.AttachmentAppReq; +import com.gkhy.labRiskManage.application.attachment.service.dto.resp.AttachmentAppRespDTO; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.config.file.FilePathConfig; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.attachment.dto.resp.AttachmentDomainDTO; +import com.gkhy.labRiskManage.domain.attachment.enums.FileProjectConstants; +import com.gkhy.labRiskManage.domain.attachment.service.AttachmentDomainService; +import lombok.SneakyThrows; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.Assert; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.UUID; + +import static cn.hutool.core.io.FileTypeUtil.getType; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 13:37 + */ +@Service +public class AttachmentAppServiceImpl implements AttachmentAppService { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + /** + * 错误信息格式 + */ + private static final String ERROR_FORMATTER = "{}:{}"; + + @Resource + private FilePathConfig filePathConfig; + + @Autowired + private UserDomainService userDomainService; + + @Autowired + private AttachmentDomainService attachmentDomainService; + + @Autowired + private AttachmentAppConverter converter; + + + + @Override + @Transactional(rollbackFor = Exception.class) + public Object saveFileToPath(MultipartFile file, String module, Integer type, Long currentUserId){ + UserInfoDomainDTO userInfo = userDomainService.getUserInfoById(currentUserId); + //获取对应模块路径 + String path; + //获取对应模块根路径 + String dcPath; + path = filePathConfig.getModule().get(module); + dcPath = filePathConfig.getDcPath(); + + String originalFilename = file.getOriginalFilename(); + if (StringUtils.isEmpty(originalFilename)) { + logger.error(ERROR_FORMATTER,module,ResultCode.PATH_NOT_EXISIST.getDesc()); + throw new BusinessException(this.getClass(), ResultCode.FILE_NOT_EXISIST); + } + if (StringUtils.isEmpty(path)) { + logger.error(ERROR_FORMATTER, module, ResultCode.PATH_NOT_EXISIST.getDesc()); + throw new BusinessException(this.getClass(), ResultCode.PATH_NOT_EXISIST); + } + assert originalFilename != null; + LocalDateTime now = LocalDateTime.now(); + File newFile = null; + try { + //文件标识 UUID 如4d6873609b144945935ae84442711fd6 + String key = ""; + String suffix = ""; + if (originalFilename.contains(".mp3")) { + key = originalFilename; + suffix = ""; + } else { + key = UUID.randomUUID().toString().replace("-", ""); + //文件后缀 包含. + suffix = originalFilename.substring(originalFilename.lastIndexOf(".")).toLowerCase(); + } + + path = path.replace("/", File.separator); + //文件模块路径 如 2021/base/build/0421 + String modulePath = now.getYear() + path + now.format(DateTimeFormatter.ofPattern("MMdd")); + //文件路径 如 2021/base/build/0421/4d6873609b144945935ae84442711fd6.后缀 + String newFilePath = modulePath + File.separator + key + suffix; + //文件绝对路径 如 /home/img/2021/base/build/0421/4d6873609b144945935ae84442711fd6.后缀 + String localPath = dcPath + newFilePath; + //文件访问路径 如 /upload/2021/base/build/0421/4d6873609b144945935ae84442711fd6.后缀 + String url = filePathConfig.getUrlRootPath() + newFilePath.replace(File.separator, "/"); + newFile = new File(localPath); + if (!newFile.exists() && !newFile.mkdirs()) { + logger.error(ERROR_FORMATTER, newFilePath, ResultCode.FILE_UPLOAD_FAIL.getDesc()); + throw new BusinessException(this.getClass(),ResultCode.FILE_UPLOAD_FAIL); + } + file.transferTo(newFile); + //创建文件信息 + AttachmentAppReq attachmentAppReq = new AttachmentAppReq(); + attachmentAppReq.setDelFlag(0); + attachmentAppReq.setFileKey(key); + attachmentAppReq.setFileSuffix(suffix); + attachmentAppReq.setFilePath(localPath); + attachmentAppReq.setFileUrl(url); + attachmentAppReq.setFileName(file.getOriginalFilename()); + attachmentAppReq.setFileSize(file.getSize()); + attachmentAppReq.setModule(module); + attachmentAppReq.setFileType(getType(suffix)); + attachmentAppReq.setCreateUid(userInfo.getId()); + attachmentAppReq.setCreateUname(userInfo.getName()); + attachmentAppReq.setUpdateUid(userInfo.getId()); + attachmentAppReq.setUpdateUname(userInfo.getName()); + AttachmentDomainDTO attachmentDomainDTO = attachmentDomainService.save(attachmentAppReq); + switch (type) { + case FileProjectConstants.ReturnType.URL: + return url; + case FileProjectConstants.ReturnType.KEY: + return key; + case FileProjectConstants.ReturnType.DETAIL: + return attachmentDomainDTO; + default: + return null; + } + } catch (IOException e) { + if (newFile != null && newFile.exists()) { + newFile.delete(); + } + logger.error(ERROR_FORMATTER, ResultCode.FILE_UPLOAD_FAIL, e.getMessage()); + throw new BusinessException(this.getClass(),ResultCode.FILE_UPLOAD_FAIL); + } + } + + @Override + public AttachmentAppRespDTO findByKey(String key) { + if(StringUtils.isEmpty(key)){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL); + } + AttachmentDomainDTO byKey = attachmentDomainService.findByKey(key); + return converter.getAppRespDTO(byKey); + } + @Override + public AttachmentAppRespDTO findById(Long id) { + if(id == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL); + } + AttachmentDomainDTO findById = attachmentDomainService.findById(id); + return converter.getAppRespDTO(findById); + } + + @Override + public void delete(Long id) { + if(id == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL); + } + attachmentDomainService.delete(id); + } + + @Override + public void downloadByKey(HttpServletResponse response, HttpServletRequest request, String key) { + Assert.isTrue(StrUtil.isNotBlank(key) && !StrUtil.isNullOrUndefined(key), "文件key未知异常"); + AttachmentAppRespDTO byKey = findByKey(key); + downloadByEntity(response, request, byKey); + } + + @SneakyThrows + @Override + public void downloadForStream(HttpServletResponse response, String key) { + AttachmentAppRespDTO byKey = findByKey(key); + File file; + try { + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode(byKey.getFileName(), StandardCharsets.UTF_8.name())); + response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); + file = new File(byKey.getFilePath()); + if (!file.exists()) { + logger.error(ERROR_FORMATTER, key, ResultCode.FILE_NOT_EXISIST.getDesc()); + throw new BusinessException(this.getClass(),ResultCode.FILE_NOT_EXISIST); + } + OutputStream outputStream = response.getOutputStream(); + FileInputStream inputStream = new FileInputStream(file); + IoUtil.copy(inputStream, outputStream); + outputStream.close(); + } catch (UnsupportedEncodingException e) { + logger.error(e.getMessage()); + throw new BusinessException(this.getClass(),ResultCode.FILE_DOWNLOAD_EXPERTION); + } + + } + + //@Override + public void downloadByEntity(HttpServletResponse response, HttpServletRequest request, AttachmentAppRespDTO appRespDTO) { + if (ObjectUtil.isNotNull(appRespDTO)) { + String type = appRespDTO.getFileType(); + if (StrUtil.isBlank(type)) { + type = "application/octet-stream"; + } + type = type + ";charset=utf-8"; + String fileName = appRespDTO.getFileName(); + response.setContentType("multipart/form-data;charset=utf-8"); + ServletUtil.setHeader(response, "Access-Control-Expose-Headers", "Content-Disposition"); + //本地文件下载 + File file = FileUtil.file(appRespDTO.getFilePath()); + if (!FileUtil.exist(file)) { + throw new BusinessException(this.getClass(),ResultCode.FILE_NOT_EXISIST,appRespDTO.getFileKey() + "文件不存在"); + } + InputStream is = null; + try { + is = IoUtil.toStream(file); + ServletUtil.write(response, is, type, fileName); + } catch (Exception e) { + throw new BusinessException(this.getClass(),ResultCode.FILE_DOWNLOAD_EXPERTION); + } finally { + IoUtil.close(is); + } + } else { + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST,"文件记录不存在"); + } + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppInsertBO.java new file mode 100644 index 0000000..4e69e58 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppInsertBO.java @@ -0,0 +1,152 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +import java.time.LocalDateTime; + +public class BasicExperimentDeviceAppInsertBO { + + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppQueryBO.java new file mode 100644 index 0000000..fe423e7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppQueryBO.java @@ -0,0 +1,84 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +public class BasicExperimentDeviceAppQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + 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 getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppUpdateBO.java new file mode 100644 index 0000000..380798f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentDeviceAppUpdateBO.java @@ -0,0 +1,161 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +import java.time.LocalDateTime; + +public class BasicExperimentDeviceAppUpdateBO { + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppInsertBO.java new file mode 100644 index 0000000..5304ad0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppInsertBO.java @@ -0,0 +1,118 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonAppInsertBO { + + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppQueryBO.java new file mode 100644 index 0000000..4d72220 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppQueryBO.java @@ -0,0 +1,87 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonAppQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 人员 + */ + private String personName; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + 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 getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppUpdateBO.java new file mode 100644 index 0000000..56a23b6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentPersonAppUpdateBO.java @@ -0,0 +1,127 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonAppUpdateBO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppInsertBO.java new file mode 100644 index 0000000..bf57fd7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppInsertBO.java @@ -0,0 +1,141 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteAppInsertBO { + + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppQueryBO.java new file mode 100644 index 0000000..bc020b5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppQueryBO.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteAppQueryBO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + + 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 getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppUpdateBO.java new file mode 100644 index 0000000..f1c6ff3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentSiteAppUpdateBO.java @@ -0,0 +1,149 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteAppUpdateBO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppInsertBO.java new file mode 100644 index 0000000..2d0b94a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppInsertBO.java @@ -0,0 +1,70 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentStuffAppInsertBO { + + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppQueryBO.java new file mode 100644 index 0000000..b097f18 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppQueryBO.java @@ -0,0 +1,65 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentStuffAppQueryBO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + + 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 getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppUpdateBO.java new file mode 100644 index 0000000..ec08767 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicExperimentStuffAppUpdateBO.java @@ -0,0 +1,80 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentStuffAppUpdateBO { + + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppInsertBO.java new file mode 100644 index 0000000..a4b2956 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppInsertBO.java @@ -0,0 +1,118 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础风险单元管理 + */ +public class BasicRiskUnitAppInsertBO { + + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppQueryBO.java new file mode 100644 index 0000000..fe73d35 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppQueryBO.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础风险单元管理 + */ +public class BasicRiskUnitAppQueryBO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + + 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 getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppUpdateBO.java new file mode 100644 index 0000000..355d5cc --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/bo/BasicRiskUnitAppUpdateBO.java @@ -0,0 +1,126 @@ +package com.gkhy.labRiskManage.application.basic.dto.bo; + +/** + * 基础风险单元管理 + */ +public class BasicRiskUnitAppUpdateBO { + + private Long id; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentDeviceAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentDeviceAppListDTO.java new file mode 100644 index 0000000..4fa796f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentDeviceAppListDTO.java @@ -0,0 +1,161 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.time.LocalDateTime; + +public class BasicExperimentDeviceAppListDTO { + + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentDeviceAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentDeviceAppQueryDTO.java new file mode 100644 index 0000000..d431ede --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentDeviceAppQueryDTO.java @@ -0,0 +1,233 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + + +import java.time.LocalDateTime; +import java.util.Date; + +public class BasicExperimentDeviceAppQueryDTO { + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentPersonAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentPersonAppListDTO.java new file mode 100644 index 0000000..878b7a5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentPersonAppListDTO.java @@ -0,0 +1,129 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonAppListDTO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentPersonAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentPersonAppQueryDTO.java new file mode 100644 index 0000000..4a076e7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentPersonAppQueryDTO.java @@ -0,0 +1,176 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验人员 + */ +public class BasicExperimentPersonAppQueryDTO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentSiteAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentSiteAppListDTO.java new file mode 100644 index 0000000..e0977c4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentSiteAppListDTO.java @@ -0,0 +1,150 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteAppListDTO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentSiteAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentSiteAppQueryDTO.java new file mode 100644 index 0000000..6adae9d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentSiteAppQueryDTO.java @@ -0,0 +1,223 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验场所管理 + */ + +public class BasicExperimentSiteAppQueryDTO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentStuffAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentStuffAppListDTO.java new file mode 100644 index 0000000..906651d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentStuffAppListDTO.java @@ -0,0 +1,79 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +/** + * 基础实验耗材管理 + */ +public class BasicExperimentStuffAppListDTO { + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentStuffAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentStuffAppQueryDTO.java new file mode 100644 index 0000000..0158a48 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentStuffAppQueryDTO.java @@ -0,0 +1,151 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class BasicExperimentStuffAppQueryDTO { + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentTypeAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentTypeAppListDTO.java new file mode 100644 index 0000000..6a8fc4b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicExperimentTypeAppListDTO.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +/** + * 基础实验耗材管理 + */ +public class BasicExperimentTypeAppListDTO { + + private Long id; + /** + * 1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private String experimentType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getExperimentType() { + return experimentType; + } + + public void setExperimentType(String experimentType) { + this.experimentType = experimentType; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskSourceTypeAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskSourceTypeAppListDTO.java new file mode 100644 index 0000000..05e9b7f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskSourceTypeAppListDTO.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +/** + * 基本危险因素类型 + */ +public class BasicRiskSourceTypeAppListDTO { + + private Long id; + /** + * 危险源种类 + */ + private String riskSourceType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(String riskSourceType) { + this.riskSourceType = riskSourceType; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskUnitAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskUnitAppListDTO.java new file mode 100644 index 0000000..2148094 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskUnitAppListDTO.java @@ -0,0 +1,78 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +/** + * 基础实验耗材管理 + */ +public class BasicRiskUnitAppListDTO { + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险单元描述 + */ + private String description; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskUnitAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskUnitAppQueryDTO.java new file mode 100644 index 0000000..3036b0b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/BasicRiskUnitAppQueryDTO.java @@ -0,0 +1,221 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class BasicRiskUnitAppQueryDTO { + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 新建人姓名 + */ + private String liabilityUserName; + + public String getLiabilityUserName() { + return liabilityUserName; + } + + public void setLiabilityUserName(String liabilityUserName) { + this.liabilityUserName = liabilityUserName; + } + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getEvaluateStatus() { + return evaluateStatus; + } + + public void setEvaluateStatus(Byte evaluateStatus) { + this.evaluateStatus = evaluateStatus; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecCAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecCAppListDTO.java new file mode 100644 index 0000000..1261075 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecCAppListDTO.java @@ -0,0 +1,92 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LEC-C + */ +public class FactorLecCAppListDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-S-法律,法规及其它要求 + */ + private String desc; + /** + * LS-S-人员伤亡 + */ + private String person; + /** + * LS-S-直接经济损失 + */ + private String money; + /** + * LS-S-停工 + */ + private String stopWork; + /** + * LS-S-企业形象 + */ + private String company; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecEAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecEAppListDTO.java new file mode 100644 index 0000000..0986368 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecEAppListDTO.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LEC-E + */ +public class FactorLecEAppListDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-E-标准 + */ + private String desc; + + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecLAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecLAppListDTO.java new file mode 100644 index 0000000..68fb6da --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLecLAppListDTO.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LEC—L + */ +public class FactorLecLAppListDTO{ + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-L-事故发生的可能性 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLsLAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLsLAppListDTO.java new file mode 100644 index 0000000..5593caf --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLsLAppListDTO.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LS-L + */ +public class FactorLsLAppListDTO{ + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-L-标准 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLsSAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLsSAppListDTO.java new file mode 100644 index 0000000..cdbb7b9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorLsSAppListDTO.java @@ -0,0 +1,93 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LS-S + */ +public class FactorLsSAppListDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-S-法律,法规及其它要求 + */ + private String desc; + /** + * LS-S-人员伤亡 + */ + private String person; + /** + * LS-S-直接经济损失 + */ + private String money; + /** + * LS-S-停工 + */ + private String stopWork; + /** + * LS-S-企业形象 + */ + private String company; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesEAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesEAppListDTO.java new file mode 100644 index 0000000..91b81e1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesEAppListDTO.java @@ -0,0 +1,57 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.math.BigDecimal; + +/** + * 评价因子MES-E + */ +public class FactorMesEAppListDTO{ + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-E-E1 + */ + private String e1Desc; + /** + * MES-E-E2 + */ + private String e2Desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getE1Desc() { + return e1Desc; + } + + public void setE1Desc(String e1Desc) { + this.e1Desc = e1Desc; + } + + public String getE2Desc() { + return e2Desc; + } + + public void setE2Desc(String e2Desc) { + this.e2Desc = e2Desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesMAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesMAppListDTO.java new file mode 100644 index 0000000..1485600 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesMAppListDTO.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.math.BigDecimal; + +/** + * 评价因子MES-M + */ +public class FactorMesMAppListDTO{ + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-M-标准 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesSAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesSAppListDTO.java new file mode 100644 index 0000000..5252c9a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorMesSAppListDTO.java @@ -0,0 +1,81 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.math.BigDecimal; + +/** + * 评价因子MES-S + */ +public class FactorMesSAppListDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-S-法律法规及其他要求 + */ + private String desc; + /** + * MES-S-人员伤亡 + */ + private String person; + /** + * MES-S-直接经济损失(万元) + */ + private String money; + /** + * MES-S-停工 + */ + private String stopWork; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorRsRAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorRsRAppListDTO.java new file mode 100644 index 0000000..cb2ece5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorRsRAppListDTO.java @@ -0,0 +1,57 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + +import java.math.BigDecimal; + +/** + * 评价因子RS-R + */ +public class FactorRsRAppListDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-C-法律法规及其他要求 + */ + private String desc; + /** + * 区间,定量描述 + */ + private String section; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getSection() { + return section; + } + + public void setSection(String section) { + this.section = section; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorRsSAppListDTO.java b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorRsSAppListDTO.java new file mode 100644 index 0000000..bb529b6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/dto/dto/FactorRsSAppListDTO.java @@ -0,0 +1,68 @@ +package com.gkhy.labRiskManage.application.basic.dto.dto; + + +/** + * 评价因子RS-S + */ +public class FactorRsSAppListDTO{ + + private Long id; + /** + * 分值 + */ + private String value; + /** + * LEC-C-人员伤亡 + */ + private String person; + /** + * LEC-C-直接经济损失(万元) + */ + private String money; + /** + * LEC-C-法律法规及其他要求 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/service/BasicAppService.java b/src/main/java/com/gkhy/labRiskManage/application/basic/service/BasicAppService.java new file mode 100644 index 0000000..7016f92 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/service/BasicAppService.java @@ -0,0 +1,126 @@ +package com.gkhy.labRiskManage.application.basic.service; + +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.*; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicExperimentTypeListRespDTO; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicRiskSourceTypeListRespDTO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentStuffAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.dto.*; +import com.gkhy.labRiskManage.commons.domain.SearchResult; + +public interface BasicAppService { + + /** + * 基础仪器设备表 - 新增 + * */ + int insertBasicExperimentDevice(Long currentUserId, BasicExperimentDeviceInsertReqBO basicDeviceReqDTO); + /** + * 基础仪器设备表 - 分页查询 + * */ + SearchResult<BasicExperimentDeviceAppQueryDTO> getBasicExperimentDevicePage(Long currentUserId,BasicExperimentDeviceQueryReqBO queryReqDTO); + /** + * 基础仪器设备表 - 修改 + * */ + int updateBasicExperimentDevice(Long currentUserId, BasicExperimentDeviceUpdateReqBO deviceUpdateReqDTO); + /** + * 基础仪器设备表 - 删除 + * */ + int deleteBasicExperimentDevice(Long currentUserId, Long id); + /** + * 基础仪器设备表 - 设备列表 + * */ + SearchResult<BasicExperimentDeviceAppQueryDTO> listBasicExperimentDevice(Long currentUserId); + + /** + * 基础实验人员 - 插入 + * */ + int insertBasicExperimentPerson(Long currentUserId, BasicExperimentPersonInsertReqBO insertReqDO); + /** + * 基础实验人员 - 分页查询 + * */ + SearchResult<BasicExperimentPersonAppQueryBO> getBasicExperimentPersonPage(Long currentUserId, BasicExperimentPersonQueryReqBO queryReqDO); + /** + * 基础实验人员 - 修改 + * */ + int updateBasicExperimentPerson(Long currentUserId, BasicExperimentPersonUpdateReqBO updateReqDO); + /** + * 基础实验人员 - 删除 + * */ + int deleteBasicExperimentPerson(Long currentUserId, Long id); + /** + * 基础实验人员 - 列表 + * */ + SearchResult<BasicExperimentPersonAppListDTO> listBasicExperimentPerson(Long currentUserId); + + /** + * 基础场所管理 - 新增 + * */ + int insertBasicExperimentSite(Long currentUserId, BasicExperimentSiteInsertReqBO insertReqBO); + /** + * 基础场所管理 - 分页查询 + * */ + SearchResult<BasicExperimentSiteAppQueryDTO> selectBasicExperimentSitePage(Long currentUserId, BasicExperimentSiteQueryReqBO queryReqBO); + /** + * 基础场所管理 - 修改 + * */ + int updateBasicExperimentSite(Long currentUserId, BasicExperimentSiteUpdateReqBO updateReqBO); + /** + * 基础场所管理 - 删除 + * */ + int deleteBasicExperimentSite(Long currentUserId, Long id); + /** + * 基础场所管理 - 列表 + * */ + SearchResult<BasicExperimentSiteAppListDTO> listBasicExperimentSite(Long currentUserId); + + /** + * 基础实验耗材管理 - 新增 + */ + int insertBasicExperimentStuff(Long currentUserId, BasicExperimentStuffInsertReqBO insertReqBO); + /** + * 基础实验耗材管理 - 新增 + */ + SearchResult<BasicExperimentStuffAppQueryDTO> selectBasicExperimentStuffPage(Long currentUserId, BasicExperimentStuffQueryReqBO queryReqBO); + /** + * 基础实验耗材管理 - 修改 + */ + int updateBasicExperimentStuff(Long currentUserId, BasicExperimentStuffUpdateReqBO updateReqBO); + /** + * 基础实验耗材管理 - 删除 + */ + int deleteBasicExperimentStuff(Long currentUserId, Long id); + /** + * 基础实验耗材管理 - 列表 + */ + SearchResult<BasicExperimentStuffAppListDTO> listBasicExperimentStuff(Long currentUserId); + /** + * 基础实验类型 - 列表 + */ + SearchResult<BasicExperimentTypeAppListDTO> listBasicExperimentType(); + + /** + * 基础风险单元管理 - 插入 + */ + int insertBasicRiskUnit(Long currentUserId, BasicRiskUnitInsertReqBO insertReqBO); + + /** + * 基础风险单元管理 - 分页查询 + */ + SearchResult<BasicRiskUnitAppQueryDTO> selectBasicRiskUnitPage(Long currentUserId, BasicRiskUnitQueryReqBO queryReqBO); + /** + * 基础风险单元管理 - 修改 + */ + int updateBasicRiskUnit(Long currentUserId, BasicRiskUnitUpdateReqBO updateReqBO); + /** + * 基础风险单元管理 - 删除 + */ + int deleteBasicRiskUnit(Long currentUserId, Long id); + /** + * 基础风险单元管理 - 列表 + */ + SearchResult<BasicRiskUnitAppListDTO> listBasicRiskUnit(Long currentUserId); + /** + * 基础实验风险 - 列表 + * */ + SearchResult<BasicRiskSourceTypeListRespDTO> listRiskSourceType(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/service/DictionaryAppService.java b/src/main/java/com/gkhy/labRiskManage/application/basic/service/DictionaryAppService.java new file mode 100644 index 0000000..84cb1b3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/service/DictionaryAppService.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.application.basic.service; + +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceTypeDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitTypeDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteTypeDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.TipDTO; + +import java.util.List; + +public interface DictionaryAppService { + + /** + * 基础字典 - 场所类型 + * */ + List<SiteTypeDTO> listSiteType(); + + /** + * 基础字典 - 风险类型 + * */ + List<RiskUnitTypeDTO> listRiskUnitType(); + + /** + * 基础字典 - 设备类型 + * */ + List<DeviceTypeDTO> listDeviceType(); + + /** + * 基础字典 - 友情提示 + * */ + List<TipDTO> listTip(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/service/FactorAppService.java b/src/main/java/com/gkhy/labRiskManage/application/basic/service/FactorAppService.java new file mode 100644 index 0000000..3823970 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/service/FactorAppService.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.application.basic.service; + +import com.gkhy.labRiskManage.application.basic.dto.dto.*; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.basic.model.dto.FactorMesSDTO; + +/** + * 评价因子 + */ +public interface FactorAppService { + + /** + * 评价因子LEC-L 列表 + */ + SearchResult<FactorLecLAppListDTO> listLecL(); + /** + * 评价因子LEC-E 列表 + */ + SearchResult<FactorLecEAppListDTO> listLecE(); + /** + * 评价因子LEC-C 列表 + */ + SearchResult<FactorLecCAppListDTO> listLecC(); + /** + * 评价因子LS-L 列表 + */ + SearchResult<FactorLsLAppListDTO> listLsL(); + /** + * 评价因子LS-S 列表 + */ + SearchResult<FactorLsSAppListDTO> listLsS(); + /** + * 评价因子Mes-M 列表 + */ + SearchResult<FactorMesMAppListDTO> listMesM(); + /** + * 评价因子Mes-E 列表 + */ + SearchResult<FactorMesEAppListDTO> listMesE(); + /** + * 评价因子Mes-S 列表 + */ + SearchResult<FactorMesSAppListDTO> listMesS(); + /** + * 评价因子Rs-R 列表 + */ + SearchResult<FactorRsRAppListDTO> listRsR(); + /** + * 评价因子Rs-S 列表 + */ + SearchResult<FactorRsSAppListDTO> listRsS(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/BasicAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/BasicAppServiceImpl.java new file mode 100644 index 0000000..915e2a7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/BasicAppServiceImpl.java @@ -0,0 +1,491 @@ +package com.gkhy.labRiskManage.application.basic.service.impl; + + +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.*; +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.BasicRiskSourceTypeListRespDTO; +import com.gkhy.labRiskManage.application.basic.dto.bo.*; +import com.gkhy.labRiskManage.application.basic.dto.dto.*; +import com.gkhy.labRiskManage.application.basic.service.BasicAppService; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentStuff; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; +import com.gkhy.labRiskManage.domain.basic.service.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.util.List; + + +@Service +public class BasicAppServiceImpl implements BasicAppService { + + @Autowired + private BasicExperimentDeviceService basicExperimentDeviceService; + @Autowired + private BasicExperimentPersonService basicExperimentPersonService; + @Autowired + private BasicExperimentSiteService basicExperimentSiteService; + @Autowired + private BasicExperimentStuffService basicExperimentStuffService; + @Autowired + private BasicExperimentTypeService basicExperimentTypeService; + @Autowired + private BasicRiskUnitService basicRiskUnitService; + @Autowired + private BasicExperimentRiskSourceTypeService basicRiskSourceTypeService; + @Autowired + private UserDomainService userDomainService; + + /** + * 基础仪器设备表 - 新增 + * */ + @Override + public int insertBasicExperimentDevice(Long currentUserId, BasicExperimentDeviceInsertReqBO basicDeviceReqDTO) { + + BasicExperimentDeviceAppInsertBO basicExperimentDeviceAppInsertBO = BeanCopyUtils.copyBean(basicDeviceReqDTO, BasicExperimentDeviceAppInsertBO.class); + + DeviceInsertDTO deviceInsertDTO = basicExperimentDeviceService.insertBasicExperimentDevice(currentUserId, basicExperimentDeviceAppInsertBO); + if (ObjectUtils.isEmpty(deviceInsertDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础仪器设备表 - 分页查询 + * */ + @Override + public SearchResult<BasicExperimentDeviceAppQueryDTO> getBasicExperimentDevicePage(Long currentUserId, BasicExperimentDeviceQueryReqBO queryReqDTO) { + + SearchResult searchResult = new SearchResult<>(); + + BasicExperimentDeviceAppQueryBO queryParam = BeanCopyUtils.copyBean(queryReqDTO, BasicExperimentDeviceAppQueryBO.class); + SearchResult<DeviceQueryDTO> queryAppDeviceDTO = basicExperimentDeviceService.getBasicExperimentDevicePage(currentUserId, queryParam); + + Object data = queryAppDeviceDTO.getData(); + + searchResult.setPageIndex(queryAppDeviceDTO.getPageIndex()); + searchResult.setPageSize(queryAppDeviceDTO.getPageSize()); + searchResult.setTotal(queryAppDeviceDTO.getTotal()); + searchResult.setData(BeanCopyUtils.copyDeviceAppQueryList(data, BasicExperimentDeviceAppQueryDTO.class)); + + return searchResult; + } + + /** + * 基础仪器设备表 - 修改 + * */ + @Override + public int updateBasicExperimentDevice(Long currentUserId, BasicExperimentDeviceUpdateReqBO deviceUpdateReqDO) { + + BasicExperimentDeviceAppUpdateBO updateParam = BeanCopyUtils.copyBean(deviceUpdateReqDO, BasicExperimentDeviceAppUpdateBO.class); + + DeviceUpdateDTO updateDeviceDTO = basicExperimentDeviceService.updateBasicExperimentDevice(currentUserId, updateParam); + if (ObjectUtils.isEmpty(updateDeviceDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础仪器设备表 - 删除 + * */ + @Override + public int deleteBasicExperimentDevice(Long currentUserId, Long id) { + + DeviceDeleteDTO deviceDeleteDTO = basicExperimentDeviceService.deleteBasicExperimentDevice(currentUserId, id); + + if (ObjectUtils.isEmpty(deviceDeleteDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础仪器设备表 - 设备列表 + * */ + @Override + public SearchResult<BasicExperimentDeviceAppQueryDTO> listBasicExperimentDevice(Long currentUserId) { + + SearchResult searchResult = new SearchResult<>(); + + List<BasicExperimentDeviceAppListDTO> deviceAppListDTOS = basicExperimentDeviceService.listBasicExperimentDevice(currentUserId); + searchResult.setData(deviceAppListDTOS); + searchResult.setCount(deviceAppListDTOS.size()); + + return searchResult; + } + + /** + * 基础实验人员 - 插入 + * */ + @Override + public int insertBasicExperimentPerson(Long currentUserId, BasicExperimentPersonInsertReqBO insertReqDO) { + + BasicExperimentPersonAppInsertBO personAppInsertDO = BeanCopyUtils.copyBean(insertReqDO, BasicExperimentPersonAppInsertBO.class); + PersonInsertDTO personInsertDTO = basicExperimentPersonService.insertBasicExperimentPerson(currentUserId, personAppInsertDO); + + if (ObjectUtils.isEmpty(personInsertDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础实验人员 - 分页查询 + * */ + @Override + public SearchResult<BasicExperimentPersonAppQueryBO> getBasicExperimentPersonPage(Long currentUserId, BasicExperimentPersonQueryReqBO queryReqDO) { + + SearchResult searchResult = new SearchResult<>(); + BasicExperimentPersonAppQueryBO queryParam = BeanCopyUtils.copyBean(queryReqDO, BasicExperimentPersonAppQueryBO.class); + SearchResult<PersonQueryDTO> queryPersonDTO = basicExperimentPersonService.getBasicExperimentPersonPage(currentUserId, queryParam); + Object data = queryPersonDTO.getData(); + + searchResult.setPageIndex(queryPersonDTO.getPageIndex()); + searchResult.setPageSize(queryPersonDTO.getPageSize()); + searchResult.setTotal(queryPersonDTO.getTotal()); + searchResult.setData(BeanCopyUtils.copyPersonAppQueryList(data, BasicExperimentPersonAppQueryBO.class)); + + return searchResult; + } + + /** + * 基础实验人员 - 修改 + * */ + @Override + public int updateBasicExperimentPerson(Long currentUserId, BasicExperimentPersonUpdateReqBO updateReqDO) { + + BasicExperimentPersonAppUpdateBO updateParam = BeanCopyUtils.copyBean(updateReqDO, BasicExperimentPersonAppUpdateBO.class); + + PersonUpdateDTO personUpdateDTO = basicExperimentPersonService.updateBasicExperimentPerson(currentUserId, updateParam); + + if (ObjectUtils.isEmpty(personUpdateDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础实验人员 - 删除 + * */ + @Override + public int deleteBasicExperimentPerson(Long currentUserId, Long id) { + + PersonDeleteDTO personDeleteDTO = basicExperimentPersonService.deleteBasicExperimentPerson(currentUserId, id); + + if (ObjectUtils.isEmpty(personDeleteDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础实验人员 - 列表 + * */ + @Override + public SearchResult<BasicExperimentPersonAppListDTO> listBasicExperimentPerson(Long currentUserId) { + + SearchResult searchResult = new SearchResult<>(); + + List<PersonListDTO> personListDTOS = basicExperimentPersonService.listBasicExperimentPerson(currentUserId); + searchResult.setData(BeanCopyUtils.copyBeanList(personListDTOS, BasicExperimentPersonAppListDTO.class)); + searchResult.setCount(personListDTOS.size()); + + return searchResult; + } + + /** + * 基础场所管理 - 新增 + * */ + @Override + public int insertBasicExperimentSite(Long currentUserId, BasicExperimentSiteInsertReqBO insertReqBO) { + + BasicExperimentSiteAppInsertBO insertParam = BeanCopyUtils.copyBean(insertReqBO, BasicExperimentSiteAppInsertBO.class); + + BasicExperimentSite insertResult = basicExperimentSiteService.insertBasicExperimentSite(currentUserId, insertParam); + + if (ObjectUtils.isEmpty(insertResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础场所管理 - 分页查询 + * */ + @Override + public SearchResult<BasicExperimentSiteAppQueryDTO> selectBasicExperimentSitePage(Long currentUserId, BasicExperimentSiteQueryReqBO queryReqBO) { + + SearchResult searchResult = new SearchResult<>(); + + BasicExperimentSiteAppQueryBO queryParam = BeanCopyUtils.copyBean(queryReqBO, BasicExperimentSiteAppQueryBO.class); + SearchResult<SiteQueryDTO> queryResult = basicExperimentSiteService.selectBasicExperimentSitePage(currentUserId, queryParam); + + Object data = queryResult.getData(); + + searchResult.setPageIndex(queryResult.getPageIndex()); + searchResult.setPageSize(queryResult.getPageSize()); + searchResult.setTotal(queryResult.getTotal()); + searchResult.setData(BeanCopyUtils.copySiteAppQueryList(data, BasicExperimentSiteAppQueryDTO.class)); + + return searchResult; + } + + /** + * 基础场所管理 - 修改 + * */ + @Override + public int updateBasicExperimentSite(Long currentUserId, BasicExperimentSiteUpdateReqBO updateReqBO) { + BasicExperimentSiteAppUpdateBO updateParam = BeanCopyUtils.copyBean(updateReqBO, BasicExperimentSiteAppUpdateBO.class); + + SiteUpdateDTO siteUpdateDTO = basicExperimentSiteService.updateBasicExperimentSite(currentUserId, updateParam); + if (ObjectUtils.isEmpty(siteUpdateDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础场所管理 - 删除 + * */ + @Override + public int deleteBasicExperimentSite(Long currentUserId, Long id) { + + SiteDeleteDTO deleteResult = basicExperimentSiteService.deleteBasicExperimentSite(currentUserId, id); + if (ObjectUtils.isEmpty(deleteResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础场所管理 - 列表 + * */ + @Override + public SearchResult<BasicExperimentSiteAppListDTO> listBasicExperimentSite(Long currentUserId) { + SearchResult searchResult = new SearchResult<>(); + + List<SiteListDTO> listResult = basicExperimentSiteService.listBasicExperimentSite(currentUserId); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, BasicExperimentSiteAppListDTO.class)); + searchResult.setCount(listResult.size()); + return searchResult; + } + + /** + * 基础实验耗材管理 - 新增 + */ + @Override + public int insertBasicExperimentStuff(Long currentUserId, BasicExperimentStuffInsertReqBO insertReqBO) { + + BasicExperimentStuffAppInsertBO insertParam = BeanCopyUtils.copyBean(insertReqBO, BasicExperimentStuffAppInsertBO.class); + StuffInsertDTO insertResult = basicExperimentStuffService.insertBasicExperimentStuff(currentUserId, insertParam); + + if (ObjectUtils.isEmpty(insertResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础实验耗材管理 - 分页查询 + */ + @Override + public SearchResult<BasicExperimentStuffAppQueryDTO> selectBasicExperimentStuffPage(Long currentUserId, BasicExperimentStuffQueryReqBO queryReqBO) { + + SearchResult searchResult = new SearchResult(); + + BasicExperimentStuffAppQueryBO queryParam = BeanCopyUtils.copyBean(queryReqBO, BasicExperimentStuffAppQueryBO.class); + SearchResult<StuffQueryDTO> queryResult = basicExperimentStuffService.selectBasicExperimentStuffPage(currentUserId, queryParam); + + + searchResult.setPageIndex(queryResult.getPageIndex()); + searchResult.setPageSize(queryResult.getPageSize()); + searchResult.setTotal(queryResult.getTotal()); + searchResult.setData(BeanCopyUtils.copyStuffAppQueryList(queryResult.getData(), BasicExperimentStuffAppQueryDTO.class)); + + return searchResult; + } + + /** + * 基础实验耗材管理 - 修改 + */ + @Override + public int updateBasicExperimentStuff(Long currentUserId, BasicExperimentStuffUpdateReqBO updateReqBO) { + + BasicExperimentStuffAppUpdateBO updateParam = BeanCopyUtils.copyBean(updateReqBO, BasicExperimentStuffAppUpdateBO.class); + + StuffUpdateDTO stuffUpdateDTO = basicExperimentStuffService.updateBasicExperimentSite(currentUserId, updateParam); + + if (ObjectUtils.isEmpty(stuffUpdateDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础实验耗材管理 - 删除 + */ + @Override + public int deleteBasicExperimentStuff(Long currentUserId, Long id) { + + StuffDeleteDTO deleteResult = basicExperimentStuffService.deleteBasicExperimentStuff(currentUserId, id); + if (ObjectUtils.isEmpty(deleteResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础实验耗材管理 - 列表 + */ + @Override + public SearchResult<BasicExperimentStuffAppListDTO> listBasicExperimentStuff(Long currentUserId) { + SearchResult searchResult = new SearchResult<>(); + + List<StuffListDTO> listResult = basicExperimentStuffService.listBasicExperimentStuff(currentUserId); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, BasicExperimentStuffAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 基础实验类型 - 列表 + */ + @Override + public SearchResult<BasicExperimentTypeAppListDTO> listBasicExperimentType() { + SearchResult searchResult = new SearchResult<>(); + + List<TypeListDTO> listResult = basicExperimentTypeService.listBasicExperimentType(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, BasicExperimentTypeAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 基础风险单元管理 - 插入 + */ + @Override + public int insertBasicRiskUnit(Long currentUserId, BasicRiskUnitInsertReqBO insertReqBO) { + + BasicRiskUnitAppInsertBO insertParam = BeanCopyUtils.copyBean(insertReqBO, BasicRiskUnitAppInsertBO.class); + + //校验,如果类型是1或者2,则风险源id不可为空 + if (insertReqBO.getRiskSourceType() == 1 || insertReqBO.getRiskSourceType() == 2){ + if (ObjectUtils.isEmpty(insertReqBO.getRiskSourceId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险源不能为空"); + } + //如果riskType为1-区域 + if (insertReqBO.getRiskSourceType() == 1){ + SiteQueryDTO siteById = basicExperimentSiteService.getBasicExperimentSiteById(insertReqBO.getRiskSourceId()); + //设置参数 + insertParam.setRiskSourceId(siteById.getId()); + } + //如果riskType为2-设备 + if (insertReqBO.getRiskSourceType() == 2){ + DeviceQueryDTO deviceById = basicExperimentDeviceService.getBasicExperimentDeviceById(insertReqBO.getRiskSourceId()); + //设置参数 + insertParam.setRiskSourceId(deviceById.getId()); + } + }else { + insertParam.setRiskSourceId(null); + } + + RiskUnitInsertDTO insertResult = basicRiskUnitService.insertBasicRiskUnit(currentUserId, insertParam); + + if (ObjectUtils.isEmpty(insertResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础风险单元管理 - 分页查询 + */ + @Override + public SearchResult<BasicRiskUnitAppQueryDTO> selectBasicRiskUnitPage(Long currentUserId, BasicRiskUnitQueryReqBO queryReqBO) { + + SearchResult searchResult = new SearchResult(); + + BasicRiskUnitAppQueryBO queryParam = BeanCopyUtils.copyBean(queryReqBO, BasicRiskUnitAppQueryBO.class); + SearchResult<RiskUnitBasicQueryDTO> queryResult = basicRiskUnitService.selectBasicRiskUnitPage(currentUserId, queryParam); + + searchResult.setPageIndex(queryResult.getPageIndex()); + searchResult.setPageSize(queryResult.getPageSize()); + searchResult.setTotal(queryResult.getTotal()); + searchResult.setData(BeanCopyUtils.copyStuffAppQueryList(queryResult.getData(), BasicExperimentStuffAppQueryDTO.class)); + + return searchResult; + } + + /** + * 基础风险单元管理 - 修改 + */ + @Override + public int updateBasicRiskUnit(Long currentUserId, BasicRiskUnitUpdateReqBO updateReqBO) { + + BasicRiskUnitAppUpdateBO updateParam = BeanCopyUtils.copyBean(updateReqBO, BasicRiskUnitAppUpdateBO.class); + + RiskUnitUpdateDTO riskUnitUpdateDTO = basicRiskUnitService.updateBasicRiskUnit(currentUserId, updateParam); + + if (ObjectUtils.isEmpty(riskUnitUpdateDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础风险单元管理 - 删除 + */ + @Override + public int deleteBasicRiskUnit(Long currentUserId, Long id) { + + RiskUnitBasicDeleteDTO deleteResult = basicRiskUnitService.deleteBasicRiskUnit(currentUserId, id); + if (ObjectUtils.isEmpty(deleteResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础风险单元管理 - 列表 + */ + @Override + public SearchResult<BasicRiskUnitAppListDTO> listBasicRiskUnit(Long currentUserId) { + SearchResult searchResult = new SearchResult<>(); + + List<RiskUnitListDTO> listResult = basicRiskUnitService.listBasicRiskUnit(currentUserId); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, BasicRiskUnitAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 基础实验风险 - 列表 + * */ + @Override + public SearchResult<BasicRiskSourceTypeListRespDTO> listRiskSourceType() { + SearchResult searchResult = new SearchResult<>(); + + List<RiskSourceTypeDTO> listResult = basicRiskSourceTypeService.listBasicRiskSourceType(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, BasicRiskUnitAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/DictionaryAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/DictionaryAppServiceImpl.java new file mode 100644 index 0000000..9934277 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/DictionaryAppServiceImpl.java @@ -0,0 +1,59 @@ +package com.gkhy.labRiskManage.application.basic.service.impl; + +import com.gkhy.labRiskManage.application.basic.service.DictionaryAppService; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceTypeDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitTypeDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteTypeDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.TipDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentDeviceTypeService; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteTypeService; +import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitTypeService; +import com.gkhy.labRiskManage.domain.basic.service.BasicTipService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class DictionaryAppServiceImpl implements DictionaryAppService { + + @Autowired + private BasicExperimentSiteTypeService siteTypeService; + @Autowired + private BasicExperimentDeviceTypeService deviceTypeService; + @Autowired + private BasicRiskUnitTypeService riskUnitTypeService; + @Autowired + private BasicTipService tipService; + /** + * 基础字典 - 场所类型 + * */ + @Override + public List<SiteTypeDTO> listSiteType() { + return siteTypeService.listSiteType(); + } + + /** + * 基础字典 - 风险类型 + * */ + @Override + public List<RiskUnitTypeDTO> listRiskUnitType() { + return riskUnitTypeService.listRiskUnitType(); + } + + /** + * 基础字典 - 设备类型 + * */ + @Override + public List<DeviceTypeDTO> listDeviceType() { + return deviceTypeService.listDeviceType(); + } + + /** + * 基础字典 - 友情提示 + * */ + @Override + public List<TipDTO> listTip() { + return tipService.listTip(); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/FactorAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/FactorAppServiceImpl.java new file mode 100644 index 0000000..d444a0a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/basic/service/impl/FactorAppServiceImpl.java @@ -0,0 +1,172 @@ +package com.gkhy.labRiskManage.application.basic.service.impl; + +import com.gkhy.labRiskManage.application.basic.dto.dto.*; +import com.gkhy.labRiskManage.application.basic.service.FactorAppService; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; +import com.gkhy.labRiskManage.domain.basic.service.FactorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 评价因子 + */ +@Service +public class FactorAppServiceImpl implements FactorAppService { + + @Autowired + private FactorService factorService; + + /** + * 评价因子LEC-L 列表 + */ + @Override + public SearchResult<FactorLecLAppListDTO> listLecL() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorLecLDTO> listResult = factorService.listLecL(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorLecLAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 评价因子LEC-E 列表 + */ + @Override + public SearchResult<FactorLecEAppListDTO> listLecE() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorLecEDTO> listResult = factorService.listLecE(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorLecEAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 评价因子LEC-C 列表 + */ + @Override + public SearchResult<FactorLecCAppListDTO> listLecC() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorLecCDTO> listResult = factorService.listLecC(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorLecCAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 评价因子LS-L 列表 + */ + @Override + public SearchResult<FactorLsLAppListDTO> listLsL() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorLsLDTO> listResult = factorService.listLsL(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorLsLAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 评价因子LS-S 列表 + */ + @Override + public SearchResult<FactorLsSAppListDTO> listLsS() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorLsSDTO> listResult = factorService.listLsS(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorLsSAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 评价因子Mes-M 列表 + */ + @Override + public SearchResult<FactorMesMAppListDTO> listMesM() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorMesMDTO> listResult = factorService.listMesM(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorMesMAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 评价因子Mes-E 列表 + */ + @Override + public SearchResult<FactorMesEAppListDTO> listMesE() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorMesEDTO> listResult = factorService.listMesE(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorMesEAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 评价因子Mes-S 列表 + */ + @Override + public SearchResult<FactorMesSAppListDTO> listMesS() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorMesSDTO> listResult = factorService.listMesS(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorMesSAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 评价因子Rs-R 列表 + */ + @Override + public SearchResult<FactorRsRAppListDTO> listRsR() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorRsRDTO> listResult = factorService.listRsR(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorRsRAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } + + /** + * 评价因子Rs-S 列表 + */ + @Override + public SearchResult<FactorRsSAppListDTO> listRsS() { + SearchResult searchResult = new SearchResult<>(); + + List<FactorRsSDTO> listResult = factorService.listRsS(); + + searchResult.setData(BeanCopyUtils.copyBeanList(listResult, FactorRsSAppListDTO.class)); + searchResult.setCount(listResult.size()); + + return searchResult; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/converter/ExperimentAppConverter.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/converter/ExperimentAppConverter.java new file mode 100644 index 0000000..7122a67 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/converter/ExperimentAppConverter.java @@ -0,0 +1,94 @@ +package com.gkhy.labRiskManage.application.experiment.converter; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentAndDeviceInsertReqBO; +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentAndEmergencyInsertReqBO; +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentAndStuffInsertReqBO; +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentHazardousWasteInsertReqBO; +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAndDeviceAppInsertBO; +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAndEmergencyAppInsertBO; +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAndStuffAppInsertBO; +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentHazardousWasteAppInsertBO; +import com.gkhy.labRiskManage.application.experiment.dto.dto.ExperimentInfoAppVo; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndEmergency; +import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/20 + * @time: 15:15 + */ +@Component +public class ExperimentAppConverter { + public List<ExperimentAndDeviceAppInsertBO> getDeviceInsertBOList(List<ExperimentAndDeviceInsertReqBO> deviceList, Long experimentId) { + List<ExperimentAndDeviceAppInsertBO> list = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(deviceList)){ + for(ExperimentAndDeviceInsertReqBO experimentAndDeviceInsertReqBO:deviceList){ + ExperimentAndDeviceAppInsertBO experimentAndDeviceAppInsertBO = new ExperimentAndDeviceAppInsertBO(); + experimentAndDeviceAppInsertBO.setDeviceId(experimentAndDeviceInsertReqBO.getDeviceId()); + experimentAndDeviceAppInsertBO.setDeviceUseCount(experimentAndDeviceInsertReqBO.getDeviceUseCount()); + experimentAndDeviceAppInsertBO.setExperimentId(experimentId); + list.add(experimentAndDeviceAppInsertBO); + } + } + return list; + } + public List<ExperimentAndStuffAppInsertBO> getStuffInsertBOList(List<ExperimentAndStuffInsertReqBO> stuffList, Long experimentId) { + List<ExperimentAndStuffAppInsertBO> list = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(stuffList)){ + for(ExperimentAndStuffInsertReqBO experimentAndStuffInsertReqBO:stuffList){ + ExperimentAndStuffAppInsertBO experimentAndStuffAppInsertBO = new ExperimentAndStuffAppInsertBO(); + experimentAndStuffAppInsertBO.setStuffId(experimentAndStuffInsertReqBO.getStuffId()); + experimentAndStuffAppInsertBO.setStuffUseCount(experimentAndStuffInsertReqBO.getStuffUseCount()); + experimentAndStuffAppInsertBO.setExperimentId(experimentId); + list.add(experimentAndStuffAppInsertBO); + } + } + return list; + } + public List<ExperimentHazardousWasteAppInsertBO> getHazardousWasteInsertBOList(List<ExperimentHazardousWasteInsertReqBO> hazardousWasteList, Long experimentId) { + + List<ExperimentHazardousWasteAppInsertBO> list = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(hazardousWasteList)){ + for(ExperimentHazardousWasteInsertReqBO experimentHazardousWasteInsertReqBO:hazardousWasteList){ + ExperimentHazardousWasteAppInsertBO experimentHazardousWasteAppInsertBO = new ExperimentHazardousWasteAppInsertBO(); + BeanUtils.copyProperties(experimentHazardousWasteInsertReqBO,experimentHazardousWasteAppInsertBO); + experimentHazardousWasteAppInsertBO.setExperimentId(experimentId); + list.add(experimentHazardousWasteAppInsertBO); + } + } + + return list; + } + public List<ExperimentAndEmergencyAppInsertBO> getExperimentAndEmergencyAppInsertBOList(List<ExperimentAndEmergencyInsertReqBO> ExperimentAndEmergencyList, Long experimentId){ + List<ExperimentAndEmergencyAppInsertBO> list = new ArrayList<>(); + if (ObjectUtil.isNotEmpty(ExperimentAndEmergencyList)) { + for(ExperimentAndEmergencyInsertReqBO emergencyInsertReqBO : ExperimentAndEmergencyList){ + ExperimentAndEmergencyAppInsertBO experimentAndEmergencyAppInsertBO = new ExperimentAndEmergencyAppInsertBO(); + BeanUtils.copyProperties(emergencyInsertReqBO,experimentAndEmergencyAppInsertBO); + experimentAndEmergencyAppInsertBO.setExperimentId(experimentId); + list.add(experimentAndEmergencyAppInsertBO); + } + } + return list; + } + + + public List<ExperimentInfoAppVo> getExperimentInfoAppVoList(List<ExperimentInfoDTO> experimentInfoList) { + List<ExperimentInfoAppVo> experimentInfoAppVos = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoList)){ + experimentInfoAppVos = BeanCopyUtils.copyBeanList(experimentInfoList,ExperimentInfoAppVo.class); + } + return experimentInfoAppVos; + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndDeviceAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndDeviceAppInsertBO.java new file mode 100644 index 0000000..4e1babc --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndDeviceAppInsertBO.java @@ -0,0 +1,37 @@ +package com.gkhy.labRiskManage.application.experiment.dto.bo; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:10 + */ +public class ExperimentAndDeviceAppInsertBO { + private Long deviceId; + private Long experimentId; + private Integer deviceUseCount; + + public Long getDeviceId() { + return deviceId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + + public Integer getDeviceUseCount() { + return deviceUseCount; + } + + public void setDeviceUseCount(Integer deviceUseCount) { + this.deviceUseCount = deviceUseCount; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndEmergencyAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndEmergencyAppInsertBO.java new file mode 100644 index 0000000..8125486 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndEmergencyAppInsertBO.java @@ -0,0 +1,35 @@ +package com.gkhy.labRiskManage.application.experiment.dto.bo; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 13:27 + */ +@Data +public class ExperimentAndEmergencyAppInsertBO { + + private Long id; + /** + * 有无应急预案 + */ + private String emergencyPlan; + /** + * 预案名称 + */ + private String emergencyPlanName; + /** + * 是否演练 + */ + private String emergencyDrillStatus; + /** + * 应急演练情况 + */ + private String emergencyDrill; + /** + * 实验信息 + */ + private Long experimentId; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndPersonAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndPersonAppInsertBO.java new file mode 100644 index 0000000..d5d8ae2 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndPersonAppInsertBO.java @@ -0,0 +1,116 @@ +package com.gkhy.labRiskManage.application.experiment.dto.bo; + +/** + * 基础实验人员管理 + */ +public class ExperimentAndPersonAppInsertBO { + + private Long personId; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 手机号 + */ + private Long phone; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + + + public Long getPersonId() { + return personId; + } + + public void setPersonId(Long personId) { + this.personId = personId; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndStuffAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndStuffAppInsertBO.java new file mode 100644 index 0000000..e80b1ac --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAndStuffAppInsertBO.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.application.experiment.dto.bo; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 16:14 + */ +@Data +public class ExperimentAndStuffAppInsertBO { + private Long stuffId; + private Integer stuffUseCount; + private Long experimentId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppDevelopUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppDevelopUpdateBO.java new file mode 100644 index 0000000..68f0a3e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppDevelopUpdateBO.java @@ -0,0 +1,58 @@ +package com.gkhy.labRiskManage.application.experiment.dto.bo; + +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 15:25 + */ +public class ExperimentAppDevelopUpdateBO { + /** + * 实验id + */ + private Long id; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + + private LocalDateTime startTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getSisStatus() { + return sisStatus; + } + + public void setSisStatus(Byte sisStatus) { + this.sisStatus = sisStatus; + } + + public String getSafeInformationSystem() { + return safeInformationSystem; + } + + public void setSafeInformationSystem(String safeInformationSystem) { + this.safeInformationSystem = safeInformationSystem; + } + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppInsertBO.java new file mode 100644 index 0000000..c851118 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentAppInsertBO.java @@ -0,0 +1,153 @@ +package com.gkhy.labRiskManage.application.experiment.dto.bo; + +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentAndDeviceInsertReqBO; +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentAndStuffInsertReqBO; +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentHazardousWasteInsertReqBO; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 15:25 + */ +@Data +public class ExperimentAppInsertBO { + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long liabilityUserId; + private String liabilityUserPhone; + + /** + * 安全负责人id + */ + private Long safeLiabilityUserId; + + private String safeLiabilityUser; + + private String safeLiabilityUserPhone; + + /** + * 部门 + */ + private String dep; + + /** + * 实验开始时间 + */ + private LocalDateTime startTime; + /** + * 实验立项时间 + */ + private LocalDateTime createExperimentTime; + /** + * 实验步骤 + */ + private String experimentStep; + /** + * 实验操作方法 + */ + private String experimentMethod; + /** + * 工艺流程 + */ + private String process; + /** + * 关键过程 + */ + private String keyProcess; + /** + * 是否存在过夜、老化实验。1-存在;2-不存在 + */ + private Byte timeout; + /** + * 过夜、老化实验保障管理措施 + */ + private String timeoutManager; + /** + * 是否在密闭条件下。1-密闭;2-不密闭 + */ + private Byte closed; + /** + * 非密闭实验保障管理措施 + */ + private String unclosedManager; + /** + * 实验场所防爆措施条件和设施情况 + */ + private String explosionProof; + /** + * 实验场所防火措施条件和设施情况 + */ + private String fireProof; + /** + * 实验场所防毒措施条件和设施情况 + */ + private String poisonProof; + + /** + * 安全管理制度 + */ + private String safeManagerMethod; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + /** + * 分区隔断情况 + */ + private Byte partitionCondition; + /** + * 其他基础信息 + */ + private String note; + /** + * 实验评估状态:1-未评估;2-评估中;3-评估完成 + */ + private Byte stage; + /** + * 实验申请状态:1-未申请;2-已申请 + */ + private Byte status; + /** + * 实验标签:1-新立项;2-已开展 + */ + private Byte experimentTag; + + private String measure; + + /** + * 危废情况 + */ + private List<ExperimentHazardousWasteAppInsertBO> hazardousWasteList; + /** + * 实验耗材 + */ + private List<ExperimentAndStuffAppInsertBO> stuffList; + /** + * 试验设备 + */ + private List<ExperimentAndDeviceAppInsertBO> deviceList; + /** + * 实验人员 + */ + private List<ExperimentAndPersonAppInsertBO> persons; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentHazardousWasteAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentHazardousWasteAppInsertBO.java new file mode 100644 index 0000000..7611a8b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentHazardousWasteAppInsertBO.java @@ -0,0 +1,56 @@ +package com.gkhy.labRiskManage.application.experiment.dto.bo; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 16:09 + */ +public class ExperimentHazardousWasteAppInsertBO { + /** + * 废弃物分类:1-有机;2-酸;3-碱性;4-固体废弃物;5-医疗废弃物;6-过期化学品;7-其他; + */ + private Byte classify; + /** + * 废弃物存储方式:1-吨袋;2-吨桶;3-小桶;4-托盘;5-其他; + */ + private Byte wasteStorage; + /** + * 预估处理量(计量单位:kg) + */ + private Double handAmount; + + private Long experimentId; + + public Byte getClassify() { + return classify; + } + + public void setClassify(Byte classify) { + this.classify = classify; + } + + public Byte getWasteStorage() { + return wasteStorage; + } + + public void setWasteStorage(Byte wasteStorage) { + this.wasteStorage = wasteStorage; + } + + public Double getHandAmount() { + return handAmount; + } + + public void setHandAmount(Double handAmount) { + this.handAmount = handAmount; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentInfoAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentInfoAppQueryBO.java new file mode 100644 index 0000000..1f8b49a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/bo/ExperimentInfoAppQueryBO.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.application.experiment.dto.bo; + +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/26 + * @time: 14:46 + */ +public class ExperimentInfoAppQueryBO { + private LocalDateTime startTime; + private LocalDateTime endTime; + private Byte experimentType; + private String experimentName; + + 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 getExperimentType() { + return experimentType; + } + + public void setExperimentType(Byte experimentType) { + this.experimentType = experimentType; + } + + public String getExperimentName() { + return experimentName; + } + + public void setExperimentName(String experimentName) { + this.experimentName = experimentName; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndDeviceAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndDeviceAppQueryDTO.java new file mode 100644 index 0000000..3736c48 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndDeviceAppQueryDTO.java @@ -0,0 +1,106 @@ +package com.gkhy.labRiskManage.application.experiment.dto.dto; + +import java.time.LocalDateTime; + +/** + * 实验与设备 + */ + +public class ExperimentAndDeviceAppQueryDTO { + + private Long deviceId; + + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 使用数量 + */ + private Integer deviceUseCount; + + public Long getDeviceId() { + return deviceId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + + public Integer getDeviceUseCount() { + return deviceUseCount; + } + + public void setDeviceUseCount(Integer deviceUseCount) { + this.deviceUseCount = deviceUseCount; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndEmergencyAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndEmergencyAppQueryDTO.java new file mode 100644 index 0000000..6c2cc35 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndEmergencyAppQueryDTO.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.application.experiment.dto.dto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 16:07 + */ +@Data +public class ExperimentAndEmergencyAppQueryDTO { + + private Long id; + /** + * 有无应急预案 + */ + private String emergencyPlan; + /** + * 预案名称 + */ + private String emergencyPlanName; + /** + * 是否演练 + */ + private String emergencyDrillStatus; + /** + * 应急演练情况 + */ + private String emergencyDrill; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndPersonAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndPersonAppQueryDTO.java new file mode 100644 index 0000000..b6124e6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndPersonAppQueryDTO.java @@ -0,0 +1,107 @@ +package com.gkhy.labRiskManage.application.experiment.dto.dto; + + +/** + * 实验与实验人员 + */ + +public class ExperimentAndPersonAppQueryDTO { + + private Long personId; + /** + * 人员(此信息不在修改) + */ + private String personName; + /** + * 年龄(此信息不在修改) + */ + private Integer personAge; + + /** + * 1-男;2-女(此信息不在修改) + */ + private Byte personGender; + + /** + * 专业(此信息不在修改) + */ + private String personMajor; + /** + * 部门名称(与基础部门无关)(此信息不在修改) + */ + private String depName; + /** + * 相关资质(此信息不在修改) + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训(此信息不在修改) + */ + private Byte training; + + public Long getPersonId() { + return personId; + } + + public void setPersonId(Long personId) { + this.personId = personId; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndSiteAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndSiteAppQueryDTO.java new file mode 100644 index 0000000..4a9274a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndSiteAppQueryDTO.java @@ -0,0 +1,40 @@ +package com.gkhy.labRiskManage.application.experiment.dto.dto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/28 + * @time: 15:24 + */ +@Data +public class ExperimentAndSiteAppQueryDTO { + private Long siteId; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + + /** + * 场所性质 + */ + private String siteType; +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndStuffAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndStuffAppQueryDTO.java new file mode 100644 index 0000000..7fe10fb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentAndStuffAppQueryDTO.java @@ -0,0 +1,95 @@ +package com.gkhy.labRiskManage.application.experiment.dto.dto; + +import java.time.LocalDateTime; + +/** + * 实验与耗材 + */ + +public class ExperimentAndStuffAppQueryDTO { + + + /** + * 名称 + */ + private String stuffName; + /** + * 类型 + */ + private Byte stuffType; + /** + * 编号 + */ + private String stuffCode; + /** + * 存储方式 + */ + private Byte stuffStorage; + /** + * 计量单位 + */ + private Byte stuffUnit; + /** + * 使用数量 + */ + private Integer stuffUseCount; + + private Long stuffId; + + public Integer getStuffUseCount() { + return stuffUseCount; + } + + public void setStuffUseCount(Integer stuffUseCount) { + this.stuffUseCount = stuffUseCount; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + + public Long getStuffId() { + return stuffId; + } + + public void setStuffId(Long stuffId) { + this.stuffId = stuffId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentHazardousWasteAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentHazardousWasteAppQueryDTO.java new file mode 100644 index 0000000..dada651 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentHazardousWasteAppQueryDTO.java @@ -0,0 +1,77 @@ +package com.gkhy.labRiskManage.application.experiment.dto.dto; + +import java.time.LocalDateTime; + +/** + * 实验危废物 + */ +public class ExperimentHazardousWasteAppQueryDTO { + + private Long id; + + /** + * 废弃物分类:1-有机;2-酸;3-碱性;4-固体废弃物;5-医疗废弃物;6-过期化学品;7-其他; + */ + private Byte classify; + private String classifyDes; + /** + * 废弃物存储方式:1-吨袋;2-吨桶;3-小桶;4-托盘;5-其他; + */ + private Byte wasteStorage; + private String wasteStorageDes; + /** + * 预估处理量(计量单位:kg) + */ + private Double handAmount; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getClassify() { + return classify; + } + + public void setClassify(Byte classify) { + this.classify = classify; + } + + public Byte getWasteStorage() { + return wasteStorage; + } + + public void setWasteStorage(Byte wasteStorage) { + this.wasteStorage = wasteStorage; + } + + public Double getHandAmount() { + return handAmount; + } + + public void setHandAmount(Double handAmount) { + this.handAmount = handAmount; + } + + + public String getClassifyDes() { + return classifyDes; + } + + public void setClassifyDes(String classifyDes) { + this.classifyDes = classifyDes; + } + + public String getWasteStorageDes() { + return wasteStorageDes; + } + + public void setWasteStorageDes(String wasteStorageDes) { + this.wasteStorageDes = wasteStorageDes; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppQueryDTO.java new file mode 100644 index 0000000..8988f4c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppQueryDTO.java @@ -0,0 +1,219 @@ +package com.gkhy.labRiskManage.application.experiment.dto.dto; + + +import com.gkhy.labRiskManage.api.controller.experiment.dto.resp.ExperimentAndEmergencyRespDTO; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 实验信息 + */ +@Data +public class ExperimentInfoAppQueryDTO { + private Long id; + /** + * 实验编号 + */ + private String experimentCode; + /** + * 自定义试验编号 + */ + private String experimentCustomCode; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long liabilityUserId; + + private String liabilityUserPhone; + + private String safeLiabilityUserPhone; + /** + * 实验负责人 + * (文字描述可能不再修改) + */ + private String liabilityUser; + /** + * 安全负责人id + */ + private Long safeLiabilityUserId; + /** + * 安全负责人(文字描述可能不再修改) + */ + private String safeLiabilityUser; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + /** + * 场所ID + */ + private Long siteId; + + /** + * 实验开始时间 + */ + private LocalDateTime startTime; + /** + * 实验步骤 + */ + private String experimentStep; + /** + * 实验操作方法 + */ + private String experimentMethod; + /** + * 工艺流程 + */ + private String process; + /** + * 关键过程 + */ + private String keyProcess; + /** + * 是否存在过夜、老化实验。1-存在;2-不存在 + */ + private Byte timeout; + /** + * 过夜、老化实验保障管理措施 + */ + private String timeoutManager; + /** + * 是否在密闭条件下。1-密闭;2-不密闭 + */ + private Byte closed; + /** + * 非密闭实验保障管理措施 + */ + private String unclosedManager; + /** + * 实验场所防爆措施条件和设施情况 + */ + private String explosionProof; + /** + * 实验场所防火措施条件和设施情况 + */ + private String fireProof; + /** + * 实验场所防毒措施条件和设施情况 + */ + private String poisonProof; + /** + * 危废产生情况:1-有危废;2-无危废 + */ + private Byte hazardousWaste; + /** + * 安全管理制度 + */ + private String safeManagerMethod; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + /** + * 分区隔断情况 + */ + private Byte partitionCondition; + /** + * 其他基础信息 + */ + private String note; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Integer updateByUserId; + /** + * 新建人 + */ + private Integer createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 实验评估状态:1-未评估;2-评估中;3-评估完成 + */ + private Byte stage; + /** + * 实验申请状态:1-未申请;2-已申请 + */ + private Byte status; + /** + * 实验标签:1-新立项;2-已开展 + */ + private Byte experimentTag; + /** + * 实验预期时间 + */ + private LocalDateTime createExperimentTime; + /** + * 风险评估等级 + */ + private Byte assessLevel; + /** + * 评估时间 + */ + private LocalDateTime assessTime; + /** + * 评估申请时间 + */ + private LocalDateTime assessApplyTime; + /** + * 措施 + */ + private String measure; + /** + * 整改 + */ + private Byte rectifyStatus; + /** + * 审核结果 + */ + private Byte approvalStatus; + /** + * 填报人 + */ + private String informant; + /** + * 填报人 + */ + private String assessPerson; + + private List<ExperimentAndPersonAppQueryDTO> persons; + private List<ExperimentAndDeviceAppQueryDTO> devices; + private List<ExperimentAndStuffAppQueryDTO> stuffs; + private List<ExperimentHazardousWasteAppQueryDTO> wastes; + private List<ExperimentAndSiteAppQueryDTO> sites; + /** + * 演练情况 + */ + private List<ExperimentAndEmergencyRespDTO> emergencies; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppVo.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppVo.java new file mode 100644 index 0000000..9810f72 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/dto/dto/ExperimentInfoAppVo.java @@ -0,0 +1,28 @@ +package com.gkhy.labRiskManage.application.experiment.dto.dto; + +/** + * 实验信息 + */ + +public class ExperimentInfoAppVo { + private Long id; + + private String experimentName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getExperimentName() { + return experimentName; + } + + public void setExperimentName(String experimentName) { + this.experimentName = experimentName; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/service/ExperimentAppService.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/service/ExperimentAppService.java new file mode 100644 index 0000000..2a75299 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/service/ExperimentAppService.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.application.experiment.service; + +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.ExperimentInsertReqBO; +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAppDevelopUpdateBO; +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentInfoAppQueryBO; +import com.gkhy.labRiskManage.application.experiment.dto.dto.ExperimentInfoAppQueryDTO; +import com.gkhy.labRiskManage.application.experiment.dto.dto.ExperimentInfoAppVo; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.model.PageQuery; + +import java.util.List; + +public interface ExperimentAppService { + int save(Long currentUserId, ExperimentInsertReqBO experimentAppInsertBO); + int developSave(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO); + + int deleteById(Long id, Long currentUserId); + + int updateDevelop(Long currentUserId, List<ExperimentAppDevelopUpdateBO> appDevelopUpdateBOList); + + int applyEvaluation(Long currentUserId, List<Long> ids); + + SearchResult<List<ExperimentInfoAppQueryDTO>> projectListByPage(PageQuery<ExperimentInfoAppQueryBO> pageQuery,Long currentUserId); + + SearchResult<List<ExperimentInfoAppQueryDTO>> developListByPage(PageQuery<ExperimentInfoAppQueryBO> appPageQuery,Long currentUserId); + + int revokeApplyEvaluation(Long currentUserId, List<Long> ids); + + List<ExperimentInfoAppVo> getExperimentInfoList(Long currentUserId); + + int rectifySave(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO); + + SearchResult<List<ExperimentInfoAppQueryDTO>> applyEvaluationListByPage(PageQuery<ExperimentInfoAppQueryBO> appPageQuery,Long currentUserId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/experiment/service/impl/ExperimentAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/experiment/service/impl/ExperimentAppServiceImpl.java new file mode 100644 index 0000000..93de098 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/experiment/service/impl/ExperimentAppServiceImpl.java @@ -0,0 +1,358 @@ +package com.gkhy.labRiskManage.application.experiment.service.impl; + +import com.gkhy.labRiskManage.api.controller.experiment.dto.req.*; +import com.gkhy.labRiskManage.api.controller.experiment.dto.resp.ExperimentAndEmergencyRespDTO; +import com.gkhy.labRiskManage.application.experiment.converter.ExperimentAppConverter; +import com.gkhy.labRiskManage.application.experiment.dto.bo.*; +import com.gkhy.labRiskManage.application.experiment.dto.dto.*; +import com.gkhy.labRiskManage.application.experiment.service.ExperimentAppService; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.ReportAppQueryDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentInfo; +import com.gkhy.labRiskManage.domain.experiment.enums.ExperimentStatusEnum; +import com.gkhy.labRiskManage.domain.experiment.enums.ExperimentTagEnum; +import com.gkhy.labRiskManage.domain.experiment.model.bo.*; +import com.gkhy.labRiskManage.domain.experiment.enums.HazardousWasteEnum; +import com.gkhy.labRiskManage.domain.experiment.enums.TimeoutEnum; +import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO; +import com.gkhy.labRiskManage.domain.experiment.service.*; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportRiskAssessInfoService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class ExperimentAppServiceImpl implements ExperimentAppService { + @Autowired + private ExperimentInfoService experimentInfoService; + @Autowired + private ExperimentHazardousWasteService experimentHazardousWasteService; + @Autowired + private ExperimentAndStuffService experimentAndStuffService; + @Autowired + private ExperimentAndDeviceService experimentAndDeviceService; + @Autowired + private ExperimentAndPersonService experimentAndPersonService; + @Autowired + private ReportRiskAssessInfoService reportRiskAssessInfoService; + @Autowired + private ExperimentAndSiteService experimentAndSiteService; + @Autowired + private ExperimentAndEmergencyService experimentAndEmergencyService; + @Autowired + private ExperimentAppConverter experimentAppConverter; + + @Transactional + @Override + public int save(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO) { + + //实验基础信息 + ExperimentAppInsertBO experimentAppInsertBO = new ExperimentAppInsertBO(); + BeanUtils.copyProperties(experimentInsertReqBO,experimentAppInsertBO); + ExperimentInfoDTO experimentInfoDTO = experimentInfoService.save(currentUserId,experimentAppInsertBO); + + //设备中间表 + List<ExperimentAndDeviceAppInsertBO> deviceAppInsertBOList = experimentAppConverter.getDeviceInsertBOList(experimentInsertReqBO.getDeviceList(),experimentInfoDTO.getId()); + //材料中间表 + List<ExperimentAndStuffAppInsertBO> stuffInsertBOList = experimentAppConverter.getStuffInsertBOList(experimentInsertReqBO.getStuffList(),experimentInfoDTO.getId()); + //实验人员 + List<Long> personIds = new ArrayList<>(); + if(!CollectionUtils.isEmpty(experimentInsertReqBO.getPersons())){ + personIds = experimentInsertReqBO.getPersons().stream().map(ExperimentAndPersonInsertReqBO::getPersonId).collect(Collectors.toList()); + } + //实验地点中间表 + List<Long> siteIds = new ArrayList<>(); + if(!CollectionUtils.isEmpty(experimentInsertReqBO.getSiteList())){ + siteIds = experimentInsertReqBO.getSiteList().stream().map(ExperimentAndSiteInsertReqBO::getSiteId).collect(Collectors.toList()); + } + //危废中间表 + List<ExperimentHazardousWasteAppInsertBO> hazardousWasteInsertBOList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(experimentAppInsertBO.getHazardousWasteList())){ + hazardousWasteInsertBOList = experimentAppConverter.getHazardousWasteInsertBOList(experimentInsertReqBO.getHazardousWasteList(),experimentInfoDTO.getId()); + } + //应急演练 + List<ExperimentAndEmergencyAppInsertBO> experimentAndEmergencyAppInsertBOList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(experimentInsertReqBO.getEmergencyList())){ + experimentAndEmergencyAppInsertBOList = experimentAppConverter.getExperimentAndEmergencyAppInsertBOList(experimentInsertReqBO.getEmergencyList(), experimentInfoDTO.getId()); + } + experimentAndDeviceService.saveBatch(currentUserId,deviceAppInsertBOList); + experimentAndStuffService.saveBatch(currentUserId,stuffInsertBOList); + experimentAndPersonService.saveBatch(currentUserId,personIds,experimentInfoDTO.getId()); + experimentAndSiteService.saveBatch(currentUserId, siteIds, experimentInfoDTO.getId()); + experimentHazardousWasteService.saveBatch(currentUserId,hazardousWasteInsertBOList); + experimentAndEmergencyService.saveBatch(currentUserId,experimentAndEmergencyAppInsertBOList); + Integer code = StatusEnum.SUCCESS.getCode(); + if(ObjectUtils.isEmpty(experimentInfoDTO)){ + code = StatusEnum.FAIL.getCode(); + } + return code; + } + @Transactional + @Override + public int developSave(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO) { + //实验基础信息 + ExperimentAppInsertBO experimentAppInsertBO = new ExperimentAppInsertBO(); + BeanUtils.copyProperties(experimentInsertReqBO,experimentAppInsertBO); + ExperimentInfoDTO experimentInfoDTO = experimentInfoService.developSave(currentUserId,experimentAppInsertBO); + + //设备中间表 + List<ExperimentAndDeviceAppInsertBO> deviceAppInsertBOList = experimentAppConverter.getDeviceInsertBOList(experimentInsertReqBO.getDeviceList(),experimentInfoDTO.getId()); + //材料中间表 + List<ExperimentAndStuffAppInsertBO> stuffInsertBOList = experimentAppConverter.getStuffInsertBOList(experimentInsertReqBO.getStuffList(),experimentInfoDTO.getId()); + //实验人员 + List<Long> personIds = new ArrayList<>(); + if(!CollectionUtils.isEmpty(experimentInsertReqBO.getPersons())){ + personIds = experimentInsertReqBO.getPersons().stream().map(ExperimentAndPersonInsertReqBO::getPersonId).collect(Collectors.toList()); + } + //实验地点中间表 + List<Long> siteIds = new ArrayList<>(); + if(!CollectionUtils.isEmpty(experimentInsertReqBO.getSiteList())){ + siteIds = experimentInsertReqBO.getSiteList().stream().map(ExperimentAndSiteInsertReqBO::getSiteId).collect(Collectors.toList()); + } + //危废中间表 + List<ExperimentHazardousWasteAppInsertBO> hazardousWasteInsertBOList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(experimentAppInsertBO.getHazardousWasteList())){ + hazardousWasteInsertBOList = experimentAppConverter.getHazardousWasteInsertBOList(experimentInsertReqBO.getHazardousWasteList(),experimentInfoDTO.getId()); + } + //应急演练 + List<ExperimentAndEmergencyAppInsertBO> experimentAndEmergencyAppInsertBOList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(experimentInsertReqBO.getEmergencyList())){ + experimentAndEmergencyAppInsertBOList = experimentAppConverter.getExperimentAndEmergencyAppInsertBOList(experimentInsertReqBO.getEmergencyList(), experimentInfoDTO.getId()); + } + + experimentAndDeviceService.saveBatch(currentUserId,deviceAppInsertBOList); + experimentAndStuffService.saveBatch(currentUserId,stuffInsertBOList); + experimentAndPersonService.saveBatch(currentUserId,personIds,experimentInfoDTO.getId()); + experimentAndSiteService.saveBatch(currentUserId, siteIds, experimentInfoDTO.getId()); + experimentHazardousWasteService.saveBatch(currentUserId,hazardousWasteInsertBOList); + experimentAndEmergencyService.saveBatch(currentUserId,experimentAndEmergencyAppInsertBOList); + Integer code = StatusEnum.SUCCESS.getCode(); + if(ObjectUtils.isEmpty(experimentInfoDTO)){ + code = StatusEnum.FAIL.getCode(); + } + return code; + } + @Transactional + @Override + public int rectifySave(Long currentUserId, ExperimentInsertReqBO experimentInsertReqBO) { + //修该原有实验已整改 + boolean flag = experimentInfoService.updateRectify(experimentInsertReqBO.getId()); + //新建 + int save = this.save(currentUserId, experimentInsertReqBO); + if(flag && save == StatusEnum.SUCCESS.getCode()){ + return StatusEnum.SUCCESS.getCode(); + } + return StatusEnum.FAIL.getCode(); + } + + @Override + public SearchResult<List<ExperimentInfoAppQueryDTO>> applyEvaluationListByPage(PageQuery<ExperimentInfoAppQueryBO> appPageQuery,Long currentUserId) { + PageQuery<ExperimentInfoQueryBO> pageQuery = new PageQuery<>(); + pageQuery.setPageSize(appPageQuery.getPageSize()); + pageQuery.setPageIndex(appPageQuery.getPageIndex()); + ExperimentInfoQueryBO queryBO = new ExperimentInfoQueryBO(); + if(!ObjectUtils.isEmpty(appPageQuery.getSearchParams())){ + BeanUtils.copyProperties(appPageQuery.getSearchParams(),queryBO); + } + queryBO.setStatus(ExperimentStatusEnum.YES_APPLY.getValue()); + pageQuery.setSearchParams(queryBO); + SearchResult<List<ExperimentInfoDTO>> searchResult = experimentInfoService.listByPage(pageQuery,currentUserId); + SearchResult<List<ExperimentInfoAppQueryDTO>> result = new SearchResult<>(); + if(!ObjectUtils.isEmpty(searchResult)){ + BeanUtils.copyProperties(searchResult,result); + } + List<ExperimentInfoDTO> experimentInfoDTOS = (List<ExperimentInfoDTO>)searchResult.getData(); + + result.setData(getExperimentInfoAppQueryDTO(experimentInfoDTOS)); + //获取分页数据 + return result; + } + + /** + * 删除 + * + * @param id + * @param currentUserId + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int deleteById(Long id, Long currentUserId) { + experimentInfoService.deleteById(id,currentUserId); + experimentAndDeviceService.deleteByExperimentId(id,currentUserId); + experimentHazardousWasteService.deleteByExperimentId(id,currentUserId); + experimentAndPersonService.deleteByExperimentId(id,currentUserId); + experimentAndStuffService.deleteByExperimentId(id,currentUserId); + experimentAndSiteService.deleteByExperimentId(id); + experimentAndEmergencyService.deleteByExperimentId(id); + return StatusEnum.SUCCESS.getCode(); + } + + @Override + public int updateDevelop(Long currentUserId, List<ExperimentAppDevelopUpdateBO> appDevelopUpdateBOList) { + int code = StatusEnum.SUCCESS.getCode(); + List<ExperimentDevelopUpdateBO> developUpdateBOList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(appDevelopUpdateBOList)){ + developUpdateBOList = BeanCopyUtils.copyBeanList(appDevelopUpdateBOList,ExperimentDevelopUpdateBO.class); + } + boolean flag = experimentInfoService.updateDevelop(currentUserId,developUpdateBOList); + if(!flag){ + code = StatusEnum.FAIL.getCode(); + } + return code; + } + + @Override + public int applyEvaluation(Long currentUserId, List<Long> ids) { + int code = StatusEnum.SUCCESS.getCode(); + boolean flag = experimentInfoService.applyEvaluation(currentUserId,ids); + if(!flag){ + code = StatusEnum.FAIL.getCode(); + } + return code; + } + @Override + public int revokeApplyEvaluation(Long currentUserId, List<Long> ids) { + int code = StatusEnum.SUCCESS.getCode(); + boolean flag = experimentInfoService.revokeApplyEvaluation(currentUserId,ids); + if(!flag){ + code = StatusEnum.FAIL.getCode(); + } + return code; + } + + @Override + public List<ExperimentInfoAppVo> getExperimentInfoList(Long currentUserId) { + List<ExperimentInfoDTO> experimentInfoList = experimentInfoService.getExperimentInfoList(currentUserId); + + return experimentAppConverter.getExperimentInfoAppVoList(experimentInfoList); + } + + + + @Override + public SearchResult<List<ExperimentInfoAppQueryDTO>> projectListByPage(PageQuery<ExperimentInfoAppQueryBO> appPageQuery,Long currentUserId) { + PageQuery<ExperimentInfoQueryBO> pageQuery = new PageQuery<>(); + pageQuery.setPageSize(appPageQuery.getPageSize()); + pageQuery.setPageIndex(appPageQuery.getPageIndex()); + ExperimentInfoQueryBO queryBO = new ExperimentInfoQueryBO(); + if(!ObjectUtils.isEmpty(appPageQuery.getSearchParams())){ + BeanUtils.copyProperties(appPageQuery.getSearchParams(),queryBO); + } + queryBO.setExperimentTag(ExperimentTagEnum.NEW_CREATE.getValue()); + pageQuery.setSearchParams(queryBO); + SearchResult<List<ExperimentInfoDTO>> searchResult = experimentInfoService.listByPage(pageQuery,currentUserId); + SearchResult<List<ExperimentInfoAppQueryDTO>> result = new SearchResult<>(); + if(!ObjectUtils.isEmpty(searchResult)){ + BeanUtils.copyProperties(searchResult,result); + } + List<ExperimentInfoDTO> experimentInfoDTOS = (List<ExperimentInfoDTO>)searchResult.getData(); + + result.setData(getExperimentInfoAppQueryDTO(experimentInfoDTOS)); + //获取分页数据 + return result; + } + + @Override + public SearchResult<List<ExperimentInfoAppQueryDTO>> developListByPage(PageQuery<ExperimentInfoAppQueryBO> appPageQuery,Long currentUserId) { + PageQuery<ExperimentInfoQueryBO> pageQuery = new PageQuery<>(); + pageQuery.setPageSize(appPageQuery.getPageSize()); + pageQuery.setPageIndex(appPageQuery.getPageIndex()); + ExperimentInfoQueryBO queryBO = new ExperimentInfoQueryBO(); + if(!ObjectUtils.isEmpty(appPageQuery.getSearchParams())){ + BeanUtils.copyProperties(appPageQuery.getSearchParams(),queryBO); + } + queryBO.setExperimentTag(ExperimentTagEnum.AREADLY_DEVELOP.getValue()); + pageQuery.setSearchParams(queryBO); + SearchResult<List<ExperimentInfoDTO>> searchResult = experimentInfoService.listByPage(pageQuery,currentUserId); + SearchResult<List<ExperimentInfoAppQueryDTO>> result = new SearchResult<>(); + if(!ObjectUtils.isEmpty(searchResult)){ + BeanUtils.copyProperties(searchResult,result); + } + List<ExperimentInfoDTO> experimentInfoDTOS = (List<ExperimentInfoDTO>)searchResult.getData(); + + result.setData(getExperimentInfoAppQueryDTO(experimentInfoDTOS)); + //获取分页数据 + return result; + } + + + + private List<ExperimentInfoAppQueryDTO> getExperimentInfoAppQueryDTO(List<ExperimentInfoDTO> experimentInfoDTOS){ + List<ExperimentInfoAppQueryDTO> experimentInfoAppQueryDTOS = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoDTOS)){ + List<Long> expermentIds = experimentInfoDTOS.stream().map(ExperimentInfoDTO::getId).collect(Collectors.toList()); + //获取关联的评估数据 + List<ReportAppQueryDTO> reportAppQueryDTOS = reportRiskAssessInfoService.listRiskReport(expermentIds); + //遍历实验 + for (ExperimentInfoDTO experimentInfoDTO:experimentInfoDTOS){ + ExperimentInfoAppQueryDTO experimentInfoAppQueryDTO = new ExperimentInfoAppQueryDTO(); + BeanUtils.copyProperties(experimentInfoDTO,experimentInfoAppQueryDTO); + //实验场所 + List<ExperimentAndSiteAppQueryDTO> siteAppQueryDTOs = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoDTO.getSites())){ + siteAppQueryDTOs = BeanCopyUtils.copyBeanList(experimentInfoDTO.getSites(),ExperimentAndSiteAppQueryDTO.class); + } + experimentInfoAppQueryDTO.setSites(siteAppQueryDTOs); + //人员 + List<ExperimentAndPersonAppQueryDTO> personAppQueryDTOList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoDTO.getPersons())){ + personAppQueryDTOList = BeanCopyUtils.copyBeanList(experimentInfoDTO.getPersons(),ExperimentAndPersonAppQueryDTO.class); + } + experimentInfoAppQueryDTO.setPersons(personAppQueryDTOList); + //设备 + List<ExperimentAndDeviceAppQueryDTO> deviceAppQueryDTOList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoDTO.getDevices())){ + deviceAppQueryDTOList = BeanCopyUtils.copyBeanList(experimentInfoDTO.getDevices(),ExperimentAndDeviceAppQueryDTO.class); + } + experimentInfoAppQueryDTO.setDevices(deviceAppQueryDTOList); + //材料 + List<ExperimentAndStuffAppQueryDTO> stuffAppQueryDTOList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoDTO.getStuffs())){ + stuffAppQueryDTOList = BeanCopyUtils.copyBeanList(experimentInfoDTO.getStuffs(),ExperimentAndStuffAppQueryDTO.class); + } + experimentInfoAppQueryDTO.setStuffs(stuffAppQueryDTOList); + //危废 + List<ExperimentHazardousWasteAppQueryDTO> wasteAppQueryDTOList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoDTO.getWastes())){ + wasteAppQueryDTOList = BeanCopyUtils.copyBeanList(experimentInfoDTO.getWastes(),ExperimentHazardousWasteAppQueryDTO.class); + } + experimentInfoAppQueryDTO.setWastes(wasteAppQueryDTOList); + + //应急演练 + List<ExperimentAndEmergencyRespDTO> emergencies = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfoDTO.getEmergencies())){ + emergencies = BeanCopyUtils.copyBeanList(experimentInfoDTO.getEmergencies(),ExperimentAndEmergencyRespDTO.class); + } + experimentInfoAppQueryDTO.setEmergencies(emergencies); + //风险评估 + if(!ObjectUtils.isEmpty(reportAppQueryDTOS)){ + List<ReportAppQueryDTO> selectList = reportAppQueryDTOS.stream().filter(item -> item.getExperimentId().equals(experimentInfoDTO.getId())).collect(Collectors.toList()); + if(selectList.size()>0){ + experimentInfoAppQueryDTO.setAssessLevel(selectList.get(0).getAssessLevel()); + experimentInfoAppQueryDTO.setAssessTime(selectList.get(0).getAssessTime()); + } + }else { + experimentInfoAppQueryDTO.setAssessLevel((byte)0); + } + experimentInfoAppQueryDTOS.add(experimentInfoAppQueryDTO); + } + } + return experimentInfoAppQueryDTOS; + } + + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/InherentRiskUnitAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/InherentRiskUnitAppInsertBO.java new file mode 100644 index 0000000..12de283 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/InherentRiskUnitAppInsertBO.java @@ -0,0 +1,125 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +public class InherentRiskUnitAppInsertBO { + + /** + * 实验id + */ + private Long experimentId; + /** + * 基础风险单元id + */ + private Long basicRiskUnitId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Long getBasicRiskUnitId() { + return basicRiskUnitId; + } + + public void setBasicRiskUnitId(Long basicRiskUnitId) { + this.basicRiskUnitId = basicRiskUnitId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getEvaluateStatus() { + return evaluateStatus; + } + + public void setEvaluateStatus(Byte evaluateStatus) { + this.evaluateStatus = evaluateStatus; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportAppQueryBO.java new file mode 100644 index 0000000..16ea525 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportAppQueryBO.java @@ -0,0 +1,42 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + + +import lombok.Data; + +/** + * 风险评估报告 + */ +@Data +public class ReportAppQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * tag:1-查询未填写的报告;2-已填写的报告;3-查询所有报告 + */ + private Byte tag; + /** + * 实验名称 - 先不用 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + * (文字描述可能不再修改) + */ + private Byte experimentType; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approvePlanStatus; + /** + * 实验 + */ + private Long experimentId; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportAppUpdateBO.java new file mode 100644 index 0000000..2298f43 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportAppUpdateBO.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + + +import lombok.Data; + +/** + * 风险评估报告 + */ +@Data +public class ReportAppUpdateBO { + + private Long id; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 评估人 + */ + private String assessPerson; + /** + * 评级依据 + */ + private String description; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportPersonAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportPersonAppInsertBO.java new file mode 100644 index 0000000..388bced --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportPersonAppInsertBO.java @@ -0,0 +1,83 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import java.time.LocalDateTime; + +/** + * 风险评估报告-评估专家 + */ +public class ReportPersonAppInsertBO { + + /** + * 报告id + */ + private Long reportId; + /** + * 审批阶段排序 + */ + private Integer approveIndex; + /** + * 审批阶段名称 + */ + private String approveStage; + /** + * 审批意见说明 + */ + private String approveDesc; + /** + * 审批时间 + */ + private LocalDateTime approveTime; + /** + * 审批人id + */ + private Long approvePersonId; + + public LocalDateTime getApproveTime() { + return approveTime; + } + + public void setApproveTime(LocalDateTime approveTime) { + this.approveTime = approveTime; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getApproveIndex() { + return approveIndex; + } + + public void setApproveIndex(Integer approveIndex) { + this.approveIndex = approveIndex; + } + + public String getApproveStage() { + return approveStage; + } + + public void setApproveStage(String approveStage) { + this.approveStage = approveStage; + } + + public String getApproveDesc() { + return approveDesc; + } + + public void setApproveDesc(String approveDesc) { + this.approveDesc = approveDesc; + } + + public Long getApprovePersonId() { + return approvePersonId; + } + + public void setApprovePersonId(Long approvePersonId) { + this.approvePersonId = approvePersonId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportPersonAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportPersonAppUpdateBO.java new file mode 100644 index 0000000..5b42300 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportPersonAppUpdateBO.java @@ -0,0 +1,92 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import java.time.LocalDateTime; + +/** + * 风险评估报告-评估专家 + */ +public class ReportPersonAppUpdateBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 审批阶段排序 + */ + private Integer approveIndex; + /** + * 审批阶段名称 + */ + private String approveStage; + /** + * 审批意见说明 + */ + private String approveDesc; + /** + * 审批时间 + */ + private LocalDateTime approveTime; + /** + * 审批人id + */ + private Long approvePersonId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public LocalDateTime getApproveTime() { + return approveTime; + } + + public void setApproveTime(LocalDateTime approveTime) { + this.approveTime = approveTime; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getApproveIndex() { + return approveIndex; + } + + public void setApproveIndex(Integer approveIndex) { + this.approveIndex = approveIndex; + } + + public String getApproveStage() { + return approveStage; + } + + public void setApproveStage(String approveStage) { + this.approveStage = approveStage; + } + + public String getApproveDesc() { + return approveDesc; + } + + public void setApproveDesc(String approveDesc) { + this.approveDesc = approveDesc; + } + + public Long getApprovePersonId() { + return approvePersonId; + } + + public void setApprovePersonId(Long approvePersonId) { + this.approvePersonId = approvePersonId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceAppInsertBO.java new file mode 100644 index 0000000..6da11fc --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceAppInsertBO.java @@ -0,0 +1,85 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +public class ReportSourceAppInsertBO { + + + /** + * 报告id + */ + private Long reportId; + /** + * 排序 + */ + private Integer riskSourceIndex; + /** + * 危险源 + */ + private String riskSource; + /** + * 危险特性 + */ + private String riskCharacteristic; + /** + * 数量 + */ + private Integer number; + /** + * 说明 + */ + private String desc; + + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getRiskSourceIndex() { + return riskSourceIndex; + } + + public void setRiskSourceIndex(Integer riskSourceIndex) { + this.riskSourceIndex = riskSourceIndex; + } + + public String getRiskSource() { + return riskSource; + } + + public void setRiskSource(String riskSource) { + this.riskSource = riskSource; + } + + public String getRiskCharacteristic() { + return riskCharacteristic; + } + + public void setRiskCharacteristic(String riskCharacteristic) { + this.riskCharacteristic = riskCharacteristic; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceAppUpdateBO.java new file mode 100644 index 0000000..061fd3d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceAppUpdateBO.java @@ -0,0 +1,92 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +public class ReportSourceAppUpdateBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 排序 + */ + private Integer riskSourceIndex; + /** + * 危险源 + */ + private String riskSource; + /** + * 危险特性 + */ + private String riskCharacteristic; + /** + * 数量 + */ + private Integer number; + /** + * 说明 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getRiskSourceIndex() { + return riskSourceIndex; + } + + public void setRiskSourceIndex(Integer riskSourceIndex) { + this.riskSourceIndex = riskSourceIndex; + } + + public String getRiskSource() { + return riskSource; + } + + public void setRiskSource(String riskSource) { + this.riskSource = riskSource; + } + + public String getRiskCharacteristic() { + return riskCharacteristic; + } + + public void setRiskCharacteristic(String riskCharacteristic) { + this.riskCharacteristic = riskCharacteristic; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceTypeAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceTypeAppInsertBO.java new file mode 100644 index 0000000..dbbd234 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceTypeAppInsertBO.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public class ReportSourceTypeAppInsertBO { + + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private Long riskSourceTypeId; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Long getRiskSourceTypeId() { + return riskSourceTypeId; + } + + public void setRiskSourceTypeId(Long riskSourceTypeId) { + this.riskSourceTypeId = riskSourceTypeId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceTypeAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceTypeAppUpdateBO.java new file mode 100644 index 0000000..fbce1f4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/ReportSourceTypeAppUpdateBO.java @@ -0,0 +1,55 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public class ReportSourceTypeAppUpdateBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private Long riskSourceTypeId; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Long getRiskSourceTypeId() { + return riskSourceTypeId; + } + + public void setRiskSourceTypeId(Long riskSourceTypeId) { + this.riskSourceTypeId = riskSourceTypeId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessAppQueryBO.java new file mode 100644 index 0000000..d2b5f48 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessAppQueryBO.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + + +import lombok.Data; + +/** + * 风险辨识与评价 + * */ +@Data +public class RiskAssessAppQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 实验 + */ + private String experimentName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 标识 :1-查询所有,2-查询辨识提交,3-查询评价提交 + */ + private Integer tag; + /** + * + */ + private Long assessPlanId; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppEvaluateBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppEvaluateBO.java new file mode 100644 index 0000000..4edc6a3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppEvaluateBO.java @@ -0,0 +1,207 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import lombok.Data; + +import java.math.BigDecimal; +@Data +public class RiskAssessPlanAppEvaluateBO { + + + private Long id; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 评价专家意见 + */ + private String evaluateDesc; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + + + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + + + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + + + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + + + /** + * LEC_L的数值(评价) + */ + private BigDecimal originalLecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecE; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecC; + /** + * LS_L的数值(评价) + */ + private BigDecimal originalLsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal originalLsS; + /** + * MES_M的数值(评价) + */ + private BigDecimal originalMesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal originalMesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal originalMesS; + /** + * RS_R的数值(评价) + */ + private BigDecimal originalRsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal originalRsS; + + /** + * 风险数值 + */ + private Byte originalRiskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppIdentificationBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppIdentificationBO.java new file mode 100644 index 0000000..1d69669 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppIdentificationBO.java @@ -0,0 +1,137 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import lombok.Data; + +@Data +public class RiskAssessPlanAppIdentificationBO { + + + private Long id; +// /** +// * 技术措施 +// */ +// private String technologyMeasure; +// /** +// * 管理措施 +// */ +// private String manageMeasure; +// /** +// * 教育措施 +// */ +// private String educationMeasure; +// /** +// * 个体防护措施 +// */ +// private String personalProtectionMeasure; +// /** +// * 应急措施 +// */ +// private String emergencyMeasure; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + + + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + + + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + + + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + + + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppInsertBO.java new file mode 100644 index 0000000..2e179ad --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppInsertBO.java @@ -0,0 +1,59 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * + */ +@Data +public class RiskAssessPlanAppInsertBO { + + /** + * 风险分析单元id --传 + */ + private Long riskUnitId; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Long riskType; + /** + * 评估计划名称 --传 + */ + private String assessPlanName; + /** + * 计划制定人 --传 + */ + private Long planUserId; + /** + * 评估开始时间 --传 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 --传 + */ + private LocalDateTime assessEndTime; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 评价专家id + */ + private Long evaluateUserId; + + + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppQueryBO.java new file mode 100644 index 0000000..2a78d2f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppQueryBO.java @@ -0,0 +1,29 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import lombok.Data; + +/** + * + */ +@Data +public class RiskAssessPlanAppQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 风险单元 + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 实验 + */ + private Long experimentId; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppUpdateBO.java new file mode 100644 index 0000000..720ce6f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanAppUpdateBO.java @@ -0,0 +1,128 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import java.time.LocalDateTime; + +/** + * + */ +public class RiskAssessPlanAppUpdateBO { + + private Long id; + /** + * 风险分析单元id --传 + */ + private Long riskUnitId; + /** + * 评估计划名称 --传 + */ + private String assessPlanName; + /** + * 计划制定人 --传 + */ + private Long planUserId; + /** + * 评估开始时间 --传 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 --传 + */ + private LocalDateTime assessEndTime; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + + 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 getAssessPlanName() { + return assessPlanName; + } + + public void setAssessPlanName(String assessPlanName) { + this.assessPlanName = assessPlanName; + } + + public Long getPlanUserId() { + return planUserId; + } + + public void setPlanUserId(Long planUserId) { + this.planUserId = planUserId; + } + + public LocalDateTime getAssessStartTime() { + return assessStartTime; + } + + public void setAssessStartTime(LocalDateTime assessStartTime) { + this.assessStartTime = assessStartTime; + } + + public LocalDateTime getAssessEndTime() { + return assessEndTime; + } + + public void setAssessEndTime(LocalDateTime assessEndTime) { + this.assessEndTime = assessEndTime; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + + public Long getIdentificationUserId() { + return identificationUserId; + } + + public void setIdentificationUserId(Long identificationUserId) { + this.identificationUserId = identificationUserId; + } + + public Byte getEvaluateMethod() { + return evaluateMethod; + } + + public void setEvaluateMethod(Byte evaluateMethod) { + this.evaluateMethod = evaluateMethod; + } + + public Long getEvaluateUserId() { + return evaluateUserId; + } + + public void setEvaluateUserId(Long evaluateUserId) { + this.evaluateUserId = evaluateUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanEvaluateAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanEvaluateAppUpdateBO.java new file mode 100644 index 0000000..bc2a113 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanEvaluateAppUpdateBO.java @@ -0,0 +1,252 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import java.math.BigDecimal; + +public class RiskAssessPlanEvaluateAppUpdateBO { + + private Long id; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + + + private Long LecId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + + + private Long LsId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + + private Long MesId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + + + private Long RsId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getLecId() { + return LecId; + } + + public void setLecId(Long lecId) { + LecId = lecId; + } + + public Long getLsId() { + return LsId; + } + + public void setLsId(Long lsId) { + LsId = lsId; + } + + public Long getMesId() { + return MesId; + } + + public void setMesId(Long mesId) { + MesId = mesId; + } + + public Long getRsId() { + return RsId; + } + + public void setRsId(Long rsId) { + RsId = rsId; + } + + public Byte getEvaluateMethod() { + return evaluateMethod; + } + + public void setEvaluateMethod(Byte evaluateMethod) { + this.evaluateMethod = evaluateMethod; + } + + public BigDecimal getRiskValue() { + return riskValue; + } + + public void setRiskValue(BigDecimal riskValue) { + this.riskValue = riskValue; + } + + public Byte getRiskLevelValue() { + return riskLevelValue; + } + + public void setRiskLevelValue(Byte riskLevelValue) { + this.riskLevelValue = riskLevelValue; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getRiskColor() { + return riskColor; + } + + public void setRiskColor(Byte riskColor) { + this.riskColor = riskColor; + } + + public Byte getManageLevel() { + return manageLevel; + } + + public void setManageLevel(Byte manageLevel) { + this.manageLevel = manageLevel; + } + + public BigDecimal getLecL() { + return lecL; + } + + public void setLecL(BigDecimal lecL) { + this.lecL = lecL; + } + + public BigDecimal getLecE() { + return lecE; + } + + public void setLecE(BigDecimal lecE) { + this.lecE = lecE; + } + + public BigDecimal getLecC() { + return lecC; + } + + public void setLecC(BigDecimal lecC) { + this.lecC = lecC; + } + + public BigDecimal getLsL() { + return lsL; + } + + public void setLsL(BigDecimal lsL) { + this.lsL = lsL; + } + + public BigDecimal getLsS() { + return lsS; + } + + public void setLsS(BigDecimal lsS) { + this.lsS = lsS; + } + + public BigDecimal getMesM() { + return mesM; + } + + public void setMesM(BigDecimal mesM) { + this.mesM = mesM; + } + + public BigDecimal getMesE() { + return mesE; + } + + public void setMesE(BigDecimal mesE) { + this.mesE = mesE; + } + + public BigDecimal getMesS() { + return mesS; + } + + public void setMesS(BigDecimal mesS) { + this.mesS = mesS; + } + + public BigDecimal getRsR() { + return rsR; + } + + public void setRsR(BigDecimal rsR) { + this.rsR = rsR; + } + + public BigDecimal getRsS() { + return rsS; + } + + public void setRsS(BigDecimal rsS) { + this.rsS = rsS; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanIdentificationAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanIdentificationAppUpdateBO.java new file mode 100644 index 0000000..e3ce40e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskAssessPlanIdentificationAppUpdateBO.java @@ -0,0 +1,415 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +public class RiskAssessPlanIdentificationAppUpdateBO { + + private Long id; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + + + private Long analogyId; + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + + + private Long hazopId; + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + + private Long jhaId; + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + + + private Long phaId; + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + + + private Long sclId; + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAnalogyId() { + return analogyId; + } + + public void setAnalogyId(Long analogyId) { + this.analogyId = analogyId; + } + + public Long getHazopId() { + return hazopId; + } + + public void setHazopId(Long hazopId) { + this.hazopId = hazopId; + } + + public Long getJhaId() { + return jhaId; + } + + public void setJhaId(Long jhaId) { + this.jhaId = jhaId; + } + + public Long getPhaId() { + return phaId; + } + + public void setPhaId(Long phaId) { + this.phaId = phaId; + } + + public Long getSclId() { + return sclId; + } + + public void setSclId(Long sclId) { + this.sclId = sclId; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public String getAnalogyCheckItem() { + return analogyCheckItem; + } + + public void setAnalogyCheckItem(String analogyCheckItem) { + this.analogyCheckItem = analogyCheckItem; + } + + public String getAnalogyRiskFactor() { + return analogyRiskFactor; + } + + public void setAnalogyRiskFactor(String analogyRiskFactor) { + this.analogyRiskFactor = analogyRiskFactor; + } + + public String getAnalogyResult() { + return analogyResult; + } + + public void setAnalogyResult(String analogyResult) { + this.analogyResult = analogyResult; + } + + public String getAnalogyReference() { + return analogyReference; + } + + public void setAnalogyReference(String analogyReference) { + this.analogyReference = analogyReference; + } + + public String getHazopNode() { + return hazopNode; + } + + public void setHazopNode(String hazopNode) { + this.hazopNode = hazopNode; + } + + public String getHazopParam() { + return hazopParam; + } + + public void setHazopParam(String hazopParam) { + this.hazopParam = hazopParam; + } + + public String getHazopParamDesc() { + return hazopParamDesc; + } + + public void setHazopParamDesc(String hazopParamDesc) { + this.hazopParamDesc = hazopParamDesc; + } + + public String getHazopGuide() { + return hazopGuide; + } + + public void setHazopGuide(String hazopGuide) { + this.hazopGuide = hazopGuide; + } + + public String getHazopDeviation() { + return hazopDeviation; + } + + public void setHazopDeviation(String hazopDeviation) { + this.hazopDeviation = hazopDeviation; + } + + public String getHazopPossibleCauses() { + return hazopPossibleCauses; + } + + public void setHazopPossibleCauses(String hazopPossibleCauses) { + this.hazopPossibleCauses = hazopPossibleCauses; + } + + public String getHazopResult() { + return hazopResult; + } + + public void setHazopResult(String hazopResult) { + this.hazopResult = hazopResult; + } + + public String getJhaCheckItem() { + return jhaCheckItem; + } + + public void setJhaCheckItem(String jhaCheckItem) { + this.jhaCheckItem = jhaCheckItem; + } + + public String getJhaRiskFactor() { + return jhaRiskFactor; + } + + public void setJhaRiskFactor(String jhaRiskFactor) { + this.jhaRiskFactor = jhaRiskFactor; + } + + public String getJhaResult() { + return jhaResult; + } + + public void setJhaResult(String jhaResult) { + this.jhaResult = jhaResult; + } + + public String getPhaCheckItem() { + return phaCheckItem; + } + + public void setPhaCheckItem(String phaCheckItem) { + this.phaCheckItem = phaCheckItem; + } + + public String getPhaRiskFactor() { + return phaRiskFactor; + } + + public void setPhaRiskFactor(String phaRiskFactor) { + this.phaRiskFactor = phaRiskFactor; + } + + public String getPhaResult() { + return phaResult; + } + + public void setPhaResult(String phaResult) { + this.phaResult = phaResult; + } + + public String getSclCheckItem() { + return sclCheckItem; + } + + public void setSclCheckItem(String sclCheckItem) { + this.sclCheckItem = sclCheckItem; + } + + public String getSclCheckStandard() { + return sclCheckStandard; + } + + public void setSclCheckStandard(String sclCheckStandard) { + this.sclCheckStandard = sclCheckStandard; + } + + public String getSclCheckUnstandard() { + return sclCheckUnstandard; + } + + public void setSclCheckUnstandard(String sclCheckUnstandard) { + this.sclCheckUnstandard = sclCheckUnstandard; + } + + public String getSclCheckResult() { + return sclCheckResult; + } + + public void setSclCheckResult(String sclCheckResult) { + this.sclCheckResult = sclCheckResult; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppInsertBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppInsertBO.java new file mode 100644 index 0000000..9f483ca --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppInsertBO.java @@ -0,0 +1,38 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import lombok.Data; + +@Data +public class RiskUnitAppInsertBO { + + + /** + * 实验id + */ + private Long experimentId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 风险单元描述 + */ + private String description; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppQueryBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppQueryBO.java new file mode 100644 index 0000000..b488acb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppQueryBO.java @@ -0,0 +1,28 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import lombok.Data; + +@Data +public class RiskUnitAppQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 实验 + */ + private String experimentName; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 实验 + */ + private Long experimentId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppUpdateBO.java new file mode 100644 index 0000000..109579b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/bo/RiskUnitAppUpdateBO.java @@ -0,0 +1,41 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.bo; + +import lombok.Data; + +@Data +public class RiskUnitAppUpdateBO { + + /** + * id + */ + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 风险单元描述 + */ + private String description; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/ReportAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/ReportAppQueryDTO.java new file mode 100644 index 0000000..1b57ca1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/ReportAppQueryDTO.java @@ -0,0 +1,159 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.dto; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportExperimentSiteQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportPersonQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportRiskSourceQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportSourceTypeQueryRespDTO; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 风险评估报告 + */ +@Data +public class ReportAppQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + * (文字描述可能不再修改) + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long personUserId; + /** + * 实验负责人(文字描述可能不再修改) + */ + private String personUser; + /** + * 实验负责人手机 + */ + private Long personUserPhone; + /** + * 安全负责人id + */ + private Long safePersonUserId; + /** + * 安全负责人((文字描述可能不再修改) + */ + private String safePersonUser; + /** + * 安全负责人手机 + */ + private Long safePersonUserPhone; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + /** + * 评估人id + */ + private Long assessPersonId; + /** + * 评估人 + */ + private String assessPerson; + /** + * 评估时间 + */ + private LocalDateTime assessTime; + /** + * 实验概况 + */ + private String experimentDesc; + /** + * 实验涉及到的风险源 + */ + private String experimentRiskSource; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approvePlanStatus; +// /** +// * 实验室id +// */ +// private Long siteId; +// /** +// * 实验室 +// */ +// private String site; + /** + * 最后修改人 + */ + private String updateByUserName; + /** + * 新建人 + */ + private String createByUserName; + /** + * 评级依据 + */ + private String description; + /** + * + */ + private String experimentCode; + /** + * + */ + private LocalDateTime evaluateTime; + + List<ReportPersonQueryRespDTO> person; + /** + * 风险源类型 + */ + List<ReportSourceTypeQueryRespDTO> riskSourceType; + /** + * 风险源信息 + */ + List<ReportRiskSourceQueryRespDTO> riskSource; + /** + * + */ + List<ReportExperimentSiteQueryRespDTO> experimentSite; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessAppQueryDTO.java new file mode 100644 index 0000000..64974c6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessAppQueryDTO.java @@ -0,0 +1,127 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.dto; + +import com.gkhy.labRiskManage.domain.riskReport.model.dto.FactorQueryDTO; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 风险辨识与评价 + * */ +@Data +public class RiskAssessAppQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 风险分析单元id + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + + + private List<FactorQueryDTO> factorQueryDTOList; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessAppQueryDTO_0223bak.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessAppQueryDTO_0223bak.java new file mode 100644 index 0000000..0781d23 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessAppQueryDTO_0223bak.java @@ -0,0 +1,896 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.dto; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 风险辨识与评价 + * */ +public class RiskAssessAppQueryDTO_0223bak { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 风险分析单元 + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 类比法_检查项目id + */ + private Long analogyId; + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + + private Long hazopId; + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + private Long jhaId; + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + + private Long phaId; + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + + private Long sclId; + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + + + + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + + private Long LecId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + + private Long LsId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + private Long MesId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + + private Long RsId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + 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 getAssessPlanName() { + return assessPlanName; + } + + public void setAssessPlanName(String assessPlanName) { + this.assessPlanName = assessPlanName; + } + + public Byte getRiskType() { + return riskType; + } + + public void setRiskType(Byte riskType) { + this.riskType = riskType; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Long getPlanUserId() { + return planUserId; + } + + public void setPlanUserId(Long planUserId) { + this.planUserId = planUserId; + } + + public LocalDateTime getAssessStartTime() { + return assessStartTime; + } + + public void setAssessStartTime(LocalDateTime assessStartTime) { + this.assessStartTime = assessStartTime; + } + + public LocalDateTime getAssessEndTime() { + return assessEndTime; + } + + public void setAssessEndTime(LocalDateTime assessEndTime) { + this.assessEndTime = assessEndTime; + } + + public LocalDateTime getIdentificationTime() { + return identificationTime; + } + + public void setIdentificationTime(LocalDateTime identificationTime) { + this.identificationTime = identificationTime; + } + + public LocalDateTime getEvaluateTime() { + return evaluateTime; + } + + public void setEvaluateTime(LocalDateTime evaluateTime) { + this.evaluateTime = evaluateTime; + } + + public Byte getPlanSellStatus() { + return planSellStatus; + } + + public void setPlanSellStatus(Byte planSellStatus) { + this.planSellStatus = planSellStatus; + } + + public LocalDateTime getPlanSellTime() { + return planSellTime; + } + + public void setPlanSellTime(LocalDateTime planSellTime) { + this.planSellTime = planSellTime; + } + + public Byte getPlanExecStatus() { + return planExecStatus; + } + + public void setPlanExecStatus(Byte planExecStatus) { + this.planExecStatus = planExecStatus; + } + + public Byte getPlanTimeStatus() { + return planTimeStatus; + } + + public void setPlanTimeStatus(Byte planTimeStatus) { + this.planTimeStatus = planTimeStatus; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + + public String getIdentificationUser() { + return identificationUser; + } + + public void setIdentificationUser(String identificationUser) { + this.identificationUser = identificationUser; + } + + public Long getIdentificationUserId() { + return identificationUserId; + } + + public void setIdentificationUserId(Long identificationUserId) { + this.identificationUserId = identificationUserId; + } + + public Byte getEvaluateMethod() { + return evaluateMethod; + } + + public void setEvaluateMethod(Byte evaluateMethod) { + this.evaluateMethod = evaluateMethod; + } + + public Long getEvaluateUserId() { + return evaluateUserId; + } + + public void setEvaluateUserId(Long evaluateUserId) { + this.evaluateUserId = evaluateUserId; + } + + public String getEvaluateUser() { + return evaluateUser; + } + + public void setEvaluateUser(String evaluateUser) { + this.evaluateUser = evaluateUser; + } + + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public Long getAnalogyId() { + return analogyId; + } + + public void setAnalogyId(Long analogyId) { + this.analogyId = analogyId; + } + + public String getAnalogyCheckItem() { + return analogyCheckItem; + } + + public void setAnalogyCheckItem(String analogyCheckItem) { + this.analogyCheckItem = analogyCheckItem; + } + + public String getAnalogyRiskFactor() { + return analogyRiskFactor; + } + + public void setAnalogyRiskFactor(String analogyRiskFactor) { + this.analogyRiskFactor = analogyRiskFactor; + } + + public String getAnalogyResult() { + return analogyResult; + } + + public void setAnalogyResult(String analogyResult) { + this.analogyResult = analogyResult; + } + + public String getAnalogyReference() { + return analogyReference; + } + + public void setAnalogyReference(String analogyReference) { + this.analogyReference = analogyReference; + } + + public Long getHazopId() { + return hazopId; + } + + public void setHazopId(Long hazopId) { + this.hazopId = hazopId; + } + + public String getHazopNode() { + return hazopNode; + } + + public void setHazopNode(String hazopNode) { + this.hazopNode = hazopNode; + } + + public String getHazopParam() { + return hazopParam; + } + + public void setHazopParam(String hazopParam) { + this.hazopParam = hazopParam; + } + + public String getHazopParamDesc() { + return hazopParamDesc; + } + + public void setHazopParamDesc(String hazopParamDesc) { + this.hazopParamDesc = hazopParamDesc; + } + + public String getHazopGuide() { + return hazopGuide; + } + + public void setHazopGuide(String hazopGuide) { + this.hazopGuide = hazopGuide; + } + + public String getHazopDeviation() { + return hazopDeviation; + } + + public void setHazopDeviation(String hazopDeviation) { + this.hazopDeviation = hazopDeviation; + } + + public String getHazopPossibleCauses() { + return hazopPossibleCauses; + } + + public void setHazopPossibleCauses(String hazopPossibleCauses) { + this.hazopPossibleCauses = hazopPossibleCauses; + } + + public String getHazopResult() { + return hazopResult; + } + + public void setHazopResult(String hazopResult) { + this.hazopResult = hazopResult; + } + + public Long getJhaId() { + return jhaId; + } + + public void setJhaId(Long jhaId) { + this.jhaId = jhaId; + } + + public String getJhaCheckItem() { + return jhaCheckItem; + } + + public void setJhaCheckItem(String jhaCheckItem) { + this.jhaCheckItem = jhaCheckItem; + } + + public String getJhaRiskFactor() { + return jhaRiskFactor; + } + + public void setJhaRiskFactor(String jhaRiskFactor) { + this.jhaRiskFactor = jhaRiskFactor; + } + + public String getJhaResult() { + return jhaResult; + } + + public void setJhaResult(String jhaResult) { + this.jhaResult = jhaResult; + } + + public Long getPhaId() { + return phaId; + } + + public void setPhaId(Long phaId) { + this.phaId = phaId; + } + + public String getPhaCheckItem() { + return phaCheckItem; + } + + public void setPhaCheckItem(String phaCheckItem) { + this.phaCheckItem = phaCheckItem; + } + + public String getPhaRiskFactor() { + return phaRiskFactor; + } + + public void setPhaRiskFactor(String phaRiskFactor) { + this.phaRiskFactor = phaRiskFactor; + } + + public String getPhaResult() { + return phaResult; + } + + public void setPhaResult(String phaResult) { + this.phaResult = phaResult; + } + + public Long getSclId() { + return sclId; + } + + public void setSclId(Long sclId) { + this.sclId = sclId; + } + + public String getSclCheckItem() { + return sclCheckItem; + } + + public void setSclCheckItem(String sclCheckItem) { + this.sclCheckItem = sclCheckItem; + } + + public String getSclCheckStandard() { + return sclCheckStandard; + } + + public void setSclCheckStandard(String sclCheckStandard) { + this.sclCheckStandard = sclCheckStandard; + } + + public String getSclCheckUnstandard() { + return sclCheckUnstandard; + } + + public void setSclCheckUnstandard(String sclCheckUnstandard) { + this.sclCheckUnstandard = sclCheckUnstandard; + } + + public String getSclCheckResult() { + return sclCheckResult; + } + + public void setSclCheckResult(String sclCheckResult) { + this.sclCheckResult = sclCheckResult; + } + + public BigDecimal getRiskValue() { + return riskValue; + } + + public void setRiskValue(BigDecimal riskValue) { + this.riskValue = riskValue; + } + + public Byte getRiskLevelValue() { + return riskLevelValue; + } + + public void setRiskLevelValue(Byte riskLevelValue) { + this.riskLevelValue = riskLevelValue; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getRiskColor() { + return riskColor; + } + + public void setRiskColor(Byte riskColor) { + this.riskColor = riskColor; + } + + public Byte getManageLevel() { + return manageLevel; + } + + public void setManageLevel(Byte manageLevel) { + this.manageLevel = manageLevel; + } + + public Long getLecId() { + return LecId; + } + + public void setLecId(Long lecId) { + LecId = lecId; + } + + public BigDecimal getLecL() { + return lecL; + } + + public void setLecL(BigDecimal lecL) { + this.lecL = lecL; + } + + public BigDecimal getLecE() { + return lecE; + } + + public void setLecE(BigDecimal lecE) { + this.lecE = lecE; + } + + public BigDecimal getLecC() { + return lecC; + } + + public void setLecC(BigDecimal lecC) { + this.lecC = lecC; + } + + public Long getLsId() { + return LsId; + } + + public void setLsId(Long lsId) { + LsId = lsId; + } + + public BigDecimal getLsL() { + return lsL; + } + + public void setLsL(BigDecimal lsL) { + this.lsL = lsL; + } + + public BigDecimal getLsS() { + return lsS; + } + + public void setLsS(BigDecimal lsS) { + this.lsS = lsS; + } + + public Long getMesId() { + return MesId; + } + + public void setMesId(Long mesId) { + MesId = mesId; + } + + public BigDecimal getMesM() { + return mesM; + } + + public void setMesM(BigDecimal mesM) { + this.mesM = mesM; + } + + public BigDecimal getMesE() { + return mesE; + } + + public void setMesE(BigDecimal mesE) { + this.mesE = mesE; + } + + public BigDecimal getMesS() { + return mesS; + } + + public void setMesS(BigDecimal mesS) { + this.mesS = mesS; + } + + public Long getRsId() { + return RsId; + } + + public void setRsId(Long rsId) { + RsId = rsId; + } + + public BigDecimal getRsR() { + return rsR; + } + + public void setRsR(BigDecimal rsR) { + this.rsR = rsR; + } + + public BigDecimal getRsS() { + return rsS; + } + + public void setRsS(BigDecimal rsS) { + this.rsS = rsS; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanAppQueryDTO.java new file mode 100644 index 0000000..65bbeea --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanAppQueryDTO.java @@ -0,0 +1,166 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.dto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * + */ +@Data +public class RiskAssessPlanAppQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 风险分析单元id + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 计划制定人人姓名 + */ + private String planUserName; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanListAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanListAppDTO.java new file mode 100644 index 0000000..9cc7a2e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskAssessPlanListAppDTO.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.dto; + +/** + * + */ +public class RiskAssessPlanListAppDTO { + + private Long id; + + /** + * 评估计划名称 + */ + private String assessPlanName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getAssessPlanName() { + return assessPlanName; + } + + public void setAssessPlanName(String assessPlanName) { + this.assessPlanName = assessPlanName; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskUnitAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskUnitAppQueryDTO.java new file mode 100644 index 0000000..c83fc88 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/dto/dto/RiskUnitAppQueryDTO.java @@ -0,0 +1,101 @@ +package com.gkhy.labRiskManage.application.riskReport.dto.dto; + + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class RiskUnitAppQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 实验名称 + */ + private String experimentName; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 负责人 + */ + private String liabilityUser; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 最后修改人名称 + */ + private String updateByUser; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 新建人名称 + */ + private String createByUser; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + /** + * 风险单元类型 + */ + private String riskUnitType; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/ReportAppService.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/ReportAppService.java new file mode 100644 index 0000000..bd7194f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/ReportAppService.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.application.riskReport.service; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportInfoUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportQueryReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportQueryRespDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; + +public interface ReportAppService { + + /** + * 风险评估报告 - 查询 + */ + SearchResult<ReportQueryRespDTO> selectRiskReportPage(Long currentUserId, ReportQueryReqBO queryReqBO); + /** + * 风险评估报告 - 生成报告信息 + */ + int insertRiskReport(Long currentUserId, Long id); + /** + * 风险评估报告 - 填写信息 + */ + int updateRiskReport(Long currentUserId, ReportUpdateReqBO updateReqBO); + /** + * 风险评估报告 - 修改报告信息 + */ + int updateReportInfo(Long currentUserId, ReportInfoUpdateReqBO reportInfoUpdateReqBO); + /** + * 风险评估报告 - 报告审核 - 旧 - 两层审核 + */ + int report(Long currentUserId, ReportReqBO reportReqBO); + /** + * 风险评估报告 - 报告审核 - 新 - 单次审核 + */ + int reportNew(Long currentUserId, ReportReqBO reportReqBO); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/RiskAccessAppService.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/RiskAccessAppService.java new file mode 100644 index 0000000..9e58ff0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/RiskAccessAppService.java @@ -0,0 +1,129 @@ +package com.gkhy.labRiskManage.application.riskReport.service; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.*; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.RiskAssessPlanListRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.RiskUnitListQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessPlanAppQueryDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskUnitAppQueryDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.AssessPlanUpdateDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.FactorQueryDTO; + +import java.math.BigDecimal; + +public interface RiskAccessAppService { + + /** + * 风险评估计划 - 插入 + */ + int insertAssessPlan(Long currentUserId, RiskAssessPlanInsertReqBO assessPlanInsertReqDTO); + /** + * 风险评估计划 - 查询 + */ + SearchResult<RiskAssessPlanAppQueryDTO> selectAssessPlanPage(Long currentUserId, RiskAssessPlanQueryReqBO queryReqBO); + /** + * 风险评估计划 - 修改 + */ + int updateAssessPlan(Long currentUserId, RiskAssessPlanUpdateReqBO updateReqBO); + /** + * 风险评估计划 - 删除 + */ + int deleteAssessPlan(Long currentUserId, Long id); + /** + * 风险评估计划 - 派发任务 + */ + int sellAssessPlan(Long currentUserId, Long id); + /** + * 风险评估计划 - 辨识 + */ + FactorQueryDTO identification(Long currentUserId, RiskAssessPlanIdentificationInsertReqBO identificationReqBO); + /** + * 风险评估计划 - 辨识修改 + */ + FactorQueryDTO updateIdentification(Long currentUserId, RiskAssessPlanIdentificationUpdateReqBO updateReqBO); + /** + * 风险评估计划 - 辨识删除 + */ + int deleteIdentification(Long currentUserId, RiskAssessPlanIdentificationDeleteReqBO deleteReqBO); + /** + * 风险评估计划 - 评价 + */ + FactorQueryDTO evaluate(Long currentUserId, RiskAssessPlanEvaluateInsertReqBO evaluateReqBO); + /** + * 风险评估计划 - 评价修改 + */ + FactorQueryDTO updateEvaluate(Long currentUserId, RiskAssessPlanEvaluateUpdateReqBO updateReqBO); + /** + * 风险评估计划 - 辨识结果提交 + */ + int identificationSubmit(Long currentUserId, Long id); + /** + * 风险评估计划 - 评价结果提交 + */ + int evaluateSubmit(Long currentUserId, Long id); + /** + * 风险辨识与评价 - 查询 + */ + SearchResult selectAssessPage(Long currentUserId, RiskAssessQueryReqBO queryReqBO); + /** + * 风险评估计划 - 评价删除 + */ + int deleteEvaluate(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO); + + /** + * 实验风险单元 - 插入 + */ + int insertRiskUnit(Long currentUserId, RiskUnitInsertReqBO riskUnitInsertReqBO); + /** + * 固有风险单元 - 插入 + */ + int insertInherentRiskUnit(Long currentUserId, InherentRiskUnitInsertReqBO insertReqBO); + /** + * 风险单元管理 - 分页查询 + */ + SearchResult<RiskUnitAppQueryDTO> selectRiskUnitPage(Long currentUserId, RiskUnitQueryReqBO queryReqBO); + /** + * 风险单元 - 修改 + */ + int updateRiskUnit(Long currentUserId, RiskUnitUpdateReqBO updateReqBO); + /** + * 风险单元 - 删除 + */ + int deleteRiskUnit(Long currentUserId, Long id); + /** + * 风险单元 - 列表查询 + */ + SearchResult<RiskUnitListQueryRespDTO> listRiskUnit(Long currentUserId); + /** + * 风险单元 - 列表查询 + */ + SearchResult<RiskUnitListQueryRespDTO> listRiskUnitByExperiment(Long currentUserId, RiskUnitListReqBO reqBO); + /** + * 评估计划 - 列表查询 + */ + SearchResult<RiskAssessPlanListRespDTO> listAssessPlan(); + /** + * 评估计划 - 风险值计算 + */ + BigDecimal riskValue(RiskValueReqBO valueReqBO); + /** + * 风险评估计划 - 辨识专家拒绝 + */ + AssessPlanUpdateDTO identificationRefuse(Long currentUserId, Long id); + /** + * 风险评估计划 - 评价专家拒绝 + */ + AssessPlanUpdateDTO evaluateRefuse(Long currentUserId, Long id); + /** + * 风险评估计划 - 修改辨识方法 + */ + AssessPlanUpdateDTO identificationUpdateMethod(Long currentUserId, MethodUpdateReqDTO updateReqDTO); + /** + * 风险评估计划 - 评价方法修改 + */ + AssessPlanUpdateDTO evaluateUpdateMethod(Long currentUserId, MethodUpdateReqDTO updateReqDTO); + /** + * 风险评估计划 - 重新指定专家 + */ + AssessPlanUpdateDTO appoint(Long currentUserId, AppointUserReBO appointUserReBO); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/ReportAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/ReportAppServiceImpl.java new file mode 100644 index 0000000..c7b2aea --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/ReportAppServiceImpl.java @@ -0,0 +1,205 @@ +package com.gkhy.labRiskManage.application.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportInfoUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportQueryReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportUpdateReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.*; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.ReportAppQueryDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessPlanAppQueryDTO; +import com.gkhy.labRiskManage.application.riskReport.service.ReportAppService; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentInfoService; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportExperimentRiskSourceService; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportExperimentRiskSourceTypeService; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportRiskAssessInfoService; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportRiskAssessPersonService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; + +import java.util.List; + +@Service +public class ReportAppServiceImpl implements ReportAppService { + + @Autowired + private ReportRiskAssessInfoService reportInfoService; + @Autowired + private ReportRiskAssessPersonService reportPersonService; + @Autowired + private ReportExperimentRiskSourceTypeService reportSourceTypeService; + @Autowired + private ReportExperimentRiskSourceService reportSourceService; + @Autowired + private UserDomainService userDomainService; + @Autowired + private ExperimentInfoService experimentInfoService; + + + /** + * 风险评估报告 - 查询 + */ + @Override + public SearchResult<ReportQueryRespDTO> selectRiskReportPage(Long currentUserId, ReportQueryReqBO queryReqBO) { + + SearchResult searchResult = new SearchResult<>(); + + ReportAppQueryBO queryParam = BeanCopyUtils.copyBean(queryReqBO, ReportAppQueryBO.class); + + SearchResult<ReportAppQueryDTO> queryResult = reportInfoService.selectRiskReportPage(currentUserId, queryParam); + + searchResult.setPageIndex(queryResult.getPageIndex()); + searchResult.setPageSize(queryResult.getPageSize()); + searchResult.setTotal(queryResult.getTotal()); + searchResult.setData(BeanCopyUtils.copyRiskAssessPlanAppQueryList(queryResult.getData(), RiskAssessPlanAppQueryDTO.class)); + + return searchResult; + } + + /** + * 风险评估报告 - 生成报告信息 + */ + @Override + public int insertRiskReport(Long currentUserId, Long id) { + + ReportInsertDTO insertResult = reportInfoService.insertRiskReport(currentUserId, id); + + if (ObjectUtils.isEmpty(insertResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估报告 - 填写信息 + */ + @Transactional + @Override + public int updateRiskReport(Long currentUserId, ReportUpdateReqBO updateReqBO) { + + int i = 0; + //报告信息 + ReportAppUpdateBO reportUpdateBO = BeanCopyUtils.copyBean(updateReqBO, ReportAppUpdateBO.class); + ReportUpdateDTO reportUpdateDTO = reportInfoService.updateReportInfoById(currentUserId,reportUpdateBO); + if (ObjectUtils.isEmpty(reportUpdateDTO)){ + i = 1; + } +// +// //审核人信息 +// if (!ObjectUtils.isEmpty(updateReqBO.getPerson())){ +// List<ReportPersonAppInsertBO> personInsertBO = BeanCopyUtils.copyBeanList(updateReqBO.getPerson(), ReportPersonAppInsertBO.class); +// List<ReportPersonInsertDTO> reportPersonInsertDTOS = reportPersonService.insertReportPerson(currentUserId,personInsertBO); +// if (reportPersonInsertDTOS.size() != personInsertBO.size()){ +// i = 1; +// } +// } +// +// //危险源类型信息 +// if (!ObjectUtils.isEmpty(updateReqBO.getRiskSourceType())){ +// List<ReportSourceTypeAppInsertBO> reportSourceTypeInsertBO = BeanCopyUtils.copyBeanList(updateReqBO.getRiskSourceType(), ReportSourceTypeAppInsertBO.class); +// List<ReportSourceTypeInsertDTO> reportSourceTypeInsertDTOS = reportSourceTypeService.insertReportSourceType(currentUserId,reportSourceTypeInsertBO); +// if (reportSourceTypeInsertDTOS.size() != reportSourceTypeInsertBO.size()){ +// i = 1; +// } +// } +// + //危险源信 + if (!ObjectUtils.isEmpty(updateReqBO.getRiskSource())){ + List<ReportSourceAppInsertBO> riskSourceInsertBO = BeanCopyUtils.copyBeanList(updateReqBO.getRiskSource(), ReportSourceAppInsertBO.class); + List<ReportRiskSourceDTO> reportRiskSourceDTOS = reportSourceService.insertReportSource(currentUserId,riskSourceInsertBO); + if (reportRiskSourceDTOS.size() != riskSourceInsertBO.size()){ + i = 1; + } + } + + if (ObjectUtils.isEmpty(reportUpdateDTO)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "风险评估报告写入失败"); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估报告 - 修改报告信息 + */ + @Transactional + @Override + public int updateReportInfo(Long currentUserId, ReportInfoUpdateReqBO updateReqBO) { + + int i = 0; + //报告信息 + ReportAppUpdateBO reportUpdateBO = BeanCopyUtils.copyBean(updateReqBO, ReportAppUpdateBO.class); + ReportUpdateDTO reportUpdateDTO = reportInfoService.updateReportInfoById(currentUserId,reportUpdateBO); + if (ObjectUtils.isEmpty(reportUpdateDTO)){ + i = 1; + } + + //审核人信息 +// if (!ObjectUtils.isEmpty(updateReqBO.getPerson())){ +// List<ReportPersonAppUpdateBO> personUpdateBO = BeanCopyUtils.copyBeanList(updateReqBO.getPerson(), ReportPersonAppUpdateBO.class); +// List<ReportPersonInsertDTO> reportPersonUpdateDTOS = reportPersonService.updateReportPerson(currentUserId, personUpdateBO); +// if (reportPersonUpdateDTOS.size() != personUpdateBO.size()){ +// i = 1; +// } +// } + + //危险源类型信息 +// if (!ObjectUtils.isEmpty(updateReqBO.getRiskSourceType())){ +// List<ReportSourceTypeAppUpdateBO> reportSourceTypeUpdateBO = BeanCopyUtils.copyBeanList(updateReqBO.getRiskSourceType(), ReportSourceTypeAppUpdateBO.class); +// List<ReportSourceTypeInsertDTO> reportSourceTypeUpdateDTOS = reportSourceTypeService.updateReportSourceType(currentUserId, reportSourceTypeUpdateBO); +// if (reportSourceTypeUpdateDTOS.size() != reportSourceTypeUpdateBO.size()){ +// i = 1; +// } +// } + +// if (!ObjectUtils.isEmpty(updateReqBO.getRiskSource())){ +// //危险源信息 +// List<ReportSourceAppUpdateBO> riskSourceUpdateBO = BeanCopyUtils.copyBeanList(updateReqBO.getRiskSource(), ReportSourceAppUpdateBO.class); +// List<ReportRiskSourceDTO> reportRiskSourceUpdateDTOS = reportSourceService.updateReportSource(currentUserId, riskSourceUpdateBO); +// if (reportRiskSourceUpdateDTOS.size() != riskSourceUpdateBO.size()){ +// i = 1; +// } +// } + + if (i == 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "风险评估报告修改失败"); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估报告 - 报告审核 - 旧 - 两层审核 + */ + @Override + public int report(Long currentUserId, ReportReqBO reportReqBO) { + + int report = reportInfoService.report(currentUserId, reportReqBO); + + if (report == 0){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估报告 - 报告审核 - 新 - 单次审核 + */ + @Override + public int reportNew(Long currentUserId, ReportReqBO reportReqBO) { + + int report = reportInfoService.reportNew(currentUserId, reportReqBO); + + if (report == 0){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java new file mode 100644 index 0000000..80506bf --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/riskReport/service/impl/RiskAccessAppServiceImpl.java @@ -0,0 +1,916 @@ +package com.gkhy.labRiskManage.application.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.*; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.RiskAssessPlanListRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.RiskUnitListQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.*; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.*; +import com.gkhy.labRiskManage.application.riskReport.service.RiskAccessAppService; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.enums.UserRoleEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.model.dto.PersonQueryDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitBasicQueryDTO; +import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO; +import com.gkhy.labRiskManage.domain.riskReport.entity.*; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessLSInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessLecInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessMesInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessRsInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService; +import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitService; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentInfoService; +import com.gkhy.labRiskManage.domain.riskReport.service.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; + +import java.math.BigDecimal; +import java.util.List; + +@Service +public class RiskAccessAppServiceImpl implements RiskAccessAppService { + + @Autowired + private RiskAssessPlanService assessPlanService; + @Autowired + private RiskUnitService riskUnitService; + @Autowired + private ExperimentInfoService experimentInfoService; + @Autowired + private BasicRiskUnitService basicRiskUnitService; + @Autowired + private BasicExperimentPersonService basicExperimentPersonService; + + + @Autowired + private RiskAssessPlanIdentificationAnalogyService analogyService; + @Autowired + private RiskAssessPlanIdentificationHazopService hazopService; + @Autowired + private RiskAssessPlanIdentificationJhaService jhaService; + @Autowired + private RiskAssessPlanIdentificationPhaService phaService; + @Autowired + private RiskAssessPlanIdentificationSclService sclService; + + @Autowired + private RiskAssessPlanEvaluateLecService lecService; + @Autowired + private RiskAssessPlanEvaluateLsService lsService; + @Autowired + private RiskAssessPlanEvaluateMesService mesService; + @Autowired + private RiskAssessPlanEvaluateRsService rsService; + + @Autowired + private UserDomainService userDomainService; + + /** + * 风险评估计划 - 插入 + */ + @Override + public int insertAssessPlan(Long currentUserId, RiskAssessPlanInsertReqBO assessPlanInsertReqDTO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } +// RiskUnitQueryDTO riskUnitById = riskUnitService.getRiskUnitById(assessPlanInsertReqDTO.getRiskUnitId()); +// UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); +// if (!userInfoById.getId().equals(riskUnitById.getLiabilityUserId())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "只有实验负责人,才能修改实验风险单元"); +// } + + RiskAssessPlanAppInsertBO insertParam = BeanCopyUtils.copyBean(assessPlanInsertReqDTO, RiskAssessPlanAppInsertBO.class); + PlanInsertDTO planInsertDTO = assessPlanService.insertAssessPlan(currentUserId, insertParam); + + if (ObjectUtils.isEmpty(planInsertDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估计划 - 查询 + */ + @Override + public SearchResult<RiskAssessPlanAppQueryDTO> selectAssessPlanPage(Long currentUserId, RiskAssessPlanQueryReqBO queryReqBO) { + + + SearchResult searchResult = new SearchResult<>(); + + RiskAssessPlanAppQueryBO queryParam = BeanCopyUtils.copyBean(queryReqBO, RiskAssessPlanAppQueryBO.class); + SearchResult<AssessPlanQueryDTO> queryResult = assessPlanService.selectAssessPlanPage(currentUserId, queryParam); + + searchResult.setPageIndex(queryResult.getPageIndex()); + searchResult.setPageSize(queryResult.getPageSize()); + searchResult.setTotal(queryResult.getTotal()); + searchResult.setData(BeanCopyUtils.copyRiskAssessPlanAppQueryList(queryResult.getData(), RiskAssessPlanAppQueryDTO.class)); + + return searchResult; + } + + /** + * 风险评估计划 - 修改 + */ + @Override + public int updateAssessPlan(Long currentUserId, RiskAssessPlanUpdateReqBO updateReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + RiskAssessPlanUpdateReqBO updateParam = BeanCopyUtils.copyBean(updateReqBO, RiskAssessPlanUpdateReqBO.class); + + AssessPlanUpdateDTO assessPlanUpdateDTO = assessPlanService.updateAssessPlan(currentUserId, updateParam); + + if (ObjectUtils.isEmpty(assessPlanUpdateDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估计划 - 删除 + */ + @Override + public int deleteAssessPlan(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + AssessPlanDeleteDTO deleteResult = assessPlanService.deleteAssessPlan(currentUserId, id); + + if (ObjectUtils.isEmpty(deleteResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估计划 - 派发任务 + */ + @Override + public int sellAssessPlan(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + AssessPlanUpdateDTO sellResult = assessPlanService.sellAssessPlan(currentUserId, id); + + if (ObjectUtils.isEmpty(sellResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估计划 - 辨识 + */ + @Override + @Transactional + public FactorQueryDTO identification(Long currentUserId, RiskAssessPlanIdentificationInsertReqBO identificationReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + RiskAssessPlanAppIdentificationBO identificationParam = BeanCopyUtils.copyBean(identificationReqBO, RiskAssessPlanAppIdentificationBO.class); + int tag = 1; + FactorQueryDTO factorQueryDTO = new FactorQueryDTO(); + PhaInsertDTO phaInsertDTO = new PhaInsertDTO(); + JhaInsertDTO jhaInsertDTO = new JhaInsertDTO(); + SclInsertDTO sclInsertDTO = new SclInsertDTO(); + HazopInsertDTO hazopInsertDTO = new HazopInsertDTO(); + AnalogyInsertDTO analogyInsertDTO = new AnalogyInsertDTO(); + //分发参数到不同的服务进行处理 + //辨识方法 1-PHA; + if (identificationParam.getIdentificationMethod() == 1){ + RiskAssessPlanIdentificationPha pha = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationPha.class); + pha.setAssessPlanId(identificationParam.getId()); + phaInsertDTO = phaService.insertPha(currentUserId, pha); + if (ObjectUtils.isEmpty(phaInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(phaInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setPhaId(phaInsertDTO.getId()); + //辨识方法 2-JHA; + }else if (identificationParam.getIdentificationMethod() == 2){ + RiskAssessPlanIdentificationJha jha = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationJha.class); + jha.setAssessPlanId(identificationParam.getId()); + jhaInsertDTO = jhaService.insertJha(currentUserId, jha); + if (ObjectUtils.isEmpty(jhaInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(jhaInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setJhaId(jhaInsertDTO.getId()); + //辨识方法 3-SCL; + }else if (identificationParam.getIdentificationMethod() == 3){ + RiskAssessPlanIdentificationScl scl = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationScl.class); + scl.setAssessPlanId(identificationParam.getId()); + sclInsertDTO = sclService.insertScl(currentUserId, scl); + if (ObjectUtils.isEmpty(sclInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(sclInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setSclId(sclInsertDTO.getId()); + //辨识方法 4-HAZOP; + }else if (identificationParam.getIdentificationMethod() == 4){ + RiskAssessPlanIdentificationHazop hazop = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationHazop.class); + hazop.setAssessPlanId(identificationParam.getId()); + hazopInsertDTO = hazopService.insertHazop(currentUserId, hazop); + if (ObjectUtils.isEmpty(hazopInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(hazopInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setHazopId(hazopInsertDTO.getId()); + //5-类比法 nalogy; + }else if (identificationParam.getIdentificationMethod() == 5){ + RiskAssessPlanIdentificationAnalogy analogy = BeanCopyUtils.copyBean(identificationParam, RiskAssessPlanIdentificationAnalogy.class); + analogy.setAssessPlanId(identificationParam.getId()); + analogyInsertDTO = analogyService.insertAnalogy(currentUserId, analogy); + if (ObjectUtils.isEmpty(analogyInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(analogyInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setAnalogyId(analogyInsertDTO.getId()); + }else { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请选择正确的辨识方法"); + } + + //处理评估计划表 + AssessPlanIdentificationDTO identificationResult = assessPlanService.identification(currentUserId, identificationParam); + + if (ObjectUtils.isEmpty(identificationResult) && tag == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "新增辨识失败"); + } + return factorQueryDTO; + } + + /** + * 风险评估计划 - 辨识修改 + */ + @Transactional + @Override + public FactorQueryDTO updateIdentification(Long currentUserId, RiskAssessPlanIdentificationUpdateReqBO updateReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + RiskAssessPlanIdentificationAppUpdateBO updateParam = BeanCopyUtils.copyBean(updateReqBO, RiskAssessPlanIdentificationAppUpdateBO.class); + int tag = 1; + FactorQueryDTO factorQueryDTO = new FactorQueryDTO(); + //分发参数到不同的服务进行处理 + //辨识方法 1-PHA; + if (updateParam.getIdentificationMethod() == 1){ + RiskAssessPlanIdentificationPha pha = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationPha.class); + pha.setAssessPlanId(updateParam.getId()); + pha.setId(updateParam.getPhaId()); + PhaInsertDTO phaInsertDTO = phaService.updatePha(currentUserId, pha); + if (ObjectUtils.isEmpty(phaInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(phaInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setPhaId(phaInsertDTO.getId()); + //辨识方法 2-JHA; + }else if (updateParam.getIdentificationMethod() == 2){ + RiskAssessPlanIdentificationJha jha = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationJha.class); + jha.setAssessPlanId(updateParam.getId()); + jha.setId(updateParam.getJhaId()); + JhaInsertDTO jhaInsertDTO = jhaService.updateJha(currentUserId, jha); + if (ObjectUtils.isEmpty(jhaInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(jhaInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setJhaId(jhaInsertDTO.getId()); + //辨识方法 3-SCL; + }else if (updateParam.getIdentificationMethod() == 3){ + RiskAssessPlanIdentificationScl scl = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationScl.class); + scl.setAssessPlanId(updateParam.getId()); + scl.setId(updateParam.getSclId()); + SclInsertDTO sclInsertDTO = sclService.updateScl(currentUserId, scl); + if (ObjectUtils.isEmpty(sclInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(sclInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setSclId(sclInsertDTO.getId()); + //辨识方法 4-HAZOP; + }else if (updateParam.getIdentificationMethod() == 4){ + RiskAssessPlanIdentificationHazop hazop = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationHazop.class); + hazop.setAssessPlanId(updateParam.getId()); + hazop.setId(updateParam.getHazopId()); + HazopInsertDTO hazopInsertDTO = hazopService.updateHazop(currentUserId, hazop); + if (ObjectUtils.isEmpty(hazopInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(hazopInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setHazopId(hazopInsertDTO.getId()); + //5-类比法 nalogy; + }else if (updateParam.getIdentificationMethod() == 5){ + RiskAssessPlanIdentificationAnalogy analogy = BeanCopyUtils.copyBean(updateParam, RiskAssessPlanIdentificationAnalogy.class); + analogy.setAssessPlanId(updateParam.getId()); + analogy.setId(updateParam.getAnalogyId()); + AnalogyInsertDTO analogyInsertDTO = analogyService.updateAnalogy(currentUserId, analogy); + if (ObjectUtils.isEmpty(analogyInsertDTO)){ + tag = 0; + } + factorQueryDTO = BeanCopyUtils.copyBean(analogyInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setAnalogyId(analogyInsertDTO.getId()); + }else { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请选择正确的辨识方法"); + } + + RiskAssessPlanAppIdentificationBO riskAssessPlanAppIdentificationBO = BeanCopyUtils.copyBean(updateReqBO, RiskAssessPlanAppIdentificationBO.class); + //处理评估计划表 + AssessPlanIdentificationDTO identificationResult = assessPlanService.identification(currentUserId, riskAssessPlanAppIdentificationBO); + + if (ObjectUtils.isEmpty(identificationResult) && tag == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "修改辨识失败"); + } + return factorQueryDTO; + } + + /** + * 风险评估计划 - 辨识删除 + */ + @Override + public int deleteIdentification(Long currentUserId, RiskAssessPlanIdentificationDeleteReqBO deleteReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + AssessPlanUpdateDTO deleteResult = assessPlanService.deleteIdentification(currentUserId, deleteReqBO); + + if (ObjectUtils.isEmpty(deleteResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估计划 - 辨识结果提交 + */ + @Override + public int identificationSubmit(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + AssessPlanUpdateDTO identificationSubmitResult= assessPlanService.identificationSubmit(currentUserId, id); + + if (ObjectUtils.isEmpty(identificationSubmitResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估计划 - 评价 + */ + @Transactional + @Override + public FactorQueryDTO evaluate(Long currentUserId, RiskAssessPlanEvaluateInsertReqBO evaluateReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + RiskAssessPlanAppEvaluateBO evaluateParam = BeanCopyUtils.copyBean(evaluateReqBO, RiskAssessPlanAppEvaluateBO.class); + AssessPlanQueryDTO assessPlanById = assessPlanService.getAssessPlanById(evaluateParam.getId()); + int tag = 1; + FactorQueryDTO factorQueryDTO = new FactorQueryDTO(); + //分发参数到不同的服务进行处理 + // todo ,1、将参数与结果值传入,2计算比对前端传来的结果值是否正确,3相同存入,不同抛异常 + //辨识方法1 - LEC + if (assessPlanById.getEvaluateMethod() == 1){ + AssessLecInsertBO lecInsertBO = BeanCopyUtils.copyBean(evaluateReqBO, AssessLecInsertBO.class); + lecInsertBO.setAssessPlanId(evaluateParam.getId()); + lecInsertBO.setIdentificationId(evaluateReqBO.getIdentificationId()); + lecInsertBO.setIdentificationMethod(assessPlanById.getIdentificationMethod()); + LecInsertDTO lecInsertDTO = lecService.insertLec(currentUserId, lecInsertBO); + if (ObjectUtils.isEmpty(lecInsertDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "写入评价结果失败"); + } + factorQueryDTO = BeanCopyUtils.copyBean(lecInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setLecId(lecInsertDTO.getId()); + factorQueryDTO.setEvaluateMethod(assessPlanById.getEvaluateMethod()); + //辨识方法2 - LS + }else if (assessPlanById.getEvaluateMethod() == 2){ + AssessLSInsertBO lsInsertBO = BeanCopyUtils.copyBean(evaluateReqBO, AssessLSInsertBO.class); + lsInsertBO.setAssessPlanId(evaluateParam.getId()); + lsInsertBO.setIdentificationId(evaluateReqBO.getIdentificationId()); + lsInsertBO.setIdentificationMethod(assessPlanById.getIdentificationMethod()); + LsInsertDTO lsInsertDTO = lsService.insertLs(currentUserId, lsInsertBO); + if (ObjectUtils.isEmpty(lsInsertDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "写入评价结果失败"); + } + factorQueryDTO = BeanCopyUtils.copyBean(lsInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setLsId(lsInsertDTO.getId()); + factorQueryDTO.setEvaluateMethod(assessPlanById.getEvaluateMethod()); + //辨识方法3 - MES + }else if (assessPlanById.getEvaluateMethod() == 3){ + AssessMesInsertBO mesInsertBO = BeanCopyUtils.copyBean(evaluateReqBO, AssessMesInsertBO.class); + mesInsertBO.setAssessPlanId(evaluateParam.getId()); + mesInsertBO.setIdentificationId(evaluateReqBO.getIdentificationId()); + mesInsertBO.setIdentificationMethod(assessPlanById.getIdentificationMethod()); + MesInsertDTO mesInsertDTO = mesService.InsertMes(currentUserId, mesInsertBO); + if (ObjectUtils.isEmpty(mesInsertDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "写入评价结果失败"); + } + factorQueryDTO = BeanCopyUtils.copyBean(mesInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setMesId(mesInsertDTO.getId()); + factorQueryDTO.setEvaluateMethod(assessPlanById.getEvaluateMethod()); + //辨识方法4 - RS + }else if (assessPlanById.getEvaluateMethod() == 4){ + AssessRsInsertBO rsInsertBO = BeanCopyUtils.copyBean(evaluateReqBO, AssessRsInsertBO.class); + rsInsertBO.setAssessPlanId(evaluateParam.getId()); + rsInsertBO.setIdentificationId(evaluateReqBO.getIdentificationId()); + rsInsertBO.setIdentificationMethod(assessPlanById.getIdentificationMethod()); + RsInsertDTO rsInsertDTO = rsService.InsertRs(currentUserId, rsInsertBO); + if (ObjectUtils.isEmpty(rsInsertDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "写入评价结果失败"); + } + factorQueryDTO = BeanCopyUtils.copyBean(rsInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setRsId(rsInsertDTO.getId()); + factorQueryDTO.setEvaluateMethod(assessPlanById.getEvaluateMethod()); + }else { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请选择正确的评价方法"); + } + + //处理评估计划表 + AssessPlanEvaluateDTO evaluateResult = assessPlanService.evaluate(currentUserId, evaluateParam); + if (ObjectUtils.isEmpty(evaluateResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "写入失败"); + } + return factorQueryDTO; + } + + /** + * 风险评估计划 - 评价修改 + */ + @Transactional + @Override + public FactorQueryDTO updateEvaluate(Long currentUserId, RiskAssessPlanEvaluateUpdateReqBO updateReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + RiskAssessPlanEvaluateUpdateReqBO updateParam = BeanCopyUtils.copyBean(updateReqBO, RiskAssessPlanEvaluateUpdateReqBO.class); + AssessPlanQueryDTO assessPlanById = assessPlanService.getAssessPlanById(updateReqBO.getId()); + int tag = 1; + FactorQueryDTO factorQueryDTO = new FactorQueryDTO(); + //分发参数到不同的服务进行处理 + // 1、将参数与结果值传入,2计算比对前端传来的结果值是否正确,3相同存入,不同抛异常 + //辨识方法1 - LEC + if (assessPlanById.getEvaluateMethod() == 1){ + AssessLecInsertBO lecInsertBO = BeanCopyUtils.copyBean(updateParam, AssessLecInsertBO.class); + lecInsertBO.setAssessPlanId(updateParam.getId()); + lecInsertBO.setId(updateParam.getLecId()); + lecInsertBO.setIdentificationMethod(assessPlanById.getIdentificationMethod()); + LecInsertDTO lecInsertDTO = lecService.updateLec(currentUserId, lecInsertBO); + if (ObjectUtils.isEmpty(lecInsertDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "修改评价结果失败"); + } + factorQueryDTO = BeanCopyUtils.copyBean(lecInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setLecId(lecInsertDTO.getId()); + factorQueryDTO.setEvaluateMethod(assessPlanById.getEvaluateMethod()); + //辨识方法2 - LS + }else if (assessPlanById.getEvaluateMethod() == 2){ + AssessLSInsertBO lsInsertBO = BeanCopyUtils.copyBean(updateParam, AssessLSInsertBO.class); + lsInsertBO.setAssessPlanId(updateParam.getId()); + lsInsertBO.setId(updateParam.getLsId()); + lsInsertBO.setIdentificationMethod(assessPlanById.getIdentificationMethod()); + LecInsertDTO lsInsertDTO = lsService.updateLs(currentUserId, lsInsertBO); + if (ObjectUtils.isEmpty(lsInsertDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "修改评价结果失败"); + } + factorQueryDTO = BeanCopyUtils.copyBean(lsInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setLsId(lsInsertDTO.getId()); + factorQueryDTO.setEvaluateMethod(assessPlanById.getEvaluateMethod()); + //辨识方法3 - MES + }else if (assessPlanById.getEvaluateMethod() == 3){ + AssessMesInsertBO mesInsertBO = BeanCopyUtils.copyBean(updateParam, AssessMesInsertBO.class); + mesInsertBO.setAssessPlanId(updateParam.getId()); + mesInsertBO.setId(updateParam.getMesId()); + mesInsertBO.setIdentificationMethod(assessPlanById.getIdentificationMethod()); + MesInsertDTO mesInsertDTO = mesService.updateMes(currentUserId, mesInsertBO); + if (ObjectUtils.isEmpty(mesInsertDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "写入评价结果失败"); + } + factorQueryDTO = BeanCopyUtils.copyBean(mesInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setMesId(mesInsertDTO.getId()); + factorQueryDTO.setEvaluateMethod(assessPlanById.getEvaluateMethod()); + //辨识方法4 - RS + }else if (assessPlanById.getEvaluateMethod() == 4){ + AssessRsInsertBO rsInsertBO = BeanCopyUtils.copyBean(updateParam, AssessRsInsertBO.class); + rsInsertBO.setAssessPlanId(updateParam.getId()); + rsInsertBO.setId(updateParam.getRsId()); + rsInsertBO.setIdentificationMethod(assessPlanById.getIdentificationMethod()); + RsInsertDTO rsInsertDTO = rsService.updateRs(currentUserId, rsInsertBO); + if (ObjectUtils.isEmpty(rsInsertDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "写入评价结果失败"); + } + factorQueryDTO = BeanCopyUtils.copyBean(rsInsertDTO, FactorQueryDTO.class); + factorQueryDTO.setRsId(rsInsertDTO.getId()); + factorQueryDTO.setEvaluateMethod(assessPlanById.getEvaluateMethod()); + } + + RiskAssessPlanAppEvaluateBO evaluateParam = BeanCopyUtils.copyBean(updateReqBO, RiskAssessPlanAppEvaluateBO.class); + //处理评估计划表 + AssessPlanEvaluateDTO evaluateResult = assessPlanService.evaluateUpdate(currentUserId, evaluateParam); + + return factorQueryDTO; + } + + /** + * 风险评估计划 - 评价删除 + */ + @Override + public int deleteEvaluate(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + AssessPlanUpdateDTO deleteResult= assessPlanService.deleteEvaluate(currentUserId, deleteReqBO); + + if (ObjectUtils.isEmpty(deleteResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估计划 - 评价结果提交 + */ + @Transactional + @Override + public int evaluateSubmit(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + //提交评价结果 + AssessPlanUpdateDTO evaluateSubmitResult= assessPlanService.evaluateSubmit(currentUserId, id); + + if (ObjectUtils.isEmpty(evaluateSubmitResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险辨识与评价 - 查询 + */ + @Override + public SearchResult selectAssessPage(Long currentUserId, RiskAssessQueryReqBO queryReqBO) { + + SearchResult searchResult = new SearchResult<>(); + + RiskAssessAppQueryBO queryBO = BeanCopyUtils.copyBean(queryReqBO, RiskAssessAppQueryBO.class); + + SearchResult<RiskAssessAppQueryDTO> queryResult = assessPlanService.selectAssessPage(currentUserId, queryBO); + + searchResult.setPageIndex(queryResult.getPageIndex()); + searchResult.setPageSize(queryResult.getPageSize()); + searchResult.setCount(queryResult.getCount()); + searchResult.setTotal(queryResult.getTotal()); + searchResult.setData(queryResult.getData()); + + return searchResult; + } + + /** + * 实验风险单元 - 插入 + */ + @Transactional + @Override + public int insertRiskUnit(Long currentUserId, RiskUnitInsertReqBO riskUnitInsertReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (roleTag != 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加"); + } + if (ObjectUtils.isEmpty(riskUnitInsertReqBO.getExperimentId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不能为空"); + } + ExperimentInfoDTO experimentById = experimentInfoService.getExperimentById(riskUnitInsertReqBO.getExperimentId()); + + if (ObjectUtils.isEmpty(experimentById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不存在或实验已被删除"); + } + if (ObjectUtils.isEmpty(riskUnitInsertReqBO.getLiabilityUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任人不能为空"); + } + + PersonQueryDTO basicExperimentPersonById = basicExperimentPersonService.getBasicExperimentPersonById(riskUnitInsertReqBO.getLiabilityUserId()); + + if (ObjectUtils.isEmpty(basicExperimentPersonById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "责任人不存在,或已被删除"); + } + RiskUnitAppInsertBO insertParam = BeanCopyUtils.copyBean(riskUnitInsertReqBO, RiskUnitAppInsertBO.class); + + RiskUnitInsertDTO riskUnitInsertDTO = riskUnitService.insertRiskUnit(currentUserId, insertParam); + + if (ObjectUtils.isEmpty(riskUnitInsertDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 固有风险单元 - 插入 + */ + @Override + public int insertInherentRiskUnit(Long currentUserId, InherentRiskUnitInsertReqBO insertReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (roleTag != 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加"); + } + if (ObjectUtils.isEmpty(insertReqBO.getExperimentId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不能为空,或实验已被删除"); + } + ExperimentInfoDTO experimentById = experimentInfoService.getExperimentById(insertReqBO.getExperimentId()); + + if (ObjectUtils.isEmpty(experimentById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不存在或实验已被删除"); + } + RiskUnitBasicQueryDTO basicRiskUnitById = basicRiskUnitService.getBasicRiskUnitById(insertReqBO.getBasicRiskUnitId()); + + //封装插入需要的数据 + InherentRiskUnitAppInsertBO insertParam = BeanCopyUtils.copyBean(basicRiskUnitById, InherentRiskUnitAppInsertBO.class); + insertParam.setExperimentId(insertReqBO.getExperimentId()); + insertParam.setBasicRiskUnitId(basicRiskUnitById.getId()); + + RiskUnitInsertDTO riskUnitInsertDTO = riskUnitService.insertInherentRiskUnit(currentUserId, insertParam); + + if (ObjectUtils.isEmpty(riskUnitInsertDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险单元 - 分页查询 + */ + @Override + public SearchResult<RiskUnitAppQueryDTO> selectRiskUnitPage(Long currentUserId, RiskUnitQueryReqBO queryReqBO) { + + SearchResult searchResult = new SearchResult<>(); + + RiskUnitAppQueryBO queryParam = BeanCopyUtils.copyBean(queryReqBO, RiskUnitAppQueryBO.class); + + SearchResult<RiskUnitQueryDTO> queryResult = riskUnitService.selectRiskUnitPage(currentUserId, queryParam); + + searchResult.setPageIndex(queryResult.getPageIndex()); + searchResult.setPageSize(queryResult.getPageSize()); + searchResult.setTotal(queryResult.getTotal()); + searchResult.setData(BeanCopyUtils.copyExperimentRiskUnitAppQueryList(queryResult.getData(), RiskUnitBasicQueryDTO.class)); + + return searchResult; + } + + /** + * 风险单元 - 修改 + */ + @Override + public int updateRiskUnit(Long currentUserId, RiskUnitUpdateReqBO updateReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (roleTag != 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限修改"); + } + if (ObjectUtils.isEmpty(updateReqBO.getExperimentId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不能为空,或实验已被删除"); + } + ExperimentInfoDTO experimentById = experimentInfoService.getExperimentById(updateReqBO.getExperimentId()); + + if (ObjectUtils.isEmpty(experimentById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选实验不存在或实验已被删除"); + } + if (ObjectUtils.isEmpty(updateReqBO.getLiabilityUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任人不能为空"); + } + + PersonQueryDTO basicExperimentPersonById = basicExperimentPersonService.getBasicExperimentPersonById(updateReqBO.getLiabilityUserId()); + if (ObjectUtils.isEmpty(basicExperimentPersonById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "责任人不存在,或已被删除"); + } + RiskUnitAppUpdateBO updateParam = BeanCopyUtils.copyBean(updateReqBO, RiskUnitAppUpdateBO.class); + + RiskUnitInsertDTO riskUnitUpdateDTO = riskUnitService.updateRiskUnit(currentUserId, updateParam); + + if (ObjectUtils.isEmpty(riskUnitUpdateDTO)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险单元 - 删除 + */ + @Override + public int deleteRiskUnit(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + RiskUnitQueryDTO riskUnitById = riskUnitService.getRiskUnitById(id); + if (ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前要删除的实验不存在,或已被删除"); + } + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (roleTag != 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户不是管理人员,无权限添加"); + } + RiskUnitDeleteDTO deleteResult = riskUnitService.deleteRiskUnit(currentUserId, id); + + if (ObjectUtils.isEmpty(deleteResult)){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 基础风险单元管理 - 列表查询 + */ + @Override + public SearchResult<RiskUnitListQueryRespDTO> listRiskUnit(Long currentUserId) { + + SearchResult result = new SearchResult(); + + List<RiskUnitListAppQueryDTO> riskUnitListAppQueryDTOS = riskUnitService.listRiskUnit(currentUserId); + + result.setData(BeanCopyUtils.copyBeanList(riskUnitListAppQueryDTOS, RiskUnitListQueryRespDTO.class)); + result.setCount(riskUnitListAppQueryDTOS.size()); + + return result; + } + + /** + * 风险单元 - 列表查询 + */ + @Override + public SearchResult<RiskUnitListQueryRespDTO> listRiskUnitByExperiment(Long currentUserId, RiskUnitListReqBO reqBO) { + + SearchResult result = new SearchResult(); + + List<RiskUnitListAppQueryDTO> riskUnitListAppQueryDTOS = riskUnitService.listRiskUnitByExperiment(currentUserId, reqBO); + + result.setData(BeanCopyUtils.copyBeanList(riskUnitListAppQueryDTOS, RiskUnitListQueryRespDTO.class)); + result.setCount(riskUnitListAppQueryDTOS.size()); + + return result; + } + + /** + * 评估计划 - 列表查询 + */ + @Override + public SearchResult<RiskAssessPlanListRespDTO> listAssessPlan() { + SearchResult result = new SearchResult(); + Byte status = StatusEnum.PLAN_SELL.getCode().byteValue(); + List<RiskAssessPlanListAppDTO> riskAssessPlanListAppDTO = assessPlanService.listAssessPlan(status); + + result.setData(BeanCopyUtils.copyBeanList(riskAssessPlanListAppDTO, RiskAssessPlanListRespDTO.class)); + result.setCount(riskAssessPlanListAppDTO.size()); + + return result; + } + + /** + * 评估计划 - 风险值计算 + */ + @Override + public BigDecimal riskValue(RiskValueReqBO valueReqBO) { + + if (valueReqBO.getValue3() == null){ + BigDecimal value = valueReqBO.getValue1().multiply(valueReqBO.getValue2()); + return value; + } + + BigDecimal value = valueReqBO.getValue1().multiply(valueReqBO.getValue2()).multiply(valueReqBO.getValue3()); + + return value; + } + + /** + * 风险评估计划 - 辨识专家拒绝 + */ + @Override + public AssessPlanUpdateDTO identificationRefuse(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + AssessPlanUpdateDTO assessPlanUpdateDTO = assessPlanService.identificationRefuse(currentUserId, id); + return assessPlanUpdateDTO; + } + + /** + * 风险评估计划 - 评价专家拒绝 + */ + @Override + public AssessPlanUpdateDTO evaluateRefuse(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + AssessPlanUpdateDTO assessPlanUpdateDTO = assessPlanService.evaluateRefuse(currentUserId, id); + return assessPlanUpdateDTO; + } + + /** + * 风险评估计划 - 修改辨识方法 + */ + @Override + public AssessPlanUpdateDTO identificationUpdateMethod(Long currentUserId, MethodUpdateReqDTO updateReqDTO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + AssessPlanUpdateDTO assessPlanUpdateDTO = assessPlanService.identificationUpdateMethod(currentUserId, updateReqDTO); + + return assessPlanUpdateDTO; + } + + /** + * 风险评估计划 - 评价方法修改 + */ + @Override + public AssessPlanUpdateDTO evaluateUpdateMethod(Long currentUserId, MethodUpdateReqDTO updateReqDTO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + AssessPlanUpdateDTO assessPlanUpdateDTO = assessPlanService.evaluateUpdateMethod(currentUserId, updateReqDTO); + + return assessPlanUpdateDTO; + } + /** + * 风险评估计划 - 重新指定专家 + */ + @Override + public AssessPlanUpdateDTO appoint(Long currentUserId, AppointUserReBO appointUserReBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + AssessPlanUpdateDTO assessPlanUpdateDTO = assessPlanService.appoint(currentUserId, appointUserReBO); + return assessPlanUpdateDTO; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/convert/MenuItemAppConvert.java b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/convert/MenuItemAppConvert.java new file mode 100644 index 0000000..cf64697 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/convert/MenuItemAppConvert.java @@ -0,0 +1,39 @@ +package com.gkhy.labRiskManage.application.sysAdmin.convert; + +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.resp.MenuItemAppDTO; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class MenuItemAppConvert { + + public List<MenuItemAppDTO> toAppDtoList(List<MenuItemDomainDTO> domainDTOList){ + if(domainDTOList == null || domainDTOList.isEmpty()) + return null; + List<MenuItemAppDTO> appDTOList = new ArrayList<>(); + domainDTOList.forEach(domainDTO -> { + appDTOList.add(toAppDto(domainDTO)); + }); + return appDTOList; + } + + public MenuItemAppDTO toAppDto(MenuItemDomainDTO dto){ + if(dto == null) + return null; + MenuItemAppDTO appDTO = new MenuItemAppDTO(); + BeanUtils.copyProperties(dto,appDTO); + if(dto.getSubMenuItemList() != null && !dto.getSubMenuItemList().isEmpty()){ + List<MenuItemAppDTO> childs = new ArrayList<>(); + dto.getSubMenuItemList().forEach(c -> { + MenuItemAppDTO childAppDto = toAppDto(c); + childs.add(childAppDto); + }); + appDTO.setSubMenuItemList(childs); + } + return appDTO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/AddAndUpdateMenuItemAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/AddAndUpdateMenuItemAppDTO.java new file mode 100644 index 0000000..2674211 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/AddAndUpdateMenuItemAppDTO.java @@ -0,0 +1,185 @@ +package com.gkhy.labRiskManage.application.sysAdmin.model.dto.req; + +import java.util.List; + +public class AddAndUpdateMenuItemAppDTO { + + private Long menuItemId; + + //父级菜单 + private Long parentId; + + //菜单项显示标题 + private String title; + + //菜单项描述信息 + private String descInfo; + + //菜单项名称 + private String name; + + //路径 + private String path; + + //重定向路径 + private String redirect; + + private String link; + + // + private boolean visiable; + + // + private String icon; + + // + private Byte priority; + + private String component; + + private Boolean aliveable; + + private Boolean affixable; + + private Boolean iframeable; + + private Boolean publicable; + + private List<Long> roles; + + public Long getMenuItemId() { + return menuItemId; + } + + public void setMenuItemId(Long menuItemId) { + this.menuItemId = menuItemId; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public boolean isVisiable() { + return visiable; + } + + public void setVisiable(boolean visiable) { + this.visiable = visiable; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getAliveable() { + return aliveable; + } + + public void setAliveable(Boolean aliveable) { + this.aliveable = aliveable; + } + + public Boolean getAffixable() { + return affixable; + } + + public void setAffixable(Boolean affixable) { + this.affixable = affixable; + } + + public Boolean getIframeable() { + return iframeable; + } + + public void setIframeable(Boolean iframeable) { + this.iframeable = iframeable; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } + + public List<Long> getRoles() { + return roles; + } + + public void setRoles(List<Long> roles) { + this.roles = roles; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/MenuItemBindRoleAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/MenuItemBindRoleAppDTO.java new file mode 100644 index 0000000..3ffa664 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/MenuItemBindRoleAppDTO.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.application.sysAdmin.model.dto.req; + +import java.util.List; + +public class MenuItemBindRoleAppDTO { + + private Long menuItemId; + + private List<Long> bindRoleIdList; + + private List<Long> unbindRoleIdList; + + public Long getMenuItemId() { + return menuItemId; + } + + public void setMenuItemId(Long menuItemId) { + this.menuItemId = menuItemId; + } + + public List<Long> getBindRoleIdList() { + return bindRoleIdList; + } + + public void setBindRoleIdList(List<Long> bindRoleIdList) { + this.bindRoleIdList = bindRoleIdList; + } + + public List<Long> getUnbindRoleIdList() { + return unbindRoleIdList; + } + + public void setUnbindRoleIdList(List<Long> unbindRoleIdList) { + this.unbindRoleIdList = unbindRoleIdList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/ModifyMenuItemAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/ModifyMenuItemAppDTO.java new file mode 100644 index 0000000..355c89c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/ModifyMenuItemAppDTO.java @@ -0,0 +1,185 @@ +package com.gkhy.labRiskManage.application.sysAdmin.model.dto.req; + +public class ModifyMenuItemAppDTO { + + private Long menuItemId; + + //父级菜单 + private Long parentId; + + //菜单项显示标题 + private String title; + + //菜单项描述信息 + private String descInfo; + + //菜单项名称 + private String name; + + //路径 + private String path; + + //重定向路径 + private String redirect; + + // + private Boolean linkable; + + private String link; + + // + private Boolean visiable; + + // + private String icon; + + // + private Byte priority; + + private String component; + + private Boolean aliveable; + + private Boolean affixable; + + private Boolean iframeable; + + private Boolean publicable; + + public Long getMenuItemId() { + return menuItemId; + } + + public void setMenuItemId(Long menuItemId) { + this.menuItemId = menuItemId; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public Boolean getLinkable() { + return linkable; + } + + public void setLinkable(Boolean linkable) { + this.linkable = linkable; + } + + public Boolean getVisiable() { + return visiable; + } + + public void setVisiable(Boolean visiable) { + this.visiable = visiable; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getAliveable() { + return aliveable; + } + + public void setAliveable(Boolean aliveable) { + this.aliveable = aliveable; + } + + public Boolean getAffixable() { + return affixable; + } + + public void setAffixable(Boolean affixable) { + this.affixable = affixable; + } + + public Boolean getIframeable() { + return iframeable; + } + + public void setIframeable(Boolean iframeable) { + this.iframeable = iframeable; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/NewMenuItemAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/NewMenuItemAppDTO.java new file mode 100644 index 0000000..e6fcf62 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/NewMenuItemAppDTO.java @@ -0,0 +1,175 @@ +package com.gkhy.labRiskManage.application.sysAdmin.model.dto.req; + +import java.util.List; + +public class NewMenuItemAppDTO { + + //父级菜单 + private Long parentId; + + //菜单项显示标题 + private String title; + + //菜单项描述信息 + private String descInfo; + + //菜单项名称 + private String name; + + //路径 + private String path; + + //重定向路径 + private String redirect; + + private String link; + + // + private boolean visiable; + + // + private String icon; + + // + private Byte priority; + + private String component; + + private Boolean aliveable; + + private Boolean affixable; + + private Boolean iframeable; + + private Boolean publicable; + + private List<Long> roles; + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public boolean isVisiable() { + return visiable; + } + + public void setVisiable(boolean visiable) { + this.visiable = visiable; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getAliveable() { + return aliveable; + } + + public void setAliveable(Boolean aliveable) { + this.aliveable = aliveable; + } + + public Boolean getAffixable() { + return affixable; + } + + public void setAffixable(Boolean affixable) { + this.affixable = affixable; + } + + public Boolean getIframeable() { + return iframeable; + } + + public void setIframeable(Boolean iframeable) { + this.iframeable = iframeable; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } + + public List<Long> getRoles() { + return roles; + } + + public void setRoles(List<Long> roles) { + this.roles = roles; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/RoleBindMenuAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/RoleBindMenuAppDTO.java new file mode 100644 index 0000000..c043292 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/req/RoleBindMenuAppDTO.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.application.sysAdmin.model.dto.req; + +import java.util.List; + +public class RoleBindMenuAppDTO { + + private Long roleId; + + private List<Long> bindMenuItemIdList; + + private List<Long> unbindMenuItemIdList; + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public List<Long> getBindMenuItemIdList() { + return bindMenuItemIdList; + } + + public void setBindMenuItemIdList(List<Long> bindMenuItemIdList) { + this.bindMenuItemIdList = bindMenuItemIdList; + } + + public List<Long> getUnbindMenuItemIdList() { + return unbindMenuItemIdList; + } + + public void setUnbindMenuItemIdList(List<Long> unbindMenuItemIdList) { + this.unbindMenuItemIdList = unbindMenuItemIdList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/resp/MenuItemAppDTO.java b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/resp/MenuItemAppDTO.java new file mode 100644 index 0000000..0cd9291 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/model/dto/resp/MenuItemAppDTO.java @@ -0,0 +1,217 @@ +package com.gkhy.labRiskManage.application.sysAdmin.model.dto.resp; + +import java.util.List; + +public class MenuItemAppDTO { + + private Long id; + + //菜单级别 + private Integer level; + + //父级菜单 + private Long parentId; + + //菜单项显示标题 + private String title; + + private Byte priority; + + //菜单项描述信息 + private String descInfo; + + + private String component; + + //菜单项名称 + private String name; + + //路径 + private String path; + + //重定向路径 + private String redirect; + + // + private Boolean linkable; + + // + private Boolean visiable; + + private Boolean aliveable; + + private Boolean affixable; + + private Boolean iframeable; + + private Boolean publicable; + + // + private String icon; + + private String link; + + private List<Long> roles; + + private List<MenuItemAppDTO> subMenuItemList; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getLevel() { + return level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public Boolean getLinkable() { + return linkable; + } + + public void setLinkable(Boolean linkable) { + this.linkable = linkable; + } + + public Boolean getVisiable() { + return visiable; + } + + public void setVisiable(Boolean visiable) { + this.visiable = visiable; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getAliveable() { + return aliveable; + } + + public void setAliveable(Boolean aliveable) { + this.aliveable = aliveable; + } + + public Boolean getAffixable() { + return affixable; + } + + public void setAffixable(Boolean affixable) { + this.affixable = affixable; + } + + public Boolean getIframeable() { + return iframeable; + } + + public void setIframeable(Boolean iframeable) { + this.iframeable = iframeable; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public List<Long> getRoles() { + return roles; + } + + public void setRoles(List<Long> roles) { + this.roles = roles; + } + + public List<MenuItemAppDTO> getSubMenuItemList() { + return subMenuItemList; + } + + public void setSubMenuItemList(List<MenuItemAppDTO> subMenuItemList) { + this.subMenuItemList = subMenuItemList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/service/MenuAppService.java b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/service/MenuAppService.java new file mode 100644 index 0000000..6f41c53 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/service/MenuAppService.java @@ -0,0 +1,39 @@ +package com.gkhy.labRiskManage.application.sysAdmin.service; + +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.req.*; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; + +public interface MenuAppService { + + /** + * 新建菜单项 + * @param dto + * @return + */ + Result addMenuItem(NewMenuItemAppDTO dto); + + /** + * 修改菜单项 + * @param dto + * @return + */ + Result modifyMenuItem(AddAndUpdateMenuItemAppDTO dto); + + /** + * 删除菜单项 + * @param menuItemId + * @return + */ + Result deleteMenuItem(Long menuItemId); + + /** + * 获取全部可用菜单项 + * @return + */ + SearchResult getAllMenuItems(); + + Result roleBindMenu(RoleBindMenuAppDTO bindDTO); + + Result menuBindRole(MenuItemBindRoleAppDTO bindDTO); +} diff --git a/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/service/impl/MenuAppServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/service/impl/MenuAppServiceImpl.java new file mode 100644 index 0000000..b0f446f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/application/sysAdmin/service/impl/MenuAppServiceImpl.java @@ -0,0 +1,298 @@ +package com.gkhy.labRiskManage.application.sysAdmin.service.impl; + +import com.gkhy.labRiskManage.application.sysAdmin.convert.MenuItemAppConvert; +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.req.*; +import com.gkhy.labRiskManage.application.sysAdmin.model.dto.resp.MenuItemAppDTO; +import com.gkhy.labRiskManage.application.sysAdmin.service.MenuAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.account.model.bo.MenuItemBindRoleBO; +import com.gkhy.labRiskManage.domain.account.model.bo.RoleBindMenuItemBO; +import com.gkhy.labRiskManage.domain.account.service.RoleDomainService; +import com.gkhy.labRiskManage.domain.account.service.RoleMenuDomainService; +import com.gkhy.labRiskManage.domain.sysAdmin.model.bo.CreateNewMenuItemBO; +import com.gkhy.labRiskManage.domain.sysAdmin.model.bo.ModifyMenuItemBO; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; +import com.gkhy.labRiskManage.domain.sysAdmin.service.MenuDomainService; +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.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@Service +public class MenuAppServiceImpl implements MenuAppService { + + @Autowired + private MenuDomainService menuDomainService; + + @Autowired + private RoleMenuDomainService roleMenuDomainService; + + @Autowired + private MenuItemAppConvert menuItemAppConvert; + + @Autowired + private RoleDomainService roleDomainService; + + @Override + @Transactional + public Result addMenuItem(NewMenuItemAppDTO dto) { + Result result = new Result<>(); + if(dto == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + if(dto.getName() == null || dto.getName().isEmpty()) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"菜单参数不能为空"); + CreateNewMenuItemBO createBO = new CreateNewMenuItemBO(); + if(dto.getParentId() != null){ + MenuItemDomainDTO parant = menuDomainService.getMenuItemById(dto.getParentId()); + if(parant == null) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), "上一级菜单不存在"); + createBO.setParentId(dto.getParentId()); + } + createBO.setName(dto.getName()); + createBO.setTitle(dto.getTitle()); + createBO.setPath(dto.getPath()); + createBO.setDescInfo(dto.getDescInfo()); + createBO.setVisiable(dto.isVisiable()); + createBO.setRedirect(dto.getRedirect()); + createBO.setIcon(dto.getIcon()); + createBO.setLink(dto.getLink()); + if(createBO.getLink() == null) + createBO.setLink(""); + // + createBO.setPriority(dto.getPriority()); + createBO.setComponent(dto.getComponent()); + createBO.setAliveable(dto.getAliveable()); + createBO.setAffixable(dto.getAffixable()); + createBO.setIframeable(dto.getIframeable()); + createBO.setPublicable(dto.getPublicable()); + createBO.setRoles(dto.getRoles()); + MenuItemDomainDTO createResultDTO = menuDomainService.createNewMenuItem(createBO); + if(createResultDTO == null) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR.getCode(),"创建菜单项出错"); + result.setSuccess(); + return result; + } + + @Override + @Transactional + public Result modifyMenuItem(AddAndUpdateMenuItemAppDTO dto) { + Result result = new Result<>(); + if(dto == null || dto.getMenuItemId() == null || dto.getMenuItemId() < 1) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + MenuItemDomainDTO orign = menuDomainService.getMenuItemById(dto.getMenuItemId()); + if(orign == null) + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(),"菜单项不存在"); + List<Long> orignRoles = roleMenuDomainService.getBindRolesByMenuItemId(dto.getMenuItemId()); + //检查是否发生变更 + if(!checkMenuItemHasModified(orign,dto) && !checkBindRolesHashModified(orignRoles,dto.getRoles())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(),"菜单项配置未发生变化"); + } + //包装修改业务对象 + ModifyMenuItemBO modifyBO = new ModifyMenuItemBO(); + BeanUtils.copyProperties(dto,modifyBO); + modifyBO.setRoles(dto.getRoles()); + if(menuDomainService.modifyMenuItem(modifyBO) == false){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(),"变更菜单项配置出错"); + } + result.setSuccess(); + return result; + } + + @Override + @Transactional + public Result deleteMenuItem(Long menuItemId) { + if(menuItemId == null || menuItemId < 1) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + Result result = new Result<>(); + if(menuDomainService.deleteMenuItem(menuItemId)) + result.setSuccess(); + else { + result.setCode(ResultCode.BUSINESS_ERROR.getCode()); + result.setMsg("删除菜单项出错"); + } + return result; + } + + @Override + public SearchResult getAllMenuItems() { + SearchResult result = new SearchResult<>(); + result.setSuccess(); + List<MenuItemDomainDTO> menuItemDomainDTOList = menuDomainService.getAllActiveMenuItems(); + if(menuItemDomainDTOList == null || menuItemDomainDTOList.isEmpty()) + result.setCount(0); + else { + //数据转换 + List<MenuItemAppDTO> appDTOList = convertToMenuItemAppDtos(menuItemDomainDTOList); + result.setData(appDTOList); + result.setCount(appDTOList.size()); + } + return result; + } + + private List<MenuItemAppDTO> convertToMenuItemAppDtos(List<MenuItemDomainDTO> orignList){ + if(orignList == null || orignList.isEmpty()) + return null; + List<MenuItemAppDTO> targetList = new ArrayList<>(); + orignList.forEach(o -> { + MenuItemAppDTO appDTO = menuItemAppConvert.toAppDto(o); + List<Long> bindRoles = roleMenuDomainService.getBindRolesByMenuItemId(o.getId()); + appDTO.setRoles(bindRoles); + if(o.getSubMenuItemList() != null && !o.getSubMenuItemList().isEmpty()){ + appDTO.setSubMenuItemList(convertToMenuItemAppDtos(o.getSubMenuItemList())); + } + targetList.add(appDTO); + }); + return targetList; + } + + @Override + @Transactional + public Result roleBindMenu(RoleBindMenuAppDTO bindDTO) { + Result result = new Result<>(); + if(bindDTO == null || bindDTO.getRoleId() == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + RoleBindMenuItemBO bindBO = new RoleBindMenuItemBO(); + BeanUtils.copyProperties(bindDTO,bindBO); + boolean bindResult = roleMenuDomainService.roleBindMenu(bindBO); + if(bindResult == true){ + result.setSuccess(); + }else { + result.setCode(ResultCode.BUSINESS_ERROR.getCode()); + result.setMsg("角色绑定菜单项出错"); + } + return result; + } + + @Override + public Result menuBindRole(MenuItemBindRoleAppDTO bindDTO) { + Result result = new Result<>(); + if(bindDTO == null || bindDTO.getMenuItemId() == null){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + } + MenuItemBindRoleBO bindBO = new MenuItemBindRoleBO(); + BeanUtils.copyProperties(bindDTO,bindBO); + boolean bindResult = roleMenuDomainService.menuBindRole(bindBO); + if(bindResult == true){ + result.setSuccess(); + }else { + result.setCode(ResultCode.BUSINESS_ERROR.getCode()); + result.setMsg("菜单项绑定角色出错"); + } + return result; + } + + /** + * 检查菜单项绑定的角色是否发生变化 + * @param orign + * @param now + * @return + */ + private boolean checkBindRolesHashModified(List<Long> orign,List<Long> now){ + if(orign == null && now == null) { + return false; + } + if(orign == null && now != null && !now.isEmpty()) { + return true; + } + if(orign == null && orign != null && now.size() == 0) { + return false; + } + if(now == null && orign != null && !orign.isEmpty()) { + return true; + } + if(now == null && orign != null && orign.size() == 0){ + return false; + } +// if((orign == null || orign.isEmpty()) && now != null && !now.isEmpty()) { +// return true; +// } +// if(orign != null && !orign.isEmpty() && (now == null || now.isEmpty())) { +// return true; +// } + if(orign != null && now != null && orign.size() != now.size()) { + return true; + } + Set<Long> set = new HashSet<>(); + orign.forEach(id -> { + set.add(id); + }); + for(int i=0;i< now.size();i++){ + if(!set.contains(now.get(i))){ + return true; + } + } + return false; + } + + /** + * 检查菜单项是否发生变更 + * @param orign + * @param dto + * @return + */ + private boolean checkMenuItemHasModified(MenuItemDomainDTO orign, AddAndUpdateMenuItemAppDTO dto){ + if(checkStringHasChanged(orign.getName(),dto.getName())) + return true; + if(checkStringHasChanged(orign.getTitle(),dto.getTitle())) + return true; + if(checkStringHasChanged(orign.getDescInfo(),dto.getDescInfo())) + return true; + if(checkStringHasChanged(orign.getIcon(),dto.getIcon())) + return true; + if(checkStringHasChanged(orign.getPath(),dto.getPath())) + return true; + if(checkStringHasChanged(orign.getRedirect(),dto.getRedirect())) + return true; + if(checkStringHasChanged(orign.getLink(),dto.getLink())) + return true; + if(orign.getParentId() == null && dto.getParentId() != null) + return true; + if(orign.getParentId() != null && dto.getParentId() == null) + return true; + if(orign.getParentId() != null && dto.getParentId() != null && !orign.getParentId().equals(dto.getParentId())) + return true; + if(orign.getVisiable() != dto.isVisiable()) + return true; + if(orign.getPriority() != dto.getPriority()) + return true; + if(checkStringHasChanged(orign.getComponent(), dto.getComponent())) + return true; + if(orign.getAliveable() != dto.getAliveable()) + return true; + if(orign.getAffixable() != dto.getAffixable()) + return true; + if(orign.getIframeable() != dto.getIframeable()) + return true; + if(orign.getPublicable() != dto.getPublicable()) + return true; + return false; + } + + /** + * 检查对象字符串是否发生变化 + * @param orign + * @param now + * @return + */ + private boolean checkStringHasChanged(String orign,String now){ + if(orign == null && now == null) + return false; + if(orign == null && !now.isEmpty()) + return true; + if(orign != null && now == null) + return true; + if(orign != null && orign.isEmpty() && now != null && now.isEmpty()) + return false; + if(orign.equals(now)) + return false; + return true; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/domain/Result.java b/src/main/java/com/gkhy/labRiskManage/commons/domain/Result.java new file mode 100644 index 0000000..4f37222 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/domain/Result.java @@ -0,0 +1,111 @@ +package com.gkhy.labRiskManage.commons.domain; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; + +import java.io.Serializable; + +public class Result<T> implements Serializable { + + private Integer code; + + private Integer count; + + private String msg; + + private T data; + + public static Result success(){ + Result resultVO = new Result(); + resultVO.setCode(ResultCode.OK.getCode()); + resultVO.setMsg(ResultCode.OK.getDesc()); + return resultVO; + } + + public void execSuccess(){ + this.code = ResultCode.OK.getCode(); + } + + public void setSuccess(){ + this.code = ResultCode.OK.getCode(); + this.msg = ResultCode.OK.getDesc(); + } + + public Result() { + this.code = ResultCode.NOT_OK.getCode(); + } + + + public Result(Integer code, String msg) { + this.code = code; + this.msg = msg; + } + + public Result(ResultCode resultCode,String msg){ + this.code = resultCode.getCode(); + if(msg != null && !msg.isEmpty()){ + this.msg = msg; + }else { + this.msg = resultCode.getDesc(); + } + } + + public Result(ResultCode code, T data) { + this.code = code.getCode(); + this.msg = code.getDesc(); + this.data = data; + } + + + public Result(ResultCode code) { + this.code = code.getCode(); + this.msg = code.getDesc(); + } + + public boolean isSuccess(){ + if(this.code == null) + return false; + if(this.code.equals(ResultCode.OK.getCode())){ + return true; + }else { + return false; + } + } + + + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public void setCode(ResultCode resultCode){ + this.code = resultCode.getCode(); + } + + 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/gkhy/labRiskManage/commons/domain/SearchResult.java b/src/main/java/com/gkhy/labRiskManage/commons/domain/SearchResult.java new file mode 100644 index 0000000..8d6be78 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/domain/SearchResult.java @@ -0,0 +1,86 @@ +package com.gkhy.labRiskManage.commons.domain; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; + +public class SearchResult<T> extends Result<T> { + + private boolean usePage; + + private Long total; + + private Integer pages; + + private Integer pageSize; + + private Integer pageIndex; + + + + public static SearchResult success(){ + SearchResult searchResultVO = new SearchResult(); + searchResultVO.setCode(ResultCode.OK.getCode()); + return searchResultVO; + } + + + public SearchResult() { + } + + public SearchResult(boolean usePage) { + if(usePage == false){ + this.setUsePage(false); + this.setPageSize(-1); + this.setPageIndex(-1); + }else { + this.setUsePage(true); + } + } + + public SearchResult(boolean usePage, Long total, Integer pages, Integer pageSize, Integer pageIndex) { + 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 Integer getPages() { + return pages; + } + + public void setPages(Integer pages) { + this.pages = pages; + } + + 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; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/enums/MethodEnum.java b/src/main/java/com/gkhy/labRiskManage/commons/enums/MethodEnum.java new file mode 100644 index 0000000..c7453ea --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/enums/MethodEnum.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.commons.enums; + +public enum MethodEnum { + + IDENTIFICATION_METHOD_PHA((byte) 1,"PHA"), + IDENTIFICATION_METHOD_JHA((byte) 2,"JHA"), + IDENTIFICATION_METHOD_SCL((byte) 3,"SCL"), + IDENTIFICATION_METHOD_HAZOP((byte) 4,"HAZOP"), + IDENTIFICATION_METHOD_ANALOGY((byte) 5,"类比法"), + + EVALUATE_METHOD_LEC((byte) 1,"LEC"), + EVALUATE_METHOD_LS((byte) 2,"LS"), + EVALUATE_METHOD_MES((byte) 3,"MES"), + EVALUATE_METHOD_RS((byte) 4,"RS"), + + RISK_EVALUATE_VALUE_1((byte) 10,"一级"), + RISK_EVALUATE_VALUE_2((byte) 20,"二级"), + RISK_EVALUATE_VALUE_3((byte) 30,"三级"), +// RISK_EVALUATE_VALUE_4((byte) 40,"四级"), + + RISK_LEVEL_1((byte) 1,"低-蓝"), + RISK_LEVEL_2((byte) 2,"一般-黄"), + RISK_LEVEL_3((byte) 3,"较大-橙"), + RISK_LEVEL_4((byte) 4,"重大-红"), + + ; + + + MethodEnum(Byte code, String desc) { + this.code = code; + this.desc = desc; + } + + private Byte code; + private String desc; + + public Byte getCode() { + return code; + } + + public void setCode(Byte code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/enums/ResultCode.java b/src/main/java/com/gkhy/labRiskManage/commons/enums/ResultCode.java new file mode 100644 index 0000000..ace45a7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/enums/ResultCode.java @@ -0,0 +1,88 @@ +package com.gkhy.labRiskManage.commons.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum ResultCode { + + //正常 + OK(100,"成功"), + + NOT_OK(200,"错误"), + + //参数错误 + PARAM_ERROR(300,"参数错误"), + PARAM_ERROR_NULL(301,"参数不能为空"), + PARAM_ERROR_ILLEGAL(301,"参数格式错误"), + PARAM_ERROR_OUT_OF_RANGE(302,"参数超出限制"), + + + + //业务错误 + BUSINESS_ERROR(400,"业务错误"), + BUSINESS_ERROR_ACCOUNT_NOT_EXIST(401,"用户不存在"), + BUSINESS_ERROR_ACCOUNT_STATU_ABNORMAL(402,"账号异常"), + BUSINESS_ERROR_ACCOUNT_OFFLINE(403,"用户未登录"), + BUSINESS_ERROR_PERMISSION_DENIALED(405,"操作未授权"), + BUSINESS_ERROR_OUT_OF_TIME(406,"业务超时"), + BUSINESS_ERROR_OBJECT_NOT_EXIST(407,"业务单元不存在"), + BUSINESS_ERROR_NOT_ALLOWED(408,"业务不允许"), + BUSINESS_ERROR_HTTP_METHOD_NOT_SUPPORT(409,"HTTP请求方法不支持"), + BUSINESS_ERROR_DATA_NOT_EXISIST(410,"数据不存在"), + + + + //系统错误 + SYSTEM_ERROR(500,"系统出错"), + SYSTEM_ERROR_API_FAIL(501,"接口错误"), + SYSTEM_ERROR_API_OUT_OF_TIME(502,"接口超时"), + SYSTEM_ERROR_DATABASE_FAIL(503,"数据库错误"), + SYSTEM_ERROR_SERIALIZA_FAIL(504,"序列化错误"), + //文件 + FILE_NOT_EXISIST(600,"文件不存在"), + PATH_NOT_EXISIST(601,"文件路径不存在"), + MODULE_NOT_EXISIST(602,"模块不存在"), + FILE_UPLOAD_FAIL(603,"文件上传失败"), + FILE_DOWNLOAD_FAIL(604,"文件下载失败"), + FILE_DOWNLOAD_EXPERTION(605,"文件下载异常"), + ; + + + + ResultCode(Integer code, String desc) { + this.code = code; + this.desc = desc; + } + + private Integer code; + private String desc; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + static Map<Integer,ResultCode> map; + + static { + map = new HashMap<>(); + for(ResultCode rc : ResultCode.values()){ + map.put(rc.getCode(),rc); + } + } + + public static ResultCode prase(Integer code){ + return map.get(code); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/enums/StatusEnum.java b/src/main/java/com/gkhy/labRiskManage/commons/enums/StatusEnum.java new file mode 100644 index 0000000..13f088b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/enums/StatusEnum.java @@ -0,0 +1,99 @@ +package com.gkhy.labRiskManage.commons.enums; + +public enum StatusEnum { + + SUCCESS(1,"操作成功"), + + FAIL(0,"操作失败"), + + + DELETE_NOT(0,"未删除"), + + DELETED(1,"已删除"), + + + EVALUATE_NOT(1,"未评价"), + + EVALUATE(2,"已评价"), + + EVALUATE_WAIT(3,"待评估"), + + + INHERENT_RISK(1,"固有风险"), + + EXPERIMENT_RISK(2,"实验风险"), + + + PLAN_SELL_NOT(1,"未派发"), + + PLAN_SELL(2,"已派发"), + + + PLAN_STATUS_NOT_START(1,"未开始"), + + PLAN_STATUS_START(2,"评估中"), + + PLAN_STATUS_TIMEOUT(3,"已超期"), + + + PLAN_EXEC_NOT_START(1,"未开始"), + + PLAN_EXEC_IDENTIFICATION(2,"辨识阶段"), + + PLAN_EXEC_EVALUATE(3,"评价阶段"), + + PLAN_EXEC_OVER(4,"评估完成"), + + + EXPERIMENT_STATUS_NOT_START(1,"未开始"), + + EXPERIMENT_STATUS_START(2,"评估中"), + + EXPERIMENT_STATUS_FINISH(3,"评估完成"), + + EXPERIMENT_STATUS_REPORT(4,"生成报告"), + + + APPROVED_WAIT(1,"未审批"), + + APPROVED_PASS(2,"已通过"), + + APPROVED_NOT_PASS(3,"不通过"), + + + REPORT_NOT_START(1,"未开始"), + + REPORT_APPROVED(2,"管理审核通过"), + + REPORT_NOT_APPROVED(3,"审核不通过"), + + REPORT_APPROVED_LEAD(4,"领导审核通过"), + + RECTIFY(1,"退回整改"), + ; + + + StatusEnum(Integer code, String desc) { + this.code = code; + this.desc = desc; + } + + private Integer code; + private String desc; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/enums/SystemCacheKeyEnum.java b/src/main/java/com/gkhy/labRiskManage/commons/enums/SystemCacheKeyEnum.java new file mode 100644 index 0000000..413927d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/enums/SystemCacheKeyEnum.java @@ -0,0 +1,35 @@ +package com.gkhy.labRiskManage.commons.enums; + +/** + * 系统缓存KEY + */ +public enum SystemCacheKeyEnum { + KEY_SYSTEM_PROP("gkhy-lab-sys","系统配置"), + KEY_SYSTEM_LICENSE_INFO("license","授权证书"), + KEY_USER_TOKEN("gkhy-lab-token","登录用户TOKEN"), + KEY_CACHE_USER("gkhy-lab-cache-user","用户信息缓存") + ; + private String key; + private String desc; + + SystemCacheKeyEnum(String key, String desc) { + this.key = key; + this.desc = desc; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/enums/SystemConfigKeyEnum.java b/src/main/java/com/gkhy/labRiskManage/commons/enums/SystemConfigKeyEnum.java new file mode 100644 index 0000000..ac309b1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/enums/SystemConfigKeyEnum.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.commons.enums; + +public enum SystemConfigKeyEnum { + LICENSE_TXT("license-value","系统授权License文本"), + LICENSE_U_KEY("license-u-key","系统授权客户私有KEY文本") + ; + + private String key; + private String desc; + + SystemConfigKeyEnum(String key, String desc) { + this.key = key; + this.desc = desc; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/enums/UserRoleEnum.java b/src/main/java/com/gkhy/labRiskManage/commons/enums/UserRoleEnum.java new file mode 100644 index 0000000..f06f7b7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/enums/UserRoleEnum.java @@ -0,0 +1,43 @@ +package com.gkhy.labRiskManage.commons.enums; + +public enum UserRoleEnum { + + USER_ROLE_1(1,"实验负责人"), + + USER_ROLE_2(2,"辨识专家"), + + USER_ROLE_3(3,"评价专家"), + + USER_ROLE_4(4,"实验管理者"), + + USER_ROLE_5(5,"现场专家"), + + USER_ROLE_6(6,"综合办"), + + ; + + + UserRoleEnum(Integer code, String desc) { + this.code = code; + this.desc = desc; + } + + private Integer code; + private String desc; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/enums/UserTagEnum.java b/src/main/java/com/gkhy/labRiskManage/commons/enums/UserTagEnum.java new file mode 100644 index 0000000..0055f75 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/enums/UserTagEnum.java @@ -0,0 +1,37 @@ +package com.gkhy.labRiskManage.commons.enums; + +public enum UserTagEnum { + + USER_TAG_0(0,"一般用户"), + + USER_TAG_1(1,"管理"), + + USER_TAG_2(2,"领导"), + + ; + + + UserTagEnum(Integer code, String desc) { + this.code = code; + this.desc = desc; + } + + private Integer code; + private String desc; + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/exception/BusinessException.java b/src/main/java/com/gkhy/labRiskManage/commons/exception/BusinessException.java new file mode 100644 index 0000000..141536c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/exception/BusinessException.java @@ -0,0 +1,74 @@ +package com.gkhy.labRiskManage.commons.exception; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; + +public class BusinessException extends RuntimeException { + + private Class causeClass; + + private Integer code; + + private String message; + +// public BusinessException(ResultCode error) { +// super(error.getDesc()); +// this.code = error.getCode(); +// this.message = error.getDesc(); +// } + + public BusinessException(Class causeClass,ResultCode error) { + super(error.getDesc()); + this.causeClass = causeClass; + this.code = error.getCode(); + this.message = error.getDesc(); + } + + public BusinessException(Class causeClass,ResultCode error, String message) { + super(error.getDesc()); + this.causeClass = causeClass; + this.code = error.getCode(); + if(message != null && !message.isEmpty()){ + this.message = message; + }else { + this.message = error.getDesc(); + } + } + +// public BusinessException(Integer code, String message) { +// super(message); +// this.code = code; +// this.message = message; +// } + + public BusinessException(Class causeClass,Integer code, String message) { + super(message); + this.causeClass = causeClass; + this.code = code; + this.message = message; + } + + public Class getCauseClass() { + return causeClass; + } + + public void setCauseClass(Class causeClass) { + this.causeClass = causeClass; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer 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/gkhy/labRiskManage/commons/exception/ExceptionInfo.java b/src/main/java/com/gkhy/labRiskManage/commons/exception/ExceptionInfo.java new file mode 100644 index 0000000..fb83256 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/exception/ExceptionInfo.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.commons.exception; + +import java.time.LocalDateTime; + +public class ExceptionInfo { + + private Class causeClass; + + private LocalDateTime time; + + private Integer code; + + private String msg; + + public Class getCauseClass() { + return causeClass; + } + + public void setCauseClass(Class causeClass) { + this.causeClass = causeClass; + } + + public LocalDateTime getTime() { + return time; + } + + public void setTime(LocalDateTime time) { + this.time = time; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/model/PageQuery.java b/src/main/java/com/gkhy/labRiskManage/commons/model/PageQuery.java new file mode 100644 index 0000000..78682bc --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/model/PageQuery.java @@ -0,0 +1,49 @@ +package com.gkhy.labRiskManage.commons.model; + +import org.springframework.util.ObjectUtils; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/26 + * @time: 15:12 + */ +public class PageQuery <T> { + private Integer pageIndex; + + private Integer pageSize; + + private T searchParams; + + public Integer getPageIndex() { + return pageIndex; + } + + public void setPageIndex(Integer pageIndex) { + if(null == pageIndex || pageIndex < 0){ + this.pageIndex = 0; + }else{ + this.pageIndex = pageIndex; + } + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + if(null == pageSize || pageSize < 0){ + this.pageSize = 10; + }else{ + this.pageSize = pageSize; + } + } + + public T getSearchParams() { + return searchParams; + } + + public void setSearchParams(T searchParams) { + this.searchParams = searchParams; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/utils/BeanCopyUtils.java b/src/main/java/com/gkhy/labRiskManage/commons/utils/BeanCopyUtils.java new file mode 100644 index 0000000..765c291 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/utils/BeanCopyUtils.java @@ -0,0 +1,186 @@ +package com.gkhy.labRiskManage.commons.utils; + +import com.gkhy.labRiskManage.api.controller.basic.dto.respDto.*; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.*; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentDeviceAppQueryDTO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentSiteAppQueryDTO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentStuffAppQueryDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessPlanAppQueryDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitBasicQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlan; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.AssessPlanQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.RiskAssessPlanQueryDTO; +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()); + } + + public static Object copyDeviceAppQueryList(Object data, Class<BasicExperimentDeviceAppQueryDTO> basicExperimentDeviceAppQueryDTOClass) { + return data; + } + + public static Object copyDeviceQueryRespList(Object data, Class<BasicExperimentDeviceQueryRespDTO> basicExperimentDeviceQueryRespDTOClass) { + return data; + } + + public static Object copyDeviceListRespList(Object data, Class<BasicExperimentDeviceQueryRespDTO> basicExperimentDeviceQueryRespDTOClass) { + return data; + } + + public static Object copyPersonAppQueryList(Object data, Class<BasicExperimentPersonAppQueryBO> basicExperimentPersonAppQueryDOClass) { + return data; + } + + public static Object copyPersonQueryRespList(Object data, Class<BasicExperimentPersonQueryRespDTO> basicExperimentPersonQueryRespDTOClass) { + return data; + } + + public static Object copyPersonListQueryList(Object data, Class<BasicExperimentPersonListRespDTO> basicExperimentPersonListRespDTOClass) { + return data; + } + + public static Object copySiteAppQueryList(Object data, Class<BasicExperimentSiteAppQueryDTO> basicExperimentSiteAppQueryDTOClass) { + return data; + } + + public static Object copySiteQueryRespList(Object data, Class<BasicExperimentSiteQueryRespDTO> basicExperimentSiteQueryRespDTOClass) { + return data; + } + + public static Object copySiteListQueryResp(Object data, Class<BasicExperimentSiteListRespDTO> basicExperimentSiteListRespDTOClass) { + return data; + } + + public static Object copyStuffAppQueryList(Object data, Class<BasicExperimentStuffAppQueryDTO> basicExperimentStuffAppQueryDTOClass) { + return data; + } + + public static Object copyStuffQueryRespList(Object data, Class<BasicExperimentStuffQueryRespDTO> basicExperimentStuffQueryRespDTOClass) { + return data; + } + + public static Object copyStuffListQueryResp(Object data, Class<BasicExperimentStuffListRespDTO> basicExperimentStuffListRespDTOClass) { + return data; + } + + + public static Object copyRiskUnitListQueryResp(Object data, Class<BasicRiskUnitQueryRespDTO> basicRiskUnitQueryRespDTOClass) { + return data; + } + + public static Object copyRiskUnitRespList(Object data, Class<BasicRiskUnitListRespDTO> basicRiskUnitListRespDTOClass) { + return data; + } + + public static Object copyFactorLecLQueryResp(Object data, Class<FactorLecLListRespDTO> factorLecEListRespDTOClass) { + return data; + } + public static Object copyFactorLecEQueryResp(Object data, Class<FactorLecEListRespDTO> factorLecCListRespDTOClass) { + return data; + } + public static Object copyFactorLecCQueryResp(Object data, Class<FactorLecCListRespDTO> factorLecCListRespDTOClass) { + return data; + } + + public static Object copyFactorLsLQueryResp(Object data, Class<FactorLsLListRespDTO> factorLsLListRespDTOClass) { + return data; + } + + public static Object copyFactorLsSQueryResp(Object data, Class<FactorLsSListRespDTO> factorLsSListRespDTOClass) { + return data; + } + public static Object copyFactorMesMQueryResp(Object data, Class<FactorMesMListRespDTO> factorMesMListRespDTOClass) { + return data; + } + + public static Object copyFactorMesEQueryResp(Object data, Class<FactorMesEListRespDTO> factorMesEListRespDTOClass) { + return data; + } + + public static Object copyFactorMesSQueryResp(Object data, Class<FactorMesSListRespDTO> factorMesSListRespDTOClass) { + return data; + } + + public static Object copyFactorRsRQueryResp(Object data, Class<FactorRsRListRespDTO> factorRsRListRespDTOClass) { + return data; + } + + public static Object copyFactorRsSQueryResp(Object data, Class<FactorRsSListRespDTO> factorRsSListRespDTOClass) { + return data; + } + + public static Object copyExperimentRiskUnitListQueryResp(Object data, Class<RiskUnitQueryRespDTO> riskUnitQueryRespDTOClass) { + return data; + } + + public static Object copyExperimentRiskUnitAppQueryList(Object data, Class<RiskUnitBasicQueryDTO> riskUnitBasicQueryDTOClass) { + return data; + } + + public static Object copyRiskAssessPlanQueryResp(Object data, Class<RiskAssessPlanQueryRespDTO> riskAssessPlanQueryRespDTOClass) { + return data; + } + + public static Object copyRiskAssessPlanAppQueryList(Object data, Class<RiskAssessPlanAppQueryDTO> riskAssessPlanAppQueryDTOClass) { + return data; + } + + public static Object copyRiskAssessQueryResp(Object data, Class<RiskAssessQueryRespDTO> riskAssessQueryReqBOClass) { + return data; + } + + + public static Object copyReportQueryResp(Object data, Class<ReportQueryRespDTO> reportQueryRespDTOClass) { + return data; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/utils/PageUtils.java b/src/main/java/com/gkhy/labRiskManage/commons/utils/PageUtils.java new file mode 100644 index 0000000..857f548 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/utils/PageUtils.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.commons.utils; + + +import com.gkhy.labRiskManage.commons.model.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() < 1) { + page.setPageIndex(1); + } + + if (page.getPageSize() == null || page.getPageSize() < 1) { + page.setPageSize(10); + } + + // pageSize 不能大于500 + if (page.getPageSize() > 500) { + page.setPageSize(500); + } + + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/commons/utils/SpringUtils.java b/src/main/java/com/gkhy/labRiskManage/commons/utils/SpringUtils.java new file mode 100644 index 0000000..bd31392 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/commons/utils/SpringUtils.java @@ -0,0 +1,18 @@ +package com.gkhy.labRiskManage.commons.utils; + +import com.gkhy.labRiskManage.Application; +import org.springframework.context.ApplicationContext; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 14:31 + */ +public class SpringUtils { + public static ApplicationContext applicationContext; + + public void setApplicationContext(ApplicationContext context){ + applicationContext = context; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/authorization/MyWebMvcConfigurerAdapter.java b/src/main/java/com/gkhy/labRiskManage/config/authorization/MyWebMvcConfigurerAdapter.java new file mode 100644 index 0000000..b458bff --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/authorization/MyWebMvcConfigurerAdapter.java @@ -0,0 +1,27 @@ +package com.gkhy.labRiskManage.config.authorization; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/8 + * @time: 10:45 + */ +@Configuration +public class MyWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter { + /** + * 配置静态访问资源 + * @param registry + */ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/uploadtest/**").addResourceLocations("file:E:/file/gkhy/test/"); + //registry.addResourceHandler("/upload/**").addResourceLocations("file:/home/upload/laboratoryRiskManage/"); + registry.addResourceHandler("/upload/**").addResourceLocations("file:/home/gkhy/upload/laboratoryRiskManage/"); + + super.addResourceHandlers(registry); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/authorization/TokenAuthenticationFilter.java b/src/main/java/com/gkhy/labRiskManage/config/authorization/TokenAuthenticationFilter.java new file mode 100644 index 0000000..b927c39 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/authorization/TokenAuthenticationFilter.java @@ -0,0 +1,140 @@ +package com.gkhy.labRiskManage.config.authorization; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.gkhy.labRiskManage.application.account.dto.respDto.ContextUserDto; +import com.gkhy.labRiskManage.application.account.dto.respDto.TokenInfoDto; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserInfoAppRespDTO; +import com.gkhy.labRiskManage.application.account.service.AccountAppService; +import com.gkhy.labRiskManage.application.account.service.TokenAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +import javax.annotation.Resource; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; + +/** +* @Description: token登录过滤器 +*/ +@Component +public class TokenAuthenticationFilter extends OncePerRequestFilter { + + @Resource + private TokenConfig tokenConfig; + + @Autowired + private RedissonClient redissonClient; + + @Autowired + private AccountAppService accountAppService; + + @Autowired + private TokenAppService tokenService; + + + + @Override + protected void doFilterInternal(HttpServletRequest req, HttpServletResponse resp, FilterChain chain) throws IOException, ServletException { + + try { + //获取当前认证成功用户权限信息 + UsernamePasswordAuthenticationToken authRequest = getAuthentication(req, resp); + if (authRequest != null) { + SecurityContextHolder.getContext().setAuthentication(authRequest); + } + // 执行下一个 filter 过滤器链 + chain.doFilter(req, resp); + } catch (BusinessException e) { + // 返回异常 + this.writeJSON(req, resp, new Result<>(e.getCode(),e.getMessage())); + } + + } + + + private UsernamePasswordAuthenticationToken getAuthentication(HttpServletRequest req,HttpServletResponse resp) { + // header获取token + String authToken = req.getHeader(tokenConfig.getHeader()); + String loginUserId = req.getHeader(tokenConfig.getLoginUserHeader()); + + RMapCache<String,Object> tokenCacheMap = null; + + if(authToken != null) { + // header 传入 userId + if (loginUserId == null || loginUserId.isEmpty()) { + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL); + } + // 登录成功时,会将权限数据存入redis + // 这里是验证获取权限信息 + // 1.从redis中获取对应该用户的权限信息 + Long userId = Long.parseLong(loginUserId); + Result<TokenInfoDto> getTokenInfoResult = tokenService.getToken(userId); + TokenInfoDto tokenInfoDto = null; + if(getTokenInfoResult.isSuccess()){ + tokenInfoDto = (TokenInfoDto) getTokenInfoResult.getData(); + if(tokenInfoDto == null || tokenInfoDto.getTk() == null || !tokenInfoDto.getTk().equals(authToken)){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_PERMISSION_DENIALED); + } + }else { + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_PERMISSION_DENIALED); + } + + SearchResult<UserInfoAppRespDTO> userResult = accountAppService.findUserByUserId(userId); + if(!userResult.isSuccess() || userResult.getData() == null){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST); + } + UserInfoAppRespDTO user = (UserInfoAppRespDTO) userResult.getData(); + ContextUserDto contextUserDto = new ContextUserDto(); + BeanUtils.copyProperties(user,contextUserDto); + + //获取授权信息 + //todo + List<GrantedAuthority> authorities = new ArrayList<>(); + + //token续期,提前60分钟 + Long tokenRemainTimeToLive = tokenInfoDto.getRemainSecond(); + if(tokenRemainTimeToLive/60 <= 60){ + tokenService.resetTokenTime(userId); + } + // security对象中存入登陆者信息 + return new UsernamePasswordAuthenticationToken(contextUserDto,authToken,authorities); + } + return null; + } + + + + protected void writeJSON(HttpServletRequest req, + HttpServletResponse resp, + Result result) throws IOException { + // 设置编码格式 + resp.setContentType("text/json;charset=utf-8"); + // 处理跨域问题 + resp.setHeader("Access-Control-Allow-Origin", "*"); + resp.setHeader("Access-Control-Allow-Methods", "POST, GET"); + + //输出JSON + PrintWriter out = resp.getWriter(); + ObjectMapper om = new ObjectMapper(); + out.write(om.writeValueAsString(result)); + out.flush(); + out.close(); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/authorization/TokenCheckWhiteListEnum.java b/src/main/java/com/gkhy/labRiskManage/config/authorization/TokenCheckWhiteListEnum.java new file mode 100644 index 0000000..3f96fe1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/authorization/TokenCheckWhiteListEnum.java @@ -0,0 +1,79 @@ +package com.gkhy.labRiskManage.config.authorization; + +import java.util.ArrayList; +import java.util.List; + +/** + * Token校验白名单 + */ +public enum TokenCheckWhiteListEnum { + PATH_LOGIN("/account/auth/login","登录接口",true), + PATH_FORGET_PASSWORD("/account/auth/pwd/forget/reset","忘记密码重置密码接口",true), + PATH_LICENSE("/sys/lic/**","授权证书查看",true), + PATH_ACCOUNT_AUTH("/account/auth/**","用户认证",true), + /*PATH_TEST_ACCOUNT("/account/user/**","账号测试接口",true), + //basic部分测试接口 + PATH_TEST_BASIC("/basic/**","账号测试接口",true), + //risk部分测试接口 + PATH_TEST_RISK("/risk/**","账号测试接口",true), + //实验部分测试接口 + PATH_EXPERIMENT_INFO("/experimentInfo/**","实验测试接口",true), + //部门测试 + PATH_DEPARTMENT("/account/department/**","部门测试接口",true), + PATH_ACCOUNT_ROLE("/account/role/**","用户认证",true), + PATH_ATTACHMENT("/attachment/**","文件上传",true), + PATH_ATTACHMENT_WINDOWN_VEIW("/uploadtest/**","文件上传",true), + PATH_ATTACHMENT_LINUX_VEIW("/upload/**","文件上传",true),*/ + ; + + + private String path; + + private String desc; + + private Boolean enable; + + TokenCheckWhiteListEnum(String path, String desc, Boolean enable) { + this.path = path; + this.desc = desc; + this.enable = enable; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public Boolean getEnable() { + return enable; + } + + public void setEnable(Boolean enable) { + this.enable = enable; + } + + public static String[] getWhitePathArray(){ + List<String> list = new ArrayList<>(); + for(TokenCheckWhiteListEnum e : TokenCheckWhiteListEnum.values()){ + if(e.enable == true){ + list.add(e.getPath()); + } + } + if(list.isEmpty()) + return null; + String[] pathArray = new String[0]; + pathArray = list.toArray(pathArray); + return pathArray; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/authorization/TokenConfig.java b/src/main/java/com/gkhy/labRiskManage/config/authorization/TokenConfig.java new file mode 100644 index 0000000..4b7a15f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/authorization/TokenConfig.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.config.authorization; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + + +/** +* @Description: jwt工具类 +* @date 2022/6/14 10:34 +*/ +@Component +@ConfigurationProperties(prefix = "system.token") +public class TokenConfig { + + private Long expiration; + private Long refreshExpiration; + private String header; + private String loginUserHeader; + + public Long getExpiration() { + return expiration; + } + + public void setExpiration(Long expiration) { + this.expiration = expiration; + } + + public Long getRefreshExpiration() { + return refreshExpiration; + } + + public void setRefreshExpiration(Long refreshExpiration) { + this.refreshExpiration = refreshExpiration; + } + + public String getHeader() { + return header; + } + + public void setHeader(String header) { + this.header = header; + } + + public String getLoginUserHeader() { + return loginUserHeader; + } + + public void setLoginUserHeader(String loginUserHeader) { + this.loginUserHeader = loginUserHeader; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/authorization/WebSecurityConfig.java b/src/main/java/com/gkhy/labRiskManage/config/authorization/WebSecurityConfig.java new file mode 100644 index 0000000..476810d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/authorization/WebSecurityConfig.java @@ -0,0 +1,76 @@ +package com.gkhy.labRiskManage.config.authorization; + +import com.gkhy.labRiskManage.infra.cache.domain.CacheUserInfo; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +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.builders.WebSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +import javax.annotation.Resource; + +@Configuration +@EnableWebSecurity +@EnableGlobalMethodSecurity(securedEnabled = true,prePostEnabled = true) +public class WebSecurityConfig extends WebSecurityConfigurerAdapter { + + @Resource + private TokenAuthenticationFilter tokenAuthenticationFilter; + + @Override + protected void configure(HttpSecurity http) throws Exception { + // 关闭跨域攻击 + http.csrf().disable(); + // 关闭session + http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); + // 登录json放行 | websocket | 普通人员密码自行修改 +// http.authorizeRequests().antMatchers("/auth/login", "/ws/test/**", "/account/pwd/forget","/sys/lic/**").permitAll(); + + //从白名单里面获取放行的接口 + http.authorizeRequests().antMatchers(TokenCheckWhiteListEnum.getWhitePathArray()).permitAll(); + + // 关闭 + http.headers().cacheControl(); + // token过滤器 + http.addFilterBefore(tokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class); + // 请求认证访问 + http.authorizeRequests().anyRequest().authenticated(); + // 允许跨域访问 + http.cors(); + + } + + + + + + /** + * @Description: 自定义查询逻辑 & 密码处理器 + */ + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.userDetailsService(userDetailsService()); + } + + /** + * @Description: 自定义查询逻辑 + */ + @Bean + @Qualifier("myUserDetailService") + protected UserDetailsService userDetailsService(){ + return (username)-> new CacheUserInfo(); + } + + + @Override + public void configure(WebSecurity web) { + web.ignoring().mvcMatchers(); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/cache/RedisConfig.java b/src/main/java/com/gkhy/labRiskManage/config/cache/RedisConfig.java new file mode 100644 index 0000000..db13f63 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/cache/RedisConfig.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.config.cache; + +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +@Configuration +@AutoConfigureAfter(RedisAutoConfiguration.class) +public class RedisConfig { + + @Bean + public RedisTemplate<String,Object> redisTemplate(RedisConnectionFactory connectionFactory){ + RedisTemplate<String,Object> template = new RedisTemplate<>(); + template.setConnectionFactory(connectionFactory); + // json序列化对象 + GenericJackson2JsonRedisSerializer jackson2JsonRedisSerializer = new GenericJackson2JsonRedisSerializer(); + StringRedisSerializer stringRedisSerializer = new StringRedisSerializer(); + // key=>string + template.setKeySerializer(stringRedisSerializer); + // hash=>string + template.setHashKeySerializer(stringRedisSerializer); + // value=>json + template.setValueSerializer(jackson2JsonRedisSerializer); + // hashValue=>json + template.setHashValueSerializer(jackson2JsonRedisSerializer); + // set + template.afterPropertiesSet(); + return template; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/cache/RedisUtils.java b/src/main/java/com/gkhy/labRiskManage/config/cache/RedisUtils.java new file mode 100644 index 0000000..6d71605 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/cache/RedisUtils.java @@ -0,0 +1,261 @@ +package com.gkhy.labRiskManage.config.cache; + + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.data.redis.connection.RedisClusterConnection; +import org.springframework.data.redis.connection.RedisClusterNode; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.jedis.JedisClusterConnection; +import org.springframework.data.redis.connection.jedis.JedisConnection; +import org.springframework.data.redis.core.*; +import org.springframework.stereotype.Repository; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** +* @Description: redis工具类 +*/ + +@Repository("configRedisRepository") +@SuppressWarnings(value = { "unchecked", "rawtypes" }) +public class RedisUtils { + + + @Resource + private RedisTemplate redisTemplate; + /** + * logger + */ + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + + @PostConstruct + public void initRepository(){ + try { + this.set("test:module:Web", "testConnection", 60L, TimeUnit.SECONDS); + logger.info("[ModuleRedis][Web] is connected"); + } catch (Exception e) { + logger.error("[ModuleRedis][Web] connected failed!!"); + } + } + + /** + * 写入缓存 + * @param key + * @param value + * @return + */ + public boolean set(final String key, Object value) { + boolean result = false; + try { + ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue(); + operations.set(key, value); + result = true; + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + /** + * 写入缓存设置时效时间 + * @param key + * @param value + * @return + */ + public boolean set(final String key, Object value, Long expireTime ,TimeUnit timeUnit) { + boolean result = false; + try { + ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue(); + operations.set(key, value); + redisTemplate.expire(key, expireTime, timeUnit); + result = true; + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + /** + * 批量删除对应的value + * @param keys + */ + public void remove(final String... keys) { + for (String key : keys) { + remove(key); + } + } + /** + * 批量删除key + * @param pattern + */ + public void removePattern(final String pattern) { + Set<Serializable> keys = redisTemplate.keys(pattern); + if (keys.size() > 0){ + redisTemplate.delete(keys); + } + } + /** + * 删除对应的value + * @param key + */ + public void remove(final String key) { + if (exists(key)) { + redisTemplate.delete(key); + } + } + /** + * 判断缓存中是否有对应的value + * @param key + * @return + */ + public boolean exists(final String key) { + return redisTemplate.hasKey(key); + } + /** + * 读取缓存 + * @param key + * @return + */ + public Object get(final String key) { + Object result = null; + ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue(); + result = operations.get(key); + return result; + } + /** + * 哈希 添加 + * @param key + * @param hashKey + * @param value + */ + public void hmSet(String key, Object hashKey, Object value){ + HashOperations<String, Object, Object> hash = redisTemplate.opsForHash(); + hash.put(key,hashKey,value); + } + /** + * 哈希获取数据 + * @param key + * @param hashKey + * @return + */ + public Object hmGet(String key, Object hashKey){ + HashOperations<String, Object, Object> hash = redisTemplate.opsForHash(); + return hash.get(key,hashKey); + } + /** + * 列表添加 + * @param k + * @param v + */ + public void lPush(String k,Object v){ + ListOperations<String, Object> list = redisTemplate.opsForList(); + list.rightPush(k,v); + } + /** + * 列表获取 + * @param k + * @param l + * @param l1 + * @return + */ + public List<Object> lRange(String k, long l, long l1){ + ListOperations<String, Object> list = redisTemplate.opsForList(); + return list.range(k,l,l1); + } + /** + * 集合添加 + * @param key + * @param value + */ + public void add(String key,Object value){ + SetOperations<String, Object> set = redisTemplate.opsForSet(); + set.add(key,value); + } + /** + * 集合获取 + * @param key + * @return + */ + public Set<Object> setMembers(String key){ + SetOperations<String, Object> set = redisTemplate.opsForSet(); + return set.members(key); + } + /** + * 有序集合添加 + * @param key + * @param value + * @param scoure + */ + public void zAdd(String key,Object value,double scoure){ + ZSetOperations<String, Object> zset = redisTemplate.opsForZSet(); + zset.add(key,value,scoure); + } + /** + * 有序集合获取 + * @param key + * @param scoure + * @param scoure1 + * @return + */ + public Set<Object> rangeByScore(String key,double scoure,double scoure1){ + ZSetOperations<String, Object> zset = redisTemplate.opsForZSet(); + return zset.rangeByScore(key, scoure, scoure1); + } + + /** + * @Description: 获取过期时间 返回 秒 + */ + + public Long getExpireTime(String key) { + return redisTemplate.getExpire(key, TimeUnit.SECONDS); + } + + + /** + * @Description: 重置key 的 过期时间 + */ + public void resetKeyExpireTime(String key, Long seconds) { + redisTemplate.expire(key, seconds, TimeUnit.SECONDS); + } + + public Set<String> scanMatch(String matchKey) { + Set<String> keys = new HashSet(); + RedisConnectionFactory connectionFactory = redisTemplate.getConnectionFactory(); + RedisConnection redisConnection = connectionFactory.getConnection(); + Cursor<byte[]> scan = null; + if(redisConnection instanceof JedisClusterConnection){ + RedisClusterConnection clusterConnection = connectionFactory.getClusterConnection(); + Iterable<RedisClusterNode> redisClusterNodes = clusterConnection.clusterGetNodes(); + Iterator<RedisClusterNode> iterator = redisClusterNodes.iterator(); + while (iterator.hasNext()) { + RedisClusterNode next = iterator.next(); + scan = clusterConnection.scan(next, ScanOptions.scanOptions().match(matchKey).count(Integer.MAX_VALUE).build()); + while (scan.hasNext()) { + keys.add(new String(scan.next())); + } + scan.close(); + } + return keys; + } + if(redisConnection instanceof JedisConnection){ + scan = redisConnection.scan(ScanOptions.scanOptions().match(matchKey).count(Integer.MAX_VALUE).build()); + while (scan.hasNext()){ + //找到一次就添加一次 + keys.add(new String(scan.next())); + } + scan.close(); + return keys; + } + + return keys; +} + +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/cors/CorsConfig.java b/src/main/java/com/gkhy/labRiskManage/config/cors/CorsConfig.java new file mode 100644 index 0000000..0085f76 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/cors/CorsConfig.java @@ -0,0 +1,39 @@ +package com.gkhy.labRiskManage.config.cors; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +@Configuration +public class CorsConfig { + + @Value("${system.enableCors}") + private Boolean enableCors; + + private CorsConfiguration buildConfig() { + CorsConfiguration corsConfiguration = new CorsConfiguration(); + // 你需要跨域的地址 注意这里的 127.0.0.1 != localhost + // * 表示对所有的地址都可以访问 + corsConfiguration.addAllowedOriginPattern("*"); // 1 + // 跨域的请求方法 + corsConfiguration.addAllowedMethod("*"); // 3 + // 跨域的请求头 + corsConfiguration.addAllowedHeader("*"); // 2 + //加上了这一句,大致意思是可以携带 cookie + //最终的结果是可以 在跨域请求的时候获取同一个 session + corsConfiguration.setAllowCredentials(true); + return corsConfiguration; + } + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + //配置 可以访问的地址 + if(enableCors == true) + source.registerCorsConfiguration("/**", buildConfig()); + return new CorsFilter(source); + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/exception/GlobalExceptionHandler.java b/src/main/java/com/gkhy/labRiskManage/config/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..9ebd9a6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/exception/GlobalExceptionHandler.java @@ -0,0 +1,133 @@ +package com.gkhy.labRiskManage.config.exception; + + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.exception.ExceptionInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.core.AuthenticationException; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.time.LocalDateTime; + +@ControllerAdvice +public class GlobalExceptionHandler { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private ObjectMapper objectMapper; + + /** + * 通用异常 + */ + @ResponseBody + @ExceptionHandler(value = BusinessException.class) + public Result businessExceptionHandler(BusinessException e) throws JsonProcessingException { + ExceptionInfo exceptionInfo = new ExceptionInfo(); + exceptionInfo.setTime(LocalDateTime.now()); + exceptionInfo.setCode(e.getCode()); + exceptionInfo.setMsg(e.getMessage()); + exceptionInfo.setCauseClass(e.getCauseClass()); + logger.error(objectMapper.writeValueAsString(exceptionInfo)); + Result result = new Result(); + result.setCode(e.getCode()); + if(e.getMessage() == null || e.getMessage().isEmpty()){ + ResultCode code = ResultCode.prase(e.getCode()); + if(code != null) + result.setMsg(code.getDesc()); + }else { + result.setMsg(e.getMessage()); + } + return result; + } + + + /** + * @Description: AuthenticationException + */ + + @ResponseBody + @ExceptionHandler(value = AuthenticationException.class) + public Result CHandler(AuthenticationException e) { + logger.warn(e.getMessage()); + return new Result(ResultCode.BUSINESS_ERROR_PERMISSION_DENIALED); + } + + + /** + * @Description: AuthenticationException + */ + + @ResponseBody + @ExceptionHandler(value = AccessDeniedException.class) + public Result DHandler(AccessDeniedException e) { + logger.warn(e.getMessage()); + return new Result(ResultCode.BUSINESS_ERROR_PERMISSION_DENIALED); + + } + + /** + * @Description: 请求方法 + */ + @ResponseBody + @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class) + public Result DHandler(HttpRequestMethodNotSupportedException e) { + Result resultVO = new Result(); + resultVO.setCode(ResultCode.BUSINESS_ERROR_HTTP_METHOD_NOT_SUPPORT.getCode()); + resultVO.setMsg(e.getMessage()); + return resultVO; + } + + + /** + * @Description: @RequestBody 请求体解析问题 + */ + @ResponseBody + @ExceptionHandler(value = HttpMessageNotReadableException.class) + public Result DHandler(HttpMessageNotReadableException e) { + Result resultVO = new Result(); + resultVO.setCode(ResultCode.PARAM_ERROR_ILLEGAL.getCode()); + resultVO.setMsg(e.getMessage()); + return resultVO; + + } + + + + @ResponseBody + @ExceptionHandler(value = Exception.class) + public Result errorHandler(Exception e) { + e.printStackTrace(); + logger.error(e.getMessage()); + Result resultVO = new Result(); + resultVO.setCode(ResultCode.SYSTEM_ERROR.getCode()); + return resultVO; +// return new ResultVO(ResultCodes.SERVER_ERROR); + } + + /** + * 处理入参异常 + * @param e + * @return + */ + @ResponseBody + @ExceptionHandler(MethodArgumentNotValidException.class) + public Result handleMethodArgumentNotValidException(MethodArgumentNotValidException e){ + logger.warn(e.getBindingResult().getFieldError().getDefaultMessage()); + return new Result(ResultCode.PARAM_ERROR, + e.getBindingResult().getFieldError().getDefaultMessage()); + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/file/FilePathConfig.java b/src/main/java/com/gkhy/labRiskManage/config/file/FilePathConfig.java new file mode 100644 index 0000000..dc691d9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/file/FilePathConfig.java @@ -0,0 +1,33 @@ +package com.gkhy.labRiskManage.config.file; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +/** + * @author :Li9527 + * @date :Created in 2019-09-02 9:57 + * @description:${description} + * @modified By: + * @version: 1.0.0 + */ +@Component +@Data +@ConfigurationProperties(prefix = "file.path") +public class FilePathConfig { + /** + * 文件保存根路径 + */ + private String dcPath; + /** + * 访问跟路径 + */ + private String urlRootPath; + /** + * 模块路径 + */ + private Map<String,String> module; +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/file/InitConfig.java b/src/main/java/com/gkhy/labRiskManage/config/file/InitConfig.java new file mode 100644 index 0000000..e576c34 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/file/InitConfig.java @@ -0,0 +1,41 @@ + +package com.gkhy.labRiskManage.config.file; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.lang.reflect.Field; + +/** + * @author :Li9527 + * @date :Created in 2019-04-01 17:17 + * @description:项目启动就执行的工具类 + * @modified By: + * @version: 1.0 + */ +@Slf4j +//@Component +public class InitConfig implements InitializingBean { + + @Resource + FilePathConfig filePathConfig; + + @Override + public void afterPropertiesSet() throws Exception { + log.info("文件配置路径开始加载"); + reflect(filePathConfig); + log.info("设置模块文件路径缓存"); + } + + public static void reflect(Object o) throws IllegalAccessException { + Class cls = o.getClass(); + Field[] fields = cls.getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + Field f = fields[i]; + f.setAccessible(true); + log.info(f.getName() + "----:" + f.get(o)); + } + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/license/CompanyLicenseDataCache.java b/src/main/java/com/gkhy/labRiskManage/config/license/CompanyLicenseDataCache.java new file mode 100644 index 0000000..5f7b3b2 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/license/CompanyLicenseDataCache.java @@ -0,0 +1,403 @@ +package com.gkhy.labRiskManage.config.license; + +import cn.hutool.crypto.asymmetric.KeyType; +import cn.hutool.crypto.asymmetric.RSA; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.SystemCacheKeyEnum; +import com.gkhy.labRiskManage.commons.enums.SystemConfigKeyEnum; +import com.gkhy.labRiskManage.domain.sysAdmin.entity.SysConfig; +import com.gkhy.labRiskManage.domain.sysAdmin.repository.jpa.SysConfigRepository; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.security.*; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; +import java.util.Optional; + +public class CompanyLicenseDataCache { + + @Autowired + private SysConfigRepository sysConfigRepository; + + @Autowired + private RedissonClient redissonClient; + + //授权信息 + private LicenseInfo licenseInfo; + + //部署模式 + private String deployMode; + + public CompanyLicenseDataCache(String deployMode) { + this.deployMode = deployMode; + initLicenseInfo(this.deployMode); + } + + private void initLicenseInfo(String deployMode){ + //初始化授权信息,系统启动时执行 + + } + + /** + * 获取授权证书信息 + * @return + */ + public LicenseInfo getLicenseInfo(){ + if(deployMode != null && deployMode.equals("standalone")){ + //单机模式 + return getLocalLicenseInfo(); + }else if(deployMode != null && deployMode.equals("cluster")){ + //集群模式 + return getClusterLicenseInfo(); + }else { + //配置错误 + return null; + } + } + + /** + * 单机部署,获取本地授权信息 + * @return + */ + private LicenseInfo getLocalLicenseInfo() { + //已经存在授权信息,直接返回 + if(licenseInfo != null){ + return licenseInfo; + } + //本地不存在授权信息,从数据库读取证书数据 + Optional<SysConfig> sysConfigOptional = sysConfigRepository.findById(SystemConfigKeyEnum.LICENSE_TXT.getKey()); + if(!sysConfigOptional.isPresent() || sysConfigOptional.get().getSysValue().isEmpty()){ + //数据库没有证书信息,返回无效授权 + licenseInfo = genEmptyLicense(); + } else{ + //解码证书文本,获取授权信息 + String licenseTxt = sysConfigOptional.get().getSysValue(); + LicenseInfo lic = decodeLicenseData(licenseTxt); + if(lic != null){ + licenseInfo = lic; + }else { + licenseInfo = genEmptyLicense(); + } + } + return licenseInfo; + } + + /** + * 集群部署,获取redis授权信息 + * @return + */ + private LicenseInfo getClusterLicenseInfo() { + //已经存在授权信息,直接返回 + if(licenseInfo != null){ + return licenseInfo; + } + //本地不存在授权信息,从数据库读取证书数据 + Optional<SysConfig> sysConfigOptional = sysConfigRepository.findById(SystemConfigKeyEnum.LICENSE_TXT.getKey()); + if(!sysConfigOptional.isPresent() || sysConfigOptional.get().getSysValue().isEmpty()){ + //数据库没有证书信息,返回无效授权 + licenseInfo = genEmptyLicense(); + } else{ + //解码证书文本,获取授权信息 + String licenseTxt = sysConfigOptional.get().getSysValue(); + LicenseInfo lic = decodeLicenseData(licenseTxt); + if(lic != null){ + licenseInfo = lic; + //将授权信息同步到redis + if(updateRedisLicenseInfo(lic).isSuccess()){ + + }else { + //todo:更新redis缓存失败 + } + }else { + licenseInfo = genEmptyLicense(); + } + } + return licenseInfo; + } + + /** + * 更新授权信息 + * @param licenseTxt + * @return + */ + public Result updateLicense(String licenseTxt){ + Result result = new Result<>(); + if(licenseTxt == null || licenseTxt.isEmpty()){ + result.setCode(ResultCode.PARAM_ERROR_NULL.getCode()); + result.setMsg("license为空"); + return result; + } + LicenseInfo licInfo = decodeLicenseData(licenseTxt); + if(licInfo == null){ + result.setCode(ResultCode.BUSINESS_ERROR.getCode()); + result.setMsg("license错误"); + return result; + } + //1、先更新redis缓存 + if(updateRedisLicenseInfo(licInfo).isSuccess()){ + //2、再更新本地缓存 + licenseInfo = licInfo; + result.execSuccess(); + }else { + result.setCode(ResultCode.SYSTEM_ERROR.getCode()); + result.setMsg("更新redis缓存的license出错"); + } + return result; + } + + /** + * 更新redis缓存的license + * @param licenseInfo + * @return + */ + private Result updateRedisLicenseInfo(LicenseInfo licenseInfo){ + Result result = new Result<>(); + if(redissonClient == null) + throw new RuntimeException("redis客户端异常"); + ObjectMapper om = new ObjectMapper(); + try { + String licenseJson = om.writeValueAsString(licenseInfo); + redissonClient.getMap(SystemCacheKeyEnum.KEY_SYSTEM_PROP.getKey()).put(SystemCacheKeyEnum.KEY_SYSTEM_LICENSE_INFO.getKey(),licenseJson); + result.setCode(ResultCode.OK.getCode()); + } catch (JsonProcessingException e) { + result.setCode(ResultCode.SYSTEM_ERROR.getCode()); + result.setMsg("license序列化为JSON出错"); + e.printStackTrace(); + } + return result; + } + + /** + * 创建无效授权信息 + * @return + */ + private LicenseInfo genEmptyLicense(){ + LicenseInfo empty = new LicenseInfo(); + empty.setLicenseType(LicenseTypeEnum.INVALID.getType()); + empty.setCompanyName(null); + empty.setBeginTime(null); + empty.setEndTime(null); + return empty; + } + + private LicenseInfo decodeLicenseDataRsa(String licenseTxt){ + LicenseInfo licenseInfo = null; + if(licenseTxt == null || licenseTxt.isEmpty()) + return null; + String aesTxt = null; + byte[] aesTxtBytes = Base64.getDecoder().decode(licenseTxt.getBytes(StandardCharsets.UTF_8)); + try { + aesTxt = String.valueOf(Base64.getDecoder().decode(licenseTxt.getBytes(StandardCharsets.UTF_8))); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + if(aesTxt == null || aesTxt.isEmpty()) + return null; + if(aesTxtBytes == null || aesTxtBytes.length == 0) + return null; + //解析本地KEY + + //todo + return null; + + } + + /** + * 解码license数据 + * @param licenseTxt + * @return + */ + private LicenseInfo decodeLicenseData(String licenseTxt){ + LicenseInfo licenseInfo = null; + if(licenseTxt == null || licenseTxt.isEmpty()) + return null; + String aesTxt = null; + byte[] aesTxtBytes = Base64.getDecoder().decode(licenseTxt.getBytes(StandardCharsets.UTF_8)); + try { + aesTxt = String.valueOf(Base64.getDecoder().decode(licenseTxt.getBytes(StandardCharsets.UTF_8))); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + if(aesTxt == null || aesTxt.isEmpty()) + return null; + if(aesTxtBytes == null || aesTxtBytes.length == 0) + return null; + //解析本地KEY + LicenseKCon sysKey = getSysKey(); + if(sysKey == null) + return null; + //获取用户私有key +// LicenseKCon userPrivateKey = getUserPrivateKey(sysKey); + LicenseKCon userPrivateKey = getUserPrivateKeyRSA(); + if(userPrivateKey == null) + return null; + //使用私有key解密license + try { + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + cipher.init(Cipher.DECRYPT_MODE,new SecretKeySpec(userPrivateKey.getKey().getBytes(),"AES"), + new IvParameterSpec(userPrivateKey.getIv().getBytes())); + byte[] rsBytes = cipher.doFinal(aesTxtBytes); + String jsonStr = new String(rsBytes,StandardCharsets.UTF_8); +// System.out.println("解密后明文:\n"+jsonStr); + ObjectMapper om = new ObjectMapper(); + om.registerModule(new JavaTimeModule()); + licenseInfo = om.readValue(jsonStr,LicenseInfo.class); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (NoSuchPaddingException e) { + e.printStackTrace(); + } catch (InvalidKeyException e) { + e.printStackTrace(); + } catch (InvalidAlgorithmParameterException e) { + e.printStackTrace(); + } catch (IllegalBlockSizeException e) { + e.printStackTrace(); + } catch (BadPaddingException e) { + e.printStackTrace(); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return licenseInfo; + } + + /** + * 获取系统KEY + * @return + */ + private LicenseKCon getSysKey(){ + //解析本地KEY + String key = null; + String iv = null; + + String sysKeyStr = new String(Base64.getDecoder().decode(LicenseDataCon.getCon().getPi().getBytes(StandardCharsets.UTF_8)), + StandardCharsets.UTF_8); + String[] kiArray =sysKeyStr.split("#"); + if(kiArray == null || kiArray.length !=2){ + return null; + } + key = kiArray[0]; + iv = kiArray[1]; + + if(key == null || iv == null || key.isEmpty() || iv.isEmpty()) + return null; + LicenseKCon licenseKCon = new LicenseKCon(); + licenseKCon.setKey(key); + licenseKCon.setIv(iv); + return licenseKCon; + } + + /** + * 用本地key解码获取用户私有key + * @param sysKey + * @return + */ + private LicenseKCon getUserPrivateKey(LicenseKCon sysKey){ + Optional<SysConfig> sysConfigOptional = sysConfigRepository.findById(SystemConfigKeyEnum.LICENSE_U_KEY.getKey()); + if(sysConfigOptional == null || !sysConfigOptional.isPresent()){ + return null; + } + SysConfig sysConfig = sysConfigOptional.get(); + if(sysConfig.getSysValue() == null || sysConfig.getSysValue().isEmpty()) + return null; + //加密:明文->转base64->aes->转base64 + //解密:密文->反base64->aes->反base64 + //明文规则: key#iv + String key = null; + String iv = null; + + + byte[] rsBytes = new byte[0]; + try { + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + cipher.init(Cipher.DECRYPT_MODE,new SecretKeySpec(sysKey.getKey().getBytes(),"AES"), + new IvParameterSpec(sysKey.getIv().getBytes())); + rsBytes = cipher.doFinal(Base64.getDecoder().decode(sysConfig.getSysValue().getBytes(StandardCharsets.UTF_8))); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (NoSuchPaddingException e) { + e.printStackTrace(); + } catch (InvalidKeyException e) { + e.printStackTrace(); + } catch (InvalidAlgorithmParameterException e) { + e.printStackTrace(); + } catch (IllegalBlockSizeException e) { + e.printStackTrace(); + } catch (BadPaddingException e) { + e.printStackTrace(); + } + + String[] kiArray = new String(Base64.getDecoder().decode(rsBytes), StandardCharsets.UTF_8).split("#"); + if(kiArray == null || kiArray.length != 2){ + return null; + } + key = kiArray[0]; + iv = kiArray[1]; + if(key == null || iv == null || key.isEmpty() || iv.isEmpty()) + return null; + LicenseKCon licenseKCon = new LicenseKCon(); + licenseKCon.setKey(key); + licenseKCon.setIv(iv); + return licenseKCon; + } + + private LicenseKCon getUserPrivateKeyRSA(){ + //1、从数据库获取加密KEY + Optional<SysConfig> sysConfigOptional = sysConfigRepository.findById(SystemConfigKeyEnum.LICENSE_U_KEY.getKey()); + if(sysConfigOptional == null || !sysConfigOptional.isPresent()){ + return null; + } + SysConfig sysConfig = sysConfigOptional.get(); + if(sysConfig.getSysValue() == null || sysConfig.getSysValue().isEmpty()) + return null; + //2、解密取得secretKey 和 IV + LicenseDataCon dataConf = LicenseDataCon.getCon(); + byte[] rsBytes = null; + + RSA rsa = new RSA(); + PublicKey pk = + null; + try { + pk = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(Base64.getDecoder().decode(dataConf.getPublicKey()))); + } catch (InvalidKeySpecException e) { + e.printStackTrace(); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + rsa.setPublicKey(pk); + rsBytes = rsa.decrypt(Base64.getDecoder().decode(sysConfig.getSysValue()), KeyType.PublicKey); + + //解密后处理 + if(rsBytes == null || rsBytes.length == 0){ + return null; + } + //明文规则: key#iv + String kiStr = new String(rsBytes, StandardCharsets.UTF_8); + String[] kiArray = kiStr.split("#"); + if(kiArray == null || kiArray.length != 2){ + return null; + } + String key = kiArray[0]; + String iv = kiArray[1]; + if(key == null || iv == null || key.isEmpty() || iv.isEmpty()) + return null; + LicenseKCon licenseKCon = new LicenseKCon(); + licenseKCon.setKey(key); + licenseKCon.setIv(iv); + return licenseKCon; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/license/LicenseBizWhiteEnum.java b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseBizWhiteEnum.java new file mode 100644 index 0000000..a494cd7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseBizWhiteEnum.java @@ -0,0 +1,51 @@ +package com.gkhy.labRiskManage.config.license; + +import java.util.HashMap; +import java.util.Map; + +/** + * 业务接口授权白名单 + * 配置在这里的业务接口前缀,不需要授权 + */ +public enum LicenseBizWhiteEnum { + BIZ_RISK_IDENTIFY("sys","系统管理"), + BIZ_ACCOUNT("account","用户账号") + ; + + + private String biz; + private String bizName; + + LicenseBizWhiteEnum(String biz, String bizName) { + this.biz = biz; + this.bizName = bizName; + } + + public String getBiz() { + return biz; + } + + public void setBiz(String biz) { + this.biz = biz; + } + + public String getBizName() { + return bizName; + } + + public void setBizName(String bizName) { + this.bizName = bizName; + } + + static Map<String, LicenseBizWhiteEnum> map; + static { + map = new HashMap<>(); + for (LicenseBizWhiteEnum bizEnum : LicenseBizWhiteEnum.values()) { + map.put(bizEnum.biz,bizEnum); + } + } + + public static LicenseBizWhiteEnum parse(String biz) { + return map.get(biz); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/license/LicenseDataCon.java b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseDataCon.java new file mode 100644 index 0000000..1850636 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseDataCon.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.config.license; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +public class LicenseDataCon { + + private String p; + + private String i; + + private String pubk; + + private LicenseDataCon(){ + this.p = "ag3hs8jqodi1hs8g"; + this.i = "8uhsgt16tsd623hd"; + this.pubk = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwyJHfDUlEIhnATeh7nHH7Xa6gXLIahAoTsQ+/DchZXxVutptzYCVebPJDg8PX+iQvjtO4F1Lmu3OKQVFv5yOA5QAShlP163a0yGg50zNGhPesnODIhEOmEHqCTQZctEGK0x51+mxIhS0xIkCOYUpTleT8KfVS8Ab9+hDhcxQkrwIDAQAB"; + } + + public static LicenseDataCon getCon(){ + return new LicenseDataCon(); + } + + public String getPi() { + if(p == null || i == null || p.isEmpty() || i.isEmpty()) + return null; + String r = p+"#"+i; + return new String(Base64.getEncoder().encodeToString(r.getBytes(StandardCharsets.UTF_8))); + } + + public String getPublicKey(){ + return this.pubk; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/license/LicenseFilter.java b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseFilter.java new file mode 100644 index 0000000..8515946 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseFilter.java @@ -0,0 +1,65 @@ +package com.gkhy.labRiskManage.config.license; + +import org.springframework.beans.factory.annotation.Autowired; +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 = "LicenseFilter") +public class LicenseFilter implements Filter { + +// @Autowired + private LicenseManageService licenseManageService; + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + Filter.super.init(filterConfig); + } + + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + HttpServletRequest reqs = (HttpServletRequest) servletRequest; + HttpServletResponse response = (HttpServletResponse) servletResponse; + String reqUri = reqs.getRequestURI().toString(); + //1、选择过滤的业务系统接口路径 + String[] uris = reqUri.split("/"); + if(uris.length < 2) + filterChain.doFilter(servletRequest,servletResponse); + String licenseBiz = uris[1]; + if(licenseBiz == null) + filterChain.doFilter(servletRequest,servletResponse); + //默认所有业务均需要授权访问 + boolean checkFlag = true; + if(LicenseBizWhiteEnum.parse(licenseBiz) != null){ + //业务接口在授权白名单清单中,不需要授权访问 + checkFlag = false; + } + //2、检查授权 + if(checkFlag == true){ + if(licenseManageService.isActiveLicense()){ + filterChain.doFilter(servletRequest,servletResponse); + //有授权,放行 + }else { + //没有授权,拦截 +// ResultDto resultDto = new ResultDto<>(); +// resultDto.setCode(401); +// resultDto.setMsg("系统授权到期,请联系管理员"); + response.setContentType("text/html;charset=UTF-8"); + response.getWriter().print("系统授权到期,请联系管理员"); + response.setStatus(401); + } + }else { + filterChain.doFilter(servletRequest,servletResponse); + } + } + + @Override + public void destroy() { + Filter.super.destroy(); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/license/LicenseInfo.java b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseInfo.java new file mode 100644 index 0000000..bbcc52e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseInfo.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.config.license; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.time.LocalDateTime; + +public class LicenseInfo { + + private String companyName; + + private Byte licenseType; + + private LocalDateTime beginTime; + + private LocalDateTime endTime; + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public Byte getLicenseType() { + return licenseType; + } + + public void setLicenseType(Byte licenseType) { + this.licenseType = licenseType; + } + + public LocalDateTime getBeginTime() { + return beginTime; + } + + public void setBeginTime(LocalDateTime beginTime) { + this.beginTime = beginTime; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/license/LicenseInit.java b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseInit.java new file mode 100644 index 0000000..71ec31e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseInit.java @@ -0,0 +1,27 @@ +package com.gkhy.labRiskManage.config.license; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.DependsOn; +import org.springframework.stereotype.Component; + +@Component +public class LicenseInit { + + @Value("${system.deployMode}") + private String deployMode; + + @Bean + public CompanyLicenseDataCache companyLicenseDataCache(){ +// //todo:从数据库加载授权信息 +// if(deployMode != null && deployMode.equals("standalone")){ +// //单机模式,直接从数据库读取数据 +// +// }else if(deployMode != null && deployMode.equals("cluster")){ +// //集群模式,跟redis缓存同步 +// }else { +// //配置错误 +// } + return new CompanyLicenseDataCache(deployMode); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/license/LicenseKCon.java b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseKCon.java new file mode 100644 index 0000000..b9949e7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseKCon.java @@ -0,0 +1,22 @@ +package com.gkhy.labRiskManage.config.license; + +public class LicenseKCon { + private String key; + private String iv; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getIv() { + return iv; + } + + public void setIv(String iv) { + this.iv = iv; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/license/LicenseManageService.java b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseManageService.java new file mode 100644 index 0000000..b1fe5d1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseManageService.java @@ -0,0 +1,63 @@ +package com.gkhy.labRiskManage.config.license; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; + +@Service +public class LicenseManageService { + + @Value("${system.deployMode}") + private String deployMode; + + @Autowired + private CompanyLicenseDataCache companyLicenseDataCache; + + /** + * 检查license有效性 + * @return + */ + public boolean isActiveLicense(){ + LicenseInfo licenseInfo = companyLicenseDataCache.getLicenseInfo(); + if(licenseInfo == null){ + return false; + } + if(licenseInfo.getLicenseType().equals(LicenseTypeEnum.INVALID.getType())){ + //无效授权 + return false; + } + LocalDateTime nowTime = LocalDateTime.now(); + if(licenseInfo.getLicenseType().equals(LicenseTypeEnum.TRAIL.getType())){ + //试用授权 + if(licenseInfo.getBeginTime() == null || licenseInfo.getEndTime() == null){ + return false; + } + if(licenseInfo.getBeginTime().isAfter(nowTime) || licenseInfo.getEndTime().isBefore(nowTime)){ + return false; + }else { + return true; + } + } + if(licenseInfo.getLicenseType().equals(LicenseTypeEnum.LIMIT.getType())){ + //有限期授权 + if(licenseInfo.getBeginTime() == null || licenseInfo.getEndTime() == null){ + return false; + } + if(licenseInfo.getBeginTime().isAfter(nowTime) || licenseInfo.getEndTime().isBefore(nowTime)){ + return false; + }else { + return true; + } + } + if(licenseInfo.getLicenseType().equals(LicenseTypeEnum.LONG_TIME.getType())){ + //长期授权 + return true; + } + //证书类型不支持,默认无效 + return false; + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/license/LicenseTypeEnum.java b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseTypeEnum.java new file mode 100644 index 0000000..fd5f0b3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/license/LicenseTypeEnum.java @@ -0,0 +1,47 @@ +package com.gkhy.labRiskManage.config.license; + +import java.util.HashMap; +import java.util.Map; + +public enum LicenseTypeEnum { + INVALID((byte)0,"无效授权"), + TRAIL((byte)1,"试用授权"), + LIMIT((byte)2,"有限期授权"), + LONG_TIME((byte)3,"长期有效授权") + ; + + private Byte type; + private String desc; + + LicenseTypeEnum(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, LicenseTypeEnum> map; + static { + map = new HashMap<>(); + for (LicenseTypeEnum typeEnum : LicenseTypeEnum.values()) { + map.put(typeEnum.type,typeEnum); + } + } + public static LicenseTypeEnum parse(Byte type) { + return map.get(type); + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/serializa/JacksonConfiguration.java b/src/main/java/com/gkhy/labRiskManage/config/serializa/JacksonConfiguration.java new file mode 100644 index 0000000..e97eb66 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/serializa/JacksonConfiguration.java @@ -0,0 +1,32 @@ +package com.gkhy.labRiskManage.config.serializa; + + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@Configuration +public class JacksonConfiguration { + + @Bean + @Primary + @ConditionalOnMissingBean(ObjectMapper.class) + public ObjectMapper jacksonObjectMapper() + { + ObjectMapper mapper = new ObjectMapper(); + JavaTimeModule javaTimeModule = new JavaTimeModule(); + javaTimeModule.addDeserializer(LocalDateTime.class, + new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + javaTimeModule.addSerializer(LocalDateTime.class, + new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + mapper.registerModule(javaTimeModule); + return mapper; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/config/serializa/JavaTimeAutoConfiguration.java b/src/main/java/com/gkhy/labRiskManage/config/serializa/JavaTimeAutoConfiguration.java new file mode 100644 index 0000000..154719a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/config/serializa/JavaTimeAutoConfiguration.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.config.serializa; + +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@Configuration +@ConditionalOnClass(JavaTimeModule.class) +public class JavaTimeAutoConfiguration { + @Bean + @ConditionalOnProperty("spring.jackson.date-format") + Jackson2ObjectMapperBuilderCustomizer customizeLocalDateTimeFormat(@Value("${spring.jackson.date-format}") String dateFormat){ + return jacksonObjectMapperBuilder -> { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateFormat); + + jacksonObjectMapperBuilder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(formatter)); + jacksonObjectMapperBuilder.deserializerByType(LocalDateTime.class, + new LocalDateTimeDeserializer(formatter)); + }; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/converter/RoleInfoConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/RoleInfoConverter.java new file mode 100644 index 0000000..c9c2bed --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/RoleInfoConverter.java @@ -0,0 +1,18 @@ +package com.gkhy.labRiskManage.domain.account.converter; + +import com.gkhy.labRiskManage.domain.account.entity.Role; +import com.gkhy.labRiskManage.domain.account.model.dto.RoleInfoDoaminDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +@Service +public class RoleInfoConverter { + + public RoleInfoDoaminDTO roleRoleInfoDTO(Role role){ + if(role == null) + return null; + RoleInfoDoaminDTO roleInfoDoaminDTO = new RoleInfoDoaminDTO(); + BeanUtils.copyProperties(role, roleInfoDoaminDTO); + return roleInfoDoaminDTO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/converter/SysDeparmentConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/SysDeparmentConverter.java new file mode 100644 index 0000000..4009170 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/SysDeparmentConverter.java @@ -0,0 +1,43 @@ +package com.gkhy.labRiskManage.domain.account.converter; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.application.account.dto.respDto.SysDepartmentAppDTO; +import com.gkhy.labRiskManage.domain.account.entity.SysDepartment; +import com.gkhy.labRiskManage.domain.account.model.dto.SysDepartmentDomainDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/9 + * @time: 8:55 + */ +@Component +public class SysDeparmentConverter { + public SysDepartmentDomainDTO sysDepDomainDTOConverter(SysDepartment sysDepartment){ + if (sysDepartment == null){ + return null; + } + SysDepartmentDomainDTO sysDepartmentDomainDTO = new SysDepartmentDomainDTO(); + BeanUtils.copyProperties(sysDepartment,sysDepartmentDomainDTO); + return sysDepartmentDomainDTO; + } + + public List<SysDepartmentAppDTO> sysDepAppDTOListConverter(List<SysDepartmentDomainDTO> list) { + List<SysDepartmentAppDTO> appDTOList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(list)){ + for (SysDepartmentDomainDTO sysDepartmentDomainDTO : list){ + SysDepartmentAppDTO sysDepartmentAppDTO = new SysDepartmentAppDTO(); + BeanUtils.copyProperties(sysDepartmentDomainDTO,sysDepartmentAppDTO); + sysDepartmentAppDTO.setChildren(sysDepAppDTOListConverter(sysDepartmentDomainDTO.getChildren())); + appDTOList.add(sysDepartmentAppDTO); + } + } + return appDTOList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/converter/SysUserIndentityBindConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/SysUserIndentityBindConverter.java new file mode 100644 index 0000000..e25ecb1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/SysUserIndentityBindConverter.java @@ -0,0 +1,44 @@ +package com.gkhy.labRiskManage.domain.account.converter; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserRoleBindAppRespDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserRoleBindRespDTO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.entity.SysUserRoleBind; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 10:34 + */ +@Component +public class SysUserIndentityBindConverter { + public List<SysUserRoleBindDomainDTO> userRoleBindDomainConverter(List<SysUserRoleBind> list){ + List<SysUserRoleBindDomainDTO> respDTO = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(list)){ + respDTO = BeanCopyUtils.copyBeanList(list, SysUserRoleBindDomainDTO.class); + } + return respDTO; + } + public List<UserRoleBindAppRespDTO> userRoleBindAppConverter(List<SysUserRoleBindDomainDTO> list){ + List<UserRoleBindAppRespDTO> respDTO = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(list)){ + respDTO = BeanCopyUtils.copyBeanList(list, UserRoleBindAppRespDTO.class); + } + return respDTO; + } + public List<UserRoleBindRespDTO> userRoleBindConverter(List<SysUserRoleBindDomainDTO> list){ + List<UserRoleBindRespDTO> respDTO = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(list)){ + respDTO = BeanCopyUtils.copyBeanList(list, UserRoleBindRespDTO.class); + } + return respDTO; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserIdentityConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserIdentityConverter.java new file mode 100644 index 0000000..3ccaf1d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserIdentityConverter.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.account.converter; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.entity.UserIdentity; +import com.gkhy.labRiskManage.domain.account.model.dto.UserIdentityDomainDTO; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 10:34 + */ +@Component +public class UserIdentityConverter { + + + public List<UserIdentityDomainDTO> userIdentityDomainConverter(List<UserIdentity> list){ + List<UserIdentityDomainDTO> respDTO = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(list)){ + respDTO = BeanCopyUtils.copyBeanList(list, UserIdentityDomainDTO.class); + } + return respDTO; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserInfoDomainConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserInfoDomainConverter.java new file mode 100644 index 0000000..b467772 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserInfoDomainConverter.java @@ -0,0 +1,92 @@ +package com.gkhy.labRiskManage.domain.account.converter; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserIdentityBindAppRespDTO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.entity.SysUserIdentityBind; +import com.gkhy.labRiskManage.domain.account.entity.SysUserRoleBind; +import com.gkhy.labRiskManage.domain.account.entity.User; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserInfoAppRespDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserIdentityBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.attachment.dto.resp.AttachmentDomainDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class UserInfoDomainConverter { + + public UserInfoAppRespDTO toUserInfoRespDTO(UserInfoDomainDTO userInfoDomainDTO){ + if(userInfoDomainDTO == null) + return null; + UserInfoAppRespDTO userInfoAppRespDTO = new UserInfoAppRespDTO(); + BeanUtils.copyProperties(userInfoDomainDTO, userInfoAppRespDTO); + return userInfoAppRespDTO; + } + + public UserInfoDomainDTO toUserInfoDTO(User user){ + if(user == null) + return null; + UserInfoDomainDTO userInfoDomainDTO = new UserInfoDomainDTO(); + BeanUtils.copyProperties(user, userInfoDomainDTO); + if(user.getSysDepartment() != null){ + userInfoDomainDTO.setDepName(user.getSysDepartment().getDepName()); + } + List<SysUserRoleBindDomainDTO> roleBindDomainDTOList = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(user.getSysUserRoleBinds())){ + user.getSysUserRoleBinds().forEach(userRoleBind -> { + roleBindDomainDTOList.add(toUserRoleDomainDTO(userRoleBind)); + }); + } + userInfoDomainDTO.setRoles(roleBindDomainDTOList); + + //身份 + List<SysUserIdentityBindDomainDTO> userIdentityBindDomainDTOS = new ArrayList<>(); + if(user.getSysUserIdentityBinds() != null){ + user.getSysUserIdentityBinds().forEach(userIdentity ->{ + userIdentityBindDomainDTOS.add(toUserIndentityDomainDTO(userIdentity)); + }); + } + userInfoDomainDTO.setUserIdentities(userIdentityBindDomainDTOS); + //资质附件 + if(user.getQualificationAttachment() != null){ + AttachmentDomainDTO attachmentDomainDTO = new AttachmentDomainDTO(); + BeanUtils.copyProperties(user.getQualificationAttachment(),attachmentDomainDTO); + userInfoDomainDTO.setQualificationAttDomainDTO(attachmentDomainDTO); + } + return userInfoDomainDTO; + } + public SysUserIdentityBindDomainDTO toUserIndentityDomainDTO(SysUserIdentityBind sysUserIdentityBind){ + if(sysUserIdentityBind == null) + return null; + SysUserIdentityBindDomainDTO sysUserRoleBindDomainDTO = new SysUserIdentityBindDomainDTO(); + BeanUtils.copyProperties(sysUserIdentityBind, sysUserRoleBindDomainDTO); + if(sysUserIdentityBind.getUserIdentity() != null){ + sysUserRoleBindDomainDTO.setUserIdentity(sysUserIdentityBind.getUserIdentity().getIdentity()); + } + return sysUserRoleBindDomainDTO; + } + public SysUserRoleBindDomainDTO toUserRoleDomainDTO(SysUserRoleBind sysUserRoleBind){ + if(sysUserRoleBind == null) + return null; + SysUserRoleBindDomainDTO sysUserRoleBindDomainDTO = new SysUserRoleBindDomainDTO(); + BeanUtils.copyProperties(sysUserRoleBind, sysUserRoleBindDomainDTO); + sysUserRoleBindDomainDTO.setRoleName(sysUserRoleBind.getRole().getName()); + return sysUserRoleBindDomainDTO; + } + public List<UserInfoDomainDTO> toDomainUserInfoList(List<User> userList){ + if(userList == null || userList.isEmpty()) + return null; + List<UserInfoDomainDTO> domainDTOList = new ArrayList<>(); + userList.forEach(u -> { + domainDTOList.add(toUserInfoDTO(u)); + }); + return domainDTOList; + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserRoleBindConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserRoleBindConverter.java new file mode 100644 index 0000000..aabdb02 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/converter/UserRoleBindConverter.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.domain.account.converter; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.application.account.dto.respDto.RoleRespDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserRoleBindAppRespDTO; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserRoleBindRespDTO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.entity.SysUserRoleBind; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 10:34 + */ +@Component +public class UserRoleBindConverter { + public List<SysUserRoleBindDomainDTO> userRoleBindDomainConverter(List<SysUserRoleBind> list){ + List<SysUserRoleBindDomainDTO> respDTO = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(list)){ + respDTO = BeanCopyUtils.copyBeanList(list, SysUserRoleBindDomainDTO.class); + } + return respDTO; + } + public List<UserRoleBindAppRespDTO> userRoleBindAppConverter(List<SysUserRoleBindDomainDTO> list){ + List<UserRoleBindAppRespDTO> respDTO = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(list)){ + respDTO = BeanCopyUtils.copyBeanList(list, UserRoleBindAppRespDTO.class); + } + return respDTO; + } + public List<UserRoleBindRespDTO> userRoleBindConverter(List<SysUserRoleBindDomainDTO> list){ + List<UserRoleBindRespDTO> respDTO = new ArrayList<>(); + if(ObjectUtil.isNotEmpty(list)){ + respDTO = BeanCopyUtils.copyBeanList(list, UserRoleBindRespDTO.class); + } + return respDTO; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/entity/Role.java b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/Role.java new file mode 100644 index 0000000..9d90931 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/Role.java @@ -0,0 +1,69 @@ +package com.gkhy.labRiskManage.domain.account.entity; + +import org.hibernate.annotations.Proxy; + +import javax.persistence.*; +import java.time.LocalDateTime; + +@Entity +@Table(name = "sys_role") +public class Role { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + //角色名 + @Column + private String name; + + //删除标志 0-未删除;1-删除 + @Column + private Byte delFlag; + + @Column + private LocalDateTime gmtCreate; + + @Column + private LocalDateTime gmtModified; + + 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 getDelFlag() { + return delFlag; + } + + public void setDelFlag(Byte delFlag) { + this.delFlag = delFlag; + } + + 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/gkhy/labRiskManage/domain/account/entity/RoleMenuBind.java b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/RoleMenuBind.java new file mode 100644 index 0000000..835f8db --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/RoleMenuBind.java @@ -0,0 +1,65 @@ +package com.gkhy.labRiskManage.domain.account.entity; + +import javax.persistence.*; +import java.time.LocalDateTime; + +@Entity +@Table(name = "sys_role_menu_bind") +public class RoleMenuBind { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column + private Long roleId; + + @Column + private Long menuItemId; + + @Column + private LocalDateTime gmtCreate; + + @Column + private LocalDateTime gmtModified; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public Long getMenuItemId() { + return menuItemId; + } + + public void setMenuItemId(Long menuItemId) { + this.menuItemId = menuItemId; + } + + 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/gkhy/labRiskManage/domain/account/entity/SysDepartment.java b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysDepartment.java new file mode 100644 index 0000000..3ea6ab6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysDepartment.java @@ -0,0 +1,68 @@ +package com.gkhy.labRiskManage.domain.account.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import javax.persistence.*; +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/7 + * @time: 13:25 + */ +@EntityListeners(AuditingEntityListener.class) +@Data +@Entity +@Table(name="sys_department") +public class SysDepartment { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 部门 + */ + private String depName; + /** + * 等级 + */ + private Byte level; + /** + * 父级id + */ + private Long parentId; + /** + * 描述 + */ + private String info; + /** + * 删除标识 0未删除,2删除 + */ + private Byte deleteStatus; + /** + * 创建时间 + */ + @JsonFormat + @CreatedDate + @Column(name = "create_time",updatable = false) + private LocalDateTime createTime; + /** + * 修改时间 + */ + @JsonFormat + @LastModifiedDate + private LocalDateTime updateTime; + /** + * 创建人 + */ + private Long createByUserId; + /** + * 更新人 + */ + private Long updateByUserId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysUserIdentityBind.java b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysUserIdentityBind.java new file mode 100644 index 0000000..2e63c9b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysUserIdentityBind.java @@ -0,0 +1,26 @@ +package com.gkhy.labRiskManage.domain.account.entity; + +import lombok.Data; + +import javax.persistence.*; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/27 + * @time: 16:09 + */ +@Data +@Entity +@Table(name = "sys_user_identity_bind") +public class SysUserIdentityBind { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private Long userId; + private Long userIdentityId; + + @OneToOne(targetEntity = UserIdentity.class,fetch = FetchType.EAGER) + @JoinColumn(name = "userIdentityId",referencedColumnName = "id",insertable =false ,updatable = false) + private UserIdentity userIdentity; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysUserRoleBind.java b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysUserRoleBind.java new file mode 100644 index 0000000..2c663a4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/SysUserRoleBind.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.domain.account.entity; + +import lombok.Data; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; + +import javax.persistence.*; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/9 + * @time: 15:43 + */ +@Data +@Entity +@Table(name = "sys_user_role_bind") +public class SysUserRoleBind { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private Long userId; + + private Long roleId; + + @OneToOne(targetEntity = Role.class,fetch = FetchType.EAGER) + @JoinColumn(name = "roleId",referencedColumnName = "id",insertable =false ,updatable = false) + private Role role; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/entity/User.java b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/User.java new file mode 100644 index 0000000..6ee1379 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/User.java @@ -0,0 +1,88 @@ +package com.gkhy.labRiskManage.domain.account.entity; + +import com.gkhy.labRiskManage.domain.attachment.entity.AttachmentInfo; +import lombok.Data; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; + +import javax.persistence.*; +import java.time.LocalDateTime; +import java.util.List; + +@Entity +//@JsonIgnoreProperties(value = { "hibernateLazyInitializer"}) +@Table(name = "sys_user") +//@Proxy(lazy = false) +@Data +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + //用户账号状态 + @Column + private Byte status; + + //部门ID + private Long depId; + + //创建时间 + @Column + private LocalDateTime gmtCreate; + + //修改时间 + @Column + private LocalDateTime gmtModified; + + @Column + private String name; + + @Column + private String salt; + + @Column + private String hash; + + //真实姓名 + @Column + private String realName; + + //手机号 + @Column + private String phone; + + //证件类型 + @Column + private Byte idType; + + //身份证号 + @Column + private String idSerial; + /** + * 身份(0专家,1非专家) + */ + private Byte identityStatus; + //资质证书id + private Long qualificationAttId; + + + @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @Fetch(FetchMode.SUBSELECT) + @JoinColumn(name = "userId",referencedColumnName = "id",insertable =false ,updatable = false) + private List<SysUserRoleBind> sysUserRoleBinds; + + @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @Fetch(FetchMode.SUBSELECT) + @JoinColumn(name = "userId",referencedColumnName = "id",insertable =false ,updatable = false) + private List<SysUserIdentityBind> sysUserIdentityBinds; + + @ManyToOne(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @JoinColumn(name = "depId",referencedColumnName = "id",insertable =false ,updatable = false) + private SysDepartment sysDepartment; + + @OneToOne(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @JoinColumn(name = "qualificationAttId",referencedColumnName = "id",insertable =false ,updatable = false) + private AttachmentInfo qualificationAttachment; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/entity/UserIdentity.java b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/UserIdentity.java new file mode 100644 index 0000000..807aba1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/entity/UserIdentity.java @@ -0,0 +1,24 @@ +package com.gkhy.labRiskManage.domain.account.entity; + +import lombok.Data; + +import javax.persistence.*; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/27 + * @time: 16:08 + */ +@Data +@Table(name = "user_identity") +@Entity +public class UserIdentity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private String identity; + private String info; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/enums/IdentityStatusEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/account/enums/IdentityStatusEnum.java new file mode 100644 index 0000000..cc4034d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/enums/IdentityStatusEnum.java @@ -0,0 +1,50 @@ +package com.gkhy.labRiskManage.domain.account.enums; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public enum IdentityStatusEnum { + EXPERT((byte)0,"专家"), + NOT_EXPERT((byte)1,"非专家") + ; + + private Byte status; + private String dec; + + IdentityStatusEnum(Byte status, String dec) { + this.status = status; + this.dec = dec; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, IdentityStatusEnum> map; + + static { + map = new HashMap<>(); + for(IdentityStatusEnum e : IdentityStatusEnum.values()){ + map.put(e.status,e); + } + } + + public static IdentityStatusEnum prase(Byte status){ + return map.get(status); + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/enums/UserIdTypeEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/account/enums/UserIdTypeEnum.java new file mode 100644 index 0000000..19bbed0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/enums/UserIdTypeEnum.java @@ -0,0 +1,54 @@ +package com.gkhy.labRiskManage.domain.account.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum UserIdTypeEnum { + TYPE_JUMIN_SHENFENZHENG((byte)1,"居民身份证"), + ; + + private Byte type; + private String dec; + + UserIdTypeEnum(Byte type, String dec) { + this.type = type; + this.dec = dec; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public static Map<Byte, UserIdTypeEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, UserIdTypeEnum> map) { + UserIdTypeEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, UserIdTypeEnum> map; + + static { + map = new HashMap<>(); + for(UserIdTypeEnum e : UserIdTypeEnum.values()){ + map.put(e.type,e); + } + } + + public static UserIdTypeEnum prase(Byte type){ + return map.get(type); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/enums/UserStatusEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/account/enums/UserStatusEnum.java new file mode 100644 index 0000000..e01250f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/enums/UserStatusEnum.java @@ -0,0 +1,57 @@ +package com.gkhy.labRiskManage.domain.account.enums; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public enum UserStatusEnum { + STATUS_ACTIVE((byte)1,"正常使用"), + STATUS_FROZEN((byte)2,"冻结"), + STATUS_DELETE((byte)3,"删除") + ; + + private Byte status; + private String dec; + + UserStatusEnum(Byte status, String dec) { + this.status = status; + this.dec = dec; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte,UserStatusEnum> map; + + static { + map = new HashMap<>(); + for(UserStatusEnum e : UserStatusEnum.values()){ + map.put(e.status,e); + } + } + + public static UserStatusEnum prase(Byte status){ + return map.get(status); + } + + public static List<Integer> getActiveUserStatus(){ + List<Integer> statusList = new ArrayList<>(); + statusList.add(1); + statusList.add(2); + return statusList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/CreateUserBO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/CreateUserBO.java new file mode 100644 index 0000000..5d83142 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/CreateUserBO.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.account.model.bo; + +import lombok.Data; + +@Data +public class CreateUserBO { + + private String name; + + private String realName; + + private String phone; + + private String pwd; + + private Byte idType; + + private String idSerial; + + private Long depId; + + private Byte identityStatus; + + private Long qualificationAttId; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/MenuItemBindRoleBO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/MenuItemBindRoleBO.java new file mode 100644 index 0000000..769215e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/MenuItemBindRoleBO.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.domain.account.model.bo; + +import java.util.List; + +public class MenuItemBindRoleBO { + + private Long menuItemId; + + private List<Long> bindRoleIdList; + + private List<Long> unbindRoleIdList; + + public Long getMenuItemId() { + return menuItemId; + } + + public void setMenuItemId(Long menuItemId) { + this.menuItemId = menuItemId; + } + + public List<Long> getBindRoleIdList() { + return bindRoleIdList; + } + + public void setBindRoleIdList(List<Long> bindRoleIdList) { + this.bindRoleIdList = bindRoleIdList; + } + + public List<Long> getUnbindRoleIdList() { + return unbindRoleIdList; + } + + public void setUnbindRoleIdList(List<Long> unbindRoleIdList) { + this.unbindRoleIdList = unbindRoleIdList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/RoleBindMenuItemBO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/RoleBindMenuItemBO.java new file mode 100644 index 0000000..98a9886 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/RoleBindMenuItemBO.java @@ -0,0 +1,36 @@ +package com.gkhy.labRiskManage.domain.account.model.bo; + +import java.util.List; + +public class RoleBindMenuItemBO { + + private Long roleId; + + private List<Long> bindMenuItemIdList; + + private List<Long> unbindMenuItemIdList; + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public List<Long> getBindMenuItemIdList() { + return bindMenuItemIdList; + } + + public void setBindMenuItemIdList(List<Long> bindMenuItemIdList) { + this.bindMenuItemIdList = bindMenuItemIdList; + } + + public List<Long> getUnbindMenuItemIdList() { + return unbindMenuItemIdList; + } + + public void setUnbindMenuItemIdList(List<Long> unbindMenuItemIdList) { + this.unbindMenuItemIdList = unbindMenuItemIdList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/SysDepartmentBO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/SysDepartmentBO.java new file mode 100644 index 0000000..17540ec --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/SysDepartmentBO.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.account.model.bo; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/7 + * @time: 17:31 + */ +@Data +public class SysDepartmentBO { + private Long id; + /** + * 部门 + */ + private String depName; + /** + * 等级 + */ + private Byte level; + /** + * 父级id + */ + private Long parentId; + /** + * 描述 + */ + private String info; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UpdateUserBO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UpdateUserBO.java new file mode 100644 index 0000000..485efbe --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UpdateUserBO.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.domain.account.model.bo; + +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateUserBO { + + private Long id; + + private String name; + + private String realName; + + private String phone; + + private Byte idType; + + private String idSerial; + + private Long depId; + + private Byte identityStatus; + + private List<Long> identityIds; + + private Long qualificationAttId; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UserBindRoleBO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UserBindRoleBO.java new file mode 100644 index 0000000..d12531a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/bo/UserBindRoleBO.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.domain.account.model.bo; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 9:10 + */ +@Data +public class UserBindRoleBO { + private Long userId; + private Long RoleId; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/RoleInfoDoaminDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/RoleInfoDoaminDTO.java new file mode 100644 index 0000000..8037f9c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/RoleInfoDoaminDTO.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.account.model.dto; + +public class RoleInfoDoaminDTO { + + 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/gkhy/labRiskManage/domain/account/model/dto/SysDepartmentDomainDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysDepartmentDomainDTO.java new file mode 100644 index 0000000..e47519c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysDepartmentDomainDTO.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.domain.account.model.dto; + + +import lombok.Data; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/9 + * @time: 8:59 + */ +@Data +public class SysDepartmentDomainDTO { + private Long id; + /** + * 部门 + */ + private String depName; + /** + * 等级 + */ + private Byte level; + /** + * 父级id + */ + private Long parentId; + /** + * 描述 + */ + private String info; + + private List<SysDepartmentDomainDTO> children; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysUserIdentityBindDomainDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysUserIdentityBindDomainDTO.java new file mode 100644 index 0000000..e2e00e9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysUserIdentityBindDomainDTO.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.domain.account.model.dto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/4 + * @time: 10:45 + */ +@Data +public class SysUserIdentityBindDomainDTO { + private Long userIdentityId; + private String userIdentity; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysUserRoleBindDomainDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysUserRoleBindDomainDTO.java new file mode 100644 index 0000000..0fa5be5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/SysUserRoleBindDomainDTO.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.account.model.dto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 10:35 + */ +@Data +public class SysUserRoleBindDomainDTO { + private Long id; + private Long userId; + private Long roleId; + private String roleName; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/UserIdentityDomainDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/UserIdentityDomainDTO.java new file mode 100644 index 0000000..3dcbd67 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/UserIdentityDomainDTO.java @@ -0,0 +1,19 @@ +package com.gkhy.labRiskManage.domain.account.model.dto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/28 + * @time: 16:57 + */ +@Data +public class UserIdentityDomainDTO { + + private Long id; + private String identity; + private String info; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/UserInfoDomainDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/UserInfoDomainDTO.java new file mode 100644 index 0000000..2ceeff6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/model/dto/UserInfoDomainDTO.java @@ -0,0 +1,55 @@ +package com.gkhy.labRiskManage.domain.account.model.dto; + +import com.gkhy.labRiskManage.domain.attachment.dto.resp.AttachmentDomainDTO; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; +@Data +public class UserInfoDomainDTO { + + private Long id; + + //用户账号状态 + private Byte status; + + //创建时间 + private LocalDateTime gmtCreate; + + //修改时间 + private LocalDateTime gmtModified; + + //登录用户名 + private String name; + + private String salt; + + private String hash; + + //真实姓名 + private String realName; + + private String phone; + + private Byte idType; + + private String idSerial; + + private Long depId; + + private String depName; + + /** + * 身份(0专家,1非专家) + */ + private Byte identityStatus; + //资质证书id + private Long qualificationAttId; + + private List<SysUserRoleBindDomainDTO> roles; + + private List<SysUserIdentityBindDomainDTO> userIdentities; + + //资质附件 + private AttachmentDomainDTO qualificationAttDomainDTO; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/RoleMenuBindRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/RoleMenuBindRepository.java new file mode 100644 index 0000000..95d42d9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/RoleMenuBindRepository.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.account.repository.jpa; + +import com.gkhy.labRiskManage.domain.account.entity.RoleMenuBind; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface RoleMenuBindRepository extends JpaRepository<RoleMenuBind,Long> { + + List<RoleMenuBind> findAllByRoleIdAndMenuItemIdIn(Long roleId,List<Long> menuItemIds); + + List<RoleMenuBind> findAllByMenuItemIdAndRoleIdIn(Long menuItemId,List<Long> roleIds); + + List<RoleMenuBind> findAllByRoleId(Long roleId); + + @Query(value = "select rb.roleId from RoleMenuBind rb where rb.menuItemId = :menuItemId") + List<Long> findBindRoleListByMenuItemId(Long menuItemId); + + @Modifying + Integer deleteByMenuItemId(Long menuItemId); + + @Modifying + Integer deleteByMenuItemIdAndRoleIdIn(Long menuItemId,List<Long> roleIds); + + List<RoleMenuBind> findAllByRoleIdIn(List<Long> roleIds); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/RoleRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/RoleRepository.java new file mode 100644 index 0000000..020c673 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/RoleRepository.java @@ -0,0 +1,35 @@ +package com.gkhy.labRiskManage.domain.account.repository.jpa; + +import com.gkhy.labRiskManage.domain.account.entity.Role; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Repository +public interface RoleRepository extends JpaRepository<Role, Long> { + + @Query(value = "select r from Role r where r.name = :name and r.delFlag = 0") + Role findRoleByName(String name); + + List<Role> findAllByDelFlag(Byte delFlag); + + @Query(value = "update Role r set r.delFlag = 1 where r.id = :roleId") + @Transactional + @Modifying + Integer deleteRole(Long roleId); + + List<Role> findAllByIdIn(List<Long> idList); + + @Query(value = "update Role r set r.name = :name where r.id = :roleId") + @Transactional + @Modifying + Integer updateRoleName(Long roleId,String name); + @Query(value = "select r from Role r where r.id in (:idList) and r.delFlag = 0") + List<Role> findAllByIdInAndDelFlag(List<Long> idList); + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/SysDeparmentRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/SysDeparmentRepository.java new file mode 100644 index 0000000..a60909b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/SysDeparmentRepository.java @@ -0,0 +1,29 @@ +package com.gkhy.labRiskManage.domain.account.repository.jpa; + +import com.gkhy.labRiskManage.domain.account.entity.SysDepartment; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/8 + * @time: 9:24 + */ +public interface SysDeparmentRepository extends JpaRepository<SysDepartment, Long> { + + @Query(value = "select s from SysDepartment s where s.id = :id and s.deleteStatus = 0") + SysDepartment findByIdAndDeleteStatus(Long id); + /** + * 根据父部门获取子部门 + */ + @Query(value = "select s from SysDepartment s where s.parentId = :parentId and s.deleteStatus = 0") + List<SysDepartment> findByParentIdAndDeleteStatus(Long parentId); + /** + * 获取所有部门 + */ + @Query(value = "select s from SysDepartment s where s.deleteStatus = 0") + List<SysDepartment> findByDeleteStatus(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/SysUserIdentityBindReposity.java b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/SysUserIdentityBindReposity.java new file mode 100644 index 0000000..8697549 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/SysUserIdentityBindReposity.java @@ -0,0 +1,28 @@ +package com.gkhy.labRiskManage.domain.account.repository.jpa; + +import com.gkhy.labRiskManage.domain.account.entity.SysUserIdentityBind; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/28 + * @time: 17:07 + */ +@Repository +public interface SysUserIdentityBindReposity extends JpaRepository<SysUserIdentityBind, Long> { + @Query(value = "select s.userIdentityId from SysUserIdentityBind s where s.userId = :userId") + List<Long> getByUserId(Long userId); + @Modifying + @Query(value = "delete from SysUserIdentityBind s where s.userId = :userId and s.userIdentityId in (:deleteUserIdentityIdList)") + int deleteByUserIdAndUserIdentityIds(Long userId, List<Long> deleteUserIdentityIdList); + + @Modifying + @Query(value = "delete from SysUserIdentityBind s where s.userId = :userId") + int deleteByUserId(Long userId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserIdentityRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserIdentityRepository.java new file mode 100644 index 0000000..c4596b5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserIdentityRepository.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.domain.account.repository.jpa; + +import com.gkhy.labRiskManage.domain.account.entity.UserIdentity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/28 + * @time: 16:52 + */ +@Repository +public interface UserIdentityRepository extends JpaRepository<UserIdentity, Long> { +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserRepository.java new file mode 100644 index 0000000..e79f02c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserRepository.java @@ -0,0 +1,58 @@ +package com.gkhy.labRiskManage.domain.account.repository.jpa; + +import com.gkhy.labRiskManage.domain.account.entity.User; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.List; + +@Repository +public interface UserRepository extends JpaRepository<User,Long> , JpaSpecificationExecutor<User> { + + @Query(value = "select u from User u where u.name = :name and u.status in (1,2)") + User findUserByName(String name); + + List<User> findAllByIdIn(List<Long> userIdList); + + @Modifying + @Query(value = "update User u set u.hash = :hash ,u.salt = :salt ,u.gmtModified = :time where u.id = :uid") + Integer updatePassword(Long uid, String hash, String salt, LocalDateTime time); + + @Modifying + @Query(value = "update User u set u.status = :status ,u.gmtModified = :time where u.id = :uid") + Integer updateUserStatus(Long uid,Byte status,LocalDateTime time); + + /*@Modifying + @Query(value = "update User u set u.roleId = :roleId ,u.gmtModified = :time where u.id = :uid") + Integer updateUserRole(Long uid,Long roleId,LocalDateTime time);*/ + + @Query(value = "select u from User u where u.phone = :phone and u.status in (1,2)") + User findUserByPhone(String phone); + + @Query(value = "select u from User u where u.idType = :idType and u.idSerial = :idSerial and u.status in (1,2)") + User findByIdTypeAndIdSerial(Byte idType,String idSerial); + + @Query("update User u set u.phone = :phone where u.id = :uid") + @Modifying + Integer updateUserPhone(Long uid,String phone); + /** + * 用户列表 + */ + @Query(value = "select * from sys_user where status in (1,2)", nativeQuery = true) + List<User> getUserList(); + + @Query(value = "select u from User u where u.realName like %:name% and u.status in (1,2)") + List<User> getUsersByRealName(String name); + + /** + * 用户列表 + */ + @Query(value = "select * from sys_user where id = :evaluateUserId and status in (1,2)", nativeQuery = true) + User getUserInfoByIdAndSellInfo(Long evaluateUserId); + @Query(value = "select u from User u where u.id = :uid and u.status in (1,2)") + User getById(Long uid); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserRoleBindReposity.java b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserRoleBindReposity.java new file mode 100644 index 0000000..f9bdce3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/repository/jpa/UserRoleBindReposity.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.account.repository.jpa; + +import com.gkhy.labRiskManage.domain.account.entity.SysUserRoleBind; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 9:48 + */ +public interface UserRoleBindReposity extends JpaRepository<SysUserRoleBind, Long> { + + List<SysUserRoleBind> findByUserId(Long userId); + + @Query(value = "select s.roleId from SysUserRoleBind s where s.userId = :userId") + List<Long> getByUserId(Long userId); + + @Modifying + @Query(value = "delete from SysUserRoleBind s where s.userId = :userId and s.roleId in (:roleIds)") + int deleteByUserIdAndRoleIds(Long userId,List<Long> roleIds); + + @Modifying + @Query(value = "delete from SysUserRoleBind s where s.userId = :userId") + int deleteByUserId(Long userId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/RoleDomainService.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/RoleDomainService.java new file mode 100644 index 0000000..6771a07 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/RoleDomainService.java @@ -0,0 +1,33 @@ +package com.gkhy.labRiskManage.domain.account.service; + +import com.gkhy.labRiskManage.domain.account.entity.Role; +import com.gkhy.labRiskManage.domain.account.model.dto.RoleInfoDoaminDTO; + +import java.util.List; + +public interface RoleDomainService { + + RoleInfoDoaminDTO createNewRole(String roleName); + + RoleInfoDoaminDTO findRoleByName(String roleName); + + RoleInfoDoaminDTO findRoleById(Long roleId); + + List<RoleInfoDoaminDTO> findAllActiveRoleList(); + + List<RoleInfoDoaminDTO> findAllDeleteRoleList(); + + boolean deleteRole(Long roleId); + + /** + * 变更用户角色 + * @param uid + * @param roleId + * @return + */ + boolean updateUserRole(Long uid,Long roleId); + + boolean updateRoleName(Long roleId,String name); + + List<RoleInfoDoaminDTO> findAllByIdIn(List<Long> idList); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/RoleMenuDomainService.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/RoleMenuDomainService.java new file mode 100644 index 0000000..0898848 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/RoleMenuDomainService.java @@ -0,0 +1,18 @@ +package com.gkhy.labRiskManage.domain.account.service; + +import com.gkhy.labRiskManage.domain.account.model.bo.MenuItemBindRoleBO; +import com.gkhy.labRiskManage.domain.account.model.bo.RoleBindMenuItemBO; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; + +import java.util.List; + +public interface RoleMenuDomainService { + + boolean roleBindMenu(RoleBindMenuItemBO bindBO); + + boolean menuBindRole(MenuItemBindRoleBO bindBO); + + List<MenuItemDomainDTO> getMenuInfoByRole(List<Long> roleIds); + + List<Long> getBindRolesByMenuItemId(Long menuItemId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/SysDepartmentDomainService.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/SysDepartmentDomainService.java new file mode 100644 index 0000000..0dbc816 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/SysDepartmentDomainService.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.account.service; + +import com.gkhy.labRiskManage.application.account.dto.respDto.SysDepartmentAppDTO; +import com.gkhy.labRiskManage.domain.account.model.bo.SysDepartmentBO; +import com.gkhy.labRiskManage.domain.account.model.dto.SysDepartmentDomainDTO; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/7 + * @time: 17:17 + */ +public interface SysDepartmentDomainService { + SysDepartmentDomainDTO save(SysDepartmentBO sysDepartmentBO,Long currentUserId); + SysDepartmentDomainDTO update(SysDepartmentBO sysDepartmentBO,Long currentUserId); + + SysDepartmentDomainDTO delete(Long id, Long currentUserId); + + List<SysDepartmentDomainDTO> list(); + + SysDepartmentDomainDTO findById(Long id); + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/SysUserIdentityBindDomainService.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/SysUserIdentityBindDomainService.java new file mode 100644 index 0000000..46c13a4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/SysUserIdentityBindDomainService.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.account.service; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/28 + * @time: 16:39 + */ +public interface SysUserIdentityBindDomainService { + boolean insertBatchUserIndentityBind(List<Long> identityIds, Long userId); + + boolean updateBatchUserIndentityBind(List<Long> identityIds, Long userId); + + boolean deleteByUser(Long userId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/UserDomainService.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/UserDomainService.java new file mode 100644 index 0000000..f1c9c9e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/UserDomainService.java @@ -0,0 +1,136 @@ +package com.gkhy.labRiskManage.domain.account.service; + +import com.gkhy.labRiskManage.api.controller.account.query.UserQuery; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.domain.account.model.bo.CreateUserBO; +import com.gkhy.labRiskManage.domain.account.model.bo.UpdateUserBO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; + +import java.util.List; + +public interface UserDomainService { + + /** + * 新增用户信息 + * @param createUserBO + * @return + */ + UserInfoDomainDTO newUser(CreateUserBO createUserBO); + + /** + * 更新用户信息 + * @param updateUserBO + * @return + */ + UserInfoDomainDTO updateUserInfo(UpdateUserBO updateUserBO); + + /** + * 根据用户ID获取用户信息 + * @param uid + * @return + */ + UserInfoDomainDTO getUserInfoById(Long uid); + + /** + * 根据用户名获取用户信息 + * @param name + * @return + */ + UserInfoDomainDTO getUserInfoByName(String name); + + List<UserInfoDomainDTO> findUserListByRealName(String name); + + SearchResult<List<UserInfoDomainDTO>> findUserListByRole(Long roleId, boolean usePage, Integer page, + Integer pageSize); + + /** + * 根据用户ID列表批量获取用户信息 + * @param uidList + * @return + */ + List<UserInfoDomainDTO> getUserInfoListByIds(List<Long> uidList); + + /** + * 更新用户密码 + * @param uid + * @param oldPwd + * @param newPwd + * @return + */ + boolean updateUserPwd(Long uid,String oldPwd,String newPwd); + + /** + * 变更账号状态 + * @param uid + * @param status + * @return + */ + boolean updateUserStatus(Long uid,Byte status); + + boolean updateUserRole(Long uid,Long roleId); + + /** + * 校验密码 + * @param pwd + * @param hash + * @param salt + * @return + */ + boolean checkPassword(String pwd,String hash,String salt); + + /** + * 手机号查找用户 + * @param phoneNumber + * @return + */ + UserInfoDomainDTO findUserByPhone(String phoneNumber); + + /** + * 证件号查找用户 + * @param idType + * @param idSerial + * @return + */ + UserInfoDomainDTO findUserByIdSerial(Byte idType, String idSerial); + + /** + * 修改手机号 + * @param uid + * @param phoneNumber + * @return + */ + boolean updateUserPhoneNumber(Long uid,String phoneNumber); + + /** + * 删除用户 + * @param uid + * @return + */ + boolean deleteUser(Long uid); + + UserInfoDomainDTO getUserById(Long id); + /** + * 用户列表 + */ + List<UserInfoDomainDTO> getUserList(); + + /** + * 用户查询 + */ + UserInfoDomainDTO getUserInfoByIdAndSellInfo(Long evaluateUserId, String info); + + /** + * 用户列表 + * @param pageQuery + * @return + */ + SearchResult<List<UserInfoDomainDTO>> findUserList(PageQuery<UserQuery> pageQuery); + + /** + * 专家库 + * @param pageQuery + * @return + */ + SearchResult<List<UserInfoDomainDTO>> findExpertList(PageQuery<UserQuery> pageQuery); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/UserIdentityDomainService.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/UserIdentityDomainService.java new file mode 100644 index 0000000..3a03fea --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/UserIdentityDomainService.java @@ -0,0 +1,18 @@ +package com.gkhy.labRiskManage.domain.account.service; + +import com.gkhy.labRiskManage.domain.account.entity.UserIdentity; +import com.gkhy.labRiskManage.domain.account.model.dto.UserIdentityDomainDTO; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/28 + * @time: 16:29 + */ +public interface UserIdentityDomainService { + List<UserIdentityDomainDTO> getListByIds(List<Long> identityIds); + + List<UserIdentityDomainDTO> getList(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/UserRoleDomainService.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/UserRoleDomainService.java new file mode 100644 index 0000000..b690c69 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/UserRoleDomainService.java @@ -0,0 +1,21 @@ +package com.gkhy.labRiskManage.domain.account.service; + +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 9:25 + */ +public interface UserRoleDomainService { + List<SysUserRoleBindDomainDTO> insertBatchUserBindRole(List<Long> roleIds, Long id); + + void updateUserRole(Long userId, List<Long> roleIds); + + boolean deleteByUser(Long userId); + + //List<SysUserRoleBindDomainDTO> getUserRoleBind(Long userId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/RoleDomainServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/RoleDomainServiceImpl.java new file mode 100644 index 0000000..9efbc08 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/RoleDomainServiceImpl.java @@ -0,0 +1,148 @@ +package com.gkhy.labRiskManage.domain.account.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.account.converter.RoleInfoConverter; +import com.gkhy.labRiskManage.domain.account.entity.Role; +import com.gkhy.labRiskManage.domain.account.model.dto.RoleInfoDoaminDTO; +import com.gkhy.labRiskManage.domain.account.repository.jpa.RoleRepository; +import com.gkhy.labRiskManage.domain.account.service.RoleDomainService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +@Repository +public class RoleDomainServiceImpl implements RoleDomainService { + + @Autowired + private RoleRepository roleRepository; + + @Autowired + private RoleInfoConverter roleInfoConverter; + + @Override + @Transactional + public RoleInfoDoaminDTO createNewRole(String roleName) { + if(roleName == null || roleName.isEmpty()) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数缺失"); + Role role = roleRepository.findRoleByName(roleName); + if(role != null) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(),"角色名已经被使用"); + role = new Role(); + role.setName(roleName); + role.setDelFlag((byte)0); + role.setGmtCreate(LocalDateTime.now()); + role.setGmtModified(role.getGmtCreate()); + role = roleRepository.save(role); + if(role == null) + return null; + RoleInfoDoaminDTO roleInfoDoaminDTO = roleInfoConverter.roleRoleInfoDTO(role); + return roleInfoDoaminDTO; + } + + @Override + public RoleInfoDoaminDTO findRoleByName(String roleName) { + Role role = roleRepository.findRoleByName(roleName); + if(role == null) + return null; + RoleInfoDoaminDTO roleInfoDoaminDTO = roleInfoConverter.roleRoleInfoDTO(role); + return roleInfoDoaminDTO; + } + + @Override + public RoleInfoDoaminDTO findRoleById(Long roleId) { + if(roleId == null || roleId < 1) + return null; + Optional<Role> roleOptional = roleRepository.findById(roleId); + if(!roleOptional.isPresent()) + return null; + RoleInfoDoaminDTO roleInfoDoaminDTO = roleInfoConverter.roleRoleInfoDTO(roleOptional.get()); + return roleInfoDoaminDTO; + } + + @Override + public List<RoleInfoDoaminDTO> findAllActiveRoleList() { + List<Role> roleList = roleRepository.findAllByDelFlag((byte)0); + if(roleList == null || roleList.isEmpty()) + return null; + List<RoleInfoDoaminDTO> dtoList = new ArrayList<>(); + for (Role role : roleList){ + RoleInfoDoaminDTO dto = roleInfoConverter.roleRoleInfoDTO(role); + dtoList.add(dto); + } + return dtoList; + } + + @Override + public List<RoleInfoDoaminDTO> findAllDeleteRoleList() { + List<Role> roleList = roleRepository.findAllByDelFlag((byte)1); + if(roleList == null || roleList.isEmpty()) + return null; + List<RoleInfoDoaminDTO> dtoList = new ArrayList<>(); + for (Role role : roleList){ + RoleInfoDoaminDTO dto = roleInfoConverter.roleRoleInfoDTO(role); + dtoList.add(dto); + } + return dtoList; + } + + @Override + @Transactional + public boolean deleteRole(Long roleId) { + if(roleId == null || roleId < 1) + return false; + if(roleRepository.deleteRole(roleId) == 1) + return true; + return false; + } + + @Override + @Transactional + public boolean updateUserRole(Long uid, Long roleId) { + return false; + } + + @Override + @Transactional + public boolean updateRoleName(Long roleId, String name) { + if(roleId == null || name == null || name.isEmpty()) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数缺失"); + Optional<Role> roleOptional = roleRepository.findById(roleId); + if(!roleOptional.isPresent()){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(),"角色不存在"); + } + Role oldRole = roleOptional.get(); + if(oldRole.getName() != null && !oldRole.getName().isEmpty() && oldRole.getName().equals(name)){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(),"角色名称未发生变化"); + } + Integer count = roleRepository.updateRoleName(roleId,name); + if(count == 1) + return true; + else + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"数据库出错"); + } + + //根据ids获取角色 + @Override + public List<RoleInfoDoaminDTO> findAllByIdIn(List<Long> idList){ + if(ObjectUtil.isEmpty(idList)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数缺失"); + } + List<Role> roles = roleRepository.findAllByIdInAndDelFlag(idList); + List<RoleInfoDoaminDTO> roleInfoDoaminDTOS = new ArrayList<>(); + for (Role role:roles){ + RoleInfoDoaminDTO roleInfoDoaminDTO = new RoleInfoDoaminDTO(); + roleInfoDoaminDTO.setId(role.getId()); + roleInfoDoaminDTO.setName(role.getName()); + roleInfoDoaminDTOS.add(roleInfoDoaminDTO); + } + return roleInfoDoaminDTOS; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/RoleMenuDomainServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/RoleMenuDomainServiceImpl.java new file mode 100644 index 0000000..cfbb085 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/RoleMenuDomainServiceImpl.java @@ -0,0 +1,151 @@ +package com.gkhy.labRiskManage.domain.account.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.account.entity.Role; +import com.gkhy.labRiskManage.domain.account.entity.RoleMenuBind; +import com.gkhy.labRiskManage.domain.account.model.bo.MenuItemBindRoleBO; +import com.gkhy.labRiskManage.domain.account.model.bo.RoleBindMenuItemBO; +import com.gkhy.labRiskManage.domain.account.repository.jpa.RoleMenuBindRepository; +import com.gkhy.labRiskManage.domain.account.repository.jpa.RoleRepository; +import com.gkhy.labRiskManage.domain.account.service.RoleMenuDomainService; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; +import com.gkhy.labRiskManage.domain.sysAdmin.service.MenuDomainService; +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.ArrayList; +import java.util.List; +import java.util.Optional; + +@Service +public class RoleMenuDomainServiceImpl implements RoleMenuDomainService { + + @Autowired + private RoleMenuBindRepository roleMenuBindRepository; + + @Autowired + private RoleRepository roleRepository; + @Autowired + private MenuDomainService menuDomainService; + @Override + @Transactional + public boolean roleBindMenu(RoleBindMenuItemBO bindBO) { + if(bindBO == null || bindBO.getRoleId() == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + //校验角色 + Optional<Role> roleOptional = roleRepository.findById(bindBO.getRoleId()); + if(!roleOptional.isPresent()) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(),"角色不存在"); + if(bindBO.getUnbindMenuItemIdList() != null && bindBO.getUnbindMenuItemIdList().size() > 0){ + //解绑菜单关联 + //1、检查绑定状态 + List<RoleMenuBind> unbindCheckList = + roleMenuBindRepository.findAllByRoleIdAndMenuItemIdIn(bindBO.getRoleId(), + bindBO.getUnbindMenuItemIdList()); + if(unbindCheckList == null || unbindCheckList.size() != bindBO.getUnbindMenuItemIdList().size()) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), "角色未拥有该菜单项访问权限"); + try { + roleMenuBindRepository.deleteAllByIdInBatch(bindBO.getUnbindMenuItemIdList()); + } catch (Exception e) { + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(), "解除角色菜单项出错"); + } + } + if(bindBO.getBindMenuItemIdList() != null && bindBO.getBindMenuItemIdList().size() > 0){ + //增加菜单关联 + //1、检查绑定状态 + List<RoleMenuBind> bindCheckList = + roleMenuBindRepository.findAllByRoleIdAndMenuItemIdIn(bindBO.getRoleId(), + bindBO.getBindMenuItemIdList()); + if(bindCheckList != null && bindCheckList.size() > 0) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "角色已拥有菜单权限"); + //2、校验菜单 + List<MenuItemDomainDTO> checkBindMenuItems = menuDomainService.getActiveMenuItemListByIds(bindBO.getBindMenuItemIdList()); + if(checkBindMenuItems == null || checkBindMenuItems.size() != bindBO.getBindMenuItemIdList().size()){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), "菜单项不存在"); + } + //3、添加角色菜单项绑定 + List<RoleMenuBind> bindList = new ArrayList<>(); + checkBindMenuItems.forEach(item -> { + RoleMenuBind b = new RoleMenuBind(); + b.setRoleId(bindBO.getRoleId()); + b.setMenuItemId(item.getId()); + b.setGmtCreate(LocalDateTime.now()); + b.setGmtModified(b.getGmtCreate()); + bindList.add(b); + }); + List<RoleMenuBind> saveRs = roleMenuBindRepository.saveAll(bindList); + if(saveRs.size() != bindList.size()) + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"保存出错"); + } + return true; + } + + @Override + @Transactional + public boolean menuBindRole(MenuItemBindRoleBO bindBO) { + if(bindBO == null || bindBO.getMenuItemId() == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + //1、校验菜单 + MenuItemDomainDTO menuItemDomainDTO = menuDomainService.getMenuItemById(bindBO.getMenuItemId()); + if(menuItemDomainDTO == null) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(),"菜单项不存在"); + //2、校验绑定角色 + if(bindBO.getBindRoleIdList() != null && !bindBO.getBindRoleIdList().isEmpty()){ + List<Role> roleList = roleRepository.findAllByIdIn(bindBO.getBindRoleIdList()); + if(roleList == null || roleList.isEmpty() || roleList.size() != bindBO.getBindRoleIdList().size()){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), "角色不存在"); + } + //绑定角色菜单 + List<RoleMenuBind> bindList = new ArrayList<>(); + roleList.forEach(r -> { + RoleMenuBind bind = new RoleMenuBind(); + bind.setRoleId(r.getId()); + bind.setMenuItemId(bindBO.getMenuItemId()); + bind.setGmtCreate(LocalDateTime.now()); + bind.setGmtModified(bind.getGmtCreate()); + bindList.add(bind); + }); + List<RoleMenuBind> saveRs = roleMenuBindRepository.saveAll(bindList); + if(saveRs == null || saveRs.isEmpty() || saveRs.size() != bindList.size()){ + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"数据库错误"); + } + } + //3、校验解绑角色 + if(bindBO.getUnbindRoleIdList() != null && !bindBO.getUnbindRoleIdList().isEmpty()){ + //解绑角色菜单 + List<RoleMenuBind> bindList = roleMenuBindRepository.findAllByMenuItemIdAndRoleIdIn(bindBO.getMenuItemId(), bindBO.getUnbindRoleIdList()); + if(bindList != null && !bindList.isEmpty()){ + roleMenuBindRepository.deleteAll(bindList); + } + } + return true; + } + + @Override + public List<MenuItemDomainDTO> getMenuInfoByRole(List<Long> roleIds) { + if(ObjectUtil.isEmpty(roleIds)) + return null; + List<RoleMenuBind> bindList = roleMenuBindRepository.findAllByRoleIdIn(roleIds); + if(bindList == null || bindList.isEmpty()) + return null; + List<Long> menuItemIdList = new ArrayList<>(); + bindList.forEach(b -> { + menuItemIdList.add(b.getMenuItemId()); + }); +// List<MenuItemDTO> menuItemList = menuDomainService.getActiveMenuItemListByIds(menuItemIdList); + List<MenuItemDomainDTO> menuItemList = menuDomainService.getActiveMenuItemListTreeByIds(menuItemIdList); + return menuItemList; + } + + @Override + public List<Long> getBindRolesByMenuItemId(Long menuItemId) { + if(menuItemId == null || menuItemId < 1) + return null; + List<Long> bindRoles = roleMenuBindRepository.findBindRoleListByMenuItemId(menuItemId); + return bindRoles; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/SysDepartmentDomainServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/SysDepartmentDomainServiceImpl.java new file mode 100644 index 0000000..c5d3807 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/SysDepartmentDomainServiceImpl.java @@ -0,0 +1,166 @@ +package com.gkhy.labRiskManage.domain.account.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.account.converter.SysDeparmentConverter; +import com.gkhy.labRiskManage.domain.account.entity.SysDepartment; +import com.gkhy.labRiskManage.domain.account.model.bo.SysDepartmentBO; +import com.gkhy.labRiskManage.domain.account.model.dto.SysDepartmentDomainDTO; +import com.gkhy.labRiskManage.domain.account.repository.jpa.SysDeparmentRepository; +import com.gkhy.labRiskManage.domain.account.service.SysDepartmentDomainService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/7 + * @time: 17:18 + */ +@Service +public class SysDepartmentDomainServiceImpl implements SysDepartmentDomainService { + + @Autowired + private SysDeparmentRepository repository; + + @Autowired + private SysDeparmentConverter converter; + + @Override + public SysDepartmentDomainDTO save(SysDepartmentBO sysDepartmentBO,Long currentUserId) { + if (ObjectUtil.isEmpty(sysDepartmentBO.getDepName())) { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(),"请填写部门名称"); + } + byte depLevel = 0; + if(ObjectUtil.isEmpty(sysDepartmentBO.getParentId())){ + depLevel = 1; + } + if (!ObjectUtil.isEmpty(sysDepartmentBO.getParentId())) { + //验证父级部门 + SysDepartment parentDep = repository.findByIdAndDeleteStatus(sysDepartmentBO.getParentId()); + if(ObjectUtil.isEmpty(parentDep)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(),"父级部门不存在!"); + } + depLevel = (byte)(parentDep.getLevel()+1); + } + + //复制 + SysDepartment sysDepartment = new SysDepartment(); + BeanUtils.copyProperties(sysDepartmentBO,sysDepartment); + sysDepartment.setDeleteStatus((byte)0); + sysDepartment.setLevel(depLevel); + sysDepartment.setCreateByUserId(currentUserId); + sysDepartment.setUpdateByUserId(currentUserId); + SysDepartmentDomainDTO sysDepartmentDomainDTO = converter.sysDepDomainDTOConverter(repository.save(sysDepartment)); + + return sysDepartmentDomainDTO; + } + + @Override + public SysDepartmentDomainDTO update(SysDepartmentBO sysDepartmentBO,Long currentUserId) { + if (ObjectUtil.isEmpty(sysDepartmentBO.getId())) { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(),"主键不可为空!"); + } + if (ObjectUtil.isEmpty(sysDepartmentBO.getDepName())) { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(),"请填写部门名称"); + } + SysDepartment sysDepartment = repository.findByIdAndDeleteStatus(sysDepartmentBO.getId()); + if(sysDepartment == null){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(),"该部门不存在,不可修改!"); + } + + //复制 + sysDepartment.setDepName(sysDepartmentBO.getDepName()); + sysDepartment.setUpdateByUserId(currentUserId); + sysDepartment.setInfo(sysDepartmentBO.getInfo()); + SysDepartmentDomainDTO sysDepartmentDomainDTO = converter.sysDepDomainDTOConverter(repository.save(sysDepartment)); + return sysDepartmentDomainDTO; + } + + @Override + public SysDepartmentDomainDTO delete(Long id, Long currentUserId) { + SysDepartment sysDepartment = repository.findByIdAndDeleteStatus(id); + if(sysDepartment == null){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(),"该部门不存在,不可修改!"); + } + //验证该部门下子部门 + if (!checkDepChildren(id)) { + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(),"该部门存在子部门,请先删除子部门!"); + } + sysDepartment.setDeleteStatus((byte)1); + SysDepartmentDomainDTO sysDepartmentDomainDTO = converter.sysDepDomainDTOConverter(repository.save(sysDepartment)); + return sysDepartmentDomainDTO; + } + @Override + public SysDepartmentDomainDTO findById(Long id){ + if(ObjectUtil.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(),"主键不可为空!"); + } + SysDepartment sysDepartment = repository.findByIdAndDeleteStatus(id); + SysDepartmentDomainDTO sysDepartmentDomainDTO = converter.sysDepDomainDTOConverter(sysDepartment); + return sysDepartmentDomainDTO; + } + + + @Override + public List<SysDepartmentDomainDTO> list() { + List<SysDepartment> list = repository.findByDeleteStatus(); + List<SysDepartment> parentList = list.stream().filter(item -> item.getParentId() == null).collect(Collectors.toList()); + List<SysDepartment> childList = list.stream().filter(item -> item.getParentId() != null).collect(Collectors.toList()); + List<SysDepartmentDomainDTO> departmentDomainDTOList = new ArrayList<>(); + if(parentList.size() > 0){ + for(SysDepartment sysDepartment : parentList){ + SysDepartmentDomainDTO sysDepartmentDomainDTO = converter.sysDepDomainDTOConverter(sysDepartment); + sysDepartmentDomainDTO.setChildren(recursion(sysDepartmentDomainDTO.getId(), childList)); + departmentDomainDTOList.add(sysDepartmentDomainDTO); + } + } + return departmentDomainDTOList; + } + private List<SysDepartmentDomainDTO> recursion(Long parentId,List<SysDepartment> list){ + List<SysDepartment> childList = list.stream().filter(item -> item.getParentId().equals(parentId)).collect(Collectors.toList()); + List<SysDepartmentDomainDTO> departmentDomainDTOList = new ArrayList<>(); + if(childList.size() > 0){ + for(SysDepartment sysDepartment : childList){ + SysDepartmentDomainDTO sysDepartmentDomainDTO = converter.sysDepDomainDTOConverter(sysDepartment); + sysDepartmentDomainDTO.setChildren(recursion(sysDepartmentDomainDTO.getId(), list)); + departmentDomainDTOList.add(sysDepartmentDomainDTO); + } + } + return departmentDomainDTOList; + } + + + + //验证部门 + private boolean checkDep(Long id){ + if(ObjectUtil.isEmpty(id)){ + return false; + } + SysDepartment dep = repository.findByIdAndDeleteStatus(id); + if(ObjectUtil.isEmpty(dep)){ + return false; + } + return true; + } + //验证部门是否存在子部门 + private boolean checkDepChildren(Long parentId){ + if (ObjectUtil.isEmpty(parentId)) { + return false; + } + List<SysDepartment> list = repository.findByParentIdAndDeleteStatus(parentId); + if(!CollectionUtils.isEmpty(list)){ + return false; + } + return true; + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/SysUserIdentityBindDomainServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/SysUserIdentityBindDomainServiceImpl.java new file mode 100644 index 0000000..054f410 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/SysUserIdentityBindDomainServiceImpl.java @@ -0,0 +1,116 @@ +package com.gkhy.labRiskManage.domain.account.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.account.entity.SysUserIdentityBind; +import com.gkhy.labRiskManage.domain.account.entity.SysUserRoleBind; +import com.gkhy.labRiskManage.domain.account.model.dto.UserIdentityDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.repository.jpa.SysUserIdentityBindReposity; +import com.gkhy.labRiskManage.domain.account.service.SysUserIdentityBindDomainService; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.account.service.UserIdentityDomainService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/28 + * @time: 16:40 + */ +@Service +public class SysUserIdentityBindDomainServiceImpl implements SysUserIdentityBindDomainService { + @Autowired + private UserIdentityDomainService userIdentityDomainService; + @Autowired + private UserDomainService userDomainService; + + @Autowired + private SysUserIdentityBindReposity sysUserIdentityBindReposity; + + @Override + public boolean insertBatchUserIndentityBind(List<Long> identityIds, Long userId) { + if(CollectionUtils.isEmpty(identityIds) || userId == null){ + return false; + } + //验证用户 + UserInfoDomainDTO user = userDomainService.getUserInfoById(userId); + if(ObjectUtil.isEmpty(user)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "用户不存在"); + } + //验证身份是否都存在 + List<UserIdentityDomainDTO> userIdentityDomainDTOList = userIdentityDomainService.getListByIds(identityIds); + for(Long identityId : identityIds){ + List<UserIdentityDomainDTO> collect = userIdentityDomainDTOList.stream().filter(identity -> identity.getId().equals(identityId)).collect(Collectors.toList()); + if(collect.size() == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "身份不存在"); + } + } + //绑定用户身份 + List<SysUserIdentityBind> sysUserIdentityBinds = new ArrayList<>(); + for(Long identityId : identityIds){ + SysUserIdentityBind userIdentityBind = new SysUserIdentityBind(); + userIdentityBind.setUserIdentityId(identityId); + userIdentityBind.setUserId(userId); + sysUserIdentityBinds.add(userIdentityBind); + } + List<SysUserIdentityBind> result = sysUserIdentityBindReposity.saveAll(sysUserIdentityBinds); + if(CollectionUtils.isEmpty(result)){ + return false; + } + return true; + } + + @Override + public boolean updateBatchUserIndentityBind(List<Long> identityIds, Long userId) { + if(CollectionUtils.isEmpty(identityIds) || userId == null){ + return false; + } + //获取原来的身份id + List<Long> oldUserIdentityIds = sysUserIdentityBindReposity.getByUserId(userId); + List<Long> deleteUserIdentityIdList = new ArrayList<>(); + List<Long> addUserIdentityIdList = identityIds; + if (ObjectUtil.isNotEmpty(oldUserIdentityIds)) { + //新增 + addUserIdentityIdList = identityIds.stream().filter(item -> !oldUserIdentityIds.contains(item)).collect(Collectors.toList()); + //删除 + deleteUserIdentityIdList = oldUserIdentityIds.stream().filter(item -> !identityIds.contains(item)).collect(Collectors.toList()); + + } + List<SysUserIdentityBind> saveList = new ArrayList<>(); + for(Long userIdentityId : addUserIdentityIdList){ + SysUserIdentityBind sysUserIdentityBind = new SysUserIdentityBind(); + sysUserIdentityBind.setUserIdentityId(userIdentityId); + sysUserIdentityBind.setUserId(userId); + saveList.add(sysUserIdentityBind); + } + //删除不需要角色 + if(deleteUserIdentityIdList.size()>0){ + sysUserIdentityBindReposity.deleteByUserIdAndUserIdentityIds(userId, deleteUserIdentityIdList); + } + //绑定新增角色 + if(saveList.size()>0){ + sysUserIdentityBindReposity.saveAll(saveList); + } + + return true; + } + + @Override + public boolean deleteByUser(Long userId) { + if(null == userId){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + } + if(sysUserIdentityBindReposity.deleteByUserId(userId) > 0){ + return true; + } + return false; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserDomainServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserDomainServiceImpl.java new file mode 100644 index 0000000..b74ce16 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserDomainServiceImpl.java @@ -0,0 +1,647 @@ +package com.gkhy.labRiskManage.domain.account.service.impl; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.gkhy.labRiskManage.api.controller.account.query.UserQuery; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.SystemCacheKeyEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.converter.UserInfoDomainConverter; +import com.gkhy.labRiskManage.domain.account.entity.SysUserIdentityBind; +import com.gkhy.labRiskManage.domain.account.entity.SysUserRoleBind; +import com.gkhy.labRiskManage.domain.account.entity.User; +import com.gkhy.labRiskManage.domain.account.enums.IdentityStatusEnum; +import com.gkhy.labRiskManage.domain.account.enums.UserIdTypeEnum; +import com.gkhy.labRiskManage.domain.account.enums.UserStatusEnum; +import com.gkhy.labRiskManage.domain.account.model.bo.CreateUserBO; +import com.gkhy.labRiskManage.domain.account.model.bo.UpdateUserBO; +import com.gkhy.labRiskManage.domain.account.model.dto.SysDepartmentDomainDTO; +import com.gkhy.labRiskManage.domain.account.repository.jpa.UserRepository; +import com.gkhy.labRiskManage.domain.account.service.RoleDomainService; +import com.gkhy.labRiskManage.domain.account.service.SysDepartmentDomainService; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.google.common.collect.Range; +import com.google.common.hash.Hashing; +import org.redisson.api.RMapCache; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.*; +import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +@Service +public class UserDomainServiceImpl implements UserDomainService { + + @Autowired + private UserRepository userRepository; + + @Autowired + private RedissonClient redissonClient; + + @Autowired + private ObjectMapper objectMapper; + + @Autowired + private UserInfoDomainConverter userInfoDomainConverter; + + @Autowired + private RoleDomainService roleDomainService; + + @Autowired + private SysDepartmentDomainService departmentDomainService; + + @Override + @Transactional + public UserInfoDomainDTO newUser(CreateUserBO createUserBO) { + if(createUserBO == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + User user = new User(); + user.setName(createUserBO.getName()); + user.setRealName(createUserBO.getRealName()); + user.setStatus(UserStatusEnum.STATUS_ACTIVE.getStatus()); + user.setSalt(genPasswordSalt()); + user.setHash(genPasswordHash(createUserBO.getPwd(), user.getSalt())); + + //校验用户名称 + User userInfo = userRepository.findUserByName(createUserBO.getName()); + if(userInfo != null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR,"该用户名称已存在"); + } + //部门校验 + SysDepartmentDomainDTO dep = departmentDomainService.findById(createUserBO.getDepId()); + if(dep == null){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(),"部门不存在"); + } + user.setDepId(dep.getId()); + //校验证件 + if(UserIdTypeEnum.prase(createUserBO.getIdType()) == null){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(),"证件类型不支持"); + } + /*User checkUser = userRepository.findByIdTypeAndIdSerial(createUserBO.getIdType(), createUserBO.getIdSerial()); + if(checkUser != null){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(),"证件已经被使用"); + }*/ + //手机号校验 + User checkUser = userRepository.findUserByPhone(createUserBO.getPhone()); + if(checkUser != null){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(),"手机号已经被使用"); + } + if(IdentityStatusEnum.prase(createUserBO.getIdentityStatus()) == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"用户用户身份不合法"); + } + user.setPhone(createUserBO.getPhone()); + user.setIdType(createUserBO.getIdType()); + user.setIdSerial(createUserBO.getIdSerial()); + user.setGmtCreate(LocalDateTime.now()); + user.setGmtModified(LocalDateTime.now()); + user.setIdentityStatus(createUserBO.getIdentityStatus()); + user.setQualificationAttId(createUserBO.getQualificationAttId()); + + if(userRepository.save(user) != null){ + UserInfoDomainDTO userInfoDomainDTO = new UserInfoDomainConverter().toUserInfoDTO(user); + return userInfoDomainDTO; + }else { + throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(), "数据库错误"); + } + } + + @Transactional + @Override + public UserInfoDomainDTO updateUserInfo(UpdateUserBO updateUserBO) { + if(updateUserBO == null || updateUserBO.getId() == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + if(updateUserBO.getName() == null || updateUserBO.getName().isEmpty()) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "用户名不能为空"); + if(updateUserBO.getRealName() == null || updateUserBO.getRealName().isEmpty()) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "真实姓名不能为空"); + if(updateUserBO.getIdType() == null || UserIdTypeEnum.prase(updateUserBO.getIdType()) == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "证件类型不支持"); + SysDepartmentDomainDTO dep = departmentDomainService.findById(updateUserBO.getDepId()); + if(dep == null){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(),"部门不存在"); + } + Optional<User> userOptional = userRepository.findById(updateUserBO.getId()); + if(!userOptional.isPresent()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST.getCode(), "用户不存在"); + } + //校验手机号 + UserInfoDomainDTO u = findUserByPhone(updateUserBO.getPhone()); + if(u != null && !u.getId().equals(updateUserBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED, "手机号已经被使用"); + } + + User user = userOptional.get(); + user.setName(updateUserBO.getName()); + user.setRealName(updateUserBO.getRealName()); + user.setIdType(updateUserBO.getIdType()); + user.setIdSerial(updateUserBO.getIdSerial()); + user.setDepId(updateUserBO.getDepId()); + user.setPhone(updateUserBO.getPhone()); + user.setIdentityStatus(updateUserBO.getIdentityStatus()); + user.setQualificationAttId(updateUserBO.getQualificationAttId()); + //写库 + User saveUserRs = userRepository.save(user); + return userInfoDomainConverter.toUserInfoDTO(saveUserRs); + } + + @Override + public UserInfoDomainDTO getUserInfoById(Long uid) { + if(uid == null || uid < 0) + return null; + //1、先从redis缓存加载 +// Object cacheUserObj = redissonClient.getMapCache(SystemCacheKeyEnum.KEY_CACHE_USER.getKey()).get(""+uid); +// if(cacheUserObj != null){ +// String cacheUserJson = (String)cacheUserObj; +// User cacheUser = null; +// try { +// cacheUser = objectMapper.readValue(cacheUserJson,User.class); +// } catch (JsonProcessingException e) { +// e.printStackTrace(); +// } +// //2、缓存命中,直接返回 +// if(cacheUser != null){ +// UserInfoDTO userInfoDTO = new UserInfoConverter().toUserInfoDTO(cacheUser); +// return userInfoDTO; +// } +// } + //3、缓存未命中,入库查 + Optional<User> userOptional = userRepository.findById(uid); + if(!userOptional.isPresent()){ + return null; + } + User user = userOptional.get(); + //获取角色信息 + // RoleInfoDoaminDTO roleInfoDoaminDTO = roleDomainService.findRoleById(user.getRoleId()); + UserInfoDomainDTO userInfoDomainDTO = new UserInfoDomainConverter().toUserInfoDTO(user); +// if(roleInfoDoaminDTO != null) +// userInfoDomainDTO.setRole(roleInfoDoaminDTO); + //重置缓存数据 +// resetUserCache(user); + return userInfoDomainDTO; + } + + @Override + public UserInfoDomainDTO getUserInfoByName(String name) { + if(name == null || name.isEmpty()) + return null; + User user = userRepository.findUserByName(name); + if(user == null) + return null; + UserInfoDomainDTO userInfoDomainDTO = new UserInfoDomainConverter().toUserInfoDTO(user); + return userInfoDomainDTO; + } + + @Override + public List<UserInfoDomainDTO> findUserListByRealName(String name) { + if(name == null || name.isEmpty()) + return null; + List<User> userList = userRepository.getUsersByRealName(name); + if(userList == null || userList.isEmpty()) + return null; + List<UserInfoDomainDTO> dtoList = new ArrayList<>(); + userList.forEach(u -> { + dtoList.add(userInfoDomainConverter.toUserInfoDTO(u)); + }); + return dtoList; + } + + @Override + public SearchResult<List<UserInfoDomainDTO>> findUserListByRole(Long roleId, boolean usePage, Integer page, + Integer pageSize) { + SearchResult<List<UserInfoDomainDTO>> result = new SearchResult<>(); + result.setSuccess(); + result.setUsePage(usePage); + if(roleId == null || roleId < 0) + return null; + Specification<User> userSpecification = new Specification<User>() { + @Override + public Predicate toPredicate(Root<User> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + predicateList.add(root.get("status").in(UserStatusEnum.getActiveUserStatus())); + Join<User, SysUserRoleBind> userRoleJion = root.join("sysUserRoleBinds", JoinType.LEFT); + predicateList.add(criteriaBuilder.equal(userRoleJion.get("roleId"), roleId)); + + return criteriaBuilder.and(predicateList.toArray(new Predicate[predicateList.size()])); + } + }; + PageRequest pageRequest = null; + if(usePage == true){ + if(page <= 0){ + page = 1; + result.setPageIndex(1); + } + if(pageSize <= 0 || pageSize > 50){ + pageSize = 20; + result.setPageSize(20); + } + pageRequest = PageRequest.of(page-1,pageSize); + } + List<User> userList = null; + if(pageRequest != null){ + Page<User> userListPage = userRepository.findAll(userSpecification,pageRequest); + result.setTotal(userListPage.getTotalElements()); + result.setPages(userListPage.getTotalPages()); + result.setPageIndex(page); + result.setPageSize(userListPage.getSize()); + userList = userListPage.getContent(); + }else { + userList = userRepository.findAll(userSpecification); + } + if(userList != null && !userList.isEmpty()){ + result.setCount(userList.size()); + result.setData(userInfoDomainConverter.toDomainUserInfoList(userList)); + } + return result; + } + + @Override + public List<UserInfoDomainDTO> getUserInfoListByIds(List<Long> uidList) { + if(uidList == null || uidList.size() == 0) + return null; + List<User> userList = userRepository.findAllByIdIn(uidList); + if(userList == null || userList.size() == 0) + return null; + List<UserInfoDomainDTO> doList = new ArrayList<>(); + UserInfoDomainConverter converter = new UserInfoDomainConverter(); + for(User u : userList){ + UserInfoDomainDTO userInfoDomainDTO = converter.toUserInfoDTO(u); + doList.add(userInfoDomainDTO); + } + return doList; + } + + @Override + @Transactional + public boolean updateUserPwd(Long uid, String oldPwd, String newPwd) { + if(uid == null || oldPwd == null || newPwd == null || oldPwd.isEmpty() || newPwd.isEmpty()) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + Optional<User> userOptional = userRepository.findById(uid); + if(!userOptional.isPresent()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST.getCode(), "用户不存在"); + } + User user = userOptional.get(); + //验证旧密码 + String hash = String.valueOf(Hashing.hmacMd5(user.getSalt().getBytes(StandardCharsets.UTF_8)).hashString(oldPwd, + StandardCharsets.UTF_8)); + if(!hash.equals(user.getHash())) + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "旧密码错误"); + String newSalt = String.valueOf(Hashing.hmacMd5("".getBytes()).hashString(""+uid+Range.atLeast(1)+System.nanoTime(), + StandardCharsets.UTF_8)); + String newHash = String.valueOf(Hashing.hmacMd5(newSalt.getBytes(StandardCharsets.UTF_8)).hashString(newPwd, + StandardCharsets.UTF_8)); + if(userRepository.updatePassword(uid,newHash,newSalt, LocalDateTime.now()) == 1){ +// deleteUserCache(uid); + return true; + }else { + throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(), "数据库错误"); + } + } + + @Override + @Transactional + public boolean updateUserStatus(Long uid, Byte status) { + if(uid == null || status == null || UserStatusEnum.prase(status) == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + Optional<User> userOptional = userRepository.findById(uid); + if(!userOptional.isPresent()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST.getCode(), "用户不存在"); + } + User user = userOptional.get(); + if(user.getStatus().equals(status)) + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "用户状态未发生改变"); + if(userRepository.updateUserStatus(uid,status,LocalDateTime.now()) == 1){ +// deleteUserCache(uid); + return true; + } + return false; + } + + @Override + @Transactional + public boolean updateUserRole(Long uid, Long roleId) { + if(uid == null || roleId == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + Optional<User> userOptional = userRepository.findById(uid); + if(!userOptional.isPresent()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST.getCode(), "用户不存在"); + } + User user = userOptional.get(); + /*if(user.getRoleId() != null && user.getRoleId().equals(roleId)) + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "用户角色未发生改变");*/ + //todo:校验角色信息 + /*if(userRepository.updateUserRole(uid,roleId,LocalDateTime.now()) != null){ +// deleteUserCache(uid); + return true; + }*/ + return false; + } + + @Override + public boolean checkPassword(String pwd, String hash, String salt) { + if(pwd == null || pwd.isEmpty() || salt == null || salt.isEmpty() || hash == null || hash.isEmpty()) + return false; + if(Hashing.hmacMd5(salt.getBytes(StandardCharsets.UTF_8)).hashString(pwd, StandardCharsets.UTF_8).toString().equals(hash)){ + return true; + }else { + return false; + } + } + + @Override + public UserInfoDomainDTO findUserByPhone(String phoneNumber) { + if(phoneNumber == null || phoneNumber.isEmpty() || phoneNumber.length() < 11) + return null; + User user = userRepository.findUserByPhone(phoneNumber); + if(user == null) + return null; + UserInfoDomainDTO userInfoDomainDTO = userInfoDomainConverter.toUserInfoDTO(user); + return userInfoDomainDTO; + } + + @Override + public UserInfoDomainDTO findUserByIdSerial(Byte idType, String idSerial) { + if(idType == null || idSerial == null || idSerial.isEmpty() || idSerial.length() < 10) + return null; + User user = userRepository.findByIdTypeAndIdSerial(idType,idSerial); + if(user == null) + return null; + UserInfoDomainDTO userInfoDomainDTO = userInfoDomainConverter.toUserInfoDTO(user); + return userInfoDomainDTO; + } + + @Override + @Transactional + public boolean updateUserPhoneNumber(Long uid, String phoneNumber) { + if(uid == null || phoneNumber == null || phoneNumber.isEmpty()) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + User user = userRepository.findUserByPhone(phoneNumber); + if(user != null && !user.getId().equals(uid)) + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "手机号码已经被使用"); + Optional<User> userOptional = userRepository.findById(uid); + if(!userOptional.isPresent()) + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST.getCode(), "用户不存在"); + user = userOptional.get(); + if(user.getPhone().equals(phoneNumber)) + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "手机号码未发生变化"); + if(userRepository.updateUserPhone(uid,phoneNumber) == 1){ +// deleteUserCache(uid); + return true; + }else { + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"数据库更新出错"); + } + } + + @Override + @Transactional + public boolean deleteUser(Long uid) { + if(uid == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + Optional<User> userOptional = userRepository.findById(uid); + if(!userOptional.isPresent()) + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_ACCOUNT_NOT_EXIST.getCode(), "用户不存在"); + User user = userOptional.get(); + if(user.getStatus().equals(UserStatusEnum.STATUS_DELETE.getStatus())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "用户不存在"); + } + if(userRepository.updateUserStatus(uid,UserStatusEnum.STATUS_DELETE.getStatus(), LocalDateTime.now()) ==1){ +// deleteUserCache(uid); + return true; + } + return false; + } + + /** + * 用户列表 + */ + @Override + public List<UserInfoDomainDTO> getUserList() { + + return BeanCopyUtils.copyBeanList(userRepository.getUserList(), UserInfoDomainDTO.class); + } + /** + * 根据用户id获取信息 + */ + public UserInfoDomainDTO getUserById(Long id){ + if(id == null) + return null; + User user = userRepository.getById(id); + UserInfoDomainDTO userInfoDomainDTO = userInfoDomainConverter.toUserInfoDTO(user); + return userInfoDomainDTO; + } + + + /** + * 根据用户获取数据 + */ + public List<UserInfoDomainDTO> getUserByRoleId(Long roleId){ + if(null == roleId){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + } + Specification<User> userSpecification = new Specification<User>() { + @Override + public Predicate toPredicate(Root<User> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + predicateList.add(root.get("status").in(UserStatusEnum.getActiveUserStatus())); + Join<User, SysUserRoleBind> userRoleJion = root.join("sysUserRoleBinds", JoinType.LEFT); + predicateList.add(criteriaBuilder.equal(userRoleJion.get("roleId"), roleId)); + + return criteriaBuilder.and(predicateList.toArray(new Predicate[predicateList.size()])); + } + }; + List<User> userList = userRepository.findAll(userSpecification); + return userInfoDomainConverter.toDomainUserInfoList(userList); + + } + + /** + * + * @param pageQuery + * @return + */ + @Override + public SearchResult<List<UserInfoDomainDTO>> findUserList(PageQuery<UserQuery> pageQuery) { + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(pageQuery.getPageIndex()); + searchResult.setPageSize(pageQuery.getPageSize()); + searchResult.setSuccess(); + + UserQuery userQuery = pageQuery.getSearchParams(); + Specification<User> userSpecification = new Specification<User>() { + @Override + public Predicate toPredicate(Root<User> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + if(query != null){ + if(!ObjectUtils.isEmpty(userQuery.getRoleId())){ + Join<User, SysUserRoleBind> userRoleJion = root.join("sysUserRoleBinds", JoinType.LEFT); + predicateList.add(criteriaBuilder.equal(userRoleJion.get("roleId"), userQuery.getRoleId())); + } + if(!ObjectUtils.isEmpty(userQuery.getName())){ + predicateList.add(criteriaBuilder.like(root.get("name"),userQuery.getName())); + } + if(!ObjectUtils.isEmpty(userQuery.getRealName())){ + predicateList.add(criteriaBuilder.like(root.get("realName"),userQuery.getRealName())); + } + } + predicateList.add(root.get("status").in(UserStatusEnum.getActiveUserStatus())); + + return criteriaBuilder.and(predicateList.toArray(new Predicate[predicateList.size()])); + } + }; + Pageable pageable = PageRequest.of(pageQuery.getPageIndex()-1, pageQuery.getPageSize(), Sort.Direction.DESC, "gmtCreate"); + Page<User> pageResult = userRepository.findAll(userSpecification, pageable); + + searchResult.setTotal(pageResult.getTotalElements()); + searchResult.setPages(pageResult.getTotalPages()); + searchResult.setData(userInfoDomainConverter.toDomainUserInfoList(pageResult.getContent())); + + return searchResult; + } + + @Override + public SearchResult<List<UserInfoDomainDTO>> findExpertList(PageQuery<UserQuery> pageQuery) { + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(pageQuery.getPageIndex()); + searchResult.setPageSize(pageQuery.getPageSize()); + searchResult.setSuccess(); + + UserQuery userQuery = pageQuery.getSearchParams(); + Specification<User> userSpecification = new Specification<User>() { + @Override + public Predicate toPredicate(Root<User> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + predicateList.add(root.get("status").in(UserStatusEnum.getActiveUserStatus())); + predicateList.add(criteriaBuilder.equal(root.get("identityStatus"),IdentityStatusEnum.EXPERT.getStatus())); + if(query != null){ + if(!ObjectUtils.isEmpty(userQuery.getRoleId())){ + Join<User, SysUserRoleBind> userRoleJion = root.join("sysUserRoleBinds", JoinType.LEFT); + predicateList.add(criteriaBuilder.equal(userRoleJion.get("roleId"), userQuery.getRoleId())); + } + if(!ObjectUtils.isEmpty(userQuery.getName())){ + predicateList.add(criteriaBuilder.like(root.get("name"),userQuery.getName())); + } + if(!ObjectUtils.isEmpty(userQuery.getRealName())){ + predicateList.add(criteriaBuilder.like(root.get("realName"),userQuery.getRealName())); + } + if(!ObjectUtils.isEmpty(userQuery.getUserIndentityId())){ + Join<User, SysUserIdentityBind> userIdentityBindJion = root.join("sysUserIdentityBinds", JoinType.LEFT); + predicateList.add(criteriaBuilder.equal(userIdentityBindJion.get("userIdentityId"), userQuery.getUserIndentityId())); + } + } + + + return criteriaBuilder.and(predicateList.toArray(new Predicate[predicateList.size()])); + } + }; + Pageable pageable = PageRequest.of(pageQuery.getPageIndex()-1, pageQuery.getPageSize(), Sort.Direction.DESC, "gmtCreate"); + Page<User> pageResult = userRepository.findAll(userSpecification, pageable); + + searchResult.setTotal(pageResult.getTotalElements()); + searchResult.setPages(pageResult.getTotalPages()); + searchResult.setData(userInfoDomainConverter.toDomainUserInfoList(pageResult.getContent())); + + return searchResult; + } + + + /** + * 用户查询 + */ + @Override + public UserInfoDomainDTO getUserInfoByIdAndSellInfo(Long evaluateUserId, String info) { + + if (ObjectUtils.isEmpty(evaluateUserId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数不能为空"); + } + + User userInfo = userRepository.getUserInfoByIdAndSellInfo(evaluateUserId); + + if (ObjectUtils.isEmpty(userInfo)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), info + "不存在,请检查是否输入有误或人员已被删除"); + } + return BeanCopyUtils.copyBean(userInfo, UserInfoDomainDTO.class); + } + + + /** + * 清除REDIS缓存的用户数据 + * @param userId + * @return + */ + public Result deleteUserCache(Long userId){ + Result result = new Result<>(); + if(userId == null){ + return result; + } + RMapCache<String,Object> userCacheMap = redissonClient.getMapCache(SystemCacheKeyEnum.KEY_CACHE_USER.getKey()); + String userKey = ""+userId; + userCacheMap.remove(userKey); + result.setSuccess(); + return result; + } + + /** + * 重置缓存的用户数据 + * @param user + * @return + */ + public boolean resetUserCache(User user){ + if(user == null) + return false; + String cacheJson = null; + try { + cacheJson = objectMapper.writeValueAsString(user); + } catch (JsonProcessingException e) { + throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR.getCode(),"序列化对象出错"); + } + RMapCache<String,Object> userCacheMap = redissonClient.getMapCache(SystemCacheKeyEnum.KEY_CACHE_USER.getKey()); + String userKey = ""+user.getId(); + //写入redis缓存,有效期1小时 + userCacheMap.put(userKey,cacheJson,60, TimeUnit.MINUTES); + return true; + } + + /** + * 生成salt + * @return + */ + private String genPasswordSalt(){ + String seed = ""+System.nanoTime(); + String m = ""+ Range.atLeast(1).toString(); + String salt = Hashing.hmacMd5(seed.getBytes(StandardCharsets.UTF_8)).hashBytes(m.getBytes(StandardCharsets.UTF_8)).toString(); + return salt; + } + + /** + * 生成hash + * @param password + * @param salt + * @return + */ + private String genPasswordHash(String password,String salt){ + if(password == null || salt == null || password.isEmpty() || salt.isEmpty()) + return null; + String hash = Hashing.hmacMd5(salt.getBytes(StandardCharsets.UTF_8)).hashBytes(password.getBytes(StandardCharsets.UTF_8)).toString(); + return hash; + } + + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserIdentityDomainServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserIdentityDomainServiceImpl.java new file mode 100644 index 0000000..6484b13 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserIdentityDomainServiceImpl.java @@ -0,0 +1,37 @@ +package com.gkhy.labRiskManage.domain.account.service.impl; + +import com.gkhy.labRiskManage.domain.account.converter.UserIdentityConverter; +import com.gkhy.labRiskManage.domain.account.entity.UserIdentity; +import com.gkhy.labRiskManage.domain.account.model.dto.UserIdentityDomainDTO; +import com.gkhy.labRiskManage.domain.account.repository.jpa.UserIdentityRepository; +import com.gkhy.labRiskManage.domain.account.service.UserIdentityDomainService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/28 + * @time: 16:38 + */ +@Service +public class UserIdentityDomainServiceImpl implements UserIdentityDomainService { + @Autowired + private UserIdentityRepository userIdentityRepository; + @Autowired + private UserIdentityConverter converter; + + @Override + public List<UserIdentityDomainDTO> getListByIds(List<Long> identityIds) { + List<UserIdentity> userIdentities = userIdentityRepository.findAllById(identityIds); + return converter.userIdentityDomainConverter(userIdentities); + } + + @Override + public List<UserIdentityDomainDTO> getList() { + List<UserIdentity> userIdentities = userIdentityRepository.findAll(); + return converter.userIdentityDomainConverter(userIdentities); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserRoleDomainServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserRoleDomainServiceImpl.java new file mode 100644 index 0000000..f6a871d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/account/service/impl/UserRoleDomainServiceImpl.java @@ -0,0 +1,127 @@ +package com.gkhy.labRiskManage.domain.account.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.account.converter.UserRoleBindConverter; +import com.gkhy.labRiskManage.domain.account.entity.SysUserRoleBind; +import com.gkhy.labRiskManage.domain.account.model.dto.RoleInfoDoaminDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; + +import com.gkhy.labRiskManage.domain.account.repository.jpa.UserRoleBindReposity; +import com.gkhy.labRiskManage.domain.account.service.RoleDomainService; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.account.service.UserRoleDomainService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/13 + * @time: 9:26 + */ +@Service +public class UserRoleDomainServiceImpl implements UserRoleDomainService { + @Autowired + private UserRoleBindReposity userRoleBindReposity; + + @Autowired + private RoleDomainService roleDomainService; + + @Autowired + private UserDomainService userDomainService; + + @Autowired + private UserRoleBindConverter converter; + + @Override + public List<SysUserRoleBindDomainDTO> insertBatchUserBindRole(List<Long> roleIds, Long userId) { + if(ObjectUtil.isEmpty(roleIds) || ObjectUtil.isEmpty(userId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + } + //验证用户 + UserInfoDomainDTO user = userDomainService.getUserInfoById(userId); + if(ObjectUtil.isEmpty(user)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "用户不存在"); + } + //验证角色是否都存在 + List<RoleInfoDoaminDTO> roleList = roleDomainService.findAllByIdIn(roleIds); + for(Long roleId : roleIds){ + List<RoleInfoDoaminDTO> collect = roleList.stream().filter(role -> role.getId().equals(roleId)).collect(Collectors.toList()); + if(collect.size() == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "角色不存在"); + } + } + //绑定用户角色 + List<SysUserRoleBind> sysUserRoleBindList = new ArrayList<>(); + for(Long roleId : roleIds){ + SysUserRoleBind sysUserRoleBind = new SysUserRoleBind(); + sysUserRoleBind.setRoleId(roleId); + sysUserRoleBind.setUserId(userId); + sysUserRoleBindList.add(sysUserRoleBind); + } + List<SysUserRoleBindDomainDTO> list = converter.userRoleBindDomainConverter(userRoleBindReposity.saveAll(sysUserRoleBindList)); + return list; + } + + @Transactional + @Override + public void updateUserRole(Long userId, List<Long> roleIds) { + if(ObjectUtil.isEmpty(roleIds) || ObjectUtil.isEmpty(userId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + } + //获取原来的角色id + List<Long> oldRoleIds = userRoleBindReposity.getByUserId(userId); + List<Long> deleteRoleIdList = new ArrayList<>(); + List<Long> addRoleIdList = roleIds; + if (ObjectUtil.isNotEmpty(oldRoleIds)) { + //新增 + addRoleIdList = roleIds.stream().filter(item -> !oldRoleIds.contains(item)).collect(Collectors.toList()); + //删除 + deleteRoleIdList = oldRoleIds.stream().filter(item -> !roleIds.contains(item)).collect(Collectors.toList()); + + } + List<SysUserRoleBind> saveList = new ArrayList<>(); + for(Long roleId : addRoleIdList){ + SysUserRoleBind sysUserRoleBind = new SysUserRoleBind(); + sysUserRoleBind.setRoleId(roleId); + sysUserRoleBind.setUserId(userId); + saveList.add(sysUserRoleBind); + } + //删除不需要角色 + if(deleteRoleIdList.size()>0){ + userRoleBindReposity.deleteByUserIdAndRoleIds(userId, deleteRoleIdList); + } + //绑定新增角色 + if(saveList.size()>0){ + userRoleBindReposity.saveAll(saveList); + } + } + + @Override + public boolean deleteByUser(Long userId) { + if(null == userId){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + } + if(userRoleBindReposity.deleteByUserId(userId) > 0){ + return true; + } + return false; + } + + /*@Override + public List<SysUserRoleBindDomainDTO> getUserRoleBind(Long userId) { + if(null == userId){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数缺失"); + } + return null; + }*/ +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/attachment/converter/AttachmentDomainConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/attachment/converter/AttachmentDomainConverter.java new file mode 100644 index 0000000..99248c7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/attachment/converter/AttachmentDomainConverter.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.attachment.converter; + +import com.gkhy.labRiskManage.domain.attachment.dto.resp.AttachmentDomainDTO; +import com.gkhy.labRiskManage.domain.attachment.entity.AttachmentInfo; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 17:06 + */ +@Component +public class AttachmentDomainConverter { + public AttachmentDomainDTO getDomainDTO(AttachmentInfo attachmentInfo){ + if(null == attachmentInfo){ + return null; + } + AttachmentDomainDTO attachmentDomainDTO = new AttachmentDomainDTO(); + BeanUtils.copyProperties(attachmentInfo,attachmentDomainDTO); + return attachmentDomainDTO; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/attachment/dto/resp/AttachmentDomainDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/attachment/dto/resp/AttachmentDomainDTO.java new file mode 100644 index 0000000..28193fc --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/attachment/dto/resp/AttachmentDomainDTO.java @@ -0,0 +1,53 @@ +package com.gkhy.labRiskManage.domain.attachment.dto.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; + +import javax.persistence.Column; +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 15:10 + */ +@Data +public class AttachmentDomainDTO { + + private Long id; + //文件标识 + private String fileKey; + //文件本地址 + private String filePath; + //文件访问路径 + private String fileUrl; + //文件名称 + private String fileName; + //文件后缀 + private String fileSuffix; + //文件描述 + private String fileDesc; + //文件大小 + private Long fileSize; + //文件类型 + private String fileType; + //模块 + private String module; + //删除标识 0-未删除,1-删除 + private Integer delFlag; + //创建时间 + private LocalDateTime createTime; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + private LocalDateTime updateTime; + //修改人id + private Long updateUid; + //修改人姓名 + private String updateUname; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/attachment/entity/AttachmentInfo.java b/src/main/java/com/gkhy/labRiskManage/domain/attachment/entity/AttachmentInfo.java new file mode 100644 index 0000000..c35e03c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/attachment/entity/AttachmentInfo.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.domain.attachment.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import javax.persistence.*; +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/6 + * @time: 14:54 + */ +@EntityListeners(AuditingEntityListener.class) +@Data +@Entity +@Table(name = "attachment") +public class AttachmentInfo { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + //文件标识 + private String fileKey; + //文件本地址 + private String filePath; + //文件访问路径 + private String fileUrl; + //文件名称 + private String fileName; + //文件后缀 + private String fileSuffix; + //文件描述 + private String fileDesc; + //文件大小 + private Long fileSize; + //文件类型 + private String fileType; + //模块 + private String module; + //删除标识 0-未删除,1-删除 + private Integer delFlag; + //创建时间 + @JsonFormat + @CreatedDate + @Column(name = "create_time",updatable = false) + private LocalDateTime createTime; + //创建人id + private Long createUid; + //创建人姓名 + private String createUname; + //修改时间 + @JsonFormat + @LastModifiedDate + private LocalDateTime updateTime; + //修改人id + private Long updateUid; + //修改人姓名 + private String updateUname; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/attachment/enums/FileProjectConstants.java b/src/main/java/com/gkhy/labRiskManage/domain/attachment/enums/FileProjectConstants.java new file mode 100644 index 0000000..69ce17b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/attachment/enums/FileProjectConstants.java @@ -0,0 +1,20 @@ +package com.gkhy.labRiskManage.domain.attachment.enums; + + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/7 + * @time: 13:42 + */ +public interface FileProjectConstants { + interface ReturnType { + int DETAIL = 1; + int KEY = 2; + int URL = 3; + } + enum FileError{ + + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/attachment/repository/jpa/AttachmentReposity.java b/src/main/java/com/gkhy/labRiskManage/domain/attachment/repository/jpa/AttachmentReposity.java new file mode 100644 index 0000000..41b39d1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/attachment/repository/jpa/AttachmentReposity.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.attachment.repository.jpa; + +import com.gkhy.labRiskManage.domain.attachment.entity.AttachmentInfo; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Optional; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/6 + * @time: 21:28 + */ +@Repository +public interface AttachmentReposity extends JpaRepository<AttachmentInfo,Long>, JpaSpecificationExecutor<AttachmentInfo> { + @Query(value = "select a from AttachmentInfo a where a.fileKey = :fileKey and a.delFlag = 0") + AttachmentInfo findByFileKey(String fileKey); + + @Query(value = "select a from AttachmentInfo a where a.id = :id and a.delFlag = 0") + AttachmentInfo getById(Long id); + @Transactional + @Query(value = "update AttachmentInfo a set a.delFlag = 1 where a.id = :id") + @Modifying + Integer deleteAttachment(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/attachment/service/AttachmentDomainService.java b/src/main/java/com/gkhy/labRiskManage/domain/attachment/service/AttachmentDomainService.java new file mode 100644 index 0000000..ff0df09 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/attachment/service/AttachmentDomainService.java @@ -0,0 +1,20 @@ +package com.gkhy.labRiskManage.domain.attachment.service; + +import com.gkhy.labRiskManage.application.attachment.service.dto.req.AttachmentAppReq; +import com.gkhy.labRiskManage.domain.attachment.dto.resp.AttachmentDomainDTO; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/6 + * @time: 14:51 + */ +public interface AttachmentDomainService { + + AttachmentDomainDTO save(AttachmentAppReq attachmentAppReq); + + AttachmentDomainDTO findByKey(String key); + AttachmentDomainDTO findById(Long id); + + int delete(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/attachment/service/impl/AttachmentDomainServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/attachment/service/impl/AttachmentDomainServiceImpl.java new file mode 100644 index 0000000..90c69e5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/attachment/service/impl/AttachmentDomainServiceImpl.java @@ -0,0 +1,68 @@ +package com.gkhy.labRiskManage.domain.attachment.service.impl; + +import com.alibaba.druid.util.StringUtils; +import com.gkhy.labRiskManage.application.attachment.service.dto.req.AttachmentAppReq; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.attachment.converter.AttachmentDomainConverter; +import com.gkhy.labRiskManage.domain.attachment.dto.resp.AttachmentDomainDTO; +import com.gkhy.labRiskManage.domain.attachment.entity.AttachmentInfo; +import com.gkhy.labRiskManage.domain.attachment.repository.jpa.AttachmentReposity; +import com.gkhy.labRiskManage.domain.attachment.service.AttachmentDomainService; +import org.checkerframework.checker.units.qual.K; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/5/6 + * @time: 14:50 + */ +@Service +public class AttachmentDomainServiceImpl implements AttachmentDomainService { + @Autowired + private AttachmentReposity reposity; + + @Autowired + private AttachmentDomainConverter converter; + + @Override + public AttachmentDomainDTO save(AttachmentAppReq attachmentAppReq) { + if(ObjectUtils.isEmpty(attachmentAppReq)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL); + } + AttachmentInfo attachmentInfo = new AttachmentInfo(); + BeanUtils.copyProperties(attachmentAppReq,attachmentInfo); + AttachmentInfo save = reposity.save(attachmentInfo); + return converter.getDomainDTO(save); + } + + @Override + public AttachmentDomainDTO findByKey(String key) { + if (StringUtils.isEmpty(key)){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL); + } + AttachmentInfo attachmentInfo = reposity.findByFileKey(key); + return converter.getDomainDTO(attachmentInfo); + } + @Override + public AttachmentDomainDTO findById(Long id) { + if (id == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL); + } + AttachmentInfo attachmentInfo = reposity.getById(id); + return converter.getDomainDTO(attachmentInfo); + } + + @Override + public int delete(Long id) { + if (id == null){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL); + } + return reposity.deleteAttachment(id); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToBasicDeviceInfoConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToBasicDeviceInfoConverter.java new file mode 100644 index 0000000..b4e0df8 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToBasicDeviceInfoConverter.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.converter; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppInsertBO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.bo.DeviceInsertBO; +import org.springframework.util.ObjectUtils; + +public class ToBasicDeviceInfoConverter { + + public DeviceInsertBO toBasicDeviceInfoConvert(BasicExperimentDeviceAppInsertBO basicExperimentDeviceAppInsertBO){ + + if (ObjectUtils.isEmpty(basicExperimentDeviceAppInsertBO)){ + return null; + } + return BeanCopyUtils.copyBean(basicExperimentDeviceAppInsertBO, DeviceInsertBO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertDeviceBOConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertDeviceBOConverter.java new file mode 100644 index 0000000..bb848c3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertDeviceBOConverter.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.converter; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppInsertBO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceInsertDTO; +import org.springframework.util.ObjectUtils; + +public class ToInsertDeviceBOConverter { + + public DeviceInsertDTO toInsertDeviceDTO(BasicExperimentDeviceAppInsertBO device){ + if (ObjectUtils.isEmpty(device)){ + return null; + } + DeviceInsertDTO deviceInsertDTO = BeanCopyUtils.copyBean(device, DeviceInsertDTO.class); + return deviceInsertDTO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertPersonBOConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertPersonBOConverter.java new file mode 100644 index 0000000..0d487d3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertPersonBOConverter.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.converter; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppInsertBO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.bo.PersonInsertBO; +import org.springframework.util.ObjectUtils; + +public class ToInsertPersonBOConverter { + + public PersonInsertBO toInsertPersonDTO(BasicExperimentPersonAppInsertBO person){ + if (ObjectUtils.isEmpty(person)){ + return null; + } + PersonInsertBO personInsertBO = BeanCopyUtils.copyBean(person, PersonInsertBO.class); + return personInsertBO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertSiteBOConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertSiteBOConverter.java new file mode 100644 index 0000000..34f4092 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToInsertSiteBOConverter.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.converter; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentSiteAppInsertBO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.bo.SiteInsertBO; +import org.springframework.util.ObjectUtils; + +public class ToInsertSiteBOConverter { + + public SiteInsertBO toSiteInsertBO(BasicExperimentSiteAppInsertBO site){ + if (ObjectUtils.isEmpty(site)){ + return null; + } + SiteInsertBO siteInsertBO = BeanCopyUtils.copyBean(site, SiteInsertBO.class); + return siteInsertBO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToQueryDeviceBOConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToQueryDeviceBOConverter.java new file mode 100644 index 0000000..36f135b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToQueryDeviceBOConverter.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.converter; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppQueryBO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.bo.DeviceQueryBO; +import org.springframework.util.ObjectUtils; + +public class ToQueryDeviceBOConverter { + + public DeviceQueryBO ToQueryDeviceDTOConverter(BasicExperimentDeviceAppQueryBO deviceQueryBO){ + if (ObjectUtils.isEmpty(deviceQueryBO)){ + return null; + } + DeviceQueryBO queryDeviceDO = BeanCopyUtils.copyBean(deviceQueryBO, DeviceQueryBO.class); + return queryDeviceDO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToQueryPersonBOConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToQueryPersonBOConverter.java new file mode 100644 index 0000000..97f3a48 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToQueryPersonBOConverter.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.converter; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppQueryBO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.bo.PersonQueryBO; +import org.springframework.util.ObjectUtils; + +public class ToQueryPersonBOConverter { + + public PersonQueryBO toQueryPersonDOConverter(BasicExperimentPersonAppQueryBO personQueryBO){ + if (ObjectUtils.isEmpty(personQueryBO)){ + return null; + } + PersonQueryBO personQueryDO = BeanCopyUtils.copyBean(personQueryBO, PersonQueryBO.class); + return personQueryDO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToUpdateDeviceBOConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToUpdateDeviceBOConverter.java new file mode 100644 index 0000000..e5ace70 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToUpdateDeviceBOConverter.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.converter; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppUpdateBO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.bo.DeviceUpdateBO; +import org.springframework.util.ObjectUtils; + +public class ToUpdateDeviceBOConverter { + + public DeviceUpdateBO toUpdateDeviceDO(BasicExperimentDeviceAppUpdateBO device){ + if (ObjectUtils.isEmpty(device)){ + return null; + } + + return BeanCopyUtils.copyBean(device, DeviceUpdateBO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToUpdatePersonBOConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToUpdatePersonBOConverter.java new file mode 100644 index 0000000..08fc5ac --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/converter/ToUpdatePersonBOConverter.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.converter; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppUpdateBO; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.bo.PersonUpdateBO; +import org.springframework.util.ObjectUtils; + +public class ToUpdatePersonBOConverter { + + public PersonUpdateBO toInsertPersonDTO(BasicExperimentPersonAppUpdateBO person){ + if (ObjectUtils.isEmpty(person)){ + return null; + } + PersonUpdateBO personUpdateBO = BeanCopyUtils.copyBean(person, PersonUpdateBO.class); + return personUpdateBO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentDevice.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentDevice.java new file mode 100644 index 0000000..a83718c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentDevice.java @@ -0,0 +1,244 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 基础仪器设备表 + */ +@Entity +@Table(name = "basic_experiment_device") +public class BasicExperimentDevice implements Serializable { + private static final long serialVersionUID = 918669580526871130L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 数量 + */ + private Integer number; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentDeviceType.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentDeviceType.java new file mode 100644 index 0000000..ba1a738 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentDeviceType.java @@ -0,0 +1,96 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +@Entity +@Table(name = "basic_experiment_device_type") +public class BasicExperimentDeviceType implements Serializable { + + private static final long serialVersionUID = -67614776004831997L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 设备类型 + */ + private String deviceType; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentPerson.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentPerson.java new file mode 100644 index 0000000..a62284b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentPerson.java @@ -0,0 +1,196 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 基础实验人员管理 + */ +@Entity +@Table(name = "basic_experiment_person") +public class BasicExperimentPerson implements Serializable { + private static final long serialVersionUID = -67614776004831997L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 手机号 + */ + private Long phone; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 头像 + */ + private String image; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentRiskSourceType.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentRiskSourceType.java new file mode 100644 index 0000000..57167f7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentRiskSourceType.java @@ -0,0 +1,99 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 基本危险因素类型 + */ +@Entity +@Table(name = "basic_experiment_risk_source_type") +public class BasicExperimentRiskSourceType implements Serializable { + private static final long serialVersionUID = -54067208633193458L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 危险源种类 + */ + private String riskSourceType; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(String riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentSite.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentSite.java new file mode 100644 index 0000000..2a2b10f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentSite.java @@ -0,0 +1,221 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 基础实验场所管理 + */ +@Entity +@Table(name = "basic_experiment_site") +public class BasicExperimentSite implements Serializable { + private static final long serialVersionUID = 579592621011524265L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentSiteType.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentSiteType.java new file mode 100644 index 0000000..e52da05 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentSiteType.java @@ -0,0 +1,96 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +@Entity +@Table(name = "basic_experiment_site_type") +public class BasicExperimentSiteType implements Serializable { + + private static final long serialVersionUID = -67614776004831997L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 场所类型 + */ + private String siteType; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentStuff.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentStuff.java new file mode 100644 index 0000000..de81d09 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentStuff.java @@ -0,0 +1,148 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 基础实验耗材管理 + */ +@Entity +@Table(name = "basic_experiment_stuff") +public class BasicExperimentStuff implements Serializable { + private static final long serialVersionUID = -15314412098578004L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentType.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentType.java new file mode 100644 index 0000000..d2e438b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicExperimentType.java @@ -0,0 +1,100 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 基础实验类型 + */ +@Entity +@Table(name = "basic_experiment_type") +public class BasicExperimentType implements Serializable { + private static final long serialVersionUID = 787995438729244617L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private String experimentType; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getExperimentType() { + return experimentType; + } + + public void setExperimentType(String experimentType) { + this.experimentType = experimentType; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicRiskUnit.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicRiskUnit.java new file mode 100644 index 0000000..ad45de5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicRiskUnit.java @@ -0,0 +1,208 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 基础风险单元管理 + */ +@Entity +@Table(name = "basic_risk_unit") +public class BasicRiskUnit implements Serializable { + private static final long serialVersionUID = 918803445093052137L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getEvaluateStatus() { + return evaluateStatus; + } + + public void setEvaluateStatus(Byte evaluateStatus) { + this.evaluateStatus = evaluateStatus; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicRiskUnitType.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicRiskUnitType.java new file mode 100644 index 0000000..1bd34e9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicRiskUnitType.java @@ -0,0 +1,96 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +@Entity +@Table(name = "basic_risk_unit_type") +public class BasicRiskUnitType implements Serializable { + + private static final long serialVersionUID = -67614776004831997L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 场所类型 + */ + private String riskType; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskType() { + return riskType; + } + + public void setRiskType(String riskType) { + this.riskType = riskType; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicTip.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicTip.java new file mode 100644 index 0000000..2365889 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/BasicTip.java @@ -0,0 +1,96 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +@Entity +@Table(name = "basic_tip") +public class BasicTip implements Serializable { + + private static final long serialVersionUID = -67614776004831997L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 提示信息 + */ + private String tipInfo; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTipInfo() { + return tipInfo; + } + + public void setTipInfo(String tipInfo) { + this.tipInfo = tipInfo; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecC.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecC.java new file mode 100644 index 0000000..d53abe0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecC.java @@ -0,0 +1,99 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子LEC-C + */ +@Entity +@Table(name = "factor_lec_c") +public class FactorLecC implements Serializable { + private static final long serialVersionUID = -55333598853895257L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-S-法律,法规及其它要求 + */ + private String desc; + /** + * LS-S-人员伤亡 + */ + private String person; + /** + * LS-S-直接经济损失 + */ + private String money; + /** + * LS-S-停工 + */ + private String stopWork; + /** + * LS-S-企业形象 + */ + private String company; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecE.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecE.java new file mode 100644 index 0000000..fd087de --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecE.java @@ -0,0 +1,53 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子LEC-E + */ +@Entity +@Table(name = "factor_lec_e") +public class FactorLecE implements Serializable { + private static final long serialVersionUID = 560093075517340201L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-E-标准 + */ + private String desc; + + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecL.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecL.java new file mode 100644 index 0000000..545cdd6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLecL.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子LEC—L + */ +@Entity +@Table(name = "factor_lec_l") +public class FactorLecL implements Serializable { + private static final long serialVersionUID = -10888385883301689L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-L-事故发生的可能性 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLsL.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLsL.java new file mode 100644 index 0000000..bb63f80 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLsL.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子LS-L + */ +@Entity +@Table(name = "factor_ls_l") +public class FactorLsL implements Serializable { + private static final long serialVersionUID = -84696582992525157L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-L-标准 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLsS.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLsS.java new file mode 100644 index 0000000..6d7c956 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorLsS.java @@ -0,0 +1,100 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子LS-S + */ +@Entity +@Table(name = "factor_ls_s") +public class FactorLsS implements Serializable { + private static final long serialVersionUID = 743856976951077393L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-S-法律,法规及其它要求 + */ + private String desc; + /** + * LS-S-人员伤亡 + */ + private String person; + /** + * LS-S-直接经济损失 + */ + private String money; + /** + * LS-S-停工 + */ + private String stopWork; + /** + * LS-S-企业形象 + */ + private String company; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesE.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesE.java new file mode 100644 index 0000000..479edff --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesE.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子MES-E + */ +@Entity +@Table(name = "factor_mes_e") +public class FactorMesE implements Serializable { + private static final long serialVersionUID = 968448586288354800L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-E-E1 + */ + private String e1Desc; + /** + * MES-E-E2 + */ + private String e2Desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getE1Desc() { + return e1Desc; + } + + public void setE1Desc(String e1Desc) { + this.e1Desc = e1Desc; + } + + public String getE2Desc() { + return e2Desc; + } + + public void setE2Desc(String e2Desc) { + this.e2Desc = e2Desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesM.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesM.java new file mode 100644 index 0000000..523dfe5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesM.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子MES-M + */ +@Entity +@Table(name = "factor_mes_m") +public class FactorMesM implements Serializable { + private static final long serialVersionUID = -30012506948345740L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-M-标准 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesS.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesS.java new file mode 100644 index 0000000..e115e2c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorMesS.java @@ -0,0 +1,88 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子MES-S + */ +@Entity +@Table(name = "factor_mes_s") +public class FactorMesS implements Serializable { + private static final long serialVersionUID = 429540548969553519L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-S-法律法规及其他要求 + */ + private String desc; + /** + * MES-S-人员伤亡 + */ + private String person; + /** + * MES-S-直接经济损失(万元) + */ + private String money; + /** + * MES-S-停工 + */ + private String stopWork; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorRsR.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorRsR.java new file mode 100644 index 0000000..43f778b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorRsR.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 评价因子RS-R + */ +@Entity +@Table(name = "factor_rs_r") +public class FactorRsR implements Serializable { + private static final long serialVersionUID = 412266922663919468L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-C-法律法规及其他要求 + */ + private String desc; + /** + * 区间,定量描述 + */ + private String section; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getSection() { + return section; + } + + public void setSection(String section) { + this.section = section; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorRsS.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorRsS.java new file mode 100644 index 0000000..d5dffae --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/entity/FactorRsS.java @@ -0,0 +1,75 @@ +package com.gkhy.labRiskManage.domain.basic.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * 评价因子RS-S + */ +@Entity +@Table(name = "factor_rs_s") +public class FactorRsS implements Serializable { + private static final long serialVersionUID = 832891283436891289L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 分值 + */ + private String value; + /** + * LEC-C-人员伤亡 + */ + private String person; + /** + * LEC-C-直接经济损失(万元) + */ + private String money; + /** + * LEC-C-法律法规及其他要求 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceInsertBO.java new file mode 100644 index 0000000..f70d568 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceInsertBO.java @@ -0,0 +1,189 @@ +package com.gkhy.labRiskManage.domain.basic.model.bo; + +import java.time.LocalDateTime; + +/** + * 基础仪器设备 + */ + +public class DeviceInsertBO { + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceQueryBO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceQueryBO.java new file mode 100644 index 0000000..e268289 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceQueryBO.java @@ -0,0 +1,72 @@ +package com.gkhy.labRiskManage.domain.basic.model.bo; + +public class DeviceQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + + 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 getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceUpdateBO.java new file mode 100644 index 0000000..bfe8483 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/DeviceUpdateBO.java @@ -0,0 +1,167 @@ +package com.gkhy.labRiskManage.domain.basic.model.bo; + +import java.time.LocalDateTime; + +/** + * 基础仪器设备 + */ + +public class DeviceUpdateBO { + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonInsertBO.java new file mode 100644 index 0000000..386b60c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonInsertBO.java @@ -0,0 +1,118 @@ +package com.gkhy.labRiskManage.domain.basic.model.bo; + +/** + * 基础实验人员 + */ +public class PersonInsertBO { + + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonQueryBO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonQueryBO.java new file mode 100644 index 0000000..f9ac119 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonQueryBO.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.domain.basic.model.bo; + +/** + * 基础实验人员 + */ +public class PersonQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 人员 + */ + private String personName; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + + 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 getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonUpdateBO.java new file mode 100644 index 0000000..460f83b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/PersonUpdateBO.java @@ -0,0 +1,127 @@ +package com.gkhy.labRiskManage.domain.basic.model.bo; + +/** + * 基础实验人员 + */ +public class PersonUpdateBO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/SiteInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/SiteInsertBO.java new file mode 100644 index 0000000..4d10075 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/bo/SiteInsertBO.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.domain.basic.model.bo; + +/** + * 基础实验场所管理 + */ + +public class SiteInsertBO { + private Integer pageIndex; + + private Integer pageSize; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + + 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 getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceDeleteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceDeleteDTO.java new file mode 100644 index 0000000..1b99406 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceDeleteDTO.java @@ -0,0 +1,178 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础仪器设备 + */ + +public class DeviceDeleteDTO { + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 数量 + */ + private Integer number; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceInsertDTO.java new file mode 100644 index 0000000..dd9819e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceInsertDTO.java @@ -0,0 +1,174 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + + +import java.time.LocalDateTime; + +public class DeviceInsertDTO { + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 数量 + */ + private Integer number; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceQueryDTO.java new file mode 100644 index 0000000..c8368e6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceQueryDTO.java @@ -0,0 +1,244 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +public class DeviceQueryDTO { + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 数量 + */ + private Integer number; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceTypeDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceTypeDTO.java new file mode 100644 index 0000000..c7f2014 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceTypeDTO.java @@ -0,0 +1,29 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +public class DeviceTypeDTO { + + + private Long id; + /** + * 设备类型 + */ + private String deviceType; + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceUpdateDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceUpdateDTO.java new file mode 100644 index 0000000..5fd6698 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/DeviceUpdateDTO.java @@ -0,0 +1,178 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础仪器设备 + */ + +public class DeviceUpdateDTO { + + private Long id; + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + /** + * 数量 + */ + private Integer number; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 设备类型id + */ + private Long deviceTypeId; + /** + * 设备类型 + */ + private String deviceType; + /** + * 设备型号 + */ + private String deviceDesc; + /** + * 设备状态:1-完好 ;2-异常 + */ + private Byte deviceStatus; + /** + * 购入时间 + */ + private LocalDateTime buyTime; + /** + * 校准时间 + */ + private LocalDateTime adjustTime; + + public Long getDeviceTypeId() { + return deviceTypeId; + } + + public void setDeviceTypeId(Long deviceTypeId) { + this.deviceTypeId = deviceTypeId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getDeviceDesc() { + return deviceDesc; + } + + public void setDeviceDesc(String deviceDesc) { + this.deviceDesc = deviceDesc; + } + + public Byte getDeviceStatus() { + return deviceStatus; + } + + public void setDeviceStatus(Byte deviceStatus) { + this.deviceStatus = deviceStatus; + } + + public LocalDateTime getBuyTime() { + return buyTime; + } + + public void setBuyTime(LocalDateTime buyTime) { + this.buyTime = buyTime; + } + + public LocalDateTime getAdjustTime() { + return adjustTime; + } + + public void setAdjustTime(LocalDateTime adjustTime) { + this.adjustTime = adjustTime; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecCDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecCDTO.java new file mode 100644 index 0000000..eaec03a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecCDTO.java @@ -0,0 +1,91 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LEC-C + */ +public class FactorLecCDTO{ + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-S-法律,法规及其它要求 + */ + private String desc; + /** + * LS-S-人员伤亡 + */ + private String person; + /** + * LS-S-直接经济损失 + */ + private String money; + /** + * LS-S-停工 + */ + private String stopWork; + /** + * LS-S-企业形象 + */ + private String company; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecEDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecEDTO.java new file mode 100644 index 0000000..dfd6e89 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecEDTO.java @@ -0,0 +1,47 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LEC-E + */ + +public class FactorLecEDTO{ + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-E-标准 + */ + private String desc; + + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecLDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecLDTO.java new file mode 100644 index 0000000..5be8ac4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLecLDTO.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LEC—L + */ +public class FactorLecLDTO{ + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-L-事故发生的可能性 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLsLDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLsLDTO.java new file mode 100644 index 0000000..4e74be8 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLsLDTO.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LS-L + */ +public class FactorLsLDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-L-标准 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLsSDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLsSDTO.java new file mode 100644 index 0000000..ff6e38c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorLsSDTO.java @@ -0,0 +1,93 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.math.BigDecimal; + +/** + * 评价因子LS-S + */ +public class FactorLsSDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LS-S-法律,法规及其它要求 + */ + private String desc; + /** + * LS-S-人员伤亡 + */ + private String person; + /** + * LS-S-直接经济损失 + */ + private String money; + /** + * LS-S-停工 + */ + private String stopWork; + /** + * LS-S-企业形象 + */ + private String company; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesEDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesEDTO.java new file mode 100644 index 0000000..e5a6f65 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesEDTO.java @@ -0,0 +1,58 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import javax.persistence.*; +import java.math.BigDecimal; + +/** + * 评价因子MES-E + */ +public class FactorMesEDTO{ + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-E-E1 + */ + private String e1Desc; + /** + * MES-E-E2 + */ + private String e2Desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getE1Desc() { + return e1Desc; + } + + public void setE1Desc(String e1Desc) { + this.e1Desc = e1Desc; + } + + public String getE2Desc() { + return e2Desc; + } + + public void setE2Desc(String e2Desc) { + this.e2Desc = e2Desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesMDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesMDTO.java new file mode 100644 index 0000000..882b113 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesMDTO.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.math.BigDecimal; + +/** + * 评价因子MES-M + */ +public class FactorMesMDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-M-标准 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesSDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesSDTO.java new file mode 100644 index 0000000..bc21900 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorMesSDTO.java @@ -0,0 +1,81 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.math.BigDecimal; + +/** + * 评价因子MES-S + */ +public class FactorMesSDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * MES-S-法律法规及其他要求 + */ + private String desc; + /** + * MES-S-人员伤亡 + */ + private String person; + /** + * MES-S-直接经济损失(万元) + */ + private String money; + /** + * MES-S-停工 + */ + private String stopWork; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getStopWork() { + return stopWork; + } + + public void setStopWork(String stopWork) { + this.stopWork = stopWork; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorRsRDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorRsRDTO.java new file mode 100644 index 0000000..f118a84 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorRsRDTO.java @@ -0,0 +1,57 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.math.BigDecimal; + +/** + * 评价因子RS-R + */ +public class FactorRsRDTO { + + private Long id; + /** + * 分值 + */ + private BigDecimal value; + /** + * LEC-C-法律法规及其他要求 + */ + private String desc; + /** + * 区间,定量描述 + */ + private String section; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getValue() { + return value; + } + + public void setValue(BigDecimal value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getSection() { + return section; + } + + public void setSection(String section) { + this.section = section; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorRsSDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorRsSDTO.java new file mode 100644 index 0000000..dfaac27 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/FactorRsSDTO.java @@ -0,0 +1,68 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + + +/** + * 评价因子RS-S + */ +public class FactorRsSDTO { + + private Long id; + /** + * 分值 + */ + private String value; + /** + * LEC-C-人员伤亡 + */ + private String person; + /** + * LEC-C-直接经济损失(万元) + */ + private String money; + /** + * LEC-C-法律法规及其他要求 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getPerson() { + return person; + } + + public void setPerson(String person) { + this.person = person; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonDeleteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonDeleteDTO.java new file mode 100644 index 0000000..0b2ff21 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonDeleteDTO.java @@ -0,0 +1,176 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验人员 + */ +public class PersonDeleteDTO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonInsertDTO.java new file mode 100644 index 0000000..7df1156 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonInsertDTO.java @@ -0,0 +1,129 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验人员 + */ +public class PersonInsertDTO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonListDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonListDTO.java new file mode 100644 index 0000000..21de075 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonListDTO.java @@ -0,0 +1,127 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +/** + * 基础实验人员 + */ +public class PersonListDTO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonQueryDTO.java new file mode 100644 index 0000000..8b74738 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonQueryDTO.java @@ -0,0 +1,199 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验人员 + */ +public class PersonQueryDTO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonUpdateDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonUpdateDTO.java new file mode 100644 index 0000000..739cda8 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/PersonUpdateDTO.java @@ -0,0 +1,127 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +/** + * 基础实验人员 + */ +public class PersonUpdateDTO { + + private Long id; + /** + * 人员 + */ + private String personName; + /** + * 年龄 + */ + private Integer personAge; + /** + * 1-男;2-女 + */ + private Byte personGender; + /** + * 专业 + */ + private String personMajor; + /** + * 部门名称(与基础部门无关) + */ + private String depName; + /** + * 相关资质 + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训 + */ + private Byte training; + /** + * 手机号 + */ + private Long phone; + /** + * 头像 + */ + private String image; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPhone() { + return phone; + } + + public void setPhone(Long phone) { + this.phone = phone; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskSourceTypeDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskSourceTypeDTO.java new file mode 100644 index 0000000..262c04e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskSourceTypeDTO.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +/** + * 基本危险因素类型 + */ +public class RiskSourceTypeDTO { + + private Long id; + /** + * 危险源种类 + */ + private String riskSourceType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(String riskSourceType) { + this.riskSourceType = riskSourceType; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitBasicDeleteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitBasicDeleteDTO.java new file mode 100644 index 0000000..a62ae50 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitBasicDeleteDTO.java @@ -0,0 +1,138 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +/** + * 基础风险单元管理 + */ +public class RiskUnitBasicDeleteDTO { + + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getEvaluateStatus() { + return evaluateStatus; + } + + public void setEvaluateStatus(Byte evaluateStatus) { + this.evaluateStatus = evaluateStatus; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitBasicQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitBasicQueryDTO.java new file mode 100644 index 0000000..35f0331 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitBasicQueryDTO.java @@ -0,0 +1,223 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础风险单元管理 + */ +public class RiskUnitBasicQueryDTO { + + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 新建人姓名 + */ + private String liabilityUserName; + + public String getLiabilityUserName() { + return liabilityUserName; + } + + public void setLiabilityUserName(String liabilityUserName) { + this.liabilityUserName = liabilityUserName; + } + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getEvaluateStatus() { + return evaluateStatus; + } + + public void setEvaluateStatus(Byte evaluateStatus) { + this.evaluateStatus = evaluateStatus; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitInsertDTO.java new file mode 100644 index 0000000..88b5f50 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitInsertDTO.java @@ -0,0 +1,140 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础风险单元管理 + */ +public class RiskUnitInsertDTO { + + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getEvaluateStatus() { + return evaluateStatus; + } + + public void setEvaluateStatus(Byte evaluateStatus) { + this.evaluateStatus = evaluateStatus; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitListDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitListDTO.java new file mode 100644 index 0000000..14c5ea7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitListDTO.java @@ -0,0 +1,78 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +/** + * 基础实验耗材管理 + */ +public class RiskUnitListDTO { + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险单元描述 + */ + private String description; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitTypeDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitTypeDTO.java new file mode 100644 index 0000000..031193a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitTypeDTO.java @@ -0,0 +1,33 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +public class RiskUnitTypeDTO{ + + + private Long id; + /** + * 场所类型 + */ + private String riskType; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRiskType() { + return riskType; + } + + public void setRiskType(String riskType) { + this.riskType = riskType; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitUpdateDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitUpdateDTO.java new file mode 100644 index 0000000..1bb0163 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/RiskUnitUpdateDTO.java @@ -0,0 +1,138 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +/** + * 基础风险单元管理 + */ +public class RiskUnitUpdateDTO { + + private Long id; + /** + * 风险源id + */ + private Long riskSourceId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门id + */ + private Long liabilityDepId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + + public String getLiabilityDep() { + return liabilityDep; + } + + public void setLiabilityDep(String liabilityDep) { + this.liabilityDep = liabilityDep; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRiskSourceId() { + return riskSourceId; + } + + public void setRiskSourceId(Long riskSourceId) { + this.riskSourceId = riskSourceId; + } + + public String getRiskCode() { + return riskCode; + } + + public void setRiskCode(String riskCode) { + this.riskCode = riskCode; + } + + public String getRiskName() { + return riskName; + } + + public void setRiskName(String riskName) { + this.riskName = riskName; + } + + public Byte getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(Byte riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getEvaluateStatus() { + return evaluateStatus; + } + + public void setEvaluateStatus(Byte evaluateStatus) { + this.evaluateStatus = evaluateStatus; + } + + public Long getLiabilityUserId() { + return liabilityUserId; + } + + public void setLiabilityUserId(Long liabilityUserId) { + this.liabilityUserId = liabilityUserId; + } + + public Long getLiabilityDepId() { + return liabilityDepId; + } + + public void setLiabilityDepId(Long liabilityDepId) { + this.liabilityDepId = liabilityDepId; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteDeleteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteDeleteDTO.java new file mode 100644 index 0000000..af4958b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteDeleteDTO.java @@ -0,0 +1,201 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验场所管理 + */ + +public class SiteDeleteDTO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteListDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteListDTO.java new file mode 100644 index 0000000..b449eab --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteListDTO.java @@ -0,0 +1,150 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +/** + * 基础实验场所管理 + */ + +public class SiteListDTO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteQueryDTO.java new file mode 100644 index 0000000..1f0e2ee --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteQueryDTO.java @@ -0,0 +1,223 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验场所管理 + */ + +public class SiteQueryDTO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteTypeDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteTypeDTO.java new file mode 100644 index 0000000..e2d9823 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteTypeDTO.java @@ -0,0 +1,28 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +public class SiteTypeDTO { + + private Long id; + /** + * 场所类型 + */ + private String siteType; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteUpdateDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteUpdateDTO.java new file mode 100644 index 0000000..5eb20f9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/SiteUpdateDTO.java @@ -0,0 +1,204 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 基础实验场所管理 + */ + +public class SiteUpdateDTO { + + private Long id; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; + + public Long getSiteLiabilityPersonId() { + return siteLiabilityPersonId; + } + + public void setSiteLiabilityPersonId(Long siteLiabilityPersonId) { + this.siteLiabilityPersonId = siteLiabilityPersonId; + } + + + public Long getSafeLiabilityPersonId() { + return safeLiabilityPersonId; + } + + public void setSafeLiabilityPersonId(Long safeLiabilityPersonId) { + this.safeLiabilityPersonId = safeLiabilityPersonId; + } + + public String getSiteLiabilityPerson() { + return siteLiabilityPerson; + } + + public void setSiteLiabilityPerson(String siteLiabilityPerson) { + this.siteLiabilityPerson = siteLiabilityPerson; + } + + public String getSafeLiabilityPerson() { + return safeLiabilityPerson; + } + + public void setSafeLiabilityPerson(String safeLiabilityPerson) { + this.safeLiabilityPerson = safeLiabilityPerson; + } + + public Byte getFireFacilities() { + return fireFacilities; + } + + public void setFireFacilities(Byte fireFacilities) { + this.fireFacilities = fireFacilities; + } + + public Byte getPartitionStatus() { + return partitionStatus; + } + + public void setPartitionStatus(Byte partitionStatus) { + this.partitionStatus = partitionStatus; + } + + public Long getSiteTypeId() { + return siteTypeId; + } + + public void setSiteTypeId(Long siteTypeId) { + this.siteTypeId = siteTypeId; + } + + public String getSiteType() { + return siteType; + } + + public void setSiteType(String siteType) { + this.siteType = siteType; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffDeleteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffDeleteDTO.java new file mode 100644 index 0000000..137498b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffDeleteDTO.java @@ -0,0 +1,128 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class StuffDeleteDTO { + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffInsertDTO.java new file mode 100644 index 0000000..9607164 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffInsertDTO.java @@ -0,0 +1,82 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class StuffInsertDTO { + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffListDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffListDTO.java new file mode 100644 index 0000000..c34042a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffListDTO.java @@ -0,0 +1,80 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class StuffListDTO { + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffQueryDTO.java new file mode 100644 index 0000000..b1da02b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffQueryDTO.java @@ -0,0 +1,151 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import java.time.LocalDateTime; + +/** + * 基础实验耗材管理 + */ +public class StuffQueryDTO { + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + + public String getUpdateByUserName() { + return updateByUserName; + } + + public void setUpdateByUserName(String updateByUserName) { + this.updateByUserName = updateByUserName; + } + + public String getCreateByUserName() { + return createByUserName; + } + + public void setCreateByUserName(String createByUserName) { + this.createByUserName = createByUserName; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffUpdateDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffUpdateDTO.java new file mode 100644 index 0000000..a340c7b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/StuffUpdateDTO.java @@ -0,0 +1,78 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +/** + * 基础实验耗材管理 + */ +public class StuffUpdateDTO { + + private Long id; + /** + * 实验材料 + */ + private String stuffName; + /** + * 编号 + */ + private String stuffCode; + /** + * 材料类型:1-化学试剂;2-基础材料 + */ + private Byte stuffType; + /** + * 材料储存:1-智能试剂柜;2-普通储存柜 + */ + private Byte stuffStorage; + /** + * 计量单位:1-g;2-kg;3-ml;4-L + */ + private Byte stuffUnit; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/TipDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/TipDTO.java new file mode 100644 index 0000000..f1a2030 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/TipDTO.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + + +public class TipDTO { + + + private Long id; + /** + * 提示信息 + */ + private String tipInfo; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTipInfo() { + return tipInfo; + } + + public void setTipInfo(String tipInfo) { + this.tipInfo = tipInfo; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/TypeListDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/TypeListDTO.java new file mode 100644 index 0000000..4c14515 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/model/dto/TypeListDTO.java @@ -0,0 +1,87 @@ +package com.gkhy.labRiskManage.domain.basic.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 基础实验类型 + */ +@Entity +@Table(name = "basic_experiment_type") +public class TypeListDTO implements Serializable { + private static final long serialVersionUID = 787995438729244617L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private String experimentType; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getExperimentType() { + return experimentType; + } + + public void setExperimentType(String experimentType) { + this.experimentType = experimentType; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentDeviceRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentDeviceRepository.java new file mode 100644 index 0000000..ffa0d1e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentDeviceRepository.java @@ -0,0 +1,61 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentDevice; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * 基础实验设备 + */ +@Repository +public interface BasicExperimentDeviceRepository extends JpaRepository<BasicExperimentDevice, Long>, JpaSpecificationExecutor<BasicExperimentDevice> { + + /** + * 查询设备 - by id + * */ + @Query(value = "select t from BasicExperimentDevice t where t.id = :id and t.deleteStatus = 0") + BasicExperimentDevice getDeviceById(Long id); + + /** + * 查询设备 - by deviceCode + * */ + @Query(value = "select t from BasicExperimentDevice t where t.deviceCode = :deviceCode and t.deleteStatus = 0") + BasicExperimentDevice getDeviceByCode(String deviceCode); + + /** + * 查询设备 - by deviceName + * */ + @Query(value = "select t from BasicExperimentDevice t where t.deviceName = :deviceName and t.deleteStatus = 0") + BasicExperimentDevice getDeviceByName(String deviceName); + + /** + * 基础仪器设备表 - 删除 + * */ + @Query(value = "update BasicExperimentDevice t set t.deleteStatus = 0 where t.id = :id") + int deleteBasicExperimentDevice(Long id); + + /** + * 基础仪器设备表 - 设备列表 - 查询所有 + * */ + @Query(value = "select t from BasicExperimentDevice t where t.deleteStatus = 0") + List<BasicExperimentDevice> listDevice(); + + /** + * 基础仪器设备表 - 设备列表 - 查询相关 + * */ + @Query(value = "select t from BasicExperimentDevice t where t.createByUserId = :currentUserId and t.deleteStatus = 0") + List<BasicExperimentDevice> listDeviceByUserId(Long currentUserId); + + /** + * 基础仪器设备表 - 通过id列表查询 + * */ + @Query(value = "select t from BasicExperimentDevice t where t.id in (?1) and t.deleteStatus = 0") + List<BasicExperimentDevice> batchById(List<Long> ids); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentDeviceTypeRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentDeviceTypeRepository.java new file mode 100644 index 0000000..d916284 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentDeviceTypeRepository.java @@ -0,0 +1,32 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentDeviceType; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceTypeDTO; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * 基础实验设备类型 + */ +@Repository +public interface BasicExperimentDeviceTypeRepository extends JpaRepository<BasicExperimentDeviceType, Long>, JpaSpecificationExecutor<BasicExperimentDeviceType> { + + /** + * 基础实验人员 - 根据名字查询 + */ + @Query(value = "select t from BasicExperimentDeviceType t where t.id = :deviceTypeId and t.deleteStatus = 0") + BasicExperimentDeviceType getDeviceTypeById(Long deviceTypeId); + + /** + * 基础字典 - 设备类型 + * */ + @Query(value = "select t from BasicExperimentDeviceType t where t.deleteStatus = 0") + List<BasicExperimentDeviceType> listDeviceType(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentPersonRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentPersonRepository.java new file mode 100644 index 0000000..ba5ac6a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentPersonRepository.java @@ -0,0 +1,53 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentPerson; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * 基础实验人员 + */ +@Repository +public interface BasicExperimentPersonRepository extends JpaRepository<BasicExperimentPerson, Long>, JpaSpecificationExecutor<BasicExperimentPerson> { + + /** + * 基础实验人员 - 根据名字查询 + */ + @Query(value = "select t from BasicExperimentPerson t where t.personName = :personName and t.deleteStatus = 0") + BasicExperimentPerson getPersonByName(String personName); + + /** + * 基础实验人员 - 根据手机号查询 + */ + @Query(value = "select t from BasicExperimentPerson t where t.phone = :phone and t.deleteStatus = 0") + BasicExperimentPerson getPersonByPhone(Long phone); + + /** + * 基础实验人员 - 根据手机号查询 + */ + @Query(value = "select t from BasicExperimentPerson t where t.id = :id and t.deleteStatus = 0") + BasicExperimentPerson getPersonById(Long id); + + /** + * 基础实验人员 - 列表 -查询所有 + */ + @Query(value = "select t from BasicExperimentPerson t where t.deleteStatus = 0") + List<BasicExperimentPerson> listPerson(Long currentUserId); + + /** + * 基础实验人员 - 列表- 查询相关 + */ + @Query(value = "select t from BasicExperimentPerson t where createByUserId = :currentUserId and t.deleteStatus = 0") + List<BasicExperimentPerson> listPersonByUserId(Long currentUserId); + /** + * 基础实验人员 - 通过id列表查询 + * */ + @Query(value = "select t from BasicExperimentPerson t where t.id in (?1) and t.deleteStatus = 0") + List<BasicExperimentPerson> batchById(List<Long> ids); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentRiskSourceTypeRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentRiskSourceTypeRepository.java new file mode 100644 index 0000000..f9c3f21 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentRiskSourceTypeRepository.java @@ -0,0 +1,24 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentRiskSourceType; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface BasicExperimentRiskSourceTypeRepository extends JpaRepository<BasicExperimentRiskSourceType, Long>, JpaSpecificationExecutor<BasicExperimentRiskSourceType> { + + /** + * 实验风险类型 - 列表 + * */ + @Query(value = "select t from BasicExperimentRiskSourceType t where t.deleteStatus = 0") + List<BasicExperimentRiskSourceType> listBasicRiskSourceType(); + /** + * 实验风险类型 - + * */ + @Query(value = "select t from BasicExperimentRiskSourceType t where t.id =:id and t.deleteStatus = 0") + BasicExperimentRiskSourceType getTypeById(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentSiteRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentSiteRepository.java new file mode 100644 index 0000000..d7577df --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentSiteRepository.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * 基础实验场所 + */ +@Repository +public interface BasicExperimentSiteRepository extends JpaRepository<BasicExperimentSite, Long>, JpaSpecificationExecutor<BasicExperimentSite> { + + /** + * 基础场所管理 - 新增 + * */ + @Query(value = "select t from BasicExperimentSite t where t.siteName = :siteName and t.room = :room and t.deleteStatus = 0") + BasicExperimentSite getSiteByFloorAndRoom(String siteName, String room); + /** + * 基础场所管理 - 按照id查询 + * */ + @Query(value = "select t from BasicExperimentSite t where t.id = :id and t.deleteStatus = 0") + BasicExperimentSite getSiteById(Long id); + /** + * 基础场所管理 - 按照id查询 + * */ + @Query(value = "select t from BasicExperimentSite t where t.deleteStatus = 0") + List<BasicExperimentSite> listSite(); + /** + * 基础场所管理 - 按照id查询 + * */ + @Query(value = "select t from BasicExperimentSite t where t.createByUserId = :currentUserId and t.deleteStatus = 0") + List<BasicExperimentSite> listSiteByUserId(Long currentUserId); + + /** + * 基础场所管理 - 通过id列表查询 + * */ + @Query(value = "select t from BasicExperimentSite t where t.id in (?1) and t.deleteStatus = 0") + List<BasicExperimentSite> batchById(List<Long> ids); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentSiteTypeRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentSiteTypeRepository.java new file mode 100644 index 0000000..434f922 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentSiteTypeRepository.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSiteType; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteTypeDTO; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * 基础实验场所类型 + */ +@Repository +public interface BasicExperimentSiteTypeRepository extends JpaRepository<BasicExperimentSiteType, Long>, JpaSpecificationExecutor<BasicExperimentSiteType> { + + /** + * 基础实验场所类型 - 查询 by id + */ + @Query(value = "select t from BasicExperimentSiteType t where t.id = :siteTypeId and t.deleteStatus = 0") + BasicExperimentSiteType getSiteTypeById(Long siteTypeId); + + /** + * 基础字典 - 场所类型 + * */ + @Query(value = "select t from BasicExperimentSiteType t where t.deleteStatus = 0") + List<BasicExperimentSiteType> listSiteType(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentStuffRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentStuffRepository.java new file mode 100644 index 0000000..3cb7b4e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentStuffRepository.java @@ -0,0 +1,44 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentStuff; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 基础实验耗材 + */ +@Repository +public interface BasicExperimentStuffRepository extends JpaRepository<BasicExperimentStuff, Long>, JpaSpecificationExecutor<BasicExperimentStuff> { + + /** + * 基础实验耗材 - 通过名字查询 + */ + @Query(value = "select t from BasicExperimentStuff t where t.stuffName = :stuffName and t.deleteStatus = 0") + BasicExperimentStuff getStuffByName(String stuffName); + /** + * 基础实验耗材 - 通过id + */ + @Query(value = "select t from BasicExperimentStuff t where t.id = :id and t.deleteStatus = 0") + BasicExperimentStuff getStuffById(Long id); + /** + * 基础实验耗材管理 - 列表 + */ + @Query(value = "select t from BasicExperimentStuff t where t.deleteStatus = 0") + List<BasicExperimentStuff> listStuff(Long currentUserId); + /** + * 基础实验耗材管理 - 列表 + */ + @Query(value = "select t from BasicExperimentStuff t where t.createByUserId = :currentUserId and t.deleteStatus = 0") + List<BasicExperimentStuff> listStuffByUserId(Long currentUserId); + /** + * 基础实验耗材管理 - 通过id列表项 + */ + @Query(value = "select t from BasicExperimentStuff t where t.id in (?1) and t.deleteStatus = 0") + List<BasicExperimentStuff> batchById(List<Long> ids); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentTypeRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentTypeRepository.java new file mode 100644 index 0000000..426bcf3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicExperimentTypeRepository.java @@ -0,0 +1,24 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentType; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 基础实验类型 + */ +@Repository +public interface BasicExperimentTypeRepository extends JpaRepository<BasicExperimentType, Long>, JpaSpecificationExecutor<BasicExperimentType> { + + /** + * 基础实验类型 - 列表 + */ + @Query(value = "select t from BasicExperimentType t where t.deleteStatus = 0") + List<BasicExperimentType> listType(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicRiskUnitRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicRiskUnitRepository.java new file mode 100644 index 0000000..e9e88f1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicRiskUnitRepository.java @@ -0,0 +1,50 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnit; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 固有风险单元 + */ +@Repository +public interface BasicRiskUnitRepository extends JpaRepository<BasicRiskUnit, Long>, JpaSpecificationExecutor<BasicRiskUnit> { + + /** + * 固有风险单元 - 通过Code查询 + */ + @Query(value = "select t from BasicRiskUnit t where t.riskCode = :riskCode and t.deleteStatus = 0") + BasicRiskUnit getRiskUnitByCode(String riskCode); + /** + * 固有风险单元 - 通过name查询 + */ + @Query(value = "select t from BasicRiskUnit t where t.riskName = :riskName and t.deleteStatus = 0") + BasicRiskUnit getRiskUnitByName(String riskName); + /** + * 固有风险单元 - id + */ + @Query(value = "select t from BasicRiskUnit t where t.id = :id and t.deleteStatus = 0") + BasicRiskUnit getRiskUnitById(Long id); + /** + * 固有风险单元 - id + */ + @Query(value = "select t from BasicRiskUnit t where t.evaluateStatus = 2 and t.deleteStatus = 0") + List<BasicRiskUnit> listRiskUnit(); + /** + * 固有风险单元 - id + */ + @Query(value = "select t from BasicRiskUnit t where t.createByUserId = :currentUserId and t.evaluateStatus = 2 and t.deleteStatus = 0") + List<BasicRiskUnit> listRiskUnitByUserId(Long currentUserId); + + /** + * 基础风险单元管理 - 通过id列表查询 + */ + @Query(value = "select t from BasicRiskUnit t where t.id in (?1) and t.deleteStatus = 0") + List<BasicRiskUnit> batchById(List<Long> ids); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicRiskUnitTypeRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicRiskUnitTypeRepository.java new file mode 100644 index 0000000..611a6bf --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicRiskUnitTypeRepository.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnitType; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitTypeDTO; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 风险单元类型 + * */ +@Repository +public interface BasicRiskUnitTypeRepository extends JpaRepository<BasicRiskUnitType, Long>, JpaSpecificationExecutor<BasicRiskUnitType> { + + + @Query(value = "select t from BasicRiskUnitType t where t.id = :id and t.deleteStatus = 0") + BasicRiskUnitType getRiskUnitTypeById(Long id); + + + @Query(value = "select t from BasicRiskUnitType t where t.deleteStatus = 0") + List<BasicRiskUnitType> listRiskUnitType(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicTipRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicTipRepository.java new file mode 100644 index 0000000..42059e5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/BasicTipRepository.java @@ -0,0 +1,20 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicTip; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 风险单元类型 + * */ +@Repository +public interface BasicTipRepository extends JpaRepository<BasicTip, Long>, JpaSpecificationExecutor<BasicTip> { + + + @Query(value = "select t from BasicTip t where t.deleteStatus = 0") + List<BasicTip> listTip(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecCRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecCRepository.java new file mode 100644 index 0000000..c9d8f18 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecCRepository.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecC; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子LEC-C + */ +@Repository +public interface FactorLecCRepository extends JpaRepository<FactorLecC, Long> , JpaSpecificationExecutor<FactorLecC> { + + /** + * 评价因子LEC-C 列表 + */ + @Query(value = "select t from FactorLecC t ") + List<FactorLecC> listLecC(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecERepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecERepository.java new file mode 100644 index 0000000..f08bb75 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecERepository.java @@ -0,0 +1,24 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecE; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子LEC-E + */ +@Repository +public interface FactorLecERepository extends JpaRepository<FactorLecE, Long> , JpaSpecificationExecutor<FactorLecE> { + + /** + * 评价因子LEC-E 列表 + */ + @Query(value = "select t from FactorLecE t ") + List<FactorLecE> listLecE(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecLRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecLRepository.java new file mode 100644 index 0000000..21b38db --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLecLRepository.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecL; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子LEC—L + */ +@Repository +public interface FactorLecLRepository extends JpaRepository<FactorLecL, Long> , JpaSpecificationExecutor<FactorLecL> { + + /** + * 评价因子LEC-L 列表 + */ + @Query(value = "select t from FactorLecL t ") + List<FactorLecL> listLecL(); + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLsLRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLsLRepository.java new file mode 100644 index 0000000..79c3075 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLsLRepository.java @@ -0,0 +1,26 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecC; +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecL; +import com.gkhy.labRiskManage.domain.basic.entity.FactorLsL; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子LS-L + */ +@Repository +public interface FactorLsLRepository extends JpaRepository<FactorLsL, Long>, JpaSpecificationExecutor<FactorLecL> { + + /** + * 评价因子LS-L 列表 + */ + @Query(value = "select t from FactorLsL t ") + List<FactorLsL> listLecC(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLsSRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLsSRepository.java new file mode 100644 index 0000000..92cb720 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorLsSRepository.java @@ -0,0 +1,26 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecC; +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecL; +import com.gkhy.labRiskManage.domain.basic.entity.FactorLsS; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子LS-S + */ +@Repository +public interface FactorLsSRepository extends JpaRepository<FactorLsS, Long>, JpaSpecificationExecutor<FactorLecL> { + + /** + * 评价因子LS-S 列表 + */ + @Query(value = "select t from FactorLsS t ") + List<FactorLsS> listLecC(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesERepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesERepository.java new file mode 100644 index 0000000..7aa44bd --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesERepository.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecL; +import com.gkhy.labRiskManage.domain.basic.entity.FactorMesE; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子MES-E + */ +@Repository +public interface FactorMesERepository extends JpaRepository<FactorMesE, Long>, JpaSpecificationExecutor<FactorLecL> { + + /** + * 评价因子Mes-E 列表 + */ + @Query(value = "select t from FactorMesE t ") + List<FactorMesE> listMesE(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesMRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesMRepository.java new file mode 100644 index 0000000..30960ca --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesMRepository.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecL; +import com.gkhy.labRiskManage.domain.basic.entity.FactorMesM; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子MES-M + */ +@Repository +public interface FactorMesMRepository extends JpaRepository<FactorMesM, Long>, JpaSpecificationExecutor<FactorLecL> { + + /** + * 评价因子Mes-M 列表 + */ + @Query(value = "select t from FactorMesM t ") + List<FactorMesM> listMesM(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesSRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesSRepository.java new file mode 100644 index 0000000..0c35a6d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorMesSRepository.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecL; +import com.gkhy.labRiskManage.domain.basic.entity.FactorMesS; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子MES-S + */ +@Repository +public interface FactorMesSRepository extends JpaRepository<FactorMesS, Long>, JpaSpecificationExecutor<FactorLecL> { + + /** + * 评价因子Mes-S 列表 + */ + @Query(value = "select t from FactorMesS t ") + List<FactorMesS> listMesS(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorRsRRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorRsRRepository.java new file mode 100644 index 0000000..0b268eb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorRsRRepository.java @@ -0,0 +1,26 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecL; +import com.gkhy.labRiskManage.domain.basic.entity.FactorMesS; +import com.gkhy.labRiskManage.domain.basic.entity.FactorRsR; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子RS-R + */ +@Repository +public interface FactorRsRRepository extends JpaRepository<FactorRsR, Long>, JpaSpecificationExecutor<FactorLecL> { + + /** + * 评价因子Rs-R 列表 + */ + @Query(value = "select t from FactorRsR t ") + List<FactorRsR> listRsR(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorRsSRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorRsSRepository.java new file mode 100644 index 0000000..eba73cf --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/repository/jpa/FactorRsSRepository.java @@ -0,0 +1,26 @@ +package com.gkhy.labRiskManage.domain.basic.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.FactorLecL; +import com.gkhy.labRiskManage.domain.basic.entity.FactorMesS; +import com.gkhy.labRiskManage.domain.basic.entity.FactorRsS; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价因子RS-S + */ +@Repository +public interface FactorRsSRepository extends JpaRepository<FactorRsS, Long>, JpaSpecificationExecutor<FactorLecL> { + + /** + * 评价因子Rs-S 列表 + */ + @Query(value = "select t from FactorRsS t ") + List<FactorRsS> listRsS(); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentDeviceService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentDeviceService.java new file mode 100644 index 0000000..136e577 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentDeviceService.java @@ -0,0 +1,51 @@ +package com.gkhy.labRiskManage.domain.basic.service; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppUpdateBO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentDeviceAppListDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceDeleteDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceInsertDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceQueryDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceUpdateDTO; + +import java.util.List; + +/** + * 基础仪器设备表 + */ +public interface BasicExperimentDeviceService { + + /** + * 基础仪器设备表 - 新增 + * */ + DeviceInsertDTO insertBasicExperimentDevice(Long currentUserId, BasicExperimentDeviceAppInsertBO basicExperimentDeviceAppInsertBO); + + /** + * 基础仪器设备表 - 分页查询 + * */ + SearchResult<DeviceQueryDTO> getBasicExperimentDevicePage(Long currentUserId,BasicExperimentDeviceAppQueryBO queryParam); + + /** + * 基础仪器设备表 - 修改 + * */ + DeviceUpdateDTO updateBasicExperimentDevice(Long currentUserId, BasicExperimentDeviceAppUpdateBO updateParam); + /** + * 基础仪器设备表 - 删除 + * */ + DeviceDeleteDTO deleteBasicExperimentDevice(Long currentUserId, Long id); + /** + * 基础仪器设备表 - 设备列表 + * */ + List<BasicExperimentDeviceAppListDTO> listBasicExperimentDevice(Long currentUserId); + + /** + * 基础仪器设备表 - 通过id查询 + * */ + DeviceQueryDTO getBasicExperimentDeviceById(Long id); + /** + * 基础仪器设备表 - 通过id列表查询 + * */ + List<DeviceQueryDTO> getBasicExperimentDeviceByIdList(List<Long> ids); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentDeviceTypeService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentDeviceTypeService.java new file mode 100644 index 0000000..2da02b0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentDeviceTypeService.java @@ -0,0 +1,23 @@ +package com.gkhy.labRiskManage.domain.basic.service; + + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentDeviceType; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceTypeDTO; + +import java.util.List; + +/** + * 基础仪器设备类型表 + */ +public interface BasicExperimentDeviceTypeService { + + /** + * 基础仪器设备类型 - 查询 by id + */ + BasicExperimentDeviceType getDeviceTypeById(Long deviceTypeId); + + /** + * 基础字典 - 设备类型 + * */ + List<DeviceTypeDTO> listDeviceType(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentPersonService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentPersonService.java new file mode 100644 index 0000000..86ae0d5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentPersonService.java @@ -0,0 +1,51 @@ +package com.gkhy.labRiskManage.domain.basic.service; + + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppUpdateBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; + +import java.util.List; + +/** + * 基础实验人员管理 + */ +public interface BasicExperimentPersonService { + + /** + * 基础实验人员 - 插入 + * */ + PersonInsertDTO insertBasicExperimentPerson(Long currentUserId, BasicExperimentPersonAppInsertBO personAppInsertDO); + /** + * 基础实验人员 - 分页查询 + * */ + SearchResult<PersonQueryDTO> getBasicExperimentPersonPage(Long currentUserId, BasicExperimentPersonAppQueryBO queryParam); + /** + * 基础实验人员 - 修改 + * */ + PersonUpdateDTO updateBasicExperimentPerson(Long currentUserId, BasicExperimentPersonAppUpdateBO updateParam); + /** + * 基础实验人员 - 删除 + * */ + PersonDeleteDTO deleteBasicExperimentPerson(Long currentUserId, Long id); + /** + * 基础实验人员 - 列表 + * */ + List<PersonListDTO> listBasicExperimentPerson(Long currentUserId); + /** + * 基础实验人员 - 查询 by id + * */ + PersonQueryDTO getBasicExperimentPersonById(Long id); + /** + * 基础实验人员 - 通过id列表查询 + * */ + List<PersonQueryDTO> getBasicExperimentPersonByIdList(List<Long> ids); + + + /** + * 基础实验人员 - 查询 by id --评估计划使用 + * */ + PersonQueryDTO getPersonByIdAndSellInfo(Long id, String Info); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentRiskSourceTypeService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentRiskSourceTypeService.java new file mode 100644 index 0000000..5022ccb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentRiskSourceTypeService.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.service; + +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskSourceTypeDTO; + +import java.util.List; + +public interface BasicExperimentRiskSourceTypeService { + + /** + * 实验风险类型 - 列表 + * */ + List<RiskSourceTypeDTO> listBasicRiskSourceType(); + /** + * 实验风险类型 - 列表 + * */ + RiskSourceTypeDTO getTypeById(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentSiteService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentSiteService.java new file mode 100644 index 0000000..c808764 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentSiteService.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.domain.basic.service; + +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicExperimentSiteInsertReqBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentSiteAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentSiteAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentSiteAppUpdateBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteDeleteDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteListDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteQueryDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteUpdateDTO; + +import java.util.List; + +/** + * 基础实验场所管理 + */ +public interface BasicExperimentSiteService { + + /** + * 基础场所管理 - 新增 + * */ + BasicExperimentSite insertBasicExperimentSite(Long currentUserId, BasicExperimentSiteAppInsertBO insertParam); + + /** + * 基础场所管理 - 分页查询 + * */ + SearchResult<SiteQueryDTO> selectBasicExperimentSitePage(Long currentUserId, BasicExperimentSiteAppQueryBO queryParam); + /** + * 基础场所管理 - 修改 + * */ + SiteUpdateDTO updateBasicExperimentSite(Long currentUserId, BasicExperimentSiteAppUpdateBO updateParam); + + /** + * 基础场所管理 - 删除 + * */ + SiteDeleteDTO deleteBasicExperimentSite(Long currentUserId, Long id); + /** + * 基础场所管理 - 列表 + * */ + List<SiteListDTO> listBasicExperimentSite(Long currentUserId); + + /** + * 基础场所管理 - 通过id查询 + * */ + SiteQueryDTO getBasicExperimentSiteById(Long id); + /** + * 基础场所管理 - 通过id列表查询 + * */ + List<SiteQueryDTO> getBasicExperimentSiteByIdList(List<Long> ids); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentSiteTypeService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentSiteTypeService.java new file mode 100644 index 0000000..9e8ad6e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentSiteTypeService.java @@ -0,0 +1,21 @@ +package com.gkhy.labRiskManage.domain.basic.service; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSiteType; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteTypeDTO; + +import java.util.List; + +/** + * 基础实验场所类型管理 + */ +public interface BasicExperimentSiteTypeService { + + /** + * 基础实验场所类型管理 + */ + BasicExperimentSiteType getSiteTypeById(Long siteTypeId); + /** + * 基础字典 - 场所类型 + * */ + List<SiteTypeDTO> listSiteType(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentStuffService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentStuffService.java new file mode 100644 index 0000000..62c4210 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentStuffService.java @@ -0,0 +1,45 @@ +package com.gkhy.labRiskManage.domain.basic.service; + +import com.gkhy.labRiskManage.api.controller.basic.dto.repDto.BasicRiskUnitInsertReqBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentStuffAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentStuffAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentStuffAppUpdateBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; + +import java.util.List; + +/** + * 基础实验耗材管理 + */ +public interface BasicExperimentStuffService { + + /** + * 基础实验耗材管理 - 新增 + */ + StuffInsertDTO insertBasicExperimentStuff(Long currentUserId, BasicExperimentStuffAppInsertBO insertParam); + /** + * 基础实验耗材管理 - 分页查询 + */ + SearchResult<StuffQueryDTO> selectBasicExperimentStuffPage(Long currentUserId, BasicExperimentStuffAppQueryBO queryParam); + /** + * 基础实验耗材管理 - 修改 + */ + StuffUpdateDTO updateBasicExperimentSite(Long currentUserId, BasicExperimentStuffAppUpdateBO updateParam); + /** + * 基础实验耗材管理 - 删除 + */ + StuffDeleteDTO deleteBasicExperimentStuff(Long currentUserId, Long id); + /** + * 基础实验耗材管理 - 列表 + */ + List<StuffListDTO> listBasicExperimentStuff(Long currentUserId); + /** + * 基础实验耗材管理 - 查询 by id + */ + StuffQueryDTO getBasicExperimentStuffById(Long id); + /** + * 基础实验耗材管理 - 通过id列表查询 + */ + List<StuffQueryDTO> getBasicExperimentStuffByIdList(List<Long> ids); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentTypeService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentTypeService.java new file mode 100644 index 0000000..3dd6d30 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicExperimentTypeService.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.basic.service; + + +import com.gkhy.labRiskManage.domain.basic.model.dto.TypeListDTO; + +import java.util.List; + +/** + * 基础实验类型 + */ +public interface BasicExperimentTypeService { + + /** + * 基础实验类型 - 列表 + */ + List<TypeListDTO> listBasicExperimentType(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicRiskUnitService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicRiskUnitService.java new file mode 100644 index 0000000..383c085 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicRiskUnitService.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.domain.basic.service; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicRiskUnitAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicRiskUnitAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicRiskUnitAppUpdateBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; + +import java.util.List; + +/** + * 基础风险单元管理 + */ +public interface BasicRiskUnitService { + + /** + * 基础风险单元管理 - 插入 + */ + RiskUnitInsertDTO insertBasicRiskUnit(Long currentUserId, BasicRiskUnitAppInsertBO insertReqBO); + /** + * 基础风险单元管理 - 分页查询 + */ + SearchResult<RiskUnitBasicQueryDTO> selectBasicRiskUnitPage(Long currentUserId, BasicRiskUnitAppQueryBO queryParam); + /** + * 基础风险单元管理 - 修改 + */ + RiskUnitUpdateDTO updateBasicRiskUnit(Long currentUserId, BasicRiskUnitAppUpdateBO updateParam); + /** + * 基础风险单元管理 - 删除 + */ + RiskUnitBasicDeleteDTO deleteBasicRiskUnit(Long currentUserId, Long id); + /** + * 基础风险单元管理 - 列表 + */ + List<RiskUnitListDTO> listBasicRiskUnit(Long currentUserId); + /** + * 基础风险单元管理 - 通过id查询 + */ + RiskUnitBasicQueryDTO getBasicRiskUnitById(Long id); + /** + * 基础风险单元管理 - 通过id列表查询 + */ + List<RiskUnitBasicQueryDTO> getBasicRiskUnitByIdList(List<Long> ids); + + RiskUnitUpdateDTO updateRiskUnitStatus(Long riskUnitId, int status); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicRiskUnitTypeService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicRiskUnitTypeService.java new file mode 100644 index 0000000..f42ec7a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicRiskUnitTypeService.java @@ -0,0 +1,16 @@ +package com.gkhy.labRiskManage.domain.basic.service; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnitType; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitTypeDTO; + +import java.util.List; + +public interface BasicRiskUnitTypeService { + + + BasicRiskUnitType getRiskUnitTypeById(Long id); + /** + * 基础字典 - 风险类型 + * */ + List<RiskUnitTypeDTO> listRiskUnitType(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicTipService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicTipService.java new file mode 100644 index 0000000..ecb9186 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/BasicTipService.java @@ -0,0 +1,14 @@ +package com.gkhy.labRiskManage.domain.basic.service; + + +import com.gkhy.labRiskManage.domain.basic.model.dto.TipDTO; + +import java.util.List; + +public interface BasicTipService { + + /** + * 基础字典 - 友情提示 + * */ + List<TipDTO> listTip(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/FactorService.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/FactorService.java new file mode 100644 index 0000000..c0cfdb5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/FactorService.java @@ -0,0 +1,51 @@ +package com.gkhy.labRiskManage.domain.basic.service; + +import com.gkhy.labRiskManage.domain.basic.model.dto.*; + +import java.util.List; + +/** + *评价因子 + */ +public interface FactorService { + /** + * 评价因子LEC-L 列表 + */ + List<FactorLecLDTO> listLecL(); + /** + * 评价因子LEC-E 列表 + */ + List<FactorLecEDTO> listLecE(); + /** + * 评价因子LEC-C 列表 + */ + List<FactorLecCDTO> listLecC(); + /** + * 评价因子LS-L 列表 + */ + List<FactorLsLDTO> listLsL(); + /** + * 评价因子LS-S 列表 + */ + List<FactorLsSDTO> listLsS(); + /** + * 评价因子Mes-M 列表 + */ + List<FactorMesMDTO> listMesM(); + /** + * 评价因子Mes-E 列表 + */ + List<FactorMesEDTO> listMesE(); + /** + * 评价因子Mes-S 列表 + */ + List<FactorMesSDTO> listMesS(); + /** + * 评价因子Rs-R 列表 + */ + List<FactorRsRDTO> listRsR(); + /** + * 评价因子Rs-S 列表 + */ + List<FactorRsSDTO> listRsS(); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentDeviceServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentDeviceServiceImpl.java new file mode 100644 index 0000000..d116619 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentDeviceServiceImpl.java @@ -0,0 +1,407 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentDeviceAppUpdateBO; +import com.gkhy.labRiskManage.application.basic.dto.dto.BasicExperimentDeviceAppListDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.enums.UserTagEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.converter.ToBasicDeviceInfoConverter; +import com.gkhy.labRiskManage.domain.basic.converter.ToQueryDeviceBOConverter; +import com.gkhy.labRiskManage.domain.basic.converter.ToUpdateDeviceBOConverter; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentDevice; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentDeviceType; +import com.gkhy.labRiskManage.domain.basic.model.bo.DeviceInsertBO; +import com.gkhy.labRiskManage.domain.basic.model.bo.DeviceQueryBO; +import com.gkhy.labRiskManage.domain.basic.model.bo.DeviceUpdateBO; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicExperimentDeviceRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentDeviceService; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentDeviceTypeService; +import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +/** + * 基础仪器设备表 + */ +@Service +public class BasicExperimentDeviceServiceImpl implements BasicExperimentDeviceService { + + @Autowired + private BasicExperimentDeviceRepository basicExperimentDeviceRepository; + @Autowired + private UserDomainService userDomainService; + @Autowired + private BasicExperimentDeviceTypeService deviceTypeService; + + + /** + * 基础仪器设备表 - 新增 + * */ + @Override + public DeviceInsertDTO insertBasicExperimentDevice(Long currentUserId, BasicExperimentDeviceAppInsertBO basicExperimentDeviceAppInsertBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + //接收、转换参数 + ToBasicDeviceInfoConverter deviceParam = new ToBasicDeviceInfoConverter(); + DeviceInsertBO deviceInsertBO = deviceParam.toBasicDeviceInfoConvert(basicExperimentDeviceAppInsertBO); + + //参数校验 + if (ObjectUtils.isEmpty(deviceInsertBO.getDeviceCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备编码不能为空"); + } + BasicExperimentDevice deviceByCode = basicExperimentDeviceRepository.getDeviceByCode(deviceInsertBO.getDeviceCode()); +// if (!ObjectUtils.isEmpty(deviceByCode)){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"设备编码已存在"); +// } + if (ObjectUtils.isEmpty(deviceInsertBO.getDeviceName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备名称不能为空"); + } + BasicExperimentDevice deviceByName = basicExperimentDeviceRepository.getDeviceByName(deviceInsertBO.getDeviceName()); +// if (!ObjectUtils.isEmpty(deviceByName)){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"设备名称已存在"); +// } + if (ObjectUtils.isEmpty(deviceInsertBO.getSpecialDevice())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备类型不能为空"); + } + if (ObjectUtils.isEmpty(deviceInsertBO.getDevicePower())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备功率不能为空"); + } + if (ObjectUtils.isEmpty(deviceInsertBO.getDeviceUnit())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备计量单位不能为空"); + } + if (ObjectUtils.isEmpty(deviceInsertBO.getDeviceTypeId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备类型不能为空"); + } + BasicExperimentDeviceType deviceTypeById = deviceTypeService.getDeviceTypeById(deviceInsertBO.getDeviceTypeId()); + if (ObjectUtils.isEmpty(deviceTypeById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"找不到该类型的设备,请检查输入是否正确,或者先添加设备类型"); + } + if (ObjectUtils.isEmpty(deviceInsertBO.getDeviceDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备型号不能为空"); + } + if (ObjectUtils.isEmpty(deviceInsertBO.getDeviceStatus())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备状态不能为空"); + } + if (ObjectUtils.isEmpty(deviceInsertBO.getBuyTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备购买时间不能为空"); + } + if (ObjectUtils.isEmpty(deviceInsertBO.getAdjustTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备校准时间不能为空"); + } + //获取需要的参数 + LocalDateTime date = LocalDateTime.now(); + if (date.isBefore(deviceInsertBO.getBuyTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备购买时间不能在当前时间之后"); + } + if (date.isBefore(deviceInsertBO.getAdjustTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备校准时间不能在当前时间之后"); + } + if (deviceInsertBO.getAdjustTime().isBefore(deviceInsertBO.getBuyTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备校准时间不能在购买时间之后"); + } + //获取需要的参数 + BasicExperimentDevice device = BeanCopyUtils.copyBean(deviceInsertBO, BasicExperimentDevice.class); + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + + + device.setCreateTime(date); + device.setUpdateTime(date); + device.setCreateByUserId(userInfoById.getId()); + device.setUpdateByUserId(userInfoById.getId()); + device.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + device.setDeviceType(deviceTypeById.getDeviceType()); + + BasicExperimentDevice saveResult = basicExperimentDeviceRepository.save(device); + + DeviceInsertDTO deviceInsertDTO = BeanCopyUtils.copyBean(saveResult, DeviceInsertDTO.class); + + return deviceInsertDTO; + } + + /** + * 基础仪器设备表 - 分页查询 + * */ + @Override + public SearchResult<DeviceQueryDTO> getBasicExperimentDevicePage(Long currentUserId, BasicExperimentDeviceAppQueryBO deviceQueryBO) { + + //校验参数 + if (ObjectUtils.isEmpty(deviceQueryBO.getPageSize())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(deviceQueryBO.getPageIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (deviceQueryBO.getDeviceCode() == ""){ + deviceQueryBO.setDeviceCode(null); + } + if (deviceQueryBO.getDevicePower() == ""){ + deviceQueryBO.setDevicePower(null); + } + if (deviceQueryBO.getDeviceName() == ""){ + deviceQueryBO.setDeviceName(null); + } + + ToQueryDeviceBOConverter toQueryDeviceBOConverter = new ToQueryDeviceBOConverter(); + DeviceQueryBO queryPageParam = toQueryDeviceBOConverter.ToQueryDeviceDTOConverter(deviceQueryBO); + + SearchResult searchResult = new SearchResult<>(); + + searchResult.setPageIndex(queryPageParam.getPageIndex()); + searchResult.setPageSize(queryPageParam.getPageSize()); + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + //组装查询条件 + Specification<BasicExperimentDevice> specification = new Specification<BasicExperimentDevice>() { + @Override + public Predicate toPredicate(Root<BasicExperimentDevice> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + if (deviceQueryBO.getDeviceCode() != null && !deviceQueryBO.getDeviceCode().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("deviceCode"), deviceQueryBO.getDeviceCode())); + } + if (deviceQueryBO.getDeviceName() != null && !deviceQueryBO.getDeviceName().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("deviceName"), deviceQueryBO.getDeviceName())); + } + if (deviceQueryBO.getDevicePower() != null && !deviceQueryBO.getDevicePower().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("devicePower"), deviceQueryBO.getDevicePower())); + } + if (deviceQueryBO.getSpecialDevice() != null && !deviceQueryBO.getSpecialDevice().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("specialDevice"), deviceQueryBO.getSpecialDevice())); + } + if (roleTag == UserTagEnum.USER_TAG_0.getCode()){ + predicateList.add(criteriaBuilder.equal(root.get("createByUserId"), currentUserId)); + } + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode())); + //返回组装的条件 + return criteriaBuilder.and(predicateList.toArray(predicateList.toArray(new Predicate[0]))); + } + }; + + PageRequest page = PageRequest.of(queryPageParam.getPageIndex() - 1, queryPageParam.getPageSize(), Sort.Direction.DESC, "updateTime"); + + Page<BasicExperimentDevice> pageResult = basicExperimentDeviceRepository.findAll(specification, page); + List<DeviceQueryDTO> deviceQueryDTO = BeanCopyUtils.copyBeanList(pageResult.getContent(), DeviceQueryDTO.class); + + List<UserInfoDomainDTO> userList = userDomainService.getUserList(); + for (DeviceQueryDTO queryDTO : deviceQueryDTO) { + for (UserInfoDomainDTO userInfo : userList) { + if (userInfo.getId() == queryDTO.getCreateByUserId()){ + queryDTO.setCreateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == queryDTO.getUpdateByUserId()){ + queryDTO.setUpdateByUserName(userInfo.getRealName()); + } + } + } + + + searchResult.setTotal(pageResult.getTotalElements()); + searchResult.setData(deviceQueryDTO); + + return searchResult; + } + + /** + * 基础仪器设备表 - 修改 + * */ + @Override + public DeviceUpdateDTO updateBasicExperimentDevice(Long currentUserId, BasicExperimentDeviceAppUpdateBO deviceAppUpdateDO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + //接收、转换参数 + ToUpdateDeviceBOConverter converter = new ToUpdateDeviceBOConverter(); + DeviceUpdateBO updateDeviceParam = converter.toUpdateDeviceDO(deviceAppUpdateDO); + + //参数校验 + if (ObjectUtils.isEmpty(updateDeviceParam.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "修改参数错误"); + } + BasicExperimentDevice deviceById = basicExperimentDeviceRepository.getDeviceById(updateDeviceParam.getId()); + if (ObjectUtils.isEmpty(deviceById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "要修改的数据不存在,或已被删除"); + } + + if (ObjectUtils.isEmpty(deviceAppUpdateDO.getDeviceCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备编码不能为空"); + } + BasicExperimentDevice deviceByCode = basicExperimentDeviceRepository.getDeviceByCode(deviceAppUpdateDO.getDeviceCode()); +// if (!ObjectUtils.isEmpty(deviceByCode) && !deviceByCode.getId().equals(updateDeviceParam.getId())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"设备编码已存在"); +// } + if (ObjectUtils.isEmpty(deviceAppUpdateDO.getDeviceName()) && !deviceByCode.getId().equals(updateDeviceParam.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备名称不能为空"); + } +// BasicExperimentDevice deviceByName = basicExperimentDeviceRepository.getDeviceByName(deviceAppUpdateDO.getDeviceName()); +// if (!ObjectUtils.isEmpty(deviceByName)){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"设备名称已存在"); +// } + + if (ObjectUtils.isEmpty(deviceAppUpdateDO.getSpecialDevice())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备类型不能为空"); + } + if (ObjectUtils.isEmpty(deviceAppUpdateDO.getDevicePower())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备功率不能为空"); + } + if (ObjectUtils.isEmpty(deviceAppUpdateDO.getDeviceUnit())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备计量单位不能为空"); + } + if (ObjectUtils.isEmpty(deviceAppUpdateDO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"找不到该类型的设备,请检查输入是否正确,或者先添加设备类型"); + } + if (ObjectUtils.isEmpty(deviceAppUpdateDO.getDeviceDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备型号不能为空"); + } + if (ObjectUtils.isEmpty(deviceAppUpdateDO.getDeviceStatus())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备状态不能为空"); + } + if (ObjectUtils.isEmpty(deviceAppUpdateDO.getBuyTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备购买时间不能为空"); + } + if (ObjectUtils.isEmpty(deviceAppUpdateDO.getAdjustTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备校准时间不能为空"); + } + //获取需要的参数 + LocalDateTime date = LocalDateTime.now(); + if (date.isBefore(deviceAppUpdateDO.getBuyTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备购买时间不能在当前时间之后"); + } + if (date.isBefore(deviceAppUpdateDO.getAdjustTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备校准时间不能在当前时间之后"); + } + if (deviceAppUpdateDO.getAdjustTime().isBefore(deviceAppUpdateDO.getBuyTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"设备校准时间不能在购买时间之后"); + } + BasicExperimentDevice device = BeanCopyUtils.copyBean(deviceById, BasicExperimentDevice.class); + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + + device.setUpdateTime(date); + device.setUpdateByUserId(userInfoById.getId()); + + device.setDeviceCode(updateDeviceParam.getDeviceCode()); + device.setDeviceName(updateDeviceParam.getDeviceName()); + device.setDevicePower(updateDeviceParam.getDevicePower()); + device.setDeviceUnit(updateDeviceParam.getDeviceUnit()); + device.setSpecialDevice(updateDeviceParam.getSpecialDevice()); + device.setSafeProtect(updateDeviceParam.getSafeProtect()); + device.setDeviceTypeId(updateDeviceParam.getDeviceTypeId()); + device.setDeviceType(updateDeviceParam.getDeviceType()); + device.setDeviceDesc(updateDeviceParam.getDeviceDesc()); + device.setDeviceStatus(updateDeviceParam.getDeviceStatus()); + device.setBuyTime(updateDeviceParam.getBuyTime()); + device.setAdjustTime(updateDeviceParam.getAdjustTime()); + + BasicExperimentDevice saveResult = basicExperimentDeviceRepository.save(device); + + DeviceUpdateDTO deviceUpdateDTO = BeanCopyUtils.copyBean(saveResult, DeviceUpdateDTO.class); + + return deviceUpdateDTO; + } + + /** + * 基础仪器设备表 - 删除 + * */ + @Override + public DeviceDeleteDTO deleteBasicExperimentDevice(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"请选择正常的设备进行删除"); + } + BasicExperimentDevice deviceById = basicExperimentDeviceRepository.getDeviceById(id); + if (ObjectUtils.isEmpty(deviceById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode() ,"要删除的设备不存在,或已被删除"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + + LocalDateTime date = LocalDateTime.now(); + //设置数据为删除 + deviceById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + deviceById.setUpdateByUserId(userInfoById.getId()); + deviceById.setUpdateTime(date); + + BasicExperimentDevice deleteResult = basicExperimentDeviceRepository.save(deviceById); + + return BeanCopyUtils.copyBean(deleteResult, DeviceDeleteDTO.class); + } + + /** + * 基础仪器设备表 - 设备列表 + * */ + @Override + public List<BasicExperimentDeviceAppListDTO> listBasicExperimentDevice(Long currentUserId) { + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + List<BasicExperimentDevice> deviceList = new ArrayList<>(); + if (roleTag != UserTagEnum.USER_TAG_0.getCode()){ + deviceList = basicExperimentDeviceRepository.listDevice(); + }else { + deviceList = basicExperimentDeviceRepository.listDeviceByUserId(currentUserId); + } + + return BeanCopyUtils.copyBeanList(deviceList, BasicExperimentDeviceAppListDTO.class); + } + + /** + * 基础仪器设备表 - 通过id查询 + * */ + @Override + public DeviceQueryDTO getBasicExperimentDeviceById(Long id) { + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数不能为空"); + } + BasicExperimentDevice deviceById = basicExperimentDeviceRepository.getDeviceById(id); + + if (ObjectUtils.isEmpty(deviceById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "风险源信息不存在,请检查是否输入有误或已被删除"); + } + return BeanCopyUtils.copyBean(deviceById, DeviceQueryDTO.class); + } + + /** + * 基础仪器设备表 - 通过id列表查询 + * */ + @Override + public List<DeviceQueryDTO> getBasicExperimentDeviceByIdList(List<Long> ids) { + if (ids.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请求参数不能为空"); + } + + List<BasicExperimentDevice> listResult = basicExperimentDeviceRepository.batchById(ids); + if (listResult.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "查询结果为空"); + } + + return BeanCopyUtils.copyBeanList(listResult, DeviceQueryDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentDeviceTypeServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentDeviceTypeServiceImpl.java new file mode 100644 index 0000000..3392e6d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentDeviceTypeServiceImpl.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + + +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentDeviceType; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceTypeDTO; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicExperimentDeviceTypeRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentDeviceTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.util.List; + +/** + * 基础仪器设备表 + */ +@Service +public class BasicExperimentDeviceTypeServiceImpl implements BasicExperimentDeviceTypeService { + + @Autowired + private BasicExperimentDeviceTypeRepository deviceTypeRepository; + + /** + * 基础仪器设备类型 - 查询 by id + */ + @Override + public BasicExperimentDeviceType getDeviceTypeById(Long deviceTypeId) { + + return deviceTypeRepository.getDeviceTypeById(deviceTypeId); + } + + /** + * 基础字典 - 设备类型 + * */ + @Override + public List<DeviceTypeDTO> listDeviceType() { + + List<BasicExperimentDeviceType> listDeviceType = deviceTypeRepository.listDeviceType(); + if (ObjectUtils.isEmpty(listDeviceType)){ + return null; + } + + return BeanCopyUtils.copyBeanList(listDeviceType, DeviceTypeDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentPersonServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentPersonServiceImpl.java new file mode 100644 index 0000000..b50d9f2 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentPersonServiceImpl.java @@ -0,0 +1,357 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentPersonAppUpdateBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.enums.UserTagEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.converter.ToInsertPersonBOConverter; +import com.gkhy.labRiskManage.domain.basic.converter.ToQueryPersonBOConverter; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentPerson; +import com.gkhy.labRiskManage.domain.basic.model.bo.PersonInsertBO; +import com.gkhy.labRiskManage.domain.basic.model.bo.PersonQueryBO; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicExperimentPersonRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService; +import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +/** + * 基础实验人员管理 + */ +@Service +public class BasicExperimentPersonServiceImpl implements BasicExperimentPersonService { + + @Autowired + private BasicExperimentPersonRepository personRepository; + @Autowired + private UserDomainService userDomainService; + + /** + * 基础实验人员 - 插入 + * */ + @Override + public PersonInsertDTO insertBasicExperimentPerson(Long currentUserId, BasicExperimentPersonAppInsertBO personAppInsertDO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + + //接收,转换参数 todo ,目前所有信息,缺乏唯一性标识。需要如身份证,手机号,人员身份码之类的信息 + ToInsertPersonBOConverter converter = new ToInsertPersonBOConverter(); + PersonInsertBO personInsertBO = converter.toInsertPersonDTO(personAppInsertDO); + + //参数校验 + if (ObjectUtils.isEmpty(personInsertBO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "人员信息不能为空"); + } + if (ObjectUtils.isEmpty(personInsertBO.getPersonName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "姓名不能为空"); + } + if (ObjectUtils.isEmpty(personInsertBO.getPersonAge())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "年龄不能为空"); + } + if (ObjectUtils.isEmpty(personInsertBO.getPersonGender())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "性别不能为空"); + } + if (ObjectUtils.isEmpty(personInsertBO.getPersonMajor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "专业不能为空"); + } +// if (ObjectUtils.isEmpty(insertPersonDO.getDepName())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所属部门不能为空"); +// } todo 暂时没有部门 + if (ObjectUtils.isEmpty(personInsertBO.getAptitude())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "相关资质不能为空"); + } + if (ObjectUtils.isEmpty(personInsertBO.getTraining())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "培训情况不能为空"); + } + if (ObjectUtils.isEmpty(personInsertBO.getPhone())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "手机号不能为空"); + } + BasicExperimentPerson personByPhone = personRepository.getPersonByPhone(personInsertBO.getPhone()); + if (!ObjectUtils.isEmpty(personByPhone)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "手机号已被使用"); + } + + BasicExperimentPerson person = BeanCopyUtils.copyBean(personInsertBO, BasicExperimentPerson.class); + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + //获取参数 + LocalDateTime date = LocalDateTime.now(); + //封装参数 + person.setCreateByUserId(userInfoById.getId()); + person.setCreateTime(date); + person.setUpdateByUserId(userInfoById.getId()); + person.setUpdateTime(date); + person.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + + + BasicExperimentPerson saveResult = personRepository.save(person); + return BeanCopyUtils.copyBean(saveResult, PersonInsertDTO.class); + } + + /** + * 基础实验人员 - 分页查询 + * */ + @Override + public SearchResult<PersonQueryDTO> getBasicExperimentPersonPage(Long currentUserId, BasicExperimentPersonAppQueryBO queryParam) { + + //校验参数 + if (ObjectUtils.isEmpty(queryParam.getPageSize())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(queryParam.getPageIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (queryParam.getPersonName() == ""){ + queryParam.setPersonName(null); + } + if (queryParam.getDepName() == ""){ + queryParam.setDepName(null); + } + + //接收,转换参数 + ToQueryPersonBOConverter converter = new ToQueryPersonBOConverter(); + PersonQueryBO queryPageParam = converter.toQueryPersonDOConverter(queryParam); + + SearchResult searchResult = new SearchResult<>(); + + searchResult.setPageIndex(queryPageParam.getPageIndex()); + searchResult.setPageSize(queryPageParam.getPageSize()); + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + //封装查询参数 + Specification<BasicExperimentPerson> specification = new Specification<BasicExperimentPerson>() { + @Override + public Predicate toPredicate(Root<BasicExperimentPerson> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + if (queryPageParam.getPersonName() != null && !queryPageParam.getPersonName().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("personName"), queryPageParam.getPersonName())); + } + if (queryPageParam.getDepName() != null && !queryPageParam.getDepName().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("depName"), queryPageParam.getDepName())); + } + if (queryPageParam.getTraining() != null && !queryPageParam.getTraining().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("training"), queryPageParam.getTraining())); + } + if (roleTag == UserTagEnum.USER_TAG_0.getCode()){ + predicateList.add(criteriaBuilder.equal(root.get("createByUserId"), currentUserId)); + } + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode())); + return criteriaBuilder.and(predicateList.toArray(new Predicate[0])); + } + }; + PageRequest pageParam = PageRequest.of(queryPageParam.getPageIndex() - 1, queryPageParam.getPageSize(), Sort.Direction.DESC, "updateTime"); + + Page<BasicExperimentPerson> pageResult = personRepository.findAll(specification, pageParam); + List<PersonQueryDTO> personQueryDTOS = BeanCopyUtils.copyBeanList(pageResult.getContent(), PersonQueryDTO.class); + + List<UserInfoDomainDTO> userList = userDomainService.getUserList(); + for (PersonQueryDTO personQueryDTO : personQueryDTOS) { + for (UserInfoDomainDTO userInfo : userList) { + if (userInfo.getId() == personQueryDTO.getCreateByUserId()){ + personQueryDTO.setCreateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == personQueryDTO.getUpdateByUserId()){ + personQueryDTO.setUpdateByUserName(userInfo.getRealName()); + } + } + } + + searchResult.setData(personQueryDTOS); + searchResult.setTotal(pageResult.getTotalElements()); + + return searchResult; + } + + /** + * 基础实验人员 - 修改 + * */ + @Override + public PersonUpdateDTO updateBasicExperimentPerson(Long currentUserId, BasicExperimentPersonAppUpdateBO updateParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + + //参数校验 + if (ObjectUtils.isEmpty(updateParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "人员信息不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getPersonName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "姓名不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getPersonAge())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "年龄不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getPersonGender())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "性别不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getPersonMajor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "专业不能为空"); + } +// if (ObjectUtils.isEmpty(insertPersonDO.getDepName())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所属部门不能为空"); +// } todo 暂时没有部门 + if (ObjectUtils.isEmpty(updateParam.getAptitude())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "相关资质不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getTraining())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "培训情况不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getPhone())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "手机号不能为空"); + } + BasicExperimentPerson personByPhone = personRepository.getPersonByPhone(updateParam.getPhone()); +// if (!ObjectUtils.isEmpty(personByPhone) && updateParam.getId() != personByPhone.getId()){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "手机号已被使用"); +// } + + BasicExperimentPerson personById = personRepository.getPersonById(updateParam.getId()); + BasicExperimentPerson person = BeanCopyUtils.copyBean(personById, BasicExperimentPerson.class); + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + + //获取参数 + LocalDateTime date = LocalDateTime.now(); + //封装参数 + person.setUpdateByUserId(userInfoById.getId()); + person.setUpdateTime(date); + person.setPersonName(updateParam.getPersonName()); + person.setPersonAge(updateParam.getPersonAge()); + person.setPersonGender(updateParam.getPersonGender()); + person.setPersonMajor(updateParam.getPersonMajor()); + person.setDepName(updateParam.getDepName()); + person.setAptitude(updateParam.getAptitude()); + person.setTraining(updateParam.getTraining()); + person.setPhone(updateParam.getPhone()); + person.setImage(updateParam.getImage()); + + //更新数据 + BasicExperimentPerson saveResult = personRepository.save(person); + + return BeanCopyUtils.copyBean(saveResult, PersonUpdateDTO.class); + } + + /** + * 基础实验人员 - 删除 + * */ + @Override + public PersonDeleteDTO deleteBasicExperimentPerson(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + + //校验参数 + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数错误"); + } + BasicExperimentPerson personById = personRepository.getPersonById(id); + if (ObjectUtils.isEmpty(personById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "该人员不存在,或已被删除"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + LocalDateTime date = LocalDateTime.now(); + //设置数据为删除 + personById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + personById.setUpdateByUserId(userInfoById.getId()); + personById.setUpdateTime(date); + //执行数据更新 + BasicExperimentPerson deleteResult = personRepository.save(personById); + + return BeanCopyUtils.copyBean(deleteResult, PersonDeleteDTO.class); + } + + /** + * 基础实验人员 - 列表 + * */ + @Override + public List<PersonListDTO> listBasicExperimentPerson(Long currentUserId) { + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + List<BasicExperimentPerson> peopleList = new ArrayList<>(); + + if (roleTag != UserTagEnum.USER_TAG_0.getCode()){ + peopleList = personRepository.listPerson(currentUserId); + }else { + peopleList = personRepository.listPersonByUserId(currentUserId); + } + return BeanCopyUtils.copyBeanList(peopleList, PersonListDTO.class); + } + + /** + * 基础实验人员 - 查询 by id + * */ + @Override + public PersonQueryDTO getBasicExperimentPersonById(Long id) { + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数不能为空"); + } + + BasicExperimentPerson personById = personRepository.getPersonById(id); + + if (ObjectUtils.isEmpty(personById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请检查是否输入有误或人员已被删除"); + } + return BeanCopyUtils.copyBean(personById, PersonQueryDTO.class); + } + + /** + * 基础实验人员 - 查询 by id --评估计划使用 + * */ + @Override + public PersonQueryDTO getPersonByIdAndSellInfo(Long id, String Info) { + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数不能为空"); + } + + BasicExperimentPerson personById = personRepository.getPersonById(id); + + if (ObjectUtils.isEmpty(personById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), Info + "不存在,请检查是否输入有误或人员已被删除"); + } + return BeanCopyUtils.copyBean(personById, PersonQueryDTO.class); + } + + /** + * 基础实验人员 - 通过id列表查询 + * */ + @Override + public List<PersonQueryDTO> getBasicExperimentPersonByIdList(List<Long> ids) { + if (ids.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请求参数不能为空"); + } + + List<BasicExperimentPerson> listResult = personRepository.batchById(ids); + if (listResult.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "查询结果为空"); + } + + return BeanCopyUtils.copyBeanList(listResult, PersonQueryDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentRiskSourceTypeServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentRiskSourceTypeServiceImpl.java new file mode 100644 index 0000000..91ed0c0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentRiskSourceTypeServiceImpl.java @@ -0,0 +1,38 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentRiskSourceType; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskSourceTypeDTO; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicExperimentRiskSourceTypeRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentRiskSourceTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class BasicExperimentRiskSourceTypeServiceImpl implements BasicExperimentRiskSourceTypeService { + + @Autowired + private BasicExperimentRiskSourceTypeRepository typeRepository; + + /** + * 实验风险类型 - 列表 + * */ + @Override + public List<RiskSourceTypeDTO> listBasicRiskSourceType() { + + List<BasicExperimentRiskSourceType> queryResult = typeRepository.listBasicRiskSourceType(); + return BeanCopyUtils.copyBeanList(queryResult, RiskSourceTypeDTO.class); + } + + /** + * 实验风险类型 - + * */ + @Override + public RiskSourceTypeDTO getTypeById(Long id) { + + BasicExperimentRiskSourceType typeById = typeRepository.getTypeById(id); + return BeanCopyUtils.copyBean(typeById, RiskSourceTypeDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentSiteServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentSiteServiceImpl.java new file mode 100644 index 0000000..cf006ec --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentSiteServiceImpl.java @@ -0,0 +1,369 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentSiteAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentSiteAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentSiteAppUpdateBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.enums.UserTagEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSiteType; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicExperimentSiteRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteService; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteTypeService; +import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +/** + * 基础实验场所管理 + */ +@Service +public class BasicExperimentSiteServiceImpl implements BasicExperimentSiteService { + + @Autowired + private BasicExperimentSiteRepository siteRepository; + @Autowired + private UserDomainService userDomainService; + @Autowired + private BasicExperimentSiteTypeService siteTypeService; + @Autowired + private BasicExperimentPersonService basicPersonService; + + /** + * 基础场所管理 - 新增 + * */ + @Override + public BasicExperimentSite insertBasicExperimentSite(Long currentUserId, BasicExperimentSiteAppInsertBO insertParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + //校验参数 + if(ObjectUtils.isEmpty(insertParam.getSiteName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所名称不能为空"); + } + if(ObjectUtils.isEmpty(insertParam.getFloor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所楼层不能为空"); + } + if(ObjectUtils.isEmpty(insertParam.getRoom())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所房间号不能为空"); + } + BasicExperimentSite siteByFloorAndRoom = siteRepository.getSiteByFloorAndRoom(insertParam.getSiteName(), insertParam.getRoom()); +// if (!ObjectUtils.isEmpty(siteByFloorAndRoom)){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "该区域已被使用,请检查输入是否正确,或需要改变该区域用处"); +// } + + if(ObjectUtils.isEmpty(insertParam.getPartitionStatus())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请填写该场所是否有隔断情况"); + } + if(ObjectUtils.isEmpty(insertParam.getFireFacilities())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请填写该场所是否有消防设施"); + } + + if(ObjectUtils.isEmpty(insertParam.getSiteLiabilityPersonId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所负责人不能为空"); + } + PersonQueryDTO siteLiabilityPerson = basicPersonService.getBasicExperimentPersonById(insertParam.getSiteLiabilityPersonId()); + if(ObjectUtils.isEmpty(siteLiabilityPerson)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所负责人不存在"); + } + + if(ObjectUtils.isEmpty(insertParam.getSafeLiabilityPersonId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所安全员不能为空"); + } + PersonQueryDTO safeLiabilityPerson = basicPersonService.getBasicExperimentPersonById(insertParam.getSafeLiabilityPersonId()); + if(ObjectUtils.isEmpty(safeLiabilityPerson)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所安全员不存在"); + } + + if(ObjectUtils.isEmpty(insertParam.getSiteTypeId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所类型不能为空"); + } + BasicExperimentSiteType siteTypeById = siteTypeService.getSiteTypeById(insertParam.getSiteTypeId()); + if(ObjectUtils.isEmpty(siteTypeById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所类型不存在,请添加后使用"); + } + + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + BasicExperimentSite site = BeanCopyUtils.copyBean(insertParam, BasicExperimentSite.class); + //获取必要参数 + LocalDateTime date = LocalDateTime.now(); + site.setCreateTime(date); + site.setCreateByUserId(userInfoById.getId()); + site.setUpdateTime(date); + site.setUpdateByUserId(userInfoById.getId()); + site.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + site.setSiteLiabilityPerson(siteLiabilityPerson.getPersonName()); + site.setSafeLiabilityPerson(safeLiabilityPerson.getPersonName()); + site.setSiteType(siteTypeById.getSiteType()); + + BasicExperimentSite save = siteRepository.save(site); + + return save; + } + + /** + * 基础场所管理 - 分页查询 + * */ + @Override + public SearchResult<SiteQueryDTO> selectBasicExperimentSitePage(Long currentUserId, BasicExperimentSiteAppQueryBO queryParam) { + + //校验参数 + if (ObjectUtils.isEmpty(queryParam.getPageSize())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(queryParam.getPageIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (queryParam.getSiteName() == ""){ + queryParam.setSiteName(null); + } + if (queryParam.getRoom() == ""){ + queryParam.setRoom(null); + } + if (queryParam.getFloor() == ""){ + queryParam.setFloor(null); + } + + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(queryParam.getPageIndex()); + searchResult.setPageSize(queryParam.getPageSize()); + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + //封装查询参数 + Specification<BasicExperimentSite> specification = new Specification<BasicExperimentSite>() { + @Override + public Predicate toPredicate(Root<BasicExperimentSite> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + if (queryParam.getSiteName() != null && !queryParam.getSiteName().equals("")){ + predicateList.add(criteriaBuilder.like(root.get("siteName"),"%"+queryParam.getSiteName()+"%")); + } + if (queryParam.getFloor() != null && !queryParam.getFloor().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("floor"), queryParam.getFloor())); + } + if (queryParam.getRoom() != null && !queryParam.getRoom().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("room"), queryParam.getRoom())); + } + if (roleTag == UserTagEnum.USER_TAG_0.getCode()){ + predicateList.add(criteriaBuilder.equal(root.get("createByUserId"),currentUserId)); + } + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode())); + return criteriaBuilder.and(predicateList.toArray(new Predicate[0])); + } + }; + PageRequest pageParam = PageRequest.of(queryParam.getPageIndex() - 1, queryParam.getPageSize(), Sort.Direction.DESC, "updateTime"); + + Page<BasicExperimentSite> pageResult = siteRepository.findAll(specification, pageParam); + + List<SiteQueryDTO> siteQueryDTOS = BeanCopyUtils.copyBeanList(pageResult.getContent(), SiteQueryDTO.class); + + List<UserInfoDomainDTO> userList = userDomainService.getUserList(); + for (SiteQueryDTO siteQueryDTO : siteQueryDTOS) { + for (UserInfoDomainDTO userInfo : userList) { + if (userInfo.getId() == siteQueryDTO.getCreateByUserId()){ + siteQueryDTO.setCreateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == siteQueryDTO.getUpdateByUserId()){ + siteQueryDTO.setUpdateByUserName(userInfo.getRealName()); + } + } + } + + searchResult.setData(siteQueryDTOS); + searchResult.setTotal(pageResult.getTotalElements()); + + return searchResult; + } + + /** + * 基础场所管理 - 修改 + * */ + @Override + public SiteUpdateDTO updateBasicExperimentSite(Long currentUserId, BasicExperimentSiteAppUpdateBO updateParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + //校验参数 + if(ObjectUtils.isEmpty(updateParam.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的场所进行修改,或确认该场所是否已被删除"); + } + if(ObjectUtils.isEmpty(updateParam.getSiteName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所名称不能为空"); + } + if(ObjectUtils.isEmpty(updateParam.getFloor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所楼层不能为空"); + } + if(ObjectUtils.isEmpty(updateParam.getRoom())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所房间号不能为空"); + } + BasicExperimentSite siteByFloorAndRoom = siteRepository.getSiteByFloorAndRoom(updateParam.getSiteName(), updateParam.getRoom()); +// if (!ObjectUtils.isEmpty(siteByFloorAndRoom) && !updateParam.getId().equals(siteByFloorAndRoom.getId())){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "该区域已被使用,请检查输入是否正确"); +// } + + if(ObjectUtils.isEmpty(updateParam.getPartitionStatus())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请填写该场所是否有隔断情况"); + } + if(ObjectUtils.isEmpty(updateParam.getFireFacilities())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请填写该场所是否有消防设施"); + } + + if(ObjectUtils.isEmpty(updateParam.getSiteLiabilityPersonId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所负责人不能为空"); + } + PersonQueryDTO siteLiabilityPerson = basicPersonService.getBasicExperimentPersonById(updateParam.getSiteLiabilityPersonId()); + if(ObjectUtils.isEmpty(siteLiabilityPerson)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所负责人不存在"); + } + + if(ObjectUtils.isEmpty(updateParam.getSafeLiabilityPersonId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所安全员不能为空"); + } + PersonQueryDTO safeLiabilityPerson = basicPersonService.getBasicExperimentPersonById(updateParam.getSafeLiabilityPersonId()); + if(ObjectUtils.isEmpty(safeLiabilityPerson)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所安全员不存在"); + } + + if(ObjectUtils.isEmpty(updateParam.getSiteTypeId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所类型不能为空"); + } + BasicExperimentSiteType siteTypeById = siteTypeService.getSiteTypeById(updateParam.getSiteTypeId()); + if(ObjectUtils.isEmpty(siteTypeById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "场所类型不存在,请添加后使用"); + } + + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + BasicExperimentSite siteById = siteRepository.getSiteById(updateParam.getId()); + BasicExperimentSite site = BeanCopyUtils.copyBean(siteById, BasicExperimentSite.class); + + //获取必要参数 + LocalDateTime date = LocalDateTime.now(); + site.setUpdateTime(date); + site.setUpdateByUserId(userInfoById.getId()); + + site.setSiteName(updateParam.getSiteName()); + site.setFloor(updateParam.getFloor()); + site.setRoom(updateParam.getRoom()); + site.setSiteLiabilityPersonId(updateParam.getSiteLiabilityPersonId()); + site.setSiteLiabilityPerson(siteLiabilityPerson.getPersonName()); + site.setSafeLiabilityPersonId(updateParam.getSafeLiabilityPersonId()); + site.setSafeLiabilityPerson(safeLiabilityPerson.getPersonName()); + site.setFireFacilities(updateParam.getFireFacilities()); + site.setPartitionStatus(updateParam.getPartitionStatus()); + site.setSiteTypeId(updateParam.getSiteTypeId()); + site.setSiteType(siteTypeById.getSiteType()); + + BasicExperimentSite updateResult = siteRepository.save(site); + + return BeanCopyUtils.copyBean(updateResult, SiteUpdateDTO.class); + } + + /** + * 基础场所管理 - 删除 + * */ + @Override + public SiteDeleteDTO deleteBasicExperimentSite(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正常的内容删除"); + } + BasicExperimentSite siteById = siteRepository.getSiteById(id); + if (ObjectUtils.isEmpty(siteById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的内容删除,或确认该实验室是否已经被删除"); + } + + BasicExperimentSite site = BeanCopyUtils.copyBean(siteById, BasicExperimentSite.class); + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + + LocalDateTime date = LocalDateTime.now(); + //设置参数 + site.setId(id); + site.setUpdateTime(date); + site.setUpdateByUserId(userInfoById.getId()); + site.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + + BasicExperimentSite deleteResult = siteRepository.save(site); + return BeanCopyUtils.copyBean(deleteResult, SiteDeleteDTO.class); + } + + /** + * 基础场所管理 - 列表 + * */ + @Override + public List<SiteListDTO> listBasicExperimentSite(Long currentUserId) { + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + List<BasicExperimentSite> basicExperimentSites = new ArrayList<>(); + + if (roleTag != UserTagEnum.USER_TAG_0.getCode()){ + basicExperimentSites = siteRepository.listSite(); + }else { + basicExperimentSites = siteRepository.listSiteByUserId(currentUserId); + } + return BeanCopyUtils.copyBeanList(basicExperimentSites, SiteListDTO.class); + } + + /** + * 基础场所管理 - 通过id查询 + * */ + @Override + public SiteQueryDTO getBasicExperimentSiteById(Long id) { + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数不能为空"); + } + + BasicExperimentSite siteById = siteRepository.getSiteById(id); + + if (ObjectUtils.isEmpty(siteById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "风险源信息不存在,请检查是否输入有误或已被删除"); + } + return BeanCopyUtils.copyBean(siteById, SiteQueryDTO.class); + } + + /** + * 基础场所管理 - 通过id列表查询 + * */ + @Override + public List<SiteQueryDTO> getBasicExperimentSiteByIdList(List<Long> ids) { + if (ids.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请求参数不能为空"); + } + + List<BasicExperimentSite> listResult = siteRepository.batchById(ids); + if (listResult.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "查询结果为空"); + } + + return BeanCopyUtils.copyBeanList(listResult,SiteQueryDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentSiteTypeServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentSiteTypeServiceImpl.java new file mode 100644 index 0000000..b00fd9b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentSiteTypeServiceImpl.java @@ -0,0 +1,40 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSiteType; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteTypeDTO; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicExperimentSiteTypeRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.util.List; + +@Service +public class BasicExperimentSiteTypeServiceImpl implements BasicExperimentSiteTypeService { + + @Autowired + private BasicExperimentSiteTypeRepository repository; + + /** + * 基础实验场所类型管理 + */ + @Override + public BasicExperimentSiteType getSiteTypeById(Long siteTypeId) { + return repository.getSiteTypeById(siteTypeId); + } + + /** + * 基础字典 - 场所类型 + * */ + @Override + public List<SiteTypeDTO> listSiteType() { + List<BasicExperimentSiteType> listSiteType = repository.listSiteType(); + + if (ObjectUtils.isEmpty(listSiteType)){ + return null; + } + return BeanCopyUtils.copyBeanList(listSiteType, SiteTypeDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentStuffServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentStuffServiceImpl.java new file mode 100644 index 0000000..1ab9b47 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentStuffServiceImpl.java @@ -0,0 +1,314 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentStuffAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentStuffAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicExperimentStuffAppUpdateBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.enums.UserTagEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentStuff; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicExperimentStuffRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentStuffService; +import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +/** + * 基础实验耗材管理 + */ +@Service +public class BasicExperimentStuffServiceImpl implements BasicExperimentStuffService { + + @Autowired + private BasicExperimentStuffRepository stuffRepository; + @Autowired + private UserDomainService userDomainService; + + /** + * 基础实验耗材管理 - 新增 + */ + @Override + public StuffInsertDTO insertBasicExperimentStuff(Long currentUserId, BasicExperimentStuffAppInsertBO insertParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + //参数校验 + if (ObjectUtils.isEmpty(insertParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数不能为空"); + } + if (ObjectUtils.isEmpty(insertParam.getStuffName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "材料名称不能为空"); + } + BasicExperimentStuff stuffByName = stuffRepository.getStuffByName(insertParam.getStuffName()); +// if (!ObjectUtils.isEmpty(stuffByName)){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "该材料已存在,不需要重复添加"); +// } + if (ObjectUtils.isEmpty(insertParam.getStuffCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "材料编号不能为空"); + } + if (ObjectUtils.isEmpty(insertParam.getStuffType())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "材料类型不能为空"); + } + if (!(insertParam.getStuffType() == 1 || insertParam.getStuffType() == 2)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "材料类型符合要求"); + } + if (ObjectUtils.isEmpty(insertParam.getStuffUnit())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "计量单位不能为空"); + } + if (!(insertParam.getStuffUnit() == 1 || insertParam.getStuffUnit() == 2 || insertParam.getStuffUnit() == 3 || insertParam.getStuffUnit() == 4)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "计量单位不符合要求"); + } + if (ObjectUtils.isEmpty(insertParam.getStuffStorage())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "存储放方式不能为空"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + BasicExperimentStuff stuff = BeanCopyUtils.copyBean(insertParam, BasicExperimentStuff.class); + //设置必要参数 + LocalDateTime date = LocalDateTime.now(); + stuff.setCreateTime(date); + stuff.setCreateByUserId(userInfoById.getId()); + stuff.setUpdateTime(date); + stuff.setUpdateByUserId(userInfoById.getId()); + stuff.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + + BasicExperimentStuff insertResult = stuffRepository.save(stuff); + + return BeanCopyUtils.copyBean(insertResult, StuffInsertDTO.class); + } + + /** + * 基础实验耗材管理 - 查询 + */ + @Override + public SearchResult<StuffQueryDTO> selectBasicExperimentStuffPage(Long currentUserId, BasicExperimentStuffAppQueryBO queryParam) { + + //校验参数 + if (ObjectUtils.isEmpty(queryParam.getPageSize())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(queryParam.getPageIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (queryParam.getStuffName() == ""){ + queryParam.setStuffName(null); + } + if (queryParam.getStuffCode() == ""){ + queryParam.setStuffCode(null); + } + + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(queryParam.getPageIndex()); + searchResult.setPageSize(queryParam.getPageSize()); + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + //封装查询参数 + Specification<BasicExperimentStuff> specification = new Specification<BasicExperimentStuff>() { + @Override + public Predicate toPredicate(Root<BasicExperimentStuff> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); +// if (queryParam.getSiteName() != null && !queryParam.getSiteName().equals("")){ +// predicateList.add(criteriaBuilder.equal(root.get("siteName"), queryParam.getSiteName())); +// } + if (queryParam.getStuffName() != null && !queryParam.getStuffName().equals("")){ + predicateList.add(criteriaBuilder.like(root.get("stuffName"),"%"+queryParam.getStuffName()+"%")); + } + if (queryParam.getStuffCode() != null && !queryParam.getStuffCode().equals("")){ + predicateList.add(criteriaBuilder.like(root.get("stuffCode"), "%"+queryParam.getStuffCode()+"%")); + } + if (queryParam.getStuffType() != null && !queryParam.getStuffType().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("stuffType"), queryParam.getStuffType())); + } + + if (roleTag == UserTagEnum.USER_TAG_0.getCode()){ + predicateList.add(criteriaBuilder.equal(root.get("createByUserId"), currentUserId)); + } + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode())); + return criteriaBuilder.and(predicateList.toArray(new Predicate[0])); + } + }; + + PageRequest pageParam = PageRequest.of(queryParam.getPageIndex() - 1, queryParam.getPageSize(), Sort.Direction.DESC, "updateTime"); + Page<BasicExperimentStuff> pageResult = stuffRepository.findAll(specification, pageParam); + + List<StuffQueryDTO> stuffQueryDTOS = BeanCopyUtils.copyBeanList(pageResult.getContent(), StuffQueryDTO.class); + List<UserInfoDomainDTO> userList = userDomainService.getUserList(); + for (StuffQueryDTO stuffQueryDTO : stuffQueryDTOS) { + for (UserInfoDomainDTO userInfo : userList) { + if (userInfo.getId() == stuffQueryDTO.getCreateByUserId()){ + stuffQueryDTO.setCreateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == stuffQueryDTO.getUpdateByUserId()){ + stuffQueryDTO.setUpdateByUserName(userInfo.getRealName()); + } + } + } + + searchResult.setData(stuffQueryDTOS); + searchResult.setTotal(pageResult.getTotalElements()); + return searchResult; + } + + /** + * 基础实验耗材管理 - 修改 + */ + @Override + public StuffUpdateDTO updateBasicExperimentSite(Long currentUserId, BasicExperimentStuffAppUpdateBO updateParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + //参数校验 + if (ObjectUtils.isEmpty(updateParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getStuffName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "材料名称不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getStuffCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "材料编号不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getStuffType())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "材料类型不能为空"); + } + if (!(updateParam.getStuffType() == 1 || updateParam.getStuffType() == 2)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "材料类型不符合要求"); + } + if (ObjectUtils.isEmpty(updateParam.getStuffUnit())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "计量单位不能为空"); + } + if (!(updateParam.getStuffUnit() == 1 || updateParam.getStuffUnit() == 2 || updateParam.getStuffUnit() == 3 || updateParam.getStuffUnit() == 4)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "计量单位不符合要求"); + } + if (ObjectUtils.isEmpty(updateParam.getStuffStorage())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "存储放方式不能为空"); + } + BasicExperimentStuff stuffByName = stuffRepository.getStuffByName(updateParam.getStuffName()); +// if (!ObjectUtils.isEmpty(stuffByName) && !stuffByName.getId().equals(updateParam.getId())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "该材料已存在"); +// } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + BasicExperimentStuff stuffById = stuffRepository.getStuffById(updateParam.getId()); + BasicExperimentStuff stuff = BeanCopyUtils.copyBean(stuffById, BasicExperimentStuff.class); + //设置必要参数 + LocalDateTime date = LocalDateTime.now(); + + stuff.setUpdateTime(date); + stuff.setUpdateByUserId(userInfoById.getId()); + stuff.setStuffCode(updateParam.getStuffCode()); + stuff.setStuffName(updateParam.getStuffName()); + stuff.setStuffType(updateParam.getStuffType()); + stuff.setStuffStorage(updateParam.getStuffStorage()); + stuff.setStuffUnit(updateParam.getStuffUnit()); + + BasicExperimentStuff updateResult = stuffRepository.save(stuff); + + return BeanCopyUtils.copyBean(updateResult, StuffUpdateDTO.class); + } + + /** + * 基础实验耗材管理 - 删除 + */ + @Override + public StuffDeleteDTO deleteBasicExperimentStuff(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正常的内容删除"); + } + BasicExperimentStuff stuffById = stuffRepository.getStuffById(id); + if (ObjectUtils.isEmpty(stuffById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的内容删除,或确认该耗材是否已经被删除"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + BasicExperimentStuff stuff = BeanCopyUtils.copyBean(stuffById, BasicExperimentStuff.class); + //设置必要参数 + LocalDateTime date = LocalDateTime.now(); + + stuff.setUpdateTime(date); + stuff.setUpdateByUserId(userInfoById.getId()); + stuff.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + + BasicExperimentStuff deleteResult = stuffRepository.save(stuff); + + return BeanCopyUtils.copyBean(deleteResult, StuffDeleteDTO.class); + } + + /** + * 基础实验耗材管理 - 列表 + */ + @Override + public List<StuffListDTO> listBasicExperimentStuff(Long currentUserId) { + + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + + List<BasicExperimentStuff> listResult = new ArrayList<>(); + if (roleTag != UserTagEnum.USER_TAG_0.getCode()){ + listResult = stuffRepository.listStuff(currentUserId); + }else { + listResult = stuffRepository.listStuffByUserId(currentUserId); + } + return BeanCopyUtils.copyBeanList(listResult, StuffListDTO.class); + } + + /** + * 基础实验耗材管理 - 查询 by id + */ + @Override + public StuffQueryDTO getBasicExperimentStuffById(Long id) { + + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数不能为空"); + } + + BasicExperimentStuff stuffById = stuffRepository.getStuffById(id); + + if (ObjectUtils.isEmpty(stuffById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "查询的耗材不存在"); + } + return BeanCopyUtils.copyBean(stuffById, StuffQueryDTO.class); + } + + /** + * 基础实验耗材管理 - 通过id列表查询 + */ + @Override + public List<StuffQueryDTO> getBasicExperimentStuffByIdList(List<Long> ids) { + if (ids.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请求参数不能为空"); + } + + List<BasicExperimentStuff> listResult = stuffRepository.batchById(ids); + if (listResult.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "查询结果为空"); + } + return BeanCopyUtils.copyBeanList(listResult, StuffQueryDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentTypeServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentTypeServiceImpl.java new file mode 100644 index 0000000..5b86d2a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicExperimentTypeServiceImpl.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentType; +import com.gkhy.labRiskManage.domain.basic.model.dto.TypeListDTO; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicExperimentTypeRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 基础实验类型 + */ +@Service +public class BasicExperimentTypeServiceImpl implements BasicExperimentTypeService { + + @Autowired + private BasicExperimentTypeRepository typeRepository; + + /** + * 基础实验类型 - 列表 + */ + @Override + public List<TypeListDTO> listBasicExperimentType() { + + List<BasicExperimentType> listResult = typeRepository.listType(); + return BeanCopyUtils.copyBeanList(listResult, TypeListDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicRiskUnitServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicRiskUnitServiceImpl.java new file mode 100644 index 0000000..c73e289 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicRiskUnitServiceImpl.java @@ -0,0 +1,347 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicRiskUnitAppInsertBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicRiskUnitAppQueryBO; +import com.gkhy.labRiskManage.application.basic.dto.bo.BasicRiskUnitAppUpdateBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.enums.UserRoleEnum; +import com.gkhy.labRiskManage.commons.enums.UserTagEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnit; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicRiskUnitRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentDeviceService; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteService; +import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitService; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskUnit; +import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +/** + * 基础风险单元管理 + */ +@Service +public class BasicRiskUnitServiceImpl implements BasicRiskUnitService { + + @Autowired + private BasicRiskUnitRepository riskUnitRepository; + @Autowired + private BasicExperimentDeviceService basicExperimentDeviceService; + @Autowired + private BasicExperimentSiteService basicExperimentSiteService; + @Autowired + private UserDomainService userDomainService; + + /** + * 基础风险单元管理 - 插入 + */ + @Override + public RiskUnitInsertDTO insertBasicRiskUnit(Long currentUserId, BasicRiskUnitAppInsertBO insertReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + //参数校验、 + if (ObjectUtils.isEmpty(insertReqBO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数不能为空"); + } + if (ObjectUtils.isEmpty(insertReqBO.getRiskCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元编号不能为空"); + } + BasicRiskUnit riskUnitByCode = riskUnitRepository.getRiskUnitByCode(insertReqBO.getRiskCode()); +// if (!ObjectUtils.isEmpty(riskUnitByCode)){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "风险单元编号已被使用"); +// } + if (ObjectUtils.isEmpty(insertReqBO.getRiskName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元名字不能为空"); + } + BasicRiskUnit riskUnitByName = riskUnitRepository.getRiskUnitByName(insertReqBO.getRiskName()); +// if (!ObjectUtils.isEmpty(riskUnitByName)){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "风险单元名称已被使用"); +// } + // todo 人员和部门先不做校验 + if (ObjectUtils.isEmpty(insertReqBO.getLiabilityUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任人不能为空"); + } +// if (ObjectUtils.isEmpty(insertReqBO.getLiabilityDepId())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任部门不能为空"); +// } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + BasicRiskUnit riskUnit = BeanCopyUtils.copyBean(insertReqBO, BasicRiskUnit.class); + //设置必要参数 + LocalDateTime date = LocalDateTime.now(); + riskUnit.setCreateTime(date); + riskUnit.setCreateByUserId(userInfoById.getId()); + riskUnit.setUpdateTime(date); + riskUnit.setUpdateByUserId(userInfoById.getId()); + riskUnit.setEvaluateStatus(StatusEnum.EVALUATE_NOT.getCode().byteValue()); + riskUnit.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + + BasicRiskUnit insertResult = riskUnitRepository.save(riskUnit); + + return BeanCopyUtils.copyBean(insertResult, RiskUnitInsertDTO.class); + } + + /** + * 基础风险单元管理 - 分页查询 + */ + @Override + public SearchResult<RiskUnitBasicQueryDTO> selectBasicRiskUnitPage(Long currentUserId, BasicRiskUnitAppQueryBO queryParam) { + + //校验参数 + if (ObjectUtils.isEmpty(queryParam.getPageSize())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(queryParam.getPageIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (queryParam.getRiskName() == ""){ + queryParam.setRiskName(null); + } + if (queryParam.getRiskCode() == ""){ + queryParam.setRiskCode(null); + } + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(queryParam.getPageIndex()); + searchResult.setPageSize(queryParam.getPageSize()); + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + //封装查询参数 + Specification<BasicRiskUnit> specification = new Specification<BasicRiskUnit>() { + @Override + public Predicate toPredicate(Root<BasicRiskUnit> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + if (queryParam.getRiskName() != null && !queryParam.getRiskName().equals("")){ + predicateList.add(criteriaBuilder.like(root.get("riskName"),"%"+queryParam.getRiskName()+"%")); + } + if (queryParam.getRiskCode() != null && !queryParam.getRiskCode().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("riskCode"), queryParam.getRiskCode())); + } + if (queryParam.getRiskSourceType() != null && !queryParam.getRiskSourceType().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("riskSourceType"), queryParam.getRiskSourceType())); + } + if (roleTag == UserTagEnum.USER_TAG_0.getCode()){ + predicateList.add(criteriaBuilder.equal(root.get("createByUserId"), currentUserId)); + } + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode())); + return criteriaBuilder.and(predicateList.toArray(new Predicate[0])); + } + }; + + PageRequest pageParam = PageRequest.of(queryParam.getPageIndex() - 1, queryParam.getPageSize(), Sort.Direction.DESC, "updateTime"); + Page<BasicRiskUnit> pageResult = riskUnitRepository.findAll(specification, pageParam); + + List<RiskUnitBasicQueryDTO> riskUnitBasicQueryDTOS = BeanCopyUtils.copyBeanList(pageResult.getContent(), RiskUnitBasicQueryDTO.class); + + List<UserInfoDomainDTO> userList = userDomainService.getUserList(); + for (RiskUnitBasicQueryDTO riskUnitBasicQueryDTO : riskUnitBasicQueryDTOS) { + for (UserInfoDomainDTO userInfo : userList) { + if (userInfo.getId() == riskUnitBasicQueryDTO.getCreateByUserId()){ + riskUnitBasicQueryDTO.setCreateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == riskUnitBasicQueryDTO.getUpdateByUserId()){ + riskUnitBasicQueryDTO.setUpdateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == riskUnitBasicQueryDTO.getLiabilityUserId()){ + riskUnitBasicQueryDTO.setLiabilityUserName(userInfo.getRealName()); + } + } + } + + searchResult.setData(riskUnitBasicQueryDTOS); + searchResult.setTotal(pageResult.getTotalElements()); + return searchResult; + } + + /** + * 基础风险单元管理 - 修改 + */ + @Override + public RiskUnitUpdateDTO updateBasicRiskUnit(Long currentUserId, BasicRiskUnitAppUpdateBO updateParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + //参数校验、 + if (ObjectUtils.isEmpty(updateParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getRiskCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元编号不能为空"); + } + BasicRiskUnit riskUnitByCode = riskUnitRepository.getRiskUnitByCode(updateParam.getRiskCode()); +// if (!ObjectUtils.isEmpty(riskUnitByCode) && !riskUnitByCode.getId().equals(updateParam.getId())){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "风险单元编号已被使用"); +// } + if (ObjectUtils.isEmpty(updateParam.getRiskName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元名字不能为空"); + } + BasicRiskUnit riskUnitByName = riskUnitRepository.getRiskUnitByName(updateParam.getRiskName()); +// if (!ObjectUtils.isEmpty(riskUnitByName) && !riskUnitByName.getId().equals(updateParam.getId())){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "风险单元名称已被使用"); +// } + //校验,如果类型是1或者2,则风险源id不可为空 + if (updateParam.getRiskSourceType() == 1 || updateParam.getRiskSourceType() == 2){ + if (ObjectUtils.isEmpty(updateParam.getRiskSourceId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险源不能为空"); + } + //如果riskType为1-区域 + if (updateParam.getRiskSourceType() == 1){ + SiteQueryDTO siteById = basicExperimentSiteService.getBasicExperimentSiteById(updateParam.getRiskSourceId()); + //设置参数 + updateParam.setRiskSourceId(siteById.getId()); + } + //如果riskType为2-设备 + if (updateParam.getRiskSourceType() == 2){ + DeviceQueryDTO deviceById = basicExperimentDeviceService.getBasicExperimentDeviceById(updateParam.getRiskSourceId()); + //设置参数 + updateParam.setRiskSourceId(deviceById.getId()); + } + }else { + updateParam.setRiskSourceId(null); + } + // todo 部门先不做校验 + if (ObjectUtils.isEmpty(updateParam.getLiabilityUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任人不能为空"); + } +// if (ObjectUtils.isEmpty(updateParam.getLiabilityDepId())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任部门不能为空"); +// } + BasicRiskUnit riskUnitById = riskUnitRepository.getRiskUnitById(updateParam.getId()); + if (ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的单元不存在,请确定是否输入正确或该单元已被删除"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + BasicRiskUnit riskUnit = BeanCopyUtils.copyBean(riskUnitById, BasicRiskUnit.class); + //设置必要参数 + LocalDateTime date = LocalDateTime.now(); + riskUnit.setUpdateTime(date); + riskUnit.setUpdateByUserId(userInfoById.getId()); + riskUnit.setRiskCode(updateParam.getRiskCode()); + riskUnit.setRiskName(updateParam.getRiskName()); + riskUnit.setRiskSourceType(updateParam.getRiskSourceType()); + riskUnit.setRiskSourceId(updateParam.getRiskSourceId()); + riskUnit.setLiabilityUserId(updateParam.getLiabilityUserId()); + if (ObjectUtils.isEmpty(updateParam.getLiabilityDepId())){ + riskUnit.setLiabilityDepId(updateParam.getLiabilityDepId()); + } + riskUnit.setImage(updateParam.getImage()); + riskUnit.setDescription(updateParam.getDescription()); + + BasicRiskUnit updateResult = riskUnitRepository.save(riskUnit); + + return BeanCopyUtils.copyBean(updateResult, RiskUnitUpdateDTO.class); + } + + /** + * 基础风险单元管理 - 删除 + */ + @Override + public RiskUnitBasicDeleteDTO deleteBasicRiskUnit(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数为空"); + } + BasicRiskUnit riskUnitById = riskUnitRepository.getRiskUnitById(id); + if (ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元不存在,请检查是否输入有误或已被删除"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + BasicRiskUnit riskUnit = BeanCopyUtils.copyBean(riskUnitById, BasicRiskUnit.class); + //设置必要参数 + LocalDateTime date = LocalDateTime.now(); + + riskUnit.setUpdateTime(date); + riskUnit.setUpdateByUserId(userInfoById.getId()); + riskUnit.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + + BasicRiskUnit deleteResult = riskUnitRepository.save(riskUnit); + + return BeanCopyUtils.copyBean(deleteResult, RiskUnitBasicDeleteDTO.class); + } + + /** + * 基础风险单元管理 - 列表 + */ + @Override + public List<RiskUnitListDTO> listBasicRiskUnit(Long currentUserId) { + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + List<BasicRiskUnit> listResult = new ArrayList<>(); + if (roleTag != UserTagEnum.USER_TAG_0.getCode()){ + listResult = riskUnitRepository.listRiskUnit(); + }else { + listResult = riskUnitRepository.listRiskUnitByUserId(currentUserId); + } + return BeanCopyUtils.copyBeanList(listResult, RiskUnitListDTO.class); + } + + /** + * 基础风险单元管理 - 通过id查询 + */ + @Override + public RiskUnitBasicQueryDTO getBasicRiskUnitById(Long id) { + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数不能为空"); + } + + BasicRiskUnit riskUnitById = riskUnitRepository.getRiskUnitById(id); + + if (ObjectUtils.isEmpty(riskUnitById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "风险源信息不存在,请检查是否输入有误或已被删除"); + } + return BeanCopyUtils.copyBean(riskUnitById, RiskUnitBasicQueryDTO.class); + } + + /** + * 基础风险单元管理 - 通过id列表查询 + */ + @Override + public List<RiskUnitBasicQueryDTO> getBasicRiskUnitByIdList(List<Long> ids) { + + if (ids.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "请求参数不能为空"); + } + + List<BasicRiskUnit> listResult = riskUnitRepository.batchById(ids); + + if (listResult.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "查询结果为空"); + } + return BeanCopyUtils.copyBeanList(listResult, RiskUnitBasicQueryDTO.class); + } + + @Override + public RiskUnitUpdateDTO updateRiskUnitStatus(Long riskUnitId, int status) { + BasicRiskUnit riskUnitById = riskUnitRepository.getRiskUnitById(riskUnitId); + riskUnitById.setEvaluateStatus((byte) status); + return BeanCopyUtils.copyBean(riskUnitRepository.save(riskUnitById),RiskUnitUpdateDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicRiskUnitTypeServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicRiskUnitTypeServiceImpl.java new file mode 100644 index 0000000..4843dbd --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicRiskUnitTypeServiceImpl.java @@ -0,0 +1,39 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnitType; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitTypeDTO; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicRiskUnitTypeRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.util.List; + +@Service +public class BasicRiskUnitTypeServiceImpl implements BasicRiskUnitTypeService { + + @Autowired + private BasicRiskUnitTypeRepository repository; + + + @Override + public BasicRiskUnitType getRiskUnitTypeById(Long id) { + return repository.getRiskUnitTypeById(id); + } + + /** + * 基础字典 - 风险类型 + * */ + @Override + public List<RiskUnitTypeDTO> listRiskUnitType() { + + List<BasicRiskUnitType> listRiskUnitType = repository.listRiskUnitType(); + + if (ObjectUtils.isEmpty(listRiskUnitType)){ + return null; + } + return BeanCopyUtils.copyBeanList(listRiskUnitType, RiskUnitTypeDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicTipServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicTipServiceImpl.java new file mode 100644 index 0000000..da1d768 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/BasicTipServiceImpl.java @@ -0,0 +1,33 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.entity.BasicTip; +import com.gkhy.labRiskManage.domain.basic.model.dto.TipDTO; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicTipRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicTipService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.util.List; + +@Service +public class BasicTipServiceImpl implements BasicTipService { + + @Autowired + private BasicTipRepository tipRepository; + + /** + * 基础字典 - 友情提示 + * */ + @Override + public List<TipDTO> listTip() { + + List<BasicTip> basicTips = tipRepository.listTip(); + if (ObjectUtils.isEmpty(basicTips)){ + return null; + } + + return BeanCopyUtils.copyBeanList(basicTips, TipDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/FactorServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/FactorServiceImpl.java new file mode 100644 index 0000000..cf195b7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/basic/service/impl/FactorServiceImpl.java @@ -0,0 +1,132 @@ +package com.gkhy.labRiskManage.domain.basic.service.impl; + +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.entity.*; +import com.gkhy.labRiskManage.domain.basic.model.dto.*; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.*; +import com.gkhy.labRiskManage.domain.basic.service.FactorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *评价因子 + */ +@Service +public class FactorServiceImpl implements FactorService { + + @Autowired + private FactorLecCRepository lecCRepository; + @Autowired + private FactorLecERepository lecERepository; + @Autowired + private FactorLecLRepository lecLRepository; + @Autowired + private FactorLsLRepository lsLRepository; + @Autowired + private FactorLsSRepository lsSRepository; + @Autowired + private FactorMesMRepository mesMRepository; + @Autowired + private FactorMesERepository mesERepository; + @Autowired + private FactorMesSRepository mesSRepository; + @Autowired + private FactorRsRRepository rsRRepository; + @Autowired + private FactorRsSRepository rsSRepository; + + + /** + * 评价因子LEC-L 列表 + */ + @Override + public List<FactorLecLDTO> listLecL() { + List<FactorLecL> listResult = lecLRepository.listLecL(); + return BeanCopyUtils.copyBeanList(listResult, FactorLecLDTO.class); + } + + /** + * 评价因子LEC-E 列表 + */ + @Override + public List<FactorLecEDTO> listLecE() { + List<FactorLecE> listResult = lecERepository.listLecE(); + return BeanCopyUtils.copyBeanList(listResult, FactorLecEDTO.class); + } + + /** + * 评价因子LEC-C 列表 + */ + @Override + public List<FactorLecCDTO> listLecC() { + List<FactorLecC> listResult = lecCRepository.listLecC(); + return BeanCopyUtils.copyBeanList(listResult, FactorLecCDTO.class); + } + + /** + * 评价因子LS-L 列表 + */ + @Override + public List<FactorLsLDTO> listLsL() { + List<FactorLsL> listResult = lsLRepository.listLecC(); + return BeanCopyUtils.copyBeanList(listResult, FactorLsLDTO.class); + } + + /** + * 评价因子LS-S 列表 + */ + @Override + public List<FactorLsSDTO> listLsS() { + List<FactorLsS> listResult = lsSRepository.listLecC(); + return BeanCopyUtils.copyBeanList(listResult, FactorLsSDTO.class); + } + + /** + * 评价因子Mes-M 列表 + */ + @Override + public List<FactorMesMDTO> listMesM() { + List<FactorMesM> listResult = mesMRepository.listMesM(); + return BeanCopyUtils.copyBeanList(listResult, FactorMesMDTO.class); + } + + /** + * 评价因子Mes-E 列表 + */ + @Override + public List<FactorMesEDTO> listMesE() { + List<FactorMesE> listResult = mesERepository.listMesE(); + return BeanCopyUtils.copyBeanList(listResult, FactorMesEDTO.class); + } + + /** + * 评价因子Mes-S 列表 + */ + @Override + public List<FactorMesSDTO> listMesS() { + List<FactorMesS> listResult = mesSRepository.listMesS(); + return BeanCopyUtils.copyBeanList(listResult, FactorMesSDTO.class); + } + + /** + * 评价因子Rs-R 列表 + */ + @Override + public List<FactorRsRDTO> listRsR() { + List<FactorRsR> listResult = rsRRepository.listRsR(); + return BeanCopyUtils.copyBeanList(listResult, FactorRsRDTO.class); + } + + /** + * 评价因子Rs-S 列表 + */ + @Override + public List<FactorRsSDTO> listRsS() { + List<FactorRsS> listResult = rsSRepository.listRsS(); + return BeanCopyUtils.copyBeanList(listResult, FactorRsSDTO.class); + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/converter/ExperimentInfoDomainConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/converter/ExperimentInfoDomainConverter.java new file mode 100644 index 0000000..b574dd8 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/converter/ExperimentInfoDomainConverter.java @@ -0,0 +1,134 @@ +package com.gkhy.labRiskManage.domain.experiment.converter; + +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.experiment.entity.*; +import com.gkhy.labRiskManage.domain.experiment.model.dto.*; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/21 + * @time: 17:05 + */ +@Service +public class ExperimentInfoDomainConverter { + public ExperimentInfoDTO getExperimentInfoDTO(ExperimentInfo experimentInfo) { + if(experimentInfo == null){ + return null; + } + ExperimentInfoDTO experimentInfoDTO = new ExperimentInfoDTO(); + BeanUtils.copyProperties(experimentInfo,experimentInfoDTO); + return experimentInfoDTO; + } + + public List<ExperimentInfoDTO> getExperimentInfoDTOSimpleList(List<ExperimentInfo> experimentInfoByIdList) { + List<ExperimentInfoDTO> list = new ArrayList<>(); + if(!CollectionUtils.isEmpty(experimentInfoByIdList)){ + list = BeanCopyUtils.copyBeanList(experimentInfoByIdList,ExperimentInfoDTO.class); + } + return list; + } + + //返回上一层转换 + public List<ExperimentInfoDTO> getExperimentInfoDTODetailList(List<ExperimentInfo> experimentInfoList){ + List<ExperimentInfoDTO> list = new ArrayList<>(); + if (!CollectionUtils.isEmpty(experimentInfoList)) { + for (ExperimentInfo experimentInfo:experimentInfoList){ + //实验基础信息 + ExperimentInfoDTO experimentInfoDTO = new ExperimentInfoDTO(); + BeanUtils.copyProperties(experimentInfo,experimentInfoDTO); + //实验场所数据 + List<ExperimentAndSiteDTO> sites = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfo.getSites())){ + for (ExperimentAndSite experimentAndSite : experimentInfo.getSites()){ + ExperimentAndSiteDTO experimentAndSiteDTO = new ExperimentAndSiteDTO(); + experimentAndSiteDTO.setSiteId(experimentAndSite.getSiteId()); + if(null != experimentAndSite.getSite()){ + experimentAndSiteDTO.setSiteName(experimentAndSite.getSite().getSiteName()); + experimentAndSiteDTO.setFireFacilities(experimentAndSite.getSite().getFireFacilities()); + experimentAndSiteDTO.setPartitionStatus(experimentAndSite.getSite().getPartitionStatus()); + experimentAndSiteDTO.setSiteType(experimentAndSite.getSite().getSiteType()); + } + experimentAndSiteDTO.setRoom(experimentAndSite.getSite().getRoom()); + experimentAndSiteDTO.setFloor(experimentAndSite.getSite().getFloor()); + sites.add(experimentAndSiteDTO); + } + } + experimentInfoDTO.setSites(sites); + //人员信息 + List<ExperimentAndPersonDTO> persons = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfo.getPersons())){ + for (ExperimentAndPerson person:experimentInfo.getPersons()) { + ExperimentAndPersonDTO personDTO = new ExperimentAndPersonDTO(); + BeanUtils.copyProperties(person,personDTO); + persons.add(personDTO); + } + } + experimentInfoDTO.setPersons(persons); + //材料信息 + List<ExperimentAndStuffDTO> stuffs = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfo.getStuffs())){ + for (ExperimentAndStuff experimentAndStuff:experimentInfo.getStuffs()) { + ExperimentAndStuffDTO stuffDTO = new ExperimentAndStuffDTO(); + stuffDTO.setStuffCode(experimentAndStuff.getStuff().getStuffCode()); + stuffDTO.setStuffName(experimentAndStuff.getStuff().getStuffName()); + stuffDTO.setStuffType(experimentAndStuff.getStuff().getStuffType()); + stuffDTO.setStuffStorage(experimentAndStuff.getStuff().getStuffStorage()); + stuffDTO.setStuffUnit(experimentAndStuff.getStuff().getStuffUnit()); + stuffDTO.setStuffUseCount(experimentAndStuff.getStuffUseCount()); + stuffDTO.setStuffId(experimentAndStuff.getStuffId()); + stuffs.add(stuffDTO); + } + } + experimentInfoDTO.setStuffs(stuffs); + //设备信息 + List<ExperimentAndDeviceDTO> devices = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfo.getDevices())){ + for (ExperimentAndDevice experimentAndDevice:experimentInfo.getDevices()) { + ExperimentAndDeviceDTO deviceDTO = new ExperimentAndDeviceDTO(); + //deviceDTO.setId(experimentAndDevice.getDeviceId()); + deviceDTO.setDeviceId(experimentAndDevice.getDeviceId()); + deviceDTO.setDeviceCode(experimentAndDevice.getDevice().getDeviceCode()); + deviceDTO.setDeviceName(experimentAndDevice.getDevice().getDeviceName()); + deviceDTO.setDevicePower(experimentAndDevice.getDevice().getDevicePower()); + deviceDTO.setDeviceUnit(experimentAndDevice.getDevice().getDeviceUnit()); + deviceDTO.setSpecialDevice(experimentAndDevice.getDevice().getSpecialDevice()); + deviceDTO.setDeviceUseCount(experimentAndDevice.getDeviceUseCount()); + devices.add(deviceDTO); + } + } + experimentInfoDTO.setDevices(devices); + //危废信息 + List<ExperimentHazardousWasteDTO> wastes = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfo.getWastes())){ + for (ExperimentHazardousWaste experimentHazardousWaste:experimentInfo.getWastes()) { + ExperimentHazardousWasteDTO wasteDTO = new ExperimentHazardousWasteDTO(); + BeanUtils.copyProperties(experimentHazardousWaste,wasteDTO); + wastes.add(wasteDTO); + } + } + experimentInfoDTO.setWastes(wastes); + //应急演练 + List<ExperimentAndEmergencyDTO> emergencies = new ArrayList<>(); + if(!ObjectUtils.isEmpty(experimentInfo.getEmergencies())){ + for (ExperimentAndEmergency experimentAndEmergency : experimentInfo.getEmergencies()) { + ExperimentAndEmergencyDTO emergencyDTO = new ExperimentAndEmergencyDTO(); + BeanUtils.copyProperties(experimentAndEmergency,emergencyDTO); + emergencies.add(emergencyDTO); + } + } + experimentInfoDTO.setEmergencies(emergencies); + list.add(experimentInfoDTO); + } + } + + return list; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndDevice.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndDevice.java new file mode 100644 index 0000000..8cb66f0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndDevice.java @@ -0,0 +1,151 @@ +package com.gkhy.labRiskManage.domain.experiment.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentDevice; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +/** + * 实验与设备 + */ +@EntityListeners(AuditingEntityListener.class) +@Entity +@Table(name = "experiment_and_device") +public class ExperimentAndDevice implements Serializable { + private static final long serialVersionUID = -74398808654954420L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 实验ID + */ + @Column(name = "experiment_id") + private Long experimentId; + /** + * 设备ID + */ + @Column(name = "device_id") + private Long deviceId; + /** + * 使用数量 + */ + private Integer deviceUseCount; + /** + * 修改时间 + */ + @JsonFormat + @LastModifiedDate + private LocalDateTime updateTime; + /** + * 新建时间 + */ + @JsonFormat + @CreatedDate + @Column(name = "create_time",updatable = false) + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + @ManyToOne(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @JoinColumn(name = "device_id",referencedColumnName = "id",insertable =false ,updatable = false) + private BasicExperimentDevice device; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Long getDeviceId() { + return deviceId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Integer getDeviceUseCount() { + return deviceUseCount; + } + + public void setDeviceUseCount(Integer deviceUseCount) { + this.deviceUseCount = deviceUseCount; + } + + public BasicExperimentDevice getDevice() { + return device; + } + + public void setDevice(BasicExperimentDevice device) { + this.device = device; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndEmergency.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndEmergency.java new file mode 100644 index 0000000..c6e4f07 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndEmergency.java @@ -0,0 +1,71 @@ +package com.gkhy.labRiskManage.domain.experiment.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; + +import javax.persistence.*; +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 9:16 + */ +@Data +@Entity +@Table(name = "experiment_and_emergency") +public class ExperimentAndEmergency { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + /** + * 有无应急预案 + */ + private String emergencyPlan; + /** + * 预案名称 + */ + private String emergencyPlanName; + /** + * 是否演练 + */ + private String emergencyDrillStatus; + /** + * 应急演练情况 + */ + private String emergencyDrill; + /** + * 实验信息 + */ + private Long experimentId; + /** + * 修改时间 + */ + @JsonFormat + @LastModifiedDate + private LocalDateTime updateTime; + /** + * 新建时间 + */ + @JsonFormat + @CreatedDate + @Column(name = "create_time",updatable = false) + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndPerson.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndPerson.java new file mode 100644 index 0000000..4311a10 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndPerson.java @@ -0,0 +1,209 @@ +package com.gkhy.labRiskManage.domain.experiment.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 实验与实验人员 + */ +@EntityListeners(AuditingEntityListener.class) +@Entity +@Table(name = "experiment_and_person") +public class ExperimentAndPerson implements Serializable { + private static final long serialVersionUID = 217943177919881451L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + /** + * 实验ID + */ + @Column(name = "experiment_id") + private Long experimentId; + /** + * 人员id + */ + private Long personId; + /** + * 人员(此信息不在修改) + */ + private String personName; + /** + * 年龄(此信息不在修改) + */ + private Integer personAge; + /** + * 1-男;2-女(此信息不在修改) + */ + private Byte personGender; + /** + * 专业(此信息不在修改) + */ + private String personMajor; + /** + * 部门名称(与基础部门无关)(此信息不在修改) + */ + private String depName; + /** + * 相关资质(此信息不在修改) + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训(此信息不在修改) + */ + private Byte training; + /** + * 修改时间 + */ + @JsonFormat + @LastModifiedDate + private LocalDateTime updateTime; + /** + * 新建时间 + */ + @JsonFormat + @CreatedDate + @Column(name = "create_time",updatable = false) + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Long getPersonId() { + return personId; + } + + public void setPersonId(Long personId) { + this.personId = personId; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndSite.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndSite.java new file mode 100644 index 0000000..28c682c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndSite.java @@ -0,0 +1,42 @@ +package com.gkhy.labRiskManage.domain.experiment.entity; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentStuff; +import lombok.Data; + + +import javax.persistence.*; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/20 + * @time: 15:54 + */ +@Data +@Entity +@Table(name = "experiment_and_site") +public class ExperimentAndSite { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + /** + * 实验ID + */ + @Column(name = "experiment_id") + private Long experimentId; + /** + * 场所 + */ + @Column(name = "site_id") + private Long siteId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + @OneToOne(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @JoinColumn(name = "site_id",referencedColumnName = "id",insertable =false ,updatable = false) + private BasicExperimentSite site; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndStuff.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndStuff.java new file mode 100644 index 0000000..3c706c5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentAndStuff.java @@ -0,0 +1,152 @@ +package com.gkhy.labRiskManage.domain.experiment.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentStuff; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +/** + * 实验与耗材 + */ +@EntityListeners(AuditingEntityListener.class) +@Entity +@Table(name = "experiment_and_stuff") +public class ExperimentAndStuff implements Serializable { + private static final long serialVersionUID = -79650379228221888L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 实验ID + */ + @Column(name = "experiment_id") + private Long experimentId; + /** + * 耗材ID + */ + @Column(name = "stuff_id") + private Long stuffId; + /** + * 使用数量 + */ + private Integer stuffUseCount; + /** + * 修改时间 + */ + @JsonFormat + @LastModifiedDate + private LocalDateTime updateTime; + /** + * 新建时间 + */ + @JsonFormat + @CreatedDate + @Column(name = "create_time",updatable = false) + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + @ManyToOne(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @JoinColumn(name = "stuff_id",referencedColumnName = "id",insertable =false ,updatable = false) + private BasicExperimentStuff stuff; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Long getStuffId() { + return stuffId; + } + + public void setStuffId(Long stuffId) { + this.stuffId = stuffId; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Integer getStuffUseCount() { + return stuffUseCount; + } + + public void setStuffUseCount(Integer stuffUseCount) { + this.stuffUseCount = stuffUseCount; + } + + public BasicExperimentStuff getStuff() { + return stuff; + } + + public void setStuff(BasicExperimentStuff stuff) { + this.stuff = stuff; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentHazardousWaste.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentHazardousWaste.java new file mode 100644 index 0000000..477ef69 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentHazardousWaste.java @@ -0,0 +1,147 @@ +package com.gkhy.labRiskManage.domain.experiment.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 实验危废物 + */ +@EntityListeners(AuditingEntityListener.class) +@Entity +@Table(name = "experiment_hazardous_waste") +public class ExperimentHazardousWaste implements Serializable { + private static final long serialVersionUID = -50912711565680265L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 实验ID + */ + @Column(name = "experiment_id") + private Long experimentId; + /** + * 废弃物分类:1-有机;2-酸;3-碱性;4-固体废弃物;5-医疗废弃物;6-过期化学品;7-其他; + */ + private Byte classify; + /** + * 废弃物存储方式:1-吨袋;2-吨桶;3-小桶;4-托盘;5-其他; + */ + private Byte wasteStorage; + /** + * 预估处理量(计量单位:kg) + */ + private Double handAmount; + + /** + * 修改时间 + */ + @JsonFormat + @LastModifiedDate + private LocalDateTime updateTime; + /** + * 新建时间 + */ + @JsonFormat + @CreatedDate + @Column(name = "create_time",updatable = false) + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Byte getClassify() { + return classify; + } + + public void setClassify(Byte classify) { + this.classify = classify; + } + + public Byte getWasteStorage() { + return wasteStorage; + } + + public void setWasteStorage(Byte wasteStorage) { + this.wasteStorage = wasteStorage; + } + + public Double getHandAmount() { + return handAmount; + } + + public void setHandAmount(Double handAmount) { + this.handAmount = handAmount; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentInfo.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentInfo.java new file mode 100644 index 0000000..e806314 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/entity/ExperimentInfo.java @@ -0,0 +1,253 @@ +package com.gkhy.labRiskManage.domain.experiment.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.gkhy.labRiskManage.domain.account.entity.SysUserRoleBind; +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentSite; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlan; +import lombok.Data; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +/** + * 实验信息 + */ +@EntityListeners(AuditingEntityListener.class) +@Data +@Entity +@Table(name = "experiment_info") +public class ExperimentInfo implements Serializable { + private static final long serialVersionUID = -52940047194699982L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + /** + * 实验编号 + */ + private String experimentCode; + /** + * 自定义试验编号 + */ + private String experimentCustomCode; + + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private Byte experimentType; + + /** + * 实验负责人id + */ + private Long liabilityUserId; + /** + * 实验负责人电话 + */ + private String liabilityUserPhone; + + /** + * 实验负责人 + * (文字描述可能不再修改) + */ + private String liabilityUser; + /** + * 安全负责人id + */ + private Long safeLiabilityUserId; + /** + * 实验负责人电话 + */ + private String safeLiabilityUserPhone; + + /** + * 安全负责人(文字描述可能不再修改) + */ + private String safeLiabilityUser; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + /** + * 实验开始时间 + */ + private LocalDateTime startTime; + /** + * 实验步骤 + */ + private String experimentStep; + /** + * 实验操作方法 + */ + private String experimentMethod; + /** + * 工艺流程 + */ + private String process; + /** + * 关键过程 + */ + private String keyProcess; + /** + * 是否存在过夜、老化实验。1-存在;2-不存在 + */ + private Byte timeout; + /** + * 过夜、老化实验保障管理措施 + */ + private String timeoutManager; + /** + * 是否在密闭条件下。1-密闭;2-不密闭 + */ + private Byte closed; + /** + * 非密闭实验保障管理措施 + */ + private String unclosedManager; + /** + * 实验场所防爆措施条件和设施情况 + */ + private String explosionProof; + /** + * 实验场所防火措施条件和设施情况 + */ + private String fireProof; + /** + * 实验场所防毒措施条件和设施情况 + */ + private String poisonProof; + /** + * 安全管理制度 + */ + private String safeManagerMethod; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + /** + * 分区隔断情况 + */ + private Byte partitionCondition; + /** + * 其他基础信息 + */ + private String note; + /** + * 修改时间 + */ + @JsonFormat + @LastModifiedDate + private LocalDateTime updateTime; + /** + * 新建时间 + */ + @JsonFormat + @CreatedDate + @Column(name = "create_time",updatable = false) + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 实验评估状态:1-未评估;2-评估中;3-评估完成 + */ + private Byte stage; + /** + * 实验申请状态:1-未申请;2-已申请 + */ + private Byte status; + /** + * 实验标签:1-新立项;2-已开展 + */ + private Byte experimentTag; + + /** + * 实验预期时间 + */ + private LocalDateTime createExperimentTime; + /** + * 评估申请时间 + */ + private LocalDateTime assessApplyTime; + /** + * 整改 + */ + private Byte rectifyStatus; + /** + * 措施 + */ + private String measure; + /** + * 实验审核结果(0未审核,1审核中,2审核失败,3审核成功) + */ + private Byte approvalStatus; + /** + * 填报人 + */ + private String informant; + + @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @JoinColumn(name = "experiment_id",referencedColumnName = "id",insertable =false ,updatable = false) + private List<ExperimentAndSite> sites; + + @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @Fetch(FetchMode.SUBSELECT) + @JoinColumn(name = "experiment_id",referencedColumnName = "id",insertable =false ,updatable = false) + private List<ExperimentAndDevice> devices; + + @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @Fetch(FetchMode.SUBSELECT) + @JoinColumn(name = "experiment_id",referencedColumnName = "id",insertable =false ,updatable = false) + private List<ExperimentAndStuff> stuffs; + + @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @Fetch(FetchMode.SUBSELECT) + @JoinColumn(name = "experiment_id",referencedColumnName = "id",insertable =false ,updatable = false) + private List<ExperimentAndPerson> persons; + + @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @Fetch(FetchMode.SUBSELECT) + @JoinColumn(name = "experiment_id",referencedColumnName = "id",insertable =false ,updatable = false) + private List<ExperimentHazardousWaste> wastes; + + @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @Fetch(FetchMode.SUBSELECT) + @JoinColumn(name = "experimentId",referencedColumnName = "id",insertable =false ,updatable = false) + private List<ExperimentAndEmergency> emergencies; + + @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH}) + @Fetch(FetchMode.SUBSELECT) + @JoinColumn(name = "experimentId",referencedColumnName = "id",insertable =false ,updatable = false) + private List<RiskAssessPlan> riskAssessPlans; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/CloseConditionEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/CloseConditionEnum.java new file mode 100644 index 0000000..5539bfc --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/CloseConditionEnum.java @@ -0,0 +1,61 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum CloseConditionEnum { + CLOSE_YES((byte)1,"密闭"), + CLOSE_NO((byte)2,"不密闭"), + ; + + private Byte value; + private String dec; + + CloseConditionEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, CloseConditionEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, CloseConditionEnum> map) { + CloseConditionEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, CloseConditionEnum> map; + + static { + map = new HashMap<>(); + for(CloseConditionEnum e : CloseConditionEnum.values()){ + map.put(e.value,e); + } + } + + public static CloseConditionEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/EmergencyDrillStatusEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/EmergencyDrillStatusEnum.java new file mode 100644 index 0000000..dd171ff --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/EmergencyDrillStatusEnum.java @@ -0,0 +1,62 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum EmergencyDrillStatusEnum { + + NOT_EVALUATION((byte)1,"是"), + UNDER_EVALUATION((byte)2,"否"), + ; + + private Byte value; + private String dec; + + EmergencyDrillStatusEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, EmergencyDrillStatusEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, EmergencyDrillStatusEnum> map) { + EmergencyDrillStatusEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, EmergencyDrillStatusEnum> map; + + static { + map = new HashMap<>(); + for(EmergencyDrillStatusEnum e : EmergencyDrillStatusEnum.values()){ + map.put(e.value,e); + } + } + + public static EmergencyDrillStatusEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentApprovalStatusEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentApprovalStatusEnum.java new file mode 100644 index 0000000..afe77a9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentApprovalStatusEnum.java @@ -0,0 +1,63 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum ExperimentApprovalStatusEnum { + + NOT_APPROVAL((byte)0,"未审核"), + APPROVALING((byte)1,"审核中"), + APPROVAL_FAIL((byte)2,"审核失败"), + APPROVAL_SUCCESS((byte)3,"审核通过"); + + private Byte value; + private String dec; + + ExperimentApprovalStatusEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, ExperimentApprovalStatusEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, ExperimentApprovalStatusEnum> map) { + ExperimentApprovalStatusEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, ExperimentApprovalStatusEnum> map; + + static { + map = new HashMap<>(); + for(ExperimentApprovalStatusEnum e : ExperimentApprovalStatusEnum.values()){ + map.put(e.value,e); + } + } + + public static ExperimentApprovalStatusEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentRectifyStatusEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentRectifyStatusEnum.java new file mode 100644 index 0000000..831ed7e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentRectifyStatusEnum.java @@ -0,0 +1,63 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum ExperimentRectifyStatusEnum { + + NOT_RECTIFY((byte)0,"无需整改"), + WAIT_RECTIFY((byte)1,"待整改"), + YES_RECTIFY((byte)2,"已申请整改"), + ; + + private Byte value; + private String dec; + + ExperimentRectifyStatusEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, ExperimentRectifyStatusEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, ExperimentRectifyStatusEnum> map) { + ExperimentRectifyStatusEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, ExperimentRectifyStatusEnum> map; + + static { + map = new HashMap<>(); + for(ExperimentRectifyStatusEnum e : ExperimentRectifyStatusEnum.values()){ + map.put(e.value,e); + } + } + + public static ExperimentRectifyStatusEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStageEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStageEnum.java new file mode 100644 index 0000000..ee8e559 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStageEnum.java @@ -0,0 +1,62 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum ExperimentStageEnum { + NOT_EVALUATION((byte)1,"未评估"), + UNDER_EVALUATION((byte)2,"评估中"), + COMPLETED_EVALUATION((byte)3,"评估完成"), + ; + + private Byte value; + private String dec; + + ExperimentStageEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, ExperimentStageEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, ExperimentStageEnum> map) { + ExperimentStageEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, ExperimentStageEnum> map; + + static { + map = new HashMap<>(); + for(ExperimentStageEnum e : ExperimentStageEnum.values()){ + map.put(e.value,e); + } + } + + public static ExperimentStageEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStatusEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStatusEnum.java new file mode 100644 index 0000000..36345f0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentStatusEnum.java @@ -0,0 +1,62 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum ExperimentStatusEnum { + + NOT_APPLY((byte)1,"未申请"), + YES_APPLY((byte)2,"已申请"), + ; + + private Byte value; + private String dec; + + ExperimentStatusEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, ExperimentStatusEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, ExperimentStatusEnum> map) { + ExperimentStatusEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, ExperimentStatusEnum> map; + + static { + map = new HashMap<>(); + for(ExperimentStatusEnum e : ExperimentStatusEnum.values()){ + map.put(e.value,e); + } + } + + public static ExperimentStatusEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentTagEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentTagEnum.java new file mode 100644 index 0000000..1bf39a9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentTagEnum.java @@ -0,0 +1,62 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum ExperimentTagEnum { + + NEW_CREATE((byte)1,"新立项"), + AREADLY_DEVELOP((byte)2,"已开展"), + ; + + private Byte value; + private String dec; + + ExperimentTagEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, ExperimentTagEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, ExperimentTagEnum> map) { + ExperimentTagEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, ExperimentTagEnum> map; + + static { + map = new HashMap<>(); + for(ExperimentTagEnum e : ExperimentTagEnum.values()){ + map.put(e.value,e); + } + } + + public static ExperimentTagEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentTypeEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentTypeEnum.java new file mode 100644 index 0000000..98fd88c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/ExperimentTypeEnum.java @@ -0,0 +1,67 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import com.gkhy.labRiskManage.domain.account.enums.UserIdTypeEnum; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:16 + */ +public enum ExperimentTypeEnum { + CHEMISTRY((byte)1,"化学类"), + BIOLOGY((byte)2,"生物类"), + RADIATION((byte)3,"辐射类"), + ELECTROMECHANICAL((byte)4,"机电类"), + SPECIAL_EQUIPMENT((byte)5,"特种设备类"), + OTHER((byte)6,"其它类"), + ; + + private Byte type; + private String dec; + + ExperimentTypeEnum(Byte type, String dec) { + this.type = type; + this.dec = dec; + } + + public Byte getType() { + return type; + } + + public void setType(Byte type) { + this.type = type; + } + + public static Map<Byte, ExperimentTypeEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, ExperimentTypeEnum> map) { + ExperimentTypeEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, ExperimentTypeEnum> map; + + static { + map = new HashMap<>(); + for(ExperimentTypeEnum e : ExperimentTypeEnum.values()){ + map.put(e.type,e); + } + } + + public static ExperimentTypeEnum prase(Byte type){ + return map.get(type); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteEnum.java new file mode 100644 index 0000000..37358d6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteEnum.java @@ -0,0 +1,61 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum HazardousWasteEnum { + HAZARDOUS_WASTE_YES((byte)1,"有危废"), + HAZARDOUS_WASTE_NO((byte)2,"无危废"), + ; + + private Byte value; + private String dec; + + HazardousWasteEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, HazardousWasteEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, HazardousWasteEnum> map) { + HazardousWasteEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, HazardousWasteEnum> map; + + static { + map = new HashMap<>(); + for(HazardousWasteEnum e : HazardousWasteEnum.values()){ + map.put(e.value,e); + } + } + + public static HazardousWasteEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteStorageEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteStorageEnum.java new file mode 100644 index 0000000..97d2a64 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteStorageEnum.java @@ -0,0 +1,65 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +//危废类型 +public enum HazardousWasteStorageEnum { + TON_BAG((byte)1,"吨袋"), + TON_BUCKET((byte)2,"吨桶"), + KEG((byte)3,"小桶"), + TRAY((byte)4,"托盘"), + OTHER((byte)7,"其他"), + ; + + private Byte value; + private String dec; + + HazardousWasteStorageEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, HazardousWasteStorageEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, HazardousWasteStorageEnum> map) { + HazardousWasteStorageEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, HazardousWasteStorageEnum> map; + + static { + map = new HashMap<>(); + for(HazardousWasteStorageEnum e : HazardousWasteStorageEnum.values()){ + map.put(e.value,e); + } + } + + public static HazardousWasteStorageEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteTypeEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteTypeEnum.java new file mode 100644 index 0000000..bd6b628 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/HazardousWasteTypeEnum.java @@ -0,0 +1,67 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +//危废类型 +public enum HazardousWasteTypeEnum { + ORGANIC((byte)1,"有机"), + ACIDIC((byte)2,"酸性"), + ALKALINITY((byte)3,"碱性"), + SOLID_WASTE((byte)4,"固体废弃物"), + MEDICAL_WASTE((byte)5,"医疗废弃物"), + EXPIRED_CHEMICAL((byte)6,"过期化学品"), + OTHER((byte)7,"其他"), + ; + + private Byte value; + private String dec; + + HazardousWasteTypeEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, HazardousWasteTypeEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, HazardousWasteTypeEnum> map) { + HazardousWasteTypeEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, HazardousWasteTypeEnum> map; + + static { + map = new HashMap<>(); + for(HazardousWasteTypeEnum e : HazardousWasteTypeEnum.values()){ + map.put(e.value,e); + } + } + + public static HazardousWasteTypeEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/PertitionConditionEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/PertitionConditionEnum.java new file mode 100644 index 0000000..0151b19 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/PertitionConditionEnum.java @@ -0,0 +1,61 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 15:25 + */ +public enum PertitionConditionEnum { + YES((byte)0,"是"), + NO((byte)1,"否"), + ; + + private Byte value; + private String dec; + + PertitionConditionEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, PertitionConditionEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, CloseConditionEnum> map) { + CloseConditionEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, PertitionConditionEnum> map; + + static { + map = new HashMap<>(); + for(PertitionConditionEnum e : PertitionConditionEnum.values()){ + map.put(e.value,e); + } + } + + public static PertitionConditionEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/SafeInformationSystemEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/SafeInformationSystemEnum.java new file mode 100644 index 0000000..7e1edb4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/SafeInformationSystemEnum.java @@ -0,0 +1,61 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum SafeInformationSystemEnum { + YES((byte)1,"是"), + NO((byte)2,"否"), + ; + + private Byte value; + private String dec; + + SafeInformationSystemEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, SafeInformationSystemEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, SafeInformationSystemEnum> map) { + SafeInformationSystemEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, SafeInformationSystemEnum> map; + + static { + map = new HashMap<>(); + for(SafeInformationSystemEnum e : SafeInformationSystemEnum.values()){ + map.put(e.value,e); + } + } + + public static SafeInformationSystemEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/TimeoutEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/TimeoutEnum.java new file mode 100644 index 0000000..14c374c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/enums/TimeoutEnum.java @@ -0,0 +1,61 @@ +package com.gkhy.labRiskManage.domain.experiment.enums; + +import java.util.HashMap; +import java.util.Map; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 17:31 + */ +public enum TimeoutEnum { + EXISTENT((byte)1,"存在"), + NON_EXISTENT((byte)2,"不存在"), + ; + + private Byte value; + private String dec; + + TimeoutEnum(Byte value, String dec) { + this.value = value; + this.dec = dec; + } + + public Byte getValue() { + return value; + } + + public void setValue(Byte value) { + this.value = value; + } + + public static Map<Byte, TimeoutEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, TimeoutEnum> map) { + TimeoutEnum.map = map; + } + + public String getDec() { + return dec; + } + + public void setDec(String dec) { + this.dec = dec; + } + + static Map<Byte, TimeoutEnum> map; + + static { + map = new HashMap<>(); + for(TimeoutEnum e : TimeoutEnum.values()){ + map.put(e.value,e); + } + } + + public static TimeoutEnum prase(Byte value){ + return map.get(value); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/bo/ExperimentDevelopUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/bo/ExperimentDevelopUpdateBO.java new file mode 100644 index 0000000..0d21358 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/bo/ExperimentDevelopUpdateBO.java @@ -0,0 +1,58 @@ +package com.gkhy.labRiskManage.domain.experiment.model.bo; + +import java.time.LocalDateTime; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/20 + * @time: 15:25 + */ +public class ExperimentDevelopUpdateBO { + /** + * 实验id + */ + private Long id; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + + private LocalDateTime startTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getSisStatus() { + return sisStatus; + } + + public void setSisStatus(Byte sisStatus) { + this.sisStatus = sisStatus; + } + + public String getSafeInformationSystem() { + return safeInformationSystem; + } + + public void setSafeInformationSystem(String safeInformationSystem) { + this.safeInformationSystem = safeInformationSystem; + } + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/bo/ExperimentInfoQueryBO.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/bo/ExperimentInfoQueryBO.java new file mode 100644 index 0000000..d1c9b00 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/bo/ExperimentInfoQueryBO.java @@ -0,0 +1,23 @@ +package com.gkhy.labRiskManage.domain.experiment.model.bo; + +import lombok.Data; + +import java.time.LocalDate; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/26 + * @time: 14:46 + */ +@Data +public class ExperimentInfoQueryBO { + private LocalDate startTime; + private LocalDate endTime; + private Byte experimentType; + private String experimentName; + private Byte experimentTag; + private Byte status; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndDeviceDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndDeviceDTO.java new file mode 100644 index 0000000..abac8ef --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndDeviceDTO.java @@ -0,0 +1,111 @@ +package com.gkhy.labRiskManage.domain.experiment.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 实验与设备 + */ + +public class ExperimentAndDeviceDTO { + + + /** + * 设备编号 + */ + private String deviceCode; + /** + * 设备名称 + */ + private String deviceName; + /** + * 设备功率 + */ + private String devicePower; + /** + * 是否特种设备:1-是;2-不是 + */ + private Byte specialDevice; + + /** + * 计量单位:1-台;2-个; 3-件 + */ + private Byte deviceUnit; + /** + * 安全防护 + */ + private String safeProtect; + /** + * 使用数量 + */ + private Integer deviceUseCount; + private Long deviceId; + + + + public Integer getDeviceUseCount() { + return deviceUseCount; + } + + public void setDeviceUseCount(Integer deviceUseCount) { + this.deviceUseCount = deviceUseCount; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDevicePower() { + return devicePower; + } + + public void setDevicePower(String devicePower) { + this.devicePower = devicePower; + } + + public Byte getSpecialDevice() { + return specialDevice; + } + + public void setSpecialDevice(Byte specialDevice) { + this.specialDevice = specialDevice; + } + + public Byte getDeviceUnit() { + return deviceUnit; + } + + public void setDeviceUnit(Byte deviceUnit) { + this.deviceUnit = deviceUnit; + } + + public String getSafeProtect() { + return safeProtect; + } + + public void setSafeProtect(String safeProtect) { + this.safeProtect = safeProtect; + } + + public Long getDeviceId() { + return deviceId; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndEmergencyDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndEmergencyDTO.java new file mode 100644 index 0000000..831be78 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndEmergencyDTO.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.experiment.model.dto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 16:07 + */ +@Data +public class ExperimentAndEmergencyDTO { + private Long id; + /** + * 有无应急预案 + */ + private String emergencyPlan; + /** + * 预案名称 + */ + private String emergencyPlanName; + /** + * 是否演练 + */ + private String emergencyDrillStatus; + /** + * 应急演练情况 + */ + private String emergencyDrill; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndPersonDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndPersonDTO.java new file mode 100644 index 0000000..81db923 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndPersonDTO.java @@ -0,0 +1,128 @@ +package com.gkhy.labRiskManage.domain.experiment.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 实验与实验人员 + */ + +public class ExperimentAndPersonDTO { + + + /** + * 实验ID + */ + private Long experimentId; + /** + * 人员id + */ + private Long personId; + /** + * 人员(此信息不在修改) + */ + private String personName; + /** + * 年龄(此信息不在修改) + */ + private Integer personAge; + + /** + * 1-男;2-女(此信息不在修改) + */ + private Byte personGender; + /** + * 专业(此信息不在修改) + */ + private String personMajor; + /** + * 部门名称(与基础部门无关)(此信息不在修改) + */ + private String depName; + /** + * 相关资质(此信息不在修改) + */ + private String aptitude; + /** + * 培训情况:1-已完成当期安全培训;2-未完成当期安全培训(此信息不在修改) + */ + private Byte training; + + + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Long getPersonId() { + return personId; + } + + public void setPersonId(Long personId) { + this.personId = personId; + } + + public String getPersonName() { + return personName; + } + + public void setPersonName(String personName) { + this.personName = personName; + } + + public Integer getPersonAge() { + return personAge; + } + + public void setPersonAge(Integer personAge) { + this.personAge = personAge; + } + + public Byte getPersonGender() { + return personGender; + } + + public void setPersonGender(Byte personGender) { + this.personGender = personGender; + } + + public String getPersonMajor() { + return personMajor; + } + + public void setPersonMajor(String personMajor) { + this.personMajor = personMajor; + } + + public String getDepName() { + return depName; + } + + public void setDepName(String depName) { + this.depName = depName; + } + + public String getAptitude() { + return aptitude; + } + + public void setAptitude(String aptitude) { + this.aptitude = aptitude; + } + + public Byte getTraining() { + return training; + } + + public void setTraining(Byte training) { + this.training = training; + } + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndSiteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndSiteDTO.java new file mode 100644 index 0000000..9a32829 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndSiteDTO.java @@ -0,0 +1,41 @@ +package com.gkhy.labRiskManage.domain.experiment.model.dto; + +import lombok.Data; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2022/12/27 + * @time: 15:27 + */ +@Data +public class ExperimentAndSiteDTO { + private Long siteId; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + + /** + * 场所性质 + */ + private String siteType; + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndStuffDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndStuffDTO.java new file mode 100644 index 0000000..d697337 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentAndStuffDTO.java @@ -0,0 +1,97 @@ +package com.gkhy.labRiskManage.domain.experiment.model.dto; + +/** + * 实验与耗材 + */ + +public class ExperimentAndStuffDTO{ + + + /** + * 名称 + */ + private String stuffName; + /** + * 类型 + */ + private Byte stuffType; + /** + * 编号 + */ + private String stuffCode; + /** + * 存储方式 + */ + private Byte stuffStorage; + /** + * 计量单位 + */ + private Byte stuffUnit; + /** + * 使用数量 + */ + private Integer stuffUseCount; + + private Long stuffId; + + + + + public Integer getStuffUseCount() { + return stuffUseCount; + } + + public void setStuffUseCount(Integer stuffUseCount) { + this.stuffUseCount = stuffUseCount; + } + + public String getStuffName() { + return stuffName; + } + + public void setStuffName(String stuffName) { + this.stuffName = stuffName; + } + + + public Byte getStuffType() { + return stuffType; + } + + public void setStuffType(Byte stuffType) { + this.stuffType = stuffType; + } + + public String getStuffCode() { + return stuffCode; + } + + public void setStuffCode(String stuffCode) { + this.stuffCode = stuffCode; + } + + public Byte getStuffStorage() { + return stuffStorage; + } + + public void setStuffStorage(Byte stuffStorage) { + this.stuffStorage = stuffStorage; + } + + public Byte getStuffUnit() { + return stuffUnit; + } + + public void setStuffUnit(Byte stuffUnit) { + this.stuffUnit = stuffUnit; + } + + public Long getStuffId() { + return stuffId; + } + + public void setStuffId(Long stuffId) { + this.stuffId = stuffId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentHazardousWasteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentHazardousWasteDTO.java new file mode 100644 index 0000000..d624c48 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentHazardousWasteDTO.java @@ -0,0 +1,119 @@ +package com.gkhy.labRiskManage.domain.experiment.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 实验危废物 + */ +public class ExperimentHazardousWasteDTO{ + + private Long id; + /** + * 实验ID + */ + private Long experimentId; + /** + * 废弃物分类:1-有机;2-酸;3-碱性;4-固体废弃物;5-医疗废弃物;6-过期化学品;7-其他; + */ + private Byte classify; + /** + * 废弃物存储方式:1-吨袋;2-吨桶;3-小桶;4-托盘;5-其他; + */ + private Byte wasteStorage; + /** + * 预估处理量(计量单位:kg) + */ + private Double handAmount; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Byte getClassify() { + return classify; + } + + public void setClassify(Byte classify) { + this.classify = classify; + } + + public Byte getWasteStorage() { + return wasteStorage; + } + + public void setWasteStorage(Byte wasteStorage) { + this.wasteStorage = wasteStorage; + } + + public Double getHandAmount() { + return handAmount; + } + + public void setHandAmount(Double handAmount) { + this.handAmount = handAmount; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentInfoDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentInfoDTO.java new file mode 100644 index 0000000..a6c8a09 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/model/dto/ExperimentInfoDTO.java @@ -0,0 +1,212 @@ +package com.gkhy.labRiskManage.domain.experiment.model.dto; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 实验信息 + */ +@Data +public class ExperimentInfoDTO { + private Long id; + /** + * 实验编号 + */ + private String experimentCode; + /** + * 自定义试验编号 + */ + private String experimentCustomCode; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long liabilityUserId; + /** + * 实验负责人 + * (文字描述可能不再修改) + */ + private String liabilityUser; + + private String liabilityUserPhone; + + private String safeLiabilityUserPhone; + /** + * 安全负责人id + */ + private Long safeLiabilityUserId; + /** + * 安全负责人(文字描述可能不再修改) + */ + private String safeLiabilityUser; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + + private Long siteId; + + /** + * 实验开始时间 + */ + private LocalDateTime startTime; + /** + * 实验步骤 + */ + private String experimentStep; + /** + * 实验操作方法 + */ + private String experimentMethod; + /** + * 工艺流程 + */ + private String process; + /** + * 关键过程 + */ + private String keyProcess; + /** + * 是否存在过夜、老化实验。1-存在;2-不存在 + */ + private Byte timeout; + /** + * 过夜、老化实验保障管理措施 + */ + private String timeoutManager; + /** + * 是否在密闭条件下。1-密闭;2-不密闭 + */ + private Byte closed; + /** + * 非密闭实验保障管理措施 + */ + private String unclosedManager; + /** + * 实验场所防爆措施条件和设施情况 + */ + private String explosionProof; + /** + * 实验场所防火措施条件和设施情况 + */ + private String fireProof; + /** + * 实验场所防毒措施条件和设施情况 + */ + private String poisonProof; + /** + * 危废产生情况:1-有危废;2-无危废 + */ + private Byte hazardousWaste; + /** + * 安全管理制度 + */ + private String safeManagerMethod; + /** + * 是否是安全化信息系统(1是,2否) + */ + private Byte sisStatus; + /** + * 安全信息化系统 + */ + private String safeInformationSystem; + + /** + * 分区隔断情况 + */ + private Byte partitionCondition; + /** + * 其他基础信息 + */ + private String note; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Integer updateByUserId; + /** + * 新建人 + */ + private Integer createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 实验评估状态:1-未评估;2-评估中;3-评估完成 + */ + private Byte stage; + /** + * 实验申请状态:1-未申请;2-已申请 + */ + private Byte status; + /** + * 实验标签:1-新立项;2-已开展 + */ + private Byte experimentTag; + /** + * 实验预期时间 + */ + private LocalDateTime createExperimentTime; + /** + * 措施 + */ + private String measure; + /** + * 整改 0未整改 1整改 + */ + private Byte rectifyStatus; + /** + * 审核结果 + */ + private Byte approvalStatus; + /** + * 评估申请时间 + */ + private LocalDateTime assessApplyTime; + /** + * 填报人 + */ + private String informant; + /** + * 填报人 + */ + private String assessPerson; + + + private List<ExperimentAndSiteDTO> sites; + + private List<ExperimentAndDeviceDTO> devices; + + private List<ExperimentAndPersonDTO> persons; + + private List<ExperimentHazardousWasteDTO> wastes; + + private List<ExperimentAndStuffDTO> stuffs; + + private List<ExperimentAndEmergencyDTO> emergencies; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndDeviceRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndDeviceRepository.java new file mode 100644 index 0000000..e79eb0e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndDeviceRepository.java @@ -0,0 +1,25 @@ +package com.gkhy.labRiskManage.domain.experiment.repository.jpa; + +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndDevice; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 实验与设备 + */ +@Repository +public interface ExperimentAndDeviceRepository extends JpaRepository<ExperimentAndDevice, Long> { + + @Modifying + @Query(value = "update experiment_and_device set delete_status = 1 where experiment_id = :experimentId",nativeQuery = true) + int deleteByExperimentId(@Param("experimentId") Long experimentId); + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndEmergencyRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndEmergencyRepository.java new file mode 100644 index 0000000..0a2e13e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndEmergencyRepository.java @@ -0,0 +1,21 @@ +package com.gkhy.labRiskManage.domain.experiment.repository.jpa; + +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndEmergency; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 10:40 + */ +@Repository +public interface ExperimentAndEmergencyRepository extends JpaRepository<ExperimentAndEmergency, Long> { + @Modifying + @Query(value = "update experiment_and_emergency set delete_status = 1 where experiment_id = :experimentId",nativeQuery = true) + int deleteByExperimentId(@Param("experimentId") Long experimentId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndPersonRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndPersonRepository.java new file mode 100644 index 0000000..4d63fa3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndPersonRepository.java @@ -0,0 +1,23 @@ +package com.gkhy.labRiskManage.domain.experiment.repository.jpa; + + +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndPerson; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 实验与实验人员 + */ +@Repository +public interface ExperimentAndPersonRepository extends JpaRepository<ExperimentAndPerson, Long> { + @Modifying + @Query(value = "update experiment_and_person set delete_status = 1 where experiment_id = :experimentId",nativeQuery = true) + int deleteByExperimentId(@Param("experimentId") Long experimentId); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndSiteRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndSiteRepository.java new file mode 100644 index 0000000..2ddc9ae --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndSiteRepository.java @@ -0,0 +1,26 @@ +package com.gkhy.labRiskManage.domain.experiment.repository.jpa; + +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndSite; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/20 + * @time: 16:18 + */ +@Repository +public interface ExperimentAndSiteRepository extends JpaRepository<ExperimentAndSite, Long> { + + @Modifying + @Query(value = "update experiment_and_site set delete_status = 1 where experiment_id = :experimentId",nativeQuery = true) + int deleteByExperimentId(Long experimentId); + + @Query(value = "select * from experiment_and_site where delete_status = 0 and experiment_id = :id",nativeQuery = true) + List<ExperimentAndSite> getByExperimentId(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndStuffRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndStuffRepository.java new file mode 100644 index 0000000..3316cb5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentAndStuffRepository.java @@ -0,0 +1,23 @@ +package com.gkhy.labRiskManage.domain.experiment.repository.jpa; + +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndStuff; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 实验与耗材 + */ +@Repository +public interface ExperimentAndStuffRepository extends JpaRepository<ExperimentAndStuff, Long> { + + @Modifying + @Query(value = "update experiment_and_stuff set delete_status = 1 where experiment_id = :experimentId",nativeQuery = true) + int deleteByExperimentId(@Param("experimentId") Long experimentId); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentHazardousWasteRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentHazardousWasteRepository.java new file mode 100644 index 0000000..83c92de --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentHazardousWasteRepository.java @@ -0,0 +1,23 @@ +package com.gkhy.labRiskManage.domain.experiment.repository.jpa; + +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentHazardousWaste; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 实验危废物 + */ +@Repository +public interface ExperimentHazardousWasteRepository extends JpaRepository<ExperimentHazardousWaste, Long> { + + @Modifying + @Query(value = "update experiment_hazardous_waste set delete_status = 1 where experiment_id = :experimentId",nativeQuery = true) + int deleteByExperimentId(@Param("experimentId") Long experimentId); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentInfoRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentInfoRepository.java new file mode 100644 index 0000000..73bd54f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/repository/jpa/ExperimentInfoRepository.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.domain.experiment.repository.jpa; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentDevice; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentInfo; +import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.time.LocalDate; +import java.util.List; + +/** + * 实验信息 + */ +@Repository +public interface ExperimentInfoRepository extends JpaRepository<ExperimentInfo, Long>, JpaSpecificationExecutor<ExperimentInfo> { + + @Query(value = "SELECT count(1) FROM experiment_info e WHERE DATE_FORMAT(e.create_time,'%Y-%m-%d') = :time", + nativeQuery = true) + Integer countByCreateTime(@Param("time") String time); + + @Query(value = "SELECT * FROM experiment_info e WHERE e.id = :id and e.delete_status = 0" ,nativeQuery = true) + ExperimentInfo getExperimentInfoById(@Param("id") Long id); + + @Query(value = "SELECT * FROM experiment_info e WHERE e.id in :idList and e.delete_status = 0" ,nativeQuery = true) + List<ExperimentInfo> getExperimentInfoByIds(List<Long> idList); + + @Query(value = "SELECT * FROM experiment_info e WHERE e.experiment_name = :experimentName and e.delete_status = 0" ,nativeQuery = true) + ExperimentInfo getExperimentInfoByName(@Param("experimentName") String experimentName); + /** + * 实验信息 - 修改实验评估状态 + */ + @Query(value = "update experiment_info t set t.stage = :stage where t.id = :id and t.delete_status = 0" ,nativeQuery = true) + ExperimentInfo updateExperimentStage(Long id, Integer stage); + + @Query(value = "select e.* from experiment_info e LEFT JOIN risk_assess_plan r on e.id = r.experiment_id where e.delete_status = 0 and e.status = 2 and e.stage in(1,2) and e.liability_user_id = :currentUserId or r.evaluate_user_id = :currentUserId or r.identification_user_id = :currentUserId group by e.id",nativeQuery = true) + List<ExperimentInfo> getExperimentInfoList(Long currentUserId); + + @Query(value = "select * from experiment_info e where e.delete_status = 0 and e.liability_user_id = :currentUserId ",nativeQuery = true) + List<ExperimentInfo> getExperimentByUser(Long currentUserId); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndDeviceService.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndDeviceService.java new file mode 100644 index 0000000..1cb8cdd --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndDeviceService.java @@ -0,0 +1,17 @@ +package com.gkhy.labRiskManage.domain.experiment.service; + + +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAndDeviceAppInsertBO; + +import java.util.List; + +/** + * 实验与设备 + */ +public interface ExperimentAndDeviceService { + + + boolean saveBatch(Long currentUserId, List<ExperimentAndDeviceAppInsertBO> deviceInsertBOList); + + void deleteByExperimentId(Long experimentId,Long currentUserId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndEmergencyService.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndEmergencyService.java new file mode 100644 index 0000000..82cc5fc --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndEmergencyService.java @@ -0,0 +1,16 @@ +package com.gkhy.labRiskManage.domain.experiment.service; + +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAndEmergencyAppInsertBO; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 13:55 + */ +public interface ExperimentAndEmergencyService { + boolean saveBatch(Long currentUserId, List<ExperimentAndEmergencyAppInsertBO> experimentAndEmergencyAppInsertBOList); + void deleteByExperimentId(Long experimentId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndPersonService.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndPersonService.java new file mode 100644 index 0000000..52f636a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndPersonService.java @@ -0,0 +1,14 @@ +package com.gkhy.labRiskManage.domain.experiment.service; + + +import java.util.List; + +/** + * 实验与实验人员 + */ +public interface ExperimentAndPersonService { + + boolean saveBatch(Long currentUserId, List<Long> personIds, Long experimentId); + + void deleteByExperimentId(Long experimentId, Long currentUserId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndSiteService.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndSiteService.java new file mode 100644 index 0000000..a37d861 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndSiteService.java @@ -0,0 +1,19 @@ +package com.gkhy.labRiskManage.domain.experiment.service; + +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndSite; + +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/20 + * @time: 15:51 + */ +public interface ExperimentAndSiteService { + boolean saveBatch(Long currentUserId, List<Long> siteIds, Long experimentId); + + void deleteByExperimentId(Long id); + + List<ExperimentAndSite> getByExperimentId(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndStuffService.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndStuffService.java new file mode 100644 index 0000000..74738ea --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentAndStuffService.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.domain.experiment.service; + + +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAndStuffAppInsertBO; +import java.util.List; + +/** + * 实验与耗材 + */ +public interface ExperimentAndStuffService { + + boolean saveBatch(Long currentUserId, List<ExperimentAndStuffAppInsertBO> stuffAppInsertBOList); + + void deleteByExperimentId(Long experimentId, Long currentUserId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentHazardousWasteService.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentHazardousWasteService.java new file mode 100644 index 0000000..8f77c84 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentHazardousWasteService.java @@ -0,0 +1,15 @@ +package com.gkhy.labRiskManage.domain.experiment.service; + +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentHazardousWasteAppInsertBO; + +import java.util.List; + +/** + * 实验危废物 + */ +public interface ExperimentHazardousWasteService { + + boolean saveBatch(Long currentUserId, List<ExperimentHazardousWasteAppInsertBO> hazardousWasteAppInsertBOList); + + void deleteByExperimentId(Long experimentId, Long currentUserId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentInfoService.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentInfoService.java new file mode 100644 index 0000000..027863b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/ExperimentInfoService.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.domain.experiment.service; + + +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAppInsertBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentInfo; +import com.gkhy.labRiskManage.domain.experiment.model.bo.ExperimentDevelopUpdateBO; +import com.gkhy.labRiskManage.domain.experiment.model.bo.ExperimentInfoQueryBO; +import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.UpdateExperimentInfoBO; + +import java.util.List; + +/** + * 实验信息 + */ +public interface ExperimentInfoService { + + ExperimentInfoDTO save(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO); + ExperimentInfoDTO developSave(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO); + + boolean deleteById(Long id,Long currentUserId); + ExperimentInfoDTO getExperimentById(Long id); + ExperimentInfoDTO getExperimentByName(String experimentName); + + List<ExperimentInfoDTO> getExperimentInfoByIds(List<Long> idList); + + boolean updateDevelop(Long currentUserId, List<ExperimentDevelopUpdateBO> developUpdateBOList); + + boolean applyEvaluation(Long currentUserId, List<Long> ids); + + SearchResult<List<ExperimentInfoDTO>> listByPage(PageQuery<ExperimentInfoQueryBO> pageQuery,Long currentUserId); + /** + * 实验信息 - 修改实验状态 + */ + ExperimentInfoDTO updateExperimentStage(Long id, Byte stage); + + boolean revokeApplyEvaluation(Long currentUserId, List<Long> ids); + + /** + * 获取实验信息列表 + * @return + */ + List<ExperimentInfoDTO> getExperimentInfoList(Long currentUserId); + + boolean updateRectify(Long experimentId); + + List<ExperimentInfoDTO> getExperimentByUser(Long currentUserId); + + ExperimentInfo updateExperimentStatus(UpdateExperimentInfoBO updateBO); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndDeviceServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndDeviceServiceImpl.java new file mode 100644 index 0000000..ffb8a88 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndDeviceServiceImpl.java @@ -0,0 +1,84 @@ +package com.gkhy.labRiskManage.domain.experiment.service.impl; + +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAndDeviceAppInsertBO; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.basic.model.dto.DeviceQueryDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentDeviceService; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndDevice; +import com.gkhy.labRiskManage.domain.experiment.repository.jpa.ExperimentAndDeviceRepository; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndDeviceService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + + +/** + * 实验与设备 + */ +@Service +public class ExperimentAndDeviceServiceImpl implements ExperimentAndDeviceService { + @Autowired + private ExperimentAndDeviceRepository repository; + @Autowired + private BasicExperimentDeviceService basicExperimentDeviceService; + + + + @Override + public boolean saveBatch(Long currentUserId, List<ExperimentAndDeviceAppInsertBO> deviceAppInsertBOList) { + Boolean flag = false; + if(CollectionUtils.isEmpty(deviceAppInsertBOList)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择试验设备!"); + } + List<Long> deviceIdList = deviceAppInsertBOList.stream().map(ExperimentAndDeviceAppInsertBO::getDeviceId).collect(Collectors.toList()); + List<DeviceQueryDTO> basicExperimentDeviceByIdList = basicExperimentDeviceService.getBasicExperimentDeviceByIdList(deviceIdList); + + for(ExperimentAndDeviceAppInsertBO experimentAndDeviceAppInsertBO:deviceAppInsertBOList){ + if(ObjectUtils.isEmpty(experimentAndDeviceAppInsertBO.getDeviceId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"设备主键不可为空!"); + } + if(ObjectUtils.isEmpty(experimentAndDeviceAppInsertBO.getDeviceUseCount())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"设备数量不可为空!"); + } + if(ObjectUtils.isEmpty(experimentAndDeviceAppInsertBO.getExperimentId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + List<DeviceQueryDTO> selectList = basicExperimentDeviceByIdList.stream().filter(item -> item.getId().equals(experimentAndDeviceAppInsertBO.getDeviceId())).collect(Collectors.toList()); + if(selectList.size() == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(),"未查询到设备信息!"); + } + + } + List<ExperimentAndDevice> experimentAndDeviceInsertList = new ArrayList<>(); + for (ExperimentAndDeviceAppInsertBO deviceInsertBO:deviceAppInsertBOList){ + ExperimentAndDevice device = new ExperimentAndDevice(); + BeanUtils.copyProperties(deviceInsertBO,device); + device.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + device.setCreateByUserId(currentUserId); + device.setUpdateByUserId(currentUserId); + experimentAndDeviceInsertList.add(device); + } + List<ExperimentAndDevice> experimentAndDeviceList = repository.saveAll(experimentAndDeviceInsertList); + if(!CollectionUtils.isEmpty(experimentAndDeviceList)){ + flag = true; + } + return flag; + } + + @Override + public void deleteByExperimentId(Long experimentId,Long currentUserId) { + if(ObjectUtils.isEmpty(experimentId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + repository.deleteByExperimentId(experimentId); + + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndEmergencyServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndEmergencyServiceImpl.java new file mode 100644 index 0000000..d315f1a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndEmergencyServiceImpl.java @@ -0,0 +1,59 @@ +package com.gkhy.labRiskManage.domain.experiment.service.impl; + +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAndEmergencyAppInsertBO; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndEmergency; +import com.gkhy.labRiskManage.domain.experiment.repository.jpa.ExperimentAndEmergencyRepository; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndEmergencyService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; +import java.util.ArrayList; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/4/24 + * @time: 13:56 + */ +@Service +public class ExperimentAndEmergencyServiceImpl implements ExperimentAndEmergencyService { + + @Autowired + private ExperimentAndEmergencyRepository repository; + + @Override + public boolean saveBatch(Long currentUserId, List<ExperimentAndEmergencyAppInsertBO> experimentAndEmergencyAppInsertBOList) { + Boolean flag = false; + if(!CollectionUtils.isEmpty(experimentAndEmergencyAppInsertBOList)){ + List<ExperimentAndEmergency> experimentAndEmergencyList = new ArrayList<>(); + for (ExperimentAndEmergencyAppInsertBO emergencyAppInsertBO : experimentAndEmergencyAppInsertBOList){ + ExperimentAndEmergency experimentAndEmergency = new ExperimentAndEmergency(); + BeanUtils.copyProperties(emergencyAppInsertBO,experimentAndEmergency); + experimentAndEmergency.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + experimentAndEmergency.setCreateByUserId(currentUserId); + experimentAndEmergency.setUpdateByUserId(currentUserId); + experimentAndEmergencyList.add(experimentAndEmergency); + } + List<ExperimentAndEmergency> emergencies = repository.saveAll(experimentAndEmergencyList); + if(!CollectionUtils.isEmpty(emergencies)){ + flag = true; + } + } + return flag; + } + + @Override + public void deleteByExperimentId(Long experimentId) { + if(ObjectUtils.isEmpty(experimentId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + repository.deleteByExperimentId(experimentId); + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndPersonServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndPersonServiceImpl.java new file mode 100644 index 0000000..a68d7f5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndPersonServiceImpl.java @@ -0,0 +1,74 @@ +package com.gkhy.labRiskManage.domain.experiment.service.impl; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.basic.model.dto.PersonQueryDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndPerson; +import com.gkhy.labRiskManage.domain.experiment.repository.jpa.ExperimentAndPersonRepository; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndPersonService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 实验与实验人员 + */ +@Service +public class ExperimentAndPersonServiceImpl implements ExperimentAndPersonService { + @Autowired + private ExperimentAndPersonRepository repository; + @Autowired + private BasicExperimentPersonService basicExperimentPersonService; + + @Override + public boolean saveBatch(Long currentUserId, List<Long> personIds, Long experimentId) { + boolean flag = false; + if(CollectionUtils.isEmpty(personIds)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择试验人员!"); + } + if(ObjectUtils.isEmpty(experimentId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验信息主键不可为空!"); + } + List<PersonQueryDTO> basicExperimentPersonList = basicExperimentPersonService.getBasicExperimentPersonByIdList(personIds); + if(personIds.size() != basicExperimentPersonList.size()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(),"部分实验人员信息不存在!"); + } + List<ExperimentAndPerson> personInsertList = new ArrayList<>(); + for(PersonQueryDTO personQueryDTO:basicExperimentPersonList){ + ExperimentAndPerson experimentAndPerson = new ExperimentAndPerson(); + experimentAndPerson.setExperimentId(experimentId); + experimentAndPerson.setPersonId(personQueryDTO.getId()); + experimentAndPerson.setPersonAge(personQueryDTO.getPersonAge()); + experimentAndPerson.setPersonGender(personQueryDTO.getPersonGender()); + experimentAndPerson.setPersonMajor(personQueryDTO.getPersonMajor()); + experimentAndPerson.setPersonName(personQueryDTO.getPersonName()); + experimentAndPerson.setAptitude(personQueryDTO.getAptitude()); + experimentAndPerson.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + experimentAndPerson.setDepName(personQueryDTO.getDepName()); + experimentAndPerson.setTraining(personQueryDTO.getTraining()); + experimentAndPerson.setCreateByUserId(currentUserId); + experimentAndPerson.setUpdateByUserId(currentUserId); + personInsertList.add(experimentAndPerson); + } + List<ExperimentAndPerson> personList = repository.saveAll(personInsertList); + if(!CollectionUtils.isEmpty(personList)){ + flag = true; + } + return flag; + } + + @Override + public void deleteByExperimentId(Long experimentId, Long currentUserId) { + if(ObjectUtils.isEmpty(experimentId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + repository.deleteByExperimentId(experimentId); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndSiteServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndSiteServiceImpl.java new file mode 100644 index 0000000..b3a3e38 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndSiteServiceImpl.java @@ -0,0 +1,80 @@ +package com.gkhy.labRiskManage.domain.experiment.service.impl; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; + +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteQueryDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteService; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndSite; +import com.gkhy.labRiskManage.domain.experiment.repository.jpa.ExperimentAndSiteRepository; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndSiteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/3/20 + * @time: 16:01 + */ +@Service +public class ExperimentAndSiteServiceImpl implements ExperimentAndSiteService { + @Autowired + private BasicExperimentSiteService basicExperimentSiteService; + + @Autowired + private ExperimentAndSiteRepository repository; + + @Override + public boolean saveBatch(Long currentUserId, List<Long> siteIds, Long experimentId) { + boolean flag = false; + if(CollectionUtils.isEmpty(siteIds)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择试地点!"); + } + if(ObjectUtils.isEmpty(experimentId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验信息主键不可为空!"); + } + List<SiteQueryDTO> basicExperimentSiteByIdList = basicExperimentSiteService.getBasicExperimentSiteByIdList(siteIds); + for(Long siteId : siteIds){ + List<SiteQueryDTO> collect = basicExperimentSiteByIdList.stream().filter(site -> site.getId().equals(siteId)).collect(Collectors.toList()); + if(collect.size() == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(),"实验场所信息不存在!"); + } + } + + List<ExperimentAndSite> siteList = new ArrayList<>(); + for(Long siteId : siteIds){ + ExperimentAndSite experimentAndSite = new ExperimentAndSite(); + experimentAndSite.setExperimentId(experimentId); + experimentAndSite.setSiteId(siteId); + experimentAndSite.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + siteList.add(experimentAndSite); + } + List<ExperimentAndSite> experimentAndSiteList = repository.saveAll(siteList); + if(!CollectionUtils.isEmpty(experimentAndSiteList)){ + flag = true; + } + return flag; + } + + @Override + public void deleteByExperimentId(Long id) { + if(ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + repository.deleteByExperimentId(id); + } + + @Override + public List<ExperimentAndSite> getByExperimentId(Long id) { + List<ExperimentAndSite> experimentAndSiteList = repository.getByExperimentId(id); + return experimentAndSiteList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndStuffServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndStuffServiceImpl.java new file mode 100644 index 0000000..405432f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentAndStuffServiceImpl.java @@ -0,0 +1,81 @@ +package com.gkhy.labRiskManage.domain.experiment.service.impl; + +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAndStuffAppInsertBO; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.basic.model.dto.StuffQueryDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentStuffService; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndStuff; +import com.gkhy.labRiskManage.domain.experiment.repository.jpa.ExperimentAndStuffRepository; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndStuffService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + + +/** + * 实验与耗材 + */ +@Service +public class ExperimentAndStuffServiceImpl implements ExperimentAndStuffService { + @Autowired + private ExperimentAndStuffRepository repository; + @Autowired + private BasicExperimentStuffService basicExperimentStuffService; + + @Override + public boolean saveBatch(Long currentUserId, List<ExperimentAndStuffAppInsertBO> stuffAppInsertBOList) { + Boolean flag = false; + if(CollectionUtils.isEmpty(stuffAppInsertBOList)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择试验实验材料!"); + } + //获取材料 + List<Long> stuffIdList = stuffAppInsertBOList.stream().map(ExperimentAndStuffAppInsertBO::getStuffId).collect(Collectors.toList()); + List<StuffQueryDTO> basicExperimentStuffByIdList = basicExperimentStuffService.getBasicExperimentStuffByIdList(stuffIdList); + for(ExperimentAndStuffAppInsertBO experimentAndStuffAppInsertBO:stuffAppInsertBOList){ + if(ObjectUtils.isEmpty(experimentAndStuffAppInsertBO.getStuffId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"材料主键不可为空!"); + } + if(ObjectUtils.isEmpty(experimentAndStuffAppInsertBO.getStuffUseCount())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"材料数量不可为空!"); + } + if(ObjectUtils.isEmpty(experimentAndStuffAppInsertBO.getExperimentId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + List<StuffQueryDTO> selectList = basicExperimentStuffByIdList.stream().filter(item -> item.getId().equals(experimentAndStuffAppInsertBO.getStuffId())).collect(Collectors.toList()); + if(selectList.size() == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(),"未查询到实验材料!"); + } + } + List<ExperimentAndStuff> experimentAndStuffInsertList = new ArrayList<>(); + for (ExperimentAndStuffAppInsertBO stuffInsertBO:stuffAppInsertBOList){ + ExperimentAndStuff stuff = new ExperimentAndStuff(); + BeanUtils.copyProperties(stuffInsertBO,stuff); + stuff.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + stuff.setCreateByUserId(currentUserId); + stuff.setUpdateByUserId(currentUserId); + experimentAndStuffInsertList.add(stuff); + } + List<ExperimentAndStuff> experimentAndStuffList = repository.saveAll(experimentAndStuffInsertList); + if(!CollectionUtils.isEmpty(experimentAndStuffList)){ + flag = true; + } + return flag; + } + + @Override + public void deleteByExperimentId(Long id, Long currentUserId) { + if(ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + repository.deleteByExperimentId(id); + + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentHazardousWasteServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentHazardousWasteServiceImpl.java new file mode 100644 index 0000000..d01962a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentHazardousWasteServiceImpl.java @@ -0,0 +1,73 @@ +package com.gkhy.labRiskManage.domain.experiment.service.impl; + +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentHazardousWasteAppInsertBO; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentHazardousWaste; +import com.gkhy.labRiskManage.domain.experiment.enums.HazardousWasteStorageEnum; +import com.gkhy.labRiskManage.domain.experiment.enums.HazardousWasteTypeEnum; +import com.gkhy.labRiskManage.domain.experiment.repository.jpa.ExperimentHazardousWasteRepository; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentHazardousWasteService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.List; + + +/** + * 实验危废物 + */ +@Service +public class ExperimentHazardousWasteServiceImpl implements ExperimentHazardousWasteService { + @Autowired + private ExperimentHazardousWasteRepository repository; + + + @Override + public boolean saveBatch(Long currentUserId, List<ExperimentHazardousWasteAppInsertBO> hazardousWasteAppInsertBOList) { + Boolean flag = false; + if(!CollectionUtils.isEmpty(hazardousWasteAppInsertBOList)){ + for(ExperimentHazardousWasteAppInsertBO experimentHazardousWasteInsertBO:hazardousWasteAppInsertBOList){ + if(ObjectUtils.isEmpty(HazardousWasteTypeEnum.prase(experimentHazardousWasteInsertBO.getClassify()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"危废类型校验非法!"); + } + if(ObjectUtils.isEmpty(HazardousWasteStorageEnum.prase(experimentHazardousWasteInsertBO.getWasteStorage()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"危废存储方式校验非法!"); + } + if(ObjectUtils.isEmpty(experimentHazardousWasteInsertBO.getHandAmount())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写危废存预估处理数量!"); + } + if(ObjectUtils.isEmpty(experimentHazardousWasteInsertBO.getExperimentId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + } + List<ExperimentHazardousWaste> experimentHazardousWasteInsertList = new ArrayList<>(); + for (ExperimentHazardousWasteAppInsertBO wasteInsertBO:hazardousWasteAppInsertBOList){ + ExperimentHazardousWaste waste = new ExperimentHazardousWaste(); + BeanUtils.copyProperties(wasteInsertBO,waste); + waste.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + waste.setCreateByUserId(currentUserId); + waste.setUpdateByUserId(currentUserId); + experimentHazardousWasteInsertList.add(waste); + } + List<ExperimentHazardousWaste> experimentHazardousWasteList = repository.saveAll(experimentHazardousWasteInsertList); + if(!CollectionUtils.isEmpty(experimentHazardousWasteList)){ + flag = true; + } + } + return flag; + } + + @Override + public void deleteByExperimentId(Long experimentId, Long currentUserId) { + if(ObjectUtils.isEmpty(experimentId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + repository.deleteByExperimentId(experimentId); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentInfoServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentInfoServiceImpl.java new file mode 100644 index 0000000..7c85f45 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/experiment/service/impl/ExperimentInfoServiceImpl.java @@ -0,0 +1,652 @@ +package com.gkhy.labRiskManage.domain.experiment.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.gkhy.labRiskManage.application.experiment.dto.bo.ExperimentAppInsertBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.enums.UserRoleEnum; +import com.gkhy.labRiskManage.commons.enums.UserTagEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.model.PageQuery; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.entity.Role; +import com.gkhy.labRiskManage.domain.account.entity.SysUserRoleBind; +import com.gkhy.labRiskManage.domain.account.entity.User; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.experiment.converter.ExperimentInfoDomainConverter; +import com.gkhy.labRiskManage.domain.experiment.entity.*; +import com.gkhy.labRiskManage.domain.experiment.model.bo.ExperimentDevelopUpdateBO; +import com.gkhy.labRiskManage.domain.basic.model.dto.PersonQueryDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteQueryDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteService; +import com.gkhy.labRiskManage.domain.experiment.enums.*; +import com.gkhy.labRiskManage.domain.experiment.model.bo.ExperimentInfoQueryBO; +import com.gkhy.labRiskManage.domain.experiment.model.dto.*; +import com.gkhy.labRiskManage.domain.experiment.repository.jpa.ExperimentInfoRepository; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentInfoService; +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportRiskAssessInfo; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlan; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.UpdateExperimentInfoBO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.ReportRiskAssessInfoRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportRiskAssessInfoService; +import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; +import jodd.util.StringUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.*; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + + +/** + * 实验信息 + */ +@Service +public class ExperimentInfoServiceImpl implements ExperimentInfoService { + @Autowired + private ExperimentInfoRepository repository; + + @Autowired + private BasicExperimentPersonService basicExperimentPersonService; + @Autowired + private UserDomainService userDomainService; + @Autowired + private ExperimentInfoDomainConverter converter; + + @Autowired + private ReportRiskAssessInfoRepository reportRiskAssessInfoRepository; + + @Override + public ExperimentInfoDTO save(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO) { + UserInfoDomainDTO operator = userDomainService.getUserInfoById(currentUserId); + //验证权限 + List<SysUserRoleBindDomainDTO> roles = operator.getRoles(); + boolean flag = false; + if(roles != null && roles.size() > 0){ + for (SysUserRoleBindDomainDTO role : roles){ + if (role.getRoleName().equals(UserRoleEnum.USER_ROLE_1.getDesc())) { + flag = true; + break; + } + } + } + if (!flag){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"该账号无权限录入实验信息!"); + } + + //验证 + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验名称!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentType())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"请选择实验类型!"); + } + if(ObjectUtils.isEmpty(ExperimentTypeEnum.prase(experimentAppInsertBO.getExperimentType()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"实验类型非法!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getLiabilityUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择实验负责人!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getLiabilityUserPhone())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验负责人手机号!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getSafeLiabilityUser())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写安全负责人!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getSafeLiabilityUserPhone())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写安全负责人手机号!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getDep())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请输入部门!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentStep())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验步骤!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentMethod())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验操作方法!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getProcess())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写工艺过程!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getKeyProcess())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写关键流程!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getTimeout())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择是否存在过夜、老化实验!"); + } + if(ObjectUtils.isEmpty(TimeoutEnum.prase(experimentAppInsertBO.getTimeout()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"是否存在过夜、老化实验数据校验非法!"); + } + + if(experimentAppInsertBO.getTimeout().equals(TimeoutEnum.EXISTENT.getValue()) && ObjectUtils.isEmpty(experimentAppInsertBO.getTimeoutManager())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写过夜、老化实验保障管理措施!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getClosed())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择是否在密闭条件下!"); + } + if(ObjectUtils.isEmpty(CloseConditionEnum.prase(experimentAppInsertBO.getClosed()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"是否在密闭条件下数据校验非法!"); + } + if(experimentAppInsertBO.getClosed().equals(CloseConditionEnum.CLOSE_YES.getValue()) && ObjectUtils.isEmpty(experimentAppInsertBO.getUnclosedManager())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写密闭实验保障管理措施!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExplosionProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getFireProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防火措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getPoisonProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + + if(ObjectUtils.isEmpty(experimentAppInsertBO.getSafeManagerMethod())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写安全管理制度!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExplosionProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExplosionProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExplosionProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(PertitionConditionEnum.prase(experimentAppInsertBO.getPartitionCondition()))){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"是否需要分区隔断参数非法!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getCreateExperimentTime())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请选择实验立项时间!"); + } + ExperimentInfo experimentInfo = new ExperimentInfo(); + BeanUtils.copyProperties(experimentAppInsertBO, experimentInfo); + experimentInfo.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + experimentInfo.setLiabilityUser(operator.getName()); + experimentInfo.setLiabilityUserId(currentUserId); + experimentInfo.setStage(ExperimentStageEnum.NOT_EVALUATION.getValue()); + experimentInfo.setStatus(ExperimentStatusEnum.NOT_APPLY.getValue()); + experimentInfo.setExperimentTag(ExperimentTagEnum.NEW_CREATE.getValue()); + experimentInfo.setRectifyStatus(ExperimentRectifyStatusEnum.NOT_RECTIFY.getValue()); + experimentInfo.setExperimentCode(generateTestNumber()); + experimentInfo.setCreateByUserId(currentUserId); + experimentInfo.setInformant(operator == null?"":operator.getName()); + experimentInfo.setUpdateByUserId(currentUserId); + experimentInfo.setApprovalStatus(ExperimentApprovalStatusEnum.NOT_APPROVAL.getValue()); + ExperimentInfo experiment = repository.save(experimentInfo); + + return converter.getExperimentInfoDTO(experiment); + } + @Override + public ExperimentInfoDTO developSave(Long currentUserId, ExperimentAppInsertBO experimentAppInsertBO) { + UserInfoDomainDTO operator = userDomainService.getUserInfoById(currentUserId); + //验证权限 + List<SysUserRoleBindDomainDTO> roles = operator.getRoles(); + boolean flag = false; + if(roles != null && roles.size() > 0){ + for (SysUserRoleBindDomainDTO role : roles){ + if (role.getRoleName().equals(UserRoleEnum.USER_ROLE_1.getDesc())) { + flag = true; + break; + } + } + } + if (!flag){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"该账号无权限录入实验信息!"); + } + //验证 + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验名称!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentType())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"请选择实验类型!"); + } + if(ObjectUtils.isEmpty(ExperimentTypeEnum.prase(experimentAppInsertBO.getExperimentType()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"实验类型非法!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getLiabilityUserPhone())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验负责人手机号!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getSafeLiabilityUser())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写安全负责人!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getSafeLiabilityUserPhone())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写安全负责人手机号!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getDep())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请输入部门!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentStep())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验步骤!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExperimentMethod())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验操作方法!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getProcess())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写工艺过程!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getKeyProcess())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请填写关键流程!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getTimeout())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择是否存在过夜、老化实验!"); + } + if(ObjectUtils.isEmpty(TimeoutEnum.prase(experimentAppInsertBO.getTimeout()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"是否存在过夜、老化实验数据校验非法!"); + } + if(experimentAppInsertBO.getTimeout().equals(TimeoutEnum.EXISTENT.getValue()) && ObjectUtils.isEmpty(experimentAppInsertBO.getTimeoutManager())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写过夜、老化实验保障管理措施!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getClosed())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"请选择是否在密闭条件下!"); + } + if(ObjectUtils.isEmpty(CloseConditionEnum.prase(experimentAppInsertBO.getClosed()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"是否在密闭条件下数据校验非法!"); + } + if(experimentAppInsertBO.getClosed().equals(CloseConditionEnum.CLOSE_YES.getValue()) && ObjectUtils.isEmpty(experimentAppInsertBO.getUnclosedManager())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写密闭实验保障管理措施!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExplosionProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getFireProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防火措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getPoisonProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + + if(ObjectUtils.isEmpty(experimentAppInsertBO.getSafeManagerMethod())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写安全管理制度!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExplosionProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExplosionProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getExplosionProof())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请填写实验场所防爆措施条件和设施情况!"); + } + if(ObjectUtils.isEmpty(PertitionConditionEnum.prase(experimentAppInsertBO.getPartitionCondition()))){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_ILLEGAL.getCode(),"是否需要分区隔断参数非法!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getCreateExperimentTime())){ + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"请选择实验立项时间!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getSisStatus())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择是否是安全信息系统!"); + } + if(ObjectUtils.isEmpty(SafeInformationSystemEnum.prase(experimentAppInsertBO.getSisStatus()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(), "安全信息系统数据校验错误!"); + } + if(SafeInformationSystemEnum.YES.getValue().equals(experimentAppInsertBO.getSisStatus()) && ObjectUtils.isEmpty(experimentAppInsertBO.getSafeInformationSystem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请填写安全信息系统名称!"); + } + if(ObjectUtils.isEmpty(experimentAppInsertBO.getStartTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请填写请实验开展时间!"); + } + ExperimentInfo experimentInfo = new ExperimentInfo(); + BeanUtils.copyProperties(experimentAppInsertBO, experimentInfo); + experimentInfo.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + experimentInfo.setLiabilityUserId(currentUserId); + experimentInfo.setLiabilityUser(operator.getName()); + experimentInfo.setStage(ExperimentStageEnum.NOT_EVALUATION.getValue()); + experimentInfo.setStatus(ExperimentStatusEnum.NOT_APPLY.getValue()); + experimentInfo.setExperimentTag(ExperimentTagEnum.AREADLY_DEVELOP.getValue()); + experimentInfo.setRectifyStatus(ExperimentRectifyStatusEnum.NOT_RECTIFY.getValue()); + experimentInfo.setExperimentCode(generateTestNumber()); + experimentInfo.setCreateByUserId(currentUserId); + experimentInfo.setInformant(operator == null?"":operator.getName()); + experimentInfo.setUpdateByUserId(currentUserId); + experimentInfo.setApprovalStatus(ExperimentApprovalStatusEnum.NOT_APPROVAL.getValue()); + ExperimentInfo experiment = repository.save(experimentInfo); + + return converter.getExperimentInfoDTO(experiment); + } + + @Override + public boolean deleteById(Long id,Long currentUserId) { + boolean flag = false; + if(ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + //获取该条实现信息 + ExperimentInfo experimentInfo = repository.getExperimentInfoById(id); + if(ObjectUtils.isEmpty(experimentInfo)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), " 该实验信息不存在,或已被删除"); + } + if(experimentInfo.getStatus().equals(ExperimentStatusEnum.YES_APPLY.getValue())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(),"该条实验信息已申请评估,不可删除!"); + } + LocalDateTime date = LocalDateTime.now(); + //设置数据为删除 + experimentInfo.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + experimentInfo.setUpdateByUserId(currentUserId); // todo 没有用户信息 + experimentInfo.setUpdateTime(date); + ExperimentInfo deleteExperiment = repository.save(experimentInfo); + if(!ObjectUtils.isEmpty(deleteExperiment)){ + flag = true; + } + return flag; + } + @Override + public ExperimentInfoDTO getExperimentById(Long id) { + if(ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验主键不可为空!"); + } + //获取该条实现信息 + ExperimentInfo experimentInfo = repository.getExperimentInfoById(id); + if(ObjectUtils.isEmpty(experimentInfo)){ //todo 暂时抛出100 + throw new BusinessException(this.getClass(), ResultCode.OK.getCode(),"实验信息不存在或已被删除"); + } + return converter.getExperimentInfoDTO(experimentInfo); + } + @Override + public ExperimentInfoDTO getExperimentByName(String experimentName) { + if(StringUtil.isBlank(experimentName)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"实验名称不可为空!"); + } + //获取该条实现信息 + ExperimentInfo experimentInfo = repository.getExperimentInfoByName(experimentName); + if(ObjectUtils.isEmpty(experimentInfo)){ //todo 暂时抛出100 + throw new BusinessException(this.getClass(), ResultCode.OK.getCode(),"实验信息不存在或已被删除"); + } + return converter.getExperimentInfoDTO(experimentInfo); + } + + @Override + public List<ExperimentInfoDTO> getExperimentInfoByIds(List<Long> idList) { + if (CollectionUtils.isEmpty(idList)) { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "该实验信息主键不可为空!"); + } + List<ExperimentInfo> experimentInfoByIdList = repository.getExperimentInfoByIds(idList); + + return converter.getExperimentInfoDTOSimpleList(experimentInfoByIdList); + } + + @Override + public boolean updateDevelop(Long currentUserId, List<ExperimentDevelopUpdateBO> developUpdateBOList) { + boolean flag = false; + if (CollectionUtils.isEmpty(developUpdateBOList)) { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择需要开展实验信息!"); + } + List<Long> idList = developUpdateBOList.stream().map(ExperimentDevelopUpdateBO::getId).collect(Collectors.toList()); + //获取实验信息 + List<ExperimentInfo> experimentInfoByIdList = repository.getExperimentInfoByIds(idList); + List<ExperimentInfo> updateExoerimentInfoList = new ArrayList<>(); + for(ExperimentDevelopUpdateBO experimentDevelopUpdateBO:developUpdateBOList){ + if(ObjectUtils.isEmpty(experimentDevelopUpdateBO.getSisStatus())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择是否是安全信息系统!"); + } + if(ObjectUtils.isEmpty(SafeInformationSystemEnum.prase(experimentDevelopUpdateBO.getSisStatus()))){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_ILLEGAL.getCode(), "安全信息系统数据校验错误!"); + } + if(SafeInformationSystemEnum.YES.getValue().equals(experimentDevelopUpdateBO.getSisStatus()) && ObjectUtils.isEmpty(experimentDevelopUpdateBO.getSafeInformationSystem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请填写安全信息系统名称!"); + } + if(ObjectUtils.isEmpty(experimentDevelopUpdateBO.getStartTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请填写请实验开展时间!"); + } + List<ExperimentInfo> selectList = experimentInfoByIdList.stream().filter(experimentInfo -> experimentInfo.getId().equals(experimentDevelopUpdateBO.getId())).collect(Collectors.toList()); + if(selectList.size() == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "实验信息不存在或已删除!"); + } + ExperimentInfo experimentInfo = selectList.get(0); + if(experimentInfo.getExperimentTag().equals(ExperimentTagEnum.AREADLY_DEVELOP.getValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验已开展不可再次开展!"); + } + experimentInfo.setExperimentTag(ExperimentTagEnum.AREADLY_DEVELOP.getValue()); + experimentInfo.setSisStatus(experimentDevelopUpdateBO.getSisStatus()); + experimentInfo.setSafeInformationSystem(experimentDevelopUpdateBO.getSafeInformationSystem()); + experimentInfo.setUpdateTime(LocalDateTime.now()); + experimentInfo.setUpdateByUserId(currentUserId); + experimentInfo.setStartTime(experimentDevelopUpdateBO.getStartTime()); + updateExoerimentInfoList.add(experimentInfo); + } + List<ExperimentInfo> experimentInfos = repository.saveAll(updateExoerimentInfoList); + if (!CollectionUtils.isEmpty(experimentInfos)) { + flag = true; + } + return flag; + } + + @Override + public boolean applyEvaluation(Long currentUserId, List<Long> ids) { + boolean flag = false; + if(CollectionUtils.isEmpty(ids)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验信息主键不可为空!"); + } + //获取实验信息 + List<ExperimentInfo> experimentInfoByIdList = repository.getExperimentInfoByIds(ids); + List<ExperimentInfo> updateExperimentInfoList = new ArrayList<>(); + for(Long id:ids){ + List<ExperimentInfo> selectList = experimentInfoByIdList.stream().filter(experimentInfo -> experimentInfo.getId().equals(id)).collect(Collectors.toList()); + if(selectList.size() == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "实验信息不存在或已删除!"); + } + ExperimentInfo experimentInfo = selectList.get(0); + if(experimentInfo.getStatus().equals(ExperimentStatusEnum.YES_APPLY.getValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验已申请评估不可再次申请!"); + } + experimentInfo.setStatus(ExperimentStatusEnum.YES_APPLY.getValue()); + experimentInfo.setAssessApplyTime(LocalDateTime.now()); + experimentInfo.setUpdateTime(LocalDateTime.now()); + experimentInfo.setUpdateByUserId(currentUserId); + updateExperimentInfoList.add(experimentInfo); + } + List<ExperimentInfo> experimentInfos = repository.saveAll(updateExperimentInfoList); + if(!CollectionUtils.isEmpty(experimentInfos)){ + flag = true; + } + return flag; + } + + /** + * 修改申请评估状态 + * @param currentUserId + * @param ids + * @return + */ + @Override + public boolean revokeApplyEvaluation(Long currentUserId, List<Long> ids) { + boolean flag = false; + if(CollectionUtils.isEmpty(ids)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验信息主键不可为空!"); + } + //获取实验信息 + List<ExperimentInfo> experimentInfoByIdList = repository.getExperimentInfoByIds(ids); + List<ExperimentInfo> updateExperimentInfoList = new ArrayList<>(); + for(Long id:ids){ + List<ExperimentInfo> selectList = experimentInfoByIdList.stream().filter(experimentInfo -> experimentInfo.getId().equals(id)).collect(Collectors.toList()); + if(selectList.size() == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "实验信息不存在或已删除!"); + } + ExperimentInfo experimentInfo = selectList.get(0); + if(experimentInfo.getStatus().equals(ExperimentStatusEnum.NOT_APPLY.getValue()) || !experimentInfo.getStage().equals(ExperimentStageEnum.NOT_EVALUATION.getValue())){ + //未申请评估或者评估中评估完成 + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验未申请评估,评估中,评估完成,不可执行撤销操作!"); + } + experimentInfo.setStatus(ExperimentStatusEnum.NOT_APPLY.getValue()); + experimentInfo.setUpdateTime(LocalDateTime.now()); + experimentInfo.setUpdateByUserId(currentUserId); + updateExperimentInfoList.add(experimentInfo); + } + List<ExperimentInfo> experimentInfos = repository.saveAll(updateExperimentInfoList); + if(!CollectionUtils.isEmpty(experimentInfos)){ + flag = true; + } + return flag; + } + + @Override + public List<ExperimentInfoDTO> getExperimentInfoList(Long currentUserId) { + return converter.getExperimentInfoDTOSimpleList(repository.getExperimentInfoList(currentUserId)); + } + + @Override + public boolean updateRectify(Long experimentId) { + if(ObjectUtils.isEmpty(experimentId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验信息主键不可为空!"); + } + ExperimentInfo experimentInfo = repository.getExperimentInfoById(experimentId); + if (ObjectUtils.isEmpty(experimentInfo)) { + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "实验信息不存在或已删除!"); + } + if (!experimentInfo.getRectifyStatus().equals(ExperimentRectifyStatusEnum.WAIT_RECTIFY.getValue())) { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "非待整改实验,不可申请整改!"); + } + experimentInfo.setRectifyStatus(ExperimentRectifyStatusEnum.YES_RECTIFY.getValue()); + ExperimentInfo save = repository.save(experimentInfo); + if(ObjectUtils.isEmpty(save)){ + return false; + } + return true; + + } + + @Override + public SearchResult<List<ExperimentInfoDTO>> listByPage(PageQuery<ExperimentInfoQueryBO> pageQuery,Long currentUserId) { + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(pageQuery.getPageIndex()); + searchResult.setPageSize(pageQuery.getPageSize()); + ExperimentInfoQueryBO queryBO = pageQuery.getSearchParams(); + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + Specification<ExperimentInfo> specification = new Specification<ExperimentInfo>() { + @Override + public Predicate toPredicate(Root<ExperimentInfo> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode())); + if(!ObjectUtils.isEmpty(ExperimentStatusEnum.prase(queryBO.getStatus()))){ + predicateList.add(criteriaBuilder.equal(root.get("status"),queryBO.getStatus())); + } + if(!ObjectUtils.isEmpty(ExperimentTagEnum.prase(queryBO.getExperimentTag()))){ + predicateList.add(criteriaBuilder.equal(root.get("experimentTag"),queryBO.getExperimentTag())); + } + if (!ObjectUtils.isEmpty(ExperimentTypeEnum.prase(queryBO.getExperimentType()))){ + predicateList.add(criteriaBuilder.equal(root.get("experimentType"), queryBO.getExperimentType())); + } + if (StrUtil.isNotBlank(queryBO.getExperimentName())){ + predicateList.add(criteriaBuilder.like(root.get("experimentName"), '%'+ queryBO.getExperimentName()+'%')); + } + if (!ObjectUtils.isEmpty(queryBO.getStartTime())){ + predicateList.add(criteriaBuilder.greaterThanOrEqualTo(root.get("createTime"), queryBO.getStartTime())); + } + if (!ObjectUtils.isEmpty(queryBO.getEndTime())){ + predicateList.add(criteriaBuilder.lessThanOrEqualTo(root.get("createTime"), queryBO.getEndTime())); + } + if(roleTag == UserTagEnum.USER_TAG_0.getCode()){ // todo + Join<ExperimentInfo, RiskAssessPlan> experimentJion = root.join("riskAssessPlans", JoinType.LEFT); + predicateList.add(criteriaBuilder.or( + criteriaBuilder.equal(root.get("liabilityUserId"), currentUserId), + criteriaBuilder.equal(experimentJion.get("identificationUserId"), currentUserId), + criteriaBuilder.equal(experimentJion.get("evaluateUserId"), currentUserId)) + ); + query.groupBy(root.get("id")); + } + + //返回组装的条件 + return criteriaBuilder.and(predicateList.toArray(predicateList.toArray(new Predicate[0]))); + } + }; + Pageable pageable = PageRequest.of(pageQuery.getPageIndex()-1, pageQuery.getPageSize(), Sort.Direction.DESC, "createTime"); + Page<ExperimentInfo> pageResult = repository.findAll(specification, pageable); + + List<ExperimentInfoDTO> experimentInfoDTODetailList = converter.getExperimentInfoDTODetailList(pageResult.getContent()); + for (ExperimentInfoDTO experimentInfoDTO : experimentInfoDTODetailList) { + ReportRiskAssessInfo report = reportRiskAssessInfoRepository.getByExperimentId(experimentInfoDTO.getId()); + if (!ObjectUtils.isEmpty(report) && report.getCreateTime().isBefore(report.getUpdateTime())){ + experimentInfoDTO.setAssessPerson(report.getAssessPerson()); + } + } + + searchResult.setTotal(pageResult.getTotalElements()); + searchResult.setPages(pageResult.getTotalPages()); + searchResult.setData(experimentInfoDTODetailList); + return searchResult; + } + + + /** + * 生成实验编号 + */ + private String generateTestNumber(){ + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd" ); + SimpleDateFormat sdf2 =new SimpleDateFormat("yyyyMMdd" ); + String time = sdf.format(new Date()); + //获取当天新立项数量 + Integer count = repository.countByCreateTime(time); + + String serialCode = null; + if(count >= 1000){ + serialCode = "" + (count+1); + }else if(count >=0){ + String countStr = String.valueOf(count+1); + serialCode = "000".substring(0,(3- countStr.length()))+countStr; + } + return sdf2.format(new Date()) + serialCode; + } + + /** + * 实验信息 - 修改实验状态 + */ + @Override + public ExperimentInfoDTO updateExperimentStage(Long id, Byte stage) { + +// ExperimentInfo experimentInfo = repository.updateExperimentStage(id, StatusEnum.EXPERIMENT_STATUS_FINISH.getCode()); + ExperimentInfo experimentInfoById = repository.getExperimentInfoById(id); + + experimentInfoById.setStage(stage); + + ExperimentInfo experimentInfo = repository.save(experimentInfoById); + + if (ObjectUtils.isEmpty(experimentInfo)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验评估状态修改失败"); + } + + return BeanCopyUtils.copyBean(experimentInfo, ExperimentInfoDTO.class); + } + + @Override + public List<ExperimentInfoDTO> getExperimentByUser(Long currentUserId) { + + List<ExperimentInfo> experimentList = repository.getExperimentByUser(currentUserId); + if (ObjectUtils.isEmpty(experimentList)){ + List<ExperimentInfoDTO> experiment = new ArrayList<>(); + return experiment; + } + return BeanCopyUtils.copyBeanList(experimentList, ExperimentInfoDTO.class); + } + + @Override + public ExperimentInfo updateExperimentStatus(UpdateExperimentInfoBO updateBO) { + + ExperimentInfo experimentInfoById = repository.getExperimentInfoById(updateBO.getExperimentId()); + if (ObjectUtils.isEmpty(experimentInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验不存在"); + } + + experimentInfoById.setApprovalStatus(updateBO.getApprovalStatus()); + if (updateBO.getRectifyStatus() == ExperimentRectifyStatusEnum.WAIT_RECTIFY.getValue()){ + experimentInfoById.setRectifyStatus(updateBO.getRectifyStatus()); + } + return repository.save(experimentInfoById); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentRiskSource.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentRiskSource.java new file mode 100644 index 0000000..19e975e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentRiskSource.java @@ -0,0 +1,160 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +@Entity +@Table(name = "report_experiment_risk_source") +public class ReportExperimentRiskSource implements Serializable { + private static final long serialVersionUID = -70957745946382015L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 排序 + */ + private Integer riskSourceIndex; + /** + * 危险源 + */ + private String riskSource; + /** + * 危险特性 + */ + private String riskCharacteristic; + /** + * 数量 + */ + private Integer number; + /** + * 说明 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getRiskSourceIndex() { + return riskSourceIndex; + } + + public void setRiskSourceIndex(Integer riskSourceIndex) { + this.riskSourceIndex = riskSourceIndex; + } + + public String getRiskSource() { + return riskSource; + } + + public void setRiskSource(String riskSource) { + this.riskSource = riskSource; + } + + public String getRiskCharacteristic() { + return riskCharacteristic; + } + + public void setRiskCharacteristic(String riskCharacteristic) { + this.riskCharacteristic = riskCharacteristic; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentRiskSourceType.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentRiskSourceType.java new file mode 100644 index 0000000..5547a26 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentRiskSourceType.java @@ -0,0 +1,124 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +@Entity +@Table(name = "report_experiment_risk_source_type") +public class ReportExperimentRiskSourceType implements Serializable { + private static final long serialVersionUID = -54067208633193458L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private String riskSourceType; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public String getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(String riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentSite.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentSite.java new file mode 100644 index 0000000..6d5969f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportExperimentSite.java @@ -0,0 +1,83 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +@Data +@Entity +@Table(name = "report_experiment_site") +public class ReportExperimentSite implements Serializable { + + private static final long serialVersionUID = -54067208633193458L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 报告ID + */ + private Long reportId; + /** + * D + */ + private Long siteId; + /** + * 场所名称 + */ + private String siteName; + /** + * 实验室所在楼 + */ + private String floor; + /** + * 实验室所在房间 + */ + private String room; + /** + * 实验室所在房间 + */ + private String description; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 场所责任人id + */ + private Long siteLiabilityPersonId; + /** + * 场所责任人 + */ + private String siteLiabilityPerson; + /** + * 场所安全员id + */ + private Long safeLiabilityPersonId; + /** + * 场所安全员 + */ + private String safeLiabilityPerson; + /** + * 有无消防设施:1-有;2-无 + */ + private Byte fireFacilities; + /** + * 有无隔断:1-有;2-无 + */ + private Byte partitionStatus; + /** + * 场所性质id + */ + private Long siteTypeId; + /** + * 场所性质 + */ + private String siteType; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportRiskAssessInfo.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportRiskAssessInfo.java new file mode 100644 index 0000000..8b4ee39 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportRiskAssessInfo.java @@ -0,0 +1,136 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 风险评估报告 + */ +@Data +@Entity +@Table(name = "report_risk_assess_info") +public class ReportRiskAssessInfo implements Serializable { + private static final long serialVersionUID = -64918832117250230L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + * (文字描述可能不再修改) + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long personUserId; + /** + * 实验负责人(文字描述可能不再修改) + */ + private String personUser; + /** + * 实验负责人手机 + */ + private Long personUserPhone; + /** + * 安全负责人id + */ + private Long safePersonUserId; + /** + * 安全负责人((文字描述可能不再修改) + */ + private String safePersonUser; + /** + * 安全负责人手机 + */ + private Long safePersonUserPhone; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + /** + * 评估人id + */ + private Long assessPersonId; + /** + * 评估人 + */ + private String assessPerson; + /** + * 评估时间 + */ + private LocalDateTime assessTime; + /** + * 实验概况 + */ + private String experimentDesc; + /** + * 实验涉及到的风险源 + */ + private String experimentRiskSource; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approvePlanStatus; + /** + * 实验室id + */ + private Long siteId; + /** + * 实验室 + */ + private String site; + /** + * 评级依据 + */ + private String description; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportRiskAssessPerson.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportRiskAssessPerson.java new file mode 100644 index 0000000..1c543f1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/ReportRiskAssessPerson.java @@ -0,0 +1,184 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 风险评估报告-评估专家 + */ +@Entity +@Table(name = "report_risk_assess_person") +public class ReportRiskAssessPerson implements Serializable { + private static final long serialVersionUID = -34775201914468215L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 审批阶段排序 + */ + private Integer approveIndex; + /** + * 审批阶段名称 + */ + private String approveStage; + /** + * 审批意见说明 + */ + private String approveDesc; + /** + * 审批时间 + */ + private LocalDateTime approveTime; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approveStatus; + /** + * 审批人(一旦结束,此信息不再修改) + */ + private String approvePerson; + /** + * 审批人id + */ + private Long approvePersonId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } + + public Integer getApproveIndex() { + return approveIndex; + } + + public void setApproveIndex(Integer approveIndex) { + this.approveIndex = approveIndex; + } + + public String getApproveStage() { + return approveStage; + } + + public void setApproveStage(String approveStage) { + this.approveStage = approveStage; + } + + public String getApproveDesc() { + return approveDesc; + } + + public void setApproveDesc(String approveDesc) { + this.approveDesc = approveDesc; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getApproveTime() { + return approveTime; + } + + public void setApproveTime(LocalDateTime approveTime) { + this.approveTime = approveTime; + } + + public Byte getApproveStatus() { + return approveStatus; + } + + public void setApproveStatus(Byte approveStatus) { + this.approveStatus = approveStatus; + } + + public String getApprovePerson() { + return approvePerson; + } + + public void setApprovePerson(String approvePerson) { + this.approvePerson = approvePerson; + } + + public Long getApprovePersonId() { + return approvePersonId; + } + + public void setApprovePersonId(Long approvePersonId) { + this.approvePersonId = approvePersonId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlan.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlan.java new file mode 100644 index 0000000..25b801b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlan.java @@ -0,0 +1,165 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import com.gkhy.labRiskManage.domain.basic.entity.BasicTip; +import lombok.Data; + +import javax.persistence.*; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; +import java.io.Serializable; + +/** + * + */ +@Data +@Entity +@Table(name = "risk_assess_plan") +public class RiskAssessPlan implements Serializable { + private static final long serialVersionUID = -44756780317221858L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateLec.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateLec.java new file mode 100644 index 0000000..29e647a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateLec.java @@ -0,0 +1,166 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法LEC + */ +@Data +@Entity +@Table(name = "risk_assess_plan_evaluate_lec") +public class RiskAssessPlanEvaluateLec implements Serializable { + private static final long serialVersionUID = 170637863976453861L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + /** + * 删除状态:1-正常;2-已删除 + */ + private Byte deleteStatus; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + /** + * LEC_L的数值(评价) + */ + private BigDecimal originalLecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal originalLecC; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateLs.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateLs.java new file mode 100644 index 0000000..62b5c0e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateLs.java @@ -0,0 +1,160 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法LS + */ +@Data +@Entity +@Table(name = "risk_assess_plan_evaluate_ls") +public class RiskAssessPlanEvaluateLs implements Serializable { + private static final long serialVersionUID = 719640654269140778L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + /** + * 删除状态:1-正常;2-已删除 + */ + private Byte deleteStatus; + + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + /** + * LS_L的数值(评价) + */ + private BigDecimal originalLsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal originalLsS; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateMes.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateMes.java new file mode 100644 index 0000000..62b0aea --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateMes.java @@ -0,0 +1,167 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法MES + */ +@Data +@Entity +@Table(name = "risk_assess_plan_evaluate_mes") +public class RiskAssessPlanEvaluateMes implements Serializable { + private static final long serialVersionUID = -80826042360815264L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + /** + * 删除状态:1-正常;2-已删除 + */ + private Byte deleteStatus; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + /** + * MES_M的数值(评价) + */ + private BigDecimal originalMesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal originalMesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal originalMesS; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateRs.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateRs.java new file mode 100644 index 0000000..5ffb6f2 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanEvaluateRs.java @@ -0,0 +1,158 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法RS + */ +@Data +@Entity +@Table(name = "risk_assess_plan_evaluate_rs") +public class RiskAssessPlanEvaluateRs implements Serializable { + private static final long serialVersionUID = 642761023880479465L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + /** + * 删除状态:1-正常;2-已删除 + */ + private Byte deleteStatus; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + /** + * RS_R的数值(评价) + */ + private BigDecimal originalRsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal originalRsS; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationAnalogy.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationAnalogy.java new file mode 100644 index 0000000..93ed876 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationAnalogy.java @@ -0,0 +1,206 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 辨识方法-类比法(Analogy) + */ +@Entity +@Table(name = "risk_assess_plan_identification_analogy") +public class RiskAssessPlanIdentificationAnalogy implements Serializable { + private static final long serialVersionUID = 647218208630896833L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + /** + * 删除状态:1-正常;2-已删除 + */ + private Byte deleteStatus; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getAnalogyCheckItem() { + return analogyCheckItem; + } + + public void setAnalogyCheckItem(String analogyCheckItem) { + this.analogyCheckItem = analogyCheckItem; + } + + public String getAnalogyRiskFactor() { + return analogyRiskFactor; + } + + public void setAnalogyRiskFactor(String analogyRiskFactor) { + this.analogyRiskFactor = analogyRiskFactor; + } + + public String getAnalogyResult() { + return analogyResult; + } + + public void setAnalogyResult(String analogyResult) { + this.analogyResult = analogyResult; + } + + public String getAnalogyReference() { + return analogyReference; + } + + public void setAnalogyReference(String analogyReference) { + this.analogyReference = analogyReference; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationHazop.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationHazop.java new file mode 100644 index 0000000..f4188ec --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationHazop.java @@ -0,0 +1,241 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 辨识方法-Hazop + */ +@Entity +@Table(name = "risk_assess_plan_identification_hazop") +public class RiskAssessPlanIdentificationHazop implements Serializable { + private static final long serialVersionUID = -10750978358198693L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + /** + * 删除状态:1-正常;2-已删除 + */ + private Byte deleteStatus; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getHazopNode() { + return hazopNode; + } + + public void setHazopNode(String hazopNode) { + this.hazopNode = hazopNode; + } + + public String getHazopParam() { + return hazopParam; + } + + public void setHazopParam(String hazopParam) { + this.hazopParam = hazopParam; + } + + public String getHazopParamDesc() { + return hazopParamDesc; + } + + public void setHazopParamDesc(String hazopParamDesc) { + this.hazopParamDesc = hazopParamDesc; + } + + public String getHazopGuide() { + return hazopGuide; + } + + public void setHazopGuide(String hazopGuide) { + this.hazopGuide = hazopGuide; + } + + public String getHazopDeviation() { + return hazopDeviation; + } + + public void setHazopDeviation(String hazopDeviation) { + this.hazopDeviation = hazopDeviation; + } + + public String getHazopPossibleCauses() { + return hazopPossibleCauses; + } + + public void setHazopPossibleCauses(String hazopPossibleCauses) { + this.hazopPossibleCauses = hazopPossibleCauses; + } + + public String getHazopResult() { + return hazopResult; + } + + public void setHazopResult(String hazopResult) { + this.hazopResult = hazopResult; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationJha.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationJha.java new file mode 100644 index 0000000..c081a31 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationJha.java @@ -0,0 +1,193 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 辨识方法-Jha + */ +@Entity +@Table(name = "risk_assess_plan_identification_jha") +public class RiskAssessPlanIdentificationJha implements Serializable { + private static final long serialVersionUID = -59936371944640050L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + /** + * 删除状态:1-正常;2-已删除 + */ + private Byte deleteStatus; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getJhaCheckItem() { + return jhaCheckItem; + } + + public void setJhaCheckItem(String jhaCheckItem) { + this.jhaCheckItem = jhaCheckItem; + } + + public String getJhaRiskFactor() { + return jhaRiskFactor; + } + + public void setJhaRiskFactor(String jhaRiskFactor) { + this.jhaRiskFactor = jhaRiskFactor; + } + + public String getJhaResult() { + return jhaResult; + } + + public void setJhaResult(String jhaResult) { + this.jhaResult = jhaResult; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationPha.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationPha.java new file mode 100644 index 0000000..6fd4237 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationPha.java @@ -0,0 +1,193 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 辨识方法-Pha + */ +@Entity +@Table(name = "risk_assess_plan_identification_pha") +public class RiskAssessPlanIdentificationPha implements Serializable { + private static final long serialVersionUID = 822532931637148116L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + /** + * 删除状态:1-正常;2-已删除 + */ + private Byte deleteStatus; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getPhaCheckItem() { + return phaCheckItem; + } + + public void setPhaCheckItem(String phaCheckItem) { + this.phaCheckItem = phaCheckItem; + } + + public String getPhaRiskFactor() { + return phaRiskFactor; + } + + public void setPhaRiskFactor(String phaRiskFactor) { + this.phaRiskFactor = phaRiskFactor; + } + + public String getPhaResult() { + return phaResult; + } + + public void setPhaResult(String phaResult) { + this.phaResult = phaResult; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationScl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationScl.java new file mode 100644 index 0000000..8cba8ce --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskAssessPlanIdentificationScl.java @@ -0,0 +1,206 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 辨识方法-Scl + */ +@Entity +@Table(name = "risk_assess_plan_identification_scl") +public class RiskAssessPlanIdentificationScl implements Serializable { + private static final long serialVersionUID = 687817593181642275L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getSclCheckItem() { + return sclCheckItem; + } + + public void setSclCheckItem(String sclCheckItem) { + this.sclCheckItem = sclCheckItem; + } + + public String getSclCheckStandard() { + return sclCheckStandard; + } + + public void setSclCheckStandard(String sclCheckStandard) { + this.sclCheckStandard = sclCheckStandard; + } + + public String getSclCheckUnstandard() { + return sclCheckUnstandard; + } + + public void setSclCheckUnstandard(String sclCheckUnstandard) { + this.sclCheckUnstandard = sclCheckUnstandard; + } + + public String getSclCheckResult() { + return sclCheckResult; + } + + public void setSclCheckResult(String sclCheckResult) { + this.sclCheckResult = sclCheckResult; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskUnit.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskUnit.java new file mode 100644 index 0000000..eaabb6f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/entity/RiskUnit.java @@ -0,0 +1,93 @@ +package com.gkhy.labRiskManage.domain.riskReport.entity; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 实验风险单元 + */ +@Data +@Entity +@Table(name = "risk_unit") +public class RiskUnit implements Serializable { + private static final long serialVersionUID = 956090285789319176L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 基础风险单元id + */ + private Long basicRiskUnitId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 删除状态:0-正常;1-已删除 + */ + private Byte deleteStatus; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessEvaluateQueryBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessEvaluateQueryBO.java new file mode 100644 index 0000000..dc44d54 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessEvaluateQueryBO.java @@ -0,0 +1,33 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + + +/** + * 评估项目查询BO + * */ +public class AssessEvaluateQueryBO { + + /** + * 评估计划id + */ + private Long assessPlanId; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public Byte getEvaluateMethod() { + return evaluateMethod; + } + + public void setEvaluateMethod(Byte evaluateMethod) { + this.evaluateMethod = evaluateMethod; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessIdentificationQueryBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessIdentificationQueryBO.java new file mode 100644 index 0000000..86d30d1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessIdentificationQueryBO.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + + +/** + * 评估项目查询BO + * */ +public class AssessIdentificationQueryBO { + + /** + * 评估计划id + */ + private Long assessPlanId; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessLSInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessLSInsertBO.java new file mode 100644 index 0000000..f039e50 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessLSInsertBO.java @@ -0,0 +1,135 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 评价方法LS + */ +@Data +public class AssessLSInsertBO{ + + private Long id; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价专家意见 + */ + private String evaluateDesc; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + + /** + * LS_L的数值(评价) + */ + private BigDecimal originalRiskValue; + /** + * LS_L的数值(评价) + */ + private BigDecimal originalLsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal originalLsS; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessLecInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessLecInsertBO.java new file mode 100644 index 0000000..1b77d4d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessLecInsertBO.java @@ -0,0 +1,146 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法LEC + */ +@Data +public class AssessLecInsertBO { + + private Long id; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价专家意见 + */ + private String evaluateDesc; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + /** + * = + */ + private BigDecimal originalRiskValue; + /** + * LEC_L的数值(评价) + */ + private BigDecimal originalLecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal originalLecC; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessMesInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessMesInsertBO.java new file mode 100644 index 0000000..1e0c845 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessMesInsertBO.java @@ -0,0 +1,142 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 评价方法MES + */ +@Data +public class AssessMesInsertBO { + + private Long id; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价专家意见 + */ + private String evaluateDesc; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + /** + * = + */ + private BigDecimal originalRiskValue; + /** + * MES_M的数值(评价) + */ + private BigDecimal originalMesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal originalMesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal originalMesS; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessQueryBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessQueryBO.java new file mode 100644 index 0000000..802afcb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessQueryBO.java @@ -0,0 +1,35 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + + +import lombok.Data; + +/** + * 风险辨识与评价 + * */ +@Data +public class AssessQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 实验 + */ + private Long experimentId; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 标识 :1-查询所有,2-查询辨识提交,3-查询评价提交 + */ + private Integer tag; + /** + * + */ + private Long assessPlanId; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessRsInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessRsInsertBO.java new file mode 100644 index 0000000..8320cb2 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/AssessRsInsertBO.java @@ -0,0 +1,134 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 评价方法RS + */ +@Data +public class AssessRsInsertBO{ + + private Long id; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价专家意见 + */ + private String evaluateDesc; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + + /** + * = + */ + private BigDecimal originalRiskValue; + /** + * RS_R的数值(评价) + */ + private BigDecimal originalRsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal originalRsS; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ExecStatusSubmitBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ExecStatusSubmitBO.java new file mode 100644 index 0000000..bea98f0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ExecStatusSubmitBO.java @@ -0,0 +1,26 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +public class ExecStatusSubmitBO { + + private Long id; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getPlanExecStatus() { + return planExecStatus; + } + + public void setPlanExecStatus(Byte planExecStatus) { + this.planExecStatus = planExecStatus; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/InherentRiskUnitInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/InherentRiskUnitInsertBO.java new file mode 100644 index 0000000..f70dcc6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/InherentRiskUnitInsertBO.java @@ -0,0 +1,51 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +/** + * 实验风险单元 + */ +public class InherentRiskUnitInsertBO { + + /** + * 实验id + */ + private Long experimentId; + /** + * 基础风险单元id + */ + private Long basicRiskUnitId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportPersonInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportPersonInsertBO.java new file mode 100644 index 0000000..31beb16 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportPersonInsertBO.java @@ -0,0 +1,85 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 风险评估报告-评估专家 + */ +public class ReportPersonInsertBO{ + + /** + * 报告id + */ + private Long reportId; + /** + * 审批阶段排序 + */ + private Integer approveIndex; + /** + * 审批阶段名称 + */ + private String approveStage; + /** + * 审批意见说明 + */ + private String approveDesc; + /** + * 审批时间 + */ + private LocalDateTime approveTime; + /** + * 审批人id + */ + private Long approvePersonId; + + public LocalDateTime getApproveTime() { + return approveTime; + } + + public void setApproveTime(LocalDateTime approveTime) { + this.approveTime = approveTime; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getApproveIndex() { + return approveIndex; + } + + public void setApproveIndex(Integer approveIndex) { + this.approveIndex = approveIndex; + } + + public String getApproveStage() { + return approveStage; + } + + public void setApproveStage(String approveStage) { + this.approveStage = approveStage; + } + + public String getApproveDesc() { + return approveDesc; + } + + public void setApproveDesc(String approveDesc) { + this.approveDesc = approveDesc; + } + + public Long getApprovePersonId() { + return approvePersonId; + } + + public void setApprovePersonId(Long approvePersonId) { + this.approvePersonId = approvePersonId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportQueryBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportQueryBO.java new file mode 100644 index 0000000..e7fd718 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportQueryBO.java @@ -0,0 +1,42 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + + +import lombok.Data; + +/** + * 风险评估报告 + */ +@Data +public class ReportQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * tag:1-查询未填写的报告;2-已填写的报告;3-查询所有报告 + */ + private Byte tag; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + * (文字描述可能不再修改) + */ + private Byte experimentType; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approvePlanStatus; + /** + * 实验 + */ + private Long experimentId; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceInsertBO.java new file mode 100644 index 0000000..f7f3b30 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceInsertBO.java @@ -0,0 +1,85 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +public class ReportSourceInsertBO{ + + + /** + * 报告id + */ + private Long reportId; + /** + * 排序 + */ + private Integer riskSourceIndex; + /** + * 危险源 + */ + private String riskSource; + /** + * 危险特性 + */ + private String riskCharacteristic; + /** + * 数量 + */ + private Integer number; + /** + * 说明 + */ + private String desc; + + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getRiskSourceIndex() { + return riskSourceIndex; + } + + public void setRiskSourceIndex(Integer riskSourceIndex) { + this.riskSourceIndex = riskSourceIndex; + } + + public String getRiskSource() { + return riskSource; + } + + public void setRiskSource(String riskSource) { + this.riskSource = riskSource; + } + + public String getRiskCharacteristic() { + return riskCharacteristic; + } + + public void setRiskCharacteristic(String riskCharacteristic) { + this.riskCharacteristic = riskCharacteristic; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceTypeInsertBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceTypeInsertBO.java new file mode 100644 index 0000000..9195b4b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceTypeInsertBO.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public class ReportSourceTypeInsertBO { + + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private Long riskSourceTypeId; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Long getRiskSourceTypeId() { + return riskSourceTypeId; + } + + public void setRiskSourceTypeId(Long riskSourceTypeId) { + this.riskSourceTypeId = riskSourceTypeId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceTypeUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceTypeUpdateBO.java new file mode 100644 index 0000000..23bf23c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceTypeUpdateBO.java @@ -0,0 +1,55 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public class ReportSourceTypeUpdateBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private Long riskSourceTypeId; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Long getRiskSourceTypeId() { + return riskSourceTypeId; + } + + public void setRiskSourceTypeId(Long riskSourceTypeId) { + this.riskSourceTypeId = riskSourceTypeId; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceUpdateBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceUpdateBO.java new file mode 100644 index 0000000..9d1d4e3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/ReportSourceUpdateBO.java @@ -0,0 +1,92 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +public class ReportSourceUpdateBO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 排序 + */ + private Integer riskSourceIndex; + /** + * 危险源 + */ + private String riskSource; + /** + * 危险特性 + */ + private String riskCharacteristic; + /** + * 数量 + */ + private Integer number; + /** + * 说明 + */ + private String desc; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getRiskSourceIndex() { + return riskSourceIndex; + } + + public void setRiskSourceIndex(Integer riskSourceIndex) { + this.riskSourceIndex = riskSourceIndex; + } + + public String getRiskSource() { + return riskSource; + } + + public void setRiskSource(String riskSource) { + this.riskSource = riskSource; + } + + public String getRiskCharacteristic() { + return riskCharacteristic; + } + + public void setRiskCharacteristic(String riskCharacteristic) { + this.riskCharacteristic = riskCharacteristic; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/RiskAssessPlanIdentificationInsertReqBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/RiskAssessPlanIdentificationInsertReqBO.java new file mode 100644 index 0000000..5206146 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/RiskAssessPlanIdentificationInsertReqBO.java @@ -0,0 +1,370 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +public class RiskAssessPlanIdentificationInsertReqBO { + + private Long id; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + + + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + + + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + + + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + + + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public String getAnalogyCheckItem() { + return analogyCheckItem; + } + + public void setAnalogyCheckItem(String analogyCheckItem) { + this.analogyCheckItem = analogyCheckItem; + } + + public String getAnalogyRiskFactor() { + return analogyRiskFactor; + } + + public void setAnalogyRiskFactor(String analogyRiskFactor) { + this.analogyRiskFactor = analogyRiskFactor; + } + + public String getAnalogyResult() { + return analogyResult; + } + + public void setAnalogyResult(String analogyResult) { + this.analogyResult = analogyResult; + } + + public String getAnalogyReference() { + return analogyReference; + } + + public void setAnalogyReference(String analogyReference) { + this.analogyReference = analogyReference; + } + + public String getHazopNode() { + return hazopNode; + } + + public void setHazopNode(String hazopNode) { + this.hazopNode = hazopNode; + } + + public String getHazopParam() { + return hazopParam; + } + + public void setHazopParam(String hazopParam) { + this.hazopParam = hazopParam; + } + + public String getHazopParamDesc() { + return hazopParamDesc; + } + + public void setHazopParamDesc(String hazopParamDesc) { + this.hazopParamDesc = hazopParamDesc; + } + + public String getHazopGuide() { + return hazopGuide; + } + + public void setHazopGuide(String hazopGuide) { + this.hazopGuide = hazopGuide; + } + + public String getHazopDeviation() { + return hazopDeviation; + } + + public void setHazopDeviation(String hazopDeviation) { + this.hazopDeviation = hazopDeviation; + } + + public String getHazopPossibleCauses() { + return hazopPossibleCauses; + } + + public void setHazopPossibleCauses(String hazopPossibleCauses) { + this.hazopPossibleCauses = hazopPossibleCauses; + } + + public String getHazopResult() { + return hazopResult; + } + + public void setHazopResult(String hazopResult) { + this.hazopResult = hazopResult; + } + + public String getJhaCheckItem() { + return jhaCheckItem; + } + + public void setJhaCheckItem(String jhaCheckItem) { + this.jhaCheckItem = jhaCheckItem; + } + + public String getJhaRiskFactor() { + return jhaRiskFactor; + } + + public void setJhaRiskFactor(String jhaRiskFactor) { + this.jhaRiskFactor = jhaRiskFactor; + } + + public String getJhaResult() { + return jhaResult; + } + + public void setJhaResult(String jhaResult) { + this.jhaResult = jhaResult; + } + + public String getPhaCheckItem() { + return phaCheckItem; + } + + public void setPhaCheckItem(String phaCheckItem) { + this.phaCheckItem = phaCheckItem; + } + + public String getPhaRiskFactor() { + return phaRiskFactor; + } + + public void setPhaRiskFactor(String phaRiskFactor) { + this.phaRiskFactor = phaRiskFactor; + } + + public String getPhaResult() { + return phaResult; + } + + public void setPhaResult(String phaResult) { + this.phaResult = phaResult; + } + + public String getSclCheckItem() { + return sclCheckItem; + } + + public void setSclCheckItem(String sclCheckItem) { + this.sclCheckItem = sclCheckItem; + } + + public String getSclCheckStandard() { + return sclCheckStandard; + } + + public void setSclCheckStandard(String sclCheckStandard) { + this.sclCheckStandard = sclCheckStandard; + } + + public String getSclCheckUnstandard() { + return sclCheckUnstandard; + } + + public void setSclCheckUnstandard(String sclCheckUnstandard) { + this.sclCheckUnstandard = sclCheckUnstandard; + } + + public String getSclCheckResult() { + return sclCheckResult; + } + + public void setSclCheckResult(String sclCheckResult) { + this.sclCheckResult = sclCheckResult; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/RiskAssessPlanQueryBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/RiskAssessPlanQueryBO.java new file mode 100644 index 0000000..0027367 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/RiskAssessPlanQueryBO.java @@ -0,0 +1,31 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +import lombok.Data; + +import java.util.List; + +/** + * + */ +@Data +public class RiskAssessPlanQueryBO { + + private Integer pageIndex; + + private Integer pageSize; + /** + * 风险单元 + */ + private List<Long> riskUnitIds; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 实验 + */ + private Long experimentId; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/UpdateExperimentInfoBO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/UpdateExperimentInfoBO.java new file mode 100644 index 0000000..2397d21 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/bo/UpdateExperimentInfoBO.java @@ -0,0 +1,13 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.bo; + +import lombok.Data; + +@Data +public class UpdateExperimentInfoBO { + //实验id + private Long experimentId; + //整改状态 + private Byte rectifyStatus; + //审核结果 + private Byte approvalStatus; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AnalogyInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AnalogyInsertDTO.java new file mode 100644 index 0000000..3fb4b2a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AnalogyInsertDTO.java @@ -0,0 +1,156 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +public class AnalogyInsertDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getAnalogyCheckItem() { + return analogyCheckItem; + } + + public void setAnalogyCheckItem(String analogyCheckItem) { + this.analogyCheckItem = analogyCheckItem; + } + + public String getAnalogyRiskFactor() { + return analogyRiskFactor; + } + + public void setAnalogyRiskFactor(String analogyRiskFactor) { + this.analogyRiskFactor = analogyRiskFactor; + } + + public String getAnalogyResult() { + return analogyResult; + } + + public void setAnalogyResult(String analogyResult) { + this.analogyResult = analogyResult; + } + + public String getAnalogyReference() { + return analogyReference; + } + + public void setAnalogyReference(String analogyReference) { + this.analogyReference = analogyReference; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AnalogyQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AnalogyQueryDTO.java new file mode 100644 index 0000000..53033df --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AnalogyQueryDTO.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class AnalogyQueryDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanDeleteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanDeleteDTO.java new file mode 100644 index 0000000..3242ae4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanDeleteDTO.java @@ -0,0 +1,417 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * + */ +public class AssessPlanDeleteDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + + public LocalDateTime getPlanSellTime() { + return planSellTime; + } + + public void setPlanSellTime(LocalDateTime planSellTime) { + this.planSellTime = planSellTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getAssessPlanName() { + return assessPlanName; + } + + public void setAssessPlanName(String assessPlanName) { + this.assessPlanName = assessPlanName; + } + + public Byte getRiskType() { + return riskType; + } + + public void setRiskType(Byte riskType) { + this.riskType = riskType; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Long getPlanUserId() { + return planUserId; + } + + public void setPlanUserId(Long planUserId) { + this.planUserId = planUserId; + } + + public LocalDateTime getAssessStartTime() { + return assessStartTime; + } + + public void setAssessStartTime(LocalDateTime assessStartTime) { + this.assessStartTime = assessStartTime; + } + + public LocalDateTime getAssessEndTime() { + return assessEndTime; + } + + public void setAssessEndTime(LocalDateTime assessEndTime) { + this.assessEndTime = assessEndTime; + } + + public LocalDateTime getIdentificationTime() { + return identificationTime; + } + + public void setIdentificationTime(LocalDateTime identificationTime) { + this.identificationTime = identificationTime; + } + + public LocalDateTime getEvaluateTime() { + return evaluateTime; + } + + public void setEvaluateTime(LocalDateTime evaluateTime) { + this.evaluateTime = evaluateTime; + } + + public Byte getPlanSellStatus() { + return planSellStatus; + } + + public void setPlanSellStatus(Byte planSellStatus) { + this.planSellStatus = planSellStatus; + } + + public Byte getPlanExecStatus() { + return planExecStatus; + } + + public void setPlanExecStatus(Byte planExecStatus) { + this.planExecStatus = planExecStatus; + } + + public Byte getPlanTimeStatus() { + return planTimeStatus; + } + + public void setPlanTimeStatus(Byte planTimeStatus) { + this.planTimeStatus = planTimeStatus; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + + public String getIdentificationUser() { + return identificationUser; + } + + public void setIdentificationUser(String identificationUser) { + this.identificationUser = identificationUser; + } + + public Long getIdentificationUserId() { + return identificationUserId; + } + + public void setIdentificationUserId(Long identificationUserId) { + this.identificationUserId = identificationUserId; + } + + public Byte getEvaluateMethod() { + return evaluateMethod; + } + + public void setEvaluateMethod(Byte evaluateMethod) { + this.evaluateMethod = evaluateMethod; + } + + public Long getEvaluateUserId() { + return evaluateUserId; + } + + public void setEvaluateUserId(Long evaluateUserId) { + this.evaluateUserId = evaluateUserId; + } + + public String getEvaluateUser() { + return evaluateUser; + } + + public void setEvaluateUser(String evaluateUser) { + this.evaluateUser = evaluateUser; + } + + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public BigDecimal getRiskValue() { + return riskValue; + } + + public void setRiskValue(BigDecimal riskValue) { + this.riskValue = riskValue; + } + + public Byte getRiskLevelValue() { + return riskLevelValue; + } + + public void setRiskLevelValue(Byte riskLevelValue) { + this.riskLevelValue = riskLevelValue; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getRiskColor() { + return riskColor; + } + + public void setRiskColor(Byte riskColor) { + this.riskColor = riskColor; + } + + public Byte getManageLevel() { + return manageLevel; + } + + public void setManageLevel(Byte manageLevel) { + this.manageLevel = manageLevel; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanEvaluateDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanEvaluateDTO.java new file mode 100644 index 0000000..675dd10 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanEvaluateDTO.java @@ -0,0 +1,4 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +public class AssessPlanEvaluateDTO { +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanIdentificationDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanIdentificationDTO.java new file mode 100644 index 0000000..73d88ad --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanIdentificationDTO.java @@ -0,0 +1,4 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +public class AssessPlanIdentificationDTO { +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanQueryDTO.java new file mode 100644 index 0000000..94e2cc5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanQueryDTO.java @@ -0,0 +1,168 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * + */ +@Data +public class AssessPlanQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 风险分析单元id + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 计划制定人人姓名 + */ + private String planUserName; + + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanUpdateDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanUpdateDTO.java new file mode 100644 index 0000000..9d66412 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessPlanUpdateDTO.java @@ -0,0 +1,417 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * + */ +public class AssessPlanUpdateDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + + public LocalDateTime getPlanSellTime() { + return planSellTime; + } + + public void setPlanSellTime(LocalDateTime planSellTime) { + this.planSellTime = planSellTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Long getRiskUnitId() { + return riskUnitId; + } + + public void setRiskUnitId(Long riskUnitId) { + this.riskUnitId = riskUnitId; + } + + public String getAssessPlanName() { + return assessPlanName; + } + + public void setAssessPlanName(String assessPlanName) { + this.assessPlanName = assessPlanName; + } + + public Byte getRiskType() { + return riskType; + } + + public void setRiskType(Byte riskType) { + this.riskType = riskType; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Long getPlanUserId() { + return planUserId; + } + + public void setPlanUserId(Long planUserId) { + this.planUserId = planUserId; + } + + public LocalDateTime getAssessStartTime() { + return assessStartTime; + } + + public void setAssessStartTime(LocalDateTime assessStartTime) { + this.assessStartTime = assessStartTime; + } + + public LocalDateTime getAssessEndTime() { + return assessEndTime; + } + + public void setAssessEndTime(LocalDateTime assessEndTime) { + this.assessEndTime = assessEndTime; + } + + public LocalDateTime getIdentificationTime() { + return identificationTime; + } + + public void setIdentificationTime(LocalDateTime identificationTime) { + this.identificationTime = identificationTime; + } + + public LocalDateTime getEvaluateTime() { + return evaluateTime; + } + + public void setEvaluateTime(LocalDateTime evaluateTime) { + this.evaluateTime = evaluateTime; + } + + public Byte getPlanSellStatus() { + return planSellStatus; + } + + public void setPlanSellStatus(Byte planSellStatus) { + this.planSellStatus = planSellStatus; + } + + public Byte getPlanExecStatus() { + return planExecStatus; + } + + public void setPlanExecStatus(Byte planExecStatus) { + this.planExecStatus = planExecStatus; + } + + public Byte getPlanTimeStatus() { + return planTimeStatus; + } + + public void setPlanTimeStatus(Byte planTimeStatus) { + this.planTimeStatus = planTimeStatus; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + + public String getIdentificationUser() { + return identificationUser; + } + + public void setIdentificationUser(String identificationUser) { + this.identificationUser = identificationUser; + } + + public Long getIdentificationUserId() { + return identificationUserId; + } + + public void setIdentificationUserId(Long identificationUserId) { + this.identificationUserId = identificationUserId; + } + + public Byte getEvaluateMethod() { + return evaluateMethod; + } + + public void setEvaluateMethod(Byte evaluateMethod) { + this.evaluateMethod = evaluateMethod; + } + + public Long getEvaluateUserId() { + return evaluateUserId; + } + + public void setEvaluateUserId(Long evaluateUserId) { + this.evaluateUserId = evaluateUserId; + } + + public String getEvaluateUser() { + return evaluateUser; + } + + public void setEvaluateUser(String evaluateUser) { + this.evaluateUser = evaluateUser; + } + + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public BigDecimal getRiskValue() { + return riskValue; + } + + public void setRiskValue(BigDecimal riskValue) { + this.riskValue = riskValue; + } + + public Byte getRiskLevelValue() { + return riskLevelValue; + } + + public void setRiskLevelValue(Byte riskLevelValue) { + this.riskLevelValue = riskLevelValue; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getRiskColor() { + return riskColor; + } + + public void setRiskColor(Byte riskColor) { + this.riskColor = riskColor; + } + + public Byte getManageLevel() { + return manageLevel; + } + + public void setManageLevel(Byte manageLevel) { + this.manageLevel = manageLevel; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessQueryDTO.java new file mode 100644 index 0000000..0e7a9f4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessQueryDTO.java @@ -0,0 +1,125 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 风险辨识与评价 + * */ +@Data +public class AssessQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private String riskUnitName; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + + + private List<FactorQueryDTO> factorQueryDTOList; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessQueryDTO_0223bak.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessQueryDTO_0223bak.java new file mode 100644 index 0000000..1c024b9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/AssessQueryDTO_0223bak.java @@ -0,0 +1,896 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 风险辨识与评价 + * */ +public class AssessQueryDTO_0223bak { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 风险分析单元 + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 类比法_检查项目id + */ + private Long analogyId; + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + + private Long hazopId; + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + private Long jhaId; + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + + private Long phaId; + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + + private Long sclId; + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + + + + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + + private Long LecId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + + private Long LsId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + private Long MesId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + + private Long RsId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + 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 getAssessPlanName() { + return assessPlanName; + } + + public void setAssessPlanName(String assessPlanName) { + this.assessPlanName = assessPlanName; + } + + public Byte getRiskType() { + return riskType; + } + + public void setRiskType(Byte riskType) { + this.riskType = riskType; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Long getPlanUserId() { + return planUserId; + } + + public void setPlanUserId(Long planUserId) { + this.planUserId = planUserId; + } + + public LocalDateTime getAssessStartTime() { + return assessStartTime; + } + + public void setAssessStartTime(LocalDateTime assessStartTime) { + this.assessStartTime = assessStartTime; + } + + public LocalDateTime getAssessEndTime() { + return assessEndTime; + } + + public void setAssessEndTime(LocalDateTime assessEndTime) { + this.assessEndTime = assessEndTime; + } + + public LocalDateTime getIdentificationTime() { + return identificationTime; + } + + public void setIdentificationTime(LocalDateTime identificationTime) { + this.identificationTime = identificationTime; + } + + public LocalDateTime getEvaluateTime() { + return evaluateTime; + } + + public void setEvaluateTime(LocalDateTime evaluateTime) { + this.evaluateTime = evaluateTime; + } + + public Byte getPlanSellStatus() { + return planSellStatus; + } + + public void setPlanSellStatus(Byte planSellStatus) { + this.planSellStatus = planSellStatus; + } + + public LocalDateTime getPlanSellTime() { + return planSellTime; + } + + public void setPlanSellTime(LocalDateTime planSellTime) { + this.planSellTime = planSellTime; + } + + public Byte getPlanExecStatus() { + return planExecStatus; + } + + public void setPlanExecStatus(Byte planExecStatus) { + this.planExecStatus = planExecStatus; + } + + public Byte getPlanTimeStatus() { + return planTimeStatus; + } + + public void setPlanTimeStatus(Byte planTimeStatus) { + this.planTimeStatus = planTimeStatus; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + + public String getIdentificationUser() { + return identificationUser; + } + + public void setIdentificationUser(String identificationUser) { + this.identificationUser = identificationUser; + } + + public Long getIdentificationUserId() { + return identificationUserId; + } + + public void setIdentificationUserId(Long identificationUserId) { + this.identificationUserId = identificationUserId; + } + + public Byte getEvaluateMethod() { + return evaluateMethod; + } + + public void setEvaluateMethod(Byte evaluateMethod) { + this.evaluateMethod = evaluateMethod; + } + + public Long getEvaluateUserId() { + return evaluateUserId; + } + + public void setEvaluateUserId(Long evaluateUserId) { + this.evaluateUserId = evaluateUserId; + } + + public String getEvaluateUser() { + return evaluateUser; + } + + public void setEvaluateUser(String evaluateUser) { + this.evaluateUser = evaluateUser; + } + + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public Long getAnalogyId() { + return analogyId; + } + + public void setAnalogyId(Long analogyId) { + this.analogyId = analogyId; + } + + public String getAnalogyCheckItem() { + return analogyCheckItem; + } + + public void setAnalogyCheckItem(String analogyCheckItem) { + this.analogyCheckItem = analogyCheckItem; + } + + public String getAnalogyRiskFactor() { + return analogyRiskFactor; + } + + public void setAnalogyRiskFactor(String analogyRiskFactor) { + this.analogyRiskFactor = analogyRiskFactor; + } + + public String getAnalogyResult() { + return analogyResult; + } + + public void setAnalogyResult(String analogyResult) { + this.analogyResult = analogyResult; + } + + public String getAnalogyReference() { + return analogyReference; + } + + public void setAnalogyReference(String analogyReference) { + this.analogyReference = analogyReference; + } + + public Long getHazopId() { + return hazopId; + } + + public void setHazopId(Long hazopId) { + this.hazopId = hazopId; + } + + public String getHazopNode() { + return hazopNode; + } + + public void setHazopNode(String hazopNode) { + this.hazopNode = hazopNode; + } + + public String getHazopParam() { + return hazopParam; + } + + public void setHazopParam(String hazopParam) { + this.hazopParam = hazopParam; + } + + public String getHazopParamDesc() { + return hazopParamDesc; + } + + public void setHazopParamDesc(String hazopParamDesc) { + this.hazopParamDesc = hazopParamDesc; + } + + public String getHazopGuide() { + return hazopGuide; + } + + public void setHazopGuide(String hazopGuide) { + this.hazopGuide = hazopGuide; + } + + public String getHazopDeviation() { + return hazopDeviation; + } + + public void setHazopDeviation(String hazopDeviation) { + this.hazopDeviation = hazopDeviation; + } + + public String getHazopPossibleCauses() { + return hazopPossibleCauses; + } + + public void setHazopPossibleCauses(String hazopPossibleCauses) { + this.hazopPossibleCauses = hazopPossibleCauses; + } + + public String getHazopResult() { + return hazopResult; + } + + public void setHazopResult(String hazopResult) { + this.hazopResult = hazopResult; + } + + public Long getJhaId() { + return jhaId; + } + + public void setJhaId(Long jhaId) { + this.jhaId = jhaId; + } + + public String getJhaCheckItem() { + return jhaCheckItem; + } + + public void setJhaCheckItem(String jhaCheckItem) { + this.jhaCheckItem = jhaCheckItem; + } + + public String getJhaRiskFactor() { + return jhaRiskFactor; + } + + public void setJhaRiskFactor(String jhaRiskFactor) { + this.jhaRiskFactor = jhaRiskFactor; + } + + public String getJhaResult() { + return jhaResult; + } + + public void setJhaResult(String jhaResult) { + this.jhaResult = jhaResult; + } + + public Long getPhaId() { + return phaId; + } + + public void setPhaId(Long phaId) { + this.phaId = phaId; + } + + public String getPhaCheckItem() { + return phaCheckItem; + } + + public void setPhaCheckItem(String phaCheckItem) { + this.phaCheckItem = phaCheckItem; + } + + public String getPhaRiskFactor() { + return phaRiskFactor; + } + + public void setPhaRiskFactor(String phaRiskFactor) { + this.phaRiskFactor = phaRiskFactor; + } + + public String getPhaResult() { + return phaResult; + } + + public void setPhaResult(String phaResult) { + this.phaResult = phaResult; + } + + public Long getSclId() { + return sclId; + } + + public void setSclId(Long sclId) { + this.sclId = sclId; + } + + public String getSclCheckItem() { + return sclCheckItem; + } + + public void setSclCheckItem(String sclCheckItem) { + this.sclCheckItem = sclCheckItem; + } + + public String getSclCheckStandard() { + return sclCheckStandard; + } + + public void setSclCheckStandard(String sclCheckStandard) { + this.sclCheckStandard = sclCheckStandard; + } + + public String getSclCheckUnstandard() { + return sclCheckUnstandard; + } + + public void setSclCheckUnstandard(String sclCheckUnstandard) { + this.sclCheckUnstandard = sclCheckUnstandard; + } + + public String getSclCheckResult() { + return sclCheckResult; + } + + public void setSclCheckResult(String sclCheckResult) { + this.sclCheckResult = sclCheckResult; + } + + public BigDecimal getRiskValue() { + return riskValue; + } + + public void setRiskValue(BigDecimal riskValue) { + this.riskValue = riskValue; + } + + public Byte getRiskLevelValue() { + return riskLevelValue; + } + + public void setRiskLevelValue(Byte riskLevelValue) { + this.riskLevelValue = riskLevelValue; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getRiskColor() { + return riskColor; + } + + public void setRiskColor(Byte riskColor) { + this.riskColor = riskColor; + } + + public Byte getManageLevel() { + return manageLevel; + } + + public void setManageLevel(Byte manageLevel) { + this.manageLevel = manageLevel; + } + + public Long getLecId() { + return LecId; + } + + public void setLecId(Long lecId) { + LecId = lecId; + } + + public BigDecimal getLecL() { + return lecL; + } + + public void setLecL(BigDecimal lecL) { + this.lecL = lecL; + } + + public BigDecimal getLecE() { + return lecE; + } + + public void setLecE(BigDecimal lecE) { + this.lecE = lecE; + } + + public BigDecimal getLecC() { + return lecC; + } + + public void setLecC(BigDecimal lecC) { + this.lecC = lecC; + } + + public Long getLsId() { + return LsId; + } + + public void setLsId(Long lsId) { + LsId = lsId; + } + + public BigDecimal getLsL() { + return lsL; + } + + public void setLsL(BigDecimal lsL) { + this.lsL = lsL; + } + + public BigDecimal getLsS() { + return lsS; + } + + public void setLsS(BigDecimal lsS) { + this.lsS = lsS; + } + + public Long getMesId() { + return MesId; + } + + public void setMesId(Long mesId) { + MesId = mesId; + } + + public BigDecimal getMesM() { + return mesM; + } + + public void setMesM(BigDecimal mesM) { + this.mesM = mesM; + } + + public BigDecimal getMesE() { + return mesE; + } + + public void setMesE(BigDecimal mesE) { + this.mesE = mesE; + } + + public BigDecimal getMesS() { + return mesS; + } + + public void setMesS(BigDecimal mesS) { + this.mesS = mesS; + } + + public Long getRsId() { + return RsId; + } + + public void setRsId(Long rsId) { + RsId = rsId; + } + + public BigDecimal getRsR() { + return rsR; + } + + public void setRsR(BigDecimal rsR) { + this.rsR = rsR; + } + + public BigDecimal getRsS() { + return rsS; + } + + public void setRsS(BigDecimal rsS) { + this.rsS = rsS; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/EvaluateInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/EvaluateInsertDTO.java new file mode 100644 index 0000000..4ce40ac --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/EvaluateInsertDTO.java @@ -0,0 +1,23 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import java.math.BigDecimal; + +/** + * 评价方法LEC + */ +public class EvaluateInsertDTO { + + /** + * 结果 + */ + private int result; + + public int getResult() { + return result; + } + + public void setResult(int result) { + this.result = result; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/EvaluateMethodDeleteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/EvaluateMethodDeleteDTO.java new file mode 100644 index 0000000..8dbf13f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/EvaluateMethodDeleteDTO.java @@ -0,0 +1,16 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +public class EvaluateMethodDeleteDTO { + /** + * 结果 + */ + private int result; + + public int getResult() { + return result; + } + + public void setResult(int result) { + this.result = result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/FactorQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/FactorQueryDTO.java new file mode 100644 index 0000000..2a9b8f1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/FactorQueryDTO.java @@ -0,0 +1,329 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +public class FactorQueryDTO { + + /** + * + */ + private Long id; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + + /** + * 类比法_检查项目id + */ + private Long analogyId; + /** + * 类比法_检查项目(辨识) + */ + private String analogyCheckItem; + /** + * 类比法_存在风险因素(辨识) + */ + private String analogyRiskFactor; + /** + * 类比法_可能产生的后果(辨识) + */ + private String analogyResult; + /** + * 类比法_类比参照(辨识) + */ + private String analogyReference; + + private Long hazopId; + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + private Long jhaId; + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + + private Long phaId; + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + + private Long sclId; + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + + + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识完成时间 + */ + private LocalDateTime itemIdentificationTime; + /** + * 评价完成时间 + */ + private LocalDateTime itemEducationTime; + + private Long LecId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + + private Long LsId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + private Long MesId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + + private Long RsId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + /** + * 评价状态 0-未评价过;1-已评价 + */ + private Byte evaluateStatus; + /** + * 辨识专家意见 + */ + private String identificationDesc; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + + + /** + * LEC_L的数值(评价) + */ + private BigDecimal originalLecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecE; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecC; + /** + * LS_L的数值(评价) + */ + private BigDecimal originalLsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal originalLsS; + /** + * MES_M的数值(评价) + */ + private BigDecimal originalMesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal originalMesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal originalMesS; + /** + * RS_R的数值(评价) + */ + private BigDecimal originalRsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal originalRsS; + + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/HazopInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/HazopInsertDTO.java new file mode 100644 index 0000000..f24c7bf --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/HazopInsertDTO.java @@ -0,0 +1,197 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + + +/** + * 辨识方法-Hazop + */ +public class HazopInsertDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getHazopNode() { + return hazopNode; + } + + public void setHazopNode(String hazopNode) { + this.hazopNode = hazopNode; + } + + public String getHazopParam() { + return hazopParam; + } + + public void setHazopParam(String hazopParam) { + this.hazopParam = hazopParam; + } + + public String getHazopParamDesc() { + return hazopParamDesc; + } + + public void setHazopParamDesc(String hazopParamDesc) { + this.hazopParamDesc = hazopParamDesc; + } + + public String getHazopGuide() { + return hazopGuide; + } + + public void setHazopGuide(String hazopGuide) { + this.hazopGuide = hazopGuide; + } + + public String getHazopDeviation() { + return hazopDeviation; + } + + public void setHazopDeviation(String hazopDeviation) { + this.hazopDeviation = hazopDeviation; + } + + public String getHazopPossibleCauses() { + return hazopPossibleCauses; + } + + public void setHazopPossibleCauses(String hazopPossibleCauses) { + this.hazopPossibleCauses = hazopPossibleCauses; + } + + public String getHazopResult() { + return hazopResult; + } + + public void setHazopResult(String hazopResult) { + this.hazopResult = hazopResult; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/HazopQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/HazopQueryDTO.java new file mode 100644 index 0000000..22831e5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/HazopQueryDTO.java @@ -0,0 +1,67 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 辨识方法-Hazop + */ +@Data +public class HazopQueryDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * HAZOP_节点(辨识) + */ + private String hazopNode; + /** + * HAZOP_参数(辨识) + */ + private String hazopParam; + /** + * HAZOP_参数描述(辨识) + */ + private String hazopParamDesc; + /** + * HAZOP_引导词(辨识) + */ + private String hazopGuide; + /** + * HAZOP_偏差(辨识) + */ + private String hazopDeviation; + /** + * HAZOP_可能原因(辨识) + */ + private String hazopPossibleCauses; + /** + * HAZOP_主要后果(辨识) + */ + private String hazopResult; + + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/IdentificationMethodDeleteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/IdentificationMethodDeleteDTO.java new file mode 100644 index 0000000..d211408 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/IdentificationMethodDeleteDTO.java @@ -0,0 +1,16 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +public class IdentificationMethodDeleteDTO { + /** + * 结果 + */ + private int result; + + public int getResult() { + return result; + } + + public void setResult(int result) { + this.result = result; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/JhaInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/JhaInsertDTO.java new file mode 100644 index 0000000..670fd6b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/JhaInsertDTO.java @@ -0,0 +1,144 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +public class JhaInsertDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getJhaCheckItem() { + return jhaCheckItem; + } + + public void setJhaCheckItem(String jhaCheckItem) { + this.jhaCheckItem = jhaCheckItem; + } + + public String getJhaRiskFactor() { + return jhaRiskFactor; + } + + public void setJhaRiskFactor(String jhaRiskFactor) { + this.jhaRiskFactor = jhaRiskFactor; + } + + public String getJhaResult() { + return jhaResult; + } + + public void setJhaResult(String jhaResult) { + this.jhaResult = jhaResult; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/JhaQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/JhaQueryDTO.java new file mode 100644 index 0000000..afca3b3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/JhaQueryDTO.java @@ -0,0 +1,43 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class JhaQueryDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * JHA_作业步骤(辨识) + */ + private String jhaCheckItem; + /** + * JHA_危险源或潜在事件(辨识) + */ + private String jhaRiskFactor; + /** + * JHA_可能发生的事故类型及后果(辨识) + */ + private String jhaResult; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LecInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LecInsertDTO.java new file mode 100644 index 0000000..dff1e22 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LecInsertDTO.java @@ -0,0 +1,86 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法LEC + */ +@Data +public class LecInsertDTO{ + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LecQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LecQueryDTO.java new file mode 100644 index 0000000..c73d5cf --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LecQueryDTO.java @@ -0,0 +1,159 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法LEC + */ +@Data +public class LecQueryDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * LEC_L的数值(评价) + */ + private BigDecimal lecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal lecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal lecC; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + /** + * LEC_L的数值(评价) + */ + private BigDecimal originalLecL; + /** + * LEC_E的数值(评价) + */ + private BigDecimal originalLecE; + /** + * LEC_C的数值(评价) + */ + private BigDecimal originalLecC; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + + + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LsInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LsInsertDTO.java new file mode 100644 index 0000000..5017000 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LsInsertDTO.java @@ -0,0 +1,196 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法LS + */ +public class LsInsertDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + public String getEvaluateDesc() { + return evaluateDesc; + } + + public void setEvaluateDesc(String evaluateDesc) { + this.evaluateDesc = evaluateDesc; + } + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + public BigDecimal getRiskValue() { + return riskValue; + } + + public void setRiskValue(BigDecimal riskValue) { + this.riskValue = riskValue; + } + + public Byte getRiskLevelValue() { + return riskLevelValue; + } + + public void setRiskLevelValue(Byte riskLevelValue) { + this.riskLevelValue = riskLevelValue; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getRiskColor() { + return riskColor; + } + + public void setRiskColor(Byte riskColor) { + this.riskColor = riskColor; + } + + public Byte getManageLevel() { + return manageLevel; + } + + public void setManageLevel(Byte manageLevel) { + this.manageLevel = manageLevel; + } + + public Long getIdentificationId() { + return identificationId; + } + + public void setIdentificationId(Long identificationId) { + this.identificationId = identificationId; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public BigDecimal getLsL() { + return lsL; + } + + public void setLsL(BigDecimal lsL) { + this.lsL = lsL; + } + + public BigDecimal getLsS() { + return lsS; + } + + public void setLsS(BigDecimal lsS) { + this.lsS = lsS; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LsQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LsQueryDTO.java new file mode 100644 index 0000000..6f1d96e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/LsQueryDTO.java @@ -0,0 +1,150 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法LS + */ +@Data +public class LsQueryDTO{ + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * LS_L的数值(评价) + */ + private BigDecimal lsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal lsS; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + /** + * LS_L的数值(评价) + */ + private BigDecimal originalLsL; + /** + * LS_S的数值(评价) + */ + private BigDecimal originalLsS; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/MesInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/MesInsertDTO.java new file mode 100644 index 0000000..4ed5359 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/MesInsertDTO.java @@ -0,0 +1,88 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法MES + */ +@Data +public class MesInsertDTO implements Serializable { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + + + + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/MesQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/MesQueryDTO.java new file mode 100644 index 0000000..1e4c901 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/MesQueryDTO.java @@ -0,0 +1,156 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法MES + */ +@Data +public class MesQueryDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * MES_M的数值(评价) + */ + private BigDecimal mesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal mesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal mesS; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + + /** + * MES_M的数值(评价) + */ + private BigDecimal originalMesM; + /** + * MES_E的数值(评价) + */ + private BigDecimal originalMesE; + /** + * MES_S的数值(评价) + */ + private BigDecimal originalMesS; + /** + * MES_S的数值(评价) + */ + private BigDecimal originalRiskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PhaInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PhaInsertDTO.java new file mode 100644 index 0000000..e17dc9d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PhaInsertDTO.java @@ -0,0 +1,149 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +/** + * 辨识方法-Pha + */ +public class PhaInsertDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getPhaCheckItem() { + return phaCheckItem; + } + + public void setPhaCheckItem(String phaCheckItem) { + this.phaCheckItem = phaCheckItem; + } + + public String getPhaRiskFactor() { + return phaRiskFactor; + } + + public void setPhaRiskFactor(String phaRiskFactor) { + this.phaRiskFactor = phaRiskFactor; + } + + public String getPhaResult() { + return phaResult; + } + + public void setPhaResult(String phaResult) { + this.phaResult = phaResult; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PhaQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PhaQueryDTO.java new file mode 100644 index 0000000..63a652b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PhaQueryDTO.java @@ -0,0 +1,49 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 辨识方法-Pha + */ +@Data +public class PhaQueryDTO{ + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * PHA_检查项目(辨识) + */ + private String phaCheckItem; + /** + * PHA_存在风险因素(辨识) + */ + private String phaRiskFactor; + /** + * PHA_可能产生的后果(辨识) + */ + private String phaResult; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PlanInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PlanInsertDTO.java new file mode 100644 index 0000000..521823c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/PlanInsertDTO.java @@ -0,0 +1,418 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * + */ +public class PlanInsertDTO { + + private Long id; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 实验id + */ + private Long experimentId; + /** + * 评估结束时间 + */ + private Date assessEndTime; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + + public LocalDateTime getPlanSellTime() { + return planSellTime; + } + + public void setPlanSellTime(LocalDateTime planSellTime) { + this.planSellTime = planSellTime; + } + + 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 getAssessPlanName() { + return assessPlanName; + } + + public void setAssessPlanName(String assessPlanName) { + this.assessPlanName = assessPlanName; + } + + public Byte getRiskType() { + return riskType; + } + + public void setRiskType(Byte riskType) { + this.riskType = riskType; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Long getPlanUserId() { + return planUserId; + } + + public void setPlanUserId(Long planUserId) { + this.planUserId = planUserId; + } + + public LocalDateTime getAssessStartTime() { + return assessStartTime; + } + + public void setAssessStartTime(LocalDateTime assessStartTime) { + this.assessStartTime = assessStartTime; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + + public String getIdentificationUser() { + return identificationUser; + } + + public void setIdentificationUser(String identificationUser) { + this.identificationUser = identificationUser; + } + + public Long getIdentificationUserId() { + return identificationUserId; + } + + public void setIdentificationUserId(Long identificationUserId) { + this.identificationUserId = identificationUserId; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public Date getAssessEndTime() { + return assessEndTime; + } + + public void setAssessEndTime(Date assessEndTime) { + this.assessEndTime = assessEndTime; + } + + public Byte getEvaluateMethod() { + return evaluateMethod; + } + + public void setEvaluateMethod(Byte evaluateMethod) { + this.evaluateMethod = evaluateMethod; + } + + public Long getEvaluateUserId() { + return evaluateUserId; + } + + public void setEvaluateUserId(Long evaluateUserId) { + this.evaluateUserId = evaluateUserId; + } + + public String getEvaluateUser() { + return evaluateUser; + } + + public void setEvaluateUser(String evaluateUser) { + this.evaluateUser = evaluateUser; + } + + public Byte getPlanSellStatus() { + return planSellStatus; + } + + public void setPlanSellStatus(Byte planSellStatus) { + this.planSellStatus = planSellStatus; + } + + public Byte getPlanExecStatus() { + return planExecStatus; + } + + public void setPlanExecStatus(Byte planExecStatus) { + this.planExecStatus = planExecStatus; + } + + public Byte getPlanTimeStatus() { + return planTimeStatus; + } + + public void setPlanTimeStatus(Byte planTimeStatus) { + this.planTimeStatus = planTimeStatus; + } + + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public BigDecimal getRiskValue() { + return riskValue; + } + + public void setRiskValue(BigDecimal riskValue) { + this.riskValue = riskValue; + } + + public Byte getRiskLevelValue() { + return riskLevelValue; + } + + public void setRiskLevelValue(Byte riskLevelValue) { + this.riskLevelValue = riskLevelValue; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getRiskColor() { + return riskColor; + } + + public void setRiskColor(Byte riskColor) { + this.riskColor = riskColor; + } + + public Byte getManageLevel() { + return manageLevel; + } + + public void setManageLevel(Byte manageLevel) { + this.manageLevel = manageLevel; + } + + public LocalDateTime getEvaluateTime() { + return evaluateTime; + } + + public void setEvaluateTime(LocalDateTime evaluateTime) { + this.evaluateTime = evaluateTime; + } + + public LocalDateTime getIdentificationTime() { + return identificationTime; + } + + public void setIdentificationTime(LocalDateTime identificationTime) { + this.identificationTime = identificationTime; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportDTO.java new file mode 100644 index 0000000..e6832b4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportDTO.java @@ -0,0 +1,29 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +public class ReportDTO { + + /** + * reportId + * */ + private Long reportId; + /** + * 报告审核结果 + * */ + private Byte approvePlanStatus; + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Byte getApprovePlanStatus() { + return approvePlanStatus; + } + + public void setApprovePlanStatus(Byte approvePlanStatus) { + this.approvePlanStatus = approvePlanStatus; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportInsertDTO.java new file mode 100644 index 0000000..d7d8bd0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportInsertDTO.java @@ -0,0 +1,333 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import java.time.LocalDateTime; + +/** + * 风险评估报告 + */ +public class ReportInsertDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + * (文字描述可能不再修改) + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long personUserId; + /** + * 实验负责人(文字描述可能不再修改) + */ + private String personUser; + /** + * 实验负责人手机 + */ + private Long personUserPhone; + /** + * 安全负责人id + */ + private Long safePersonUserId; + /** + * 安全负责人((文字描述可能不再修改) + */ + private String safePersonUser; + /** + * 安全负责人手机 + */ + private Long safePersonUserPhone; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + /** + * 评估人id + */ + private Long assessPersonId; + /** + * 评估人 + */ + private String assessPerson; + /** + * 评估时间 + */ + private LocalDateTime assessTime; + /** + * 实验概况 + */ + private String experimentDesc; + /** + * 实验涉及到的风险源 + */ + private String experimentRiskSource; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approvePlanStatus; + /** + * 实验室id + */ + private Long siteId; + /** + * 实验室 + */ + private String site; + + public Long getSiteId() { + return siteId; + } + + public void setSiteId(Long siteId) { + this.siteId = siteId; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public String getExperimentName() { + return experimentName; + } + + public void setExperimentName(String experimentName) { + this.experimentName = experimentName; + } + + public Byte getExperimentType() { + return experimentType; + } + + public void setExperimentType(Byte experimentType) { + this.experimentType = experimentType; + } + + public Long getPersonUserId() { + return personUserId; + } + + public void setPersonUserId(Long personUserId) { + this.personUserId = personUserId; + } + + public String getPersonUser() { + return personUser; + } + + public void setPersonUser(String personUser) { + this.personUser = personUser; + } + + public Long getPersonUserPhone() { + return personUserPhone; + } + + public void setPersonUserPhone(Long personUserPhone) { + this.personUserPhone = personUserPhone; + } + + public Long getSafePersonUserId() { + return safePersonUserId; + } + + public void setSafePersonUserId(Long safePersonUserId) { + this.safePersonUserId = safePersonUserId; + } + + public String getSafePersonUser() { + return safePersonUser; + } + + public void setSafePersonUser(String safePersonUser) { + this.safePersonUser = safePersonUser; + } + + public Long getSafePersonUserPhone() { + return safePersonUserPhone; + } + + public void setSafePersonUserPhone(Long safePersonUserPhone) { + this.safePersonUserPhone = safePersonUserPhone; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDep() { + return dep; + } + + public void setDep(String dep) { + this.dep = dep; + } + + public Long getAssessPersonId() { + return assessPersonId; + } + + public void setAssessPersonId(Long assessPersonId) { + this.assessPersonId = assessPersonId; + } + + public String getAssessPerson() { + return assessPerson; + } + + public void setAssessPerson(String assessPerson) { + this.assessPerson = assessPerson; + } + + public LocalDateTime getAssessTime() { + return assessTime; + } + + public void setAssessTime(LocalDateTime assessTime) { + this.assessTime = assessTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public String getExperimentDesc() { + return experimentDesc; + } + + public void setExperimentDesc(String experimentDesc) { + this.experimentDesc = experimentDesc; + } + + public String getExperimentRiskSource() { + return experimentRiskSource; + } + + public void setExperimentRiskSource(String experimentRiskSource) { + this.experimentRiskSource = experimentRiskSource; + } + + public String getSafeRiskAnalysis() { + return safeRiskAnalysis; + } + + public void setSafeRiskAnalysis(String safeRiskAnalysis) { + this.safeRiskAnalysis = safeRiskAnalysis; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public Byte getAssessLevel() { + return assessLevel; + } + + public void setAssessLevel(Byte assessLevel) { + this.assessLevel = assessLevel; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getApprovePlanStatus() { + return approvePlanStatus; + } + + public void setApprovePlanStatus(Byte approvePlanStatus) { + this.approvePlanStatus = approvePlanStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportPersonInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportPersonInsertDTO.java new file mode 100644 index 0000000..d6b6d1c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportPersonInsertDTO.java @@ -0,0 +1,164 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import java.time.LocalDateTime; + +/** + * 风险评估报告-评估专家 + */ +public class ReportPersonInsertDTO{ + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 审批阶段排序 + */ + private Integer approveIndex; + /** + * 审批阶段名称 + */ + private String approveStage; + /** + * 审批意见说明 + */ + private String approveDesc; + /** + * 审批时间 + */ + private LocalDateTime approveTime; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approveStatus; + /** + * 审批人(一旦结束,此信息不再修改) + */ + private String approvePerson; + /** + * 审批人id + */ + private Long approvePersonId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Integer getApproveIndex() { + return approveIndex; + } + + public void setApproveIndex(Integer approveIndex) { + this.approveIndex = approveIndex; + } + + public String getApproveStage() { + return approveStage; + } + + public void setApproveStage(String approveStage) { + this.approveStage = approveStage; + } + + public String getApproveDesc() { + return approveDesc; + } + + public void setApproveDesc(String approveDesc) { + this.approveDesc = approveDesc; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getApproveTime() { + return approveTime; + } + + public void setApproveTime(LocalDateTime approveTime) { + this.approveTime = approveTime; + } + + public Byte getApproveStatus() { + return approveStatus; + } + + public void setApproveStatus(Byte approveStatus) { + this.approveStatus = approveStatus; + } + + public String getApprovePerson() { + return approvePerson; + } + + public void setApprovePerson(String approvePerson) { + this.approvePerson = approvePerson; + } + + public Long getApprovePersonId() { + return approvePersonId; + } + + public void setApprovePersonId(Long approvePersonId) { + this.approvePersonId = approvePersonId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportQueryDTO.java new file mode 100644 index 0000000..197ac11 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportQueryDTO.java @@ -0,0 +1,141 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 风险评估报告 + */ +@Data +public class ReportQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + * (文字描述可能不再修改) + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long personUserId; + /** + * 实验负责人(文字描述可能不再修改) + */ + private String personUser; + /** + * 实验负责人手机 + */ + private Long personUserPhone; + /** + * 安全负责人id + */ + private Long safePersonUserId; + /** + * 安全负责人((文字描述可能不再修改) + */ + private String safePersonUser; + /** + * 安全负责人手机 + */ + private Long safePersonUserPhone; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + /** + * 评估人id + */ + private Long assessPersonId; + /** + * 评估人 + */ + private String assessPerson; + /** + * 评估时间 + */ + private LocalDateTime assessTime; + /** + * 实验概况 + */ + private String experimentDesc; + /** + * 实验涉及到的风险源 + */ + private String experimentRiskSource; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approvePlanStatus; + /** + * 实验室id + */ + private Long siteId; + /** + * 实验室 + */ + private String site; + /** + * 最后修改人 + */ + private String updateByUserName; + /** + * 新建人 + */ + private String createByUserName; + /** + * 评级依据 + */ + private String description; + /** + * + */ + private String experimentCode; + /** + * + */ + private LocalDateTime evaluateTime; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportRiskSourceDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportRiskSourceDTO.java new file mode 100644 index 0000000..ab31e86 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportRiskSourceDTO.java @@ -0,0 +1,141 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import java.time.LocalDateTime; + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +public class ReportRiskSourceDTO { + + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 排序 + */ + private Integer riskSourceIndex; + /** + * 危险源 + */ + private String riskSource; + /** + * 危险特性 + */ + private String riskCharacteristic; + /** + * 数量 + */ + private Integer number; + /** + * 说明 + */ + private String desc; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public Integer getRiskSourceIndex() { + return riskSourceIndex; + } + + public void setRiskSourceIndex(Integer riskSourceIndex) { + this.riskSourceIndex = riskSourceIndex; + } + + public String getRiskSource() { + return riskSource; + } + + public void setRiskSource(String riskSource) { + this.riskSource = riskSource; + } + + public String getRiskCharacteristic() { + return riskCharacteristic; + } + + public void setRiskCharacteristic(String riskCharacteristic) { + this.riskCharacteristic = riskCharacteristic; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportSourceTypeInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportSourceTypeInsertDTO.java new file mode 100644 index 0000000..bde4e84 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportSourceTypeInsertDTO.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public class ReportSourceTypeInsertDTO { + + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private String riskSourceType; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public String getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(String riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportSourceTypeQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportSourceTypeQueryDTO.java new file mode 100644 index 0000000..60b91c4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportSourceTypeQueryDTO.java @@ -0,0 +1,107 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public class ReportSourceTypeQueryDTO { + + private Long id; + /** + * 报告id + */ + private Long reportId; + /** + * 危险源种类 + */ + private String riskSourceType; + /** + * 状态:1-存在;2-不存在 + */ + private Byte status; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getReportId() { + return reportId; + } + + public void setReportId(Long reportId) { + this.reportId = reportId; + } + + public String getRiskSourceType() { + return riskSourceType; + } + + public void setRiskSourceType(String riskSourceType) { + this.riskSourceType = riskSourceType; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportUpdateDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportUpdateDTO.java new file mode 100644 index 0000000..4770223 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/ReportUpdateDTO.java @@ -0,0 +1,333 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import java.time.LocalDateTime; + +/** + * 风险评估报告 + */ +public class ReportUpdateDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 实验名称 + */ + private String experimentName; + /** + * 实验类型:1-化学类;2-生物类;3-辐射类;4-机电类;5-特种设备类;6-其它类 + * (文字描述可能不再修改) + */ + private Byte experimentType; + /** + * 实验负责人id + */ + private Long personUserId; + /** + * 实验负责人(文字描述可能不再修改) + */ + private String personUser; + /** + * 实验负责人手机 + */ + private Long personUserPhone; + /** + * 安全负责人id + */ + private Long safePersonUserId; + /** + * 安全负责人((文字描述可能不再修改) + */ + private String safePersonUser; + /** + * 安全负责人手机 + */ + private Long safePersonUserPhone; + /** + * 部门ID + */ + private Long depId; + /** + * 部门(文字描述可能不再修改) + */ + private String dep; + /** + * 评估人id + */ + private Long assessPersonId; + /** + * 评估人 + */ + private String assessPerson; + /** + * 评估时间 + */ + private LocalDateTime assessTime; + /** + * 实验概况 + */ + private String experimentDesc; + /** + * 实验涉及到的风险源 + */ + private String experimentRiskSource; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 项目风险评估等级:1-低风险;2-一般风险;3-较大风险;4-重大风险; + */ + private Byte assessLevel; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 审批状态:1-未审批;2-已通过;3-不通过(该状态暂时不用) + */ + private Byte approvePlanStatus; + /** + * 实验室id + */ + private Long siteId; + /** + * 实验室 + */ + private String site; + + public Long getSiteId() { + return siteId; + } + + public void setSiteId(Long siteId) { + this.siteId = siteId; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getExperimentId() { + return experimentId; + } + + public void setExperimentId(Long experimentId) { + this.experimentId = experimentId; + } + + public String getExperimentName() { + return experimentName; + } + + public void setExperimentName(String experimentName) { + this.experimentName = experimentName; + } + + public Byte getExperimentType() { + return experimentType; + } + + public void setExperimentType(Byte experimentType) { + this.experimentType = experimentType; + } + + public Long getPersonUserId() { + return personUserId; + } + + public void setPersonUserId(Long personUserId) { + this.personUserId = personUserId; + } + + public String getPersonUser() { + return personUser; + } + + public void setPersonUser(String personUser) { + this.personUser = personUser; + } + + public Long getPersonUserPhone() { + return personUserPhone; + } + + public void setPersonUserPhone(Long personUserPhone) { + this.personUserPhone = personUserPhone; + } + + public Long getSafePersonUserId() { + return safePersonUserId; + } + + public void setSafePersonUserId(Long safePersonUserId) { + this.safePersonUserId = safePersonUserId; + } + + public String getSafePersonUser() { + return safePersonUser; + } + + public void setSafePersonUser(String safePersonUser) { + this.safePersonUser = safePersonUser; + } + + public Long getSafePersonUserPhone() { + return safePersonUserPhone; + } + + public void setSafePersonUserPhone(Long safePersonUserPhone) { + this.safePersonUserPhone = safePersonUserPhone; + } + + public Long getDepId() { + return depId; + } + + public void setDepId(Long depId) { + this.depId = depId; + } + + public String getDep() { + return dep; + } + + public void setDep(String dep) { + this.dep = dep; + } + + public Long getAssessPersonId() { + return assessPersonId; + } + + public void setAssessPersonId(Long assessPersonId) { + this.assessPersonId = assessPersonId; + } + + public String getAssessPerson() { + return assessPerson; + } + + public void setAssessPerson(String assessPerson) { + this.assessPerson = assessPerson; + } + + public LocalDateTime getAssessTime() { + return assessTime; + } + + public void setAssessTime(LocalDateTime assessTime) { + this.assessTime = assessTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public String getExperimentDesc() { + return experimentDesc; + } + + public void setExperimentDesc(String experimentDesc) { + this.experimentDesc = experimentDesc; + } + + public String getExperimentRiskSource() { + return experimentRiskSource; + } + + public void setExperimentRiskSource(String experimentRiskSource) { + this.experimentRiskSource = experimentRiskSource; + } + + public String getSafeRiskAnalysis() { + return safeRiskAnalysis; + } + + public void setSafeRiskAnalysis(String safeRiskAnalysis) { + this.safeRiskAnalysis = safeRiskAnalysis; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public Byte getAssessLevel() { + return assessLevel; + } + + public void setAssessLevel(Byte assessLevel) { + this.assessLevel = assessLevel; + } + + public LocalDateTime getCreateTime() { + return createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public Long getUpdateByUserId() { + return updateByUserId; + } + + public void setUpdateByUserId(Long updateByUserId) { + this.updateByUserId = updateByUserId; + } + + public Long getCreateByUserId() { + return createByUserId; + } + + public void setCreateByUserId(Long createByUserId) { + this.createByUserId = createByUserId; + } + + public Byte getApprovePlanStatus() { + return approvePlanStatus; + } + + public void setApprovePlanStatus(Byte approvePlanStatus) { + this.approvePlanStatus = approvePlanStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskAssessPlanQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskAssessPlanQueryDTO.java new file mode 100644 index 0000000..3e2835b --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskAssessPlanQueryDTO.java @@ -0,0 +1,165 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * + */ +@Data +public class RiskAssessPlanQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险分析单元id + */ + private Long riskUnitId; + /** + * 风险分析单元id + */ + private String riskUnitName; + /** + * 评估计划名称 + */ + private String assessPlanName; + /** + * 风险来源:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 计划制定人 + */ + private Long planUserId; + /** + * 评估开始时间 + */ + private LocalDateTime assessStartTime; + /** + * 评估结束时间 + */ + private LocalDateTime assessEndTime; + /** + * 辨识时间 + */ + private LocalDateTime identificationTime; + /** + * 评价时间 + */ + private LocalDateTime evaluateTime; + /** + * 评估计划派发状态:1-未派发;2-已派发 + */ + private Byte planSellStatus; + /** + * 评估计划执行状态:1-未开始;2-辨识阶段;3-评价阶段;4-评价完成 + */ + private Byte planExecStatus; + /** + * 评估计划时间状态:1-未开始;2-评估中;3-已超期 + */ + private Byte planTimeStatus; + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法 + */ + private Byte identificationMethod; + /** + * 辨识专家 + */ + private String identificationUser; + /** + * 辨识专家id + */ + private Long identificationUserId; + /** + * 推荐评价方法:1-LEC;2-LS;3-MES;4-RS; + */ + private Byte evaluateMethod; + /** + * 评价专家id + */ + private Long evaluateUserId; + /** + * 评价专家 + */ + private String evaluateUser; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评估计划派发时间 + */ + private LocalDateTime planSellTime; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 计划制定人人姓名 + */ + private String planUserName; + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitDeleteDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitDeleteDTO.java new file mode 100644 index 0000000..7ee1808 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitDeleteDTO.java @@ -0,0 +1,72 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + + +import lombok.Data; + +import java.time.LocalDateTime; +@Data +public class RiskUnitDeleteDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 负责人 + */ + private String liabilityUser; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitInsertDTO.java new file mode 100644 index 0000000..edcbfb7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitInsertDTO.java @@ -0,0 +1,74 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 实验风险单元 + */ +@Data +public class RiskUnitInsertDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 基础风险单元id + */ + private Long basicRiskUnitId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 风险单元描述 + */ + private String desc; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitListAppQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitListAppQueryDTO.java new file mode 100644 index 0000000..fbacd6c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitListAppQueryDTO.java @@ -0,0 +1,33 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +@Data +public class RiskUnitListAppQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 风险单元描述 + */ + private String description; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + /** + * 风险单元类型 + */ + private String riskUnitType; +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitQueryDTO.java new file mode 100644 index 0000000..8aa20f0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RiskUnitQueryDTO.java @@ -0,0 +1,89 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class RiskUnitQueryDTO { + + private Long id; + /** + * 实验id + */ + private Long experimentId; + /** + * 风险单元编号 + */ + private String riskCode; + /** + * 风险单元名称 + */ + private String riskName; + /** + * 风险类型:1-固有风险;2-实验风险 + */ + private Byte riskType; + /** + * 评价状态:1-未评价;2-已评价 + */ + private Byte evaluateStatus; + /** + * 负责人id + */ + private Long liabilityUserId; + /** + * 负责人 + */ + private String liabilityUser; + /** + * 责任部门 + */ + private String liabilityDep; + /** + * 图片 + */ + private String image; + /** + * 风险单元描述 + */ + private String description; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 最后修改人 + */ + private Long updateByUserId; + /** + * 新建人 + */ + private Long createByUserId; + /** + * 最后修改人姓名 + */ + private String updateByUserName; + /** + * 新建人姓名 + */ + private String createByUserName; + /** + * 风险源风险类型:1-区域、实验场所;2-设施设备;3-固定工艺节点 + */ + private Byte riskSourceType; + /** + * 风险单元类型id + */ + private Long riskUnitTypeId; + /** + * 风险单元类型 + */ + private String riskUnitType; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RsInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RsInsertDTO.java new file mode 100644 index 0000000..11e3edb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RsInsertDTO.java @@ -0,0 +1,209 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import javax.persistence.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法RS + */ +@Entity +@Table(name = "risk_assess_plan_evaluate_rs") +public class RsInsertDTO implements Serializable { + private static final long serialVersionUID = 642761023880479465L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + /** + * 删除状态:1-正常;2-已删除 + */ + private Byte deleteStatus; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + public String getEvaluateDesc() { + return evaluateDesc; + } + + public void setEvaluateDesc(String evaluateDesc) { + this.evaluateDesc = evaluateDesc; + } + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + public BigDecimal getRiskValue() { + return riskValue; + } + + public void setRiskValue(BigDecimal riskValue) { + this.riskValue = riskValue; + } + + public Byte getRiskLevelValue() { + return riskLevelValue; + } + + public void setRiskLevelValue(Byte riskLevelValue) { + this.riskLevelValue = riskLevelValue; + } + + public Byte getRiskLevel() { + return riskLevel; + } + + public void setRiskLevel(Byte riskLevel) { + this.riskLevel = riskLevel; + } + + public Byte getRiskColor() { + return riskColor; + } + + public void setRiskColor(Byte riskColor) { + this.riskColor = riskColor; + } + + public Byte getManageLevel() { + return manageLevel; + } + + public void setManageLevel(Byte manageLevel) { + this.manageLevel = manageLevel; + } + + public Long getIdentificationId() { + return identificationId; + } + + public void setIdentificationId(Long identificationId) { + this.identificationId = identificationId; + } + + public Byte getIdentificationMethod() { + return identificationMethod; + } + + public void setIdentificationMethod(Byte identificationMethod) { + this.identificationMethod = identificationMethod; + } + public LocalDateTime getCreateTime() { + return createTime; + } + + public void setCreateTime(LocalDateTime createTime) { + this.createTime = createTime; + } + + public LocalDateTime getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(LocalDateTime updateTime) { + this.updateTime = updateTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public BigDecimal getRsR() { + return rsR; + } + + public void setRsR(BigDecimal rsR) { + this.rsR = rsR; + } + + public BigDecimal getRsS() { + return rsS; + } + + public void setRsS(BigDecimal rsS) { + this.rsS = rsS; + } + + public Byte getDeleteStatus() { + return deleteStatus; + } + + public void setDeleteStatus(Byte deleteStatus) { + this.deleteStatus = deleteStatus; + } +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RsQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RsQueryDTO.java new file mode 100644 index 0000000..7ab1269 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/RsQueryDTO.java @@ -0,0 +1,147 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 评价方法RS + */ +@Data +public class RsQueryDTO{ + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * RS_R的数值(评价) + */ + private BigDecimal rsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal rsS; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + /** + * 安全风险分析 + */ + private String safeRiskAnalysis; + /** + * 辨识方法id + */ + private Long identificationId; + /** + * 辨识方法类型 + */ + private Byte identificationMethod; + /** + * 风险数值 + */ + private BigDecimal riskValue; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte riskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte riskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte riskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte manageLevel; + /** + * 评价状态:0-未评价过;1-已编写评价 + */ + private Byte status; + /** + * 评价专家意见 + */ + private String evaluateDesc; + + + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + + /** + * 风险数值 + */ + private BigDecimal originalRiskValue; + /** + * RS_R的数值(评价) + */ + private BigDecimal originalRsR; + /** + * RS_S的数值(评价) + */ + private BigDecimal originalRsS; + /** + * 风险等级值:风险值区间级别,1-1级,2-2级,3-3级,4-4级,5-5级 + */ + private Byte originalRiskLevelValue; + /** + * 风险级别:1-低,2-一般,3-较大,4-重大 + */ + private Byte originalRiskLevel; + /** + * 风险色:1-蓝色;2-黄色;3-橙色;4-红色 + */ + private Byte originalRiskColor; + /** + * 管理层级:1-院所级;2-部门级;3-项目组级 + */ + private Byte originalManageLevel; + /** + * 技术措施 + */ + private String adviseTechnologyMeasure; + /** + * 管理措施 + */ + private String adviseManageMeasure; + /** + * 教育措施 + */ + private String adviseEducationMeasure; + /** + * 个体防护措施 + */ + private String advisePersonalProtectionMeasure; + /** + * 应急措施 + */ + private String adviseEmergencyMeasure; +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/SclInsertDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/SclInsertDTO.java new file mode 100644 index 0000000..f5056ec --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/SclInsertDTO.java @@ -0,0 +1,156 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +public class SclInsertDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + /** + * 技术措施 + */ + private String technologyMeasure; + /** + * 管理措施 + */ + private String manageMeasure; + /** + * 教育措施 + */ + private String educationMeasure; + /** + * 个体防护措施 + */ + private String personalProtectionMeasure; + /** + * 应急措施 + */ + private String emergencyMeasure; + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + + public String getIdentificationDesc() { + return identificationDesc; + } + + public void setIdentificationDesc(String identificationDesc) { + this.identificationDesc = identificationDesc; + } + public Byte getResult() { + return result; + } + + public void setResult(Byte result) { + this.result = result; + } + public String getTechnologyMeasure() { + return technologyMeasure; + } + + public void setTechnologyMeasure(String technologyMeasure) { + this.technologyMeasure = technologyMeasure; + } + + public String getManageMeasure() { + return manageMeasure; + } + + public void setManageMeasure(String manageMeasure) { + this.manageMeasure = manageMeasure; + } + + public String getEducationMeasure() { + return educationMeasure; + } + + public void setEducationMeasure(String educationMeasure) { + this.educationMeasure = educationMeasure; + } + + public String getPersonalProtectionMeasure() { + return personalProtectionMeasure; + } + + public void setPersonalProtectionMeasure(String personalProtectionMeasure) { + this.personalProtectionMeasure = personalProtectionMeasure; + } + + public String getEmergencyMeasure() { + return emergencyMeasure; + } + + public void setEmergencyMeasure(String emergencyMeasure) { + this.emergencyMeasure = emergencyMeasure; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getAssessPlanId() { + return assessPlanId; + } + + public void setAssessPlanId(Long assessPlanId) { + this.assessPlanId = assessPlanId; + } + + public String getSclCheckItem() { + return sclCheckItem; + } + + public void setSclCheckItem(String sclCheckItem) { + this.sclCheckItem = sclCheckItem; + } + + public String getSclCheckStandard() { + return sclCheckStandard; + } + + public void setSclCheckStandard(String sclCheckStandard) { + this.sclCheckStandard = sclCheckStandard; + } + + public String getSclCheckUnstandard() { + return sclCheckUnstandard; + } + + public void setSclCheckUnstandard(String sclCheckUnstandard) { + this.sclCheckUnstandard = sclCheckUnstandard; + } + + public String getSclCheckResult() { + return sclCheckResult; + } + + public void setSclCheckResult(String sclCheckResult) { + this.sclCheckResult = sclCheckResult; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/SclQueryDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/SclQueryDTO.java new file mode 100644 index 0000000..02e2d3a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/model/dto/SclQueryDTO.java @@ -0,0 +1,49 @@ +package com.gkhy.labRiskManage.domain.riskReport.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class SclQueryDTO { + + private Long id; + /** + * 风险评估计划id + */ + private Long assessPlanId; + /** + * SCL_检查项目(辨识) + */ + private String sclCheckItem; + /** + * SCL_检查标准(辨识) + */ + private String sclCheckStandard; + /** + * SCL_不符合标准情况(辨识) + */ + private String sclCheckUnstandard; + /** + * SCL_主要后果(辨识) + */ + private String sclCheckResult; + + /** + * 辨识结果:1-有风险;2-无风险; + */ + private Byte result; + /** + * 辨识专家意见 + */ + private String identificationDesc; + /** + * 新建时间 + */ + private LocalDateTime createTime; + /** + * 修改时间 + */ + private LocalDateTime updateTime; + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentRiskSourceRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentRiskSourceRepository.java new file mode 100644 index 0000000..2711efb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentRiskSourceRepository.java @@ -0,0 +1,29 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentRiskSource; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +@Repository +public interface ReportExperimentRiskSourceRepository extends JpaRepository<ReportExperimentRiskSource, Long>, JpaSpecificationExecutor<ReportExperimentRiskSource> { + + /** + * 查询 + */ + @Query(value = "select t from ReportExperimentRiskSource t where t.id = :id and t.deleteStatus = 0") + ReportExperimentRiskSource getRiskSourceById(Long id); + /** + * 查询 + */ + @Query(value = "select t from ReportExperimentRiskSource t where t.reportId = :id and t.deleteStatus = 0") + List<ReportExperimentRiskSource> getRiskSourceByReportId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentRiskSourceTypeRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentRiskSourceTypeRepository.java new file mode 100644 index 0000000..5b21a25 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentRiskSourceTypeRepository.java @@ -0,0 +1,27 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentRiskSourceType; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +@Repository +public interface ReportExperimentRiskSourceTypeRepository extends JpaRepository<ReportExperimentRiskSourceType, Long>, JpaSpecificationExecutor<ReportExperimentRiskSourceType> { + + /** + * 风险评估报告-评估专家 - 查询 + */ + @Query(value = "select t from ReportExperimentRiskSourceType t where t.id = :id and t.deleteStatus = 0") + ReportExperimentRiskSourceType getTypeById(Long id); + + @Query(value = "select t from ReportExperimentRiskSourceType t where t.reportId = :id and t.deleteStatus = 0") + List<ReportExperimentRiskSourceType> getSourceTypeByReportId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentSiteRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentSiteRepository.java new file mode 100644 index 0000000..76eecd0 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportExperimentSiteRepository.java @@ -0,0 +1,16 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentSite; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface ReportExperimentSiteRepository extends JpaRepository<ReportExperimentSite, Long>, JpaSpecificationExecutor<ReportExperimentSite> { + + @Query(value = "select t from ReportExperimentSite t where t.reportId = :id and t.deleteStatus = 0") + List<ReportExperimentSite> getSiteByReportId(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportRiskAssessInfoRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportRiskAssessInfoRepository.java new file mode 100644 index 0000000..ff699af --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportRiskAssessInfoRepository.java @@ -0,0 +1,38 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportRiskAssessInfo; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportDTO; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 风险评估报告 + */ +@Repository +public interface ReportRiskAssessInfoRepository extends JpaRepository<ReportRiskAssessInfo, Long>, JpaSpecificationExecutor<ReportRiskAssessInfo> { + + /** + * 风险评估报告 - 查询 by id + */ + @Query(value = "select t from ReportRiskAssessInfo t where t.id = :id and t.deleteStatus = 0") + ReportRiskAssessInfo getReportById(Long id); + /** + * 风险评估报告 - 报告结束 + */ + @Query(value = "update ReportRiskAssessInfo set approve_plan_status = :reportDTO.approvePlanStatus where id = :reportId" , nativeQuery = true) + ReportRiskAssessInfo report(ReportDTO reportDTO); + /** + * 风险评估报告 - 通过id列表查询 + */ + @Query(value = "select t from ReportRiskAssessInfo t where t.id in (?1) and t.deleteStatus = 0") + List<ReportRiskAssessInfo> listRiskReport(List<Long> idList); + + @Query(value = "select t from ReportRiskAssessInfo t where t.experimentId = :id and t.deleteStatus = 0") + ReportRiskAssessInfo getByExperimentId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportRiskAssessPersonRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportRiskAssessPersonRepository.java new file mode 100644 index 0000000..7add441 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/ReportRiskAssessPersonRepository.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportRiskAssessPerson; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * 风险评估报告-评估专家 + */ +@Repository +public interface ReportRiskAssessPersonRepository extends JpaRepository<ReportRiskAssessPerson, Long>, JpaSpecificationExecutor<ReportRiskAssessPerson> { + + /** + * 风险评估报告-评估专家 - 查询 + */ + @Query(value = "select t from ReportRiskAssessPerson t where t.id = :id and t.deleteStatus = 0") + ReportRiskAssessPerson getPersonById(Long id); + /** + * 风险评估报告-评估专家 - list + */ + @Query(value = "select t from ReportRiskAssessPerson t where t.reportId = :reportId and t.deleteStatus = 0") + List<ReportRiskAssessPerson> getPersonByReportId(Long reportId); + +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateLecRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateLecRepository.java new file mode 100644 index 0000000..18a3237 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateLecRepository.java @@ -0,0 +1,48 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLec; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价方法LEC + */ +@Repository +public interface RiskAssessPlanEvaluateLecRepository extends JpaRepository<RiskAssessPlanEvaluateLec, Long>, JpaSpecificationExecutor<RiskAssessPlanEvaluateLec> { + + /** + * 评价方法LEC 查询 - by id + */ + @Query(value = "select t from RiskAssessPlanEvaluateLec t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlanEvaluateLec getLecById(Long id); + /** + * 评价方法LEC 删除 - by id + */ + @Query(value = "update RiskAssessPlanEvaluateLec set delete_status = 1 where id = :id and delete_status = 0", nativeQuery = true) + RiskAssessPlanEvaluateLec deleteLecByPlanId(Long id); + /** + * 评价方法LEC 查询 by 辨识方法 + */ + @Query(value = "select t from RiskAssessPlanEvaluateLec t where t.identificationId = :identificationId and t.identificationMethod = :identificationMethod and t.deleteStatus = 0") + RiskAssessPlanEvaluateLec getLecByIdentification(Long identificationId, Byte identificationMethod); + /** + * 评价方法LEC - list + */ + @Query(value = "select t from RiskAssessPlanEvaluateLec t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateLec> listLecByPlanId(Long id); + +// select t from BasicRiskUnit t where t.id in (?1) and t.deleteStatus = 0 + @Query(value = "select t from RiskAssessPlanEvaluateLec t where t.assessPlanId in(?1) and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateLec> getLecByIds(List<Long> assessPlanIds); + + @Query(value = "select t from RiskAssessPlanEvaluateLec t where t.assessPlanId = :assessPlanId and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateLec> getbyByAssessPlanId(Long assessPlanId); + + @Query(value = "select t from RiskAssessPlanEvaluateLec t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateLec> getLecByPlanId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateLsRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateLsRepository.java new file mode 100644 index 0000000..596b8bb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateLsRepository.java @@ -0,0 +1,47 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLs; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价方法LS + */ +@Repository +public interface RiskAssessPlanEvaluateLsRepository extends JpaRepository<RiskAssessPlanEvaluateLs, Long>, JpaSpecificationExecutor<RiskAssessPlanEvaluateLs> { + + /** + * 评价方法LS 查询 - by id + */ + @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlanEvaluateLs getLsById(Long id); + /** + * 评价方法LS 删除 - by id + */ + @Query(value = "update RiskAssessPlanEvaluateLs set delete_status = 1 where id = :id and delete_status = 0", nativeQuery = true) + RiskAssessPlanEvaluateLs deleteLecByPlanId(Long id); + /** + * 评价方法LS - 查询 by 辨识方法 + */ + @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.identificationId = :identificationId and t.identificationMethod = :identificationMethod and t.deleteStatus = 0") + RiskAssessPlanEvaluateLs getLsByIdentification(Long identificationId, Byte identificationMethod); + /** + * 评价方法LS - list + */ + @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateLs> listLsByPlanId(Long id); + + @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId in(?1) and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateLs> getLsByIds(List<Long> assessPlanIds); + + @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId = :assessPlanId and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateLs> getLsByAssessPlanId(Long assessPlanId); + + @Query(value = "select t from RiskAssessPlanEvaluateLs t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateLs> getLsByPlanId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateMesRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateMesRepository.java new file mode 100644 index 0000000..05825d6 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateMesRepository.java @@ -0,0 +1,47 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateMes; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价方法MES + */ +@Repository +public interface RiskAssessPlanEvaluateMesRepository extends JpaRepository<RiskAssessPlanEvaluateMes, Long>, JpaSpecificationExecutor<RiskAssessPlanEvaluateMes> { + + /** + * 评价方法MES - 查询 by id + */ + @Query(value = "select t from RiskAssessPlanEvaluateMes t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlanEvaluateMes getMesById(Long id); + /** + * 评价方法MES 删除 - by id + */ + @Query(value = "update RiskAssessPlanEvaluateMes set delete_status = 1 where id = :id and delete_status = 0", nativeQuery = true) + RiskAssessPlanEvaluateMes deleteMesByPlanId(Long id); + /** + * 评价方法MES - 查询 by 辨识方法 + */ + @Query(value = "select t from RiskAssessPlanEvaluateMes t where t.identificationId = :identificationId and t.identificationMethod = :identificationMethod and t.deleteStatus = 0") + RiskAssessPlanEvaluateMes getMesByIdentification(Long identificationId, Byte identificationMethod); + /** + * 评价方法MES - list + */ + @Query(value = "select t from RiskAssessPlanEvaluateMes t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateMes> listMesByPlanId(Long id); + + @Query(value = "select t from RiskAssessPlanEvaluateMes t where t.assessPlanId in(?1) and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateMes> getMesByIds(List<Long> assessPlanIds); + + @Query(value = "select t from RiskAssessPlanEvaluateMes t where t.assessPlanId = :assessPlanId and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateMes> getMesByAssessPlanId(Long assessPlanId); + + @Query(value = "select t from RiskAssessPlanEvaluateMes t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateMes> getMesByPlanId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateRsRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateRsRepository.java new file mode 100644 index 0000000..c0f991f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanEvaluateRsRepository.java @@ -0,0 +1,47 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateRs; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 评价方法RS + */ +@Repository +public interface RiskAssessPlanEvaluateRsRepository extends JpaRepository<RiskAssessPlanEvaluateRs, Long>, JpaSpecificationExecutor<RiskAssessPlanEvaluateRs> { + + /** + * 评价方法MES - 查询 by id + */ + @Query(value = "select t from RiskAssessPlanEvaluateRs t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlanEvaluateRs getRsById(Long id); + /** + * 评价方法MES 删除 - by id + */ + @Query(value = "update RiskAssessPlanEvaluateRs set delete_status = 1 where id = :id and delete_status = 0", nativeQuery = true) + RiskAssessPlanEvaluateRs deleteMesByPlanId(Long id); + /** + * 评价方法LEC 查询 by 辨识方法 + */ + @Query(value = "select t from RiskAssessPlanEvaluateRs t where t.identificationId = :identificationId and t.identificationMethod = :identificationMethod and t.deleteStatus = 0") + RiskAssessPlanEvaluateRs getRsByIdentification(Long identificationId, Byte identificationMethod); + /** + * 评价方法RS - list + */ + @Query(value = "select t from RiskAssessPlanEvaluateRs t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateRs> listRsByPlanId(Long id); + + @Query(value = "select t from RiskAssessPlanEvaluateRs t where t.assessPlanId in(?1) and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateRs> getRsByIds(List<Long> assessPlanIds); + + @Query(value = "select t from RiskAssessPlanEvaluateRs t where t.assessPlanId = :assessPlanId and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateRs> geByAssessPlanId(Long assessPlanId); + + @Query(value = "select t from RiskAssessPlanEvaluateRs t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanEvaluateRs> getRsByPlanId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationAnalogyRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationAnalogyRepository.java new file mode 100644 index 0000000..4b38b80 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationAnalogyRepository.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationAnalogy; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-类比法(Analogy) + */ +@Repository +public interface RiskAssessPlanIdentificationAnalogyRepository extends JpaRepository<RiskAssessPlanIdentificationAnalogy, Long>, JpaSpecificationExecutor<RiskAssessPlanIdentificationAnalogy> { + + /** + * 辨识方法-类比法 - 查询 by id + */ + @Query(value = "select t from RiskAssessPlanIdentificationAnalogy t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlanIdentificationAnalogy getAnalogyById(Long id); + /** + * 辨识方法-类比法 - 查询 by id + */ + @Query(value = "update RiskAssessPlanIdentificationAnalogy set delete_status = 1,update_time = :date where id = :id and delete_status = 0", nativeQuery = true) + RiskAssessPlanIdentificationAnalogy deleteAnalogyByPlanId(Long id, LocalDateTime date); + /** + * 辨识方法-类比法(Analogy) - list + */ + @Query(value = "select t from RiskAssessPlanIdentificationAnalogy t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanIdentificationAnalogy> listAnalogyByPlanId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationHazopRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationHazopRepository.java new file mode 100644 index 0000000..d4f96f7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationHazopRepository.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationHazop; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-Hazop + */ +@Repository +public interface RiskAssessPlanIdentificationHazopRepository extends JpaRepository<RiskAssessPlanIdentificationHazop, Long>, JpaSpecificationExecutor<RiskAssessPlanIdentificationHazop> { + + /** + * 辨识方法-Hazop - 查询 by id + */ + @Query(value = "select t from RiskAssessPlanIdentificationHazop t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlanIdentificationHazop getHazopById(Long id); + /** + * 辨识方法-Jha -- 删除 + */ + @Query(value = "update RiskAssessPlanIdentificationHazop set delete_status = 1,update_time = :date where id = :id and delete_status = 0", nativeQuery = true) + RiskAssessPlanIdentificationHazop deleteSclByPlanId(Long id, LocalDateTime date); + /** + * 辨识方法-Hazop - list + */ + @Query(value = "select t from RiskAssessPlanIdentificationHazop t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanIdentificationHazop> listHazopByPlanId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationJhaRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationJhaRepository.java new file mode 100644 index 0000000..1682342 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationJhaRepository.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationJha; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-Jha + */ +@Repository +public interface RiskAssessPlanIdentificationJhaRepository extends JpaRepository<RiskAssessPlanIdentificationJha, Long>, JpaSpecificationExecutor<RiskAssessPlanIdentificationJha> { + + /** + * 辨识方法-Jha - 查询 by id + */ + @Query(value = "select t from RiskAssessPlanIdentificationJha t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlanIdentificationJha getJhaById(Long id); + /** + * 辨识方法-Jha -- 删除 + */ + @Query(value = "update RiskAssessPlanIdentificationJha set delete_status = 1,update_time = :date where id = :id and delete_status = 0", nativeQuery = true) + RiskAssessPlanIdentificationJha deleteJhaByPlanId(Long id, LocalDateTime date); + /** + * 辨识方法-Jha -- list + */ + @Query(value = "select t from RiskAssessPlanIdentificationJha t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanIdentificationJha> listJhaByPlanId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationPhaRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationPhaRepository.java new file mode 100644 index 0000000..0445b2c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationPhaRepository.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationPha; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-Pha + */ +@Repository +public interface RiskAssessPlanIdentificationPhaRepository extends JpaRepository<RiskAssessPlanIdentificationPha, Long>, JpaSpecificationExecutor<RiskAssessPlanIdentificationPha> { + + /** + * 辨识方法 - 查询 by id + */ + @Query(value = "select t from RiskAssessPlanIdentificationPha t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlanIdentificationPha getPhaById(Long id); + /** + * 辨识方法 - 删除 + */ + @Query(value = "update RiskAssessPlanIdentificationPha set delete_status = 1,update_time = :date where id = :id and delete_status = 0", nativeQuery = true) + RiskAssessPlanIdentificationPha deletePhaByPlanId(Long id, LocalDateTime date); + /** + * 辨识方法-Pha - list + */ + @Query(value = "select t from RiskAssessPlanIdentificationPha t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanIdentificationPha> listPhaByPlanId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationSclRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationSclRepository.java new file mode 100644 index 0000000..6868175 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanIdentificationSclRepository.java @@ -0,0 +1,34 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationScl; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-Scl + */ +@Repository +public interface RiskAssessPlanIdentificationSclRepository extends JpaRepository<RiskAssessPlanIdentificationScl, Long>, JpaSpecificationExecutor<RiskAssessPlanIdentificationScl> { + + /** + * 辨识方法-Scl - 查询 by id + */ + @Query(value = "select t from RiskAssessPlanIdentificationScl t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlanIdentificationScl getSclById(Long id); + /** + * 辨识方法-Scl -- 删除 + */ + @Query(value = "update RiskAssessPlanIdentificationScl set delete_status = 1,update_time = :date where id = :id and delete_status = 0", nativeQuery = true) + RiskAssessPlanIdentificationScl deleteSclByPlanId(Long id, LocalDateTime date); + /** + * 辨识方法-Scl - list + */ + @Query(value = "select t from RiskAssessPlanIdentificationScl t where t.assessPlanId = :id and t.deleteStatus = 0") + List<RiskAssessPlanIdentificationScl> listSclByPlanId(Long id); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanRepository.java new file mode 100644 index 0000000..c6acd34 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskAssessPlanRepository.java @@ -0,0 +1,67 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlan; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.ExecStatusSubmitBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.AssessPlanQueryDTO; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +/** + * 风险评估-评估项 + */ +@Repository +public interface RiskAssessPlanRepository extends JpaRepository<RiskAssessPlan, Long>, JpaSpecificationExecutor<RiskAssessPlan> { + + /** + * 风险评估计划-查询 by name + */ + @Query(value = "select t from RiskAssessPlan t where t.assessPlanName = :assessPlanName and t.deleteStatus = 0") + RiskAssessPlan getAssessPlanByName(String assessPlanName); + /** + * 风险评估计划-查询 by id + */ + @Query(value = "select t from RiskAssessPlan t where t.id = :id and t.deleteStatus = 0") + RiskAssessPlan getAssessPlanById(Long id); + /** + * 风险评估计划-提交 辨识-评价 结果 --弃用 + */ + @Query(value = "update RiskAssessPlan set plan_exec_status = :#{#execStatusSubmitBO.ExecStatus} where id = :#{#execStatusSubmitBO.id}", nativeQuery = true) + RiskAssessPlan execStatusSubmit(ExecStatusSubmitBO execStatusSubmitBO); + /** + * 风险评估计划- 辨识删除 --弃用 + */ + @Query(value = "update RiskAssessPlan set identification_time = :#date where id = :id", nativeQuery = true) + RiskAssessPlan deleteIdentification(Long id, LocalDateTime date); + /** + * 风险评估计划- 评价删除 --弃用 + */ + @Query(value = "update RiskAssessPlan set evaluate_time = :date where id = :id", nativeQuery = true) + RiskAssessPlan deleteEvaluate(Long id, LocalDateTime date); + /** + * 风险评估计划 - 查询 by 实验id + */ + @Query(value = "select t from RiskAssessPlan t where t.experimentId = :experimentId and t.deleteStatus = 0") + List<RiskAssessPlan> getAssessPlanByExperimentId(Long experimentId); + + @Query(value = "select t from RiskAssessPlan t where t.riskUnitId = :riskUnitId and t.deleteStatus = 0") + List<RiskAssessPlan> getAssessPlanByUnitId(Long riskUnitId); + + /** + * 评估计划 - 查询已派发 + */ + @Query(value = "select t from RiskAssessPlan t where t.planSellStatus = :status and t.deleteStatus = 0") + List<RiskAssessPlan> listAssessPlan(Byte status); + + @Query(value = "select t from RiskAssessPlan t where t.deleteStatus = 0 and (t.identificationUserId = :currentUserId or t.evaluateUserId = :currentUserId)") + List<RiskAssessPlan> getAssessPlanBySpecialist(Long currentUserId); + + @Query(value = "select t from RiskAssessPlan t where t.deleteStatus = 0 and t.riskUnitId = :basicId and riskType = 1") + List<RiskAssessPlan> getAssessPlanByInherentUnit(Long basicId); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskUnitRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskUnitRepository.java new file mode 100644 index 0000000..42623fd --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/repository/jpa/RiskUnitRepository.java @@ -0,0 +1,68 @@ +package com.gkhy.labRiskManage.domain.riskReport.repository.jpa; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskUnitListReqBO; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskUnit; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * 实验风险单元 + */ +@Repository +public interface RiskUnitRepository extends JpaRepository<RiskUnit, Long>, JpaSpecificationExecutor<RiskUnit> { + + /** + * 实验风险单元 - 查询 by code + */ + @Query(value = "select t from RiskUnit t where t.riskCode = :riskCode and t.deleteStatus = 0") + RiskUnit getUnitByCode(String riskCode); + /** + * 风险单元 - 查询 by id + */ + @Query(value = "select t from RiskUnit t where t.id = :id and t.deleteStatus = 0") + RiskUnit getUnitById(Long id); + /** + * 风险单元 - 查询by name + */ + @Query(value = "select * from risk_unit where risk_name = :riskUnitName and delete_status = 0",nativeQuery = true) + List<RiskUnit> getRiskUnitByName(String riskUnitName); + /** + * 基础风险单元管理 - 列表查询 + */ + @Query(value = "select * from risk_unit where delete_status = 0 and evaluate_status = 1",nativeQuery = true) + List<RiskUnit> listRiskUnit(); + /** + * 基础风险单元管理 - 列表查询 + */ + @Query(value = "select * from risk_unit where create_by_user_id = :currentUserId and delete_status = 0 and evaluate_status = 1",nativeQuery = true) + List<RiskUnit> listRiskUnitByUserId(Long currentUserId); + + /** + * 基础风险单元管理 - 已添加评估计划的unit + */ + @Query(value = "select * from risk_unit where delete_status = 0",nativeQuery = true) + List<RiskUnit> listAssessRiskUnit(); + + + @Query(value = "select * from risk_unit where delete_status = 0 and experiment_id = :id",nativeQuery = true) + List<RiskUnit> getRiskUnitByExperimentId(Long id); + + @Query(value = "select * from risk_unit where delete_status = 0 and risk_source_type < 4",nativeQuery = true) + List<RiskUnit> listInherentRiskUnit(); + /** + * 基础风险单元管理 - 列表查询 + */ + @Query(value = "select * from risk_unit where delete_status = 0 and evaluate_status = 1 and experiment_id = :#{#reqBO.ExperimentId}",nativeQuery = true) + List<RiskUnit> listRiskUnitByExperiment(RiskUnitListReqBO reqBO); + /** + * 基础风险单元管理 - 列表查询 + */ + @Query(value = "select * from risk_unit where create_by_user_id = :currentUserId and delete_status = 0 and evaluate_status = 1 and experiment_id = :#{#reqBO.ExperimentId}",nativeQuery = true) + List<RiskUnit> listRiskUnitByExperimentAndUserId(Long currentUserId, RiskUnitListReqBO reqBO); +} + diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentRiskSourceService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentRiskSourceService.java new file mode 100644 index 0000000..5cf6d76 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentRiskSourceService.java @@ -0,0 +1,30 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportRiskSourceQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportSourceAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportSourceAppUpdateBO; +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentRiskSource; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportRiskSourceDTO; + +import java.util.List; + +/** + * 风险评估报告-实验可能有的危险源或危险因素 + */ +public interface ReportExperimentRiskSourceService { + + /** + * 风险评估报告-危险因素 - 插入 + */ + List<ReportRiskSourceDTO> insertReportSource(Long currentUserId, List<ReportSourceAppInsertBO> riskSourceInsertBO); + /** + * 风险评估报告-危险因素 - 修改 + */ + List<ReportRiskSourceDTO> updateReportSource(Long currentUserId, List<ReportSourceAppUpdateBO> riskSourceUpdateBO); + /** + * 风险评估报告-危险因素 - 查询by 报告id + */ + List<ReportRiskSourceQueryRespDTO> getRiskSourceByReportId(Long id); + + List<ReportExperimentRiskSource> insertAllReportSource(List<ReportExperimentRiskSource> riskSourceList); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentRiskSourceTypeService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentRiskSourceTypeService.java new file mode 100644 index 0000000..5627feb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentRiskSourceTypeService.java @@ -0,0 +1,32 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportSourceTypeQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportSourceTypeAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportSourceTypeAppUpdateBO; +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentRiskSourceType; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportSourceTypeInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportSourceTypeQueryDTO; + +import java.util.List; + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +public interface ReportExperimentRiskSourceTypeService { + + /** + * 危险因素类型 - 插入 + */ + List<ReportSourceTypeInsertDTO> insertReportSourceType(Long currentUserId, List<ReportSourceTypeAppInsertBO> reportSourceTypeInsertBO); + /** + * 危险因素类型 - 修改 + */ + List<ReportSourceTypeInsertDTO> updateReportSourceType(Long currentUserId, List<ReportSourceTypeAppUpdateBO> reportSourceTypeUpdateBO); + /** + * 危险因素类型 - 查询 by 报告id + */ + List<ReportSourceTypeQueryRespDTO> getSourceTypeByReportId(Long id); + + List<ReportExperimentRiskSourceType> insertAllReportSource(List<ReportExperimentRiskSourceType> riskSourceTypeList); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentSiteService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentSiteService.java new file mode 100644 index 0000000..c230f11 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportExperimentSiteService.java @@ -0,0 +1,11 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentSite; + +import java.util.List; + +public interface ReportExperimentSiteService { + List<ReportExperimentSite> insertAll(List<ReportExperimentSite> reportSiteList); + + List<ReportExperimentSite> getSiteByReportId(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportRiskAssessInfoService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportRiskAssessInfoService.java new file mode 100644 index 0000000..98336dd --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportRiskAssessInfoService.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportReqBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportAppQueryBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportAppUpdateBO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.ReportAppQueryDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportRiskAssessInfo; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportUpdateDTO; + +import java.util.List; + +/** + * 风险评估报告 + */ +public interface ReportRiskAssessInfoService { + + /** + * 风险评估报告 - 查询 + */ + SearchResult<ReportAppQueryDTO> selectRiskReportPage(Long currentUserId, ReportAppQueryBO queryParam); + /** + * 风险评估报告 - 生成报告信息 + */ + ReportInsertDTO insertRiskReport(Long currentUserId,Long id); + /** + * 风险评估报告 - 填报信息 + */ + ReportUpdateDTO updateReportInfo(Long currentUserId,ReportAppUpdateBO reportUpdateBO); + + /** + * 风险评估报告 - 填报信息 + */ + ReportUpdateDTO updateReportInfoById(Long currentUserId,ReportAppUpdateBO reportUpdateBO); + /** + * 风险评估报告 - 报告审核 - 旧 - 两层审核 + */ + int report(Long currentUserId,ReportReqBO reportReqBO); + /** + * 风险评估报告 - 报告审核 - 新 - 单次审核 + */ + int reportNew(Long currentUserId, ReportReqBO reportReqBO); + + /** + * 风险评估报告 - list + */ + List<ReportAppQueryDTO> listRiskReport(List<Long> idList); + + ReportRiskAssessInfo getByExperimentId(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportRiskAssessPersonService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportRiskAssessPersonService.java new file mode 100644 index 0000000..babc529 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/ReportRiskAssessPersonService.java @@ -0,0 +1,44 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportPersonQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportPersonAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportPersonAppUpdateBO; +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportRiskAssessPerson; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportPersonInsertDTO; + +import java.util.List; + +/** + * 风险评估报告-评估专家 + */ +public interface ReportRiskAssessPersonService { + + /** + * 风险评估报告-评估专家 - 插入 + */ + List<ReportPersonInsertDTO> insertReportPerson(Long currentUserId, List<ReportPersonAppInsertBO> personInsertBO); + /** + * 风险评估报告-评估专家 - 修改 + */ + List<ReportPersonInsertDTO> updateReportPerson(Long currentUserId, List<ReportPersonAppUpdateBO> personUpdateBO); + /** + * 风险评估报告-评估专家 - 查询 + */ + ReportPersonInsertDTO getPersonById(Long id); + /** + * 风险评估报告-评估专家 - list + */ + List<ReportPersonInsertDTO> getPersonByReportId(Long reportId); + /** + * 风险评估报告-评估专家 - 审核 + */ + ReportPersonInsertDTO report(Long currentUserId, ReportReqBO reportReqBO); + /** + * 风险评估报告-评估专家 + */ + List<ReportPersonQueryRespDTO> listPersonByReportId(Long id); + + ReportRiskAssessPerson insertOneReportPerson(ReportRiskAssessPerson approvePerson); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateLecService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateLecService.java new file mode 100644 index 0000000..7928eee --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateLecService.java @@ -0,0 +1,46 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskAssessPlanEvaluateDeleteReqBO; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLec; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessLecInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.LecInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.LecQueryDTO; + +import java.util.List; + +/** + * 评价方法LEC + */ +public interface RiskAssessPlanEvaluateLecService { + + /** + * 评价方法LEC - 评价插入 + */ + LecInsertDTO insertLec(Long currentUserId, AssessLecInsertBO lecInsertBO); + /** + * 评价方法LEC - 修改 + */ + LecInsertDTO updateLec(Long currentUserId, AssessLecInsertBO lecInsertBO); + /** + * 评价方法LEC - 查询 + */ + LecQueryDTO getLecByPlanId(Long id); + /** + * 评价方法LEC - 删除 + */ + EvaluateMethodDeleteDTO deleteLecByPlanId(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO); + /** + * 评价方法LEC - list + */ + List<LecQueryDTO> listLecByPlanId(Long id); + + List<RiskAssessPlanEvaluateLec> getLecByIds(List<Long> assessPlanIds); + + int deleteLecByAssessPlanId(Long id); + + int deleteLecByPlan(Long id); + + RiskAssessPlanEvaluateLec getLecByIdentificationId(Long identificationId , Byte identificationMethod); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateLsService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateLsService.java new file mode 100644 index 0000000..eb397de --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateLsService.java @@ -0,0 +1,43 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskAssessPlanEvaluateDeleteReqBO; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLs; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessLSInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; + +import java.util.List; + +/** + * 评价方法LS + */ +public interface RiskAssessPlanEvaluateLsService { + + /** + * 评价方法LS - 插入 + */ + LsInsertDTO insertLs(Long currentUserId, AssessLSInsertBO lsInsertBO); + /** + * 评价方法LS - 修改 + */ + LecInsertDTO updateLs(Long currentUserId, AssessLSInsertBO lsInsertBO); + /** + * 评价方法LS - 查询 + */ + LsQueryDTO getLsByPlanId(Long id); + /** + * 评价方法LS - 删除 + */ + EvaluateMethodDeleteDTO deleteLsByPlanId(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO); + /** + * 评价方法LS - list + */ + List<LsQueryDTO> listLsByPlanId(Long id); + + List<RiskAssessPlanEvaluateLs> getLsByIds(List<Long> assessPlanIds); + + int deleteLsByAssessPlanId(Long id); + + int deleteLsByPlan(Long id); + + RiskAssessPlanEvaluateLs getLsByIdentificationId(Long id, Byte identificationMethod); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateMesService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateMesService.java new file mode 100644 index 0000000..a744661 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateMesService.java @@ -0,0 +1,47 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskAssessPlanEvaluateDeleteReqBO; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateMes; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessMesInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.MesInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.MesQueryDTO; + +import java.util.List; + +/** + * 评价方法MES + */ +public interface RiskAssessPlanEvaluateMesService { + + /** + * 评价方法MES - 插入 + */ + MesInsertDTO InsertMes(Long currentUserId, AssessMesInsertBO mesInsertBO); + /** + * 评价方法MES - 修改 + */ + MesInsertDTO updateMes(Long currentUserId, AssessMesInsertBO mesInsertBO); + /** + * 评价方法MES - 查询 + */ + MesQueryDTO getMesByPlanId(Long id); + /** + * 评价方法MES - 删除 + */ + EvaluateMethodDeleteDTO deleteMesByPlanId(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO); + /** + * 评价方法MES - list + */ + List<MesQueryDTO> listMesByPlanId(Long id); + + List<RiskAssessPlanEvaluateMes> getMesByIds(List<Long> assessPlanIds); + + int deleteMesByAssessPlanId(Long id); + + int deleteMesByPlan(Long id); + + RiskAssessPlanEvaluateMes getMesByIdentificationId(Long id, Byte identificationMethod); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateRsService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateRsService.java new file mode 100644 index 0000000..16f9a68 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanEvaluateRsService.java @@ -0,0 +1,47 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskAssessPlanEvaluateDeleteReqBO; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateRs; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessRsInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.RsInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.RsQueryDTO; + +import java.util.List; + +/** + * 评价方法RS + */ +public interface RiskAssessPlanEvaluateRsService { + + + /** + * 评价方法RS - 插入 + */ + RsInsertDTO InsertRs(Long currentUserId, AssessRsInsertBO rsInsertBO); + /** + * 评价方法RS - 修改 + */ + RsInsertDTO updateRs(Long currentUserId, AssessRsInsertBO rsInsertBO); + /** + * 评价方法RS - 查询 + */ + RsQueryDTO getRsByPlanId(Long id); + /** + * 评价方法RS - 删除 + */ + EvaluateMethodDeleteDTO deleteRsByPlanId(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO); + /** + * 评价方法RS - list + */ + List<RsQueryDTO> listRsByPlanId(Long id); + + List<RiskAssessPlanEvaluateRs> getRsByIds(List<Long> assessPlanIds); + + int deleteRsByAssessPlanId(Long id); + + int deleteRsByPlan(Long id); + + RiskAssessPlanEvaluateRs getRsByIdentificationId(Long id, Byte identificationMethod); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationAnalogyService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationAnalogyService.java new file mode 100644 index 0000000..5c0ed7a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationAnalogyService.java @@ -0,0 +1,39 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationAnalogy; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.AnalogyInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.AnalogyQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; + +import java.util.List; + +/** + * 辨识方法-类比法(Analogy) + */ +public interface RiskAssessPlanIdentificationAnalogyService { + + /** + * 辨识方法-类比法(Analogy) - 插入 + */ + AnalogyInsertDTO insertAnalogy(Long currentUserId, RiskAssessPlanIdentificationAnalogy analogy); + /** + * 辨识方法-类比法(Analogy) - 修改 + */ + AnalogyInsertDTO updateAnalogy(Long currentUserId, RiskAssessPlanIdentificationAnalogy analogy); + /** + * 辨识方法-类比法(Analogy) - 查询 + */ + AnalogyQueryDTO getAnalogyByPlanId(Long id); + /** + * 辨识方法-类比法(Analogy) - 删除 + */ + IdentificationMethodDeleteDTO deleteAnalogyByPlanId(Long currentUserId, Long id); + /** + * 辨识方法-类比法(Analogy) - 查询 -- 不校验结果 + */ + RiskAssessPlanIdentificationAnalogy checkAnalogyByPlanId(Long identificationId); + /** + * 辨识方法-类比法(Analogy) - list + */ + List<AnalogyQueryDTO> listAnalogyByPlanId(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationHazopService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationHazopService.java new file mode 100644 index 0000000..1648c15 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationHazopService.java @@ -0,0 +1,40 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationHazop; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.HazopInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.HazopQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; + +import java.util.List; + +/** + * 辨识方法-Hazop + */ +public interface RiskAssessPlanIdentificationHazopService { + + + /** + * 辨识方法-Hazop - 插入 + */ + HazopInsertDTO insertHazop(Long currentUserId, RiskAssessPlanIdentificationHazop hazop); + /** + * 辨识方法-Hazop - 修改 + */ + HazopInsertDTO updateHazop(Long currentUserId, RiskAssessPlanIdentificationHazop hazop); + /** + * 辨识方法-Hazop - 查询 + */ + HazopQueryDTO getHazopByPlanId(Long id); + /** + * 辨识方法-Hazop - 删除 + */ + IdentificationMethodDeleteDTO deleteHazopByPlanId(Long currentUserId, Long id); + /** + * 辨识方法-Hazop - 查询 -- 不校验结果 + */ + RiskAssessPlanIdentificationHazop checkHazopByPlanId(Long identificationId); + /** + * 辨识方法-Hazop - list + */ + List<HazopQueryDTO> listHazopByPlanId(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationJhaService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationJhaService.java new file mode 100644 index 0000000..b85ec34 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationJhaService.java @@ -0,0 +1,39 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationJha; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.JhaInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.JhaQueryDTO; + +import java.util.List; + +/** + * 辨识方法-Jha + */ +public interface RiskAssessPlanIdentificationJhaService { + + /** + * 辨识方法-Jha -- 插入 + */ + JhaInsertDTO insertJha(Long currentUserId, RiskAssessPlanIdentificationJha jha); + /** + * 辨识方法-Jha -- 修改 + */ + JhaInsertDTO updateJha(Long currentUserId, RiskAssessPlanIdentificationJha jha); + /** + * 辨识方法-Jha -- 查询 + */ + JhaQueryDTO getJhaByPlanId(Long id); + /** + * 辨识方法-Jha -- 删除 + */ + IdentificationMethodDeleteDTO deleteJhaByPlanId(Long currentUserId, Long id); + /** + * 辨识方法-Jha -- 查询 --不校验结果 + */ + RiskAssessPlanIdentificationJha checkJhaByPlanId(Long identificationId); + /** + * 辨识方法-Jha -- list + */ + List<JhaQueryDTO> listJhaByPlanId(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationPhaService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationPhaService.java new file mode 100644 index 0000000..016207c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationPhaService.java @@ -0,0 +1,40 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationPha; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.PhaInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.PhaQueryDTO; + +import java.util.List; + +/** + * 辨识方法-Pha + */ +public interface RiskAssessPlanIdentificationPhaService { + + /** + * 辨识方法-Pha - 插入 + */ + PhaInsertDTO insertPha(Long currentUserId, RiskAssessPlanIdentificationPha pha); + /** + * 辨识方法-Pha - 修改 + */ + PhaInsertDTO updatePha(Long currentUserId, RiskAssessPlanIdentificationPha pha); + /** + * 辨识方法-Pha - 查询 + */ + PhaQueryDTO getPhaByPlanId(Long id); + /** + * 辨识方法-Pha - 删除 + */ + IdentificationMethodDeleteDTO deletePhaByPlanId(Long currentUserId, Long id); + /** + * 辨识方法-Pha - 查询 - 不校验结果 + */ + RiskAssessPlanIdentificationPha checkPhaByPlanId(Long identificationId); + /** + * 辨识方法-Pha - list + */ + List<PhaQueryDTO> listPhaByPlanId(Long id); + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationSclService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationSclService.java new file mode 100644 index 0000000..3a4097e --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanIdentificationSclService.java @@ -0,0 +1,39 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationScl; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.SclInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.SclQueryDTO; + +import java.util.List; + +/** + * 辨识方法-Scl + */ +public interface RiskAssessPlanIdentificationSclService { + + /** + * 辨识方法-Scl - 插入 + */ + SclInsertDTO insertScl(Long currentUserId, RiskAssessPlanIdentificationScl scl); + /** + * 辨识方法-Scl - 修改 + */ + SclInsertDTO updateScl(Long currentUserId, RiskAssessPlanIdentificationScl scl); + /** + * 辨识方法-Scl - 查询 + */ + SclQueryDTO getSclByPlanId(Long id); + /** + * 辨识方法-Scl - 删除 + */ + IdentificationMethodDeleteDTO deleteSclByPlanId(Long currentUserId, Long id); + /** + * 辨识方法-Scl - 查询 -- 不校验结果 + */ + RiskAssessPlanIdentificationScl checkSclByPlanId(Long identificationId); + /** + * 辨识方法-Scl - list + */ + List<SclQueryDTO> listSclByPlanId(Long id); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanService.java new file mode 100644 index 0000000..629c4e9 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskAssessPlanService.java @@ -0,0 +1,111 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.*; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.*; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessAppQueryDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessAppQueryDTO_0223bak; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessPlanListAppDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; + +import java.util.List; + +/** + * 风险评估计划 + */ +public interface RiskAssessPlanService { + + /** + * 风险评估计划 - 插入 + */ + PlanInsertDTO insertAssessPlan(Long currentUserId, RiskAssessPlanAppInsertBO insertParam); + /** + * 风险评估计划 - 查询 + */ + SearchResult<AssessPlanQueryDTO> selectAssessPlanPage(Long currentUserId, RiskAssessPlanAppQueryBO queryParam); + /** + * 风险评估计划 - 修改 + */ + AssessPlanUpdateDTO updateAssessPlan(Long currentUserId, RiskAssessPlanUpdateReqBO updateParam); + /** + * 风险评估计划 - 删除 + */ + AssessPlanDeleteDTO deleteAssessPlan(Long currentUserId, Long id); + /** + * 风险评估计划 - 派发任务 + */ + AssessPlanUpdateDTO sellAssessPlan(Long currentUserId, Long id); + /** + * 风险评估计划 - 辨识 + */ + AssessPlanIdentificationDTO identification(Long currentUserId, RiskAssessPlanAppIdentificationBO identificationParam); + /** + * 风险评估计划 - 评价 + */ + AssessPlanEvaluateDTO evaluate(Long currentUserId, RiskAssessPlanAppEvaluateBO evaluateParam); + /** + * 风险评估计划 - 评价修改 + */ + AssessPlanEvaluateDTO evaluateUpdate(Long currentUserId, RiskAssessPlanAppEvaluateBO evaluateParam); + /** + * 风险评估计划 - 辨识结果提交 + */ + AssessPlanUpdateDTO identificationSubmit(Long currentUserId, Long id); + /** + * 风险评估计划 - 评价结果提交 + */ + AssessPlanUpdateDTO evaluateSubmit(Long currentUserId, Long id); + /** + * 风险辨识与评价 - 查询 + */ + SearchResult<RiskAssessAppQueryDTO> selectAssessPage(Long currentUserId, RiskAssessAppQueryBO queryBO); + /** + * 风险评估计划 - 辨识删除 + */ + AssessPlanUpdateDTO deleteIdentification(Long currentUserId, RiskAssessPlanIdentificationDeleteReqBO deleteReqBO); + /** + * 风险评估计划 - 评价删除 + */ + AssessPlanUpdateDTO deleteEvaluate(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO); + + /** + * 风险评估计划 - 查询 by id + */ + AssessPlanQueryDTO getAssessPlanById(Long id); + /** + * 风险评估计划 - 查询 by 实验id + */ + List<AssessPlanQueryDTO> getAssessPlanByExperimentId(Long experimentId); + /** + * 评估计划 - 列表查询 + */ + List<RiskAssessPlanListAppDTO> listAssessPlan(Byte status); + + /** + * 评估计划 - 修改任务派发状态 + */ + int assessPlanSellStatus(Long id, byte byteValue); + /** + * 风险评估计划 - 辨识专家拒绝 + */ + AssessPlanUpdateDTO identificationRefuse(Long currentUserId, Long id); + /** + * 风险评估计划 - 评价专家拒绝 + */ + AssessPlanUpdateDTO evaluateRefuse(Long currentUserId, Long id); + /** + * 风险评估计划 - 辨识方法修改 + */ + AssessPlanUpdateDTO identificationUpdateMethod(Long currentUserId, MethodUpdateReqDTO updateReqDTO); + /** + * 风险评估计划 - 评价方法修改 + */ + AssessPlanUpdateDTO evaluateUpdateMethod(Long currentUserId, MethodUpdateReqDTO updateReqDTO); + + /** + * 风险评估计划 - 重新指定专家 + */ + AssessPlanUpdateDTO appoint(Long currentUserId, AppointUserReBO appointUserReBO); + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskUnitService.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskUnitService.java new file mode 100644 index 0000000..ce26381 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/RiskUnitService.java @@ -0,0 +1,73 @@ +package com.gkhy.labRiskManage.domain.riskReport.service; + + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskUnitListReqBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.InherentRiskUnitAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.RiskUnitAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.RiskUnitAppQueryBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.RiskUnitAppUpdateBO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessPlanListAppDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitBasicDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskUnit; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.RiskUnitDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.RiskUnitInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.RiskUnitListAppQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.RiskUnitQueryDTO; + +import java.util.List; + +/** + * 实验风险单元 + */ +public interface RiskUnitService { + + /** + * 实验风险单元 - 插入 + */ + RiskUnitInsertDTO insertRiskUnit(Long currentUserId, RiskUnitAppInsertBO insertParam); + /** + * 固有风险单元 - 插入 + */ + RiskUnitInsertDTO insertInherentRiskUnit(Long currentUserId, InherentRiskUnitAppInsertBO insertParam); + /** + * 风险单元 - 分页查询 + */ + SearchResult<RiskUnitQueryDTO> selectRiskUnitPage(Long currentUserId, RiskUnitAppQueryBO queryParam); + /** + * 风险单元 - 修改 + */ + RiskUnitInsertDTO updateRiskUnit(Long currentUserId, RiskUnitAppUpdateBO updateParam); + /** + * 风险单元 - 删除 + */ + RiskUnitDeleteDTO deleteRiskUnit(Long currentUserId, Long id); + /** + * 风险单元 - 查询by id + */ + RiskUnitQueryDTO getRiskUnitById(Long id); + /** + * 风险单元 - 查询by name + */ + List<RiskUnitQueryDTO> getRiskUnitByName(String riskUnitName); + /** + * 风险单元管理 - 列表查询 + */ + List<RiskUnitListAppQueryDTO> listRiskUnit(Long currentUserId); + /** + * 风险单元管理 - 列表查询 + */ + List<RiskUnitListAppQueryDTO> listRiskUnitByExperiment(Long currentUserId, RiskUnitListReqBO reqBO); + + /** + * 风险单元管理 - 已添加评估计划的unit + */ + List<RiskUnitListAppQueryDTO> listAssessRiskUnit(); + + List<RiskUnit> getRiskUnitByExperimentId(Long id); + + RiskUnit updateRiskUnitStatus(Long id, int status); + + List<RiskUnit> listInherentRiskUnit(); + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentRiskSourceServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentRiskSourceServiceImpl.java new file mode 100644 index 0000000..3483edc --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentRiskSourceServiceImpl.java @@ -0,0 +1,169 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportRiskSourceQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportSourceAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportSourceAppUpdateBO; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentRiskSource; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.ReportSourceInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.ReportSourceUpdateBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportPersonInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportRiskSourceDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportSourceTypeInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.ReportExperimentRiskSourceRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportExperimentRiskSourceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +/** + * + */ +@Service +public class ReportExperimentRiskSourceServiceImpl implements ReportExperimentRiskSourceService { + + @Autowired + private ReportExperimentRiskSourceRepository riskSourceRepository; + @Autowired + private UserDomainService userDomainService; + /** + * 风险评估报告-危险因素 - 插入 + */ + @Override + public List<ReportRiskSourceDTO> insertReportSource(Long currentUserId, List<ReportSourceAppInsertBO> riskSourceInsertBO) { + + if (riskSourceInsertBO.size() < 1){ + List<ReportRiskSourceDTO> list= new ArrayList<>(); + return list; + } + + List<ReportSourceInsertBO> reportSourceInsertBO = BeanCopyUtils.copyBeanList(riskSourceInsertBO, ReportSourceInsertBO.class); + + List<ReportExperimentRiskSource> riskSourceLists = new ArrayList<>(); + + for (ReportSourceInsertBO sourceInsertBO : reportSourceInsertBO) { + if (ObjectUtils.isEmpty(sourceInsertBO.getReportId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "报告id不能为空"); + } + if (ObjectUtils.isEmpty(sourceInsertBO.getRiskSource())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险源不能为空"); + } + if (ObjectUtils.isEmpty(sourceInsertBO.getRiskCharacteristic())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险特性不能为空"); + } + if (ObjectUtils.isEmpty(sourceInsertBO.getNumber())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "数量不能为空"); + } + if (ObjectUtils.isEmpty(sourceInsertBO.getRiskSourceIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "排序不能为空"); + } + + ReportExperimentRiskSource riskSource = BeanCopyUtils.copyBean(sourceInsertBO, ReportExperimentRiskSource.class); + + //补全数据 + LocalDateTime date = LocalDateTime.now(); + + riskSource.setCreateTime(date); + riskSource.setUpdateTime(date); + riskSource.setCreateByUserId(currentUserId); + riskSource.setUpdateByUserId(currentUserId); + riskSource.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + + riskSourceLists.add(riskSource); + } + + List<ReportExperimentRiskSource> insertResult = riskSourceRepository.saveAll(riskSourceLists); + if (insertResult.size() != reportSourceInsertBO.size()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "风险源写入失败"); + } + + return BeanCopyUtils.copyBeanList(insertResult, ReportRiskSourceDTO.class); + } + + /** + * 风险评估报告-危险因素 - 修改 + */ + @Override + public List<ReportRiskSourceDTO> updateReportSource(Long currentUserId, List<ReportSourceAppUpdateBO> riskSourceUpdateBO) { + + if (riskSourceUpdateBO.size() < 1){ + List<ReportRiskSourceDTO> list= new ArrayList<>(); + return list; + } + + List<ReportSourceUpdateBO> reportSourceUpdateBO = BeanCopyUtils.copyBeanList(riskSourceUpdateBO, ReportSourceUpdateBO.class); + + List<ReportExperimentRiskSource> riskSourceLists = new ArrayList<>(); + + for (ReportSourceUpdateBO sourceInsertBO : reportSourceUpdateBO) { + if (ObjectUtils.isEmpty(sourceInsertBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险因素id不能为空"); + } + if (ObjectUtils.isEmpty(sourceInsertBO.getReportId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "报告id不能为空"); + } + if (ObjectUtils.isEmpty(sourceInsertBO.getRiskSource())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险源不能为空"); + } + if (ObjectUtils.isEmpty(sourceInsertBO.getRiskCharacteristic())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险特性不能为空"); + } + if (ObjectUtils.isEmpty(sourceInsertBO.getNumber())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "数量不能为空"); + } + if (ObjectUtils.isEmpty(sourceInsertBO.getRiskSourceIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "排序不能为空"); + } + ReportExperimentRiskSource riskSource = riskSourceRepository.getRiskSourceById(sourceInsertBO.getId()); + + //补全数据 + LocalDateTime date = LocalDateTime.now(); + + riskSource.setUpdateTime(date); + riskSource.setUpdateByUserId(currentUserId); + riskSource.setRiskSourceIndex(sourceInsertBO.getRiskSourceIndex()); + riskSource.setRiskSource(sourceInsertBO.getRiskSource()); + riskSource.setRiskCharacteristic(sourceInsertBO.getRiskCharacteristic()); + riskSource.setNumber(sourceInsertBO.getNumber()); + riskSource.setDescription(sourceInsertBO.getDesc()); + + riskSourceLists.add(riskSource); + } + + List<ReportExperimentRiskSource> insertResult = riskSourceRepository.saveAll(riskSourceLists); + if (insertResult.size() != riskSourceUpdateBO.size()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "风险源写入失败"); + } + + return BeanCopyUtils.copyBeanList(insertResult, ReportRiskSourceDTO.class); + } + + /** + * 风险评估报告-危险因素 - 查询by 报告id + */ + @Override + public List<ReportRiskSourceQueryRespDTO> getRiskSourceByReportId(Long id) { + + List<ReportExperimentRiskSource> riskSourceByReportId = riskSourceRepository.getRiskSourceByReportId(id); + if (ObjectUtils.isEmpty(riskSourceByReportId)){ + return null; + } + List<ReportRiskSourceQueryRespDTO> reportRiskSourceDTOS = BeanCopyUtils.copyBeanList(riskSourceByReportId, ReportRiskSourceQueryRespDTO.class); + return reportRiskSourceDTOS; + } + + @Override + public List<ReportExperimentRiskSource> insertAllReportSource(List<ReportExperimentRiskSource> riskSourceList) { + List<ReportExperimentRiskSource> riskSources = riskSourceRepository.saveAll(riskSourceList); + return riskSources; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentRiskSourceTypeServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentRiskSourceTypeServiceImpl.java new file mode 100644 index 0000000..3e20f73 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentRiskSourceTypeServiceImpl.java @@ -0,0 +1,164 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportSourceTypeQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportSourceTypeAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportSourceTypeAppUpdateBO; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskSourceTypeDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentRiskSourceTypeService; +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentRiskSourceType; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.ReportSourceTypeInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.ReportSourceTypeUpdateBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportPersonInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportSourceTypeInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportSourceTypeQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.ReportExperimentRiskSourceTypeRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportExperimentRiskSourceTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +/** + * 风险评估报告-实验可能有的危险源或危险因素类型 + */ +@Service +public class ReportExperimentRiskSourceTypeServiceImpl implements ReportExperimentRiskSourceTypeService { + + @Autowired + private ReportExperimentRiskSourceTypeRepository sourceTypeRepository; + @Autowired + private BasicExperimentRiskSourceTypeService basicTypeService; + /** + * 危险因素类型 - 插入 + */ + @Override + public List<ReportSourceTypeInsertDTO> insertReportSourceType(Long currentUserId, List<ReportSourceTypeAppInsertBO> reportSourceTypeInsertBO) { + + if (reportSourceTypeInsertBO.size() != 8){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险源类型不符合标准,请重新填写"); + } + + List<ReportSourceTypeInsertBO> typeInsertBO = BeanCopyUtils.copyBeanList(reportSourceTypeInsertBO, ReportSourceTypeInsertBO.class); + + List<ReportExperimentRiskSourceType> sourceTypeLists = new ArrayList<>(); + + for (ReportSourceTypeInsertBO sourceTypeInsertBO : typeInsertBO) { + if (ObjectUtils.isEmpty(sourceTypeInsertBO.getReportId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "报告id不能为空"); + } + if (ObjectUtils.isEmpty(sourceTypeInsertBO.getRiskSourceTypeId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险类型不能为空"); + } + RiskSourceTypeDTO typeById = basicTypeService.getTypeById(sourceTypeInsertBO.getReportId()); + if (ObjectUtils.isEmpty(typeById )){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "危险类型不存在"); + } + if (ObjectUtils.isEmpty(sourceTypeInsertBO.getStatus())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险类型,不能为空"); + } + + ReportExperimentRiskSourceType sourceType = BeanCopyUtils.copyBean(sourceTypeInsertBO, ReportExperimentRiskSourceType.class); + //补全数据 + LocalDateTime date = LocalDateTime.now(); + + sourceType.setReportId(sourceTypeInsertBO.getReportId()); + sourceType.setRiskSourceType(typeById.getRiskSourceType()); + sourceType.setCreateTime(date); + sourceType.setUpdateTime(date); + sourceType.setCreateByUserId(currentUserId); + sourceType.setUpdateByUserId(currentUserId); + sourceType.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + + sourceTypeLists.add(sourceType); + } + + List<ReportExperimentRiskSourceType> insertResult = sourceTypeRepository.saveAll(sourceTypeLists); + if (insertResult.size() != typeInsertBO.size()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "风险源类型写入失败"); + } + + return BeanCopyUtils.copyBeanList(insertResult, ReportSourceTypeInsertDTO.class); + } + + /** + * 危险因素类型 - 修改 + */ + @Override + public List<ReportSourceTypeInsertDTO> updateReportSourceType(Long currentUserId, List<ReportSourceTypeAppUpdateBO> reportSourceTypeAppUpdateBO) { + + if (reportSourceTypeAppUpdateBO.size() != 8){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险源类型不符合标准,请重新填写"); + } + + List<ReportSourceTypeUpdateBO> typeUpdateBO = BeanCopyUtils.copyBeanList(reportSourceTypeAppUpdateBO, ReportSourceTypeUpdateBO.class); + + List<ReportExperimentRiskSourceType> sourceTypeLists = new ArrayList<>(); + + for (ReportSourceTypeUpdateBO updateBO : typeUpdateBO) { + if (ObjectUtils.isEmpty(updateBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险类型id不能为空"); + } + if (ObjectUtils.isEmpty(updateBO.getReportId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "报告id不能为空"); + } + if (ObjectUtils.isEmpty(updateBO.getRiskSourceTypeId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险类型不能为空"); + } + RiskSourceTypeDTO typeById = basicTypeService.getTypeById(updateBO.getReportId()); + if (ObjectUtils.isEmpty(typeById )){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "危险类型不存在"); + } + if (ObjectUtils.isEmpty(updateBO.getStatus())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "危险类型是否存在不能为空"); + } + ReportExperimentRiskSourceType type = sourceTypeRepository.getTypeById(updateBO.getId()); + + ReportExperimentRiskSourceType sourceType = BeanCopyUtils.copyBean(type, ReportExperimentRiskSourceType.class); + //补全数据 + LocalDateTime date = LocalDateTime.now(); + + sourceType.setRiskSourceType(typeById.getRiskSourceType()); + sourceType.setUpdateTime(date); + sourceType.setUpdateByUserId(currentUserId); + + sourceTypeLists.add(sourceType); + } + + List<ReportExperimentRiskSourceType> updateResult = sourceTypeRepository.saveAll(sourceTypeLists); + if (updateResult.size() != reportSourceTypeAppUpdateBO.size()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "风险源类型写入失败"); + } + + return BeanCopyUtils.copyBeanList(updateResult, ReportSourceTypeInsertDTO.class); + } + + /** + * 危险因素类型 - 查询 by 报告id + */ + @Override + public List<ReportSourceTypeQueryRespDTO> getSourceTypeByReportId(Long id) { + + List<ReportExperimentRiskSourceType> sourceTypeByReportId = sourceTypeRepository.getSourceTypeByReportId(id); + + if (ObjectUtils.isEmpty(sourceTypeByReportId)){ + return null; + } + + return BeanCopyUtils.copyBeanList(sourceTypeByReportId, ReportSourceTypeQueryRespDTO.class); + } + + @Override + public List<ReportExperimentRiskSourceType> insertAllReportSource(List<ReportExperimentRiskSourceType> riskSourceTypeList) { + + List<ReportExperimentRiskSourceType> sourceTypes = sourceTypeRepository.saveAll(riskSourceTypeList); + return sourceTypes; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentSiteServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentSiteServiceImpl.java new file mode 100644 index 0000000..adcd20c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportExperimentSiteServiceImpl.java @@ -0,0 +1,29 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentSite; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.ReportExperimentSiteRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportExperimentSiteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ReportExperimentSiteServiceImpl implements ReportExperimentSiteService { + + @Autowired + private ReportExperimentSiteRepository repository; + + @Override + public List<ReportExperimentSite> insertAll(List<ReportExperimentSite> reportSiteList) { + List<ReportExperimentSite> reportExperimentSites = repository.saveAll(reportSiteList); + return reportExperimentSites; + } + + @Override + public List<ReportExperimentSite> getSiteByReportId(Long id) { + + List<ReportExperimentSite> siteByReportId = repository.getSiteByReportId(id); + return siteByReportId; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessInfoServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessInfoServiceImpl.java new file mode 100644 index 0000000..4d42004 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessInfoServiceImpl.java @@ -0,0 +1,885 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportExperimentSiteQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportPersonQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportRiskSourceQueryRespDTO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportSourceTypeQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportAppQueryBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportAppUpdateBO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.ReportAppQueryDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.enums.UserTagEnum; +import com.gkhy.labRiskManage.commons.enums.UserRoleEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnitType; +import com.gkhy.labRiskManage.domain.basic.model.dto.PersonQueryDTO; +import com.gkhy.labRiskManage.domain.basic.model.dto.SiteQueryDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteService; +import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitTypeService; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndSite; +import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentInfo; +import com.gkhy.labRiskManage.domain.experiment.enums.ExperimentApprovalStatusEnum; +import com.gkhy.labRiskManage.domain.experiment.enums.ExperimentRectifyStatusEnum; +import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndSiteService; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentInfoService; +import com.gkhy.labRiskManage.domain.riskReport.entity.*; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.ReportQueryBO; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.UpdateExperimentInfoBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.ReportRiskAssessInfoRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.*; +import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; +import com.gkhy.labRiskManage.domain.riskReport.utils.RiskSourceTypeUtils; +import lombok.Data; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +/** + * 风险评估报告 + */ +@Service +public class ReportRiskAssessInfoServiceImpl implements ReportRiskAssessInfoService { + + @Autowired + private ReportRiskAssessInfoRepository reportRepository; + @Autowired + private ExperimentInfoService experimentInfoService; + @Autowired + private RiskAssessPlanService assessPlanService; + @Autowired + private BasicExperimentPersonService basicPersonService; + @Autowired + private BasicExperimentSiteService basicSiteService; + @Autowired + private RiskUnitService riskUnitService; + @Autowired + private ExperimentAndSiteService experimentAndSiteService; + @Autowired + private ReportExperimentSiteService reportExperimentSiteService; + @Autowired + private BasicRiskUnitTypeService basicRiskUnitTypeService; + + @Autowired + private ReportRiskAssessPersonService reportPersonService; + @Autowired + private ReportExperimentRiskSourceTypeService reportSourceTypeService; + @Autowired + private ReportExperimentRiskSourceService reportSourceService; + + @Autowired + private UserDomainService userDomainService; + + @Autowired + private RiskAssessPlanEvaluateLecService lecService; + @Autowired + private RiskAssessPlanEvaluateLsService lsService; + @Autowired + private RiskAssessPlanEvaluateMesService mesService; + @Autowired + private RiskAssessPlanEvaluateRsService rsService; + + + /** + * 风险评估报告 - 查询 + */ + @Override + public SearchResult<ReportAppQueryDTO> selectRiskReportPage(Long currentUserId, ReportAppQueryBO queryBO) { + + + //校验参数 + if (ObjectUtils.isEmpty(queryBO.getPageSize())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(queryBO.getPageIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(queryBO.getTag())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"查询报告类别参数缺失"); + } + if (queryBO.getExperimentName() == "null"){ + queryBO.setExperimentName(null); + } + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + if (ObjectUtils.isEmpty(user)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"用户不存在"); + } + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + ReportQueryBO queryParam = BeanCopyUtils.copyBean(queryBO, ReportQueryBO.class); + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(queryParam.getPageIndex()); + searchResult.setPageSize(queryParam.getPageSize()); + +// ExperimentInfoDTO experimentByName = experimentInfoService.getExperimentByName(queryBO.getExperimentName()); + + //封装查询参数 + Specification<ReportRiskAssessInfo> specification = new Specification<ReportRiskAssessInfo>() { + @Override + public Predicate toPredicate(Root<ReportRiskAssessInfo> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + if (queryParam.getAssessLevel() != null && !queryParam.getAssessLevel().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("assessLevel"),queryParam.getAssessLevel())); + } + if (queryParam.getApprovePlanStatus() != null && !queryParam.getApprovePlanStatus().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("approvePlanStatus"), + queryParam.getApprovePlanStatus())); + } + if (queryParam.getExperimentType() != null && !queryParam.getExperimentType().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("experimentType"),queryParam.getExperimentType())); + } + if (!ObjectUtils.isEmpty(queryParam.getExperimentId())){ + predicateList.add(criteriaBuilder.equal(root.get("experimentId"),queryParam.getExperimentId())); + } + if (!ObjectUtils.isEmpty(queryParam.getExperimentName())){ + predicateList.add(criteriaBuilder.equal(root.get("experimentName"), queryParam.getExperimentName())); + } + if (roleTag == UserTagEnum.USER_TAG_0.getCode()){ + predicateList.add(criteriaBuilder.equal(root.get("personUserId"), currentUserId)); + } + if (queryParam.getTag() == 1){ + predicateList.add(criteriaBuilder.isNull(root.get("assessPerson"))); + }else if (queryParam.getTag() == 2){ + predicateList.add(criteriaBuilder.isNotNull(root.get("assessPerson"))); + } + //现在领导能查看所有的报告 +// if (roleTag == UserTagEnum.USER_TAG_2.getCode()){ +// predicateList.add(criteriaBuilder.or( +// criteriaBuilder.equal(root.get("approvePlanStatus"), StatusEnum.REPORT_APPROVED.getCode()), +// criteriaBuilder.equal(root.get("approvePlanStatus"), StatusEnum.REPORT_NOT_APPROVED.getCode()), +// criteriaBuilder.equal(root.get("approvePlanStatus"), StatusEnum.REPORT_APPROVED_LEAD.getCode()) +// ) +// ); +// } + + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode())); + return criteriaBuilder.and(predicateList.toArray(new Predicate[0])); + } + }; + + PageRequest pageParam = PageRequest.of(queryParam.getPageIndex() - 1, queryParam.getPageSize(), Sort.Direction.DESC, "updateTime"); + Page<ReportRiskAssessInfo> pageResult = reportRepository.findAll(specification, pageParam); + + List<ReportQueryDTO> reportQueryDTOS = BeanCopyUtils.copyBeanList(pageResult.getContent(), ReportQueryDTO.class); + + List<ReportAppQueryDTO> reportAppQueryDTOS = BeanCopyUtils.copyBeanList(reportQueryDTOS, ReportAppQueryDTO.class); + + List<UserInfoDomainDTO> userList = userDomainService.getUserList(); + for (ReportAppQueryDTO reportQueryDTO : reportAppQueryDTOS) { + //获取审批人员 + List<ReportPersonQueryRespDTO> personByReportId = reportPersonService.listPersonByReportId(reportQueryDTO.getId()); + //获取实验风险源 + List<ReportRiskSourceQueryRespDTO> riskSourceByReportId = reportSourceService.getRiskSourceByReportId(reportQueryDTO.getId()); + //获取风险类型 + List<ReportSourceTypeQueryRespDTO> sourceTypeByReportId = reportSourceTypeService.getSourceTypeByReportId(reportQueryDTO.getId()); + //获取风险类型 + List<ReportExperimentSite> siteByReportId = reportExperimentSiteService.getSiteByReportId(reportQueryDTO.getId()); + //获取实验信息 + ExperimentInfoDTO experimentById = experimentInfoService.getExperimentById(reportQueryDTO.getExperimentId()); + //获取评估计划 + List<AssessPlanQueryDTO> assessPlanByExperimentId = assessPlanService.getAssessPlanByExperimentId(reportQueryDTO.getExperimentId()); + reportQueryDTO.setEvaluateTime(experimentById.getCreateTime()); + + if (!ObjectUtils.isEmpty(assessPlanByExperimentId)){ + for (AssessPlanQueryDTO assessPlan : assessPlanByExperimentId) { + if (reportQueryDTO.getEvaluateTime().isBefore(assessPlan.getEvaluateTime())){ + reportQueryDTO.setEvaluateTime(assessPlan.getEvaluateTime()); + } + } + } + + if (!ObjectUtils.isEmpty(riskSourceByReportId)){ + reportQueryDTO.setRiskSource(riskSourceByReportId); + } + if (!ObjectUtils.isEmpty(sourceTypeByReportId)){ + reportQueryDTO.setRiskSourceType(sourceTypeByReportId); + } + if (!ObjectUtils.isEmpty(personByReportId)){ + reportQueryDTO.setPerson(personByReportId); + } + if (!ObjectUtils.isEmpty(siteByReportId)){ + reportQueryDTO.setExperimentSite(BeanCopyUtils.copyBeanList(siteByReportId, ReportExperimentSiteQueryRespDTO.class)); + } + reportQueryDTO.setExperimentCode(experimentById.getExperimentCode()); + + for (UserInfoDomainDTO userInfo : userList) { + if (userInfo.getId() == reportQueryDTO.getCreateByUserId()){ + reportQueryDTO.setCreateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == reportQueryDTO.getUpdateByUserId()){ + reportQueryDTO.setUpdateByUserName(userInfo.getRealName()); + } + } + } + + searchResult.setData(reportAppQueryDTOS); + searchResult.setTotal(pageResult.getTotalElements()); + return searchResult; + } + + /** + * 风险评估报告 - 生成报告信息 + */ + @Transactional + @Override + public ReportInsertDTO insertRiskReport(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + int roleTag = GetRoleTagUtils.GetRoleTagUtils(userInfoById); + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"实验id不能为空"); + } + //获取实验id,查询实验 + ExperimentInfoDTO experimentById = experimentInfoService.getExperimentById(id); + if (ObjectUtils.isEmpty(experimentById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "实验不存在"); + } + if (roleTag == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"不是管理员,无权生成报告"); + } + if (experimentById.getStage() == StatusEnum.EXPERIMENT_STATUS_REPORT.getCode().byteValue()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"该实验已经生成报告,无需重复操作"); + } + //定义初始风险等级0级 + Byte level = 0; + //获取该实验的所有计划信息 + List<AssessPlanQueryDTO> assessPlanList = assessPlanService.getAssessPlanByExperimentId(id); + int tag = 0; + StringBuilder info = new StringBuilder(); + List<Long> assessPlanIds = new ArrayList<>(); + //如果有计划未评价完成,不可生成报告 + for (AssessPlanQueryDTO assessPlanQueryDTO : assessPlanList) { + if (assessPlanQueryDTO.getPlanExecStatus() != StatusEnum.PLAN_EXEC_OVER.getCode().byteValue()){ + info.append(assessPlanQueryDTO.getAssessPlanName() + ";"); + tag = 1; + } + assessPlanIds.add(assessPlanQueryDTO.getId()); + } + + if (tag == 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"该实验有未完成的评估计划" + info); + } + + UserInfoDomainDTO liabilityUser = userDomainService.getUserInfoById(experimentById.getLiabilityUserId()); + if (ObjectUtils.isEmpty(liabilityUser)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"实验责任人信息不存在"); + } + + + //检查该实验所有的评价结果,遍历评价结果等级 + int a = 1; + StringBuilder analysis = new StringBuilder(); + List<RiskAssessPlanEvaluateLec> lecByIds = lecService.getLecByIds(assessPlanIds); + List<RiskAssessPlanEvaluateLs> lsByIds = lsService.getLsByIds(assessPlanIds); + List<RiskAssessPlanEvaluateMes> mesByIds = mesService.getMesByIds(assessPlanIds); + List<RiskAssessPlanEvaluateRs> rsByIds = rsService.getRsByIds(assessPlanIds); + + if (lecByIds .size() > 0){ + for (RiskAssessPlanEvaluateLec lecById : lecByIds) { + if (lecById.getRiskLevel() > level){ + level = lecById.getRiskLevel(); + analysis.append(a + lecById.getSafeRiskAnalysis() + ";");//todo 安全风险分析 + a++; + } + } + } + if (lsByIds .size() > 0){ + for (RiskAssessPlanEvaluateLs lsById : lsByIds) { + if (lsById.getRiskLevel() > level){ + level = lsById.getRiskLevel(); + analysis.append(a + lsById.getSafeRiskAnalysis() + ";"); + a++; + } + } + } + if (mesByIds .size() > 0){ + for (RiskAssessPlanEvaluateMes mesById : mesByIds) { + if (mesById.getRiskLevel() > level){ + level = mesById.getRiskLevel(); + analysis.append(a + mesById.getSafeRiskAnalysis() + ";"); + a++; + } + } + } + + if (rsByIds .size() > 0){ + for (RiskAssessPlanEvaluateRs rsById : rsByIds) { + if (rsById.getRiskLevel() > level){ + level = rsById.getRiskLevel(); + analysis.append(a + rsById.getSafeRiskAnalysis() + ";"); + a++; + } + } + } + + //封装报告主体信息 + LocalDateTime date = LocalDateTime.now(); + ReportRiskAssessInfo reportInfo = new ReportRiskAssessInfo(); + + reportInfo.setExperimentId(experimentById.getId()); + reportInfo.setExperimentName(experimentById.getExperimentName()); + reportInfo.setExperimentType(experimentById.getExperimentType()); + reportInfo.setExperimentDesc(experimentById.getNote()); + reportInfo.setPersonUserId(experimentById.getLiabilityUserId());//todo 确定实验负责人,安全负责人来源 + reportInfo.setPersonUser(experimentById.getLiabilityUser()); + reportInfo.setPersonUserPhone(Long.valueOf(experimentById.getLiabilityUserPhone())); //从实验用户表查询 + reportInfo.setSafePersonUserId(experimentById.getSafeLiabilityUserId()); + reportInfo.setSafePersonUser(experimentById.getSafeLiabilityUser()); + reportInfo.setSafePersonUserPhone(Long.valueOf(experimentById.getSafeLiabilityUserPhone())); + reportInfo.setEmergencyMeasure(experimentById.getMeasure()); + reportInfo.setDep(experimentById.getDep()); + reportInfo.setCreateTime(date); + reportInfo.setUpdateTime(date); + reportInfo.setCreateByUserId(userInfoById.getId()); + reportInfo.setUpdateByUserId(userInfoById.getId()); + reportInfo.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + reportInfo.setApprovePlanStatus(StatusEnum.REPORT_NOT_START.getCode().byteValue()); + reportInfo.setSafeRiskAnalysis(analysis.toString()); + + reportInfo.setAssessPerson(null); + reportInfo.setAssessLevel(null); + reportInfo.setDepId(null); //todo 不确定是否需要部门 + reportInfo.setSafeRiskAnalysis(null); //todo 安全风险分析,暂时不知道数据来源,先设空 + + + //修改实验 4 生成报告, + ExperimentInfoDTO experimentInfoDTO = experimentInfoService.updateExperimentStage(id, StatusEnum.EXPERIMENT_STATUS_REPORT.getCode().byteValue()); + if (ObjectUtils.isEmpty(experimentInfoDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"实验状态修改失败"); + } + + //修改实验所有评估计划状态 + int result = assessPlanService.assessPlanSellStatus(id, StatusEnum.PLAN_EXEC_OVER.getCode().byteValue()); + if (result == 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"评估计划状态修改失败"); + } + + //生成报告主体信息 + ReportRiskAssessInfo saveResult = reportRepository.save(reportInfo); + if (ObjectUtils.isEmpty(saveResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"写入报告基本信息失败,请稍后尝试"); + } + + //封装实验场所信息 + List<ReportExperimentSite> reportSiteList = new ArrayList<>(); + List<ExperimentAndSite> experimentAndSiteList = experimentAndSiteService.getByExperimentId(id); + for (ExperimentAndSite experimentAndSite : experimentAndSiteList) { + SiteQueryDTO siteInfo = basicSiteService.getBasicExperimentSiteById(experimentAndSite.getSiteId()); + ReportExperimentSite reportSite = BeanCopyUtils.copyBean(siteInfo, ReportExperimentSite.class); + reportSite.setReportId(saveResult.getId()); + reportSite.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + reportSite.setSiteId(siteInfo.getId()); + reportSiteList.add(reportSite); + } + List<ReportExperimentSite> reportExperimentSites = reportExperimentSiteService.insertAll(reportSiteList); + if (reportExperimentSites.size() < reportSiteList.size()){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"写入报告实验场所信息时失败,请稍后尝试"); + } + + //封装风险源类型信息 + List<ReportExperimentRiskSourceType> riskSourceTypeList = RiskSourceTypeUtils.RiskSourceType(currentUserId, saveResult.getId()); + + //封装风 + List<RiskUnit> riskUnitList = riskUnitService.getRiskUnitByExperimentId(id); + List<ReportExperimentRiskSource> riskSourceList = new ArrayList<>(); + int i = 1; + for (RiskUnit riskUnit : riskUnitList) { + //封装风险源信息 todo -- 需要确认 此处封装风险单元?辨识出的每一项结果 + ReportExperimentRiskSource riskSource = new ReportExperimentRiskSource(); + riskSource.setReportId(saveResult.getId()); + riskSource.setRiskSourceIndex(i); + riskSource.setRiskSource(riskUnit.getRiskName()); + riskSource.setRiskCharacteristic(riskUnit.getDescription()); + riskSource.setDescription(riskUnit.getDescription()); + riskSource.setNumber(1); + riskSource.setCreateByUserId(currentUserId); + riskSource.setCreateTime(date); + riskSource.setUpdateByUserId(currentUserId); + riskSource.setUpdateTime(date); + riskSource.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + riskSourceList.add(riskSource); + i++; + + //检查风险源类型是否存在 + BasicRiskUnitType riskUnitTypeById = basicRiskUnitTypeService.getRiskUnitTypeById(riskUnit.getRiskUnitTypeId()); + for (ReportExperimentRiskSourceType riskSourceType : riskSourceTypeList) { + if (riskSourceType.getRiskSourceType().equals(riskUnitTypeById.getRiskType())){ + riskSourceType.setStatus((byte) 1);//1-存在;2-不存在 + } + } + } + //todo 改为手写,----- 暂时弃用 写入风险源 +// List<ReportExperimentRiskSource> riskSources = reportSourceService.insertAllReportSource(riskSourceList); +// if (riskSources.size() < riskSourceList.size()){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"写入报告风险源信息时失败,请稍后尝试"); +// } + + //写入风险源类型 + List<ReportExperimentRiskSourceType> riskSourceTypes = reportSourceTypeService.insertAllReportSource(riskSourceTypeList); + if (riskSourceTypes.size() < riskSourceTypeList.size()){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"写入报告风险源类型信息时失败,请稍后尝试"); + } + + return BeanCopyUtils.copyBean(saveResult, ReportInsertDTO.class); + + } + + /** + * 风险评估报告 - 填报信息 + */ + @Override + public ReportUpdateDTO updateReportInfo(Long currentUserId, ReportAppUpdateBO reportUpdateBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (ObjectUtils.isEmpty(user)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"用户不存在"); + } + if (roleTag == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权生成评估报告"); + } + if (ObjectUtils.isEmpty(reportUpdateBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"请选择正确的报告进行提交"); + } + ReportRiskAssessInfo reportById = reportRepository.getReportById(reportUpdateBO.getId()); + if (ObjectUtils.isEmpty(reportById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode() ,"选择的报告不存在"); + } + if (!ObjectUtils.isEmpty(reportById.getAssessLevel())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"报告已经填写完成"); + } + if (ObjectUtils.isEmpty(reportUpdateBO.getSafeRiskAnalysis())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"安全风险分析内容不能为空"); + } + if (ObjectUtils.isEmpty(reportUpdateBO.getAssessLevel())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"项目风险评估等级不能为空"); + } + if (!(reportUpdateBO.getAssessLevel() == 1 || reportUpdateBO.getAssessLevel() == 2 || + reportUpdateBO.getAssessLevel() == 3 || reportUpdateBO.getAssessLevel() == 4)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"项目风险评估等级不合法,请选择:低风险,一般风险,较大风险,重大风险"); + } + + reportById.setAssessPerson(reportUpdateBO.getAssessPerson()); + reportById.setAssessLevel(reportUpdateBO.getAssessLevel()); + reportById.setSafeRiskAnalysis(reportUpdateBO.getSafeRiskAnalysis()); + reportById.setDescription(reportUpdateBO.getDescription()); + reportById.setUpdateTime(LocalDateTime.now()); + reportById.setUpdateByUserId(currentUserId); + + ReportRiskAssessInfo updateResult = reportRepository.save(reportById); + if (ObjectUtils.isEmpty(updateResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"评估报告信息写入失败"); + } + + return BeanCopyUtils.copyBean(updateResult, ReportUpdateDTO.class); + } + + /** + * 风险评估报告 - 修改填报信息 + */ + @Override + public ReportUpdateDTO updateReportInfoById(Long currentUserId, ReportAppUpdateBO reportUpdateBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (ObjectUtils.isEmpty(user)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"用户不存在"); + } + if (roleTag == 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权生成评估报告"); + } + if (ObjectUtils.isEmpty(reportUpdateBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"请选择正确的报告进行提交"); + } + ReportRiskAssessInfo reportById = reportRepository.getReportById(reportUpdateBO.getId()); + if (ObjectUtils.isEmpty(reportById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode() ,"选择的报告不存在"); + } +// if (ObjectUtils.isEmpty(reportUpdateBO.getSafeRiskAnalysis())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"安全风险分析内容不能为空"); +// } + if (ObjectUtils.isEmpty(reportUpdateBO.getAssessLevel())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"项目风险评估等级不能为空"); + } + if (!(reportUpdateBO.getAssessLevel() == 1 || reportUpdateBO.getAssessLevel() == 2 || + reportUpdateBO.getAssessLevel() == 3 || reportUpdateBO.getAssessLevel() == 4)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"项目风险评估等级不合法,请选择:低风险,一般风险,较大风险,重大风险"); + } + + reportById.setAssessPerson(reportUpdateBO.getAssessPerson()); + reportById.setAssessLevel(reportUpdateBO.getAssessLevel()); +// reportById.setSafeRiskAnalysis(reportUpdateBO.getSafeRiskAnalysis()); + reportById.setDescription(reportUpdateBO.getDescription()); + reportById.setUpdateTime(LocalDateTime.now()); + reportById.setUpdateByUserId(currentUserId); + + ReportRiskAssessInfo updateResult = reportRepository.save(reportById); + if (ObjectUtils.isEmpty(updateResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"评估报告信息写入失败"); + } + + return BeanCopyUtils.copyBean(updateResult, ReportUpdateDTO.class); + } + + /** + * 风险评估报告 - 报告审核 - 旧 - 两层审核 + */ + @Transactional + @Override + public int report(Long currentUserId, ReportReqBO reportReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + if (ObjectUtils.isEmpty(user)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + if (roleTag == 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"非管理人员,无权操作"); + } + if (ObjectUtils.isEmpty(reportReqBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"请选择正确的报告进行审核"); + } + ReportRiskAssessInfo reportById = reportRepository.getReportById(reportReqBO.getId()); + if (ObjectUtils.isEmpty(reportById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"报告不存在"); + } + if (ObjectUtils.isEmpty(reportReqBO.getApproveDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"审核意见不能为空"); + } + + /** + * 方案 + * 1、管理部门审核报告后,领导可见 + * 2、管理部门-->领导,任意审核不通过,否决实验,改变报告、实验状态 + * 3、管理部门审核通过,改变报告状态(管理审核),不改变实验状态; + * 4、领导审核通过,改变报告(领导审核)、实验状态; + * */ + LocalDateTime date = LocalDateTime.now(); + + ReportRiskAssessPerson approvePerson = new ReportRiskAssessPerson(); + approvePerson.setReportId(reportReqBO.getId()); + approvePerson.setApprovePerson(user.getRealName()); + approvePerson.setApproveDesc(reportReqBO.getApproveDesc()); + approvePerson.setApproveTime(date); + approvePerson.setCreateTime(date); + approvePerson.setUpdateTime(date); + approvePerson.setApprovePersonId(currentUserId); + approvePerson.setCreateByUserId(currentUserId); + approvePerson.setUpdateByUserId(currentUserId); + approvePerson.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + //1、审核通过 + if (reportReqBO.getApproveStatus() == 2){ + approvePerson.setApproveStatus(StatusEnum.APPROVED_PASS.getCode().byteValue()); + if (roleTag == 1){ + List<ReportPersonInsertDTO> personByReportId = reportPersonService.getPersonByReportId(reportReqBO.getId()); + if (!ObjectUtils.isEmpty(personByReportId)){ + for (ReportPersonInsertDTO person : personByReportId) { + if (person.getApproveIndex() == 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告已被管理人员审核,无需重复操作"); + } + } + } + //保存审核人员信息 + approvePerson.setApproveIndex(1); + approvePerson.setApproveStage("管理人员审核"); + ReportRiskAssessPerson assessPerson = reportPersonService.insertOneReportPerson(approvePerson); + if (ObjectUtils.isEmpty(assessPerson)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"审核信息保存失败"); + } + //修改报告信息-管理审核 + reportById.setApprovePlanStatus(StatusEnum.REPORT_APPROVED.getCode().byteValue()); + ReportRiskAssessInfo reportReject = reportRepository.save(reportById); + if (ObjectUtils.isEmpty(reportReject)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告状态修改失败"); + } + } + if (roleTag == 2){ + List<ReportPersonInsertDTO> personByReportId = reportPersonService.getPersonByReportId(reportReqBO.getId()); + if (!ObjectUtils.isEmpty(personByReportId)){ + for (ReportPersonInsertDTO person : personByReportId) { + if (person.getApproveIndex() == 2){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告已被领导审核,无需重复操作"); + } + } + } + //保存审核人员信息 + approvePerson.setApproveIndex(2); + approvePerson.setApproveStage("领导审核"); + ReportRiskAssessPerson assessPerson = reportPersonService.insertOneReportPerson(approvePerson); + if (ObjectUtils.isEmpty(assessPerson)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"审核信息保存失败"); + } + //修改报告状态-领导审核 + reportById.setApprovePlanStatus(StatusEnum.REPORT_APPROVED_LEAD.getCode().byteValue()); + ReportRiskAssessInfo reportReject = reportRepository.save(reportById); + if (ObjectUtils.isEmpty(reportReject)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告状态修改失败"); + } + //修改实验状态-通过实验 + UpdateExperimentInfoBO updateBO = new UpdateExperimentInfoBO(); + updateBO.setExperimentId(reportById.getExperimentId()); + updateBO.setApprovalStatus(ExperimentApprovalStatusEnum.APPROVAL_SUCCESS.getValue()); + updateBO.setRectifyStatus(ExperimentRectifyStatusEnum.NOT_RECTIFY.getValue()); + ExperimentInfo experimentInfo = experimentInfoService.updateExperimentStatus(updateBO); + if (ObjectUtils.isEmpty(experimentInfo)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"实验信息状态修改失败"); + } + } + } + + //2、任意审核不通过 + if (reportReqBO.getApproveStatus() == 3){ + approvePerson.setApproveStatus(StatusEnum.APPROVED_NOT_PASS.getCode().byteValue()); + if (roleTag == 1){ + //保存审核人员信息 + approvePerson.setApproveIndex(1); + approvePerson.setApproveStage("管理人员审核"); + ReportRiskAssessPerson assessPerson = reportPersonService.insertOneReportPerson(approvePerson); + if (ObjectUtils.isEmpty(assessPerson)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"审核信息保存失败"); + } + } + if (roleTag == 2){ + //保存审核人员信息 + approvePerson.setApproveIndex(2); + approvePerson.setApproveStage("领导审核"); + ReportRiskAssessPerson assessPerson = reportPersonService.insertOneReportPerson(approvePerson); + if (ObjectUtils.isEmpty(assessPerson)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"审核信息保存失败"); + } + } + //修改报告状态 + reportById.setApprovePlanStatus(StatusEnum.REPORT_NOT_APPROVED.getCode().byteValue()); + ReportRiskAssessInfo reportReject = reportRepository.save(reportById); + if (ObjectUtils.isEmpty(reportReject)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告状态修改失败"); + } + //修改实验状态,否决实验 + UpdateExperimentInfoBO updateBO = new UpdateExperimentInfoBO(); + updateBO.setExperimentId(reportById.getExperimentId()); + updateBO.setApprovalStatus(ExperimentApprovalStatusEnum.APPROVAL_FAIL.getValue()); + updateBO.setRectifyStatus(ExperimentRectifyStatusEnum.WAIT_RECTIFY.getValue()); + ExperimentInfo experimentInfo = experimentInfoService.updateExperimentStatus(updateBO); + if (ObjectUtils.isEmpty(experimentInfo)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"实验信息状态修改失败"); + } + } + + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估报告 - 报告审核 - 新 - 单次审核 + */ + @Override + public int reportNew(Long currentUserId, ReportReqBO reportReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + if (ObjectUtils.isEmpty(user)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + if (roleTag != 2){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"非综合办工作人员,无权操作"); + } + if (ObjectUtils.isEmpty(reportReqBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"请选择正确的报告进行审核"); + } + ReportRiskAssessInfo reportById = reportRepository.getReportById(reportReqBO.getId()); + if (ObjectUtils.isEmpty(reportById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"报告不存在"); + } + if (ObjectUtils.isEmpty(reportReqBO.getApproveDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"审核意见不能为空"); + } + + LocalDateTime date = LocalDateTime.now(); + + ReportRiskAssessPerson approvePerson = new ReportRiskAssessPerson(); + approvePerson.setReportId(reportReqBO.getId()); + approvePerson.setApprovePerson(user.getRealName()); + approvePerson.setApproveDesc(reportReqBO.getApproveDesc()); + approvePerson.setApproveTime(date); + approvePerson.setCreateTime(date); + approvePerson.setUpdateTime(date); + approvePerson.setApprovePersonId(currentUserId); + approvePerson.setCreateByUserId(currentUserId); + approvePerson.setUpdateByUserId(currentUserId); + approvePerson.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + //1、审核通过 + if (reportReqBO.getApproveStatus() == 2){ + approvePerson.setApproveStatus(StatusEnum.APPROVED_PASS.getCode().byteValue()); +// if (roleTag == 1){ +// List<ReportPersonInsertDTO> personByReportId = reportPersonService.getPersonByReportId(reportReqBO.getId()); +// if (!ObjectUtils.isEmpty(personByReportId)){ +// for (ReportPersonInsertDTO person : personByReportId) { +// if (person.getApproveIndex() == 1){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告已被管理人员审核,无需重复操作"); +// } +// } +// } +// //保存审核人员信息 +// approvePerson.setApproveIndex(1); +// approvePerson.setApproveStage("管理人员审核"); +// ReportRiskAssessPerson assessPerson = reportPersonService.insertOneReportPerson(approvePerson); +// if (ObjectUtils.isEmpty(assessPerson)){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"审核信息保存失败"); +// } +// //修改报告信息-管理审核 +// reportById.setApprovePlanStatus(StatusEnum.REPORT_APPROVED.getCode().byteValue()); +// ReportRiskAssessInfo reportReject = reportRepository.save(reportById); +// if (ObjectUtils.isEmpty(reportReject)){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告状态修改失败"); +// } +// } + if (roleTag == 2){ + List<ReportPersonInsertDTO> personByReportId = reportPersonService.getPersonByReportId(reportReqBO.getId()); + if (!ObjectUtils.isEmpty(personByReportId)){ + for (ReportPersonInsertDTO person : personByReportId) { + if (person.getApproveIndex() == 2){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告已被综合办审核,无需重复操作"); + } + } + } + //保存审核人员信息 + approvePerson.setApproveIndex(2); + approvePerson.setApproveStage("综合办审核"); + ReportRiskAssessPerson assessPerson = reportPersonService.insertOneReportPerson(approvePerson); + if (ObjectUtils.isEmpty(assessPerson)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"审核信息保存失败"); + } + //修改报告状态-领导审核 + reportById.setApprovePlanStatus(StatusEnum.REPORT_APPROVED_LEAD.getCode().byteValue()); + ReportRiskAssessInfo reportReject = reportRepository.save(reportById); + if (ObjectUtils.isEmpty(reportReject)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告状态修改失败"); + } + //修改实验状态-通过实验 + UpdateExperimentInfoBO updateBO = new UpdateExperimentInfoBO(); + updateBO.setExperimentId(reportById.getExperimentId()); + updateBO.setApprovalStatus(ExperimentApprovalStatusEnum.APPROVAL_SUCCESS.getValue()); + updateBO.setRectifyStatus(ExperimentRectifyStatusEnum.NOT_RECTIFY.getValue()); + ExperimentInfo experimentInfo = experimentInfoService.updateExperimentStatus(updateBO); + if (ObjectUtils.isEmpty(experimentInfo)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"实验信息状态修改失败"); + } + } + } + + //2、任意审核不通过 + if (reportReqBO.getApproveStatus() == 3){ + approvePerson.setApproveStatus(StatusEnum.APPROVED_NOT_PASS.getCode().byteValue()); +// if (roleTag == 1){ +// //保存审核人员信息 +// approvePerson.setApproveIndex(1); +// approvePerson.setApproveStage("管理人员审核"); +// ReportRiskAssessPerson assessPerson = reportPersonService.insertOneReportPerson(approvePerson); +// if (ObjectUtils.isEmpty(assessPerson)){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"审核信息保存失败"); +// } +// } + if (roleTag == 2){ + //保存审核人员信息 + approvePerson.setApproveIndex(2); + approvePerson.setApproveStage("综合办审核"); + ReportRiskAssessPerson assessPerson = reportPersonService.insertOneReportPerson(approvePerson); + if (ObjectUtils.isEmpty(assessPerson)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"审核信息保存失败"); + } + } + //修改报告状态 + reportById.setApprovePlanStatus(StatusEnum.REPORT_NOT_APPROVED.getCode().byteValue()); + ReportRiskAssessInfo reportReject = reportRepository.save(reportById); + if (ObjectUtils.isEmpty(reportReject)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"报告状态修改失败"); + } + + //修改实验状态,否决实验 + UpdateExperimentInfoBO updateBO = new UpdateExperimentInfoBO(); + updateBO.setExperimentId(reportById.getExperimentId()); + updateBO.setApprovalStatus(ExperimentApprovalStatusEnum.APPROVAL_FAIL.getValue()); + updateBO.setRectifyStatus(ExperimentRectifyStatusEnum.WAIT_RECTIFY.getValue()); + ExperimentInfo experimentInfo = experimentInfoService.updateExperimentStatus(updateBO); + if (ObjectUtils.isEmpty(experimentInfo)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"实验信息状态修改失败"); + } + } + + return StatusEnum.SUCCESS.getCode(); + } + + /** + * 风险评估报告 - list + */ + @Override + public List<ReportAppQueryDTO> listRiskReport(List<Long> idList) { + + List<ReportRiskAssessInfo> reportRiskAssessList = reportRepository.listRiskReport(idList); + if (reportRiskAssessList.size() <= 0){ + return null; + } + return BeanCopyUtils.copyBeanList(reportRiskAssessList, ReportAppQueryDTO.class); + } + + @Override + public ReportRiskAssessInfo getByExperimentId(Long id) { + return reportRepository.getByExperimentId(id); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessPersonServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessPersonServiceImpl.java new file mode 100644 index 0000000..c5aa02f --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/ReportRiskAssessPersonServiceImpl.java @@ -0,0 +1,239 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.ReportReqBO; +import com.gkhy.labRiskManage.api.controller.riskReport.dto.respDto.ReportPersonQueryRespDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportPersonAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.ReportPersonAppUpdateBO; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.basic.model.dto.PersonQueryDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService; +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportRiskAssessPerson; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.ReportPersonInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.ReportRiskAssessPersonRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.ReportRiskAssessPersonService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +/** + * 风险评估报告-评估专家 + */ +@Service +public class ReportRiskAssessPersonServiceImpl implements ReportRiskAssessPersonService { + + @Autowired + private ReportRiskAssessPersonRepository personRepository; + @Autowired + private BasicExperimentPersonService basicPersonService; + + /** + * 风险评估报告-评估专家 - 插入 + */ + @Override + public List<ReportPersonInsertDTO> insertReportPerson(Long currentUserId, List<ReportPersonAppInsertBO> personInsertBO) { + + if (personInsertBO.size() < 1){ + List<ReportPersonInsertDTO> list= new ArrayList<>(); + return list; + } + + List<ReportRiskAssessPerson> reportPeopleList = BeanCopyUtils.copyBeanList(personInsertBO, ReportRiskAssessPerson.class); + List<ReportRiskAssessPerson> personList = new ArrayList<>(); + + for (ReportRiskAssessPerson reportPerson : reportPeopleList) { + if (ObjectUtils.isEmpty(reportPerson.getReportId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "用户信息不能为空"); + } + if (ObjectUtils.isEmpty(reportPerson.getApproveStage())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审批阶段名称不能为空"); + } + if (ObjectUtils.isEmpty(reportPerson.getApproveIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审批阶段排序不能为空"); + } + if (ObjectUtils.isEmpty(reportPerson.getApproveDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审批意见说明不能为空"); + } + if (ObjectUtils.isEmpty(reportPerson.getApprovePersonId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审批人不能为空"); + } + PersonQueryDTO personById = basicPersonService.getBasicExperimentPersonById(reportPerson.getApprovePersonId()); + if (ObjectUtils.isEmpty(personById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "审批人不能为空"); + } + //补全数据 + LocalDateTime date = LocalDateTime.now(); + + reportPerson.setApprovePerson(personById.getPersonName()); + reportPerson.setCreateTime(date); + reportPerson.setUpdateTime(date); + reportPerson.setCreateByUserId(currentUserId); + reportPerson.setUpdateByUserId(currentUserId); + reportPerson.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + reportPerson.setApproveStatus(StatusEnum.EXPERIMENT_STATUS_NOT_START.getCode().byteValue()); + + personList.add(reportPerson); + } + List<ReportRiskAssessPerson> insertResult = personRepository.saveAll(personList); + if (insertResult.size() != personInsertBO.size()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "审批人写入失败"); + } + + return BeanCopyUtils.copyBeanList(insertResult, ReportPersonInsertDTO.class); + } + + /** + * 风险评估报告-评估专家 - 修改 + */ + @Override + public List<ReportPersonInsertDTO> updateReportPerson(Long currentUserId, List<ReportPersonAppUpdateBO> personUpdateBO) { + + if (personUpdateBO.size() < 1){ + List<ReportPersonInsertDTO> list= new ArrayList<>(); + return list; + } + + List<ReportRiskAssessPerson> reportPeopleList = BeanCopyUtils.copyBeanList(personUpdateBO, ReportRiskAssessPerson.class); + List<ReportRiskAssessPerson> personList = new ArrayList<>(); + + for (ReportRiskAssessPerson reportPerson : reportPeopleList) { + if (ObjectUtils.isEmpty(reportPerson.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审核人id不能为空"); + } + if (ObjectUtils.isEmpty(reportPerson.getReportId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "用户信息不能为空"); + } + if (ObjectUtils.isEmpty(reportPerson.getApproveStage())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审批阶段名称不能为空"); + } + if (ObjectUtils.isEmpty(reportPerson.getApproveIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审批阶段排序不能为空"); + } + if (ObjectUtils.isEmpty(reportPerson.getApproveDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审批意见说明不能为空"); + } + if (ObjectUtils.isEmpty(reportPerson.getApprovePersonId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审批人不能为空"); + } + if (reportPerson.getApproveStatus() == StatusEnum.REPORT_APPROVED.getCode().byteValue()){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "审批人已经提交审核结果,无法修改信息"); + } + PersonQueryDTO personById = basicPersonService.getBasicExperimentPersonById(reportPerson.getApprovePersonId()); + if (ObjectUtils.isEmpty(personById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "审批人不能为空"); + } + ReportRiskAssessPerson person = personRepository.getPersonById(reportPerson.getId()); + + //补全数据 + LocalDateTime date = LocalDateTime.now(); + + person.setApprovePerson(personById.getPersonName()); + person.setUpdateTime(date); + person.setUpdateByUserId(currentUserId); + person.setApproveIndex(reportPerson.getApproveIndex()); + person.setApproveStage(reportPerson.getApproveStage()); + person.setApproveDesc(reportPerson.getApproveDesc()); + person.setApprovePersonId(reportPerson.getApprovePersonId()); + + personList.add(person); + } + + List<ReportRiskAssessPerson> updateResult = personRepository.saveAll(personList); + if (updateResult.size() != personUpdateBO.size()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "审批人写入失败"); + } + + return BeanCopyUtils.copyBeanList(updateResult, ReportPersonInsertDTO.class); + } + + /** + * 风险评估报告-评估专家 - 查询 + */ + @Override + public ReportPersonInsertDTO getPersonById(Long id) { + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"报告审核人不能为空"); + } + ReportRiskAssessPerson personById = personRepository.getPersonById(id); + if (ObjectUtils.isEmpty(personById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "审批人不存在或已被删除"); + } + return BeanCopyUtils.copyBean(personById, ReportPersonInsertDTO.class); + } + + /** + * 风险评估报告-评估专家 - list + */ + @Override + public List<ReportPersonInsertDTO> getPersonByReportId(Long reportId) { + if (ObjectUtils.isEmpty(reportId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"报告id不能为空"); + } + + List<ReportRiskAssessPerson> personList = personRepository.getPersonByReportId(reportId); + if (ObjectUtils.isEmpty(personList)){ + return null; + } + + return BeanCopyUtils.copyBeanList(personList, ReportPersonInsertDTO.class); + } + + /** + * 风险评估报告-评估专家 + */ + @Override + public List<ReportPersonQueryRespDTO> listPersonByReportId(Long id) { + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"报告id不能为空"); + } + + List<ReportRiskAssessPerson> personList = personRepository.getPersonByReportId(id); + if (ObjectUtils.isEmpty(personList)){ + return null; + } + + return BeanCopyUtils.copyBeanList(personList, ReportPersonQueryRespDTO.class); + } + + /** + * 风险评估报告-评估专家 - 审核 + */ + @Transactional + @Override + public ReportPersonInsertDTO report(Long currentUserId, ReportReqBO reportReqBO) { + + if (ObjectUtils.isEmpty(reportReqBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"报告id不能为空"); + } + if (ObjectUtils.isEmpty(reportReqBO.getApproveStatus())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode() ,"审批状态不能为空"); + } + //获取审核人信息 + ReportRiskAssessPerson personById = personRepository.getPersonById(reportReqBO.getId()); + + LocalDateTime date = LocalDateTime.now(); + + personById.setApproveDesc(reportReqBO.getApproveDesc()); + personById.setApproveTime(date); + personById.setApproveStatus(reportReqBO.getApproveStatus()); + ReportRiskAssessPerson save = personRepository.save(personById); + if (ObjectUtils.isEmpty(save)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "审核失败"); + } + return BeanCopyUtils.copyBean(save, ReportPersonInsertDTO.class); + } + + @Override + public ReportRiskAssessPerson insertOneReportPerson(ReportRiskAssessPerson approvePerson) { + return personRepository.save(approvePerson); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateLecServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateLecServiceImpl.java new file mode 100644 index 0000000..ad3fe9d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateLecServiceImpl.java @@ -0,0 +1,377 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskAssessPlanEvaluateDeleteReqBO; +import com.gkhy.labRiskManage.commons.enums.MethodEnum; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLec; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessLecInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.LecInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.LecQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanEvaluateLecRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanEvaluateLecService; +import com.gkhy.labRiskManage.domain.riskReport.utils.IdentificationMethodCheck; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 评价方法LEC + */ +@Service +public class RiskAssessPlanEvaluateLecServiceImpl implements RiskAssessPlanEvaluateLecService { + + @Autowired + private RiskAssessPlanEvaluateLecRepository lecRepository; + + + /** + * 评价方法LEC - 评价插入 + */ + @Override + public LecInsertDTO insertLec(Long currentUserId, AssessLecInsertBO lecInsertBO) { + + EvaluateInsertDTO insertDTO = new EvaluateInsertDTO(); + insertDTO.setResult(1); + IdentificationMethodCheck methodCheck = new IdentificationMethodCheck(); + + //校验辨识方法是否存在 + int result = methodCheck.identificationMethodCheck(lecInsertBO.getIdentificationId(), lecInsertBO.getIdentificationMethod()); + if (result == 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识方法不存在"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的计划不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getLecL())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LEC_L的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getLecE())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LEC_E的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getLecC())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LEC_C的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getIdentificationId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识方法不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getIdentificationMethod())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识方法类型不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getOriginalLecL())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LEC_L的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getOriginalLecE())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LEC_E的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getOriginalLecC())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LEC_C的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getOriginalRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有风险数值不能为空"); + } + RiskAssessPlanEvaluateLec lecByIdentification = lecRepository.getLecByIdentification(lecInsertBO.getIdentificationId(), lecInsertBO.getIdentificationMethod()); + if (!ObjectUtils.isEmpty(lecByIdentification)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "该辨识已经被评价,无需重复操作"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getEvaluateDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家意见不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getSafeRiskAnalysis())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "安全风险分析内容不能为空"); + } + + BigDecimal valueL = lecInsertBO.getLecL(); + BigDecimal valueE = lecInsertBO.getLecE(); + BigDecimal valueC = lecInsertBO.getLecC(); + BigDecimal value = valueL.multiply(valueE).multiply(valueC); + //BigDecimal类型比较,结果为0是相等 + if (value.compareTo(lecInsertBO.getRiskValue()) != 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值计算有误,无法保存"); + } + + RiskAssessPlanEvaluateLec lec = new RiskAssessPlanEvaluateLec(); + //设置参数 + if (value.compareTo(new BigDecimal(10)) < 0){ + lec.setRiskLevel(MethodEnum.RISK_LEVEL_1.getCode()); + lec.setRiskLevelValue(MethodEnum.RISK_LEVEL_1.getCode()); + lec.setRiskColor(MethodEnum.RISK_LEVEL_1.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_1.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) < 0){ + lec.setRiskLevel(MethodEnum.RISK_LEVEL_2.getCode()); + lec.setRiskLevelValue(MethodEnum.RISK_LEVEL_2.getCode()); + lec.setRiskColor(MethodEnum.RISK_LEVEL_2.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) < 0){ + lec.setRiskLevel(MethodEnum.RISK_LEVEL_3.getCode()); + lec.setRiskLevelValue(MethodEnum.RISK_LEVEL_3.getCode()); + lec.setRiskColor(MethodEnum.RISK_LEVEL_3.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) > 0){ + lec.setRiskLevel(MethodEnum.RISK_LEVEL_4.getCode()); + lec.setRiskLevelValue(MethodEnum.RISK_LEVEL_4.getCode()); + lec.setRiskColor(MethodEnum.RISK_LEVEL_4.getCode()); + } + LocalDateTime date = LocalDateTime.now(); + lec.setAssessPlanId(lecInsertBO.getAssessPlanId()); + lec.setIdentificationId(lecInsertBO.getIdentificationId()); + lec.setIdentificationMethod(lecInsertBO.getIdentificationMethod()); + lec.setLecL(lecInsertBO.getLecL()); + lec.setLecE(lecInsertBO.getLecE()); + lec.setLecC(lecInsertBO.getLecC()); + lec.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + lec.setCreateTime(date); + lec.setUpdateTime(date); + lec.setRiskValue(lecInsertBO.getRiskValue()); + lec.setManageLevel(lecInsertBO.getManageLevel()); + lec.setStatus((byte) 1); + lec.setEvaluateDesc(lecInsertBO.getEvaluateDesc()); + + lec.setEducationMeasure(lecInsertBO.getEducationMeasure()); + lec.setTechnologyMeasure(lecInsertBO.getTechnologyMeasure()); + lec.setManageMeasure(lecInsertBO.getManageMeasure()); + lec.setPersonalProtectionMeasure(lecInsertBO.getPersonalProtectionMeasure()); + lec.setEmergencyMeasure(lecInsertBO.getEmergencyMeasure()); + + lec.setOriginalLecL(lecInsertBO.getOriginalLecL()); + lec.setOriginalLecE(lecInsertBO.getOriginalLecE()); + lec.setOriginalLecC(lecInsertBO.getOriginalLecC()); + lec.setOriginalRiskValue(lecInsertBO.getOriginalRiskValue()); + lec.setOriginalRiskLevelValue(lecInsertBO.getOriginalRiskLevelValue()); + lec.setOriginalRiskLevel(lecInsertBO.getOriginalRiskLevel()); + lec.setOriginalRiskColor(lecInsertBO.getOriginalRiskColor()); + lec.setOriginalManageLevel(lecInsertBO.getOriginalManageLevel()); + lec.setAdviseTechnologyMeasure(lecInsertBO.getAdviseTechnologyMeasure()); + lec.setAdviseManageMeasure(lecInsertBO.getAdviseManageMeasure()); + lec.setAdviseEmergencyMeasure(lecInsertBO.getAdviseEmergencyMeasure()); + lec.setAdviseEducationMeasure(lecInsertBO.getAdviseEducationMeasure()); + lec.setAdvisePersonalProtectionMeasure(lecInsertBO.getAdvisePersonalProtectionMeasure()); + lec.setSafeRiskAnalysis(lecInsertBO.getSafeRiskAnalysis()); + + RiskAssessPlanEvaluateLec insertResult = lecRepository.save(lec); + + return BeanCopyUtils.copyBean(insertResult, LecInsertDTO.class); + } + + /** + * 评价方法LEC - 修改 + */ + @Override + public LecInsertDTO updateLec(Long currentUserId, AssessLecInsertBO lecInsertBO) { + + EvaluateInsertDTO insertDTO = new EvaluateInsertDTO(); + insertDTO.setResult(1); + + if (ObjectUtils.isEmpty(lecInsertBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的评价内容不能为空"); + } + RiskAssessPlanEvaluateLec lecById = lecRepository.getLecById(lecInsertBO.getId()); + if (ObjectUtils.isEmpty(lecById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的评价不存在"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的计划不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getLecL())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LEC_L的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getLecE())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LEC_E的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getLecC())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LEC_C的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getOriginalLecL())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LEC_L的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getOriginalLecE())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LEC_E的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getOriginalLecC())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LEC_C的数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getOriginalRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有风险数值不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getEvaluateDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家意见不能为空"); + } + if (ObjectUtils.isEmpty(lecInsertBO.getSafeRiskAnalysis())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "安全风险分析内容不能为空"); + } + + BigDecimal valueL = lecInsertBO.getLecL(); + BigDecimal valueE = lecInsertBO.getLecE(); + BigDecimal valueC = lecInsertBO.getLecC(); + BigDecimal value = valueL.multiply(valueE).multiply(valueC); + //BigDecimal类型比较,结果为0是相等 + if (value.compareTo(lecInsertBO.getRiskValue()) != 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值计算有误,无法保存"); + } + //设置参数 + RiskAssessPlanEvaluateLec lec = BeanCopyUtils.copyBean(lecById, RiskAssessPlanEvaluateLec.class); + LocalDateTime date = LocalDateTime.now(); + if (value.compareTo(new BigDecimal(10)) < 0){ + lec.setRiskLevel(MethodEnum.RISK_LEVEL_1.getCode()); + lec.setRiskLevelValue(MethodEnum.RISK_LEVEL_1.getCode()); + lec.setRiskColor(MethodEnum.RISK_LEVEL_1.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_1.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) < 0){ + lec.setRiskLevel(MethodEnum.RISK_LEVEL_2.getCode()); + lec.setRiskLevelValue(MethodEnum.RISK_LEVEL_2.getCode()); + lec.setRiskColor(MethodEnum.RISK_LEVEL_2.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) < 0){ + lec.setRiskLevel(MethodEnum.RISK_LEVEL_3.getCode()); + lec.setRiskLevelValue(MethodEnum.RISK_LEVEL_3.getCode()); + lec.setRiskColor(MethodEnum.RISK_LEVEL_3.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) > 0){ + lec.setRiskLevel(MethodEnum.RISK_LEVEL_4.getCode()); + lec.setRiskLevelValue(MethodEnum.RISK_LEVEL_4.getCode()); + lec.setRiskColor(MethodEnum.RISK_LEVEL_4.getCode()); + } + lec.setLecL(lecInsertBO.getLecL()); + lec.setLecE(lecInsertBO.getLecE()); + lec.setLecC(lecInsertBO.getLecC()); + lec.setUpdateTime(date); + lec.setRiskValue(lecInsertBO.getRiskValue()); + lec.setManageLevel(lecInsertBO.getManageLevel()); + lec.setEvaluateDesc(lecInsertBO.getEvaluateDesc()); + + lec.setEducationMeasure(lecInsertBO.getEducationMeasure()); + lec.setTechnologyMeasure(lecInsertBO.getTechnologyMeasure()); + lec.setManageMeasure(lecInsertBO.getManageMeasure()); + lec.setPersonalProtectionMeasure(lecInsertBO.getPersonalProtectionMeasure()); + lec.setEmergencyMeasure(lecInsertBO.getEmergencyMeasure()); + + lec.setOriginalLecL(lecInsertBO.getOriginalLecL()); + lec.setOriginalLecE(lecInsertBO.getOriginalLecE()); + lec.setOriginalLecC(lecInsertBO.getOriginalLecC()); + lec.setOriginalRiskValue(lecInsertBO.getOriginalRiskValue()); + lec.setOriginalRiskLevelValue(lecInsertBO.getOriginalRiskLevelValue()); + lec.setOriginalRiskLevel(lecInsertBO.getOriginalRiskLevel()); + lec.setOriginalRiskColor(lecInsertBO.getOriginalRiskColor()); + lec.setOriginalManageLevel(lecInsertBO.getOriginalManageLevel()); + lec.setAdviseTechnologyMeasure(lecInsertBO.getAdviseTechnologyMeasure()); + lec.setAdviseManageMeasure(lecInsertBO.getAdviseManageMeasure()); + lec.setAdviseEmergencyMeasure(lecInsertBO.getAdviseEmergencyMeasure()); + lec.setAdviseEducationMeasure(lecInsertBO.getAdviseEducationMeasure()); + lec.setAdvisePersonalProtectionMeasure(lecInsertBO.getAdvisePersonalProtectionMeasure()); + lec.setSafeRiskAnalysis(lecInsertBO.getSafeRiskAnalysis()); + + RiskAssessPlanEvaluateLec insertResult = lecRepository.save(lec); + + return BeanCopyUtils.copyBean(insertResult, LecInsertDTO.class); + } + + /** + * 评价方法LEC - 查询 + */ + @Override + public LecQueryDTO getLecByPlanId(Long id) { + + RiskAssessPlanEvaluateLec lecById = lecRepository.getLecById(id); + if (ObjectUtils.isEmpty(lecById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "lec评价方法不存在或已被删除"); + } + return BeanCopyUtils.copyBean(lecById, LecQueryDTO.class); + } + + /** + * 评价方法LEC - 删除 + */ + @Override + public EvaluateMethodDeleteDTO deleteLecByPlanId(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO) { + + if (ObjectUtils.isEmpty(deleteReqBO.getLecId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的评价项目不能为空"); + } + RiskAssessPlanEvaluateLec lecById = lecRepository.getLecById(deleteReqBO.getLecId()); + + if (ObjectUtils.isEmpty(lecById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的评价项目为空,或已被删除"); + } + if (!lecById.getAssessPlanId().equals(deleteReqBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划与评价项不匹配,无法删除"); + } + + EvaluateMethodDeleteDTO deleteDTO = new EvaluateMethodDeleteDTO(); + + LocalDateTime date = LocalDateTime.now(); + lecById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + lecById.setUpdateTime(date); + + RiskAssessPlanEvaluateLec deleteResult = lecRepository.save(lecById); + + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价方法不存在或已被删除"); + } + deleteDTO.setResult(StatusEnum.DELETED.getCode().byteValue()); + + return deleteDTO; + } + + /** + * 评价方法LEC - list + */ + @Override + public List<LecQueryDTO> listLecByPlanId(Long id) { + List<RiskAssessPlanEvaluateLec> lecList = lecRepository.listLecByPlanId(id); + return BeanCopyUtils.copyBeanList(lecList, LecQueryDTO.class); + } + + @Override + public List<RiskAssessPlanEvaluateLec> getLecByIds(List<Long> assessPlanIds) { + List<RiskAssessPlanEvaluateLec> lecByIds = lecRepository.getLecByIds(assessPlanIds); + return lecByIds; + } + + @Override + public int deleteLecByAssessPlanId(Long assessPlanId) { + + List<RiskAssessPlanEvaluateLec> lecList = lecRepository.getbyByAssessPlanId(assessPlanId); + if (lecList.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价方法不存在或已被删除"); + } + int i = 0; + for (RiskAssessPlanEvaluateLec lec : lecList) { + lec.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + RiskAssessPlanEvaluateLec save = lecRepository.save(lec); + if (ObjectUtils.isEmpty(save)){ + i = 1; + } + } + return i; + } + + @Override + public int deleteLecByPlan(Long id) { + + List<RiskAssessPlanEvaluateLec> lecListByPlanId = lecRepository.getLecByPlanId(id); + if (ObjectUtils.isEmpty(lecListByPlanId)){ + return StatusEnum.SUCCESS.getCode(); + } + for (RiskAssessPlanEvaluateLec riskAssessPlanEvaluateLec : lecListByPlanId) { + riskAssessPlanEvaluateLec.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + } + List<RiskAssessPlanEvaluateLec> result = lecRepository.saveAll(lecListByPlanId); + if (result.size() != lecListByPlanId.size()){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + @Override + public RiskAssessPlanEvaluateLec getLecByIdentificationId(Long identificationId, Byte identificationMethod) { + return lecRepository.getLecByIdentification(identificationId, identificationMethod); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateLsServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateLsServiceImpl.java new file mode 100644 index 0000000..13fddbb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateLsServiceImpl.java @@ -0,0 +1,341 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskAssessPlanEvaluateDeleteReqBO; +import com.gkhy.labRiskManage.commons.enums.MethodEnum; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLec; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLs; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessLSInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanEvaluateLsRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanEvaluateLsService; +import com.gkhy.labRiskManage.domain.riskReport.utils.IdentificationMethodCheck; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 评价方法LS + */ +@Service +public class RiskAssessPlanEvaluateLsServiceImpl implements RiskAssessPlanEvaluateLsService { + + @Autowired + private RiskAssessPlanEvaluateLsRepository lsRepository; + + /** + * 评价方法LS - 插入 + */ + @Override + public LsInsertDTO insertLs(Long currentUserId, AssessLSInsertBO lsInsertBO) { + + EvaluateInsertDTO insertDTO = new EvaluateInsertDTO(); + insertDTO.setResult(1); + IdentificationMethodCheck methodCheck = new IdentificationMethodCheck(); + + //校验辨识方法是否存在 + int result = methodCheck.identificationMethodCheck(lsInsertBO.getIdentificationId(), lsInsertBO.getIdentificationMethod()); + if (result == 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识方法不存在"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的计划不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getLsL())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LS_L的数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getLsS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LS_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getOriginalLsL())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LS_L的数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getOriginalLsS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LS_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getOriginalRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有风险数值不能为空"); + } + RiskAssessPlanEvaluateLs lsByIdentification = lsRepository.getLsByIdentification(lsInsertBO.getIdentificationId(), lsInsertBO.getIdentificationMethod()); + if (!ObjectUtils.isEmpty(lsByIdentification)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "该辨识已经被评价,无需重复操作"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getEvaluateDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家意见不能为空"); + } + BigDecimal value = lsInsertBO.getLsL().multiply(lsInsertBO.getLsS()); + //BigDecimal类型比较,结果为0是相等 + if (value.compareTo(lsInsertBO.getRiskValue()) != 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值计算有误,无法保存"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getSafeRiskAnalysis())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "安全风险分析内容不能为空"); + } + + RiskAssessPlanEvaluateLs ls = new RiskAssessPlanEvaluateLs(); + //设置参数 + if (value.compareTo(new BigDecimal(10)) < 0){ + ls.setRiskLevel(MethodEnum.RISK_LEVEL_1.getCode()); + ls.setRiskLevelValue(MethodEnum.RISK_LEVEL_1.getCode()); + ls.setRiskColor(MethodEnum.RISK_LEVEL_1.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_1.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) < 0){ + ls.setRiskLevel(MethodEnum.RISK_LEVEL_2.getCode()); + ls.setRiskLevelValue(MethodEnum.RISK_LEVEL_2.getCode()); + ls.setRiskColor(MethodEnum.RISK_LEVEL_2.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) < 0){ + ls.setRiskLevel(MethodEnum.RISK_LEVEL_3.getCode()); + ls.setRiskLevelValue(MethodEnum.RISK_LEVEL_3.getCode()); + ls.setRiskColor(MethodEnum.RISK_LEVEL_3.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) > 0){ + ls.setRiskLevel(MethodEnum.RISK_LEVEL_4.getCode()); + ls.setRiskLevelValue(MethodEnum.RISK_LEVEL_4.getCode()); + ls.setRiskColor(MethodEnum.RISK_LEVEL_4.getCode()); + } + LocalDateTime date = LocalDateTime.now(); + ls.setIdentificationId(lsInsertBO.getIdentificationId()); + ls.setIdentificationMethod(lsInsertBO.getIdentificationMethod()); + ls.setAssessPlanId(lsInsertBO.getAssessPlanId()); + ls.setLsL(lsInsertBO.getLsL()); + ls.setLsS(lsInsertBO.getLsS()); + ls.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + ls.setCreateTime(date); + ls.setUpdateTime(date); + ls.setRiskValue(lsInsertBO.getRiskValue()); + ls.setManageLevel(lsInsertBO.getManageLevel()); + ls.setStatus((byte) 1); + ls.setEvaluateDesc(lsInsertBO.getEvaluateDesc()); + + ls.setEducationMeasure(lsInsertBO.getEducationMeasure()); + ls.setTechnologyMeasure(lsInsertBO.getTechnologyMeasure()); + ls.setManageMeasure(lsInsertBO.getManageMeasure()); + ls.setPersonalProtectionMeasure(lsInsertBO.getPersonalProtectionMeasure()); + ls.setEmergencyMeasure(lsInsertBO.getEmergencyMeasure()); + + ls.setOriginalLsL(lsInsertBO.getOriginalLsL()); + ls.setOriginalLsS(lsInsertBO.getOriginalLsS()); + ls.setOriginalRiskValue(lsInsertBO.getOriginalRiskValue()); + ls.setOriginalRiskLevelValue(lsInsertBO.getOriginalRiskLevelValue()); + ls.setOriginalRiskLevel(lsInsertBO.getOriginalRiskLevel()); + ls.setOriginalRiskColor(lsInsertBO.getOriginalRiskColor()); + ls.setOriginalManageLevel(lsInsertBO.getOriginalManageLevel()); + ls.setAdviseTechnologyMeasure(lsInsertBO.getAdviseTechnologyMeasure()); + ls.setAdviseManageMeasure(lsInsertBO.getAdviseManageMeasure()); + ls.setAdviseEmergencyMeasure(lsInsertBO.getAdviseEmergencyMeasure()); + ls.setAdviseEducationMeasure(lsInsertBO.getAdviseEducationMeasure()); + ls.setAdvisePersonalProtectionMeasure(lsInsertBO.getAdvisePersonalProtectionMeasure()); + ls.setSafeRiskAnalysis(lsInsertBO.getSafeRiskAnalysis()); + + RiskAssessPlanEvaluateLs insertResult = lsRepository.save(ls); + + return BeanCopyUtils.copyBean(insertResult, LsInsertDTO.class); + } + + /** + * 评价方法LS - 修改 + */ + @Override + public LecInsertDTO updateLs(Long currentUserId, AssessLSInsertBO lsInsertBO) { + + EvaluateInsertDTO insertDTO = new EvaluateInsertDTO(); + insertDTO.setResult(1); + + if (ObjectUtils.isEmpty(lsInsertBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的评价内容不能为空"); + } + RiskAssessPlanEvaluateLs lsById = lsRepository.getLsById(lsInsertBO.getId()); + if (ObjectUtils.isEmpty(lsById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的评价不存在"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的计划不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getLsL())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LS_L的数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getLsS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "LS_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getEvaluateDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家意见不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getOriginalLsL())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LS_L的数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getOriginalLsS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有LS_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getOriginalRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有风险数值不能为空"); + } + BigDecimal value = lsInsertBO.getLsL().multiply(lsInsertBO.getLsS()); + //BigDecimal类型比较,结果为0是相等 + if (value.compareTo(lsInsertBO.getRiskValue()) != 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值计算有误,无法保存"); + } + if (ObjectUtils.isEmpty(lsInsertBO.getSafeRiskAnalysis())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "安全风险分析内容不能为空"); + } + + //设置参数 + LocalDateTime date = LocalDateTime.now(); + RiskAssessPlanEvaluateLs ls = BeanCopyUtils.copyBean(lsById, RiskAssessPlanEvaluateLs.class); + if (value.compareTo(new BigDecimal(10)) < 0){ + ls.setRiskLevel(MethodEnum.RISK_LEVEL_1.getCode()); + ls.setRiskLevelValue(MethodEnum.RISK_LEVEL_1.getCode()); + ls.setRiskColor(MethodEnum.RISK_LEVEL_1.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_1.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) < 0){ + ls.setRiskLevel(MethodEnum.RISK_LEVEL_2.getCode()); + ls.setRiskLevelValue(MethodEnum.RISK_LEVEL_2.getCode()); + ls.setRiskColor(MethodEnum.RISK_LEVEL_2.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) < 0){ + ls.setRiskLevel(MethodEnum.RISK_LEVEL_3.getCode()); + ls.setRiskLevelValue(MethodEnum.RISK_LEVEL_3.getCode()); + ls.setRiskColor(MethodEnum.RISK_LEVEL_3.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) > 0){ + ls.setRiskLevel(MethodEnum.RISK_LEVEL_4.getCode()); + ls.setRiskLevelValue(MethodEnum.RISK_LEVEL_4.getCode()); + ls.setRiskColor(MethodEnum.RISK_LEVEL_4.getCode()); + } + ls.setLsL(lsInsertBO.getLsL()); + ls.setLsS(lsInsertBO.getLsS()); + ls.setUpdateTime(date); + ls.setRiskValue(lsInsertBO.getRiskValue()); + ls.setManageLevel(lsInsertBO.getManageLevel()); + ls.setEvaluateDesc(lsInsertBO.getEvaluateDesc()); + + ls.setEducationMeasure(lsInsertBO.getEducationMeasure()); + ls.setTechnologyMeasure(lsInsertBO.getTechnologyMeasure()); + ls.setManageMeasure(lsInsertBO.getManageMeasure()); + ls.setPersonalProtectionMeasure(lsInsertBO.getPersonalProtectionMeasure()); + ls.setEmergencyMeasure(lsInsertBO.getEmergencyMeasure()); + + ls.setOriginalLsL(lsInsertBO.getOriginalLsL()); + ls.setOriginalLsS(lsInsertBO.getOriginalLsS()); + ls.setOriginalRiskValue(lsInsertBO.getOriginalRiskValue()); + ls.setOriginalRiskLevelValue(lsInsertBO.getOriginalRiskLevelValue()); + ls.setOriginalRiskLevel(lsInsertBO.getOriginalRiskLevel()); + ls.setOriginalRiskColor(lsInsertBO.getOriginalRiskColor()); + ls.setOriginalManageLevel(lsInsertBO.getOriginalManageLevel()); + ls.setAdviseTechnologyMeasure(lsInsertBO.getAdviseTechnologyMeasure()); + ls.setAdviseManageMeasure(lsInsertBO.getAdviseManageMeasure()); + ls.setAdviseEmergencyMeasure(lsInsertBO.getAdviseEmergencyMeasure()); + ls.setAdviseEducationMeasure(lsInsertBO.getAdviseEducationMeasure()); + ls.setAdvisePersonalProtectionMeasure(lsInsertBO.getAdvisePersonalProtectionMeasure()); + ls.setSafeRiskAnalysis(lsInsertBO.getSafeRiskAnalysis()); + + RiskAssessPlanEvaluateLs insertResult = lsRepository.save(ls); + + return BeanCopyUtils.copyBean(insertResult, LecInsertDTO.class); + } + + /** + * 评价方法LS - 查询 + */ + @Override + public LsQueryDTO getLsByPlanId(Long id) { + + RiskAssessPlanEvaluateLs lsById = lsRepository.getLsById(id); + if (ObjectUtils.isEmpty(lsById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "ls评价方法不存在或已被删除"); + } + return BeanCopyUtils.copyBean(lsById, LsQueryDTO.class); + } + + /** + * 评价方法LS - 删除 + */ + @Override + public EvaluateMethodDeleteDTO deleteLsByPlanId(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO) { + + if (ObjectUtils.isEmpty(deleteReqBO.getLsId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的评价项目不能为空"); + } + RiskAssessPlanEvaluateLs lsById = lsRepository.getLsById(deleteReqBO.getLsId()); + if (ObjectUtils.isEmpty(lsById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的评价项目为空,或已被删除"); + } + if (!lsById.getAssessPlanId().equals(deleteReqBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划与评价项不匹配,无法删除"); + } + + EvaluateMethodDeleteDTO deleteDTO = new EvaluateMethodDeleteDTO(); + + lsById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + LocalDateTime date = LocalDateTime.now(); + lsById.setUpdateTime(date); + + RiskAssessPlanEvaluateLs deleteResult = lsRepository.save(lsById); + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价方法不存在或已被删除"); + } + deleteDTO.setResult(StatusEnum.DELETED.getCode().byteValue()); + + return deleteDTO; + } + + /** + * 评价方法LS - list + */ + @Override + public List<LsQueryDTO> listLsByPlanId(Long id) { + List<RiskAssessPlanEvaluateLs> lsList = lsRepository.listLsByPlanId(id); + return BeanCopyUtils.copyBeanList(lsList, LsQueryDTO.class); + } + + @Override + public List<RiskAssessPlanEvaluateLs> getLsByIds(List<Long> assessPlanIds) { + return lsRepository.getLsByIds(assessPlanIds); + } + + @Override + public int deleteLsByAssessPlanId(Long id) { + + List<RiskAssessPlanEvaluateLs> lsList = lsRepository.getLsByAssessPlanId(id); + if (lsList.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价方法不存在或已被删除"); + } + int i = 0; + for (RiskAssessPlanEvaluateLs ls : lsList) { + ls.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + RiskAssessPlanEvaluateLs save = lsRepository.save(ls); + if (ObjectUtils.isEmpty(save)){ + i = 1; + } + } + return i; + } + + @Override + public int deleteLsByPlan(Long id) { + List<RiskAssessPlanEvaluateLs> lsListByPlanId = lsRepository.getLsByPlanId(id); + if (ObjectUtils.isEmpty(lsListByPlanId)){ + return StatusEnum.SUCCESS.getCode(); + } + for (RiskAssessPlanEvaluateLs riskAssessPlanEvaluateLs : lsListByPlanId) { + riskAssessPlanEvaluateLs.setEvaluateDesc(StatusEnum.DELETED.getDesc()); + } + List<RiskAssessPlanEvaluateLs> result = lsRepository.saveAll(lsListByPlanId); + if (result.size() != lsListByPlanId.size()){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + @Override + public RiskAssessPlanEvaluateLs getLsByIdentificationId(Long id, Byte identificationMethod) { + return lsRepository.getLsByIdentification(id, identificationMethod); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateMesServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateMesServiceImpl.java new file mode 100644 index 0000000..083100d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateMesServiceImpl.java @@ -0,0 +1,360 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskAssessPlanEvaluateDeleteReqBO; +import com.gkhy.labRiskManage.commons.enums.MethodEnum; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLec; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateLs; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateMes; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessMesInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.MesInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.MesQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanEvaluateMesRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanEvaluateMesService; +import com.gkhy.labRiskManage.domain.riskReport.utils.IdentificationMethodCheck; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 评价方法MES + */ +@Service +public class RiskAssessPlanEvaluateMesServiceImpl implements RiskAssessPlanEvaluateMesService { + + @Autowired + private RiskAssessPlanEvaluateMesRepository mesRepository; + + /** + * 评价方法MES - 插入 + */ + @Override + public MesInsertDTO InsertMes(Long currentUserId, AssessMesInsertBO mesInsertBO) { + + EvaluateInsertDTO insertDTO = new EvaluateInsertDTO(); + insertDTO.setResult(1); + IdentificationMethodCheck methodCheck = new IdentificationMethodCheck(); + + //校验辨识方法是否存在 + int result = methodCheck.identificationMethodCheck(mesInsertBO.getIdentificationId(), mesInsertBO.getIdentificationMethod()); + if (result == 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识方法不存在"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的计划不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getMesM())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "MES_M的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getMesE())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "MES_E的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getMesS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "MES_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getOriginalMesM())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有MES_M的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getOriginalMesE())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有MES_E的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getOriginalMesS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有MES_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getOriginalRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有风险数值不能为空"); + } + RiskAssessPlanEvaluateMes mesByIdentification = mesRepository.getMesByIdentification(mesInsertBO.getIdentificationId(), mesInsertBO.getIdentificationMethod()); + if (!ObjectUtils.isEmpty(mesByIdentification)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "该辨识已经被评价,无需重复操作"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getEvaluateDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家意见不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getSafeRiskAnalysis())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "安全风险分析内容不能为空"); + } + + BigDecimal value = mesInsertBO.getMesM().multiply(mesInsertBO.getMesE()).multiply(mesInsertBO.getMesS()); + //BigDecimal类型比较,结果为0是相等 + if (value.compareTo(mesInsertBO.getRiskValue()) != 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值计算有误,无法保存"); + } + //设置参数 + LocalDateTime date = LocalDateTime.now(); + RiskAssessPlanEvaluateMes mes = new RiskAssessPlanEvaluateMes(); + if (value.compareTo(new BigDecimal(10)) < 0){ + mes.setRiskLevel(MethodEnum.RISK_LEVEL_1.getCode()); + mes.setRiskLevelValue(MethodEnum.RISK_LEVEL_1.getCode()); + mes.setRiskColor(MethodEnum.RISK_LEVEL_1.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_1.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) < 0){ + mes.setRiskLevel(MethodEnum.RISK_LEVEL_2.getCode()); + mes.setRiskLevelValue(MethodEnum.RISK_LEVEL_2.getCode()); + mes.setRiskColor(MethodEnum.RISK_LEVEL_2.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) < 0){ + mes.setRiskLevel(MethodEnum.RISK_LEVEL_3.getCode()); + mes.setRiskLevelValue(MethodEnum.RISK_LEVEL_3.getCode()); + mes.setRiskColor(MethodEnum.RISK_LEVEL_3.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) > 0){ + mes.setRiskLevel(MethodEnum.RISK_LEVEL_4.getCode()); + mes.setRiskLevelValue(MethodEnum.RISK_LEVEL_4.getCode()); + mes.setRiskColor(MethodEnum.RISK_LEVEL_4.getCode()); + } + mes.setIdentificationId(mesInsertBO.getIdentificationId()); + mes.setIdentificationMethod(mesInsertBO.getIdentificationMethod()); + mes.setAssessPlanId(mesInsertBO.getAssessPlanId()); + mes.setMesM(mesInsertBO.getMesM()); + mes.setMesE(mesInsertBO.getMesE()); + mes.setMesS(mesInsertBO.getMesS()); + mes.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + mes.setCreateTime(date); + mes.setUpdateTime(date); + mes.setRiskValue(mesInsertBO.getRiskValue()); + mes.setManageLevel(mesInsertBO.getManageLevel()); + mes.setStatus((byte) 1); + mes.setEvaluateDesc(mesInsertBO.getEvaluateDesc()); + + mes.setEducationMeasure(mesInsertBO.getEducationMeasure()); + mes.setTechnologyMeasure(mesInsertBO.getTechnologyMeasure()); + mes.setManageMeasure(mesInsertBO.getManageMeasure()); + mes.setPersonalProtectionMeasure(mesInsertBO.getPersonalProtectionMeasure()); + mes.setEmergencyMeasure(mesInsertBO.getEmergencyMeasure()); + + mes.setOriginalMesM(mesInsertBO.getOriginalMesM()); + mes.setOriginalMesE(mesInsertBO.getOriginalMesE()); + mes.setOriginalMesS(mesInsertBO.getOriginalMesS()); + mes.setOriginalRiskValue(mesInsertBO.getOriginalRiskValue()); + mes.setOriginalRiskLevelValue(mesInsertBO.getOriginalRiskLevelValue()); + mes.setOriginalRiskLevel(mesInsertBO.getOriginalRiskLevel()); + mes.setOriginalRiskColor(mesInsertBO.getOriginalRiskColor()); + mes.setOriginalManageLevel(mesInsertBO.getOriginalManageLevel()); + mes.setAdviseTechnologyMeasure(mesInsertBO.getAdviseTechnologyMeasure()); + mes.setAdviseManageMeasure(mesInsertBO.getAdviseManageMeasure()); + mes.setAdviseEmergencyMeasure(mesInsertBO.getAdviseEmergencyMeasure()); + mes.setAdviseEducationMeasure(mesInsertBO.getAdviseEducationMeasure()); + mes.setAdvisePersonalProtectionMeasure(mesInsertBO.getAdvisePersonalProtectionMeasure()); + mes.setSafeRiskAnalysis(mesInsertBO.getSafeRiskAnalysis()); + + RiskAssessPlanEvaluateMes insertResult = mesRepository.save(mes); + + return BeanCopyUtils.copyBean(insertResult, MesInsertDTO.class); + } + + /** + * 评价方法MES - 修改 + */ + @Override + public MesInsertDTO updateMes(Long currentUserId, AssessMesInsertBO mesInsertBO) { + + EvaluateInsertDTO insertDTO = new EvaluateInsertDTO(); + insertDTO.setResult(1); + + if (ObjectUtils.isEmpty(mesInsertBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的评价内容不能为空"); + } + RiskAssessPlanEvaluateMes mesById = mesRepository.getMesById(mesInsertBO.getId()); + if (ObjectUtils.isEmpty(mesById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的评价不存在"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的计划不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getMesM())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "MES_M的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getMesE())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "MES_E的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getMesS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "MES_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getEvaluateDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家意见不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getOriginalMesM())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有MES_M的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getOriginalMesE())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有MES_E的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getOriginalMesS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有MES_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(mesInsertBO.getOriginalRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有风险数值不能为空"); + } + BigDecimal value = mesInsertBO.getMesM().multiply(mesInsertBO.getMesE()).multiply(mesInsertBO.getMesS()); + //BigDecimal类型比较,结果为0是相等 + if (value.compareTo(mesInsertBO.getRiskValue()) != 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值计算有误,无法保存"); + } + //设置参数 + LocalDateTime date = LocalDateTime.now(); + RiskAssessPlanEvaluateMes mes = BeanCopyUtils.copyBean(mesById, RiskAssessPlanEvaluateMes.class); + if (value.compareTo(new BigDecimal(10)) < 0){ + mes.setRiskLevel(MethodEnum.RISK_LEVEL_1.getCode()); + mes.setRiskLevelValue(MethodEnum.RISK_LEVEL_1.getCode()); + mes.setRiskColor(MethodEnum.RISK_LEVEL_1.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_1.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) < 0){ + mes.setRiskLevel(MethodEnum.RISK_LEVEL_2.getCode()); + mes.setRiskLevelValue(MethodEnum.RISK_LEVEL_2.getCode()); + mes.setRiskColor(MethodEnum.RISK_LEVEL_2.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) < 0){ + mes.setRiskLevel(MethodEnum.RISK_LEVEL_3.getCode()); + mes.setRiskLevelValue(MethodEnum.RISK_LEVEL_3.getCode()); + mes.setRiskColor(MethodEnum.RISK_LEVEL_3.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) > 0){ + mes.setRiskLevel(MethodEnum.RISK_LEVEL_4.getCode()); + mes.setRiskLevelValue(MethodEnum.RISK_LEVEL_4.getCode()); + mes.setRiskColor(MethodEnum.RISK_LEVEL_4.getCode()); + } + mes.setMesM(mesInsertBO.getMesM()); + mes.setMesE(mesInsertBO.getMesE()); + mes.setMesS(mesInsertBO.getMesS()); + mes.setUpdateTime(date); + mes.setRiskValue(mesInsertBO.getRiskValue()); + mes.setManageLevel(mesInsertBO.getManageLevel()); + mes.setMesE(mesInsertBO.getMesE()); + mes.setMesM(mesInsertBO.getMesM()); + mes.setMesS(mesInsertBO.getMesS()); + mes.setEvaluateDesc(mesInsertBO.getEvaluateDesc()); + + mes.setEducationMeasure(mesInsertBO.getEducationMeasure()); + mes.setTechnologyMeasure(mesInsertBO.getTechnologyMeasure()); + mes.setManageMeasure(mesInsertBO.getManageMeasure()); + mes.setPersonalProtectionMeasure(mesInsertBO.getPersonalProtectionMeasure()); + mes.setEmergencyMeasure(mesInsertBO.getEmergencyMeasure()); + + mes.setOriginalMesM(mesInsertBO.getOriginalMesM()); + mes.setOriginalMesE(mesInsertBO.getOriginalMesE()); + mes.setOriginalMesS(mesInsertBO.getOriginalMesS()); + mes.setOriginalRiskValue(mesInsertBO.getOriginalRiskValue()); + mes.setOriginalRiskLevelValue(mesInsertBO.getOriginalRiskLevelValue()); + mes.setOriginalRiskLevel(mesInsertBO.getOriginalRiskLevel()); + mes.setOriginalRiskColor(mesInsertBO.getOriginalRiskColor()); + mes.setOriginalManageLevel(mesInsertBO.getOriginalManageLevel()); + mes.setAdviseTechnologyMeasure(mesInsertBO.getAdviseTechnologyMeasure()); + mes.setAdviseManageMeasure(mesInsertBO.getAdviseManageMeasure()); + mes.setAdviseEmergencyMeasure(mesInsertBO.getAdviseEmergencyMeasure()); + mes.setAdviseEducationMeasure(mesInsertBO.getAdviseEducationMeasure()); + mes.setAdvisePersonalProtectionMeasure(mesInsertBO.getAdvisePersonalProtectionMeasure()); + mes.setSafeRiskAnalysis(mesInsertBO.getSafeRiskAnalysis()); + + RiskAssessPlanEvaluateMes insertResult = mesRepository.save(mes); + + return BeanCopyUtils.copyBean(insertResult, MesInsertDTO.class); + } + + /** + * 评价方法MES - 查询 + */ + @Override + public MesQueryDTO getMesByPlanId(Long id) { + + RiskAssessPlanEvaluateMes mesById = mesRepository.getMesById(id); + if (ObjectUtils.isEmpty(mesById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "mes评价方法不存在或已被删除"); + } + return BeanCopyUtils.copyBean(mesById, MesQueryDTO.class); + } + + /** + * 评价方法MES - 删除 + */ + @Override + public EvaluateMethodDeleteDTO deleteMesByPlanId(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO) { + + if (ObjectUtils.isEmpty(deleteReqBO.getMesId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的评价项目不能为空"); + } + RiskAssessPlanEvaluateMes mesById = mesRepository.getMesById(deleteReqBO.getMesId()); + if (ObjectUtils.isEmpty(mesById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的评价项目为空,或已被删除"); + } + if (!mesById.getAssessPlanId().equals(deleteReqBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划与评价项不匹配,无法删除"); + } + + EvaluateMethodDeleteDTO deleteDTO = new EvaluateMethodDeleteDTO(); + + mesById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + LocalDateTime date = LocalDateTime.now(); + mesById.setUpdateTime(date); + + RiskAssessPlanEvaluateMes deleteResult = mesRepository.save(mesById); + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价方法不存在或已被删除"); + } + deleteDTO.setResult(StatusEnum.DELETED.getCode().byteValue()); + + return deleteDTO; + } + + /** + * 评价方法MES - list + */ + @Override + public List<MesQueryDTO> listMesByPlanId(Long id) { + List<RiskAssessPlanEvaluateMes> mesList = mesRepository.listMesByPlanId(id); + return BeanCopyUtils.copyBeanList(mesList, MesQueryDTO.class); + } + + @Override + public List<RiskAssessPlanEvaluateMes> getMesByIds(List<Long> assessPlanIds) { + return mesRepository.getMesByIds(assessPlanIds); + } + + @Override + public int deleteMesByAssessPlanId(Long id) { + + List<RiskAssessPlanEvaluateMes> mesList = mesRepository.getMesByAssessPlanId(id); + if (mesList.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价方法不存在或已被删除"); + } + int i = 0; + for (RiskAssessPlanEvaluateMes mes : mesList) { + mes.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + RiskAssessPlanEvaluateMes save = mesRepository.save(mes); + if (ObjectUtils.isEmpty(save)){ + i = 1; + } + } + return i; + } + + @Override + public int deleteMesByPlan(Long id) { + List<RiskAssessPlanEvaluateMes> mesListByPlanId = mesRepository.getMesByPlanId(id); + if (ObjectUtils.isEmpty(mesListByPlanId)){ + return StatusEnum.SUCCESS.getCode(); + } + for (RiskAssessPlanEvaluateMes riskAssessPlanEvaluateMes : mesListByPlanId) { + riskAssessPlanEvaluateMes.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + } + List<RiskAssessPlanEvaluateMes> result = mesRepository.saveAll(mesListByPlanId); + if (result.size() != mesListByPlanId.size()){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + @Override + public RiskAssessPlanEvaluateMes getMesByIdentificationId(Long id, Byte identificationMethod) { + return mesRepository.getMesByIdentification(id, identificationMethod); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateRsServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateRsServiceImpl.java new file mode 100644 index 0000000..a04c7a4 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanEvaluateRsServiceImpl.java @@ -0,0 +1,344 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskAssessPlanEvaluateDeleteReqBO; +import com.gkhy.labRiskManage.commons.enums.MethodEnum; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanEvaluateRs; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.AssessRsInsertBO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.EvaluateMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.RsInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.RsQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanEvaluateRsRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanEvaluateRsService; +import com.gkhy.labRiskManage.domain.riskReport.utils.IdentificationMethodCheck; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 评价方法RS + */ +@Service +public class RiskAssessPlanEvaluateRsServiceImpl implements RiskAssessPlanEvaluateRsService { + + @Autowired + private RiskAssessPlanEvaluateRsRepository rsRepository; + + /** + * 评价方法RS - 插入 + */ + @Override + public RsInsertDTO InsertRs(Long currentUserId, AssessRsInsertBO rsInsertBO) { + + EvaluateInsertDTO insertDTO = new EvaluateInsertDTO(); + insertDTO.setResult(1); + IdentificationMethodCheck methodCheck = new IdentificationMethodCheck(); + + //校验辨识方法是否存在 + int result = methodCheck.identificationMethodCheck(rsInsertBO.getIdentificationId(), rsInsertBO.getIdentificationMethod()); + if (result == 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识方法不存在"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的计划不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getRsR())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "RS_R的数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getRsS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "RS_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getOriginalRsR())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有RS_R的数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getOriginalRsS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有RS_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getOriginalRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有风险数值不能为空"); + } + RiskAssessPlanEvaluateRs rsByIdentification = rsRepository.getRsByIdentification(rsInsertBO.getIdentificationId(), rsInsertBO.getIdentificationMethod()); + if (!ObjectUtils.isEmpty(rsByIdentification)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "该辨识已经被评价,无需重复操作"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getEvaluateDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家意见不能为空"); + } + BigDecimal value = rsInsertBO.getRsR().multiply(rsInsertBO.getRsS()); + //BigDecimal类型比较,结果为0是相等 + if (value.compareTo(rsInsertBO.getRiskValue()) != 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值计算有误,无法保存"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getSafeRiskAnalysis())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "安全风险分析内容不能为空"); + } + //设置参数 + LocalDateTime date = LocalDateTime.now(); + RiskAssessPlanEvaluateRs rs = new RiskAssessPlanEvaluateRs(); + if (value.compareTo(new BigDecimal(10)) < 0){ + rs.setRiskLevel(MethodEnum.RISK_LEVEL_1.getCode()); + rs.setRiskLevelValue(MethodEnum.RISK_LEVEL_1.getCode()); + rs.setRiskColor(MethodEnum.RISK_LEVEL_1.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_1.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) < 0){ + rs.setRiskLevel(MethodEnum.RISK_LEVEL_2.getCode()); + rs.setRiskLevelValue(MethodEnum.RISK_LEVEL_2.getCode()); + rs.setRiskColor(MethodEnum.RISK_LEVEL_2.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) < 0){ + rs.setRiskLevel(MethodEnum.RISK_LEVEL_3.getCode()); + rs.setRiskLevelValue(MethodEnum.RISK_LEVEL_3.getCode()); + rs.setRiskColor(MethodEnum.RISK_LEVEL_3.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) > 0){ + rs.setRiskLevel(MethodEnum.RISK_LEVEL_4.getCode()); + rs.setRiskLevelValue(MethodEnum.RISK_LEVEL_4.getCode()); + rs.setRiskColor(MethodEnum.RISK_LEVEL_4.getCode()); + } + rs.setIdentificationId(rsInsertBO.getIdentificationId()); + rs.setIdentificationMethod(rsInsertBO.getIdentificationMethod()); + rs.setAssessPlanId(rs.getAssessPlanId()); + rs.setRsR(rsInsertBO.getRsR()); + rs.setRsS(rsInsertBO.getRsS()); + rs.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + rs.setCreateTime(date); + rs.setUpdateTime(date); + rs.setRiskValue(rsInsertBO.getRiskValue()); + rs.setManageLevel(rsInsertBO.getManageLevel()); + rs.setEvaluateDesc(rsInsertBO.getEvaluateDesc()); + rs.setStatus((byte) 1); + + rs.setEducationMeasure(rsInsertBO.getEducationMeasure()); + rs.setTechnologyMeasure(rsInsertBO.getTechnologyMeasure()); + rs.setManageMeasure(rsInsertBO.getManageMeasure()); + rs.setPersonalProtectionMeasure(rsInsertBO.getPersonalProtectionMeasure()); + rs.setEmergencyMeasure(rsInsertBO.getEmergencyMeasure()); + + rs.setRsR(rsInsertBO.getRsR()); + rs.setRsS(rsInsertBO.getRsS()); + rs.setOriginalRiskValue(rsInsertBO.getOriginalRiskValue()); + rs.setOriginalRiskLevelValue(rsInsertBO.getOriginalRiskLevelValue()); + rs.setOriginalRiskLevel(rsInsertBO.getOriginalRiskLevel()); + rs.setOriginalRiskColor(rsInsertBO.getOriginalRiskColor()); + rs.setOriginalManageLevel(rsInsertBO.getOriginalManageLevel()); + rs.setAdviseTechnologyMeasure(rsInsertBO.getAdviseTechnologyMeasure()); + rs.setAdviseManageMeasure(rsInsertBO.getAdviseManageMeasure()); + rs.setAdviseEmergencyMeasure(rsInsertBO.getAdviseEmergencyMeasure()); + rs.setAdviseEducationMeasure(rsInsertBO.getAdviseEducationMeasure()); + rs.setAdvisePersonalProtectionMeasure(rsInsertBO.getAdvisePersonalProtectionMeasure()); + rs.setSafeRiskAnalysis(rsInsertBO.getSafeRiskAnalysis()); + + RiskAssessPlanEvaluateRs insertResult = rsRepository.save(rs); + + return BeanCopyUtils.copyBean(insertResult, RsInsertDTO.class); + } + + /** + * 评价方法RS - 修改 + */ + @Override + public RsInsertDTO updateRs(Long currentUserId, AssessRsInsertBO rsInsertBO) { + + EvaluateInsertDTO insertDTO = new EvaluateInsertDTO(); + insertDTO.setResult(1); + + if (ObjectUtils.isEmpty(rsInsertBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的评价内容不能为空"); + } + RiskAssessPlanEvaluateRs rsById = rsRepository.getRsById(rsInsertBO.getId()); + if (ObjectUtils.isEmpty(rsById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的评价不存在"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的计划不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getRsR())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "RS_R的数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getRsS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "RS_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getOriginalRsR())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有RS_R的数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getOriginalRsS())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有RS_S的数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getOriginalRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "固有风险数值不能为空"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getEvaluateDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家意见不能为空"); + } + BigDecimal value = rsInsertBO.getRsR().multiply(rsInsertBO.getRsS()); + //BigDecimal类型比较,结果为0是相等 + if (value.compareTo(rsInsertBO.getRiskValue()) != 0){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值计算有误,无法保存"); + } + if (ObjectUtils.isEmpty(rsInsertBO.getSafeRiskAnalysis())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "安全风险分析内容不能为空"); + } + + //设置参数 + LocalDateTime date = LocalDateTime.now(); + RiskAssessPlanEvaluateRs rs = BeanCopyUtils.copyBean(rsById, RiskAssessPlanEvaluateRs.class); + if (value.compareTo(new BigDecimal(10)) < 0){ + rs.setRiskLevel(MethodEnum.RISK_LEVEL_1.getCode()); + rs.setRiskLevelValue(MethodEnum.RISK_LEVEL_1.getCode()); + rs.setRiskColor(MethodEnum.RISK_LEVEL_1.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_1.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) < 0){ + rs.setRiskLevel(MethodEnum.RISK_LEVEL_2.getCode()); + rs.setRiskLevelValue(MethodEnum.RISK_LEVEL_2.getCode()); + rs.setRiskColor(MethodEnum.RISK_LEVEL_2.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_2.getCode())) > 0 && value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) < 0){ + rs.setRiskLevel(MethodEnum.RISK_LEVEL_3.getCode()); + rs.setRiskLevelValue(MethodEnum.RISK_LEVEL_3.getCode()); + rs.setRiskColor(MethodEnum.RISK_LEVEL_3.getCode()); + }else if (value.compareTo(new BigDecimal(MethodEnum.RISK_EVALUATE_VALUE_3.getCode())) > 0){ + rs.setRiskLevel(MethodEnum.RISK_LEVEL_4.getCode()); + rs.setRiskLevelValue(MethodEnum.RISK_LEVEL_4.getCode()); + rs.setRiskColor(MethodEnum.RISK_LEVEL_4.getCode()); + } + rs.setRsR(rsInsertBO.getRsR()); + rs.setRsS(rsInsertBO.getRsS()); + rs.setUpdateTime(date); + rs.setRiskValue(rsInsertBO.getRiskValue()); + rs.setManageLevel(rsInsertBO.getManageLevel()); + rs.setStatus(StatusEnum.REPORT_NOT_START.getCode().byteValue()); + rs.setEvaluateDesc(rsInsertBO.getEvaluateDesc()); + + rs.setEducationMeasure(rsInsertBO.getEducationMeasure()); + rs.setTechnologyMeasure(rsInsertBO.getTechnologyMeasure()); + rs.setManageMeasure(rsInsertBO.getManageMeasure()); + rs.setPersonalProtectionMeasure(rsInsertBO.getPersonalProtectionMeasure()); + rs.setEmergencyMeasure(rsInsertBO.getEmergencyMeasure()); + + rs.setRsR(rsInsertBO.getRsR()); + rs.setRsS(rsInsertBO.getRsS()); + rs.setOriginalRiskValue(rsInsertBO.getOriginalRiskValue()); + rs.setOriginalRiskLevelValue(rsInsertBO.getOriginalRiskLevelValue()); + rs.setOriginalRiskLevel(rsInsertBO.getOriginalRiskLevel()); + rs.setOriginalRiskColor(rsInsertBO.getOriginalRiskColor()); + rs.setOriginalManageLevel(rsInsertBO.getOriginalManageLevel()); + rs.setAdviseTechnologyMeasure(rsInsertBO.getAdviseTechnologyMeasure()); + rs.setAdviseManageMeasure(rsInsertBO.getAdviseManageMeasure()); + rs.setAdviseEmergencyMeasure(rsInsertBO.getAdviseEmergencyMeasure()); + rs.setAdviseEducationMeasure(rsInsertBO.getAdviseEducationMeasure()); + rs.setAdvisePersonalProtectionMeasure(rsInsertBO.getAdvisePersonalProtectionMeasure()); + rs.setSafeRiskAnalysis(rsInsertBO.getSafeRiskAnalysis()); + + RiskAssessPlanEvaluateRs insertResult = rsRepository.save(rs); + + return BeanCopyUtils.copyBean(insertResult, RsInsertDTO.class); + } + + /** + * 评价方法RS - 查询 + */ + @Override + public RsQueryDTO getRsByPlanId(Long id) { + + RiskAssessPlanEvaluateRs rsById = rsRepository.getRsById(id); + if (ObjectUtils.isEmpty(rsById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "rs评价方法不存在或已被删除"); + } + return BeanCopyUtils.copyBean(rsById, RsQueryDTO.class); + } + + /** + * 评价方法RS - 删除 + */ + @Override + public EvaluateMethodDeleteDTO deleteRsByPlanId(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO) { + + if (ObjectUtils.isEmpty(deleteReqBO.getRsId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的评价项目不能为空"); + } + RiskAssessPlanEvaluateRs rsById = rsRepository.getRsById(deleteReqBO.getRsId()); + if (ObjectUtils.isEmpty(rsById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的评价项目为空,或已被删除"); + } + if (!rsById.getAssessPlanId().equals(deleteReqBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划与评价项不匹配,无法删除"); + } + + EvaluateMethodDeleteDTO deleteDTO = new EvaluateMethodDeleteDTO(); + + rsById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + LocalDateTime date = LocalDateTime.now(); + rsById.setUpdateTime(date); + + RiskAssessPlanEvaluateRs deleteResult = rsRepository.save(rsById); + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价方法不存在或已被删除"); + } + deleteDTO.setResult(StatusEnum.DELETED.getCode().byteValue()); + + return deleteDTO; + } + + /** + * 评价方法RS - list + */ + @Override + public List<RsQueryDTO> listRsByPlanId(Long id) { + List<RiskAssessPlanEvaluateRs> rsList = rsRepository.listRsByPlanId(id); + return BeanCopyUtils.copyBeanList(rsList, RsQueryDTO.class); + } + + @Override + public List<RiskAssessPlanEvaluateRs> getRsByIds(List<Long> assessPlanIds) { + return rsRepository.getRsByIds(assessPlanIds); + } + + @Override + public int deleteRsByAssessPlanId(Long id) { + + List<RiskAssessPlanEvaluateRs> rsList = rsRepository.geByAssessPlanId(id); + if (rsList.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价方法不存在或已被删除"); + } + int i = 1; + for (RiskAssessPlanEvaluateRs rs : rsList) { + rs.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + RiskAssessPlanEvaluateRs save = rsRepository.save(rs); + if (ObjectUtils.isEmpty(save)){ + i = 1; + } + } + return i; + } + + @Override + public int deleteRsByPlan(Long id) { + List<RiskAssessPlanEvaluateRs> rsListByPlanId = rsRepository.getRsByPlanId(id); + if (ObjectUtils.isEmpty(rsListByPlanId)){ + return StatusEnum.SUCCESS.getCode(); + } + for (RiskAssessPlanEvaluateRs riskAssessPlanEvaluateRs : rsListByPlanId) { + riskAssessPlanEvaluateRs.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + } + List<RiskAssessPlanEvaluateRs> result = rsRepository.saveAll(rsListByPlanId); + if (result.size() != rsListByPlanId.size()){ + return StatusEnum.FAIL.getCode(); + } + return StatusEnum.SUCCESS.getCode(); + } + + @Override + public RiskAssessPlanEvaluateRs getRsByIdentificationId(Long id, Byte identificationMethod) { + return rsRepository.getRsByIdentification(id, identificationMethod); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationAnalogyServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationAnalogyServiceImpl.java new file mode 100644 index 0000000..f8248b7 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationAnalogyServiceImpl.java @@ -0,0 +1,180 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationAnalogy; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationHazop; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.AnalogyInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.AnalogyQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanIdentificationAnalogyRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanIdentificationAnalogyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-类比法(Analogy) + */ +@Service +public class RiskAssessPlanIdentificationAnalogyServiceImpl implements RiskAssessPlanIdentificationAnalogyService { + + @Autowired + private RiskAssessPlanIdentificationAnalogyRepository analogyRepository; + + /** + * 辨识方法-类比法(Analogy) - 插入 + */ + @Override + public AnalogyInsertDTO insertAnalogy(Long currentUserId, RiskAssessPlanIdentificationAnalogy analogy) { + + if (ObjectUtils.isEmpty(analogy.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getAnalogyCheckItem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "类比法_检查项目不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getAnalogyRiskFactor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "类比法_存在风险因素不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getAnalogyResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "类比法_可能产生的后果不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getAnalogyReference())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "类比法_类比参照不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (analogy.getResult() == 1){ + if (ObjectUtils.isEmpty(analogy.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + analogy.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + LocalDateTime data = LocalDateTime.now(); + analogy.setCreateTime(data); + analogy.setUpdateTime(data); + analogy.setId(null); //参数拷贝多了,重设id为空 + + RiskAssessPlanIdentificationAnalogy insertResult = analogyRepository.save(analogy); + return BeanCopyUtils.copyBean(insertResult, AnalogyInsertDTO.class); + } + + /** + * 辨识方法-类比法(Analogy) - 修改 + */ + @Override + public AnalogyInsertDTO updateAnalogy(Long currentUserId, RiskAssessPlanIdentificationAnalogy analogy) { + + if (ObjectUtils.isEmpty(analogy.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + RiskAssessPlanIdentificationAnalogy analogyById = analogyRepository.getAnalogyById(analogy.getId()); + if (ObjectUtils.isEmpty(analogyById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的辨识项不存在"); + } + if (ObjectUtils.isEmpty(analogy.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getAnalogyCheckItem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "类比法_检查项目不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getAnalogyRiskFactor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "类比法_存在风险因素不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getAnalogyResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "类比法_可能产生的后果不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getAnalogyReference())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "类比法_类比参照不能为空"); + } + if (ObjectUtils.isEmpty(analogy.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (analogy.getResult() == 1){ + if (ObjectUtils.isEmpty(analogy.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + LocalDateTime data = LocalDateTime.now(); + + analogyById.setUpdateTime(data); + analogyById.setAnalogyReference(analogy.getAnalogyReference()); + analogyById.setAnalogyCheckItem(analogy.getAnalogyCheckItem()); + analogyById.setAnalogyResult(analogy.getAnalogyResult()); + analogyById.setAnalogyRiskFactor(analogy.getAnalogyRiskFactor()); +// analogyById.setEducationMeasure(analogy.getEducationMeasure()); +// analogyById.setManageMeasure(analogy.getManageMeasure()); +// analogyById.setEmergencyMeasure(analogy.getEmergencyMeasure()); +// analogyById.setTechnologyMeasure(analogy.getTechnologyMeasure()); +// analogyById.setPersonalProtectionMeasure(analogy.getPersonalProtectionMeasure()); + analogyById.setResult(analogy.getResult()); + analogyById.setIdentificationDesc(analogy.getIdentificationDesc()); + + RiskAssessPlanIdentificationAnalogy insertResult = analogyRepository.save(analogyById); + + return BeanCopyUtils.copyBean(insertResult, AnalogyInsertDTO.class); + } + + /** + * 辨识方法-类比法(Analogy) - 查询 + */ + @Override + public AnalogyQueryDTO getAnalogyByPlanId(Long id) { + + RiskAssessPlanIdentificationAnalogy analogyById = analogyRepository.getAnalogyById(id); + if (ObjectUtils.isEmpty(analogyById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "类比法(Analogy)辨识方法不存在或已被删除"); + } + return BeanCopyUtils.copyBean(analogyById, AnalogyQueryDTO.class); + } + + /** + * 辨识方法-类比法(Analogy) - 删除 + */ + @Override + public IdentificationMethodDeleteDTO deleteAnalogyByPlanId(Long currentUserId, Long id) { + + RiskAssessPlanIdentificationAnalogy analogyById = analogyRepository.getAnalogyById(id); + if (ObjectUtils.isEmpty(analogyById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "Hazop辨识方法不存在或已被删除"); + } + IdentificationMethodDeleteDTO deleteDTO = new IdentificationMethodDeleteDTO(); + + analogyById.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + LocalDateTime data = LocalDateTime.now(); + analogyById.setUpdateTime(data); + + RiskAssessPlanIdentificationAnalogy deleteResult = analogyRepository.save(analogyById); + + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "Hazop辨识方法不存在或已被删除"); + } + deleteDTO.setResult(StatusEnum.DELETED.getCode().byteValue()); + + return deleteDTO; + } + + /** + * 辨识方法-类比法(Analogy) - 查询 -- 不校验结果 + */ + @Override + public RiskAssessPlanIdentificationAnalogy checkAnalogyByPlanId(Long identificationId) { + return analogyRepository.getAnalogyById(identificationId); + } + + /** + * 辨识方法-类比法(Analogy) - list + */ + @Override + public List<AnalogyQueryDTO> listAnalogyByPlanId(Long id) { + List<RiskAssessPlanIdentificationAnalogy> analogyList = analogyRepository.listAnalogyByPlanId(id); + return BeanCopyUtils.copyBeanList(analogyList, AnalogyQueryDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationHazopServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationHazopServiceImpl.java new file mode 100644 index 0000000..84f591a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationHazopServiceImpl.java @@ -0,0 +1,200 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationHazop; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationScl; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.HazopInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.HazopQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanIdentificationHazopRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanIdentificationHazopService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-Hazop + */ +@Service +public class RiskAssessPlanIdentificationHazopServiceImpl implements RiskAssessPlanIdentificationHazopService { + + @Autowired + private RiskAssessPlanIdentificationHazopRepository hazopRepository; + + /** + * 辨识方法-Hazop - 插入 + */ + @Override + public HazopInsertDTO insertHazop(Long currentUserId, RiskAssessPlanIdentificationHazop hazop) { + + if (ObjectUtils.isEmpty(hazop.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopNode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_节点不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopParam())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_参数不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopParamDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_参数描述不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopGuide())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_引导词不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopDeviation())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_偏差不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopPossibleCauses())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_可能原因不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_主要后果不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (hazop.getResult() == 1){ + if (ObjectUtils.isEmpty(hazop.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + hazop.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + LocalDateTime data = LocalDateTime.now(); + hazop.setCreateTime(data); + hazop.setUpdateTime(data); + hazop.setId(null); //参数拷贝多了,重设id为空 + + RiskAssessPlanIdentificationHazop insertResult = hazopRepository.save(hazop); + return BeanCopyUtils.copyBean(insertResult, HazopInsertDTO.class); + } + + /** + * 辨识方法-Hazop - 修改 + */ + @Override + public HazopInsertDTO updateHazop(Long currentUserId, RiskAssessPlanIdentificationHazop hazop) { + + if (ObjectUtils.isEmpty(hazop.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + RiskAssessPlanIdentificationHazop hazopById = hazopRepository.getHazopById(hazop.getId()); + if (ObjectUtils.isEmpty(hazopById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的辨识项不存在"); + } + if (ObjectUtils.isEmpty(hazop.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopNode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_节点不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopParam())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_参数不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopParamDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_参数描述不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopGuide())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_引导词不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopDeviation())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_偏差不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopPossibleCauses())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_可能原因不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getHazopResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "HAZOP_主要后果不能为空"); + } + if (ObjectUtils.isEmpty(hazop.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (hazop.getResult() == 1){ + if (ObjectUtils.isEmpty(hazop.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + LocalDateTime data = LocalDateTime.now(); + hazopById.setUpdateTime(data); + hazopById.setHazopDeviation(hazop.getHazopDeviation()); + hazopById.setHazopGuide(hazop.getHazopGuide()); + hazopById.setHazopNode(hazop.getHazopNode()); + hazopById.setHazopParam(hazop.getHazopParam()); + hazopById.setHazopResult(hazop.getHazopResult()); + hazopById.setHazopPossibleCauses(hazop.getHazopPossibleCauses()); + hazopById.setHazopParamDesc(hazop.getHazopParamDesc()); +// hazopById.setEducationMeasure(hazop.getEducationMeasure()); +// hazopById.setManageMeasure(hazop.getManageMeasure()); +// hazopById.setEmergencyMeasure(hazop.getEmergencyMeasure()); +// hazopById.setTechnologyMeasure(hazop.getTechnologyMeasure()); +// hazopById.setPersonalProtectionMeasure(hazop.getPersonalProtectionMeasure()); + hazopById.setResult(hazop.getResult()); + hazopById.setIdentificationDesc(hazop.getIdentificationDesc()); + + RiskAssessPlanIdentificationHazop updateResult = hazopRepository.save(hazopById); + + return BeanCopyUtils.copyBean(updateResult, HazopInsertDTO.class); + } + + /** + * 辨识方法-Hazop - 查询 + */ + @Override + public HazopQueryDTO getHazopByPlanId(Long id) { + + RiskAssessPlanIdentificationHazop hazopById = hazopRepository.getHazopById(id); + if (ObjectUtils.isEmpty(hazopById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "hazop辨识方法不存在或已被删除"); + } + return BeanCopyUtils.copyBean(hazopById, HazopQueryDTO.class); + } + + /** + * 辨识方法-Hazop - 删除 + */ + @Override + public IdentificationMethodDeleteDTO deleteHazopByPlanId(Long currentUserId, Long id) { + + RiskAssessPlanIdentificationHazop hazopById = hazopRepository.getHazopById(id); + if (ObjectUtils.isEmpty(hazopById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "Hazop辨识方法不存在或已被删除"); + } + IdentificationMethodDeleteDTO deleteDTO = new IdentificationMethodDeleteDTO(); + + hazopById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + LocalDateTime data = LocalDateTime.now(); + hazopById.setUpdateTime(data); + RiskAssessPlanIdentificationHazop deleteResult = hazopRepository.save(hazopById); + + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "Hazop辨识方法不存在或已被删除"); + } + deleteDTO.setResult(StatusEnum.DELETED.getCode().byteValue()); + + return deleteDTO; + } + + /** + * 辨识方法-Hazop - 查询 -- 不校验结果 + */ + @Override + public RiskAssessPlanIdentificationHazop checkHazopByPlanId(Long identificationId) { + return hazopRepository.getHazopById(identificationId); + } + + /** + * 辨识方法-Hazop - list + */ + @Override + public List<HazopQueryDTO> listHazopByPlanId(Long id) { + List<RiskAssessPlanIdentificationHazop> hazopList = hazopRepository.listHazopByPlanId(id); + return BeanCopyUtils.copyBeanList(hazopList, HazopQueryDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationJhaServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationJhaServiceImpl.java new file mode 100644 index 0000000..5c2d2bb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationJhaServiceImpl.java @@ -0,0 +1,172 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationJha; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationPha; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.JhaInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.JhaQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanIdentificationJhaRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanIdentificationJhaService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-Jha + */ +@Service +public class RiskAssessPlanIdentificationJhaServiceImpl implements RiskAssessPlanIdentificationJhaService { + + @Autowired + private RiskAssessPlanIdentificationJhaRepository jhaRepository; + + /** + * 辨识方法-Jha -- 插入 + */ + @Override + public JhaInsertDTO insertJha(Long currentUserId, RiskAssessPlanIdentificationJha jha) { + + if (ObjectUtils.isEmpty(jha.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(jha.getJhaCheckItem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "JHA_作业步骤不能为空"); + } + if (ObjectUtils.isEmpty(jha.getJhaRiskFactor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "JHA_危险源或潜在事件不能为空"); + } + if (ObjectUtils.isEmpty(jha.getJhaResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "JHA_可能发生的事故类型及后果不能为空"); + } + if (ObjectUtils.isEmpty(jha.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (jha.getResult() == 1){ + if (ObjectUtils.isEmpty(jha.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + jha.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + LocalDateTime data = LocalDateTime.now(); + jha.setCreateTime(data); + jha.setUpdateTime(data); + + jha.setId(null); //参数拷贝多了,重设id为空 + + RiskAssessPlanIdentificationJha insertResult = jhaRepository.save(jha); + return BeanCopyUtils.copyBean(insertResult, JhaInsertDTO.class); + } + /** + * 辨识方法-Jha -- 修改 + */ + @Override + public JhaInsertDTO updateJha(Long currentUserId, RiskAssessPlanIdentificationJha jha) { + + if (ObjectUtils.isEmpty(jha.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + RiskAssessPlanIdentificationJha jhaById = jhaRepository.getJhaById(jha.getId()); + if (ObjectUtils.isEmpty(jhaById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的辨识项不存在"); + } + if (ObjectUtils.isEmpty(jha.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(jha.getJhaCheckItem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "JHA_作业步骤不能为空"); + } + if (ObjectUtils.isEmpty(jha.getJhaRiskFactor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "JHA_危险源或潜在事件不能为空"); + } + if (ObjectUtils.isEmpty(jha.getJhaResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "JHA_可能发生的事故类型及后果不能为空"); + } + if (ObjectUtils.isEmpty(jha.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (jha.getResult() == 1){ + if (ObjectUtils.isEmpty(jha.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + LocalDateTime data = LocalDateTime.now(); + + jhaById.setUpdateTime(data); + jhaById.setJhaResult(jha.getJhaResult()); + jhaById.setJhaRiskFactor(jha.getJhaRiskFactor()); + jhaById.setJhaCheckItem(jha.getJhaCheckItem()); +// jhaById.setEducationMeasure(jha.getEducationMeasure()); +// jhaById.setManageMeasure(jha.getManageMeasure()); +// jhaById.setEmergencyMeasure(jha.getEmergencyMeasure()); +// jhaById.setTechnologyMeasure(jha.getTechnologyMeasure()); +// jhaById.setPersonalProtectionMeasure(jha.getPersonalProtectionMeasure()); + jhaById.setResult(jha.getResult()); + jhaById.setIdentificationDesc(jha.getIdentificationDesc()); + + RiskAssessPlanIdentificationJha updateResult = jhaRepository.save(jhaById); + + return BeanCopyUtils.copyBean(updateResult, JhaInsertDTO.class); + } + + /** + * 辨识方法-Jha -- 查询 + */ + @Override + public JhaQueryDTO getJhaByPlanId(Long id) { + + RiskAssessPlanIdentificationJha jhaById = jhaRepository.getJhaById(id); + if (ObjectUtils.isEmpty(jhaById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "jha辨识方法不存在或已被删除"); + } + return BeanCopyUtils.copyBean(jhaById, JhaQueryDTO.class); + } + + /** + * 辨识方法-Jha -- 删除 + */ + @Override + public IdentificationMethodDeleteDTO deleteJhaByPlanId(Long currentUserId, Long id) { + + RiskAssessPlanIdentificationJha jhaById = jhaRepository.getJhaById(id); + if (ObjectUtils.isEmpty(jhaById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "jha辨识方法不存在或已被删除"); + } + IdentificationMethodDeleteDTO deleteDTO = new IdentificationMethodDeleteDTO(); + LocalDateTime data = LocalDateTime.now(); + + jhaById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + jhaById.setUpdateTime(data); + + RiskAssessPlanIdentificationJha deleteResult = jhaRepository.save(jhaById); + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "jha辨识方法不存在或已被删除"); + } + deleteDTO.setResult(StatusEnum.DELETED.getCode().byteValue()); + jhaRepository.getJhaById(id); + return deleteDTO; + } + + /** + * 辨识方法-Jha -- 查询 --不校验结果 + */ + @Override + public RiskAssessPlanIdentificationJha checkJhaByPlanId(Long identificationId) { + return jhaRepository.getJhaById(identificationId); + } + + /** + * 辨识方法-Jha -- list + */ + @Override + public List<JhaQueryDTO> listJhaByPlanId(Long id) { + List<RiskAssessPlanIdentificationJha> jhaList = jhaRepository.listJhaByPlanId(id); + return BeanCopyUtils.copyBeanList(jhaList, JhaQueryDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationPhaServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationPhaServiceImpl.java new file mode 100644 index 0000000..ad70153 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationPhaServiceImpl.java @@ -0,0 +1,174 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationPha; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.PhaInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.PhaQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanIdentificationPhaRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanIdentificationPhaService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-Pha + */ +@Service +public class RiskAssessPlanIdentificationPhaServiceImpl implements RiskAssessPlanIdentificationPhaService { + + @Autowired + private RiskAssessPlanIdentificationPhaRepository phaRepository; + + /** + * 辨识方法-Pha - 插入 + */ + @Override + public PhaInsertDTO insertPha(Long currentUserId, RiskAssessPlanIdentificationPha pha) { + + if (ObjectUtils.isEmpty(pha.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(pha.getPhaCheckItem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "PHA_检查项目不能为空"); + } + if (ObjectUtils.isEmpty(pha.getPhaRiskFactor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "PHA_存在风险因素不能为空"); + } + if (ObjectUtils.isEmpty(pha.getPhaResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "PHA_可能产生的后果不能为空"); + } + if (ObjectUtils.isEmpty(pha.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (pha.getResult() == 1){ + if (ObjectUtils.isEmpty(pha.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + LocalDateTime data = LocalDateTime.now(); + pha.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + pha.setCreateTime(data); + pha.setUpdateTime(data); + pha.setId(null); //参数拷贝多了,重设id为空 + + RiskAssessPlanIdentificationPha insertResult = phaRepository.save(pha); + return BeanCopyUtils.copyBean(insertResult, PhaInsertDTO.class); + } + + /** + * 辨识方法-Pha - 修改 + */ + @Override + public PhaInsertDTO updatePha(Long currentUserId, RiskAssessPlanIdentificationPha pha) { + + if (ObjectUtils.isEmpty(pha.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + RiskAssessPlanIdentificationPha phaById = phaRepository.getPhaById(pha.getId()); + + if (ObjectUtils.isEmpty(phaById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的辨识项不存在"); + } + if (ObjectUtils.isEmpty(pha.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(pha.getPhaCheckItem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "PHA_检查项目不能为空"); + } + if (ObjectUtils.isEmpty(pha.getPhaRiskFactor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "PHA_存在风险因素不能为空"); + } + if (ObjectUtils.isEmpty(pha.getPhaResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "PHA_可能产生的后果不能为空"); + } + if (ObjectUtils.isEmpty(pha.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (pha.getResult() == 1){ + if (ObjectUtils.isEmpty(pha.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + LocalDateTime data = LocalDateTime.now(); + phaById.setUpdateTime(data); + phaById.setPhaResult(pha.getPhaResult()); + phaById.setPhaRiskFactor(pha.getPhaRiskFactor()); + phaById.setPhaCheckItem(pha.getPhaCheckItem()); +// phaById.setEducationMeasure(pha.getEducationMeasure()); +// phaById.setManageMeasure(pha.getManageMeasure()); +// phaById.setEmergencyMeasure(pha.getEmergencyMeasure()); +// phaById.setTechnologyMeasure(pha.getTechnologyMeasure()); +// phaById.setPersonalProtectionMeasure(pha.getPersonalProtectionMeasure()); + phaById.setResult(pha.getResult()); + phaById.setIdentificationDesc(pha.getIdentificationDesc()); + + RiskAssessPlanIdentificationPha updateResult = phaRepository.save(phaById); + + return BeanCopyUtils.copyBean(updateResult, PhaInsertDTO.class); + } + + /** + * 辨识方法-Pha - 查询 + */ + @Override + public PhaQueryDTO getPhaByPlanId(Long id) { + RiskAssessPlanIdentificationPha phaById = phaRepository.getPhaById(id); + if (ObjectUtils.isEmpty(phaById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "pha辨识方法不存在或已被删除"); + } + return BeanCopyUtils.copyBean(phaById, PhaQueryDTO.class); + } + + /** + * 辨识方法-Pha - 删除 + */ + @Override + public IdentificationMethodDeleteDTO deletePhaByPlanId(Long currentUserId, Long id) { + + RiskAssessPlanIdentificationPha phaById = phaRepository.getPhaById(id); + if (ObjectUtils.isEmpty(phaById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "pha辨识方法不存在或已被删除"); + } + IdentificationMethodDeleteDTO deleteDTO = new IdentificationMethodDeleteDTO(); + LocalDateTime data = LocalDateTime.now(); + +// RiskAssessPlanIdentificationPha deleteResult = phaRepository.deletePhaByPlanId(id, data); + + phaById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + phaById.setUpdateTime(data); + + RiskAssessPlanIdentificationPha deleteResult = phaRepository.save(phaById); + + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "pha辨识方法不存在或已被删除"); + } + deleteDTO.setResult(StatusEnum.DELETED.getCode().byteValue()); + + return deleteDTO; + } + + /** + * 辨识方法-Pha - 查询 - 不校验结果 + */ + @Override + public RiskAssessPlanIdentificationPha checkPhaByPlanId(Long identificationId) { + RiskAssessPlanIdentificationPha phaById = phaRepository.getPhaById(identificationId); + return phaById; + } + + /** + * 辨识方法-Pha - list + */ + @Override + public List<PhaQueryDTO> listPhaByPlanId(Long id) { + List<RiskAssessPlanIdentificationPha> phaList = phaRepository.listPhaByPlanId(id); + return BeanCopyUtils.copyBeanList(phaList, PhaQueryDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationSclServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationSclServiceImpl.java new file mode 100644 index 0000000..e5baea5 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanIdentificationSclServiceImpl.java @@ -0,0 +1,185 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationJha; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationScl; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.IdentificationMethodDeleteDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.SclInsertDTO; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.SclQueryDTO; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanIdentificationSclRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanIdentificationSclService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.datasource.lookup.BeanFactoryDataSourceLookup; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 辨识方法-Scl + */ +@Service +public class RiskAssessPlanIdentificationSclServiceImpl implements RiskAssessPlanIdentificationSclService { + + @Autowired + private RiskAssessPlanIdentificationSclRepository sclRepository; + @Autowired + private UserDomainService userDomainService; + + /** + * 辨识方法-Scl - 插入 + */ + @Override + public SclInsertDTO insertScl(Long currentUserId, RiskAssessPlanIdentificationScl scl) { + + if (ObjectUtils.isEmpty(scl.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(scl.getSclCheckItem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "SCL_检查项目不能为空"); + } + if (ObjectUtils.isEmpty(scl.getSclCheckStandard())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "SCL_检查标准不能为空"); + } + if (ObjectUtils.isEmpty(scl.getSclCheckUnstandard())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "SCL_不符合标准情况不能为空"); + } + if (ObjectUtils.isEmpty(scl.getSclCheckResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "SCL_主要后果不能为空"); + } + if (ObjectUtils.isEmpty(scl.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (scl.getResult() == 1){ + if (ObjectUtils.isEmpty(scl.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + scl.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + LocalDateTime data = LocalDateTime.now(); + scl.setCreateTime(data); + scl.setUpdateTime(data); + scl.setId(null); //参数拷贝多了,重设id为空 + + RiskAssessPlanIdentificationScl insertResult = sclRepository.save(scl); + return BeanCopyUtils.copyBean(insertResult, SclInsertDTO.class); + + } + + /** + * 辨识方法-Scl - 修改 + */ + @Override + public SclInsertDTO updateScl(Long currentUserId, RiskAssessPlanIdentificationScl scl) { + + if (ObjectUtils.isEmpty(scl.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + RiskAssessPlanIdentificationScl sclById = sclRepository.getSclById(scl.getId()); + if (ObjectUtils.isEmpty(sclById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要修改的辨识项不存在"); + } + if (ObjectUtils.isEmpty(scl.getAssessPlanId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的计划不能为空"); + } + if (ObjectUtils.isEmpty(scl.getSclCheckItem())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "SCL_检查项目不能为空"); + } + if (ObjectUtils.isEmpty(scl.getSclCheckStandard())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "SCL_检查标准不能为空"); + } + if (ObjectUtils.isEmpty(scl.getSclCheckUnstandard())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "SCL_不符合标准情况不能为空"); + } + if (ObjectUtils.isEmpty(scl.getSclCheckResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "SCL_主要后果不能为空"); + } + if (ObjectUtils.isEmpty(scl.getResult())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果不能为空"); + } + if (scl.getResult() == 1){ + if (ObjectUtils.isEmpty(scl.getIdentificationDesc())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家意见不能为空"); + } + } + LocalDateTime data = LocalDateTime.now(); + + sclById.setUpdateTime(data); + sclById.setSclCheckItem(scl.getSclCheckItem()); + sclById.setSclCheckResult(scl.getSclCheckResult()); + sclById.setSclCheckStandard(scl.getSclCheckStandard()); + sclById.setSclCheckUnstandard(scl.getSclCheckUnstandard()); +// sclById.setEducationMeasure(scl.getEducationMeasure()); +// sclById.setManageMeasure(scl.getManageMeasure()); +// sclById.setEmergencyMeasure(scl.getEmergencyMeasure()); +// sclById.setTechnologyMeasure(scl.getTechnologyMeasure()); +// sclById.setPersonalProtectionMeasure(scl.getPersonalProtectionMeasure()); + sclById.setResult(scl.getResult()); + sclById.setIdentificationDesc(scl.getIdentificationDesc()); + + RiskAssessPlanIdentificationScl updateResult = sclRepository.save(sclById); + + return BeanCopyUtils.copyBean(updateResult, SclInsertDTO.class); + } + + /** + * 辨识方法-Scl - 查询 + */ + @Override + public SclQueryDTO getSclByPlanId(Long id) { + + RiskAssessPlanIdentificationScl sclById = sclRepository.getSclById(id); + if (ObjectUtils.isEmpty(sclById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "scl辨识方法不存在或已被删除"); + } + return BeanCopyUtils.copyBean(sclById, SclQueryDTO.class); + } + + /** + * 辨识方法-Scl - 删除 + */ + @Override + public IdentificationMethodDeleteDTO deleteSclByPlanId(Long currentUserId, Long id) { + + RiskAssessPlanIdentificationScl sclById = sclRepository.getSclById(id); + if (ObjectUtils.isEmpty(sclById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "Scl辨识方法不存在或已被删除"); + } + IdentificationMethodDeleteDTO deleteDTO = new IdentificationMethodDeleteDTO(); + + LocalDateTime data = LocalDateTime.now(); + sclById.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + sclById.setUpdateTime(data); + + RiskAssessPlanIdentificationScl deleteResult = sclRepository.save(sclById); + + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "Scl辨识方法不存在或已被删除"); + } + deleteDTO.setResult(StatusEnum.DELETED.getCode().byteValue()); + + return deleteDTO; + } + + /** + * 辨识方法-Scl - 查询 -- 不校验结果 + */ + @Override + public RiskAssessPlanIdentificationScl checkSclByPlanId(Long identificationId) { + return sclRepository.getSclById(identificationId); + } + + /** + * 辨识方法-Scl - list + */ + @Override + public List<SclQueryDTO> listSclByPlanId(Long id) { + List<RiskAssessPlanIdentificationScl> sclList = sclRepository.listSclByPlanId(id); + return BeanCopyUtils.copyBeanList(sclList, SclQueryDTO.class); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java new file mode 100644 index 0000000..5791ded --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java @@ -0,0 +1,2097 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.*; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.*; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessAppQueryDTO; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessAppQueryDTO_0223bak; +import com.gkhy.labRiskManage.application.riskReport.dto.dto.RiskAssessPlanListAppDTO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.*; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnit; +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnitType; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitUpdateDTO; +import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService; +import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitService; +import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitTypeService; +import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentInfoService; +import com.gkhy.labRiskManage.domain.riskReport.entity.*; +import com.gkhy.labRiskManage.domain.riskReport.model.bo.*; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.*; +import com.gkhy.labRiskManage.domain.riskReport.utils.EvaluateAndIdentificationUtils; +import com.gkhy.labRiskManage.domain.riskReport.utils.EvaluateCheckUtils; +import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.*; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +/** + * 风险评估计划 + */ +@Service +public class RiskAssessPlanServiceImpl implements RiskAssessPlanService { + + @Autowired + private RiskAssessPlanRepository assessPlanRepository; + @Autowired + private RiskUnitService riskUnitService; + @Autowired + private ExperimentInfoService experimentInfoService; + @Autowired + private BasicExperimentPersonService personService; + @Autowired + private BasicRiskUnitTypeService riskUnitTypeService; + @Autowired + private BasicRiskUnitService basicRiskUnitService; + + @Autowired + private RiskAssessPlanIdentificationAnalogyService analogyService; + @Autowired + private RiskAssessPlanIdentificationHazopService hazopService; + @Autowired + private RiskAssessPlanIdentificationJhaService jhaService; + @Autowired + private RiskAssessPlanIdentificationPhaService phaService; + @Autowired + private RiskAssessPlanIdentificationSclService sclService; + + @Autowired + private RiskAssessPlanEvaluateLecService lecService; + @Autowired + private RiskAssessPlanEvaluateLsService lsService; + @Autowired + private RiskAssessPlanEvaluateMesService mesService; + @Autowired + private RiskAssessPlanEvaluateRsService rsService; + + @Autowired + private UserDomainService userDomainService; + + /** + * 风险评估计划 - 插入 + */ + @Transactional + @Override + public PlanInsertDTO insertAssessPlan(Long currentUserId, RiskAssessPlanAppInsertBO insertParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + // 检查是否是实验管理者 + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (roleTag ==0 ){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权添加实验评估计划"); + } + if (ObjectUtils.isEmpty(user)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + //参数校验 + if (ObjectUtils.isEmpty(insertParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请求参数为空"); + } + if (ObjectUtils.isEmpty(insertParam.getRiskUnitId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元不能为空"); + } + if (ObjectUtils.isEmpty(insertParam.getRiskType())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元类型不能为空"); + } + RiskUnitQueryDTO riskUnitById = riskUnitService.getRiskUnitById(insertParam.getRiskUnitId()); + if (ObjectUtils.isEmpty(riskUnitById.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元不存在或已被删除"); + } + List<RiskAssessPlan> assessPlanByUnitId = assessPlanRepository.getAssessPlanByUnitId(insertParam.getRiskUnitId()); + if (assessPlanByUnitId.size() >= 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "该单元已有评估计划"); + } + ExperimentInfoDTO experimentById = experimentInfoService.getExperimentById(riskUnitById.getExperimentId()); + if (ObjectUtils.isEmpty(experimentById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验不存在或已被删除"); + } + if (experimentById.getStatus() == 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验未被批准,无法进行评估"); + } + if (ObjectUtils.isEmpty(insertParam.getAssessPlanName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划名称不能为空"); + } + RiskAssessPlan assessPlanByName = assessPlanRepository.getAssessPlanByName(insertParam.getAssessPlanName()); + if (!ObjectUtils.isEmpty(assessPlanByName)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "评估计划名称已被使用"); + } + if (ObjectUtils.isEmpty(insertParam.getAssessStartTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估开始时间不能为空"); + } + if (ObjectUtils.isEmpty(insertParam.getAssessEndTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估结束时间不能为空"); + } + if (insertParam.getAssessEndTime().isBefore(insertParam.getAssessStartTime())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "评估结束时间必须在评估开始时间之后"); + } + // 计划制定人? + if (ObjectUtils.isEmpty(insertParam.getPlanUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "计划制定人不能为空"); + } + UserInfoDomainDTO planUser = userDomainService.getUserInfoByIdAndSellInfo(insertParam.getPlanUserId(),"计划指定人"); + if (ObjectUtils.isEmpty(planUser)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "计划制定人不存在或已被删除"); + } + // 辨识专家 + if (ObjectUtils.isEmpty(insertParam.getIdentificationUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家不能为空"); + } + UserInfoDomainDTO identificationUser = userDomainService.getUserInfoByIdAndSellInfo(insertParam.getIdentificationUserId(), "辨识专家"); + if (ObjectUtils.isEmpty(identificationUser)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "辨识专家不存在或已被删除"); + } + // 评价专家 + if (ObjectUtils.isEmpty(insertParam.getEvaluateUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家不能为空"); + } + UserInfoDomainDTO evaluateUser = userDomainService.getUserInfoByIdAndSellInfo(insertParam.getEvaluateUserId(), "评价专家"); + if (ObjectUtils.isEmpty(evaluateUser)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "评价专家不存在或已被删除"); + } + + BasicRiskUnitType riskUnitTypeById = riskUnitTypeService.getRiskUnitTypeById(riskUnitById.getRiskUnitTypeId()); + + //参数接收到的封装 + RiskAssessPlan riskAssessPlan = BeanCopyUtils.copyBean(insertParam, RiskAssessPlan.class); + + //获取需要的参数 + LocalDateTime date = LocalDateTime.now(); + // 如果是实验风险,添加实验id + if (insertParam.getRiskType() == StatusEnum.EXPERIMENT_RISK.getCode().byteValue()){ + riskAssessPlan.setExperimentId(riskUnitById.getExperimentId());// + } + riskAssessPlan.setCreateTime(date); + riskAssessPlan.setUpdateTime(date); + riskAssessPlan.setCreateByUserId(user.getId()); + riskAssessPlan.setUpdateByUserId(user.getId()); + riskAssessPlan.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + riskAssessPlan.setRiskType(riskUnitById.getRiskType()); + riskAssessPlan.setPlanSellStatus(StatusEnum.PLAN_SELL_NOT.getCode().byteValue());//计划未派发 + riskAssessPlan.setPlanExecStatus(StatusEnum.PLAN_EXEC_NOT_START.getCode().byteValue());//计划执行未开始(执行阶段) +// riskAssessPlan.setPlanTimeStatus(StatusEnum.PLAN_STATUS_NOT_START.getCode().byteValue());//计划状态未开始 + riskAssessPlan.setIdentificationUserId(insertParam.getIdentificationUserId());//辨识专家id + riskAssessPlan.setIdentificationUser(identificationUser.getRealName());//辨识专家 + riskAssessPlan.setEvaluateUserId(insertParam.getEvaluateUserId());//评价专家id + riskAssessPlan.setEvaluateUser(evaluateUser.getRealName());//评价专家 + + riskAssessPlan.setIdentificationMethod(MethodEnum.IDENTIFICATION_METHOD_PHA.getCode());//辨识方法 + riskAssessPlan.setEvaluateMethod(MethodEnum.EVALUATE_METHOD_LEC.getCode());//评价方法 + + RiskAssessPlan saveResult = assessPlanRepository.save(riskAssessPlan); + + //修改实验状态为评估中 + ExperimentInfoDTO experimentInfoDTO = experimentInfoService.updateExperimentStage(experimentById.getId(), StatusEnum.EXPERIMENT_STATUS_START.getCode().byteValue()); + if (ObjectUtils.isEmpty(experimentInfoDTO)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "实验状态修改失败"); + } + //修改风险单元为已有评估计划 + if (insertParam.getRiskType() == StatusEnum.EXPERIMENT_RISK.getCode().byteValue()){ + RiskUnit riskUnit = riskUnitService.updateRiskUnitStatus(insertParam.getRiskUnitId(), StatusEnum.EVALUATE_WAIT.getCode()); + if (ObjectUtils.isEmpty(riskUnit)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "风险单元状态修改失败"); + } + }else if (insertParam.getRiskType() == StatusEnum.INHERENT_RISK.getCode().byteValue()){ + RiskUnitUpdateDTO riskUnitUpdateDTO = basicRiskUnitService.updateRiskUnitStatus(insertParam.getRiskUnitId(), StatusEnum.EVALUATE_WAIT.getCode()); + if (ObjectUtils.isEmpty(riskUnitUpdateDTO)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "风险单元状态修改失败"); + } + } + + + PlanInsertDTO planInsertDTO = BeanCopyUtils.copyBean(saveResult, PlanInsertDTO.class); + + return planInsertDTO; + } + + /** + * 风险评估计划 - 查询 + */ + @Override + public SearchResult<AssessPlanQueryDTO> selectAssessPlanPage(Long currentUserId, RiskAssessPlanAppQueryBO queryParamBO) { + + + //校验参数 + if (ObjectUtils.isEmpty(queryParamBO.getPageSize())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(queryParamBO.getPageIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (queryParamBO.getRiskUnitName() == "null"){ + queryParamBO.setRiskUnitName(null); + } + if (queryParamBO.getAssessPlanName() == "null"){ + queryParamBO.setAssessPlanName(null); + } + // 检查是否是实验管理者 + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + if (ObjectUtils.isEmpty(user)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"用户不存在"); + } + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + List<Long> ids = new ArrayList<>(); + if (!ObjectUtils.isEmpty(queryParamBO.getRiskUnitName())){ + List<RiskUnitQueryDTO> riskUnitList= riskUnitService.getRiskUnitByName(queryParamBO.getRiskUnitName()); + if (riskUnitList.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元不存在或已被删除"); + } + for (RiskUnitQueryDTO riskUnit : riskUnitList) { + ids.add(riskUnit.getId()); + } + } + + List<ExperimentInfoDTO> experimentByList = experimentInfoService.getExperimentByUser(currentUserId); + + List<Long> experimentIdList = new ArrayList<>(); + experimentIdList.add(0L); + if (!ObjectUtils.isEmpty(experimentByList)){ + for (ExperimentInfoDTO experimentInfo : experimentByList) { + experimentIdList.add(experimentInfo.getId()); + } + } + + RiskAssessPlanQueryBO queryParam = BeanCopyUtils.copyBean(queryParamBO, RiskAssessPlanQueryBO.class); + queryParam.setRiskUnitIds(ids); + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(queryParam.getPageIndex()); + searchResult.setPageSize(queryParam.getPageSize()); + + + //封装查询参数 + Specification<RiskAssessPlan> specification = new Specification<RiskAssessPlan>() { + @Override + public Predicate toPredicate(Root<RiskAssessPlan> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + if (queryParam.getAssessPlanName() != null && !queryParam.getAssessPlanName().equals("")){ + predicateList.add(criteriaBuilder.like(root.get("assessPlanName"),"%"+queryParam.getAssessPlanName()+"%")); + } + //in + if (queryParam.getRiskUnitIds().size() >= 1){ + predicateList.add(criteriaBuilder.in(root.get("riskUnitId")).value(ids)); + } + if (queryParam.getExperimentId() != null){ + predicateList.add(criteriaBuilder.equal(root.get("experimentId"),queryParam.getExperimentId())); + } + if (roleTag == UserTagEnum.USER_TAG_0.getCode()){ + //此处应有谁能查询:辨识专家,评价专家,实验负责人(此处未存相关信息,以实验id为条件查询) + predicateList.add(criteriaBuilder.or( + criteriaBuilder.equal(root.get("identificationUserId"), currentUserId), + criteriaBuilder.equal(root.get("evaluateUserId"), currentUserId), + criteriaBuilder.in(root.get("experimentId")).value(experimentIdList) + ) + ); + } + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode())); + return criteriaBuilder.and(predicateList.toArray(new Predicate[0])); + } + }; + + PageRequest pageParam = PageRequest.of(queryParam.getPageIndex() - 1, queryParam.getPageSize(), Sort.Direction.DESC, "updateTime"); + Page<RiskAssessPlan> pageResult = assessPlanRepository.findAll(specification, pageParam); + + List<RiskAssessPlanQueryDTO> assessPlanQueryDTOS = BeanCopyUtils.copyBeanList(pageResult.getContent(), RiskAssessPlanQueryDTO.class); + + List<RiskUnitListAppQueryDTO> riskUnitListAppQueryDTOS = riskUnitService.listAssessRiskUnit(); + + List<UserInfoDomainDTO> userList = userDomainService.getUserList(); + for (RiskAssessPlanQueryDTO assessPlanQueryDTO : assessPlanQueryDTOS) { + for (UserInfoDomainDTO userInfo : userList) { + if (userInfo.getId() == assessPlanQueryDTO.getCreateByUserId()){ + assessPlanQueryDTO.setCreateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == assessPlanQueryDTO.getUpdateByUserId()){ + assessPlanQueryDTO.setUpdateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == assessPlanQueryDTO.getPlanUserId()){ + assessPlanQueryDTO.setPlanUserName(userInfo.getRealName()); + } + } + for (RiskUnitListAppQueryDTO riskUnit : riskUnitListAppQueryDTOS) { + if (riskUnit.getId() == assessPlanQueryDTO.getRiskUnitId()){ + assessPlanQueryDTO.setRiskUnitName(riskUnit.getRiskName()); + } + } + } + + searchResult.setData(assessPlanQueryDTOS); + searchResult.setTotal(pageResult.getTotalElements()); + return searchResult; + } + + /** + * 风险评估计划 - 修改 + */ + @Override + public AssessPlanUpdateDTO updateAssessPlan(Long currentUserId, RiskAssessPlanUpdateReqBO updateParam) { + + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + // 检查是否是实验管理者 + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (roleTag ==0 ){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权修改实验评估计划"); + } + //参数校验 + if (ObjectUtils.isEmpty(updateParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要求改的参数为空"); + } + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(updateParam.getId()); + if (assessPlanById.getPlanSellStatus() == 2){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该计划已经派发,无法修改"); + } + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划不存在或已被删除"); + } + if (ObjectUtils.isEmpty(updateParam.getRiskUnitId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元参数不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getAssessStartTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估开始时间不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getAssessEndTime())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估结束时间不能为空"); + } + if (updateParam.getAssessEndTime().isBefore(updateParam.getAssessStartTime())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "评估结束时间必须在评估开始时间之后"); + } + RiskUnitQueryDTO riskUnitById = riskUnitService.getRiskUnitById(updateParam.getRiskUnitId()); + if (ObjectUtils.isEmpty(riskUnitById.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元不存在或已被删除"); + } + ExperimentInfoDTO experimentById = experimentInfoService.getExperimentById(riskUnitById.getExperimentId()); + if (ObjectUtils.isEmpty(experimentById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验不存在或已被删除"); + } + + if (ObjectUtils.isEmpty(updateParam.getAssessPlanName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划名称不能为空"); + } + RiskAssessPlan assessPlanByName = assessPlanRepository.getAssessPlanByName(updateParam.getAssessPlanName()); + if (!ObjectUtils.isEmpty(assessPlanByName) && !assessPlanByName.getId().equals(updateParam.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划已存在,请换一个计划名称"); + } + // 计划制定人 + if (ObjectUtils.isEmpty(updateParam.getPlanUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "计划制定人不能为空"); + } + UserInfoDomainDTO planUser = userDomainService.getUserInfoByIdAndSellInfo(updateParam.getPlanUserId(), "计划制定人"); + if (ObjectUtils.isEmpty(planUser)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "计划制定人不存在或已被删除"); + } + // 辨识专家 + if (ObjectUtils.isEmpty(updateParam.getIdentificationUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识专家不能为空"); + } + UserInfoDomainDTO identificationUser = userDomainService.getUserInfoByIdAndSellInfo(updateParam.getIdentificationUserId(), "辨识专家"); + if (ObjectUtils.isEmpty(identificationUser)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "辨识专家不存在或已被删除"); + } + // 评价专家 + if (ObjectUtils.isEmpty(updateParam.getEvaluateUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价专家不能为空"); + } + UserInfoDomainDTO evaluateUser = userDomainService.getUserInfoByIdAndSellInfo(updateParam.getEvaluateUserId(), "评价专家"); + if (ObjectUtils.isEmpty(evaluateUser)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "评价专家不存在或已被删除"); + } + + //获取需要的参数 + LocalDateTime date = LocalDateTime.now(); + + assessPlanById.setUpdateTime(date); + assessPlanById.setUpdateByUserId(userInfoById.getId()); + assessPlanById.setRiskUnitId(updateParam.getRiskUnitId()); + assessPlanById.setAssessPlanName(updateParam.getAssessPlanName()); + assessPlanById.setPlanUserId(updateParam.getPlanUserId()); + assessPlanById.setAssessStartTime(updateParam.getAssessStartTime()); + assessPlanById.setAssessEndTime(updateParam.getAssessEndTime()); +// assessPlanById.setIdentificationMethod(updateParam.getIdentificationMethod());//辨识方法 + assessPlanById.setIdentificationUserId(updateParam.getIdentificationUserId());//辨识专家id + assessPlanById.setIdentificationUser(identificationUser.getRealName());//辨识专家 +// assessPlanById.setEvaluateMethod(updateParam.getEvaluateMethod());//评价方法 + assessPlanById.setEvaluateUserId(updateParam.getEvaluateUserId());//评价专家id + assessPlanById.setEvaluateUser(evaluateUser.getRealName());//评价专家 + + + RiskAssessPlan saveResult = assessPlanRepository.save(assessPlanById); + + AssessPlanUpdateDTO planUpdateDTO = BeanCopyUtils.copyBean(saveResult, AssessPlanUpdateDTO.class); + + return planUpdateDTO; + } + + /** + * 风险评估计划 - 删除 + */ + @Override + public AssessPlanDeleteDTO deleteAssessPlan(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + // 检查是否是实验管理者 + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (roleTag ==0 ){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权删除实验评估计划"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "删除的内容不能为空"); + } + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(id); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除的内容不存在或已被删除"); + } + if (assessPlanById.getPlanSellStatus() == 2){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该计划已经派发,无法删除"); + } + //设置必要参数 + LocalDateTime date = LocalDateTime.now(); + + RiskAssessPlan riskAssessPlan = BeanCopyUtils.copyBean(assessPlanById, RiskAssessPlan.class); + + riskAssessPlan.setUpdateTime(date); + riskAssessPlan.setUpdateByUserId(userInfoById.getId()); + riskAssessPlan.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + + RiskAssessPlan deleteResult = assessPlanRepository.save(riskAssessPlan); + + return BeanCopyUtils.copyBean(deleteResult, AssessPlanDeleteDTO.class); + } + + /** + * 风险评估计划 - 派发任务 + */ + @Override + public AssessPlanUpdateDTO sellAssessPlan(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + // 检查是否是实验管理者 + int roleTag = 0; + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + for (SysUserRoleBindDomainDTO role : user.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + if (roleTag ==0 ){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权派发任务"); + } + LocalDateTime date = LocalDateTime.now(); + + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "选择的内容不能为空"); + } + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(id); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "要派发的计划不存在或已被删除"); + } + if (assessPlanById.getPlanSellStatus() == 2){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该计划已经派发"); + } + if (assessPlanById.getAssessEndTime().isBefore(date)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "任务派发必须在评估结束时间之前"); + } +// if (!assessPlanById.getPlanUserId().equals(userInfoById.getId())){ +// throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "您不是计划制定人,无法进行任务派发"); +// } + //设置必要参数 + RiskAssessPlan riskAssessPlan = BeanCopyUtils.copyBean(assessPlanById, RiskAssessPlan.class); + + riskAssessPlan.setPlanSellTime(date); + riskAssessPlan.setPlanSellStatus(StatusEnum.PLAN_SELL.getCode().byteValue()); + riskAssessPlan.setPlanExecStatus(StatusEnum.PLAN_EXEC_IDENTIFICATION.getCode().byteValue());//辨识阶段 + + RiskAssessPlan sellResult = assessPlanRepository.save(riskAssessPlan); + + return BeanCopyUtils.copyBean(sellResult, AssessPlanUpdateDTO.class); + } + + /** + * 风险评估计划 - 辨识 + */ + @Override + public AssessPlanIdentificationDTO identification(Long currentUserId, RiskAssessPlanAppIdentificationBO identificationParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + LocalDateTime date = LocalDateTime.now(); + + if (ObjectUtils.isEmpty(identificationParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识的内容不能为空"); + } + if (ObjectUtils.isEmpty(identificationParam.getIdentificationMethod())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "选择的辨识方法不存在"); + } +// if (ObjectUtils.isEmpty(identificationParam.getManageMeasure())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "管理措施不能为空"); +// } +// if (ObjectUtils.isEmpty(identificationParam.getEducationMeasure())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "教育措施不能为空"); +// } +// if (ObjectUtils.isEmpty(identificationParam.getPersonalProtectionMeasure())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "个体防护措施不能为空"); +// } +// if (ObjectUtils.isEmpty(identificationParam.getEmergencyMeasure())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "应急措施不能为空"); +// } +// if (ObjectUtils.isEmpty(identificationParam.getTechnologyMeasure())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "技术措施不能为空"); +// } + + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(identificationParam.getId()); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "要辨识的计划不存在或已被删除"); + } + if (!assessPlanById.getIdentificationUserId().equals(currentUserId)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"不是辨识专家,无法操作"); + } + if (assessPlanById.getPlanSellStatus() == 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该计划尚未派发,无法辨识"); + } + if (assessPlanById.getPlanExecStatus() != 2){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该计划不处在辨识阶段,无法辨识"); + } + if (date.isAfter(assessPlanById.getAssessEndTime())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "风险辨识必须在评估结束时间之前"); + } + if (date.isBefore(assessPlanById.getAssessStartTime())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "未到辨识时间"); + } + if (!assessPlanById.getIdentificationUserId().equals(userInfoById.getId())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "您不是辨识人,无法进行辨识"); + } + + //设置必要参数 + RiskAssessPlan riskAssessPlan = BeanCopyUtils.copyBean(assessPlanById, RiskAssessPlan.class); + + riskAssessPlan.setIdentificationTime(date); + riskAssessPlan.setTechnologyMeasure(null); + riskAssessPlan.setManageMeasure(null); + riskAssessPlan.setEducationMeasure(null); + riskAssessPlan.setPersonalProtectionMeasure(null); + riskAssessPlan.setEmergencyMeasure(null); + riskAssessPlan.setIdentificationMethod(identificationParam.getIdentificationMethod()); + + riskAssessPlan.setPlanExecStatus(StatusEnum.PLAN_EXEC_IDENTIFICATION.getCode().byteValue());//辨识阶段 +// riskAssessPlan.setPlanTimeStatus(StatusEnum.PLAN_STATUS_START.getCode().byteValue());//计划状态未开始 + + RiskAssessPlan identificationResult = assessPlanRepository.save(riskAssessPlan); + + return BeanCopyUtils.copyBean(identificationResult, AssessPlanIdentificationDTO.class); + } + + /** + * 风险评估计划 - 辨识结果提交 + */ + @Override + public AssessPlanUpdateDTO identificationSubmit(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选辨识不能为空"); + } + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(id); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选辨识为空或已被删除"); + } + if (assessPlanById.getPlanExecStatus() < StatusEnum.PLAN_EXEC_IDENTIFICATION.getCode().byteValue()){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "不在辨识阶段,无法提交"); + }else if (assessPlanById.getPlanExecStatus() > StatusEnum.PLAN_EXEC_IDENTIFICATION.getCode().byteValue()){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识已完成,无需重复提交"); + } + if (!assessPlanById.getIdentificationUserId().equals(userInfoById.getId())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "您不是辨识人,无法进行辨识结果提交"); + } + // 没有进行任何辨识,无法提交 + if (assessPlanById.getIdentificationMethod() == 1){ + List<PhaQueryDTO> phaQueryDTOS = phaService.listPhaByPlanId(assessPlanById.getId()); + if (phaQueryDTOS.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "您未做任何辨识,无法提交"); + } + //辨识方法 2-JHA; + }else if (assessPlanById.getIdentificationMethod() == 2){ + List<JhaQueryDTO> jhaQueryDTOS = jhaService.listJhaByPlanId(assessPlanById.getId()); + if (jhaQueryDTOS.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "您未做任何辨识,无法提交"); + } + //辨识方法 3-SCL; + }else if (assessPlanById.getIdentificationMethod() == 3){ + List<SclQueryDTO> sclQueryDTOS = sclService.listSclByPlanId(assessPlanById.getId()); + if (sclQueryDTOS.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "您未做任何辨识,无法提交"); + } + //辨识方法 4-HAZOP; + }else if (assessPlanById.getIdentificationMethod() == 4){ + List<HazopQueryDTO> hazopQueryDTOS = hazopService.listHazopByPlanId(assessPlanById.getId()); + if (hazopQueryDTOS.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "您未做任何辨识,无法提交"); + } + //5-类比法 analogy; + }else if (assessPlanById.getIdentificationMethod() == 5){ + List<AnalogyQueryDTO> analogyQueryDTOS = analogyService.listAnalogyByPlanId(assessPlanById.getId()); + if (analogyQueryDTOS.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "您未做任何辨识,无法提交"); + } + }else { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "辨识方法参数错误"); + } + + assessPlanById.setIdentificationTime(LocalDateTime.now()); + assessPlanById.setPlanExecStatus(StatusEnum.PLAN_EXEC_EVALUATE.getCode().byteValue());//提交后,进入评价阶段 + + RiskAssessPlan submitResult = assessPlanRepository.save(assessPlanById); + + return BeanCopyUtils.copyBean(submitResult, AssessPlanUpdateDTO.class); + } + + /** + * 风险评估计划 - 评价 + */ + @Override + public AssessPlanEvaluateDTO evaluate(Long currentUserId, RiskAssessPlanAppEvaluateBO evaluateParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + LocalDateTime date = LocalDateTime.now(); + + if (ObjectUtils.isEmpty(evaluateParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的内容不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getRiskLevelValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险等级值不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getRiskLevel())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险级别不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getRiskColor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险色不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getManageLevel())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "管理层级不能为空"); + } + + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(evaluateParam.getId()); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "要评价的计划不存在或已被删除"); + } + if (assessPlanById.getPlanSellStatus() == 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该计划尚未派发,无法辨识"); + } + if (assessPlanById.getPlanExecStatus() != 3){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该计划不处待评价阶段,无法评价"); + } + if (assessPlanById.getAssessEndTime().isBefore(date)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "风险评价必须在评估结束时间之前"); + } + if (!assessPlanById.getEvaluateUserId().equals(userInfoById.getId())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "您不是评价人,无法进行评价"); + } + //设置必要参数 + RiskAssessPlan riskAssessPlan = BeanCopyUtils.copyBean(assessPlanById, RiskAssessPlan.class); + + riskAssessPlan.setEvaluateTime(date); + riskAssessPlan.setRiskValue(null); + riskAssessPlan.setRiskLevelValue(null); + riskAssessPlan.setRiskLevel(null); + riskAssessPlan.setRiskColor(null); + riskAssessPlan.setManageLevel(null); + + riskAssessPlan.setPlanExecStatus(StatusEnum.PLAN_EXEC_EVALUATE.getCode().byteValue());//评价阶段 + + RiskAssessPlan evaluateResult = assessPlanRepository.save(riskAssessPlan); + + return BeanCopyUtils.copyBean(evaluateResult, AssessPlanEvaluateDTO.class); + } + + /** + * 风险评估计划 - 评价修改 + */ + @Override + public AssessPlanEvaluateDTO evaluateUpdate(Long currentUserId, RiskAssessPlanAppEvaluateBO evaluateParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + LocalDateTime date = LocalDateTime.now(); + + if (ObjectUtils.isEmpty(evaluateParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价的内容不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getRiskValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险数值不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getRiskLevelValue())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险等级值不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getRiskLevel())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险级别不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getRiskColor())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险色不能为空"); + } + if (ObjectUtils.isEmpty(evaluateParam.getManageLevel())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "管理层级不能为空"); + } + + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(evaluateParam.getId()); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "要评价的计划不存在或已被删除"); + } + if (assessPlanById.getPlanSellStatus() == 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该计划尚未派发,无法辨识"); + } + if (assessPlanById.getPlanExecStatus() != 3){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该计划不处待评价阶段,无法评价"); + } + if (assessPlanById.getAssessEndTime().isBefore(date)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "风险评价必须在评估结束时间之前"); + } + if (!assessPlanById.getEvaluateUserId().equals(userInfoById.getId())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "您不是评价人,无法进行评价"); + } + //设置必要参数 + RiskAssessPlan riskAssessPlan = BeanCopyUtils.copyBean(assessPlanById, RiskAssessPlan.class); + + riskAssessPlan.setEvaluateTime(date); + riskAssessPlan.setRiskValue(null); + riskAssessPlan.setRiskLevelValue(null); + riskAssessPlan.setRiskLevel(null); + riskAssessPlan.setRiskColor(null); + riskAssessPlan.setManageLevel(null); + + RiskAssessPlan evaluateResult = assessPlanRepository.save(riskAssessPlan); + + return BeanCopyUtils.copyBean(evaluateResult, AssessPlanEvaluateDTO.class); + } + + /** + * 风险评估计划 - 评价结果提交 + */ + @Transactional + @Override + public AssessPlanUpdateDTO evaluateSubmit(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选评价不能为空"); + } + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(id); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "所选评价为空或已被删除"); + } + if (assessPlanById.getPlanExecStatus() < StatusEnum.PLAN_EXEC_EVALUATE.getCode().byteValue()){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "不在评价阶段,无法提交"); + }else if (assessPlanById.getPlanExecStatus() > StatusEnum.PLAN_EXEC_EVALUATE.getCode().byteValue()){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价已完成,无需重复提交"); + } + if (!assessPlanById.getEvaluateUserId().equals(userInfoById.getId())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "您不是评价人,无法进行评价结果提交"); + } +// ExecStatusSubmitBO execStatusSubmitBO = new ExecStatusSubmitBO(); +// execStatusSubmitBO.setId(id); +// execStatusSubmitBO.setPlanExecStatus(StatusEnum.PLAN_EXEC_OVER.getCode().byteValue());//评价提交后,评估结束 +// +// RiskAssessPlan submitResult = assessPlanRepository.execStatusSubmit(execStatusSubmitBO); + + assessPlanById.setPlanExecStatus(StatusEnum.PLAN_EXEC_OVER.getCode().byteValue()); + assessPlanById.setEvaluateTime(LocalDateTime.now()); + //修改风险单元评价状态 + RiskUnit riskUnit = riskUnitService.updateRiskUnitStatus(assessPlanById.getRiskUnitId(),StatusEnum.EVALUATE.getCode()); + if (ObjectUtils.isEmpty(riskUnit)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "修改风险单元状态失败"); + } + + // 1-检查该计划的所有辨识项,是否全部完成评价,否则无法提交 + int result = EvaluateCheckUtils.evaluateCheckUtils(assessPlanById); + if (result == 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "有辨识项未评价,无法提交"); + } + + // 2 - 该实验所有的评估计划,是否都是已编写 评估完成 + List<RiskAssessPlan> assessPlanByExperimentId = assessPlanRepository.getAssessPlanByExperimentId(assessPlanById.getExperimentId()); + int tag = 0; + for (RiskAssessPlan riskAssessPlan : assessPlanByExperimentId) { + // todo - 之前检查使用评价计划的status,存在编写完但未提交的计划。 先加上评估计划执行状态判断。 --- 需要测试是否能避免问题 + if (assessPlanById.getPlanExecStatus() != StatusEnum.PLAN_EXEC_OVER.getCode().byteValue()){ + tag = 1; + } + if (assessPlanById.getEvaluateMethod() == 1){ + List<LecQueryDTO> lecQueryDTOS = lecService.listLecByPlanId(riskAssessPlan.getId()); + for (LecQueryDTO lec : lecQueryDTOS) { + if (lec.getStatus() != 1){ + tag = 1; + } + } + //辨识方法2 - LS + }else if (assessPlanById.getEvaluateMethod() == 2){ + List<LsQueryDTO> lsQueryDTOS = lsService.listLsByPlanId(riskAssessPlan.getId()); + for (LsQueryDTO ls : lsQueryDTOS) { + if (ls.getStatus() != 1){ + tag = 1; + } + } + //辨识方法3 - MES + }else if (assessPlanById.getEvaluateMethod() == 3){ + List<MesQueryDTO> mesQueryDTOS = mesService.listMesByPlanId(riskAssessPlan.getId()); + for (MesQueryDTO mes : mesQueryDTOS) { + if (mes.getStatus() != 1){ + tag = 1; + } + } + //辨识方法4 - RS + }else if (assessPlanById.getEvaluateMethod() == 4){ + List<RsQueryDTO> rsQueryDTOS = rsService.listRsByPlanId(riskAssessPlan.getId()); + for (RsQueryDTO rs : rsQueryDTOS) { + if (rs.getStatus() != 1){ + tag = 1; + } + } + } + } + //所有评估计划完成,设置实验为评估完成状态。 + if (tag == 0){ + //修改实验 为 评估完成 + ExperimentInfoDTO experimentInfoDTO = experimentInfoService.updateExperimentStage(assessPlanById.getExperimentId(), StatusEnum.EXPERIMENT_STATUS_FINISH.getCode().byteValue()); + if (ObjectUtils.isEmpty(experimentInfoDTO)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"实验状态修改失败"); + } + } + + RiskAssessPlan submitResult = assessPlanRepository.save(assessPlanById); + + return BeanCopyUtils.copyBean(submitResult, AssessPlanUpdateDTO.class); + } + + /** + * 风险辨识与评价 - 查询 + */ + @Transactional + @Override + public SearchResult<RiskAssessAppQueryDTO> selectAssessPage(Long currentUserId, RiskAssessAppQueryBO queryBO) { + + //校验参数 + if (ObjectUtils.isEmpty(queryBO.getPageSize())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(queryBO.getPageIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + // 检查是否是实验管理者 + UserInfoDomainDTO userInfo = userDomainService.getUserById(currentUserId); + if (ObjectUtils.isEmpty(userInfo)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"用户不存在"); + } + if (queryBO.getAssessPlanName() == "null"){ + queryBO.setAssessPlanName(null); + } + if (queryBO.getExperimentName() == "null"){ + queryBO.setExperimentName(null); + } + + AssessQueryBO queryParam = BeanCopyUtils.copyBean(queryBO, AssessQueryBO.class); + if (!ObjectUtils.isEmpty(queryBO.getExperimentName())){ + ExperimentInfoDTO experimentByName = experimentInfoService.getExperimentByName(queryBO.getExperimentName()); + if (ObjectUtils.isEmpty(experimentByName)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + queryParam.setExperimentId(experimentByName.getId()); + } + // 拿到所有的固有风险单元 ,遍历 + List<Long> planIds = new ArrayList<>(); + List<RiskUnit> riskUnits = riskUnitService.listInherentRiskUnit(); + if (ObjectUtils.isEmpty(riskUnits)){ + for (RiskUnit riskUnit : riskUnits) { + // 拿到所有固有风险的评估计划 + List<RiskAssessPlan> assessPlanByInherentUnit = assessPlanRepository.getAssessPlanByInherentUnit(riskUnit.getBasicRiskUnitId()); + if (assessPlanByInherentUnit.size() > 0){ + // 遍历固有风险评估计划,如果当前用户属于对应实验的负责人,新增,修改人 + for (RiskAssessPlan inherentRiskAssessPlan : assessPlanByInherentUnit) { + if (riskUnit.getExperimentId().equals(currentUserId) || riskUnit.getCreateByUserId().equals(currentUserId) || riskUnit.getUpdateByUserId().equals(currentUserId)){ + planIds.add(inherentRiskAssessPlan.getId()); + } + } + } + } + } + + List<ExperimentInfoDTO> experimentByList = experimentInfoService.getExperimentByUser(currentUserId); + List<Long> experimentIdList = new ArrayList<>(); + experimentIdList.add(0L); + if (!ObjectUtils.isEmpty(experimentByList)){ + for (ExperimentInfoDTO experimentInfo : experimentByList) { + experimentIdList.add(experimentInfo.getId()); + } + } + + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(queryBO.getPageIndex()); + searchResult.setPageSize(queryBO.getPageSize()); + + int roleTag = GetRoleTagUtils.GetRoleTagUtils(userInfo); + //封装查询参数 + Specification<RiskAssessPlan> specification = new Specification<RiskAssessPlan>() { + @Override + public Predicate toPredicate(Root<RiskAssessPlan> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + if (queryParam.getAssessPlanName() != null && !queryParam.getAssessPlanName().equals("")){ + predicateList.add(criteriaBuilder.like(root.get("assessPlanName"),"%"+queryParam.getAssessPlanName()+"%")); + } + if (queryParam.getExperimentId() != null && !queryParam.getExperimentId().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("experimentId"), queryParam.getExperimentId())); + } + if (queryParam.getAssessPlanId() != null && !queryParam.getAssessPlanId().equals("")){ + predicateList.add(criteriaBuilder.equal(root.get("id"), queryParam.getAssessPlanId())); + } + if (!ObjectUtils.isEmpty(queryParam.getPlanExecStatus())){ + if (queryParam.getPlanExecStatus() == 5){ + predicateList.add(criteriaBuilder.ge(root.get("planExecStatus"), 3)); + }else { + predicateList.add(criteriaBuilder.equal(root.get("planExecStatus"), queryParam.getPlanExecStatus())); + } + } + if (queryParam.getTag() == 2){ + predicateList.add(criteriaBuilder.isNotNull(root.get("identificationTime"))); + } + if (queryParam.getTag() == 3){ + predicateList.add(criteriaBuilder.isNotNull(root.get("evaluateTime"))); + } + if (planIds.size() > 0){ + predicateList.add(criteriaBuilder.in(root.get("id")).value(planIds)); + } + + if (roleTag == UserTagEnum.USER_TAG_0.getCode()){ + //此处应有谁能查询:辨识专家,评价专家,实验负责人(此处未存相关信息,以实验id为条件查询) + predicateList.add(criteriaBuilder.or( + criteriaBuilder.equal(root.get("identificationUserId"), currentUserId), + criteriaBuilder.equal(root.get("evaluateUserId"), currentUserId), + criteriaBuilder.in(root.get("experimentId")).value(experimentIdList) + ) + ); + } + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"),StatusEnum.DELETE_NOT.getCode())); + return criteriaBuilder.and(predicateList.toArray(new Predicate[0])); + } + }; + + PageRequest pageParam = PageRequest.of(queryParam.getPageIndex() - 1, queryParam.getPageSize(), Sort.Direction.DESC, "updateTime"); + Page<RiskAssessPlan> pageResult = assessPlanRepository.findAll(specification, pageParam); + + //循环遍历结果集,封装查询结果 + List<AssessQueryDTO> assessQueryDTOList = new ArrayList<>(); + List<UserInfoDomainDTO> userList = userDomainService.getUserList(); + List<RiskUnitListAppQueryDTO> riskUnitListAppQueryDTOS = riskUnitService.listAssessRiskUnit(); + +// // 查处固有风险单元列表,依此为条件,查询评估计划 此处需要测试 +// List<RiskUnit> riskUnits = riskUnitService.listInherentRiskUnit(); +// if (ObjectUtils.isEmpty(riskUnits)){ +// for (RiskUnit riskUnit : riskUnits) { +// List<RiskAssessPlan> assessPlanByInherentUnit = assessPlanRepository.getAssessPlanByInherentUnit(riskUnit.getBasicRiskUnitId()); +// if (pageResult.getContent().size() > 0){ +// for (RiskAssessPlan riskAssessPlan : pageResult.getContent()) { +// if (riskAssessPlan.getExperimentId().equals(riskUnit.getExperimentId())){ +// if (assessPlanByInherentUnit.size() > 0){ +// for (RiskAssessPlan inherentAssessPlan : assessPlanByInherentUnit) { +// pageResult.getContent().add(inherentAssessPlan); +// } +// } +// } +// } +// } +// } +// } + + if (pageResult.getContent().size() > 0){ + for (RiskAssessPlan riskAssessPlan : pageResult.getContent()) { + AssessQueryDTO assessQueryDTO = BeanCopyUtils.copyBean(riskAssessPlan, AssessQueryDTO.class); + for (RiskUnitListAppQueryDTO riskUnit : riskUnitListAppQueryDTOS) { + if (riskUnit.getId() == assessQueryDTO.getRiskUnitId()){ + assessQueryDTO.setRiskUnitName(riskUnit.getRiskName()); + } + } + List<FactorQueryDTO> factorQueryDTOList = new ArrayList<>(); + List<PhaQueryDTO> phaList = new ArrayList<>(); + List<JhaQueryDTO> jhaList = new ArrayList<>(); + List<SclQueryDTO> sclList = new ArrayList<>(); + List<HazopQueryDTO> hazopList = new ArrayList<>(); + List<AnalogyQueryDTO> analogyList = new ArrayList<>(); + + //辨识方法 1-PHA; + if (assessQueryDTO.getIdentificationMethod() == 1){ + phaList = phaService.listPhaByPlanId(riskAssessPlan.getId()); + //辨识方法 2-JHA; + }else if (assessQueryDTO.getIdentificationMethod() == 2){ + jhaList = jhaService.listJhaByPlanId(riskAssessPlan.getId()); + //辨识方法 3-SCL; + }else if (assessQueryDTO.getIdentificationMethod() == 3){ + sclList = sclService.listSclByPlanId(riskAssessPlan.getId()); + //辨识方法 4-HAZOP; + }else if (assessQueryDTO.getIdentificationMethod() == 4){ + hazopList = hazopService.listHazopByPlanId(riskAssessPlan.getId()); + //5-类比法 analogy; + }else if (assessQueryDTO.getIdentificationMethod() == 5){ + analogyList = analogyService.listAnalogyByPlanId(riskAssessPlan.getId()); + }else { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "辨识方法参数错误"); + } + + //评价方法1 - LEC + if (assessQueryDTO.getEvaluateMethod() == 1){ + List<LecQueryDTO> lecList = lecService.listLecByPlanId(riskAssessPlan.getId()); + if (assessQueryDTO.getIdentificationMethod() == 1){ + for (PhaQueryDTO pha : phaList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(pha, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setPhaId(pha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(pha.getUpdateTime()); + for (LecQueryDTO lec : lecList) { + if (lec.getIdentificationId() == pha.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lecMatchPha(pha, lec); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setPhaId(pha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 2){ + for (JhaQueryDTO jha : jhaList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(jha, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setJhaId(jha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(jha.getUpdateTime()); + for (LecQueryDTO lec : lecList) { + if (lec.getIdentificationId() == jha.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lecMatchJha(jha, lec); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setJhaId(jha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 3){ + for (SclQueryDTO scl : sclList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(scl, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setSclId(scl.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(scl.getUpdateTime()); + for (LecQueryDTO lec : lecList) { + if (lec.getIdentificationId() == scl.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lecMatchScl(scl, lec); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setSclId(scl.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 4){ + for (HazopQueryDTO hazop : hazopList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(hazop, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setHazopId(hazop.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(hazop.getUpdateTime()); + for (LecQueryDTO lec : lecList) { + if (lec.getIdentificationId() == hazop.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lecMatchHazop(hazop, lec); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setHazopId(hazop.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + } + }else if (assessQueryDTO.getIdentificationMethod() == 5){ + for (AnalogyQueryDTO analogy : analogyList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(analogy, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setAnalogyId(analogy.getAssessPlanId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(analogy.getUpdateTime()); + for (LecQueryDTO lec : lecList) { + if (lec.getIdentificationId() == analogy.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lecMatchAnalogy(analogy, lec); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setAnalogyId(analogy.getAssessPlanId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + } + + //评价方法2 - LS + }else if (assessQueryDTO.getEvaluateMethod() == 2){ + List<LsQueryDTO> lsList = lsService.listLsByPlanId(riskAssessPlan.getId()); + if (assessQueryDTO.getIdentificationMethod() == 1){ + for (PhaQueryDTO pha : phaList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(pha, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setPhaId(pha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(pha.getUpdateTime()); + for (LsQueryDTO ls : lsList) { + if (ls.getIdentificationId() == pha.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lsMatchPha(pha, ls); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setPhaId(pha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 2){ + for (JhaQueryDTO jha : jhaList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(jha, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setJhaId(jha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(jha.getUpdateTime()); + for (LsQueryDTO ls : lsList) { + if (ls.getIdentificationId() == jha.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lsMatchJha(jha, ls); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setJhaId(jha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 3){ + for (SclQueryDTO scl : sclList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(scl, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setSclId(scl.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(scl.getUpdateTime()); + for (LsQueryDTO ls : lsList) { + if (ls.getIdentificationId() == scl.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lsMatchScl(scl, ls); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setSclId(scl.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 4){ + for (HazopQueryDTO hazop : hazopList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(hazop, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setHazopId(hazop.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(hazop.getUpdateTime()); + for (LsQueryDTO ls : lsList) { + if (ls.getIdentificationId() == hazop.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lsMatchHazop(hazop, ls); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setHazopId(hazop.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 5){ + for (AnalogyQueryDTO analogy : analogyList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(analogy, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setAnalogyId(analogy.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(analogy.getUpdateTime()); + for (LsQueryDTO ls : lsList) { + if (ls.getIdentificationId() == analogy.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.lsMatchAnalogy(analogy, ls); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setAnalogyId(analogy.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + } + //评价方法3 - MES + }else if (assessQueryDTO.getEvaluateMethod() == 3){ + List<MesQueryDTO> mesList = mesService.listMesByPlanId(riskAssessPlan.getId()); + if (assessQueryDTO.getIdentificationMethod() == 1){ + for (PhaQueryDTO pha : phaList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(pha, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setPhaId(pha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(pha.getUpdateTime()); + for (MesQueryDTO mes : mesList) { + if (mes.getIdentificationId() == pha.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.mesMatchPha(pha, mes); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setPhaId(pha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 2){ + for (JhaQueryDTO jha : jhaList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(jha, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setJhaId(jha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(jha.getUpdateTime()); + for (MesQueryDTO mes : mesList) { + if (mes.getIdentificationId() == jha.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.mesMatchJha(jha, mes); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setJhaId(jha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 3){ + for (SclQueryDTO scl : sclList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(scl, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setSclId(scl.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(scl.getUpdateTime()); + for (MesQueryDTO mes : mesList) { + if (mes.getIdentificationId() == scl.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.mesMatchScl(scl, mes); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setSclId(scl.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 4){ + for (HazopQueryDTO hazop : hazopList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(hazop, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setHazopId(hazop.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(hazop.getUpdateTime()); + for (MesQueryDTO mes : mesList) { + if (mes.getIdentificationId() == hazop.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.mesMatchHazop(hazop, mes); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setHazopId(hazop.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 5){ + for (AnalogyQueryDTO analogy : analogyList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(analogy, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setAnalogyId(analogy.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(analogy.getUpdateTime()); + for (MesQueryDTO mes : mesList) { + if (mes.getIdentificationId() == analogy.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.mesMatchAnalogy(analogy, mes); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setAnalogyId(analogy.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + } + //评价方法4 - RS + }else if (assessQueryDTO.getEvaluateMethod() == 4){ + List<RsQueryDTO> rsList = rsService.listRsByPlanId(riskAssessPlan.getId()); + if (assessQueryDTO.getIdentificationMethod() == 1){ + for (PhaQueryDTO pha : phaList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(pha, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setPhaId(pha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(pha.getUpdateTime()); + for (RsQueryDTO rs : rsList) { + if (rs.getIdentificationId() == pha.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.rsMatchPha(pha, rs); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setPhaId(pha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 2){ + for (JhaQueryDTO jha : jhaList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(jha, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setJhaId(jha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(jha.getUpdateTime()); + for (RsQueryDTO rs : rsList) { + if (rs.getIdentificationId() == jha.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.rsMatchJha(jha, rs); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setJhaId(jha.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 3){ + for (SclQueryDTO scl : sclList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(scl, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setSclId(scl.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(scl.getUpdateTime()); + for (RsQueryDTO rs : rsList) { + if (rs.getIdentificationId() == scl.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.rsMatchScl(scl, rs); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setSclId(scl.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 4){ + for (HazopQueryDTO hazop : hazopList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(hazop, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setHazopId(hazop.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(hazop.getUpdateTime()); + for (RsQueryDTO rs : rsList) { + if (rs.getIdentificationId() == hazop.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.rsMatchHazop(hazop, rs); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setHazopId(hazop.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + }else if (assessQueryDTO.getIdentificationMethod() == 5){ + for (AnalogyQueryDTO analogy : analogyList) { + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(analogy, FactorQueryDTO.class); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setAnalogyId(analogy.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setItemIdentificationTime(analogy.getUpdateTime()); + for (RsQueryDTO rs : rsList) { + if (rs.getIdentificationId() == analogy.getId()){ + EvaluateAndIdentificationUtils evaluateAndIdentificationUtils = new EvaluateAndIdentificationUtils(); + factorQueryDTO = evaluateAndIdentificationUtils.rsMatchAnalogy(analogy, rs); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + factorQueryDTO.setId(riskAssessPlan.getId()); + factorQueryDTO.setAnalogyId(analogy.getId()); + factorQueryDTO.setEvaluateMethod(riskAssessPlan.getEvaluateMethod()); + } + } + for (UserInfoDomainDTO user : userList) { + if (user.getId() == assessQueryDTO.getCreateByUserId()){ + assessQueryDTO.setCreateByUserName(user.getRealName()); + } + if (user.getId() == assessQueryDTO.getUpdateByUserId()){ + assessQueryDTO.setUpdateByUserName(user.getRealName()); + } + } + factorQueryDTOList.add(factorQueryDTO); + } + } + }else { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "评价方法参数错误"); + } + assessQueryDTO.setFactorQueryDTOList(factorQueryDTOList); + assessQueryDTOList.add(assessQueryDTO); + } + } + + searchResult.setData(assessQueryDTOList); + searchResult.setTotal(pageResult.getTotalElements()); + searchResult.setCount(assessQueryDTOList.size()); + return searchResult; + } + + /** + * 风险评估计划 - 辨识删除 + */ + @Transactional + @Override + public AssessPlanUpdateDTO deleteIdentification(Long currentUserId, RiskAssessPlanIdentificationDeleteReqBO deleteReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + if (ObjectUtils.isEmpty(deleteReqBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的辨识项目不能为空"); + } + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(deleteReqBO.getId()); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "辨识计划不存在,或已被删除"); + } + if (!assessPlanById.getIdentificationUserId().equals(currentUserId)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"不是辨识专家,无法操作"); + } + if (ObjectUtils.isEmpty(assessPlanById.getIdentificationMethod())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "要删除的辨识项目为空,或已被删除"); + } + if (assessPlanById.getPlanExecStatus() != StatusEnum.PLAN_EXEC_IDENTIFICATION.getCode().byteValue()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "辨识已提交,无法删除"); + } +// if (!assessPlanById.getPlanUserId().equals(userInfoById.getId())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "您不是计划制定者,无法删除"); +// } + //处理辨识表 + //辨识方法 1-PHA; + int tag = 0; + if (assessPlanById.getIdentificationMethod() == 1){ + IdentificationMethodDeleteDTO deleteIdentificationResult = phaService.deletePhaByPlanId(currentUserId, deleteReqBO.getPhaId()); + if (deleteIdentificationResult.getResult() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除辨识项目失败"); + } + tag = 1; + //辨识方法 2-JHA; + }else if (assessPlanById.getIdentificationMethod() == 2){ + IdentificationMethodDeleteDTO deleteIdentificationResult = jhaService.deleteJhaByPlanId(currentUserId, deleteReqBO.getJhaId()); + if (deleteIdentificationResult.getResult() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除辨识项目失败"); + } + tag = 1; + //辨识方法 3-SCL; + }else if (assessPlanById.getIdentificationMethod() == 3){ + IdentificationMethodDeleteDTO deleteIdentificationResult =sclService.deleteSclByPlanId(currentUserId, deleteReqBO.getSclId()); + if (deleteIdentificationResult.getResult() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除辨识项目失败"); + } + tag = 1; + //辨识方法 4-HAZOP; + }else if (assessPlanById.getIdentificationMethod() == 4){ + IdentificationMethodDeleteDTO deleteIdentificationResult = hazopService.deleteHazopByPlanId(currentUserId, deleteReqBO.getHazopId()); + if (deleteIdentificationResult.getResult() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除辨识项目失败"); + } + tag = 1; + //5-类比法 analogy; + }else if (assessPlanById.getIdentificationMethod() == 5){ + IdentificationMethodDeleteDTO deleteIdentificationResult= analogyService.deleteAnalogyByPlanId(currentUserId, deleteReqBO.getAnalogyId()); + if (deleteIdentificationResult.getResult() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除辨识项目失败"); + } + tag = 1; + }else { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "辨识方法参数错误"); + } + //处理计划表 , 清除辨识时间 +// RiskAssessPlan deleteResult = assessPlanRepository.deleteIdentification(deleteReqBO.getId(), LocalDateTime.now()); + //todo 需要进行判断,如果没有辨识,清空时间,如果有,重置时间 + assessPlanById.setIdentificationTime(null); + RiskAssessPlan deleteResult = assessPlanRepository.save(assessPlanById); + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "辨识方法删除失败"); + } + + return BeanCopyUtils.copyBean(deleteResult, AssessPlanUpdateDTO.class); + } + + /** + * 风险评估计划 - 评价删除 + */ + @Transactional + @Override + public AssessPlanUpdateDTO deleteEvaluate(Long currentUserId, RiskAssessPlanEvaluateDeleteReqBO deleteReqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + if (ObjectUtils.isEmpty(userInfoById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除"); + } + if (ObjectUtils.isEmpty(deleteReqBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要删除的评价项目不能为空"); + } + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(deleteReqBO.getId()); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "评价计划不存在,或已被删除"); + } + if (ObjectUtils.isEmpty(assessPlanById.getEvaluateMethod())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "要删除的评价项目为空,或已被删除"); + } + if (assessPlanById.getPlanExecStatus() != StatusEnum.PLAN_EXEC_EVALUATE.getCode().byteValue()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "评价已提交,无法删除"); + } + if (!assessPlanById.getPlanUserId().equals(userInfoById.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "您不是计划制定者,无法删除"); + } + //辨识方法1 - LEC + if (assessPlanById.getEvaluateMethod() == 1){ + EvaluateMethodDeleteDTO deleteEvaluateResult = lecService.deleteLecByPlanId(currentUserId, deleteReqBO); + if (deleteEvaluateResult.getResult() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除评价项目失败"); + } + //辨识方法2 - LS + }else if (assessPlanById.getEvaluateMethod() == 2){ + EvaluateMethodDeleteDTO deleteEvaluateResult = lsService.deleteLsByPlanId(currentUserId, deleteReqBO); + if (deleteEvaluateResult.getResult() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除评价项目失败"); + } + //辨识方法3 - MES + }else if (assessPlanById.getEvaluateMethod() == 3){ + EvaluateMethodDeleteDTO deleteEvaluateResult = mesService.deleteMesByPlanId(currentUserId, deleteReqBO); + if (deleteEvaluateResult.getResult() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除评价项目失败"); + } + //辨识方法4 - RS + }else if (assessPlanById.getEvaluateMethod() == 4){ + EvaluateMethodDeleteDTO deleteEvaluateResult = rsService.deleteRsByPlanId(currentUserId, deleteReqBO); + if (deleteEvaluateResult.getResult() < 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除评价项目失败"); + } + }else { + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode(), "评价方法参数错误"); + } + + //处理评估计划表 +// RiskAssessPlan deleteResult = assessPlanRepository.deleteEvaluate(id, LocalDateTime.now()); + assessPlanById.setIdentificationTime(null); + RiskAssessPlan deleteResult = assessPlanRepository.save(assessPlanById); + if (ObjectUtils.isEmpty(deleteResult)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "评价方法删除失败"); + } + + return BeanCopyUtils.copyBean(deleteResult, AssessPlanUpdateDTO.class); + } + + /** + * 风险评估计划 - 查询 by id + */ + @Override + public AssessPlanQueryDTO getAssessPlanById(Long id) { + + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划不能为空"); + } + + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(id); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "评估计划不存在"); + } + return BeanCopyUtils.copyBean(assessPlanById, AssessPlanQueryDTO.class); + } + + /** + * 风险评估计划 - 查询 by 实验id + */ + @Override + public List<AssessPlanQueryDTO> getAssessPlanByExperimentId(Long experimentId) { + + if (ObjectUtils.isEmpty(experimentId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估计划不能为空"); + } + List<RiskAssessPlan> assessPlanList = assessPlanRepository.getAssessPlanByExperimentId(experimentId); + return BeanCopyUtils.copyBeanList(assessPlanList, AssessPlanQueryDTO.class); + } + /** + * 评估计划 - 查询已派发 + */ + @Override + public List<RiskAssessPlanListAppDTO> listAssessPlan(Byte status) { + List<RiskAssessPlan> riskAssessPlans = assessPlanRepository.listAssessPlan(status); + if (riskAssessPlans.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "没有可以辨识的评估计划"); + } + return BeanCopyUtils.copyBeanList(riskAssessPlans, RiskAssessPlanListAppDTO.class); + } + /** + * 评估计划 - 修改任务派发状态 + */ + @Override + public int assessPlanSellStatus(Long id, byte status) { + + List<RiskAssessPlan> assessPlanByExperimentId = assessPlanRepository.getAssessPlanByExperimentId(id); + + int tag = 1; + for (RiskAssessPlan riskAssessPlan : assessPlanByExperimentId) { + riskAssessPlan.setPlanSellStatus(status); + RiskAssessPlan save = assessPlanRepository.save(riskAssessPlan); + if (ObjectUtils.isEmpty(save)){ + tag = 0; + } + } + + return tag; + } + /** + * 风险评估计划 - 辨识专家拒绝 + */ + @Override + public AssessPlanUpdateDTO identificationRefuse(Long currentUserId, Long id) { + + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的评估计划"); + } + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(id); + if (!currentUserId.equals(assessPlanById.getIdentificationUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "不能拒绝其他专家的辨识任务"); + } + if (assessPlanById.getPlanExecStatus().equals(StatusEnum.PLAN_EXEC_EVALUATE.getCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识结果已提交,无法拒绝任务"); + } + assessPlanById.setIdentificationUser(null); + assessPlanById.setIdentificationUserId(null); + + RiskAssessPlan save = assessPlanRepository.save(assessPlanById); + return BeanCopyUtils.copyBean(save, AssessPlanUpdateDTO.class); + } + + /** + * 风险评估计划 - 评价专家拒绝 + */ + @Transactional + @Override + public AssessPlanUpdateDTO evaluateRefuse(Long currentUserId, Long id) { + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的评估计划"); + } + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(id); + if (!currentUserId.equals(assessPlanById.getEvaluateUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "不能拒绝其他专家的评价任务"); + } + if (assessPlanById.getPlanExecStatus().equals(StatusEnum.PLAN_EXEC_OVER.getCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评估已完成,无法拒绝任务"); + } + assessPlanById.setEvaluateUser(null); + assessPlanById.setEvaluateUserId(null); + if (assessPlanById.getEvaluateTime() != null){ + if (assessPlanById.getEvaluateMethod().equals(MethodEnum.EVALUATE_METHOD_LEC.getCode())){ + int result = lecService.deleteLecByAssessPlanId(id); + if (result == 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "删除评价信息失败"); + } + }else if (assessPlanById.getEvaluateMethod().equals(MethodEnum.EVALUATE_METHOD_LS.getCode())){ + int result = lsService.deleteLsByAssessPlanId(id); + if (result == 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "删除评价信息失败"); + } + }else if (assessPlanById.getEvaluateMethod().equals(MethodEnum.EVALUATE_METHOD_MES.getCode())){ + int result = mesService.deleteMesByAssessPlanId(id); + if (result == 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "删除评价信息失败"); + } + }else if (assessPlanById.getEvaluateMethod().equals(MethodEnum.EVALUATE_METHOD_RS.getCode())){ + int result = rsService.deleteRsByAssessPlanId(id); + if (result == 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "删除评价信息失败"); + } + } + } + + RiskAssessPlan save = assessPlanRepository.save(assessPlanById); + + return BeanCopyUtils.copyBean(save, AssessPlanUpdateDTO.class); + } + + /** + * 风险评估计划 - 辨识方法修改 + */ + @Override + public AssessPlanUpdateDTO identificationUpdateMethod(Long currentUserId, MethodUpdateReqDTO updateReqDTO) { + + if (ObjectUtils.isEmpty(updateReqDTO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的评估计划"); + } + if (ObjectUtils.isEmpty(updateReqDTO.getIdentificationMethodId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的辨识方法"); + } + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(updateReqDTO.getId()); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "辨识任务不存在"); + } + if (!assessPlanById.getIdentificationUserId().equals(currentUserId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "只能修改自己的辨识任务"); + } + assessPlanById.setIdentificationMethod(updateReqDTO.getIdentificationMethodId()); + assessPlanById.setUpdateTime(LocalDateTime.now()); + assessPlanById.setUpdateByUserId(currentUserId); + + RiskAssessPlan save = assessPlanRepository.save(assessPlanById); + return BeanCopyUtils.copyBean(save, AssessPlanUpdateDTO.class); + } + + /** + * 风险评估计划 - 评价方法修改 + */ + @Transactional + @Override + public AssessPlanUpdateDTO evaluateUpdateMethod(Long currentUserId, MethodUpdateReqDTO updateReqDTO) { + + if (ObjectUtils.isEmpty(updateReqDTO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的评估计划"); + } + if (ObjectUtils.isEmpty(updateReqDTO.getEvaluateMethodId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的评价方法"); + } + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(updateReqDTO.getId()); + if (ObjectUtils.isEmpty(assessPlanById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "评价任务不存在"); + } + if (!assessPlanById.getEvaluateUserId().equals(currentUserId)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "只能修改自己的评价任务"); + } + assessPlanById.setEvaluateMethod(updateReqDTO.getEvaluateMethodId()); + assessPlanById.setUpdateTime(LocalDateTime.now()); + assessPlanById.setUpdateByUserId(currentUserId); + assessPlanById.setEvaluateTime(null); + + if (updateReqDTO.getEvaluateMethodId() == 1){ + int result = lecService.deleteLecByPlan(updateReqDTO.getId()); + if (result == StatusEnum.FAIL.getCode()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "修改评价方法失败"); + } + }else if (updateReqDTO.getEvaluateMethodId() == 2){ + int result = lsService.deleteLsByPlan(updateReqDTO.getId()); + if (result == StatusEnum.FAIL.getCode()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "修改评价方法失败"); + } + }else if (updateReqDTO.getEvaluateMethodId() == 3){ + int result = mesService.deleteMesByPlan(updateReqDTO.getId()); + if (result == StatusEnum.FAIL.getCode()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "修改评价方法失败"); + } + }else if (updateReqDTO.getEvaluateMethodId() == 4){ + int result = rsService.deleteRsByPlan(updateReqDTO.getId()); + if (result == StatusEnum.FAIL.getCode()){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "修改评价方法失败"); + } + } + + RiskAssessPlan save = assessPlanRepository.save(assessPlanById); + return BeanCopyUtils.copyBean(save, AssessPlanUpdateDTO.class); + } + + /** + * 风险评估计划 - 重新指定专家 + */ + @Override + public AssessPlanUpdateDTO appoint(Long currentUserId, AppointUserReBO appointUserReBO) { + + if (ObjectUtils.isEmpty(appointUserReBO.getId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "请选择正确的评估计划"); + } + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + RiskAssessPlan assessPlanById = assessPlanRepository.getAssessPlanById(appointUserReBO.getId()); + + if (!ObjectUtils.isEmpty(appointUserReBO.getIdentificationUserId())){ + UserInfoDomainDTO identificationUser = userDomainService.getUserById(appointUserReBO.getIdentificationUserId()); + if (ObjectUtils.isEmpty(identificationUser)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "所选的辨识专家不存在"); + } + assessPlanById.setIdentificationUserId(identificationUser.getId()); + assessPlanById.setIdentificationUser(identificationUser.getRealName()); + } + if (!ObjectUtils.isEmpty(appointUserReBO.getEvaluateUserId())){ + UserInfoDomainDTO evaluateUser = userDomainService.getUserById(appointUserReBO.getEvaluateUserId()); + if (ObjectUtils.isEmpty(evaluateUser)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_DATA_NOT_EXISIST.getCode(), "所选的评价专家不存在"); + } + assessPlanById.setEvaluateUserId(evaluateUser.getId()); + assessPlanById.setEvaluateUser(evaluateUser.getRealName()); + } + + LocalDateTime date = LocalDateTime.now(); + assessPlanById.setUpdateByUserId(user.getId()); + assessPlanById.setUpdateTime(date); + + RiskAssessPlan save = assessPlanRepository.save(assessPlanById); + return BeanCopyUtils.copyBean(save, AssessPlanUpdateDTO.class); + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskUnitServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskUnitServiceImpl.java new file mode 100644 index 0000000..baad6bb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskUnitServiceImpl.java @@ -0,0 +1,497 @@ +package com.gkhy.labRiskManage.domain.riskReport.service.impl; + +import com.gkhy.labRiskManage.api.controller.riskReport.dto.repDto.RiskUnitListReqBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.InherentRiskUnitAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.RiskUnitAppInsertBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.RiskUnitAppQueryBO; +import com.gkhy.labRiskManage.application.riskReport.dto.bo.RiskUnitAppUpdateBO; +import com.gkhy.labRiskManage.commons.domain.SearchResult; +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.enums.UserRoleEnum; +import com.gkhy.labRiskManage.commons.enums.UserTagEnum; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import com.gkhy.labRiskManage.domain.account.service.UserDomainService; +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnit; +import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnitType; +import com.gkhy.labRiskManage.domain.basic.model.dto.RiskUnitTypeDTO; +import com.gkhy.labRiskManage.domain.basic.repository.jpa.BasicRiskUnitRepository; +import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitTypeService; +import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO; +import com.gkhy.labRiskManage.domain.experiment.service.ExperimentInfoService; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlan; +import com.gkhy.labRiskManage.domain.riskReport.entity.RiskUnit; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskAssessPlanRepository; +import com.gkhy.labRiskManage.domain.riskReport.repository.jpa.RiskUnitRepository; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskAssessPlanService; +import com.gkhy.labRiskManage.domain.riskReport.service.RiskUnitService; +import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + + +/** + * 实验风险单元 + */ +@Service +public class RiskUnitServiceImpl implements RiskUnitService { + + @Autowired + private RiskUnitRepository riskUnitRepository; + @Autowired + private UserDomainService userDomainService; + @Autowired + private BasicRiskUnitTypeService riskUnitTypeService; + @Autowired + private ExperimentInfoService experimentInfoService; + @Autowired + private RiskAssessPlanRepository riskAssessPlanService; + + @Autowired + private BasicRiskUnitRepository basicRiskUnitRepository; + + + /** + * 实验风险单元 - 插入 + */ + @Override + public RiskUnitInsertDTO insertRiskUnit(Long currentUserId, RiskUnitAppInsertBO insertParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + //参数校验 + if (ObjectUtils.isEmpty(insertParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数不能为空"); + } + if (ObjectUtils.isEmpty(insertParam.getRiskCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元编号不能为空"); + } + RiskUnit unitByCode = riskUnitRepository.getUnitByCode(insertParam.getRiskCode()); + if (!ObjectUtils.isEmpty(unitByCode)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "编号已被使用"); + } + if (ObjectUtils.isEmpty(insertParam.getRiskName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元名称不能为空"); + } + if (ObjectUtils.isEmpty(insertParam.getLiabilityUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任人不能为空"); + } + if (ObjectUtils.isEmpty(insertParam.getRiskUnitTypeId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元类型不能为空"); + } + BasicRiskUnitType riskUnitTypeById = riskUnitTypeService.getRiskUnitTypeById(insertParam.getRiskUnitTypeId()); + if (ObjectUtils.isEmpty(riskUnitTypeById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元类型不存在或已被删除"); + } +// if (ObjectUtils.isEmpty(insertParam.getLiabilityDep())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任部门不能为空"); +// } + + //参数接收到的封装 + RiskUnit riskUnit = BeanCopyUtils.copyBean(insertParam, RiskUnit.class); + //获取需要的参数 + LocalDateTime date = LocalDateTime.now(); + + riskUnit.setCreateTime(date); + riskUnit.setUpdateTime(date); + riskUnit.setCreateByUserId(userInfoById.getId()); + riskUnit.setUpdateByUserId(userInfoById.getId()); + riskUnit.setLiabilityUserId(insertParam.getLiabilityUserId()); + riskUnit.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + riskUnit.setRiskType(StatusEnum.EXPERIMENT_RISK.getCode().byteValue()); + riskUnit.setEvaluateStatus(StatusEnum.EVALUATE_NOT.getCode().byteValue()); + + RiskUnit saveResult = riskUnitRepository.save(riskUnit); + + RiskUnitInsertDTO riskUnitInsertDTO = BeanCopyUtils.copyBean(saveResult, RiskUnitInsertDTO.class); + + return riskUnitInsertDTO; + } + + /** + * 固有风险单元 - 插入 + */ + @Override + public RiskUnitInsertDTO insertInherentRiskUnit(Long currentUserId, InherentRiskUnitAppInsertBO insertParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(),"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + //参数校验 + if (ObjectUtils.isEmpty(insertParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数不能为空"); + } + if (ObjectUtils.isEmpty(insertParam.getBasicRiskUnitId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元不能为空"); + } + + //参数接收到的封装 + RiskUnit riskUnit = BeanCopyUtils.copyBean(insertParam, RiskUnit.class); + //获取需要的参数 + LocalDateTime date = LocalDateTime.now(); + + riskUnit.setCreateTime(date); + riskUnit.setUpdateTime(date); + riskUnit.setCreateByUserId(userInfoById.getId()); + riskUnit.setUpdateByUserId(userInfoById.getId()); + riskUnit.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + riskUnit.setRiskType(StatusEnum.INHERENT_RISK.getCode().byteValue()); + + RiskUnit saveResult = riskUnitRepository.save(riskUnit); + RiskUnitInsertDTO riskUnitInsertDTO = BeanCopyUtils.copyBean(saveResult, RiskUnitInsertDTO.class); + + return riskUnitInsertDTO; + } + + /** + * 风险单元 - 分页查询 + */ + @Override + public SearchResult<RiskUnitQueryDTO> selectRiskUnitPage(Long currentUserId, RiskUnitAppQueryBO queryParam) { + + //校验参数 + if (ObjectUtils.isEmpty(queryParam.getPageSize())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (ObjectUtils.isEmpty(queryParam.getPageIndex())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"分页信息不能为空"); + } + if (queryParam.getExperimentName() == "null"){ + queryParam.setExperimentName(null); + } + if (queryParam.getRiskCode() == "null"){ + queryParam.setRiskCode(null); + } + if (queryParam.getRiskName() == "null"){ + queryParam.setRiskName(null); + } + + SearchResult searchResult = new SearchResult<>(); + searchResult.setPageIndex(queryParam.getPageIndex()); + searchResult.setPageSize(queryParam.getPageSize()); + + List<Long> experimentIds = new ArrayList<>(); + //实验负责人 + List<ExperimentInfoDTO> experimentByUser = experimentInfoService.getExperimentByUser(currentUserId); + if (ObjectUtils.isEmpty(experimentByUser)){ + for (ExperimentInfoDTO experimentInfo : experimentByUser) { + experimentIds.add(experimentInfo.getId()); + } + } + //辨识专家,评价专家,辨识专家 + List<RiskAssessPlan> assessPlanBySpecialist = riskAssessPlanService.getAssessPlanBySpecialist(currentUserId); + if (ObjectUtils.isEmpty(assessPlanBySpecialist)){ + for (RiskAssessPlan assessPlan : assessPlanBySpecialist) { + experimentIds.add(assessPlan.getExperimentId()); + } + } + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + //封装查询参数 + Specification<RiskUnit> specification = new Specification<RiskUnit>() { + @Override + public Predicate toPredicate(Root<RiskUnit> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) { + List<Predicate> predicateList = new ArrayList<>(); + if (queryParam.getRiskName() != null && !queryParam.getRiskName().equals("")){ + predicateList.add(criteriaBuilder.like(root.get("riskName"),"%"+queryParam.getRiskName()+"%")); + } + if (queryParam.getRiskCode() != null && !queryParam.getRiskCode().equals("")){ + predicateList.add(criteriaBuilder.like(root.get("riskCode"), "%"+queryParam.getRiskCode()+"%")); + } +// if (roleTag == 0){ +// predicateList.add(criteriaBuilder.in(root.get("experimentId")).value(experimentIds)); +// } + if (queryParam.getExperimentId() != null){ + predicateList.add(criteriaBuilder.equal(root.get("experimentId"),queryParam.getExperimentId())); + } + predicateList.add(criteriaBuilder.equal(root.get("deleteStatus"), StatusEnum.DELETE_NOT.getCode())); + return criteriaBuilder.and(predicateList.toArray(new Predicate[0])); + } + }; + + PageRequest pageParam = PageRequest.of(queryParam.getPageIndex() - 1, queryParam.getPageSize(), Sort.Direction.DESC, "updateTime"); + Page<RiskUnit> pageResult = riskUnitRepository.findAll(specification, pageParam); + + List<RiskUnitQueryDTO> riskUnitQueryDTOS = BeanCopyUtils.copyBeanList(pageResult.getContent(), RiskUnitQueryDTO.class); + + List<RiskUnitTypeDTO> riskUnitTypeList = riskUnitTypeService.listRiskUnitType(); + //取出所有用户 + List<UserInfoDomainDTO> userList = userDomainService.getUserList(); + for (RiskUnitQueryDTO riskUnitQueryDTO : riskUnitQueryDTOS) { + for (UserInfoDomainDTO userInfo : userList) { + if (userInfo.getId() == riskUnitQueryDTO.getCreateByUserId()){ + riskUnitQueryDTO.setCreateByUserName(userInfo.getRealName()); + } + if (userInfo.getId() == riskUnitQueryDTO.getUpdateByUserId()){ + riskUnitQueryDTO.setUpdateByUserName(userInfo.getRealName()); + } + } + //目前只有实验风险,添加类型。 + if (riskUnitQueryDTO.getRiskType() == 2){ + for (RiskUnitTypeDTO riskUnitType : riskUnitTypeList) { + if (riskUnitQueryDTO.getRiskUnitTypeId().equals(riskUnitType.getId())){ + riskUnitQueryDTO.setRiskUnitType(riskUnitType.getRiskType()); + } + } + } + } + + searchResult.setData(riskUnitQueryDTOS); + searchResult.setTotal(pageResult.getTotalElements()); + return searchResult; + } + + /** + * 风险单元 - 修改 + */ + @Override + public RiskUnitInsertDTO updateRiskUnit(Long currentUserId, RiskUnitAppUpdateBO updateParam) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + //参数校验 + if (ObjectUtils.isEmpty(updateParam)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "参数不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getRiskCode())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元编号不能为空"); + } + RiskUnit unitByCode = riskUnitRepository.getUnitByCode(updateParam.getRiskCode()); + if (!ObjectUtils.isEmpty(unitByCode) && !updateParam.getId().equals(unitByCode.getId())){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "编号已被使用"); + } + if (ObjectUtils.isEmpty(updateParam.getRiskName())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元名称不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getLiabilityUserId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任人不能为空"); + } + if (ObjectUtils.isEmpty(updateParam.getRiskUnitTypeId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元类型不能为空"); + } + BasicRiskUnitType riskUnitTypeById = riskUnitTypeService.getRiskUnitTypeById(updateParam.getRiskUnitTypeId()); + if (ObjectUtils.isEmpty(riskUnitTypeById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元类型不存在或已被删除"); + } +// if (ObjectUtils.isEmpty(insertParam.getLiabilityDep())){ +// throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "责任部门不能为空"); +// } + RiskUnit unitById = riskUnitRepository.getUnitById(updateParam.getId()); + + if (unitById.getRiskType() == 1){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "固有风险,信息无法修改"); + } + if (unitById.getEvaluateStatus() == 2){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该实验风险单元已被评价,信息无法修改"); + } + //参数接收到的封装 + RiskUnit riskUnit = BeanCopyUtils.copyBean(unitById, RiskUnit.class); + //获取需要的参数 + LocalDateTime date = LocalDateTime.now(); + + riskUnit.setUpdateTime(date); + riskUnit.setUpdateByUserId(userInfoById.getId()); + riskUnit.setExperimentId(updateParam.getExperimentId()); + riskUnit.setRiskCode(updateParam.getRiskCode()); + riskUnit.setRiskName(updateParam.getRiskName()); + riskUnit.setLiabilityUserId(updateParam.getLiabilityUserId()); + riskUnit.setLiabilityDep(updateParam.getLiabilityDep()); + riskUnit.setDescription(updateParam.getDescription()); + riskUnit.setRiskUnitTypeId(riskUnitTypeById.getId()); + + RiskUnit updateResult = riskUnitRepository.save(riskUnit); + + RiskUnitInsertDTO riskUnitInsertDTO = BeanCopyUtils.copyBean(updateResult, RiskUnitInsertDTO.class); + + return riskUnitInsertDTO; + } + + /** + * 风险单元 - 删除 + */ + @Override + public RiskUnitDeleteDTO deleteRiskUnit(Long currentUserId, Long id) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无效,请重新登陆"); + } + UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId); + + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "删除的内容不能为空"); + } + RiskUnit unitById = riskUnitRepository.getUnitById(id); + if (ObjectUtils.isEmpty(unitById)){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "删除的内容不存在或已被删除"); + } + if (unitById.getEvaluateStatus() == 2 && unitById.getRiskType() == 2){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR.getCode(), "该实验风险单元已被评价,无法删除"); + } + //设置必要参数 + LocalDateTime date = LocalDateTime.now(); + + RiskUnit riskUnit = BeanCopyUtils.copyBean(unitById, RiskUnit.class); + + riskUnit.setUpdateTime(date); + riskUnit.setUpdateByUserId(userInfoById.getId()); + riskUnit.setDeleteStatus(StatusEnum.DELETED.getCode().byteValue()); + + RiskUnit deleteResult = riskUnitRepository.save(riskUnit); + + return BeanCopyUtils.copyBean(deleteResult, RiskUnitDeleteDTO.class); + } + + /** + * 风险单元 - 查询by id + */ + @Override + public RiskUnitQueryDTO getRiskUnitById(Long id) { + if (ObjectUtils.isEmpty(id)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "查询的内容不能为空"); + } + RiskUnit unitById = riskUnitRepository.getUnitById(id); + if (ObjectUtils.isEmpty(unitById)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元不存在或已被删除"); + } + return BeanCopyUtils.copyBean(unitById, RiskUnitQueryDTO.class); + } + + /** + * 风险单元 - 查询by name + */ + @Override + public List<RiskUnitQueryDTO> getRiskUnitByName(String riskUnitName) { + if (ObjectUtils.isEmpty(riskUnitName)){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "查询的内容不能为空"); + } + List<RiskUnit> riskUnitList = riskUnitRepository.getRiskUnitByName(riskUnitName); + if (riskUnitList.size() < 1){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "风险单元不存在或已被删除"); + } + return BeanCopyUtils.copyBeanList(riskUnitList, RiskUnitQueryDTO.class); + } + /** + * 基础风险单元管理 - 列表查询 + */ + @Override + public List<RiskUnitListAppQueryDTO> listRiskUnit(Long currentUserId) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + List<RiskUnit> riskUnits = new ArrayList<>(); + + if (roleTag != UserTagEnum.USER_TAG_0.getCode()){ + riskUnits = riskUnitRepository.listRiskUnit(); + List<BasicRiskUnit> basicRiskUnits = basicRiskUnitRepository.listRiskUnit(); //todo 固有评价 +// for (BasicRiskUnit basicRiskUnit : basicRiskUnits) { +// +// } + }else { + riskUnits = riskUnitRepository.listRiskUnitByUserId(currentUserId); + List<BasicRiskUnit> basicRiskUnits = basicRiskUnitRepository.listRiskUnitByUserId(currentUserId);//todo 固有评价 + } + + List<RiskUnitListAppQueryDTO> riskUnitList = BeanCopyUtils.copyBeanList(riskUnits, RiskUnitListAppQueryDTO.class); + List<RiskUnitTypeDTO> riskUnitTypeList = riskUnitTypeService.listRiskUnitType(); + for (RiskUnitListAppQueryDTO riskUnit : riskUnitList) { + for (RiskUnitTypeDTO riskUnitType : riskUnitTypeList) { + if (riskUnit.getRiskUnitTypeId().equals(riskUnitType.getId())){ + riskUnit.setRiskUnitType(riskUnitType.getRiskType()); + } + } + } + return riskUnitList; + } + + /** + * 风险单元管理 - 列表查询 -根据实验信息 + */ + @Override + public List<RiskUnitListAppQueryDTO> listRiskUnitByExperiment(Long currentUserId, RiskUnitListReqBO reqBO) { + + if (currentUserId < 0){ + throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "当前用户无效,请重新登录"); + } + if (ObjectUtils.isEmpty(reqBO.getExperimentId())){ + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "实验信息无效"); + } + UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); + int roleTag = GetRoleTagUtils.GetRoleTagUtils(user); + + List<RiskUnit> riskUnits = new ArrayList<>(); + + if (roleTag != UserTagEnum.USER_TAG_0.getCode()){ + riskUnits = riskUnitRepository.listRiskUnitByExperiment(reqBO); + }else { + riskUnits = riskUnitRepository.listRiskUnitByExperimentAndUserId(currentUserId, reqBO); + } + + List<RiskUnitListAppQueryDTO> riskUnitList = BeanCopyUtils.copyBeanList(riskUnits, RiskUnitListAppQueryDTO.class); + List<RiskUnitTypeDTO> riskUnitTypeList = riskUnitTypeService.listRiskUnitType(); + for (RiskUnitListAppQueryDTO riskUnit : riskUnitList) { + for (RiskUnitTypeDTO riskUnitType : riskUnitTypeList) { + if (riskUnit.getRiskUnitTypeId().equals(riskUnitType.getId())){ + riskUnit.setRiskUnitType(riskUnitType.getRiskType()); + } + } + } + return riskUnitList; + } + + /** + * 基础风险单元管理 - 已添加评估计划的unit + */ + @Override + public List<RiskUnitListAppQueryDTO> listAssessRiskUnit() { + List<RiskUnit> riskUnits = riskUnitRepository.listAssessRiskUnit(); + return BeanCopyUtils.copyBeanList(riskUnits, RiskUnitListAppQueryDTO.class); + } + + @Override + public List<RiskUnit> getRiskUnitByExperimentId(Long id) { + List<RiskUnit> riskUnitList= riskUnitRepository.getRiskUnitByExperimentId(id); + return riskUnitList; + } + + @Override + public RiskUnit updateRiskUnitStatus(Long id, int status) { + RiskUnit unitById = riskUnitRepository.getUnitById(id); + unitById.setEvaluateStatus((byte) status); + return riskUnitRepository.save(unitById); + } + + @Override + public List<RiskUnit> listInherentRiskUnit() { + + List<RiskUnit> riskUnits = riskUnitRepository.listInherentRiskUnit(); + return riskUnits; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateAndIdentificationNewUtils.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateAndIdentificationNewUtils.java new file mode 100644 index 0000000..c5684bb --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateAndIdentificationNewUtils.java @@ -0,0 +1,416 @@ +package com.gkhy.labRiskManage.domain.riskReport.utils; + +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; + +@Component +public class EvaluateAndIdentificationNewUtils { + + /** + * LEC 匹配 + * */ + public static AssessQueryDTO_0223bak lecMatchPha (AssessQueryDTO_0223bak assessQueryDTO0223bak, PhaQueryDTO pha, LecQueryDTO lec){ + + assessQueryDTO0223bak.setPhaId(pha.getId()); + assessQueryDTO0223bak.setPhaCheckItem(pha.getPhaCheckItem()); + assessQueryDTO0223bak.setPhaRiskFactor(pha.getPhaRiskFactor()); + assessQueryDTO0223bak.setPhaResult(pha.getPhaResult()); + assessQueryDTO0223bak.setLecId(lec.getId()); + assessQueryDTO0223bak.setLecL(lec.getLecL()); + assessQueryDTO0223bak.setLecE(lec.getLecE()); + assessQueryDTO0223bak.setLecC(lec.getLecC()); + assessQueryDTO0223bak.setRiskValue(lec.getLecE()); + assessQueryDTO0223bak.setRiskLevel(lec.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(lec.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(lec.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(lec.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak lecMatchJha (AssessQueryDTO_0223bak assessQueryDTO0223bak, JhaQueryDTO jha, LecQueryDTO lec){ + + assessQueryDTO0223bak.setJhaId(jha.getId()); + assessQueryDTO0223bak.setJhaCheckItem(jha.getJhaCheckItem()); + assessQueryDTO0223bak.setJhaRiskFactor(jha.getJhaRiskFactor()); + assessQueryDTO0223bak.setJhaResult(jha.getJhaResult()); + if (!ObjectUtils.isEmpty(lec)){ + assessQueryDTO0223bak.setLecId(lec.getId()); + assessQueryDTO0223bak.setLecL(lec.getLecL()); + assessQueryDTO0223bak.setLecE(lec.getLecE()); + assessQueryDTO0223bak.setLecC(lec.getLecC()); + assessQueryDTO0223bak.setRiskValue(lec.getLecE()); + assessQueryDTO0223bak.setRiskLevel(lec.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(lec.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(lec.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(lec.getManageLevel()); + } + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak lecMatchScl (AssessQueryDTO_0223bak assessQueryDTO0223bak, SclQueryDTO scl, LecQueryDTO lec){ + + assessQueryDTO0223bak.setSclId(scl.getId()); + assessQueryDTO0223bak.setSclCheckItem(scl.getSclCheckItem()); + assessQueryDTO0223bak.setSclCheckStandard(scl.getSclCheckStandard()); + assessQueryDTO0223bak.setSclCheckUnstandard(scl.getSclCheckUnstandard()); + assessQueryDTO0223bak.setLecId(lec.getId()); + assessQueryDTO0223bak.setLecL(lec.getLecL()); + assessQueryDTO0223bak.setLecE(lec.getLecE()); + assessQueryDTO0223bak.setLecC(lec.getLecC()); + assessQueryDTO0223bak.setRiskValue(lec.getLecE()); + assessQueryDTO0223bak.setRiskLevel(lec.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(lec.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(lec.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(lec.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak lecMatchHazop (AssessQueryDTO_0223bak assessQueryDTO0223bak, HazopQueryDTO hazop, LecQueryDTO lec){ + + assessQueryDTO0223bak.setHazopId(hazop.getId()); + assessQueryDTO0223bak.setHazopResult(hazop.getHazopResult()); + assessQueryDTO0223bak.setHazopNode(hazop.getHazopNode()); + assessQueryDTO0223bak.setHazopParam(hazop.getHazopParam()); + assessQueryDTO0223bak.setHazopParamDesc(hazop.getHazopParamDesc()); + assessQueryDTO0223bak.setHazopGuide(hazop.getHazopGuide()); + assessQueryDTO0223bak.setHazopDeviation(hazop.getHazopDeviation()); + assessQueryDTO0223bak.setHazopPossibleCauses(hazop.getHazopPossibleCauses()); + assessQueryDTO0223bak.setLecId(lec.getId()); + assessQueryDTO0223bak.setLecL(lec.getLecL()); + assessQueryDTO0223bak.setLecE(lec.getLecE()); + assessQueryDTO0223bak.setLecC(lec.getLecC()); + assessQueryDTO0223bak.setRiskValue(lec.getLecE()); + assessQueryDTO0223bak.setRiskLevel(lec.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(lec.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(lec.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(lec.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak lecMatchAnalogy (AssessQueryDTO_0223bak assessQueryDTO0223bak, AnalogyQueryDTO analogy, LecQueryDTO lec){ + + assessQueryDTO0223bak.setAnalogyId(analogy.getAssessPlanId()); + assessQueryDTO0223bak.setAnalogyResult(analogy.getAnalogyResult()); + assessQueryDTO0223bak.setAnalogyReference(analogy.getAnalogyReference()); + assessQueryDTO0223bak.setAnalogyRiskFactor(analogy.getAnalogyRiskFactor()); + assessQueryDTO0223bak.setAnalogyCheckItem(analogy.getAnalogyCheckItem()); + assessQueryDTO0223bak.setLecId(lec.getId()); + assessQueryDTO0223bak.setLecL(lec.getLecL()); + assessQueryDTO0223bak.setLecE(lec.getLecE()); + assessQueryDTO0223bak.setLecC(lec.getLecC()); + assessQueryDTO0223bak.setRiskValue(lec.getLecE()); + assessQueryDTO0223bak.setRiskLevel(lec.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(lec.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(lec.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(lec.getManageLevel()); + + return assessQueryDTO0223bak; + } + + + /** + * LS 匹配 + * */ + public static AssessQueryDTO_0223bak lsMatchPha (AssessQueryDTO_0223bak assessQueryDTO0223bak, PhaQueryDTO pha, LsQueryDTO ls){ + + assessQueryDTO0223bak.setPhaId(pha.getId()); + assessQueryDTO0223bak.setPhaCheckItem(pha.getPhaCheckItem()); + assessQueryDTO0223bak.setPhaRiskFactor(pha.getPhaRiskFactor()); + assessQueryDTO0223bak.setPhaResult(pha.getPhaResult()); + assessQueryDTO0223bak.setLsId(ls.getId()); + assessQueryDTO0223bak.setLsL(ls.getLsL()); + assessQueryDTO0223bak.setLsS(ls.getLsS()); + assessQueryDTO0223bak.setRiskValue(ls.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(ls.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(ls.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(ls.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(ls.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak lsMatchJha (AssessQueryDTO_0223bak assessQueryDTO0223bak, JhaQueryDTO jha, LsQueryDTO ls){ + + assessQueryDTO0223bak.setJhaId(jha.getId()); + assessQueryDTO0223bak.setJhaCheckItem(jha.getJhaCheckItem()); + assessQueryDTO0223bak.setJhaRiskFactor(jha.getJhaRiskFactor()); + assessQueryDTO0223bak.setJhaResult(jha.getJhaResult()); + assessQueryDTO0223bak.setLsId(ls.getId()); + assessQueryDTO0223bak.setLsL(ls.getLsL()); + assessQueryDTO0223bak.setLsS(ls.getLsS()); + assessQueryDTO0223bak.setRiskValue(ls.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(ls.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(ls.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(ls.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(ls.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak lsMatchScl (AssessQueryDTO_0223bak assessQueryDTO0223bak, SclQueryDTO scl, LsQueryDTO ls){ + + assessQueryDTO0223bak.setSclId(scl.getId()); + assessQueryDTO0223bak.setSclCheckItem(scl.getSclCheckItem()); + assessQueryDTO0223bak.setSclCheckStandard(scl.getSclCheckStandard()); + assessQueryDTO0223bak.setSclCheckUnstandard(scl.getSclCheckUnstandard()); + assessQueryDTO0223bak.setLsId(ls.getId()); + assessQueryDTO0223bak.setLsL(ls.getLsL()); + assessQueryDTO0223bak.setLsS(ls.getLsS()); + assessQueryDTO0223bak.setRiskValue(ls.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(ls.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(ls.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(ls.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(ls.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak lsMatchHazop (AssessQueryDTO_0223bak assessQueryDTO0223bak, HazopQueryDTO hazop, LsQueryDTO ls){ + + assessQueryDTO0223bak.setHazopId(hazop.getId()); + assessQueryDTO0223bak.setHazopResult(hazop.getHazopResult()); + assessQueryDTO0223bak.setHazopNode(hazop.getHazopNode()); + assessQueryDTO0223bak.setHazopParam(hazop.getHazopParam()); + assessQueryDTO0223bak.setHazopParamDesc(hazop.getHazopParamDesc()); + assessQueryDTO0223bak.setHazopGuide(hazop.getHazopGuide()); + assessQueryDTO0223bak.setHazopDeviation(hazop.getHazopDeviation()); + assessQueryDTO0223bak.setHazopPossibleCauses(hazop.getHazopPossibleCauses()); + assessQueryDTO0223bak.setLsId(ls.getId()); + assessQueryDTO0223bak.setLsL(ls.getLsL()); + assessQueryDTO0223bak.setLsS(ls.getLsS()); + assessQueryDTO0223bak.setRiskValue(ls.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(ls.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(ls.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(ls.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(ls.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak lsMatchAnalogy (AssessQueryDTO_0223bak assessQueryDTO0223bak, AnalogyQueryDTO analogy, LsQueryDTO ls){ + + assessQueryDTO0223bak.setAnalogyId(analogy.getAssessPlanId()); + assessQueryDTO0223bak.setAnalogyResult(analogy.getAnalogyResult()); + assessQueryDTO0223bak.setAnalogyReference(analogy.getAnalogyReference()); + assessQueryDTO0223bak.setAnalogyRiskFactor(analogy.getAnalogyRiskFactor()); + assessQueryDTO0223bak.setAnalogyCheckItem(analogy.getAnalogyCheckItem()); + assessQueryDTO0223bak.setLsId(ls.getId()); + assessQueryDTO0223bak.setLsL(ls.getLsL()); + assessQueryDTO0223bak.setLsS(ls.getLsS()); + assessQueryDTO0223bak.setRiskValue(ls.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(ls.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(ls.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(ls.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(ls.getManageLevel()); + + return assessQueryDTO0223bak; + } + + + /** + * MES 匹配 + * */ + public static AssessQueryDTO_0223bak mesMatchPha (AssessQueryDTO_0223bak assessQueryDTO0223bak, PhaQueryDTO pha, MesQueryDTO mes){ + + assessQueryDTO0223bak.setPhaId(pha.getId()); + assessQueryDTO0223bak.setPhaCheckItem(pha.getPhaCheckItem()); + assessQueryDTO0223bak.setPhaRiskFactor(pha.getPhaRiskFactor()); + assessQueryDTO0223bak.setPhaResult(pha.getPhaResult()); + assessQueryDTO0223bak.setMesId(mes.getId()); + assessQueryDTO0223bak.setMesM(mes.getMesM()); + assessQueryDTO0223bak.setMesE(mes.getMesE()); + assessQueryDTO0223bak.setMesS(mes.getMesS()); + assessQueryDTO0223bak.setRiskValue(mes.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(mes.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(mes.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(mes.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(mes.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak mesMatchJha (AssessQueryDTO_0223bak assessQueryDTO0223bak, JhaQueryDTO jha, MesQueryDTO mes){ + + assessQueryDTO0223bak.setJhaId(jha.getId()); + assessQueryDTO0223bak.setJhaCheckItem(jha.getJhaCheckItem()); + assessQueryDTO0223bak.setJhaRiskFactor(jha.getJhaRiskFactor()); + assessQueryDTO0223bak.setJhaResult(jha.getJhaResult()); + assessQueryDTO0223bak.setMesId(mes.getId()); + assessQueryDTO0223bak.setMesM(mes.getMesM()); + assessQueryDTO0223bak.setMesE(mes.getMesE()); + assessQueryDTO0223bak.setMesS(mes.getMesS()); + assessQueryDTO0223bak.setRiskValue(mes.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(mes.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(mes.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(mes.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(mes.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak mesMatchScl (AssessQueryDTO_0223bak assessQueryDTO0223bak, SclQueryDTO scl, MesQueryDTO mes){ + + assessQueryDTO0223bak.setSclId(scl.getId()); + assessQueryDTO0223bak.setSclCheckItem(scl.getSclCheckItem()); + assessQueryDTO0223bak.setSclCheckStandard(scl.getSclCheckStandard()); + assessQueryDTO0223bak.setSclCheckUnstandard(scl.getSclCheckUnstandard()); + assessQueryDTO0223bak.setMesId(mes.getId()); + assessQueryDTO0223bak.setMesM(mes.getMesM()); + assessQueryDTO0223bak.setMesE(mes.getMesE()); + assessQueryDTO0223bak.setMesS(mes.getMesS()); + assessQueryDTO0223bak.setRiskValue(mes.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(mes.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(mes.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(mes.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(mes.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak mesMatchHazop (AssessQueryDTO_0223bak assessQueryDTO0223bak, HazopQueryDTO hazop, MesQueryDTO mes){ + + assessQueryDTO0223bak.setHazopId(hazop.getId()); + assessQueryDTO0223bak.setHazopResult(hazop.getHazopResult()); + assessQueryDTO0223bak.setHazopNode(hazop.getHazopNode()); + assessQueryDTO0223bak.setHazopParam(hazop.getHazopParam()); + assessQueryDTO0223bak.setHazopParamDesc(hazop.getHazopParamDesc()); + assessQueryDTO0223bak.setHazopGuide(hazop.getHazopGuide()); + assessQueryDTO0223bak.setHazopDeviation(hazop.getHazopDeviation()); + assessQueryDTO0223bak.setHazopPossibleCauses(hazop.getHazopPossibleCauses()); + assessQueryDTO0223bak.setMesId(mes.getId()); + assessQueryDTO0223bak.setMesM(mes.getMesM()); + assessQueryDTO0223bak.setMesE(mes.getMesE()); + assessQueryDTO0223bak.setMesS(mes.getMesS()); + assessQueryDTO0223bak.setRiskValue(mes.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(mes.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(mes.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(mes.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(mes.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak mesMatchAnalogy (AssessQueryDTO_0223bak assessQueryDTO0223bak, AnalogyQueryDTO analogy, MesQueryDTO mes){ + + assessQueryDTO0223bak.setAnalogyId(analogy.getAssessPlanId()); + assessQueryDTO0223bak.setAnalogyResult(analogy.getAnalogyResult()); + assessQueryDTO0223bak.setAnalogyReference(analogy.getAnalogyReference()); + assessQueryDTO0223bak.setAnalogyRiskFactor(analogy.getAnalogyRiskFactor()); + assessQueryDTO0223bak.setAnalogyCheckItem(analogy.getAnalogyCheckItem()); + assessQueryDTO0223bak.setMesId(mes.getId()); + assessQueryDTO0223bak.setMesM(mes.getMesM()); + assessQueryDTO0223bak.setMesE(mes.getMesE()); + assessQueryDTO0223bak.setMesS(mes.getMesS()); + assessQueryDTO0223bak.setRiskValue(mes.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(mes.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(mes.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(mes.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(mes.getManageLevel()); + + return assessQueryDTO0223bak; + } + + + /** + * RS 匹配 + * */ + public static AssessQueryDTO_0223bak rsMatchPha (AssessQueryDTO_0223bak assessQueryDTO0223bak, PhaQueryDTO pha, RsQueryDTO rs){ + + assessQueryDTO0223bak.setPhaId(pha.getId()); + assessQueryDTO0223bak.setPhaCheckItem(pha.getPhaCheckItem()); + assessQueryDTO0223bak.setPhaRiskFactor(pha.getPhaRiskFactor()); + assessQueryDTO0223bak.setPhaResult(pha.getPhaResult()); + assessQueryDTO0223bak.setRsId(rs.getId()); + assessQueryDTO0223bak.setRsR(rs.getRsR()); + assessQueryDTO0223bak.setRsS(rs.getRsS()); + assessQueryDTO0223bak.setRiskValue(rs.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(rs.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(rs.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(rs.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(rs.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak rsMatchJha (AssessQueryDTO_0223bak assessQueryDTO0223bak, JhaQueryDTO jha, RsQueryDTO rs){ + + assessQueryDTO0223bak.setJhaId(jha.getId()); + assessQueryDTO0223bak.setJhaCheckItem(jha.getJhaCheckItem()); + assessQueryDTO0223bak.setJhaRiskFactor(jha.getJhaRiskFactor()); + assessQueryDTO0223bak.setJhaResult(jha.getJhaResult()); + assessQueryDTO0223bak.setRsId(rs.getId()); + assessQueryDTO0223bak.setRsR(rs.getRsR()); + assessQueryDTO0223bak.setRsS(rs.getRsS()); + assessQueryDTO0223bak.setRiskValue(rs.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(rs.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(rs.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(rs.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(rs.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak rsMatchScl (AssessQueryDTO_0223bak assessQueryDTO0223bak, SclQueryDTO scl, RsQueryDTO rs){ + + assessQueryDTO0223bak.setSclId(scl.getId()); + assessQueryDTO0223bak.setSclCheckItem(scl.getSclCheckItem()); + assessQueryDTO0223bak.setSclCheckStandard(scl.getSclCheckStandard()); + assessQueryDTO0223bak.setSclCheckUnstandard(scl.getSclCheckUnstandard()); + assessQueryDTO0223bak.setRsId(rs.getId()); + assessQueryDTO0223bak.setRsR(rs.getRsR()); + assessQueryDTO0223bak.setRsS(rs.getRsS()); + assessQueryDTO0223bak.setRiskValue(rs.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(rs.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(rs.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(rs.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(rs.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak rsMatchHazop (AssessQueryDTO_0223bak assessQueryDTO0223bak, HazopQueryDTO hazop, RsQueryDTO rs){ + + assessQueryDTO0223bak.setHazopId(hazop.getId()); + assessQueryDTO0223bak.setHazopResult(hazop.getHazopResult()); + assessQueryDTO0223bak.setHazopNode(hazop.getHazopNode()); + assessQueryDTO0223bak.setHazopParam(hazop.getHazopParam()); + assessQueryDTO0223bak.setHazopParamDesc(hazop.getHazopParamDesc()); + assessQueryDTO0223bak.setHazopGuide(hazop.getHazopGuide()); + assessQueryDTO0223bak.setHazopDeviation(hazop.getHazopDeviation()); + assessQueryDTO0223bak.setHazopPossibleCauses(hazop.getHazopPossibleCauses()); + assessQueryDTO0223bak.setRsId(rs.getId()); + assessQueryDTO0223bak.setRsR(rs.getRsR()); + assessQueryDTO0223bak.setRsS(rs.getRsS()); + assessQueryDTO0223bak.setRiskValue(rs.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(rs.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(rs.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(rs.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(rs.getManageLevel()); + + return assessQueryDTO0223bak; + } + + public static AssessQueryDTO_0223bak rsMatchAnalogy (AssessQueryDTO_0223bak assessQueryDTO0223bak, AnalogyQueryDTO analogy, RsQueryDTO rs){ + + assessQueryDTO0223bak.setAnalogyId(analogy.getAssessPlanId()); + assessQueryDTO0223bak.setAnalogyResult(analogy.getAnalogyResult()); + assessQueryDTO0223bak.setAnalogyReference(analogy.getAnalogyReference()); + assessQueryDTO0223bak.setAnalogyRiskFactor(analogy.getAnalogyRiskFactor()); + assessQueryDTO0223bak.setAnalogyCheckItem(analogy.getAnalogyCheckItem()); + assessQueryDTO0223bak.setRsId(rs.getId()); + assessQueryDTO0223bak.setRsR(rs.getRsR()); + assessQueryDTO0223bak.setRsS(rs.getRsS()); + assessQueryDTO0223bak.setRiskValue(rs.getRiskValue()); + assessQueryDTO0223bak.setRiskLevel(rs.getRiskLevel()); + assessQueryDTO0223bak.setRiskLevelValue(rs.getRiskLevelValue()); + assessQueryDTO0223bak.setRiskColor(rs.getRiskColor()); + assessQueryDTO0223bak.setManageLevel(rs.getManageLevel()); + + return assessQueryDTO0223bak; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateAndIdentificationUtils.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateAndIdentificationUtils.java new file mode 100644 index 0000000..0b1315a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateAndIdentificationUtils.java @@ -0,0 +1,824 @@ +package com.gkhy.labRiskManage.domain.riskReport.utils; + +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; +import org.springframework.stereotype.Component; + +@Component +public class EvaluateAndIdentificationUtils { + + /** + * LEC 匹配 + * */ + public static FactorQueryDTO lecMatchPha (PhaQueryDTO pha, LecQueryDTO lec){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(pha, FactorQueryDTO.class); + factorQueryDTO.setLecId(lec.getId()); + factorQueryDTO.setLecL(lec.getLecL()); + factorQueryDTO.setLecE(lec.getLecE()); + factorQueryDTO.setLecC(lec.getLecC()); + factorQueryDTO.setRiskValue(lec.getRiskValue()); + factorQueryDTO.setRiskLevel(lec.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(lec.getRiskLevelValue()); + factorQueryDTO.setRiskColor(lec.getRiskColor()); + factorQueryDTO.setManageLevel(lec.getManageLevel()); + factorQueryDTO.setEvaluateStatus(lec.getStatus()); + factorQueryDTO.setEvaluateDesc(lec.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(lec.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(pha.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(lec.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(lec.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(lec.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(lec.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(lec.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLecL(lec.getOriginalLecL()); + factorQueryDTO.setOriginalLecE(lec.getOriginalLecE()); + factorQueryDTO.setOriginalLecC(lec.getOriginalLecC()); + factorQueryDTO.setOriginalRiskValue(lec.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(lec.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(lec.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(lec.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(lec.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(lec.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(lec.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(lec.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(lec.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(lec.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO lecMatchJha (JhaQueryDTO jha, LecQueryDTO lec){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(jha, FactorQueryDTO.class); + factorQueryDTO.setLecId(lec.getId()); + factorQueryDTO.setLecL(lec.getLecL()); + factorQueryDTO.setLecE(lec.getLecE()); + factorQueryDTO.setLecC(lec.getLecC()); + factorQueryDTO.setRiskValue(lec.getRiskValue()); + factorQueryDTO.setRiskLevel(lec.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(lec.getRiskLevelValue()); + factorQueryDTO.setRiskColor(lec.getRiskColor()); + factorQueryDTO.setManageLevel(lec.getManageLevel()); + factorQueryDTO.setEvaluateStatus(lec.getStatus()); + factorQueryDTO.setEvaluateDesc(lec.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(lec.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(jha.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(lec.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(lec.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(lec.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(lec.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(lec.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLecL(lec.getOriginalLecL()); + factorQueryDTO.setOriginalLecE(lec.getOriginalLecE()); + factorQueryDTO.setOriginalLecC(lec.getOriginalLecC()); + factorQueryDTO.setOriginalRiskValue(lec.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(lec.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(lec.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(lec.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(lec.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(lec.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(lec.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(lec.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(lec.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(lec.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO lecMatchScl (SclQueryDTO scl, LecQueryDTO lec){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(scl, FactorQueryDTO.class); + factorQueryDTO.setLecId(lec.getId()); + factorQueryDTO.setLecL(lec.getLecL()); + factorQueryDTO.setLecE(lec.getLecE()); + factorQueryDTO.setLecC(lec.getLecC()); + factorQueryDTO.setRiskValue(lec.getRiskValue()); + factorQueryDTO.setRiskLevel(lec.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(lec.getRiskLevelValue()); + factorQueryDTO.setRiskColor(lec.getRiskColor()); + factorQueryDTO.setManageLevel(lec.getManageLevel()); + factorQueryDTO.setEvaluateStatus(lec.getStatus()); + factorQueryDTO.setEvaluateDesc(lec.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(lec.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(scl.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(lec.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(lec.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(lec.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(lec.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(lec.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLecL(lec.getOriginalLecL()); + factorQueryDTO.setOriginalLecE(lec.getOriginalLecE()); + factorQueryDTO.setOriginalLecC(lec.getOriginalLecC()); + factorQueryDTO.setOriginalRiskValue(lec.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(lec.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(lec.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(lec.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(lec.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(lec.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(lec.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(lec.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(lec.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(lec.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO lecMatchHazop (HazopQueryDTO Hazop, LecQueryDTO lec){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(Hazop, FactorQueryDTO.class); + factorQueryDTO.setLecId(lec.getId()); + factorQueryDTO.setLecL(lec.getLecL()); + factorQueryDTO.setLecE(lec.getLecE()); + factorQueryDTO.setLecC(lec.getLecC()); + factorQueryDTO.setRiskValue(lec.getRiskValue()); + factorQueryDTO.setRiskLevel(lec.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(lec.getRiskLevelValue()); + factorQueryDTO.setRiskColor(lec.getRiskColor()); + factorQueryDTO.setManageLevel(lec.getManageLevel()); + factorQueryDTO.setEvaluateStatus(lec.getStatus()); + factorQueryDTO.setEvaluateDesc(lec.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(lec.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(Hazop.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(lec.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(lec.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(lec.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(lec.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(lec.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLecL(lec.getOriginalLecL()); + factorQueryDTO.setOriginalLecE(lec.getOriginalLecE()); + factorQueryDTO.setOriginalLecC(lec.getOriginalLecC()); + factorQueryDTO.setOriginalRiskValue(lec.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(lec.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(lec.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(lec.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(lec.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(lec.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(lec.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(lec.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(lec.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(lec.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO lecMatchAnalogy (AnalogyQueryDTO Analogy, LecQueryDTO lec){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(Analogy, FactorQueryDTO.class); + factorQueryDTO.setLecId(lec.getId()); + factorQueryDTO.setLecL(lec.getLecL()); + factorQueryDTO.setLecE(lec.getLecE()); + factorQueryDTO.setLecC(lec.getLecC()); + factorQueryDTO.setRiskValue(lec.getRiskValue()); + factorQueryDTO.setRiskLevel(lec.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(lec.getRiskLevelValue()); + factorQueryDTO.setRiskColor(lec.getRiskColor()); + factorQueryDTO.setManageLevel(lec.getManageLevel()); + factorQueryDTO.setEvaluateStatus(lec.getStatus()); + factorQueryDTO.setEvaluateDesc(lec.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(lec.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(Analogy.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(lec.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(lec.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(lec.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(lec.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(lec.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLecL(lec.getOriginalLecL()); + factorQueryDTO.setOriginalLecE(lec.getOriginalLecE()); + factorQueryDTO.setOriginalLecC(lec.getOriginalLecC()); + factorQueryDTO.setOriginalRiskValue(lec.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(lec.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(lec.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(lec.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(lec.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(lec.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(lec.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(lec.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(lec.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(lec.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + + /** + * LS 匹配 + * */ + public static FactorQueryDTO lsMatchPha (PhaQueryDTO pha, LsQueryDTO ls){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(pha, FactorQueryDTO.class); + factorQueryDTO.setLsId(ls.getId()); + factorQueryDTO.setLsL(ls.getLsL()); + factorQueryDTO.setLsS(ls.getLsS()); + factorQueryDTO.setRiskValue(ls.getRiskValue()); + factorQueryDTO.setRiskLevel(ls.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(ls.getRiskLevelValue()); + factorQueryDTO.setRiskColor(ls.getRiskColor()); + factorQueryDTO.setManageLevel(ls.getManageLevel()); + factorQueryDTO.setEvaluateStatus(ls.getStatus()); + factorQueryDTO.setEvaluateDesc(ls.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(ls.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(pha.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(ls.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(ls.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(ls.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(ls.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(ls.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLsL(ls.getOriginalLsL()); + factorQueryDTO.setOriginalLsS(ls.getOriginalLsS()); + factorQueryDTO.setOriginalRiskValue(ls.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(ls.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(ls.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(ls.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(ls.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(ls.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(ls.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(ls.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(ls.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(ls.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO lsMatchJha (JhaQueryDTO jha, LsQueryDTO ls){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(jha, FactorQueryDTO.class); + factorQueryDTO.setLsId(ls.getId()); + factorQueryDTO.setLsL(ls.getLsL()); + factorQueryDTO.setLsS(ls.getLsS()); + factorQueryDTO.setRiskValue(ls.getRiskValue()); + factorQueryDTO.setRiskLevel(ls.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(ls.getRiskLevelValue()); + factorQueryDTO.setRiskColor(ls.getRiskColor()); + factorQueryDTO.setManageLevel(ls.getManageLevel()); + factorQueryDTO.setEvaluateStatus(ls.getStatus()); + factorQueryDTO.setEvaluateDesc(ls.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(ls.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(jha.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(ls.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(ls.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(ls.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(ls.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(ls.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLsL(ls.getOriginalLsL()); + factorQueryDTO.setOriginalLsS(ls.getOriginalLsS()); + factorQueryDTO.setOriginalRiskValue(ls.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(ls.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(ls.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(ls.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(ls.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(ls.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(ls.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(ls.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(ls.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(ls.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO lsMatchScl (SclQueryDTO scl, LsQueryDTO ls){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(scl, FactorQueryDTO.class); + factorQueryDTO.setLsId(ls.getId()); + factorQueryDTO.setLsL(ls.getLsL()); + factorQueryDTO.setLsS(ls.getLsS()); + factorQueryDTO.setRiskValue(ls.getRiskValue()); + factorQueryDTO.setRiskLevel(ls.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(ls.getRiskLevelValue()); + factorQueryDTO.setRiskColor(ls.getRiskColor()); + factorQueryDTO.setManageLevel(ls.getManageLevel()); + factorQueryDTO.setEvaluateStatus(ls.getStatus()); + factorQueryDTO.setEvaluateDesc(ls.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(ls.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(scl.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(ls.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(ls.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(ls.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(ls.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(ls.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLsL(ls.getOriginalLsL()); + factorQueryDTO.setOriginalLsS(ls.getOriginalLsS()); + factorQueryDTO.setOriginalRiskValue(ls.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(ls.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(ls.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(ls.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(ls.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(ls.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(ls.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(ls.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(ls.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(ls.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO lsMatchHazop (HazopQueryDTO Hazop, LsQueryDTO ls){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(Hazop, FactorQueryDTO.class); + factorQueryDTO.setLsId(ls.getId()); + factorQueryDTO.setLsL(ls.getLsL()); + factorQueryDTO.setLsS(ls.getLsS()); + factorQueryDTO.setRiskValue(ls.getRiskValue()); + factorQueryDTO.setRiskLevel(ls.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(ls.getRiskLevelValue()); + factorQueryDTO.setRiskColor(ls.getRiskColor()); + factorQueryDTO.setManageLevel(ls.getManageLevel()); + factorQueryDTO.setEvaluateStatus(ls.getStatus()); + factorQueryDTO.setEvaluateDesc(ls.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(ls.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(Hazop.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(ls.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(ls.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(ls.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(ls.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(ls.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLsL(ls.getOriginalLsL()); + factorQueryDTO.setOriginalLsS(ls.getOriginalLsS()); + factorQueryDTO.setOriginalRiskValue(ls.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(ls.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(ls.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(ls.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(ls.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(ls.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(ls.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(ls.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(ls.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(ls.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO lsMatchAnalogy (AnalogyQueryDTO Analogy, LsQueryDTO ls){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(Analogy, FactorQueryDTO.class); + factorQueryDTO.setLsId(ls.getId()); + factorQueryDTO.setLsL(ls.getLsL()); + factorQueryDTO.setLsS(ls.getLsS()); + factorQueryDTO.setRiskValue(ls.getRiskValue()); + factorQueryDTO.setRiskLevel(ls.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(ls.getRiskLevelValue()); + factorQueryDTO.setRiskColor(ls.getRiskColor()); + factorQueryDTO.setManageLevel(ls.getManageLevel()); + factorQueryDTO.setEvaluateStatus(ls.getStatus()); + factorQueryDTO.setEvaluateDesc(ls.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(ls.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(Analogy.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(ls.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(ls.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(ls.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(ls.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(ls.getEmergencyMeasure()); + + factorQueryDTO.setOriginalLsL(ls.getOriginalLsL()); + factorQueryDTO.setOriginalLsS(ls.getOriginalLsS()); + factorQueryDTO.setOriginalRiskValue(ls.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(ls.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(ls.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(ls.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(ls.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(ls.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(ls.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(ls.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(ls.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(ls.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + + /** + * MES 匹配 + * */ + public static FactorQueryDTO mesMatchPha (PhaQueryDTO pha, MesQueryDTO mes){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(pha, FactorQueryDTO.class); + factorQueryDTO.setMesId(mes.getId()); + factorQueryDTO.setMesM(mes.getMesM()); + factorQueryDTO.setMesE(mes.getMesE()); + factorQueryDTO.setMesS(mes.getMesS()); + factorQueryDTO.setRiskValue(mes.getRiskValue()); + factorQueryDTO.setRiskLevel(mes.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(mes.getRiskLevelValue()); + factorQueryDTO.setRiskColor(mes.getRiskColor()); + factorQueryDTO.setManageLevel(mes.getManageLevel()); + factorQueryDTO.setEvaluateStatus(mes.getStatus()); + factorQueryDTO.setEvaluateDesc(mes.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(mes.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(pha.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(mes.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(mes.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(mes.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(mes.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(mes.getEmergencyMeasure()); + + factorQueryDTO.setOriginalMesM(mes.getOriginalMesM()); + factorQueryDTO.setOriginalMesE(mes.getOriginalMesE()); + factorQueryDTO.setOriginalMesS(mes.getOriginalMesS()); + factorQueryDTO.setOriginalRiskValue(mes.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(mes.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(mes.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(mes.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(mes.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(mes.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(mes.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(mes.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(mes.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(mes.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO mesMatchJha (JhaQueryDTO jha, MesQueryDTO mes){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(jha, FactorQueryDTO.class); + factorQueryDTO.setMesId(mes.getId()); + factorQueryDTO.setMesM(mes.getMesM()); + factorQueryDTO.setMesE(mes.getMesE()); + factorQueryDTO.setMesS(mes.getMesS()); + factorQueryDTO.setRiskValue(mes.getRiskValue()); + factorQueryDTO.setRiskLevel(mes.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(mes.getRiskLevelValue()); + factorQueryDTO.setRiskColor(mes.getRiskColor()); + factorQueryDTO.setManageLevel(mes.getManageLevel()); + factorQueryDTO.setEvaluateStatus(mes.getStatus()); + factorQueryDTO.setEvaluateDesc(mes.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(mes.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(jha.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(mes.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(mes.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(mes.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(mes.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(mes.getEmergencyMeasure()); + + factorQueryDTO.setOriginalMesM(mes.getOriginalMesM()); + factorQueryDTO.setOriginalMesE(mes.getOriginalMesE()); + factorQueryDTO.setOriginalMesS(mes.getOriginalMesS()); + factorQueryDTO.setOriginalRiskValue(mes.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(mes.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(mes.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(mes.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(mes.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(mes.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(mes.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(mes.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(mes.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(mes.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO mesMatchScl (SclQueryDTO scl, MesQueryDTO mes){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(scl, FactorQueryDTO.class); + factorQueryDTO.setMesId(mes.getId()); + factorQueryDTO.setMesM(mes.getMesM()); + factorQueryDTO.setMesE(mes.getMesE()); + factorQueryDTO.setMesS(mes.getMesS()); + factorQueryDTO.setRiskValue(mes.getRiskValue()); + factorQueryDTO.setRiskLevel(mes.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(mes.getRiskLevelValue()); + factorQueryDTO.setRiskColor(mes.getRiskColor()); + factorQueryDTO.setManageLevel(mes.getManageLevel()); + factorQueryDTO.setEvaluateStatus(mes.getStatus()); + factorQueryDTO.setEvaluateDesc(mes.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(mes.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(scl.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(mes.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(mes.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(mes.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(mes.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(mes.getEmergencyMeasure()); + + factorQueryDTO.setOriginalMesM(mes.getOriginalMesM()); + factorQueryDTO.setOriginalMesE(mes.getOriginalMesE()); + factorQueryDTO.setOriginalMesS(mes.getOriginalMesS()); + factorQueryDTO.setOriginalRiskValue(mes.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(mes.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(mes.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(mes.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(mes.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(mes.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(mes.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(mes.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(mes.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(mes.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO mesMatchHazop (HazopQueryDTO Hazop, MesQueryDTO mes){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(Hazop, FactorQueryDTO.class); + factorQueryDTO.setMesId(mes.getId()); + factorQueryDTO.setMesM(mes.getMesM()); + factorQueryDTO.setMesE(mes.getMesE()); + factorQueryDTO.setMesS(mes.getMesS()); + factorQueryDTO.setRiskValue(mes.getRiskValue()); + factorQueryDTO.setRiskLevel(mes.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(mes.getRiskLevelValue()); + factorQueryDTO.setRiskColor(mes.getRiskColor()); + factorQueryDTO.setManageLevel(mes.getManageLevel()); + factorQueryDTO.setEvaluateStatus(mes.getStatus()); + factorQueryDTO.setEvaluateDesc(mes.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(mes.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(Hazop.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(mes.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(mes.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(mes.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(mes.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(mes.getEmergencyMeasure()); + + factorQueryDTO.setOriginalMesM(mes.getOriginalMesM()); + factorQueryDTO.setOriginalMesE(mes.getOriginalMesE()); + factorQueryDTO.setOriginalMesS(mes.getOriginalMesS()); + factorQueryDTO.setOriginalRiskValue(mes.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(mes.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(mes.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(mes.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(mes.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(mes.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(mes.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(mes.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(mes.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(mes.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO mesMatchAnalogy (AnalogyQueryDTO Analogy, MesQueryDTO mes){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(Analogy, FactorQueryDTO.class); + factorQueryDTO.setMesId(mes.getId()); + factorQueryDTO.setMesM(mes.getMesM()); + factorQueryDTO.setMesE(mes.getMesE()); + factorQueryDTO.setMesS(mes.getMesS()); + factorQueryDTO.setRiskValue(mes.getRiskValue()); + factorQueryDTO.setRiskLevel(mes.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(mes.getRiskLevelValue()); + factorQueryDTO.setRiskColor(mes.getRiskColor()); + factorQueryDTO.setManageLevel(mes.getManageLevel()); + factorQueryDTO.setEvaluateStatus(mes.getStatus()); + factorQueryDTO.setEvaluateDesc(mes.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(mes.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(Analogy.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(mes.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(mes.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(mes.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(mes.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(mes.getEmergencyMeasure()); + + factorQueryDTO.setOriginalMesM(mes.getOriginalMesM()); + factorQueryDTO.setOriginalMesE(mes.getOriginalMesE()); + factorQueryDTO.setOriginalMesS(mes.getOriginalMesS()); + factorQueryDTO.setOriginalRiskValue(mes.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(mes.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(mes.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(mes.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(mes.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(mes.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(mes.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(mes.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(mes.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(mes.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + + /** + * RS 匹配 + * */ + public static FactorQueryDTO rsMatchPha (PhaQueryDTO pha, RsQueryDTO rs){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(pha, FactorQueryDTO.class); + factorQueryDTO.setRsId(rs.getId()); + factorQueryDTO.setRsR(rs.getRsR()); + factorQueryDTO.setRsS(rs.getRsS()); + factorQueryDTO.setRiskValue(rs.getRiskValue()); + factorQueryDTO.setRiskLevel(rs.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(rs.getRiskLevelValue()); + factorQueryDTO.setRiskColor(rs.getRiskColor()); + factorQueryDTO.setManageLevel(rs.getManageLevel()); + factorQueryDTO.setEvaluateStatus(rs.getStatus()); + factorQueryDTO.setEvaluateDesc(rs.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(rs.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(pha.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(rs.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(rs.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(rs.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(rs.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(rs.getEmergencyMeasure()); + + factorQueryDTO.setOriginalRsR(rs.getOriginalRsR()); + factorQueryDTO.setOriginalRsS(rs.getOriginalRsS()); + factorQueryDTO.setOriginalRiskValue(rs.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(rs.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(rs.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(rs.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(rs.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(rs.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(rs.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(rs.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(rs.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(rs.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO rsMatchJha (JhaQueryDTO jha, RsQueryDTO rs){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(jha, FactorQueryDTO.class); + factorQueryDTO.setRsId(rs.getId()); + factorQueryDTO.setRsR(rs.getRsR()); + factorQueryDTO.setRsS(rs.getRsS()); + factorQueryDTO.setRiskValue(rs.getRiskValue()); + factorQueryDTO.setRiskLevel(rs.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(rs.getRiskLevelValue()); + factorQueryDTO.setRiskColor(rs.getRiskColor()); + factorQueryDTO.setManageLevel(rs.getManageLevel()); + factorQueryDTO.setEvaluateStatus(rs.getStatus()); + factorQueryDTO.setEvaluateDesc(rs.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(rs.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(jha.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(rs.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(rs.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(rs.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(rs.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(rs.getEmergencyMeasure()); + + factorQueryDTO.setOriginalRsR(rs.getOriginalRsR()); + factorQueryDTO.setOriginalRsS(rs.getOriginalRsS()); + factorQueryDTO.setOriginalRiskValue(rs.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(rs.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(rs.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(rs.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(rs.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(rs.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(rs.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(rs.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(rs.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(rs.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO rsMatchScl (SclQueryDTO scl, RsQueryDTO rs){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(scl, FactorQueryDTO.class); + factorQueryDTO.setRsId(rs.getId()); + factorQueryDTO.setRsR(rs.getRsR()); + factorQueryDTO.setRsS(rs.getRsS()); + factorQueryDTO.setRiskValue(rs.getRiskValue()); + factorQueryDTO.setRiskLevel(rs.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(rs.getRiskLevelValue()); + factorQueryDTO.setRiskColor(rs.getRiskColor()); + factorQueryDTO.setManageLevel(rs.getManageLevel()); + factorQueryDTO.setEvaluateStatus(rs.getStatus()); + factorQueryDTO.setEvaluateDesc(rs.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(rs.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(scl.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(rs.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(rs.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(rs.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(rs.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(rs.getEmergencyMeasure()); + + factorQueryDTO.setOriginalRsR(rs.getOriginalRsR()); + factorQueryDTO.setOriginalRsS(rs.getOriginalRsS()); + factorQueryDTO.setOriginalRiskValue(rs.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(rs.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(rs.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(rs.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(rs.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(rs.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(rs.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(rs.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(rs.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(rs.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO rsMatchHazop (HazopQueryDTO Hazop, RsQueryDTO rs){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(Hazop, FactorQueryDTO.class); + factorQueryDTO.setRsId(rs.getId()); + factorQueryDTO.setRsR(rs.getRsR()); + factorQueryDTO.setRsS(rs.getRsS()); + factorQueryDTO.setRiskValue(rs.getRiskValue()); + factorQueryDTO.setRiskLevel(rs.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(rs.getRiskLevelValue()); + factorQueryDTO.setRiskColor(rs.getRiskColor()); + factorQueryDTO.setManageLevel(rs.getManageLevel()); + factorQueryDTO.setEvaluateStatus(rs.getStatus()); + factorQueryDTO.setEvaluateDesc(rs.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(rs.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(Hazop.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(rs.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(rs.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(rs.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(rs.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(rs.getEmergencyMeasure()); + + factorQueryDTO.setOriginalRsR(rs.getOriginalRsR()); + factorQueryDTO.setOriginalRsS(rs.getOriginalRsS()); + factorQueryDTO.setOriginalRiskValue(rs.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(rs.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(rs.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(rs.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(rs.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(rs.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(rs.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(rs.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(rs.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(rs.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } + + public static FactorQueryDTO rsMatchAnalogy (AnalogyQueryDTO Analogy, RsQueryDTO rs){ + + FactorQueryDTO factorQueryDTO = BeanCopyUtils.copyBean(Analogy, FactorQueryDTO.class); + factorQueryDTO.setRsId(rs.getId()); + factorQueryDTO.setRsR(rs.getRsR()); + factorQueryDTO.setRsS(rs.getRsS()); + factorQueryDTO.setRiskValue(rs.getRiskValue()); + factorQueryDTO.setRiskLevel(rs.getRiskLevel()); + factorQueryDTO.setRiskLevelValue(rs.getRiskLevelValue()); + factorQueryDTO.setRiskColor(rs.getRiskColor()); + factorQueryDTO.setManageLevel(rs.getManageLevel()); + factorQueryDTO.setEvaluateStatus(rs.getStatus()); + factorQueryDTO.setEvaluateDesc(rs.getEvaluateDesc()); + + factorQueryDTO.setItemEducationTime(rs.getUpdateTime()); + factorQueryDTO.setItemIdentificationTime(Analogy.getUpdateTime()); + + factorQueryDTO.setEducationMeasure(rs.getEducationMeasure()); + factorQueryDTO.setTechnologyMeasure(rs.getTechnologyMeasure()); + factorQueryDTO.setManageMeasure(rs.getManageMeasure()); + factorQueryDTO.setPersonalProtectionMeasure(rs.getPersonalProtectionMeasure()); + factorQueryDTO.setEmergencyMeasure(rs.getEmergencyMeasure()); + + factorQueryDTO.setOriginalRsR(rs.getOriginalRsR()); + factorQueryDTO.setOriginalRsS(rs.getOriginalRsS()); + factorQueryDTO.setOriginalRiskValue(rs.getOriginalRiskValue()); + factorQueryDTO.setOriginalRiskLevelValue(rs.getOriginalRiskLevelValue()); + factorQueryDTO.setOriginalRiskLevel(rs.getOriginalRiskLevel()); + factorQueryDTO.setOriginalRiskColor(rs.getOriginalRiskColor()); + factorQueryDTO.setOriginalManageLevel(rs.getOriginalManageLevel()); + factorQueryDTO.setAdviseTechnologyMeasure(rs.getAdviseTechnologyMeasure()); + factorQueryDTO.setAdviseManageMeasure(rs.getAdviseManageMeasure()); + factorQueryDTO.setAdviseEmergencyMeasure(rs.getAdviseEmergencyMeasure()); + factorQueryDTO.setAdviseEducationMeasure(rs.getAdviseEducationMeasure()); + factorQueryDTO.setAdvisePersonalProtectionMeasure(rs.getAdvisePersonalProtectionMeasure()); + + return factorQueryDTO; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateCheckUtils.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateCheckUtils.java new file mode 100644 index 0000000..f806a0a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/EvaluateCheckUtils.java @@ -0,0 +1,217 @@ +package com.gkhy.labRiskManage.domain.riskReport.utils; + +import com.gkhy.labRiskManage.domain.riskReport.entity.*; +import com.gkhy.labRiskManage.domain.riskReport.model.dto.*; +import com.gkhy.labRiskManage.domain.riskReport.service.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; + +import javax.annotation.PostConstruct; +import java.util.List; + +@Component +public class EvaluateCheckUtils { + + @Autowired + private RiskAssessPlanIdentificationAnalogyService analogyService; + @Autowired + private RiskAssessPlanIdentificationHazopService hazopService; + @Autowired + private RiskAssessPlanIdentificationJhaService jhaService; + @Autowired + private RiskAssessPlanIdentificationPhaService phaService; + @Autowired + private RiskAssessPlanIdentificationSclService sclService; + + @Autowired + private RiskAssessPlanEvaluateLecService lecService; + @Autowired + private RiskAssessPlanEvaluateLsService lsService; + @Autowired + private RiskAssessPlanEvaluateMesService mesService; + @Autowired + private RiskAssessPlanEvaluateRsService rsService; + + + private static EvaluateCheckUtils methodCheck; + + @PostConstruct + private void init(){ + methodCheck = this; + methodCheck.phaService = this.phaService; + methodCheck.jhaService = this.jhaService; + methodCheck.sclService = this.sclService; + methodCheck.hazopService = this.hazopService; + methodCheck.analogyService = this.analogyService; + methodCheck.lecService = this.lecService; + methodCheck.lsService = this.lsService; + methodCheck.mesService = this.mesService; + methodCheck.rsService = this.rsService; + } + + /** + * todo 该方法, 检查每一项辨识,是否有对应的评价 + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法analogy + * */ + + public static int evaluateCheckUtils(RiskAssessPlan assessPlanById){ + + int tag = 0; + //辨识方法 1-PHA; + if (assessPlanById.getIdentificationMethod() == 1){ + List<PhaQueryDTO> phaQueryDTOS = methodCheck.phaService.listPhaByPlanId(assessPlanById.getId()); + for (PhaQueryDTO phaQueryDTO : phaQueryDTOS) { + if (assessPlanById.getEvaluateMethod() == 1){ + RiskAssessPlanEvaluateLec lecByIdentificationId = methodCheck.lecService.getLecByIdentificationId(phaQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lecByIdentificationId)){ + tag = 1; + } + //辨识方法2 - LS + }else if (assessPlanById.getEvaluateMethod() == 2){ + RiskAssessPlanEvaluateLs lsByIdentificationId = methodCheck.lsService.getLsByIdentificationId(phaQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lsByIdentificationId)){ + tag = 1; + } + //辨识方法3 - MES + }else if (assessPlanById.getEvaluateMethod() == 3){ + RiskAssessPlanEvaluateMes mesByIdentificationId = methodCheck.mesService.getMesByIdentificationId(phaQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(mesByIdentificationId)){ + tag = 1; + } + //辨识方法4 - RS + }else if (assessPlanById.getEvaluateMethod() == 4){ + RiskAssessPlanEvaluateRs rsByIdentificationId = methodCheck.rsService.getRsByIdentificationId(phaQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(rsByIdentificationId)){ + tag = 1; + } + } + } + + //辨识方法 2-JHA; + }else if (assessPlanById.getIdentificationMethod() == 2){ + List<JhaQueryDTO> jhaQueryDTOS = methodCheck.jhaService.listJhaByPlanId(assessPlanById.getId()); + for (JhaQueryDTO jhaQueryDTO : jhaQueryDTOS) { + if (assessPlanById.getEvaluateMethod() == 1){ + RiskAssessPlanEvaluateLec lecByIdentificationId = methodCheck.lecService.getLecByIdentificationId(jhaQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lecByIdentificationId)){ + tag = 1; + } + //辨识方法2 - LS + }else if (assessPlanById.getEvaluateMethod() == 2){ + RiskAssessPlanEvaluateLs lsByIdentificationId = methodCheck.lsService.getLsByIdentificationId(jhaQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lsByIdentificationId)){ + tag = 1; + } + //辨识方法3 - MES + }else if (assessPlanById.getEvaluateMethod() == 3){ + RiskAssessPlanEvaluateMes mesByIdentificationId = methodCheck.mesService.getMesByIdentificationId(jhaQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(mesByIdentificationId)){ + tag = 1; + } + //辨识方法4 - RS + }else if (assessPlanById.getEvaluateMethod() == 4){ + RiskAssessPlanEvaluateRs rsByIdentificationId = methodCheck.rsService.getRsByIdentificationId(jhaQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(rsByIdentificationId)){ + tag = 1; + } + } + } + + //辨识方法 3-SCL; + }else if (assessPlanById.getIdentificationMethod() == 3){ + List<SclQueryDTO> sclQueryDTOS = methodCheck.sclService.listSclByPlanId(assessPlanById.getId()); + for (SclQueryDTO sclQueryDTO : sclQueryDTOS) { + if (assessPlanById.getEvaluateMethod() == 1){ + RiskAssessPlanEvaluateLec lecByIdentificationId = methodCheck.lecService.getLecByIdentificationId(sclQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lecByIdentificationId)){ + tag = 1; + } + //辨识方法2 - LS + }else if (assessPlanById.getEvaluateMethod() == 2){ + RiskAssessPlanEvaluateLs lsByIdentificationId = methodCheck.lsService.getLsByIdentificationId(sclQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lsByIdentificationId)){ + tag = 1; + } + //辨识方法3 - MES + }else if (assessPlanById.getEvaluateMethod() == 3){ + RiskAssessPlanEvaluateMes mesByIdentificationId = methodCheck.mesService.getMesByIdentificationId(sclQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(mesByIdentificationId)){ + tag = 1; + } + //辨识方法4 - RS + }else if (assessPlanById.getEvaluateMethod() == 4){ + RiskAssessPlanEvaluateRs rsByIdentificationId = methodCheck.rsService.getRsByIdentificationId(sclQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(rsByIdentificationId)){ + tag = 1; + } + } + } + + //辨识方法 4-HAZOP; + }else if (assessPlanById.getIdentificationMethod() == 4){ + List<HazopQueryDTO> hazopQueryDTOS = methodCheck.hazopService.listHazopByPlanId(assessPlanById.getId()); + for (HazopQueryDTO hazopQueryDTO : hazopQueryDTOS) { + if (assessPlanById.getEvaluateMethod() == 1){ + RiskAssessPlanEvaluateLec lecByIdentificationId = methodCheck.lecService.getLecByIdentificationId(hazopQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lecByIdentificationId)){ + tag = 1; + } + //辨识方法2 - LS + }else if (assessPlanById.getEvaluateMethod() == 2){ + RiskAssessPlanEvaluateLs lsByIdentificationId = methodCheck.lsService.getLsByIdentificationId(hazopQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lsByIdentificationId)){ + tag = 1; + } + //辨识方法3 - MES + }else if (assessPlanById.getEvaluateMethod() == 3){ + RiskAssessPlanEvaluateMes mesByIdentificationId = methodCheck.mesService.getMesByIdentificationId(hazopQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(mesByIdentificationId)){ + tag = 1; + } + //辨识方法4 - RS + }else if (assessPlanById.getEvaluateMethod() == 4){ + RiskAssessPlanEvaluateRs rsByIdentificationId = methodCheck.rsService.getRsByIdentificationId(hazopQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(rsByIdentificationId)){ + tag = 1; + } + } + } + + //5-类比法 nalogy; + }else if (assessPlanById.getIdentificationMethod() == 5){ + List<AnalogyQueryDTO> analogyQueryDTOS = methodCheck.analogyService.listAnalogyByPlanId(assessPlanById.getId()); + for (AnalogyQueryDTO analogyQueryDTO : analogyQueryDTOS) { + if (assessPlanById.getEvaluateMethod() == 1){ + RiskAssessPlanEvaluateLec lecByIdentificationId = methodCheck.lecService.getLecByIdentificationId(analogyQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lecByIdentificationId)){ + tag = 1; + } + //辨识方法2 - LS + }else if (assessPlanById.getEvaluateMethod() == 2){ + RiskAssessPlanEvaluateLs lsByIdentificationId = methodCheck.lsService.getLsByIdentificationId(analogyQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(lsByIdentificationId)){ + tag = 1; + } + //辨识方法3 - MES + }else if (assessPlanById.getEvaluateMethod() == 3){ + RiskAssessPlanEvaluateMes mesByIdentificationId = methodCheck.mesService.getMesByIdentificationId(analogyQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(mesByIdentificationId)){ + tag = 1; + } + //辨识方法4 - RS + }else if (assessPlanById.getEvaluateMethod() == 4){ + RiskAssessPlanEvaluateRs rsByIdentificationId = methodCheck.rsService.getRsByIdentificationId(analogyQueryDTO.getId(), assessPlanById.getIdentificationMethod()); + if (ObjectUtils.isEmpty(rsByIdentificationId)){ + tag = 1; + } + } + } + + } + + return tag; + } + + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/GetRoleTagUtils.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/GetRoleTagUtils.java new file mode 100644 index 0000000..16ebb9c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/GetRoleTagUtils.java @@ -0,0 +1,27 @@ +package com.gkhy.labRiskManage.domain.riskReport.utils; + +import com.gkhy.labRiskManage.commons.enums.UserRoleEnum; +import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO; +import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; +import org.springframework.stereotype.Component; + +@Component +public class GetRoleTagUtils { + + public static int GetRoleTagUtils (UserInfoDomainDTO userInfo){ + + int roleTag = 0; + for (SysUserRoleBindDomainDTO role : userInfo.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){ + roleTag = 1; + } + } + for (SysUserRoleBindDomainDTO role : userInfo.getRoles()) { + if (role.getRoleId() == UserRoleEnum.USER_ROLE_6.getCode().byteValue()){ + roleTag = 2; + } + } + + return roleTag; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/IdentificationMethodCheck.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/IdentificationMethodCheck.java new file mode 100644 index 0000000..36d1187 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/IdentificationMethodCheck.java @@ -0,0 +1,79 @@ +package com.gkhy.labRiskManage.domain.riskReport.utils; + +import com.gkhy.labRiskManage.domain.riskReport.entity.*; +import com.gkhy.labRiskManage.domain.riskReport.service.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; + +import javax.annotation.PostConstruct; + +@Component +public class IdentificationMethodCheck { + + @Autowired + private RiskAssessPlanIdentificationAnalogyService analogyService; + @Autowired + private RiskAssessPlanIdentificationHazopService hazopService; + @Autowired + private RiskAssessPlanIdentificationJhaService jhaService; + @Autowired + private RiskAssessPlanIdentificationPhaService phaService; + @Autowired + private RiskAssessPlanIdentificationSclService sclService; + + + private static IdentificationMethodCheck methodCheck; + + @PostConstruct + private void init(){ + methodCheck = this; + methodCheck.phaService = this.phaService; + methodCheck.jhaService = this.jhaService; + methodCheck.sclService = this.sclService; + methodCheck.hazopService = this.hazopService; + methodCheck.analogyService = this.analogyService; + } + + public static int identificationMethodCheck(Long identificationId, Byte identificationMethod){ + + /** + * 辨识方法:1-PHA;2-JHA;3-SCL;4-HAZOP;5-类比法analogy + * */ + int tag = 1; + switch (identificationMethod){ + case 1 : + RiskAssessPlanIdentificationPha phaByPlanId = methodCheck.phaService.checkPhaByPlanId(identificationId); + if (ObjectUtils.isEmpty(phaByPlanId)){ + tag = 0; + } + break; + case 2: + RiskAssessPlanIdentificationJha jhaByPlanId = methodCheck.jhaService.checkJhaByPlanId(identificationId); + if (ObjectUtils.isEmpty(jhaByPlanId)){ + tag = 0; + } + break; + case 3: + RiskAssessPlanIdentificationScl sclByPlanId = methodCheck.sclService.checkSclByPlanId(identificationId); + if (ObjectUtils.isEmpty(sclByPlanId)){ + tag = 0; + } + break; + case 4: + RiskAssessPlanIdentificationHazop hazopByPlanId = methodCheck.hazopService.checkHazopByPlanId(identificationId); + if (ObjectUtils.isEmpty(hazopByPlanId)){ + tag = 0; + } + break; + case 5: + RiskAssessPlanIdentificationAnalogy analogyByPlanId = methodCheck.analogyService.checkAnalogyByPlanId(identificationId); + if (ObjectUtils.isEmpty(analogyByPlanId)){ + tag = 0; + } + break; + } + + return tag; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/RiskSourceTypeUtils.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/RiskSourceTypeUtils.java new file mode 100644 index 0000000..cf3e858 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/utils/RiskSourceTypeUtils.java @@ -0,0 +1,62 @@ +package com.gkhy.labRiskManage.domain.riskReport.utils; + +import com.gkhy.labRiskManage.commons.enums.StatusEnum; +import com.gkhy.labRiskManage.commons.utils.BeanCopyUtils; +import com.gkhy.labRiskManage.domain.riskReport.entity.ReportExperimentRiskSourceType; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Component +public class RiskSourceTypeUtils { + + public static List<ReportExperimentRiskSourceType> RiskSourceType(Long currentUserId, Long reportId){ + LocalDateTime date = LocalDateTime.now(); + + List<ReportExperimentRiskSourceType> riskSourceTypeList = new ArrayList<>(); + ReportExperimentRiskSourceType riskSourceType = new ReportExperimentRiskSourceType(); + riskSourceType.setReportId(reportId); + riskSourceType.setStatus((byte) 2);//状态:1-存在;2-不存在 + riskSourceType.setUpdateByUserId(currentUserId); + riskSourceType.setUpdateTime(date); + riskSourceType.setCreateByUserId(currentUserId); + riskSourceType.setCreateTime(date); + riskSourceType.setDeleteStatus(StatusEnum.DELETE_NOT.getCode().byteValue()); + + ReportExperimentRiskSourceType riskSourceType1 = BeanCopyUtils.copyBean(riskSourceType, ReportExperimentRiskSourceType.class); + riskSourceType1.setRiskSourceType("化学安全"); + riskSourceTypeList.add(riskSourceType1); + + ReportExperimentRiskSourceType riskSourceType2 = BeanCopyUtils.copyBean(riskSourceType, ReportExperimentRiskSourceType.class); + riskSourceType2.setRiskSourceType("辐射安全"); + riskSourceTypeList.add(riskSourceType2); + + ReportExperimentRiskSourceType riskSourceType3 = BeanCopyUtils.copyBean(riskSourceType, ReportExperimentRiskSourceType.class); + riskSourceType3.setRiskSourceType("生物安全"); + riskSourceTypeList.add(riskSourceType3); + + ReportExperimentRiskSourceType riskSourceType4 = BeanCopyUtils.copyBean(riskSourceType, ReportExperimentRiskSourceType.class); + riskSourceType4.setRiskSourceType("机电安全"); + riskSourceTypeList.add(riskSourceType4); + + ReportExperimentRiskSourceType riskSourceType5 = BeanCopyUtils.copyBean(riskSourceType, ReportExperimentRiskSourceType.class); + riskSourceType5.setRiskSourceType("电气安全"); + riskSourceTypeList.add(riskSourceType5); + + ReportExperimentRiskSourceType riskSourceType6 = BeanCopyUtils.copyBean(riskSourceType, ReportExperimentRiskSourceType.class); + riskSourceType6.setRiskSourceType("激光安全"); + riskSourceTypeList.add(riskSourceType6); + + ReportExperimentRiskSourceType riskSourceType7 = BeanCopyUtils.copyBean(riskSourceType, ReportExperimentRiskSourceType.class); + riskSourceType7.setRiskSourceType("特种设备安全"); + riskSourceTypeList.add(riskSourceType7); + + ReportExperimentRiskSourceType riskSourceType8 = BeanCopyUtils.copyBean(riskSourceType, ReportExperimentRiskSourceType.class); + riskSourceType8.setRiskSourceType("其他安全"); + riskSourceTypeList.add(riskSourceType8); + + return riskSourceTypeList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/converter/MenuItemConverter.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/converter/MenuItemConverter.java new file mode 100644 index 0000000..3201c5d --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/converter/MenuItemConverter.java @@ -0,0 +1,18 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.converter; + +import com.gkhy.labRiskManage.domain.sysAdmin.entity.MenuItem; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +@Service +public class MenuItemConverter { + + public MenuItemDomainDTO toMenuItemDTO(MenuItem menuItem){ + if(menuItem == null) + return null; + MenuItemDomainDTO dto = new MenuItemDomainDTO(); + BeanUtils.copyProperties(menuItem,dto); + return dto; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/entity/MenuItem.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/entity/MenuItem.java new file mode 100644 index 0000000..4f20419 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/entity/MenuItem.java @@ -0,0 +1,261 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.entity; + +import javax.persistence.*; +import java.time.LocalDateTime; + +@Entity +@Table(name = "sys_menu_item") +public class MenuItem { + + //主键 + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + //菜单级别 + @Column + private Integer level; + + //父级菜单 + @Column + private Long parentId; + + //删除标识 + @Column + private Byte del; + + //类型:公共|私有 + @Column + private Byte type; + + //菜单项显示标题 + @Column + private String title; + + @Column + private Byte priority; + + @Column + private String component; + + //菜单项描述信息 + @Column + private String descInfo; + + //菜单项名称 + @Column + private String name; + + //路径 + @Column + private String path; + + //重定向路径 + @Column + private String redirect; + + // + @Column + private boolean visiable; + + @Column + private Boolean aliveable; + + @Column + private Boolean affixable; + + @Column + private Boolean iframeable; + + @Column + private Boolean publicable; + + + // + @Column + private String icon; + + @Column + private String link; + + // + @Column + private LocalDateTime gmtCreate; + + // + @Column + private LocalDateTime gmtModified; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getLevel() { + return level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public Byte getDel() { + return del; + } + + public void setDel(Byte del) { + this.del = del; + } + + public void setType(Byte type) { + this.type = type; + } + + public byte getType() { + return type; + } + + public void setType(byte type) { + this.type = type; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public boolean isVisiable() { + return visiable; + } + + public void setVisiable(boolean visiable) { + this.visiable = visiable; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + 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 Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getAliveable() { + return aliveable; + } + + public void setAliveable(Boolean aliveable) { + this.aliveable = aliveable; + } + + public Boolean getAffixable() { + return affixable; + } + + public void setAffixable(Boolean affixable) { + this.affixable = affixable; + } + + public Boolean getIframeable() { + return iframeable; + } + + public void setIframeable(Boolean iframeable) { + this.iframeable = iframeable; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/entity/SysConfig.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/entity/SysConfig.java new file mode 100644 index 0000000..e13a360 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/entity/SysConfig.java @@ -0,0 +1,50 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.entity; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import org.hibernate.annotations.Proxy; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import java.time.LocalDateTime; + +@Entity(name = "sys_config") +//@JsonIgnoreProperties(value = { "hibernateLazyInitializer"}) +@Proxy(lazy = false) +public class SysConfig { + + //系统配置项 + @Id + private String sysProp; + + //配置项的值 + @Column + private String sysValue; + + @Column + private LocalDateTime gmtModified; + + public String getSysProp() { + return sysProp; + } + + public void setSysProp(String sysProp) { + this.sysProp = sysProp; + } + + public String getSysValue() { + return sysValue; + } + + public void setSysValue(String sysValue) { + this.sysValue = sysValue; + } + + public LocalDateTime getGmtModified() { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) { + this.gmtModified = gmtModified; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/enums/MenuItemTypeEnum.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/enums/MenuItemTypeEnum.java new file mode 100644 index 0000000..60f2134 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/enums/MenuItemTypeEnum.java @@ -0,0 +1,55 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum MenuItemTypeEnum { + + PUBLIC((byte) 1, "公共菜单"), + PRIVATE((byte) 2, "私有菜单") + ; + + byte type; + String desc; + + MenuItemTypeEnum(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 Map<Byte, MenuItemTypeEnum> getMap() { + return map; + } + + public static void setMap(Map<Byte, MenuItemTypeEnum> map) { + MenuItemTypeEnum.map = map; + } + + static Map<Byte, MenuItemTypeEnum> map; + static { + map = new HashMap<>(); + for (MenuItemTypeEnum e : MenuItemTypeEnum.values()) { + map.put(e.getType(), e); + } + } + + public static MenuItemTypeEnum parse(Byte type) { + return map.get(type); + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/bo/CreateNewMenuItemBO.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/bo/CreateNewMenuItemBO.java new file mode 100644 index 0000000..2b095c1 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/bo/CreateNewMenuItemBO.java @@ -0,0 +1,177 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.model.bo; + +import java.util.List; + +public class CreateNewMenuItemBO { + + //父级菜单 + private Long parentId; + + //菜单项显示标题 + private String title; + + //菜单项描述信息 + private String descInfo; + + //菜单项名称 + private String name; + + //路径 + private String path; + + //重定向路径 + private String redirect; + + // + private boolean visiable; + + // + private String icon; + + private String link; + + // + + private Byte priority; + + private String component; + + private Boolean aliveable; + + private Boolean affixable; + + private Boolean iframeable; + + private Boolean publicable; + + private List<Long> roles; + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public boolean isVisiable() { + return visiable; + } + + public void setVisiable(boolean visiable) { + this.visiable = visiable; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getAliveable() { + return aliveable; + } + + public void setAliveable(Boolean aliveable) { + this.aliveable = aliveable; + } + + public Boolean getAffixable() { + return affixable; + } + + public void setAffixable(Boolean affixable) { + this.affixable = affixable; + } + + public Boolean getIframeable() { + return iframeable; + } + + public void setIframeable(Boolean iframeable) { + this.iframeable = iframeable; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } + + public List<Long> getRoles() { + return roles; + } + + public void setRoles(List<Long> roles) { + this.roles = roles; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/bo/ModifyMenuItemBO.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/bo/ModifyMenuItemBO.java new file mode 100644 index 0000000..06317ad --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/bo/ModifyMenuItemBO.java @@ -0,0 +1,196 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.model.bo; + +import java.util.List; + +public class ModifyMenuItemBO { + + private Long menuItemId; + + private Long parentId; + + //菜单项显示标题 + private String title; + + //菜单项描述信息 + private String descInfo; + + //菜单项名称 + private String name; + + //路径 + private String path; + + //重定向路径 + private String redirect; + + // + private Boolean linkable; + + // + private Boolean visiable; + + // + private String icon; + + private String link; + + // + + private Byte priority; + + private String component; + + private Boolean aliveable; + + private Boolean affixable; + + private Boolean iframeable; + + private Boolean publicable; + + private List<Long> roles; + + public Long getMenuItemId() { + return menuItemId; + } + + public void setMenuItemId(Long menuItemId) { + this.menuItemId = menuItemId; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public Boolean getLinkable() { + return linkable; + } + + public void setLinkable(Boolean linkable) { + this.linkable = linkable; + } + + public Boolean getVisiable() { + return visiable; + } + + public void setVisiable(Boolean visiable) { + this.visiable = visiable; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getAliveable() { + return aliveable; + } + + public void setAliveable(Boolean aliveable) { + this.aliveable = aliveable; + } + + public Boolean getAffixable() { + return affixable; + } + + public void setAffixable(Boolean affixable) { + this.affixable = affixable; + } + + public Boolean getIframeable() { + return iframeable; + } + + public void setIframeable(Boolean iframeable) { + this.iframeable = iframeable; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public List<Long> getRoles() { + return roles; + } + + public void setRoles(List<Long> roles) { + this.roles = roles; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/dto/MenuItemDomainDTO.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/dto/MenuItemDomainDTO.java new file mode 100644 index 0000000..81e8e64 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/model/dto/MenuItemDomainDTO.java @@ -0,0 +1,207 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.model.dto; + +import java.util.List; + +public class MenuItemDomainDTO { + + private Long id; + + //菜单级别 + private Integer level; + + //父级菜单 + private Long parentId; + + //菜单项显示标题 + private String title; + + private Byte priority; + + //菜单项描述信息 + private String descInfo; + + + private String component; + + //菜单项名称 + private String name; + + //路径 + private String path; + + //重定向路径 + private String redirect; + + // + private Boolean linkable; + + // + private Boolean visiable; + + private Boolean aliveable; + + private Boolean affixable; + + private Boolean iframeable; + + private Boolean publicable; + + // + private String icon; + + private String link; + + private List<MenuItemDomainDTO> subMenuItemList; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getLevel() { + return level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescInfo() { + return descInfo; + } + + public void setDescInfo(String descInfo) { + this.descInfo = descInfo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getRedirect() { + return redirect; + } + + public void setRedirect(String redirect) { + this.redirect = redirect; + } + + public Boolean getLinkable() { + return linkable; + } + + public void setLinkable(Boolean linkable) { + this.linkable = linkable; + } + + public Boolean getVisiable() { + return visiable; + } + + public void setVisiable(Boolean visiable) { + this.visiable = visiable; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public Byte getPriority() { + return priority; + } + + public void setPriority(Byte priority) { + this.priority = priority; + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component; + } + + public Boolean getAliveable() { + return aliveable; + } + + public void setAliveable(Boolean aliveable) { + this.aliveable = aliveable; + } + + public Boolean getAffixable() { + return affixable; + } + + public void setAffixable(Boolean affixable) { + this.affixable = affixable; + } + + public Boolean getIframeable() { + return iframeable; + } + + public void setIframeable(Boolean iframeable) { + this.iframeable = iframeable; + } + + public Boolean getPublicable() { + return publicable; + } + + public void setPublicable(Boolean publicable) { + this.publicable = publicable; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public List<MenuItemDomainDTO> getSubMenuItemList() { + return subMenuItemList; + } + + public void setSubMenuItemList(List<MenuItemDomainDTO> subMenuItemList) { + this.subMenuItemList = subMenuItemList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/repository/jpa/MenuItemRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/repository/jpa/MenuItemRepository.java new file mode 100644 index 0000000..2d03607 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/repository/jpa/MenuItemRepository.java @@ -0,0 +1,52 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.repository.jpa; + +import com.gkhy.labRiskManage.domain.sysAdmin.entity.MenuItem; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; + +public interface MenuItemRepository extends JpaRepository<MenuItem, Long> { + + @Query(value = "select m from MenuItem m where m.id = :menuItemId and m.visiable = true and m.del = 0") + MenuItem findVisiableById(Long menuItemId); + + @Query(value = "select m from MenuItem m where m.id = :menuId and m.visiable = false and m.del = 0") + MenuItem findDisVisiableById(Long menuId); + + @Modifying + @Query(value = "update MenuItem m set m.del = 1 where m.id = :menuItemId") + Integer logicDeleteMenuItem(Long menuItemId); + + @Modifying + @Query(value = "delete from MenuItem m where m.id = :menuItemId") + Integer deleteByMenuItemId(Long menuItemId); + + @Modifying + @Query(value = "update MenuItem m set m.visiable = true where m.id = :menuItemId and m.visiable = false and m.del = 0") + Integer setMenuItemVisiabel(Long menuItemId); + + @Modifying + @Query(value = "update MenuItem m set m.visiable = false where m.id = :menuItemId and m.visiable = true and m.del = 0") + Integer setMenuItemDisVisiabel(Long menuItemId); + + @Query(value = "select m from MenuItem m where m.del = 0 order by m.priority asc ") + List findAllActive(); + + @Query(value = "select m from MenuItem m where m.del = 0 and m.visiable = true order by m.priority asc ") + List findAllVisiable(); + + @Query(value = "select m from MenuItem m where m.id in :idList and m.del = 0 order by m.priority asc ") + List<MenuItem> findAllActiveByIdIn(List<Long> idList); + + @Query(value = "select m from MenuItem m where m.id in :idList and m.del = 0 and m.visiable = :visiable order by m.priority asc ") + List<MenuItem> findAllByIdInAndVisiable(List<Long> idList,Boolean visiable); + + + @Query(value = "select m from MenuItem m where m.type = 1 and m.del = 0 order by m.priority asc") + List<MenuItem> findAllActivePublicMenuItems(); + + @Query("select count(m) from MenuItem m where m.parentId = :parentId") + Integer countSubMenuItems(Long parentId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/repository/jpa/SysConfigRepository.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/repository/jpa/SysConfigRepository.java new file mode 100644 index 0000000..ca189be --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/repository/jpa/SysConfigRepository.java @@ -0,0 +1,9 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.repository.jpa; + +import com.gkhy.labRiskManage.domain.sysAdmin.entity.SysConfig; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface SysConfigRepository extends JpaRepository<SysConfig,String> { +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/service/MenuDomainService.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/service/MenuDomainService.java new file mode 100644 index 0000000..b33480c --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/service/MenuDomainService.java @@ -0,0 +1,33 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.service; + +import com.gkhy.labRiskManage.domain.sysAdmin.model.bo.CreateNewMenuItemBO; +import com.gkhy.labRiskManage.domain.sysAdmin.model.bo.ModifyMenuItemBO; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; + +import java.util.List; + +public interface MenuDomainService { + + MenuItemDomainDTO createNewMenuItem(CreateNewMenuItemBO createBO); + + boolean setMenuItemEnable(Long menuItemId); + + boolean setMenuItemDisable(Long menuItemId); + + boolean deleteMenuItem(Long menuItemId); + + /** + * 获取全部可用的菜单项 + * @return + */ + List<MenuItemDomainDTO> getAllActiveMenuItems(); + + List<MenuItemDomainDTO> getActiveMenuItemListByIds(List<Long> idList); + + List<MenuItemDomainDTO> getActiveMenuItemListTreeByIds(List<Long> idList); + + MenuItemDomainDTO getMenuItemById(Long menuItemId); + + boolean modifyMenuItem(ModifyMenuItemBO bo); + +} diff --git a/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/service/impl/MenuDomainServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/service/impl/MenuDomainServiceImpl.java new file mode 100644 index 0000000..2ed2ea3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/domain/sysAdmin/service/impl/MenuDomainServiceImpl.java @@ -0,0 +1,374 @@ +package com.gkhy.labRiskManage.domain.sysAdmin.service.impl; + +import com.gkhy.labRiskManage.commons.enums.ResultCode; +import com.gkhy.labRiskManage.commons.exception.BusinessException; +import com.gkhy.labRiskManage.domain.account.entity.Role; +import com.gkhy.labRiskManage.domain.account.entity.RoleMenuBind; +import com.gkhy.labRiskManage.domain.account.model.bo.MenuItemBindRoleBO; +import com.gkhy.labRiskManage.domain.account.repository.jpa.RoleMenuBindRepository; +import com.gkhy.labRiskManage.domain.account.repository.jpa.RoleRepository; +import com.gkhy.labRiskManage.domain.account.service.RoleMenuDomainService; +import com.gkhy.labRiskManage.domain.sysAdmin.converter.MenuItemConverter; +import com.gkhy.labRiskManage.domain.sysAdmin.entity.MenuItem; +import com.gkhy.labRiskManage.domain.sysAdmin.model.bo.CreateNewMenuItemBO; +import com.gkhy.labRiskManage.domain.sysAdmin.model.bo.ModifyMenuItemBO; +import com.gkhy.labRiskManage.domain.sysAdmin.model.dto.MenuItemDomainDTO; +import com.gkhy.labRiskManage.domain.sysAdmin.repository.jpa.MenuItemRepository; +import com.gkhy.labRiskManage.domain.sysAdmin.service.MenuDomainService; +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.*; + +@Service +public class MenuDomainServiceImpl implements MenuDomainService { + + @Autowired + private MenuItemRepository menuItemRepository; + + @Autowired + private MenuItemConverter menuItemConverter; + + @Autowired + private RoleMenuBindRepository roleMenuBindRepository; + + @Autowired + private RoleRepository roleRepository; + + @Override + @Transactional + public MenuItemDomainDTO createNewMenuItem(CreateNewMenuItemBO createBO) { + if(createBO == null) + throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + MenuItem menuItem = new MenuItem(); + //获取父级菜单项信息 + if(createBO.getParentId() != null && createBO.getParentId() > 0){ + Optional<MenuItem> parantItemOptional = menuItemRepository.findById(createBO.getParentId()); + if(!parantItemOptional.isPresent()) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), + "上一级菜单项不存在"); + MenuItem parant = parantItemOptional.get(); + menuItem.setParentId(parant.getId()); + menuItem.setLevel(parant.getLevel()+1); + }else { + menuItem.setLevel(1); + } + menuItem.setName(createBO.getName()); + menuItem.setDescInfo(createBO.getDescInfo()); + menuItem.setPath(createBO.getPath()); + menuItem.setTitle(createBO.getTitle()); + menuItem.setIcon(createBO.getIcon()); + menuItem.setLink(createBO.getLink()); + menuItem.setRedirect(createBO.getRedirect()); + menuItem.setVisiable(createBO.isVisiable()); + menuItem.setDel((byte)0); + menuItem.setGmtCreate(LocalDateTime.now()); + menuItem.setGmtModified(menuItem.getGmtCreate()); + menuItem.setPriority(createBO.getPriority()); + menuItem.setComponent(createBO.getComponent()); + menuItem.setAliveable(createBO.getAliveable()); + menuItem.setAffixable(createBO.getAffixable()); + menuItem.setIframeable(createBO.getIframeable()); + menuItem.setPublicable(createBO.getPublicable()); + menuItem = menuItemRepository.save(menuItem); + if(menuItem == null) + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"数据库错误"); + //绑定角色 + if(createBO.getRoles() != null && !createBO.getRoles().isEmpty()){ + List<Role> roleList = roleRepository.findAllByIdIn(createBO.getRoles()); + if(roleList == null || roleList.isEmpty() || roleList.size() != createBO.getRoles().size()){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), "角色不存在"); + } + //绑定角色菜单 + List<RoleMenuBind> bindList = new ArrayList<>(); + Long menuId = menuItem.getId(); + roleList.forEach(r -> { + RoleMenuBind bind = new RoleMenuBind(); + bind.setRoleId(r.getId()); + bind.setMenuItemId(menuId); + bind.setGmtCreate(LocalDateTime.now()); + bind.setGmtModified(bind.getGmtCreate()); + bindList.add(bind); + }); + List<RoleMenuBind> saveRs = roleMenuBindRepository.saveAll(bindList); + if(saveRs == null || saveRs.isEmpty() || saveRs.size() != bindList.size()){ + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"数据库错误"); + } + + } + return menuItemConverter.toMenuItemDTO(menuItem); + } + + @Override + @Transactional + public boolean setMenuItemEnable(Long menuItemId) { + if(menuItemId == null || menuItemId < 1) + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + MenuItem menuItem = menuItemRepository.findDisVisiableById(menuItemId); + if(menuItem == null) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), + "菜单项不存在"); + if(menuItemRepository.setMenuItemVisiabel(menuItemId) != 1) + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"变更状态出错"); + else + return true; + } + + @Override + @Transactional + public boolean setMenuItemDisable(Long menuItemId) { + if(menuItemId == null || menuItemId < 1) + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + MenuItem menuItem = menuItemRepository.findVisiableById(menuItemId); + if(menuItem == null) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), + "菜单项不存在"); + if(menuItemRepository.setMenuItemDisVisiabel(menuItemId) != 1) + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"变更状态出错"); + else + return true; + } + + @Override + @Transactional + public boolean deleteMenuItem(Long menuItemId) { + if(menuItemId == null || menuItemId < 1) + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + Optional<MenuItem> menuItemOptional = menuItemRepository.findById(menuItemId); + if(!menuItemOptional.isPresent()) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), + "菜单项不存在"); + MenuItem menuItem = menuItemOptional.get(); + //限制:存在子菜单就不允许删除 + Integer subMenuItemCount = menuItemRepository.countSubMenuItems(menuItemId); + if(subMenuItemCount > 0){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode(), "该菜单项存在子菜单,不允许删除"); + } +// //删除角色菜单绑定关系 + roleMenuBindRepository.deleteByMenuItemId(menuItemId); + if(menuItemRepository.deleteByMenuItemId(menuItemId) != 1) + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"变更状态出错"); + return true; + } + + @Override + public List<MenuItemDomainDTO> getAllActiveMenuItems() { + List<MenuItem> allActiveMenuItemList = menuItemRepository.findAllActive(); + if(allActiveMenuItemList == null || allActiveMenuItemList.isEmpty()) + return null; + List<MenuItemDomainDTO> dtoList = new ArrayList<>(); + List<MenuItemDomainDTO> childList = new ArrayList<>(); + allActiveMenuItemList.forEach(item -> { + MenuItemDomainDTO dto = menuItemConverter.toMenuItemDTO(item); + if(item.getLevel().equals(1) && item.getParentId() == null) + dtoList.add(dto); + else + childList.add(dto); + }); + if(dtoList != null && dtoList.size() > 0 && childList != null && childList.size() > 0){ + for(MenuItemDomainDTO dto : dtoList){ + List<MenuItemDomainDTO> subMenuItemList = praseChildMenuItems(dto,childList); + if(subMenuItemList != null && subMenuItemList.size() > 0) + dto.setSubMenuItemList(subMenuItemList); + } + } + return dtoList; + } + + @Override + public List<MenuItemDomainDTO> getActiveMenuItemListByIds(List<Long> idList) { + if(idList == null || idList.size() == 0) + return null; + List<MenuItem> allActiveMenuItemList = menuItemRepository.findAllActiveByIdIn(idList); + if(allActiveMenuItemList == null || allActiveMenuItemList.isEmpty()) + return null; + List<MenuItemDomainDTO> dtoList = new ArrayList<>(); +// allActiveMenuItemList.forEach(item -> { +// MenuItemDomainDTO dto = menuItemConverter.toMenuItemDTO(item); +// dtoList.add(dto); +// }); + for (MenuItem item : allActiveMenuItemList){ + MenuItemDomainDTO dto = menuItemConverter.toMenuItemDTO(item); + dtoList.add(dto); + } + return dtoList; + //old - 解析成树结构 +// List<MenuItemDTO> childList = new ArrayList<>(); +// allActiveMenuItemList.forEach(item -> { +// MenuItemDTO dto = menuItemConverter.toMenuItemDTO(item); +// if(item.getLevel().equals(1) && item.getParantId() == null) +// dtoList.add(dto); +// else +// childList.add(dto); +// }); +// if(dtoList != null && dtoList.size() > 0 && childList != null && childList.size() > 0){ +// for(MenuItemDTO dto : dtoList){ +// List<MenuItemDTO> subMenuItemList = praseChildMenuItems(dto,childList); +// if(subMenuItemList != null && subMenuItemList.size() > 0) +// dto.setSubMenuItemList(subMenuItemList); +// } +// } +// return dtoList; + } + @Override + public MenuItemDomainDTO getMenuItemById(Long menuItemId) { + if(menuItemId == null || menuItemId < 1) + return null; + Optional<MenuItem> menuItemOptional = menuItemRepository.findById(menuItemId); + if(!menuItemOptional.isPresent()) + return null; + MenuItem menuItem = menuItemOptional.get(); + if(menuItem.getDel().equals(1)) + return null; + return menuItemConverter.toMenuItemDTO(menuItem); + } + + @Override + @Transactional + public boolean modifyMenuItem(ModifyMenuItemBO bo) { + if(bo == null) + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + if(bo.getMenuItemId() == null || bo.getMenuItemId() < 1) + throw new BusinessException(this.getClass(),ResultCode.PARAM_ERROR_NULL.getCode(),"参数不能为空"); + Optional<MenuItem> menuItemOptional = menuItemRepository.findById(bo.getMenuItemId()); + if(!menuItemOptional.isPresent()) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(),"菜单项不存在"); + MenuItem menuItem = menuItemOptional.get(); + menuItem.setParentId(bo.getParentId()); + menuItem.setTitle(bo.getTitle()); + menuItem.setName(bo.getName()); + menuItem.setIcon(bo.getIcon()); + menuItem.setPath(bo.getPath()); + menuItem.setRedirect(bo.getRedirect()); + menuItem.setDescInfo(bo.getDescInfo()); + menuItem.setLink(bo.getLink()); + menuItem.setVisiable(bo.getVisiable()); + // + menuItem.setPriority(bo.getPriority()); + menuItem.setComponent(bo.getComponent()); + menuItem.setAliveable(bo.getAliveable()); + menuItem.setAffixable(bo.getAffixable()); + menuItem.setIframeable(bo.getIframeable()); + menuItem.setPublicable(bo.getPublicable()); + if(bo.getParentId() != null){ + Optional<MenuItem> parantOptional = menuItemRepository.findById(bo.getParentId()); + if(!parantOptional.isPresent()) + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(),"上一级菜单项不存在"); + MenuItem parantItem = parantOptional.get(); + //重置父级菜单项ID + menuItem.setParentId(bo.getParentId()); + //重置菜单项等级 + menuItem.setLevel(parantItem.getLevel()+1); + } + if(menuItemRepository.save(menuItem) == null){ + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"修改菜单项出错"); + } + //修改菜单项绑定角色信息 + List<Long> bindRoles = new ArrayList<>(); + List<Long> unbindRoles = new ArrayList<>(); + List<Long> orignRoles = roleMenuBindRepository.findBindRoleListByMenuItemId(menuItem.getId()); + Set<Long> orignRoleIds = new HashSet<>(); + orignRoles.forEach(id -> { + orignRoleIds.add(id); + }); + if(bo.getRoles() != null && !bo.getRoles().isEmpty()){ + for(int i =0;i<bo.getRoles().size();i++){ + if(!orignRoleIds.contains(bo.getRoles().get(i))){ + bindRoles.add(bo.getRoles().get(i)); + } + } + } + Set<Long> nowRoles = new HashSet<>(); + if(bo.getRoles() != null && !bo.getRoles().isEmpty()){ + bo.getRoles().forEach(id -> { + nowRoles.add(id); + }); + } + for(int i =0;i<orignRoles.size();i++){ + if(!nowRoles.contains(orignRoles.get(i))){ + unbindRoles.add(orignRoles.get(i)); + } + } + if(!bindRoles.isEmpty()){ + //绑定角色 + //检查角色是否存在 + List<Role> bindRoleList = roleRepository.findAllByIdIn(bindRoles); + if(bindRoleList == null || bindRoleList.size() != bindRoleList.size()){ + throw new BusinessException(this.getClass(),ResultCode.BUSINESS_ERROR_OBJECT_NOT_EXIST.getCode(), "角色不存在"); + } + List<RoleMenuBind> roleMenuBindList = new ArrayList<>(); + bindRoles.forEach(roleId -> { + RoleMenuBind b = new RoleMenuBind(); + b.setMenuItemId(bo.getMenuItemId()); + b.setRoleId(roleId); + b.setGmtCreate(LocalDateTime.now()); + b.setGmtModified(b.getGmtCreate()); + roleMenuBindList.add(b); + }); + List<RoleMenuBind> saveRs = roleMenuBindRepository.saveAll(roleMenuBindList); + if(saveRs == null || saveRs.isEmpty() || saveRs.size() != roleMenuBindList.size()){ + throw new BusinessException(this.getClass(),ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"数据库错误"); + } + } + if(!unbindRoles.isEmpty()){ + //解绑角色 + Integer unbindCount = roleMenuBindRepository.deleteByMenuItemIdAndRoleIdIn(bo.getMenuItemId(),unbindRoles); + } + return true; + } + + @Override + public List<MenuItemDomainDTO> getActiveMenuItemListTreeByIds(List<Long> idList) { + List<MenuItemDomainDTO> orignList = getActiveMenuItemListByIds(idList); + if(orignList == null || orignList.isEmpty()) + return null; + List<MenuItemDomainDTO> parantList = new ArrayList<>(); + List<MenuItemDomainDTO> childList = new ArrayList<>(); + orignList.forEach(item -> { + if(item.getLevel().equals(1) && item.getParentId() == null) + parantList.add(item); + else + childList.add(item); + }); + if(parantList != null && parantList.size() > 0 && childList != null && childList.size() > 0){ + for(MenuItemDomainDTO dto : parantList){ + List<MenuItemDomainDTO> subMenuItemList = praseChildMenuItems(dto,childList); + if(subMenuItemList != null && subMenuItemList.size() > 0) + dto.setSubMenuItemList(subMenuItemList); + } + } + return parantList; + } + + /** + * 递归解析菜单数据,获取菜单树状结构 + * @param parantItem + * @param childItemList + * @return + */ + private List<MenuItemDomainDTO> praseChildMenuItems(MenuItemDomainDTO parantItem, List<MenuItemDomainDTO> childItemList){ + if(childItemList == null || childItemList.size() == 0 || parantItem == null) + return null; + List<MenuItemDomainDTO> resultList = new ArrayList<>(); +// childItemList.forEach(child -> { +// if(parantItem.getId().equals(child.getParentId())){ +// resultList.add(child); +// } +// }); + for(MenuItemDomainDTO child : childItemList){ + if(parantItem.getId().equals(child.getParentId())){ + resultList.add(child); + } + } + if(resultList.size() > 0){ + for (MenuItemDomainDTO child : childItemList){ + List<MenuItemDomainDTO> childList = praseChildMenuItems(child,childItemList); + if(childList != null && childList.size() > 0) + child.setSubMenuItemList(childList); + } + } + return resultList; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/infra/cache/domain/CacheUserInfo.java b/src/main/java/com/gkhy/labRiskManage/infra/cache/domain/CacheUserInfo.java new file mode 100644 index 0000000..2366c05 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/infra/cache/domain/CacheUserInfo.java @@ -0,0 +1,83 @@ +package com.gkhy.labRiskManage.infra.cache.domain; + +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Collection; + +public class CacheUserInfo implements UserDetails { + private Long userId; + + private String loginName; + + private String realName; + + private Long roleId; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + @Override + public Collection<? extends GrantedAuthority> getAuthorities() { + return null; + } + + @Override + public String getPassword() { + return null; + } + + @Override + public String getUsername() { + return null; + } + + @Override + public boolean isAccountNonExpired() { + return false; + } + + @Override + public boolean isAccountNonLocked() { + return false; + } + + @Override + public boolean isCredentialsNonExpired() { + return false; + } + + @Override + public boolean isEnabled() { + return false; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/infra/cache/service/UserCacheInfraService.java b/src/main/java/com/gkhy/labRiskManage/infra/cache/service/UserCacheInfraService.java new file mode 100644 index 0000000..ed644f3 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/infra/cache/service/UserCacheInfraService.java @@ -0,0 +1,12 @@ +package com.gkhy.labRiskManage.infra.cache.service; + +import com.gkhy.labRiskManage.infra.cache.domain.CacheUserInfo; + +public interface UserCacheInfraService { + + CacheUserInfo getCacheUser(String userId); + + boolean putCacheUser(CacheUserInfo cacheUserInfo,String userId); + + boolean removeCacheUser(String userId); +} diff --git a/src/main/java/com/gkhy/labRiskManage/infra/cache/service/impl/UserCacheInfraServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/infra/cache/service/impl/UserCacheInfraServiceImpl.java new file mode 100644 index 0000000..7f1057a --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/infra/cache/service/impl/UserCacheInfraServiceImpl.java @@ -0,0 +1,62 @@ +package com.gkhy.labRiskManage.infra.cache.service.impl; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.gkhy.labRiskManage.commons.enums.SystemCacheKeyEnum; +import com.gkhy.labRiskManage.infra.cache.domain.CacheUserInfo; +import com.gkhy.labRiskManage.infra.cache.service.UserCacheInfraService; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.concurrent.TimeUnit; + +@Service +public class UserCacheInfraServiceImpl implements UserCacheInfraService { + + @Autowired + private RedissonClient redissonClient; + + @Autowired + private ObjectMapper objectMapper; + + @Override + public CacheUserInfo getCacheUser(String userId) { + if(userId == null || userId.isEmpty()) + return null; + Object cacheUserObj = redissonClient.getMapCache(SystemCacheKeyEnum.KEY_CACHE_USER.getKey()).get(""+userId); + if(cacheUserObj != null){ + String json = (String)cacheUserObj; + try { + CacheUserInfo cacheUserInfo = objectMapper.readValue(json,CacheUserInfo.class); + return cacheUserInfo; + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + } + return null; + } + + @Override + public boolean putCacheUser(CacheUserInfo cacheUserInfo, String userId) { + if(cacheUserInfo == null || userId == null || userId.isEmpty()) + return false; + try { + String json = objectMapper.writeValueAsString(cacheUserInfo); + if(redissonClient.getMapCache(SystemCacheKeyEnum.KEY_CACHE_USER.getKey()).put(userId,json,120, + TimeUnit.MINUTES) != null) + return true; + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return false; + } + + @Override + public boolean removeCacheUser(String userId) { + if(redissonClient.getMapCache(SystemCacheKeyEnum.KEY_CACHE_USER.getKey()).remove(userId) != null) + return true; + else + return false; + } +} diff --git a/src/main/java/com/gkhy/labRiskManage/interface/sysManage/LicenseManage.java b/src/main/java/com/gkhy/labRiskManage/interface/sysManage/LicenseManage.java new file mode 100644 index 0000000..50aab68 --- /dev/null +++ b/src/main/java/com/gkhy/labRiskManage/interface/sysManage/LicenseManage.java @@ -0,0 +1,64 @@ +package com.gkhy.labRiskManage.application.sysManage; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.gkhy.labRiskManage.application.account.dto.respDto.UserInfoAppRespDTO; +import com.gkhy.labRiskManage.application.account.service.AccountAppService; +import com.gkhy.labRiskManage.commons.domain.Result; +import com.gkhy.labRiskManage.commons.enums.SystemConfigKeyEnum; +import com.gkhy.labRiskManage.domain.sysAdmin.entity.SysConfig; +import com.gkhy.labRiskManage.domain.account.repository.jpa.UserRepository; +import com.gkhy.labRiskManage.domain.sysAdmin.repository.jpa.SysConfigRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDateTime; +import java.util.Optional; + +@RestController +@RequestMapping("/sys/lic") +public class LicenseManage { + + @Autowired + private SysConfigRepository sysConfigRepository; + + @Autowired + private UserRepository userRepository; + + @Autowired + private AccountAppService accountAppService; + + @Autowired + private ObjectMapper objectMapper; + + @GetMapping("/get") + public Object getLicenseTxt() throws JsonProcessingException { +// Optional<User> userOptional = userRepository.findById(1L); +// User user = userOptional.get(); + Result<UserInfoAppRespDTO> r = accountAppService.findUserByUserId(1L); + if(r!= null && r.isSuccess() && r.getData() != null){ + UserInfoAppRespDTO userInfoAppRespDTO = (UserInfoAppRespDTO) r.getData(); + } + return r; + } + + @GetMapping("/up") + public Object updateLicense(){ + Optional<SysConfig> sysConfigOptional = sysConfigRepository.findById(SystemConfigKeyEnum.LICENSE_TXT.getKey()); + if(sysConfigOptional.isPresent()){ + SysConfig sysConfig = sysConfigOptional.get(); + sysConfig.setSysValue("SSS"); + sysConfigRepository.saveAndFlush(sysConfig); + return "OK"; + }else { + SysConfig sysConfig = new SysConfig(); + sysConfig.setSysProp(SystemConfigKeyEnum.LICENSE_TXT.getKey()); + sysConfig.setSysValue("BBB"); + sysConfig.setGmtModified(LocalDateTime.now()); + sysConfigRepository.saveAndFlush(sysConfig); + return "NEW OK"; + } + } +} diff --git a/src/main/resources/config/application-dev.yaml b/src/main/resources/config/application-dev.yaml new file mode 100644 index 0000000..f191de5 --- /dev/null +++ b/src/main/resources/config/application-dev.yaml @@ -0,0 +1,85 @@ +server: + port: 8084 + +spring: + # enable-logging: false + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://192.168.0.52:3306/laboratory_risk_manage.dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true + username: gkhy_dev_team + password: Sjscn783fsDsa21 + master: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://192.168.0.52:3306/laboratory_risk_manage.dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true + username: gkhy_dev_team + password: Sjscn783fsDsa21 + type: com.alibaba.druid.pool.DruidDataSource + jpa: + hibernate: + ddl-auto: none +# ddl-auto: update #自动更新 + show-sql: true #日志中显示sql语句 + + redis: +# host: 192.168.0.52 +# port: 6371 +# password: SEF98uvs98dUAUEF90Udssa # Redis 服务器密码,默认为空。生产中,一定要设置 Redis 密码! +# database: 0 # Redis 数据库号,默认为 0 +# timeout: 5000 # Redis 连接超时时间,单位:毫秒。 + redisson: + file: classpath:config/redisson-dev.yml + lettuce: + pool: + # 最大连接数 + max-active: 8 + min-active: 3 + # 最大阻塞等待时间(负数表示没限制) + max-wait: -1 + # 最小空闲 + min-idle: 3 + # 最大空闲 + max-idle: 8 + jackson: + default-property-inclusion: non_null + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + servlet: + multipart: + enabled: true + max-file-size: 20MB + max-request-size: 200MB + + +system: + deployMode: standalone #单机部署 +# deployMode: cluster #集群部署 + enableCors: true #跨域设置 + token: #token 配置项 + header: tk + expiration: 7200 + refreshExpiration: 14400 + loginUserHeader: uid +#windous测试 +file: + path: + #基础路径 + dcPath: E:\file\gkhy\test\ + urlRootPath: /uploadtest/ + module: + #用户模块 + accountPath: /account/user/ + +#linux测试 +#file: +# path: +# #基础路径 +# dcPath: /home/gkhy/upload/laboratoryRiskManage/ +# urlRootPath: /upload/ +# module: +# #用户模块 +# accountPath: /account/user/ + + + + diff --git a/src/main/resources/config/application-online-uat.yaml b/src/main/resources/config/application-online-uat.yaml new file mode 100644 index 0000000..7b36a47 --- /dev/null +++ b/src/main/resources/config/application-online-uat.yaml @@ -0,0 +1,68 @@ +server: + port: 16070 + +spring: + # enable-logging: false + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://192.168.30.107:43306/laboratory_risk_manage.uat?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true + username: gkhy_labrisk + password: Sh8jIOUJj988NK + master: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://192.168.30.107:43306/laboratory_risk_manage.uat?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true + username: gkhy_labrisk + password: Sh8jIOUJj988NK + type: com.alibaba.druid.pool.DruidDataSource + jpa: + hibernate: + ddl-auto: none +# ddl-auto: update #自动更新 + show-sql: true #日志中显示sql语句 + + redis: +# host: 192.168.0.52 +# port: 6371 +# password: SEF98uvs98dUAUEF90Udssa # Redis 服务器密码,默认为空。生产中,一定要设置 Redis 密码! +# database: 0 # Redis 数据库号,默认为 0 +# timeout: 5000 # Redis 连接超时时间,单位:毫秒。 + redisson: + file: classpath:config/redisson-online-uat.yml + lettuce: + pool: + # 最大连接数 + max-active: 8 + min-active: 3 + # 最大阻塞等待时间(负数表示没限制) + max-wait: -1 + # 最小空闲 + min-idle: 3 + # 最大空闲 + max-idle: 8 + jackson: + default-property-inclusion: non_null + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + + +system: + deployMode: standalone #单机部署 +# deployMode: cluster #集群部署 + enableCors: true #跨域设置 + token: #token 配置项 + header: tk + expiration: 7200 + refreshExpiration: 14400 + loginUserHeader: uid + +file: + path: + #基础路径 + dcPath: /home/upload/laboratoryRiskManage/ + urlRootPath: /upload/ + module: + #用户模块 + accountPath: /account/user/ + + diff --git a/src/main/resources/config/application.yaml b/src/main/resources/config/application.yaml new file mode 100644 index 0000000..0269a66 --- /dev/null +++ b/src/main/resources/config/application.yaml @@ -0,0 +1,6 @@ +spring: + application: + name: labRiskManage + profiles: + active: dev +# active: online-uat diff --git a/src/main/resources/config/redisson-dev.yml b/src/main/resources/config/redisson-dev.yml new file mode 100644 index 0000000..c99a90a --- /dev/null +++ b/src/main/resources/config/redisson-dev.yml @@ -0,0 +1,42 @@ +singleServerConfig: + # 连接空闲超时,单位:毫秒 + idleConnectionTimeout: 100000 + # 连接超时,单位:毫秒 + connectTimeout: 10000 + # 命令等待超时,单位:毫秒 + timeout: 3000 + # 命令失败重试次数 + retryAttempts: 3 + # 命令重试发送时间间隔,单位:毫秒 + retryInterval: 1500 + # 密码 + password: SEF98uvs98dUAUEF90Udssa + # 单个连接最大订阅数量 + subscriptionsPerConnection: 5 + # 客户端名称 +# clientName: null + # 节点地址 + address: redis://192.168.0.52:6371 +# # 发布和订阅连接的最小空闲连接数 +# subscriptionConnectionMinimumIdleSize: 1 +# # 发布和订阅连接池大小 +# subscriptionConnectionPoolSize: 50 + # 最小空闲连接数 + connectionMinimumIdleSize: 4 + # 连接池大小 + connectionPoolSize: 8 + # redis数据库编号 + database: 0 + # DNS监测时间间隔,单位:毫秒 + dnsMonitoringInterval: 5000 +# 线程池数量 +threads: 8 +# Netty线程池数量 +nettyThreads: 4 +# 编码 +codec: + class: "org.redisson.codec.JsonJacksonCodec" +# 传输模式 +transportMode: "NIO" +# 配置看门狗的默认超时时间为30s,这里改为10s +lockWatchdogTimeout: 10000 \ No newline at end of file diff --git a/src/main/resources/config/redisson-online-uat.yml b/src/main/resources/config/redisson-online-uat.yml new file mode 100644 index 0000000..498fd4e --- /dev/null +++ b/src/main/resources/config/redisson-online-uat.yml @@ -0,0 +1,42 @@ +singleServerConfig: + # 连接空闲超时,单位:毫秒 + idleConnectionTimeout: 100000 + # 连接超时,单位:毫秒 + connectTimeout: 10000 + # 命令等待超时,单位:毫秒 + timeout: 3000 + # 命令失败重试次数 + retryAttempts: 3 + # 命令重试发送时间间隔,单位:毫秒 + retryInterval: 1500 + # 密码 + password: KJGI9898UJjkkj098uj0gW + # 单个连接最大订阅数量 + subscriptionsPerConnection: 5 + # 客户端名称 +# clientName: null + # 节点地址 + address: redis://192.168.30.107:6377 +# # 发布和订阅连接的最小空闲连接数 +# subscriptionConnectionMinimumIdleSize: 1 +# # 发布和订阅连接池大小 +# subscriptionConnectionPoolSize: 50 + # 最小空闲连接数 + connectionMinimumIdleSize: 4 + # 连接池大小 + connectionPoolSize: 8 + # redis数据库编号 + database: 0 + # DNS监测时间间隔,单位:毫秒 + dnsMonitoringInterval: 5000 +# 线程池数量 +threads: 8 +# Netty线程池数量 +nettyThreads: 4 +# 编码 +codec: + class: "org.redisson.codec.JsonJacksonCodec" +# 传输模式 +transportMode: "NIO" +# 配置看门狗的默认超时时间为30s,这里改为10s +lockWatchdogTimeout: 10000 \ No newline at end of file -- Gitblit v1.9.2