From 1c272c440ef4fa3f4a919e79271c9f8db880f24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Tue, 29 Aug 2023 14:45:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BAdam-safety=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hzims-service-api/common-api/pom.xml | 6 +- .../com/hnac/hzims/cache/CaffeineCacheUtil.java | 94 +++ .../main/java/com/hnac/hzims/entity/Report.java | 273 +++++++++ .../java/com/hnac/hzims/entity/ReportData.java | 107 ++++ .../java/com/hnac/hzims/entity/ReportUnit.java | 34 ++ .../java/com/hnac/hzims/entity/StandardData.java | 174 ++++++ .../java/com/hnac/hzims/entity/YearReport.java | 178 ++++++ .../com/hnac/hzims/enums/QueryDateTypeEnum.java | 35 ++ .../main/java/com/hnac/hzims/util/CommonUtil.java | 148 +++++ .../java/com/hnac/hzims/util/ReportDateUtil.java | 116 ++++ hzims-service-api/dam-safety-api/pom.xml | 20 + .../com/hnac/hzims/damsafety/entity/TBuilding.java | 37 ++ .../com/hnac/hzims/damsafety/entity/TProjInfo.java | 38 ++ .../hzims/damsafety/entity/TSectionConfig.java | 34 ++ .../com/hnac/hzims/damsafety/entity/WrpDamsB.java | 31 + .../hzims/damsafety/entity/WrpDfrSrhrdsmp.java | 56 ++ .../hzims/damsafety/entity/WrpDfrSrvrdsbp.java | 55 ++ .../hzims/damsafety/entity/WrpDfrSrvrdsmp.java | 53 ++ .../hnac/hzims/damsafety/entity/WrpSectionB.java | 38 ++ .../hnac/hzims/damsafety/entity/WrpSpgPztb.java | 57 ++ .../hnac/hzims/damsafety/entity/WrpSpgSpprmp.java | 52 ++ .../hnac/hzims/damsafety/entity/WrpSpgSpqnmp.java | 45 ++ .../hzims/damsafety/feign/IWrpSectionBClient.java | 26 + .../com/hnac/hzims/damsafety/vo/TBuildingVo.java | 8 + .../com/hnac/hzims/damsafety/vo/TProjInfoVo.java | 8 + .../hnac/hzims/damsafety/vo/WrpDfrSrhrdsmpVo.java | 7 + .../hnac/hzims/damsafety/vo/WrpDfrSrvrdsbpVo.java | 7 + .../hnac/hzims/damsafety/vo/WrpDfrSrvrdsmpVo.java | 7 + .../com/hnac/hzims/damsafety/vo/WrpSectionBVO.java | 16 + .../com/hnac/hzims/damsafety/vo/WrpSpgPztbVo.java | 7 + .../hnac/hzims/damsafety/vo/WrpSpgSpprmpVo.java | 7 + .../hnac/hzims/damsafety/vo/WrpSpgSpqnmpVo.java | 7 + hzims-service-api/pom.xml | 1 + hzims-service/dam-safety/pom.xml | 67 +++ .../hnac/hzims/damsafety/DamSafetyApplication.java | 40 ++ .../controller/DamSafetyDataController.java | 211 +++++++ .../damsafety/controller/FileUploadController.java | 57 ++ .../damsafety/controller/TBuildingController.java | 124 ++++ .../damsafety/controller/TProjInfoController.java | 131 +++++ .../controller/TSectionConfigController.java | 114 ++++ .../damsafety/controller/WrpDamsBController.java | 123 ++++ .../controller/WrpDfrSrhrdsmpController.java | 135 +++++ .../controller/WrpDfrSrvrdsbpController.java | 117 ++++ .../controller/WrpDfrSrvrdsmpController.java | 135 +++++ .../controller/WrpSectionBController.java | 149 +++++ .../damsafety/controller/WrpSpgPztbController.java | 133 +++++ .../controller/WrpSpgSpprmpController.java | 139 +++++ .../controller/WrpSpgSpqnmpController.java | 133 +++++ .../hzims/damsafety/feign/WrpSectionBClient.java | 28 + .../hzims/damsafety/mapper/TbBuildingMapper.java | 7 + .../hzims/damsafety/mapper/TbBuildingMapper.xml | 5 + .../hzims/damsafety/mapper/TbProjInfoMapper.java | 7 + .../hzims/damsafety/mapper/TbProjInfoMapper.xml | 5 + .../damsafety/mapper/TbSectionConfigMapper.java | 7 + .../damsafety/mapper/TbSectionConfigMapper.xml | 5 + .../hzims/damsafety/mapper/WrpDamsBMapper.java | 7 + .../hnac/hzims/damsafety/mapper/WrpDamsBMapper.xml | 5 + .../damsafety/mapper/WrpDfrSrhrdsmpMapper.java | 12 + .../damsafety/mapper/WrpDfrSrhrdsmpMapper.xml | 23 + .../damsafety/mapper/WrpDfrSrvrdsbpMapper.java | 7 + .../damsafety/mapper/WrpDfrSrvrdsbpMapper.xml | 5 + .../damsafety/mapper/WrpDfrSrvrdsmpMapper.java | 13 + .../damsafety/mapper/WrpDfrSrvrdsmpMapper.xml | 23 + .../hzims/damsafety/mapper/WrpSectionBMapper.java | 27 + .../hzims/damsafety/mapper/WrpSectionBMapper.xml | 42 ++ .../hzims/damsafety/mapper/WrpSpgPztbMapper.java | 12 + .../hzims/damsafety/mapper/WrpSpgPztbMapper.xml | 23 + .../hzims/damsafety/mapper/WrpSpgSpprmpMapper.java | 12 + .../hzims/damsafety/mapper/WrpSpgSpprmpMapper.xml | 23 + .../hzims/damsafety/mapper/WrpSpgSpqnmpMapper.java | 13 + .../hzims/damsafety/mapper/WrpSpgSpqnmpMapper.xml | 23 + .../damsafety/service/IDamSafetyDataService.java | 25 + .../damsafety/service/IFileUploadService.java | 10 + .../hzims/damsafety/service/ITBuildingService.java | 8 + .../hzims/damsafety/service/ITProjInfoService.java | 7 + .../damsafety/service/ITSectionConfigService.java | 23 + .../hzims/damsafety/service/IWrpDamsBService.java | 23 + .../damsafety/service/IWrpDfrSrhrdsmpService.java | 12 + .../damsafety/service/IWrpDfrSrvrdsbpService.java | 8 + .../damsafety/service/IWrpDfrSrvrdsmpService.java | 12 + .../damsafety/service/IWrpSectionBService.java | 28 + .../damsafety/service/IWrpSpgPztbService.java | 12 + .../damsafety/service/IWrpSpgSpprmpService.java | 12 + .../damsafety/service/IWrpSpgSpqnmpService.java | 13 + .../service/impl/DamSafetyDataServiceImpl.java | 647 +++++++++++++++++++++ .../service/impl/FileUploadServiceImpl.java | 63 ++ .../service/impl/TBuildingServiceImpl.java | 11 + .../service/impl/TProjInfoServiceImpl.java | 11 + .../service/impl/TSectionConfigServiceImpl.java | 53 ++ .../service/impl/WrpDamsBServiceImpl.java | 57 ++ .../service/impl/WrpDfrSrhrdsmpServiceImpl.java | 30 + .../service/impl/WrpDfrSrvrdsbpServiceImpl.java | 11 + .../service/impl/WrpDfrSrvrdsmpServiceImpl.java | 28 + .../service/impl/WrpSectionBServiceImpl.java | 31 + .../service/impl/WrpSpgPztbServiceImpl.java | 30 + .../service/impl/WrpSpgSpprmpServiceImpl.java | 32 + .../service/impl/WrpSpgSpqnmpServiceImpl.java | 30 + .../hnac/hzims/damsafety/util/DealSectionUtil.java | 48 ++ .../com/hnac/hzims/damsafety/util/ParamUtil.java | 177 ++++++ .../hzims/damsafety/wrapper/TBuildingWrapper.java | 24 + .../hzims/damsafety/wrapper/TProjInfoWrapper.java | 26 + .../damsafety/wrapper/WrpDfrSrhrdsmpWrapper.java | 27 + .../damsafety/wrapper/WrpDfrSrvrdsbpWrapper.java | 27 + .../damsafety/wrapper/WrpDfrSrvrdsmpWrapper.java | 27 + .../damsafety/wrapper/WrpSectionBWrapper.java | 28 + .../hzims/damsafety/wrapper/WrpSpgPztbWrapper.java | 27 + .../damsafety/wrapper/WrpSpgSpprmpWrapper.java | 27 + .../damsafety/wrapper/WrpSpgSpqnmpWrapper.java | 27 + .../src/main/resources/application-dev.yml | 30 + .../src/main/resources/application-prod.yml | 28 + .../dam-safety/src/main/resources/application.yml | 13 + hzims-service/pom.xml | 1 + 112 files changed, 5687 insertions(+), 1 deletion(-) create mode 100644 hzims-service-api/common-api/src/main/java/com/hnac/hzims/cache/CaffeineCacheUtil.java create mode 100644 hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/Report.java create mode 100644 hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportData.java create mode 100644 hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportUnit.java create mode 100644 hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/StandardData.java create mode 100644 hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/YearReport.java create mode 100644 hzims-service-api/common-api/src/main/java/com/hnac/hzims/enums/QueryDateTypeEnum.java create mode 100644 hzims-service-api/common-api/src/main/java/com/hnac/hzims/util/CommonUtil.java create mode 100644 hzims-service-api/common-api/src/main/java/com/hnac/hzims/util/ReportDateUtil.java create mode 100644 hzims-service-api/dam-safety-api/pom.xml create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TBuilding.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TProjInfo.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TSectionConfig.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDamsB.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrhrdsmp.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrvrdsbp.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrvrdsmp.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSectionB.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgPztb.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgSpprmp.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgSpqnmp.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/feign/IWrpSectionBClient.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/TBuildingVo.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/TProjInfoVo.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrhrdsmpVo.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrvrdsbpVo.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrvrdsmpVo.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSectionBVO.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgPztbVo.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgSpprmpVo.java create mode 100644 hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgSpqnmpVo.java create mode 100644 hzims-service/dam-safety/pom.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/DamSafetyApplication.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/DamSafetyDataController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/FileUploadController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TBuildingController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TProjInfoController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TSectionConfigController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDamsBController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrhrdsmpController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrvrdsbpController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrvrdsmpController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSectionBController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgPztbController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgSpprmpController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgSpqnmpController.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/feign/WrpSectionBClient.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbBuildingMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbBuildingMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbProjInfoMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbProjInfoMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbSectionConfigMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbSectionConfigMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDamsBMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDamsBMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrhrdsmpMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrhrdsmpMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsbpMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsbpMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsmpMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsmpMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSectionBMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSectionBMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgPztbMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgPztbMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpprmpMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpprmpMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpqnmpMapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpqnmpMapper.xml create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IDamSafetyDataService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IFileUploadService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITBuildingService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITProjInfoService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITSectionConfigService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDamsBService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrhrdsmpService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrvrdsbpService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrvrdsmpService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSectionBService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgPztbService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgSpprmpService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgSpqnmpService.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/DamSafetyDataServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/FileUploadServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TBuildingServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TProjInfoServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TSectionConfigServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDamsBServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrhrdsmpServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrvrdsbpServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrvrdsmpServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSectionBServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgPztbServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgSpprmpServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgSpqnmpServiceImpl.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/util/DealSectionUtil.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/util/ParamUtil.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/TBuildingWrapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/TProjInfoWrapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrhrdsmpWrapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrvrdsbpWrapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrvrdsmpWrapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSectionBWrapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgPztbWrapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgSpprmpWrapper.java create mode 100644 hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgSpqnmpWrapper.java create mode 100644 hzims-service/dam-safety/src/main/resources/application-dev.yml create mode 100644 hzims-service/dam-safety/src/main/resources/application-prod.yml create mode 100644 hzims-service/dam-safety/src/main/resources/application.yml diff --git a/hzims-service-api/common-api/pom.xml b/hzims-service-api/common-api/pom.xml index 49c639e..e238dbf 100644 --- a/hzims-service-api/common-api/pom.xml +++ b/hzims-service-api/common-api/pom.xml @@ -21,7 +21,11 @@ - + + com.github.ben-manes.caffeine + caffeine + 2.8.2 + com.alibaba easyexcel diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/cache/CaffeineCacheUtil.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/cache/CaffeineCacheUtil.java new file mode 100644 index 0000000..06b1e18 --- /dev/null +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/cache/CaffeineCacheUtil.java @@ -0,0 +1,94 @@ +package com.hnac.hzims.cache; + +import com.github.benmanes.caffeine.cache.Cache; +import com.github.benmanes.caffeine.cache.Caffeine; +import com.hnac.hzims.entity.Report; +import com.hnac.hzims.entity.YearReport; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +//Caffeine采用了W-TinyLFU(LUR和LFU的优点结合)开源的缓存技术。缓存性能接近理论最优,属于是Guava Cache的增强版 +public class CaffeineCacheUtil { + + //创建guava cache + private static Cache loadingCache = Caffeine.newBuilder() + //cache的初始容量 + .initialCapacity(5) + //cache最大缓存数 + .maximumSize(50) + //设置写缓存后n秒钟过期 + .expireAfterWrite(1, TimeUnit.HOURS) + //设置读写缓存后n秒钟过期,实际很少用到,类似于expireAfterWrite + //.expireAfterAccess(17, TimeUnit.SECONDS) + .build(); + + private static Cache loadingYearCache = Caffeine.newBuilder() + //cache的初始容量 + .initialCapacity(5) + //cache最大缓存数 + .maximumSize(50) + //设置写缓存后n秒钟过期 + .expireAfterWrite(1, TimeUnit.HOURS) + //设置读写缓存后n秒钟过期,实际很少用到,类似于expireAfterWrite + //.expireAfterAccess(17, TimeUnit.SECONDS) + .build(); + + private static Cache>> loadingMapCache = Caffeine.newBuilder() + //cache的初始容量 + .initialCapacity(5) + //cache最大缓存数 + .maximumSize(50) + //设置写缓存后n秒钟过期 + .expireAfterWrite(1, TimeUnit.HOURS) + //设置读写缓存后n秒钟过期,实际很少用到,类似于expireAfterWrite + //.expireAfterAccess(17, TimeUnit.SECONDS) + .build(); + + public static void add(String key, Report report){ + // 往缓存写数据 + if(report!=null) { + loadingCache.put(key, report); + } + +// // 获取value的值,如果key不存在,获取value后再返回 +// String value = loadingCache.get(key, CaffeineCacheTest::getValueFromDB); +// System.out.println(value); +// // 删除key +// loadingCache.invalidate(key); + } + + public static void addYear(String key, YearReport report){ + // 往缓存写数据 + if(report!=null) { + loadingYearCache.put(key, report); + } + } + + public static void addMap(String key, List> report){ + // 往缓存写数据 + if(report!=null && !report.isEmpty()) { + loadingMapCache.put(key, report); + } + } + + public static List> getMap(String key){ +// // 获取value的值,如果key不存在,获取value后再返回 + List> report = loadingMapCache.getIfPresent(key); + return report; + } + + public static YearReport getYear(String key){ +// // 获取value的值,如果key不存在,获取value后再返回 + YearReport report = loadingYearCache.getIfPresent(key); + return report; + } + + public static Report get(String key){ +// // 获取value的值,如果key不存在,获取value后再返回 + Report report = loadingCache.getIfPresent(key); + return report; + } + +} diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/Report.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/Report.java new file mode 100644 index 0000000..7925b1c --- /dev/null +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/Report.java @@ -0,0 +1,273 @@ +package com.hnac.hzims.entity; + +import com.hnac.hzims.enums.QueryDateTypeEnum; +import com.hnac.hzims.util.ReportDateUtil; +import org.apache.commons.lang3.builder.ToStringBuilder; + +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * 提供出去的报表 + * 提供基础业务数据以及统计数据 + * + * @Author: liugang + * @Date: 2019/7/8 15:03 + */ +public class Report { + + /** + * (唯一标识key,标题名称value), + */ + private List> title; + + /** + * 报表基础数据 + */ + private List data; + + /** + * 附加报表统计数据 + */ + private List standardData; + + /** + * 初始化基础报表数据 + * 把数据全部置为初始状态("-") + * + * @return + */ + public void initBaseReport(int size, Date begin, Date end, QueryDateTypeEnum dtEnum) { + data = new ArrayList<>(); + Calendar cal = Calendar.getInstance(); + cal.setTime(begin); + SimpleDateFormat sdf = ReportDateUtil.getSimpleDateFormatByType(dtEnum); + int step = ReportDateUtil.getCalendarType(dtEnum); + Date temp = cal.getTime(); + while (temp.before(end)) { + String key = sdf.format(temp); + ReportUnit unit = new ReportUnit(); + unit.init(key, size); + data.add(unit); + cal.set(step, cal.get(step) + 1); + temp = cal.getTime(); + } + } + + public void initBaseReportMonth(int day,int month){ + data = new ArrayList<>(); + for(int i=1;i<=day;i++){ + String key=i> 9 ? ""+i:"0"+i; + ReportUnit unit = new ReportUnit(); + unit.init(key, month); + data.add(unit); + } + ReportUnit unit = new ReportUnit(); + unit.init("max", month); + data.add(unit); + + unit = new ReportUnit(); + unit.init("maxDate", month); + data.add(unit); + + unit = new ReportUnit(); + unit.init("min", month); + data.add(unit); + + unit = new ReportUnit(); + unit.init("minDate", month); + data.add(unit); + + unit = new ReportUnit(); + unit.init("avg", month); + data.add(unit); + } + + public void initBaseReportMaxMin(int size, Date begin, Date end, QueryDateTypeEnum dtEnum) { + initBaseReport(size, begin, end, dtEnum); + ReportUnit unit = new ReportUnit(); + unit.init("max", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("maxDate", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("min", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("minDate", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("avg", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("range", size);//极差 + data.add(unit); + } + + public void initBaseReportHistory(int size){ + data = new ArrayList<>(); + ReportUnit unit = new ReportUnit(); + unit.init("max", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("maxDate", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("min", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("minDate", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("avg", size); + data.add(unit); + + unit = new ReportUnit(); + unit.init("range", size);//极差 + data.add(unit); + } + + public void initCompareBaseReport(int size, Date begin, Date end, QueryDateTypeEnum dtEnum) { + data = new ArrayList<>(); + Calendar cal = Calendar.getInstance(); + cal.setTime(begin); + SimpleDateFormat sdf = new SimpleDateFormat("MM-dd"); + int step = ReportDateUtil.getCalendarType(dtEnum); + Date temp = cal.getTime(); + while (temp.before(end)) { + String key = sdf.format(temp); + ReportUnit unit = new ReportUnit(); + unit.init(key, size); + data.add(unit); + cal.set(step, cal.get(step) + 1); + temp = cal.getTime(); + } + } + + public void initBaseRingReport(int size, Date begin, Date end, QueryDateTypeEnum dtEnum){ + data = new ArrayList<>(); + Calendar cal = Calendar.getInstance(); + cal.setTime(begin); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH"); + int step = ReportDateUtil.getCalendarType(dtEnum); + Date temp = cal.getTime(); + while (temp.before(end)) { + String key = sdf.format(temp); + ReportUnit unit = new ReportUnit(); + unit.init(key, size); + data.add(unit); + cal.set(step, cal.get(step) + 1); + temp = cal.getTime(); + } + } + + public void initRingBaseReport(int size, Date begin, Date end, QueryDateTypeEnum dtEnum) { + data = new ArrayList<>(); + Calendar cal = Calendar.getInstance(); + cal.setTime(begin); + SimpleDateFormat sdf = new SimpleDateFormat("MM-dd"); + int step = ReportDateUtil.getCalendarType(dtEnum); + Date temp = cal.getTime(); + while (temp.before(end)) { + String key = sdf.format(temp); + ReportUnit unit = new ReportUnit(); + unit.init(key, size); + data.add(unit); + cal.set(step, cal.get(step) + 1); + temp = cal.getTime(); + } + } + + /** + * 初始化统计数据 + * + * @param size 大小 + * @param keys 统计数据类型 + */ + public void initStandardReport(int size, String[] keys) { + standardData = new ArrayList<>(); + for (String key : keys) { + standardData.add(initSingleStandard(key, size)); + } + } + + private ReportUnit initSingleStandard(String key, int size) { + ReportUnit unit = new ReportUnit(); + unit.setKey(key); + unit.setDataList(new ArrayList<>()); + for (int i = 0; i < size; i++) { + unit.getDataList().add("-"); + } + return unit; + } + + /** + * 修改唯一标识标定的数据对象(基础数据) + * + * @param key 唯一标识 + * @param index 修改的数据索引 + * @param value 修改的值 + */ + public void setBaseCell(String key, int index, String value) { + for (ReportUnit unit : data) { + if (unit.getKey().equals(key)) { + unit.getDataList().set(index, value); + } + } + } + + /** + * 修改唯一标识标定的数据对象(标准数据) + * + * @param key 唯一标识 + * @param index 修改的数据索引 + * @param value 修改的值 + */ + public void setStandardCell(String key, int index, String value) { + for (ReportUnit unit : standardData) { + if (unit.getKey().equals(key)) { + unit.getDataList().set(index, value); + } + } + } + + public List> getTitle() { + return title; + } + + public void setTitle(List> title) { + this.title = title; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public List getStandardData() { + return standardData; + } + + public void setStandardData(List standardData) { + this.standardData = standardData; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } +} + diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportData.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportData.java new file mode 100644 index 0000000..bfde3a8 --- /dev/null +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportData.java @@ -0,0 +1,107 @@ +package com.hnac.hzims.entity; + +/** + * 封装一个key,value键值对象 + * 可能是数据库返回查询数据 + * 也可能是使用的对象由于数据需要置为- + * 所以采用String存储处理 + * + * @Author: liugang + * @Date: 2019/7/8 16:02 + */ +public class ReportData { + + private String keyStr; + + private String keyDate; + + private String val; + //测站 或 属性 + private String stcd; + //属性名 + private String name; + + private Double value; + + private int month=-1; + + private String day; + + public String getDay() { + return day; + } + + public void setDay(String day) { + this.day = day; + } + + public int getMonth() { + return month; + } + + public void setMonth(int month) { + this.month = month; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStcd() { + return stcd; + } + + public void setStcd(String stcd) { + this.stcd = stcd; + } + + public ReportData() { + } + + public String getKeyDate() { + return keyDate; + } + + public void setKeyDate(String keyDate) { + this.keyDate = keyDate; + } + + public ReportData(String keyStr, String val) { + this.keyStr = keyStr; + this.val = val; + } + + public String getKeyStr() { + return keyStr; + } + + public void setKeyStr(String keyStr) { + this.keyStr = keyStr; + } + + public String getVal() { + return val; + } + + public void setVal(String val) { + this.val = val; + } + + public Double getValue() { + if(val!=null && !"".equals(val.trim())) { + if(val.indexOf("-")==-1) { + return Double.valueOf(val); + } + } + return null; + } + + public void setValue(Double value) { + this.value = value; + } +} + diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportUnit.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportUnit.java new file mode 100644 index 0000000..deac24c --- /dev/null +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/ReportUnit.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.entity; + +import java.util.ArrayList; +import java.util.List; + +public class ReportUnit { + private String key; + + private List dataList; + + public void init(String key, int size) { + this.key = key; + dataList = new ArrayList<>(); + for (int i = 0; i < size; i++) { + dataList.add("-"); + } + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public List getDataList() { + return dataList; + } + + public void setDataList(List dataList) { + this.dataList = dataList; + } +} diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/StandardData.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/StandardData.java new file mode 100644 index 0000000..01ac0bb --- /dev/null +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/StandardData.java @@ -0,0 +1,174 @@ +package com.hnac.hzims.entity; + +import org.apache.commons.lang3.StringUtils; + +import java.math.BigDecimal; +import java.util.Objects; + +public class StandardData { + public static final String STANDARD_AVG = "时刻平均值"; + public static final String STANDARD_MAX = "时刻最大值"; + public static final String STANDARD_MAX_DATE = "最大值出现的时间"; + public static final String STANDARD_MIN = "时刻最小值"; + public static final String STANDARD_MIN_DATE = "最小值出现的时间"; + public static final String STANDARD_AMPLITUDE = "最大变幅"; + public static final String STANDARD_SUM = "总量"; + + /** + * 平均值 + */ + private String dataAvg; + /** + * 最大值 + */ + private String dataMax; + /** + * 最大值时间 + */ + private String dataMaxDate; + /** + * 最小值 + */ + private String dataMin; + /** + * 最小值出现时间 + */ + private String dataMinDate; + /** + * 最大变幅 + */ + private String amplitude; + /** + * 总量 + */ + private String dataSum; + + /** + * 比较并处理最大值和最大值日期 + * + * @param value 被比较值 + * @param date 日期 + */ + public void compareDealMax(String value, String date) { + if (Objects.isNull(dataMax)) { + dataMax = value; + dataMaxDate = date; + } else { + if (Double.valueOf(dataMax) < Double.valueOf(value)) { + dataMax = value; + dataMaxDate = date; + } + } + } + + /** + * 比较并处理最小值和最小值日期 + * + * @param value 被比较值 + * @param date 日期 + */ + public void compareDealMin(String value, String date) { + if (Objects.isNull(dataMin)) { + dataMin = value; + dataMinDate = date; + } else { + if (Double.valueOf(value) < Double.valueOf(dataMin)) { + dataMin = value; + dataMinDate = date; + } + } + } + + /** + * 默认计算总和,如有其他逻辑请继承后改写 + * + * @param value + */ + public void countSum(String value) { + if (Objects.isNull(dataSum)) { + dataSum = value; + } else { + dataSum = new BigDecimal(value).add(new BigDecimal(dataSum)).toString(); + } + } + + /** + * 处理空数据,如果数据为空则置- + */ + public void dealNullData() { + if (StringUtils.isEmpty(dataAvg)) { + dataAvg = "-"; + } + if (StringUtils.isEmpty(dataMax)) { + dataMax = "-"; + } + if (StringUtils.isEmpty(dataMaxDate)) { + dataMaxDate = "-"; + } + if (StringUtils.isEmpty(dataMin)) { + dataMin = "-"; + } + if (StringUtils.isEmpty(dataMinDate)) { + dataMinDate = "-"; + } + if (StringUtils.isEmpty(dataSum)) { + dataSum = "-"; + } + } + + public String getDataAvg() { + return dataAvg; + } + + public void setDataAvg(String dataAvg) { + this.dataAvg = dataAvg; + } + + public String getDataMax() { + return dataMax; + } + + public void setDataMax(String dataMax) { + this.dataMax = dataMax; + } + + public String getDataMaxDate() { + return dataMaxDate; + } + + public void setDataMaxDate(String dataMaxDate) { + this.dataMaxDate = dataMaxDate; + } + + public String getDataMin() { + return dataMin; + } + + public void setDataMin(String dataMin) { + this.dataMin = dataMin; + } + + public String getDataMinDate() { + return dataMinDate; + } + + public void setDataMinDate(String dataMinDate) { + this.dataMinDate = dataMinDate; + } + + public String getAmplitude() { + return amplitude; + } + + public void setAmplitude(String amplitude) { + this.amplitude = amplitude; + } + + public String getDataSum() { + return dataSum; + } + + public void setDataSum(String dataSum) { + this.dataSum = dataSum; + } +} diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/YearReport.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/YearReport.java new file mode 100644 index 0000000..a601e1d --- /dev/null +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/entity/YearReport.java @@ -0,0 +1,178 @@ +package com.hnac.hzims.entity; + + + +import com.hnac.hzims.util.ReportDateUtil; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public class YearReport { + private static final int MAX_DAY = 31; + + private int year; + private String stcd; + + /** + * 一个List代表1个月 + * 1个List有31个Double对象代表每一天 + * 如果没有数据或者天不存在就用-表示 + */ + private List> dayList; + + /** + * 一个key代表统计数据类型,value代表每个月统计数据值 + * 例如<最大值,12个月的数据> + * 最大值,最小值,平均值等等组成一个List + */ + private List monthList; + + /** + * 全年统计数据 + */ + private List yearList; + + public void init(String stcd, Integer year) { + this.year = year; + this.stcd = stcd; + initDayList(); + } + + /** + * 依据年份初始化年度报表,每个月的每天都加上- + * 目前不存在的年份也加上了- + * 如果有需求,则只把有日期的天上加上- + */ + public void initDayList() { + dayList = new ArrayList<>(); + for (int month = 0; month <= ReportDateUtil.MAX_MONTH; month++) { + dayList.add(new ArrayList<>()); + for (int day = 0; day < MAX_DAY; day++) { + dayList.get(month).add("-"); + } + } + } + + /** + * 初始化月份统计数据 + * + * @param keys 最大值,最小值,平均值等 + */ + public void initMonthList(String[] keys) { + monthList = new ArrayList<>(); + for (String key : keys) { + ReportUnit reportUnit = new ReportUnit(); + reportUnit.setKey(key); + List list = new ArrayList<>(); + for (int month = 0; month <= ReportDateUtil.MAX_MONTH; month++) { + list.add("-"); + } + reportUnit.setDataList(list); + monthList.add(reportUnit); + } + } + + /** + * 获取某类型每个月的数据 + * + * @param key + * @return + */ + public ReportUnit getMonthKeyList(String key) { + for (ReportUnit reportUnit : monthList) { + if (reportUnit.getKey().equals(key)) { + return reportUnit; + } + } + return null; + } + + /** + * 提供出去的设置每天数据 + * + * @param month 0-11月 + * @param day 1-31日 + * @param value 值 + */ + public void setDayValue(int month, int day, String value) { + dayList.get(month).set(day - 1, value); + } + + /** + * 提供出去的设置每月的统计数据 + * + * @param key 类型(最大值,最小值等) + * @param month 0-11月 + * @param value 值 + */ + public void setMonthValue(String key, int month, String value) { + for (ReportUnit reportUnit : monthList) { + if (reportUnit.getKey().equals(key)) { + reportUnit.getDataList().set(month, value); + } + } + } + + /** + * 针对数据进行求和计算 + * + * @param list + * @return + */ + public String sum(List list) { + String temp = null; + for (String data : list) { + if ("-".equals(data) || Double.valueOf(data) <= 0) { + continue; + } + if (Objects.isNull(temp)) { + temp = data; + } else { + temp = new BigDecimal(temp).add(new BigDecimal(data)).toString(); + } + } + return temp; + } + + public int getYear() { + return year; + } + + public void setYear(int year) { + this.year = year; + } + + public String getStcd() { + return stcd; + } + + public void setStcd(String stcd) { + this.stcd = stcd; + } + + public List> getDayList() { + return dayList; + } + + public void setDayList(List> dayList) { + this.dayList = dayList; + } + + public List getMonthList() { + return monthList; + } + + public void setMonthList(List monthList) { + this.monthList = monthList; + } + + public List getYearList() { + return yearList; + } + + public void setYearList(List yearList) { + this.yearList = yearList; + } +} diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/enums/QueryDateTypeEnum.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/enums/QueryDateTypeEnum.java new file mode 100644 index 0000000..da64139 --- /dev/null +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/enums/QueryDateTypeEnum.java @@ -0,0 +1,35 @@ +package com.hnac.hzims.enums; + +public enum QueryDateTypeEnum { + //时 + HOUR("hour"), + //日 + DAY("day"), + //月 + MONTH("month"), + //年 + YEAR("year"); + + private String queryDateType; + + QueryDateTypeEnum(String queryDateType) { + this.queryDateType = queryDateType; + } + + public static QueryDateTypeEnum getInstance(String queryDateType) { + for (QueryDateTypeEnum queryTypeEnum : QueryDateTypeEnum.values()) { + if (queryTypeEnum.getQueryDateType().equals(queryDateType)) { + return queryTypeEnum; + } + } + return null; + } + + public String getQueryDateType() { + return queryDateType; + } + + public void setQueryDateType(String queryDateType) { + this.queryDateType = queryDateType; + } +} diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/util/CommonUtil.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/util/CommonUtil.java new file mode 100644 index 0000000..e138604 --- /dev/null +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/util/CommonUtil.java @@ -0,0 +1,148 @@ +package com.hnac.hzims.util; + + +import com.hnac.hzims.entity.ReportData; +import com.hnac.hzims.enums.QueryDateTypeEnum; + +import java.text.SimpleDateFormat; +import java.util.*; + +public class CommonUtil { + /** + * 检查查询类型是否符合 + * + * @param type + */ + public static QueryDateTypeEnum checkType(String type) { + QueryDateTypeEnum dtEnum = QueryDateTypeEnum.getInstance(type); + if (Objects.isNull(dtEnum)) { + return null; + } + return dtEnum; + } + + public static Date getHistoryDate(Date now,int year){ + Calendar calendar = Calendar.getInstance(); //创建Calendar 的实例 + calendar.setTime(now); + calendar.add(Calendar.YEAR, -year);//当前时间减去一年,即一年前的时间 + return calendar.getTime(); + } + + public static String getLastDayOfMonth(String yearMonth) + { + String[] arr=yearMonth.split("-"); + Calendar cal = Calendar.getInstance(); + //设置年份 + int year=Integer.valueOf(arr[0]); + cal.set(Calendar.YEAR,year); + //设置月份 + int month=Integer.valueOf(arr[1]); + cal.set(Calendar.MONTH, month-1); + //获取某月最大天数 + int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH); + //设置日历中月份的最大天数 + cal.set(Calendar.DAY_OF_MONTH, lastDay); + //格式化日期 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String lastDayOfMonth = sdf.format(cal.getTime()); + + return lastDayOfMonth; + } + + public static int getYearGap(Date start,Date end){ + Calendar calStartTime = Calendar.getInstance(); //获取日历实例 + Calendar calEndTime = Calendar.getInstance(); + calStartTime.setTime(start); + calEndTime.setTime(end); + return calEndTime.get(Calendar.YEAR) - calStartTime.get(Calendar.YEAR); + } + + + public static Map getStartEnd(String beginSpt, String endSpt){ + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date begin = null; + Date end = null; + try { + begin = sdf.parse(beginSpt); + end = sdf.parse(endSpt); + } catch (Exception e) { + return null; + } + + Map res=new HashMap<>(); + res.put("begin",begin); + res.put("end",end); + return res; + } + + public static String getKey(String str) { + String[] arr=str.split(" "); + String arr0=arr[0]; + String[] keys=arr0.split("-"); + String key=keys[1]+"-"+keys[2]; + return key; + } + + + public static List getReportDataBySignage(List timeDataList, String signage){ + List list=new ArrayList<>(); + for(ReportData data:timeDataList){ + if(signage.equals(data.getStcd())){ + list.add(data); + } + } + return list; + } + + public static int getMonth(String key) { + String[] keys = key.split("-"); + String month = keys[1]; + return Integer.valueOf(month); + } + + public static String getDay(String key) { + String[] keys = key.split("-"); + String dayHour = keys[2]; + String[] dayHourArr=dayHour.split(" "); + return dayHourArr[0]; + } + + public static int getHour(String key) { + String[] keys = key.split(" "); + String dayHour = keys[1]; + String[] dayHourArr=dayHour.split(":"); + return Integer.valueOf(dayHourArr[0]); + } + + //0-> s(秒) 1->、m(分)、2->h(小时)3->、d(天)4->、w(周)5->、n(自然月)、6->y(自然年) + public static String getKeyBySaveTimeType(String key,Integer saveTimeType){ + if(saveTimeType.intValue() == 2){//小时 + int index=key.indexOf(":"); + if(index>0) { + String tmp = key.substring(0, index); + return tmp; + } + } + if(saveTimeType.intValue() == 3){//天 + String[] arr=key.split(" "); + return arr[0]; + } + if(saveTimeType.intValue() == 5){//月 + int index=key.lastIndexOf("-"); + if(index>0) { + String tmp = key.substring(0, index); + return tmp; + } + } + if(saveTimeType.intValue() == 6){//年 + int index = key.indexOf("-"); + if(index>0) { + String tmp = key.substring(0, index); + return tmp; + } + } + return key; + } + +} diff --git a/hzims-service-api/common-api/src/main/java/com/hnac/hzims/util/ReportDateUtil.java b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/util/ReportDateUtil.java new file mode 100644 index 0000000..16e02b5 --- /dev/null +++ b/hzims-service-api/common-api/src/main/java/com/hnac/hzims/util/ReportDateUtil.java @@ -0,0 +1,116 @@ +package com.hnac.hzims.util; + +import com.hnac.hzims.enums.QueryDateTypeEnum; +import org.apache.commons.lang3.StringUtils; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +public class ReportDateUtil { + public static final int MAX_MONTH = 11; + + public static int getDateDiff(Date begin, Date end, int step) { + //初始化差距 + int diff = 0; + Calendar cal = Calendar.getInstance(); + cal.setTime(begin); + Date temp = cal.getTime(); + while (temp.before(end)) { + diff++; + cal.set(step, cal.get(step) + 1); + temp = cal.getTime(); + } + return diff; + } + + /** + * 获取日期 + * + * @param year 年 + * @param month 月(0-11) + * @param day 日(1-31) + * @param hour 时 + * @param minute 分 + * @param second 秒 + * @return + */ + public static Date getDate(int year, int month, int day, int hour, int minute, int second) { + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.YEAR, year); + calendar.set(Calendar.MONTH, month); + calendar.set(Calendar.DAY_OF_MONTH, day); + calendar.set(Calendar.HOUR_OF_DAY, hour); + calendar.set(Calendar.MINUTE, minute); + calendar.set(Calendar.SECOND, second); + calendar.set(Calendar.MILLISECOND, 0); + Date date = calendar.getTime(); + return date; + } + + /** + * 获取下一个日期(下一年,下一月,下一日等) + * + * @param curDate + * @param field + * @return + */ + public static Date getNextDate(Date curDate, int field) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(curDate); + calendar.set(field, calendar.get(field) + 1); + return calendar.getTime(); + } + + /** + * 依据查询类型获取时间格式类型 + * + * @param dtEnum + * @return + */ + public static SimpleDateFormat getSimpleDateFormatByType(QueryDateTypeEnum dtEnum) { + switch (dtEnum) { + case HOUR: + return new SimpleDateFormat("yyyy-MM-dd HH"); + case DAY: + return new SimpleDateFormat("yyyy-MM-dd"); + case MONTH: + return new SimpleDateFormat("yyyy-MM"); + case YEAR: + return new SimpleDateFormat("yyyy"); + default: + return new SimpleDateFormat("yyyy-MM-dd"); + } + } + + /** + * 依据查询类型获取日历类型 + * + * @param dtEnum + * @return + */ + public static int getCalendarType(QueryDateTypeEnum dtEnum) { + switch (dtEnum) { + case HOUR: + return Calendar.HOUR_OF_DAY; + case DAY: + return Calendar.DAY_OF_MONTH; + case MONTH: + return Calendar.MONTH; + case YEAR: + return Calendar.YEAR; + default: + return Calendar.DAY_OF_MONTH; + } + } + + /*** + * 年月日时分秒 转年月日 + */ + public static String getYMDStr(String ymd) { + if(StringUtils.isNotEmpty(ymd)){ + return ymd.substring(0,11); + } + return ""; + } +} diff --git a/hzims-service-api/dam-safety-api/pom.xml b/hzims-service-api/dam-safety-api/pom.xml new file mode 100644 index 0000000..ad10528 --- /dev/null +++ b/hzims-service-api/dam-safety-api/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + com.hnac.hzims + hzims-service-api + 4.0.0-SNAPSHOT + + + dam-safety-api + + + 8 + 8 + UTF-8 + + + \ No newline at end of file diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TBuilding.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TBuilding.java new file mode 100644 index 0000000..21fe57a --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TBuilding.java @@ -0,0 +1,37 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.mp.base.BaseEntity; + +import java.math.BigDecimal; + +/** + * 大坝信息表 + */ +@Data +@TableName("t_building") +public class TBuilding extends BaseEntity { + @ApiModelProperty("水库编号") + private String rscd; + @ApiModelProperty("建筑物名称") + private String name; + @ApiModelProperty("建筑物分级路径") + private String ipath; + @ApiModelProperty("简介") + private String brief; + @ApiModelProperty("图片地址") + private String attach; + @ApiModelProperty("文件地址") + private String filePath; + + //大坝信息 + @ApiModelProperty("坝类型") + private String type;//坝类型 + @ApiModelProperty("地址") + private String address;//地址 + @ApiModelProperty("坝高") + private BigDecimal damHeight;//坝高 + +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TProjInfo.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TProjInfo.java new file mode 100644 index 0000000..0670671 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TProjInfo.java @@ -0,0 +1,38 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.util.Date; + +/** + * 工程物信息表 + */ +@Data +@TableName("t_projinfo") +@EqualsAndHashCode(callSuper = true) +public class TProjInfo extends BaseEntity { + @ApiModelProperty("水库编码") + private String rscd; + @ApiModelProperty("工程名称") + private String projName; + @ApiModelProperty("工程编号") + private String projCode; + @ApiModelProperty("开工日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startDate; + @ApiModelProperty("竣工日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date completeDate; + @ApiModelProperty("蓄水日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date storeWaterDate; + @ApiModelProperty("工程所在位置") + private String location; + @ApiModelProperty("备注") + private String rm; +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TSectionConfig.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TSectionConfig.java new file mode 100644 index 0000000..5eaf6a8 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/TSectionConfig.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 大坝断面数据配置表 + */ +@Data +@TableName("t_section_config") +public class TSectionConfig implements Serializable { + @ApiModelProperty("渗流量测点编号") + @TableId(type = IdType.INPUT) + private String stcd; + @ApiModelProperty("断面编号") + private String sectionNo; + @ApiModelProperty("是否显示浸润线") + private String opinion; + @ApiModelProperty("x轴") + private BigDecimal xzhou; + @ApiModelProperty("y轴最大值") + private BigDecimal ymax; + @ApiModelProperty("y轴最小值") + private BigDecimal ymin; + @ApiModelProperty("警戒值") + private BigDecimal warm; + +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDamsB.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDamsB.java new file mode 100644 index 0000000..a6160f2 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDamsB.java @@ -0,0 +1,31 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 断面特征点信息表 + */ +@Data +@TableName("wrp_dams_b") +public class WrpDamsB{ + @ApiModelProperty("断面编号") + private String damcd; + @ApiModelProperty("特征点编号") + @TableId(type= IdType.INPUT) + private String damscd; + @ApiModelProperty("特征点名称") + private String damsnm; + @ApiModelProperty("起点距(m)") + private BigDecimal redi; + @ApiModelProperty("高程(m)") + private BigDecimal poel; + @ApiModelProperty("更新时间") + private Date dtuptm; +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrhrdsmp.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrhrdsmp.java new file mode 100644 index 0000000..0b165bf --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrhrdsmp.java @@ -0,0 +1,56 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +/** + *水平位移监测测点 + */ +@Data +@TableName("wrp_dfr_srhrdsmp") +@EqualsAndHashCode(callSuper = true) +public class WrpDfrSrhrdsmp extends BaseEntity { + @ApiModelProperty("测站编码") + private String stcd; + @ApiModelProperty("断面编号") + private String damcd; + @ApiModelProperty("测点编号") + private String mpcd; + @ApiModelProperty("桩号") + private String ch; + @ApiModelProperty("轴距") + private BigDecimal ofax; + @ApiModelProperty("高程") + private BigDecimal el; + @ApiModelProperty("基准值 X") + private BigDecimal stvlx; + @ApiModelProperty("基准值 Y") + private BigDecimal stvly; + @ApiModelProperty("位移阈值") + private BigDecimal xyhrds; + @ApiModelProperty("型式") + private String tp; + @ApiModelProperty("基础情况") + private String bsin; + @ApiModelProperty("安装日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date indt; + @ApiModelProperty("测定日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date dtdt; + @ApiModelProperty("仪器编号") + private String dvcd; + @ApiModelProperty("经度") + private BigDecimal eslg; + @ApiModelProperty("纬度") + private BigDecimal nrlt; + @ApiModelProperty("备注") + private String rm; +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrvrdsbp.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrvrdsbp.java new file mode 100644 index 0000000..60ee6aa --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrvrdsbp.java @@ -0,0 +1,55 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 监测基点表 + */ +@Data +@TableName("wrp_dfr_srvrdsbp") +@EqualsAndHashCode(callSuper = true) +public class WrpDfrSrvrdsbp extends BaseEntity { + @ApiModelProperty("水库代码") + private String rscd; + @ApiModelProperty("水工建筑物id") + private Long hycncd; + @ApiModelProperty("基点编号") + private String bpcd; + @ApiModelProperty("考证信息日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date txindt; + @ApiModelProperty("基点类型") + private String bptp; + @ApiModelProperty("桩号") + private String ch; + @ApiModelProperty("轴距") + private BigDecimal ofax; + @ApiModelProperty("高程") + private BigDecimal el; + @ApiModelProperty("型式") + private String tp; + @ApiModelProperty("基础情况") + private String bsin; + @ApiModelProperty("安装日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date indt; + @ApiModelProperty("测定日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date dtdt; + @ApiModelProperty("经度") + private BigDecimal lgtd; + @ApiModelProperty("纬度") + private BigDecimal lttd; + @ApiModelProperty("工作状态") + private String wkcn; + @ApiModelProperty("备注") + private String rm; +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrvrdsmp.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrvrdsmp.java new file mode 100644 index 0000000..54af217 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpDfrSrvrdsmp.java @@ -0,0 +1,53 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 垂直位移监测测点 + */ +@Data +@TableName("wrp_dfr_srvrdsmp") +@EqualsAndHashCode(callSuper = true) +public class WrpDfrSrvrdsmp extends BaseEntity { + @ApiModelProperty("测站编码") + private String stcd; + @ApiModelProperty("断面编号") + private String damcd; + @ApiModelProperty("测点编号") + private String mpcd; + @ApiModelProperty("桩号") + private String ch; + @ApiModelProperty("轴距") + private BigDecimal ofax; + @ApiModelProperty("初始高程") + private BigDecimal inel; + @ApiModelProperty("位移阈值") + private BigDecimal vrds; + @ApiModelProperty("型式") + private String tp; + @ApiModelProperty("基础情况") + private String bsin; + @ApiModelProperty("安装日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date indt; + @ApiModelProperty("测定日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date dtdt; + @ApiModelProperty("仪器编号") + private String dvcd; + @ApiModelProperty("经度") + private BigDecimal eslg; + @ApiModelProperty("纬度") + private BigDecimal nrlt; + @ApiModelProperty("备注") + private String rm; + +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSectionB.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSectionB.java new file mode 100644 index 0000000..26b408b --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSectionB.java @@ -0,0 +1,38 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.math.BigDecimal; + +/** + * 大坝断面信息表 + */ +@Data +@TableName("wrp_section_b") +@EqualsAndHashCode(callSuper = true) +public class WrpSectionB extends BaseEntity { + @ApiModelProperty("水库编号") + private String rscd; + @ApiModelProperty("建筑物id") + private Long buildingId; + @ApiModelProperty("断面编码") + private String damcd; + @ApiModelProperty("断面名称") + private String damnm; + @ApiModelProperty("防渗墙类型") + private String wallType; + @ApiModelProperty("断面长度") + private BigDecimal damlen; + @ApiModelProperty("断面宽度") + private BigDecimal damwd; + @ApiModelProperty("备注") + private String rm; + @ApiModelProperty("预留字段") + private String text; + @ApiModelProperty("图片地址") + private String attach; +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgPztb.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgPztb.java new file mode 100644 index 0000000..4ed8686 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgPztb.java @@ -0,0 +1,57 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.math.BigDecimal; + +/** + * 测压管测点 + */ +@Data +@TableName("wrp_spg_pztb") +@EqualsAndHashCode(callSuper = true) +public class WrpSpgPztb extends BaseEntity { + @ApiModelProperty("测站编码") + private String stcd; + @ApiModelProperty("测点编号") + private String mpcd; + @ApiModelProperty("断面编号") + private String damcd; + @ApiModelProperty("桩号") + private String ch; + @ApiModelProperty("坝轴距") + private BigDecimal ofax; + @ApiModelProperty("监测部位") + private String msps; + + @ApiModelProperty("监测类型") + private String mstp; + @ApiModelProperty("安装高程") + private BigDecimal el; + @ApiModelProperty("进水段底高程") + private BigDecimal ipbtel; + @ApiModelProperty("进水段顶高程") + private BigDecimal iptpel; + @ApiModelProperty("管口高程") + private BigDecimal tbtpel; + @ApiModelProperty("管底高程") + private BigDecimal tbbtel; + @ApiModelProperty("水位阈值高程") + private BigDecimal pztbtel; + + @ApiModelProperty("仪器编号") + private String dvcd; + @ApiModelProperty("经度") + private BigDecimal eslg; + @ApiModelProperty("纬度") + private BigDecimal nrlt; + @ApiModelProperty("备注") + private String rm; + + + +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgSpprmp.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgSpprmp.java new file mode 100644 index 0000000..b9ed7aa --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgSpprmp.java @@ -0,0 +1,52 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 渗流压力测点信息表 + */ +@Data +@TableName("wrp_spg_spprmp") +@EqualsAndHashCode(callSuper = true) +public class WrpSpgSpprmp extends BaseEntity { + @ApiModelProperty("测站编码") + private String stcd; + @ApiModelProperty("断面编码") + private String damcd; + @ApiModelProperty("测点编号") + private String mpcd; + @ApiModelProperty("考证信息日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date txindt; + @ApiModelProperty("桩号") + private String ch; + @ApiModelProperty("轴距") + private BigDecimal ofax; + @ApiModelProperty("高程") + private BigDecimal el; + @ApiModelProperty("监测类型") + private String mstp; + @ApiModelProperty("透水段底高程") + private BigDecimal pmbtel; + @ApiModelProperty("透水段顶高程") + private BigDecimal pmtpel; + @ApiModelProperty("安装日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date indt; + @ApiModelProperty("仪器出厂编号") + private String dvfccd; + @ApiModelProperty("工作状态") + private String wkcn; + @ApiModelProperty("备注") + private String rm; + + +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgSpqnmp.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgSpqnmp.java new file mode 100644 index 0000000..d6a47ae --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/entity/WrpSpgSpqnmp.java @@ -0,0 +1,45 @@ +package com.hnac.hzims.damsafety.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 渗流量测点 + */ +@Data +@TableName("wrp_spg_spqnmp") +@EqualsAndHashCode(callSuper = true) +public class WrpSpgSpqnmp extends BaseEntity { + @ApiModelProperty("测站编码") + private String stcd; + @ApiModelProperty("测点编号") + private String mpcd; + @ApiModelProperty("断面编号") + private String damcd; + @ApiModelProperty("桩号") + private String ch; + @ApiModelProperty("轴距") + private BigDecimal ofax; + @ApiModelProperty("高程") + private BigDecimal el; + @ApiModelProperty("渗流阈值") + private BigDecimal spprwl; + @ApiModelProperty("安装日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date indt; + @ApiModelProperty("仪器编号") + private String dvcd; + @ApiModelProperty("经度") + private BigDecimal eslg; + @ApiModelProperty("纬度") + private BigDecimal nrlt; + @ApiModelProperty("备注") + private String rm; +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/feign/IWrpSectionBClient.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/feign/IWrpSectionBClient.java new file mode 100644 index 0000000..081a64c --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/feign/IWrpSectionBClient.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.damsafety.feign; + +import com.hnac.hzims.damsafety.vo.WrpSectionBVO; +import org.springblade.core.tool.api.R; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; + +import java.util.List; +import java.util.Map; + +@FeignClient( + value = "dam-safety", + url = "${feign.dam-safety:}" +) +public interface IWrpSectionBClient { + String API_PREFIX = "/wrpSectionBClient"; + String LIST = API_PREFIX + "/list"; + + /** + * 获取断面列表 + * + * @return + */ + @GetMapping(LIST) + R> list(Map param); +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/TBuildingVo.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/TBuildingVo.java new file mode 100644 index 0000000..c61c0e5 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/TBuildingVo.java @@ -0,0 +1,8 @@ +package com.hnac.hzims.damsafety.vo; + + +import com.hnac.hzims.damsafety.entity.TBuilding; + +public class TBuildingVo extends TBuilding { + +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/TProjInfoVo.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/TProjInfoVo.java new file mode 100644 index 0000000..96ccab5 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/TProjInfoVo.java @@ -0,0 +1,8 @@ +package com.hnac.hzims.damsafety.vo; + + +import com.hnac.hzims.damsafety.entity.TProjInfo; + +public class TProjInfoVo extends TProjInfo { + +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrhrdsmpVo.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrhrdsmpVo.java new file mode 100644 index 0000000..23143d7 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrhrdsmpVo.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.vo; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrhrdsmp; + +public class WrpDfrSrhrdsmpVo extends WrpDfrSrhrdsmp { + +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrvrdsbpVo.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrvrdsbpVo.java new file mode 100644 index 0000000..755bb19 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrvrdsbpVo.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.vo; + + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsbp; + +public class WrpDfrSrvrdsbpVo extends WrpDfrSrvrdsbp { +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrvrdsmpVo.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrvrdsmpVo.java new file mode 100644 index 0000000..8511d94 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpDfrSrvrdsmpVo.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.vo; + + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsmp; + +public class WrpDfrSrvrdsmpVo extends WrpDfrSrvrdsmp { +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSectionBVO.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSectionBVO.java new file mode 100644 index 0000000..04ab4ad --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSectionBVO.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.damsafety.vo; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsbp; +import com.hnac.hzims.damsafety.entity.WrpSectionB; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +import java.util.List; + +@Data +@EqualsAndHashCode(callSuper = true) +public class WrpSectionBVO extends WrpSectionB { + //测点集合 + private List points; +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgPztbVo.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgPztbVo.java new file mode 100644 index 0000000..b6bfa5e --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgPztbVo.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.vo; + + +import com.hnac.hzims.damsafety.entity.WrpSpgPztb; + +public class WrpSpgPztbVo extends WrpSpgPztb { +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgSpprmpVo.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgSpprmpVo.java new file mode 100644 index 0000000..902d0e8 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgSpprmpVo.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.vo; + + +import com.hnac.hzims.damsafety.entity.WrpSpgSpprmp; + +public class WrpSpgSpprmpVo extends WrpSpgSpprmp { +} diff --git a/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgSpqnmpVo.java b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgSpqnmpVo.java new file mode 100644 index 0000000..269abd7 --- /dev/null +++ b/hzims-service-api/dam-safety-api/src/main/java/com/hnac/hzims/damsafety/vo/WrpSpgSpqnmpVo.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.vo; + + +import com.hnac.hzims.damsafety.entity.WrpSpgSpqnmp; + +public class WrpSpgSpqnmpVo extends WrpSpgSpqnmp { +} diff --git a/hzims-service-api/pom.xml b/hzims-service-api/pom.xml index fdae5c6..9ac0bdb 100644 --- a/hzims-service-api/pom.xml +++ b/hzims-service-api/pom.xml @@ -29,6 +29,7 @@ middle-api base-info-api digital-twin-display-api + dam-safety-api diff --git a/hzims-service/dam-safety/pom.xml b/hzims-service/dam-safety/pom.xml new file mode 100644 index 0000000..244cf7c --- /dev/null +++ b/hzims-service/dam-safety/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + com.hnac.hzims + hzims-service + 4.0.0-SNAPSHOT + + + dam-safety + + + 8 + 8 + UTF-8 + + + + + + com.hnac.hzims + dam-safety-api + ${hzims.project.version} + + + org.springblade + blade-core-boot + + + org.springblade + blade-starter-swagger + + + org.springblade + blade-starter-oss-all + + + com.baomidou + dynamic-datasource-spring-boot-starter + + + org.springblade + blade-core-test + test + + + org.springblade + blade-core-auto + compile + + + com.hnac.hzinfo.data + hzinfo-data-sdk + + + org.springblade + blade-common + + + com.hnac.hzims + common-api + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/DamSafetyApplication.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/DamSafetyApplication.java new file mode 100644 index 0000000..e86c3e0 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/DamSafetyApplication.java @@ -0,0 +1,40 @@ +package com.hnac.hzims.damsafety; + +import org.mybatis.spring.annotation.MapperScan; +import org.springblade.core.cloud.feign.EnableBladeFeign; +import org.springblade.core.launch.BladeApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.cloud.client.SpringCloudApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.scheduling.annotation.EnableScheduling; + +//大坝安全模块 +@EnableBladeFeign(basePackages = {"org.springblade","com.hnac"}) +@SpringCloudApplication +@MapperScan("com.hnac.hzims.**.mapper.**") +@EnableScheduling +@ComponentScan(basePackages = {"com.hnac.hzims.*"}) +public class DamSafetyApplication extends SpringBootServletInitializer { + public final static String APP_NAME = "dam-safety"; + + + static { + System.setProperty("spring.cloud.nacos.discovery.server-addr", "http://192.168.65.105:8848"); + System.setProperty("spring.cloud.nacos.config.server-addr", "http://192.168.65.105:8848"); + System.setProperty("spring.cloud.nacos.username", "nacos"); + System.setProperty("spring.cloud.nacos.password", "nacos"); + } + + + + public static void main(String[] args) { +// System.setProperty("nacos.standalone", "true"); + BladeApplication.run(APP_NAME, DamSafetyApplication.class, args); + } + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { + return BladeApplication.createSpringApplicationBuilder(builder, APP_NAME, DamSafetyApplication.class); + } +} \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/DamSafetyDataController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/DamSafetyDataController.java new file mode 100644 index 0000000..1cb4de9 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/DamSafetyDataController.java @@ -0,0 +1,211 @@ +package com.hnac.hzims.damsafety.controller; + +import com.hnac.hzims.damsafety.entity.TProjInfo; +import com.hnac.hzims.damsafety.service.IDamSafetyDataService; +import com.hnac.hzims.damsafety.service.ITProjInfoService; +import com.hnac.hzims.entity.Report; +import com.hnac.hzims.enums.QueryDateTypeEnum; +import com.hnac.hzims.util.CommonUtil; +import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; +import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeInstanceFieldVO; +import com.hnac.hzinfo.sdk.analyse.vo.DeviceSinglePropsValueVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import java.util.*; + +@RestController +@RequestMapping("/damSafety/data") +@AllArgsConstructor +@Api(value = "大坝安全数据查询接口", tags = "大坝安全数据查询接口") +public class DamSafetyDataController extends BladeController implements CacheNames { + private final IDamSafetyDataService damSafetyDataService; + + + @ApiOperation("实时数据接口") + @RequestMapping(value = "/getRealData", method = RequestMethod.GET) + public R getRealData(String deviceCode){ + List data = damSafetyDataService.getRealData(deviceCode); + return R.data(data,"查询成功"); + } + + //过程线 + @ApiOperation("基础数据报表,数据查询和统计分析使用接口") + @RequestMapping(value = "/getReportData", method = RequestMethod.GET) + public R getReportData(String deviceCode, String beginSpt, String endSpt, String type, Integer accessRules,String col){ + Map res= CommonUtil.getStartEnd(beginSpt,endSpt); + if(res == null){ + return R.data(500,false, "日期格式错误"); + } + //查询基础数据 + String[] deviceCodes=deviceCode.split(","); + Report report = damSafetyDataService.getReportData(Arrays.asList(deviceCodes),type,accessRules, res.get("begin"), res.get("end"),col); + return R.data(report,"查询成功"); + } + + @ApiOperation("大坝浸润线") + @RequestMapping(value = "/getSeepageLine", method = RequestMethod.GET) + public R getSeepageLine(String deviceCode, String beginSpt, String endSpt,String col){ + Map res= CommonUtil.getStartEnd(beginSpt,endSpt); + if(res == null){ + return R.data(500,false, "日期格式错误"); + } + //查询基础数据 + String[] deviceCodes=deviceCode.split(","); + List data = damSafetyDataService.getSeepageLine(Arrays.asList(deviceCodes), res.get("begin"), res.get("end"),col); + return R.data(data,"查询成功"); + } + + @ApiOperation("用于渗压水位过程线,相同业务场景也可用此接口") + @RequestMapping(value = "/getReportDataByDeviceCode", method = RequestMethod.GET) + public R getReportData(String deviceCode, String beginSpt, String endSpt, String type, Integer accessRules){ + Map res= CommonUtil.getStartEnd(beginSpt,endSpt); + if(res == null){ + return R.data(500,false, "日期格式错误"); + } + //查询基础数据 + Report report = damSafetyDataService.getReportDataByDeviceCode(deviceCode,type,accessRules, res.get("begin"), res.get("end")); + return R.data(report,"查询成功"); + } + + @ApiOperation("表头列") + @RequestMapping(value = "/getTableHead", method = RequestMethod.GET) + public R getTableHead(String stcd) { + //查询基础数据 + List report = damSafetyDataService.getSignages(stcd); + return R.data(report,"查询成功"); + } + + //==============================报表接口========================== + @ApiOperation("渗压年报表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "deviceCode", value = "仪器模型code", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "year", value = "年份", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "col", value = "传渗压属性字段", paramType = "query", dataType = "string") + }) + @RequestMapping(value = "/getYearSpprReport", method = RequestMethod.GET) + public R getYearSpprReport(String rscd,String deviceCode,String year,String col) { + Map res= CommonUtil.getStartEnd(year+"-01-01 00:00:00",year+"-12-31 23:59:59"); + //查询基础数据 + String[] deviceCodes=deviceCode.split(","); + Map data = damSafetyDataService.getYearSpprReport(rscd,Arrays.asList(deviceCodes),res.get("begin"), res.get("end"),col); + return R.data(data,"查询成功"); + } + + //==============================报表接口========================== + @ApiOperation("渗流年报表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "deviceCode", value = "仪器模型code", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "year", value = "年份", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "col", value = "传渗流属性字段", paramType = "query", dataType = "string") + }) + @RequestMapping(value = "/getYearSpqnReport", method = RequestMethod.GET) + public R getYearSpqnReport(String rscd,String deviceCode,String year,String col) { + Map res= CommonUtil.getStartEnd(year+"-01-01 00:00:00",year+"-12-31 23:59:59"); + //查询基础数据 + String[] deviceCodes=deviceCode.split(","); + Map data = damSafetyDataService.getYearSpprReport(rscd,Arrays.asList(deviceCodes),res.get("begin"), res.get("end"),col); + return R.data(data,"查询成功"); + } + + + @ApiOperation("水平位移年报表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deviceCode", value = "仪器模型code", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "year", value = "年份", paramType = "query", dataType = "string") + }) + @RequestMapping(value = "/getYearHrdsReport", method = RequestMethod.GET) + public R getYearHrdsReport(String deviceCode,String year) { + Map res= CommonUtil.getStartEnd(year+"-01-01 00:00:00",year+"-12-31 23:59:59"); + //查询基础数据 + String[] deviceCodes=deviceCode.split(","); + Map data = damSafetyDataService.getYearHrdsReport(Arrays.asList(deviceCodes),res.get("begin"), res.get("end")); + return R.data(data,"查询成功"); + } + + @ApiOperation("垂直位移年报表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deviceCode", value = "仪器模型code", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "year", value = "年份", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "col", value = "传垂直位移属性字段", paramType = "query", dataType = "string") + }) + @RequestMapping(value = "/getYearVrdsReport", method = RequestMethod.GET) + public R getYearVrdsReport(String deviceCode,String year,String col) { + Map res= CommonUtil.getStartEnd(year+"-01-01 00:00:00",year+"-12-31 23:59:59"); + //查询基础数据 + String[] deviceCodes=deviceCode.split(","); + Report data = damSafetyDataService.getYearVrdsReport(Arrays.asList(deviceCodes),res.get("begin"), res.get("end"),col); + return R.data(data,"查询成功"); + } + + @ApiOperation("压力(应力)年报表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deviceCode", value = "仪器模型code", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "year", value = "年份", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "col", value = "传垂直位移属性字段", paramType = "query", dataType = "string") + }) + @RequestMapping(value = "/getYearStressReport", method = RequestMethod.GET) + public R getYearStressReport(String deviceCode,String year,String col) { + Map res= CommonUtil.getStartEnd(year+"-01-01 00:00:00",year+"-12-31 23:59:59"); + //查询基础数据 + String[] deviceCodes=deviceCode.split(","); + Report data = damSafetyDataService.getYearVrdsReport(Arrays.asList(deviceCodes),res.get("begin"), res.get("end"),col); + return R.data(data,"查询成功"); + } + + private final ITProjInfoService tProjInfoService; + @ApiOperation("大坝报表 无工程竣工日期将默认查询三年的历史数据") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deviceCode", value = "仪器模型code", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "queryType", value = "year 或 month", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "yearMonth", value = "年份或者年月", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "col", value = "属性字段", paramType = "query", dataType = "string") + }) + @RequestMapping(value = "/getDamReport", method = RequestMethod.GET) + public R getDamReport(String deviceCode,String queryType,String yearMonth,String col) { + Map res = CommonUtil.getStartEnd(yearMonth + "-01-01 00:00:00", yearMonth + "-12-31 23:59:59"); + String type="month"; + if(QueryDateTypeEnum.MONTH.getQueryDateType().equals(queryType)) { + String yearMonthDay = CommonUtil.getLastDayOfMonth(yearMonth); + type="day"; + res = CommonUtil.getStartEnd(yearMonth + "-01 00:00:00", yearMonthDay + " 23:59:59"); + } + + List dd=tProjInfoService.list(); + int yearGap=3; + if(dd!=null && !dd.isEmpty()){ + Date completeDate=dd.get(0).getCompleteDate(); + if(completeDate!=null) { + yearGap = CommonUtil.getYearGap(completeDate, res.get("begin")); + } + } + //查询基础数据 + String[] deviceCodes=deviceCode.split(","); + String[] cols=col.split(","); + if(cols.length == 1) {//渗压、垂直位移 + Map data = damSafetyDataService.getDamReport(Arrays.asList(deviceCodes),type, res.get("begin"), res.get("end"), cols[0],yearGap); + return R.data(data,"查询成功"); + } + + if(cols.length == 2) {//水平位移 + Map xData = damSafetyDataService.getDamReport(Arrays.asList(deviceCodes),type, res.get("begin"), res.get("end"), cols[0],yearGap); + Map yData = damSafetyDataService.getDamReport(Arrays.asList(deviceCodes),type, res.get("begin"), res.get("end"), cols[1],yearGap); + Map data=new HashMap<>(); + data.put("xData",xData); + data.put("yData",yData); + return R.data(data,"查询成功"); + } + return null; + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/FileUploadController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/FileUploadController.java new file mode 100644 index 0000000..c0afe21 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/FileUploadController.java @@ -0,0 +1,57 @@ +package com.hnac.hzims.damsafety.controller; + +import com.hnac.hzims.damsafety.service.IFileUploadService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.tool.api.R; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +@RestController +@RequestMapping("/damSafety/fileUpload") +@AllArgsConstructor +@Api(value = "大坝文件上传", tags = "大坝文件上传接口") +public class FileUploadController { + + @Autowired + IFileUploadService iImageUploadService; + + @RequestMapping(value="/uploadFile", method = {RequestMethod.POST}) + @ApiOperation(notes ="上传单个文件", value = "上传单个文件") + public R addImage(@RequestParam("file") MultipartFile file){ + try { + Object path = iImageUploadService.addFile(file,"fileInfo"); + if (path!=null) { + return R.data(path); + } else { + return R.fail("操作失败"); + } + }catch (Exception e) { + return R.fail("操作失败"); + } + } + + @RequestMapping(value="/uploadFiles", method = {RequestMethod.POST}) + @ApiOperation(notes ="上传多文件", value = "上传多文件") + public R addFiles(@RequestParam("files") MultipartFile[] files){ + try { + List paths = iImageUploadService.addFiles(files,"fileInfo"); + if (paths!=null) { + return R.data(paths); + } else { + return R.fail("操作失败"); + } + }catch (Exception e) { + return R.fail("操作失败"); + } + } + + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TBuildingController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TBuildingController.java new file mode 100644 index 0000000..69ad800 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TBuildingController.java @@ -0,0 +1,124 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.TBuilding; +import com.hnac.hzims.damsafety.service.ITBuildingService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.TBuildingVo; +import com.hnac.hzims.damsafety.wrapper.TBuildingWrapper; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/tBuilding") +@AllArgsConstructor +@Api(value = "建筑物", tags = "建筑物接口") +public class TBuildingController extends BladeController implements CacheNames { + private final ITBuildingService tBuildingService; + + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "name", value = "建筑物名称", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入tBuilding") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionTBuilding(param); + IPage pages = tBuildingService.page(Condition.getPage(query), wrapper); + return R.data(TBuildingWrapper.build().pageVO(pages)); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "name", value = "建筑物名称", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入tBuilding") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionTBuilding(param); + List list = tBuildingService.list(wrapper); + return R.data(TBuildingWrapper.build().listVO(list)); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入tBuilding") + public R detail(TBuilding tBuilding) { + TBuilding detail = tBuildingService.getOne(Condition.getQueryWrapper(tBuilding)); + return R.data(TBuildingWrapper.build().entityVO(detail)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入tBuilding") + public R save(@RequestBody TBuilding tBuilding) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + + wrapper.eq(TBuilding::getRscd,tBuilding.getRscd()); + wrapper.eq(TBuilding::getName,tBuilding.getName()); + List list = tBuildingService.list(wrapper); + if(list!=null && !list.isEmpty()){ + return R.fail("此水库中建筑物名称已存在"); + } + return R.status(tBuildingService.save(tBuilding)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入tBuilding") + public R update(@RequestBody TBuilding tBuilding) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + wrapper.eq(TBuilding::getRscd,tBuilding.getRscd()); + wrapper.eq(TBuilding::getName,tBuilding.getName()); + wrapper.ne(TBuilding::getId,tBuilding.getId()); + List list = tBuildingService.list(wrapper); + if(list!=null && !list.isEmpty()){ + return R.fail("此水库中建筑物名称已存在"); + } + return R.status(tBuildingService.updateById(tBuilding)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + boolean temp = tBuildingService.deleteLogic(Func.toLongList(ids)); + return R.status(temp); + } + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TProjInfoController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TProjInfoController.java new file mode 100644 index 0000000..05154fa --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TProjInfoController.java @@ -0,0 +1,131 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.TProjInfo; +import com.hnac.hzims.damsafety.service.ITProjInfoService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.TProjInfoVo; +import com.hnac.hzims.damsafety.wrapper.TProjInfoWrapper; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/tProjInfo") +@AllArgsConstructor +@Api(value = "工程信息", tags = "工程信息接口") +public class TProjInfoController extends BladeController implements CacheNames { + + private final ITProjInfoService tProjInfoService; + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "projName", value = "工程名称", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "projCode", value = "工程编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入tProjInfo") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionTProjInfo(param); + IPage pages = tProjInfoService.page(Condition.getPage(query), wrapper); + return R.data(TProjInfoWrapper.build().pageVO(pages)); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "projName", value = "工程名称", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "projCode", value = "工程编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入tProjInfo") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionTProjInfo(param); + List list = tProjInfoService.list(wrapper); + return R.data(TProjInfoWrapper.build().listVO(list)); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入tProjInfo") + public R detail(TProjInfo tProjInfo) { + TProjInfo detail = tProjInfoService.getOne(Condition.getQueryWrapper(tProjInfo)); + return R.data(TProjInfoWrapper.build().entityVO(detail)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入tProjInfo") + public R save(@RequestBody TProjInfo tProjInfo) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + wrapper.eq(TProjInfo::getProjCode,tProjInfo.getProjCode()); + List list = tProjInfoService.list(wrapper); + if(list!=null && !list.isEmpty()){ + return R.fail("工程编码已存在"); + } + + wrapper=new LambdaQueryWrapper(); + wrapper.eq(TProjInfo::getProjName,tProjInfo.getProjName()); + list = tProjInfoService.list(wrapper); + if(list!=null && !list.isEmpty()){ + return R.fail("工程名称已存在"); + } + + return R.status(tProjInfoService.save(tProjInfo)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入tProjInfo") + public R update(@RequestBody TProjInfo tProjInfo) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + wrapper.eq(TProjInfo::getProjCode,tProjInfo.getProjCode()); + wrapper.ne(TProjInfo::getId,tProjInfo.getId()); + List list = tProjInfoService.list(wrapper); + if(list!=null && !list.isEmpty()){ + return R.fail("工程编码已存在"); + } + return R.status(tProjInfoService.updateById(tProjInfo)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + boolean temp = tProjInfoService.deleteLogic(Func.toLongList(ids)); + return R.status(temp); + } + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TSectionConfigController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TSectionConfigController.java new file mode 100644 index 0000000..2082b75 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/TSectionConfigController.java @@ -0,0 +1,114 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.TSectionConfig; +import com.hnac.hzims.damsafety.service.ITSectionConfigService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/tSectionConfig") +@AllArgsConstructor +@Api(value = "断面配置", tags = "断面配置接口") +public class TSectionConfigController extends BladeController implements CacheNames { + private final ITSectionConfigService tSectionConfigService; + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测点编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "sectionNo", value = "断面编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入TSectionConfig") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionTSectionConfig(param); + IPage pages = tSectionConfigService.page(Condition.getPage(query), wrapper); + return R.data(pages); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测点编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "sectionNo", value = "断面编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入TSectionConfig") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionTSectionConfig(param); + List list = tSectionConfigService.list(wrapper); + return R.data(list); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入tSectionConfig") + public R detail(TSectionConfig tSectionConfig) { + TSectionConfig detail = tSectionConfigService.getOne(Condition.getQueryWrapper(tSectionConfig)); + return R.data(detail); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入tSectionConfig") + public R save(@RequestBody TSectionConfig tSectionConfig) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(TSectionConfig::getStcd,tSectionConfig.getStcd()); + List list = tSectionConfigService.list(wrapper); + if(list!=null && !list.isEmpty()){ + return R.fail("该测点编号配置已存在"); + } + + return R.status(tSectionConfigService.save(tSectionConfig)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入tSectionConfig") + public R update(@RequestBody TSectionConfig tSectionConfig) { + return R.status(tSectionConfigService.updateById(tSectionConfig)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "stcd") + public R remove(@ApiParam(value = "测点编号集合") @RequestParam String stcd) { + List list=Func.toStrList(stcd); + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + wrapper.in(TSectionConfig::getStcd,list); + boolean temp = tSectionConfigService.delete(wrapper); + return R.status(temp); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDamsBController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDamsBController.java new file mode 100644 index 0000000..0399420 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDamsBController.java @@ -0,0 +1,123 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.WrpDamsB; +import com.hnac.hzims.damsafety.service.IWrpDamsBService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/wrpDamsB") +@AllArgsConstructor +@Api(value = "断面特征点信息", tags = "断面特征点信息接口") +public class WrpDamsBController extends BladeController implements CacheNames { + private final IWrpDamsBService wrpDamsBService; + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damscd", value = "特征点编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damsnm", value = "特征点名称", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入wrpDamsB") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionWrpDamsB(param); + IPage pages = wrpDamsBService.page(Condition.getPage(query), wrapper); + return R.data(pages); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damscd", value = "特征点编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damsnm", value = "特征点名称", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入wrpDamsB") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionWrpDamsB(param); + List list = wrpDamsBService.list(wrapper); + return R.data(list); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入wrpDamsB") + public R detail(WrpDamsB wrpDamsB) { + WrpDamsB detail = wrpDamsBService.getOne(Condition.getQueryWrapper(wrpDamsB)); + return R.data(detail); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入wrpDamsB") + public R save(@RequestBody WrpDamsB wrpDamsB) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpDamsB::getDamscd,wrpDamsB.getDamscd()); + List list = wrpDamsBService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"特征点编号已存在"); + } + + wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpDamsB::getDamsnm,wrpDamsB.getDamsnm()); + list = wrpDamsBService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"特征点名称已存在"); + } + + return R.status(wrpDamsBService.save(wrpDamsB)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入wrpDamsB") + public R update(@RequestBody WrpDamsB wrpDamsB) { + return R.status(wrpDamsBService.updateById(wrpDamsB)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "damscd") + public R remove(@ApiParam(value = "特征点编号集合") @RequestParam String damscd) { + List list=Func.toStrList(damscd); + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + wrapper.in(WrpDamsB::getDamscd,list); + boolean temp = wrpDamsBService.delete(wrapper); + return R.status(temp); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrhrdsmpController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrhrdsmpController.java new file mode 100644 index 0000000..e913baa --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrhrdsmpController.java @@ -0,0 +1,135 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.WrpDfrSrhrdsmp; +import com.hnac.hzims.damsafety.service.IWrpDfrSrhrdsmpService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.WrpDfrSrhrdsmpVo; +import com.hnac.hzims.damsafety.wrapper.WrpDfrSrhrdsmpWrapper; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/wrpDfrSrhrdsmp") +@AllArgsConstructor +@Api(value = "水平位移监测测点", tags = "水平位移监测测点接口") +public class WrpDfrSrhrdsmpController extends BladeController implements CacheNames { + private final IWrpDfrSrhrdsmpService wrpDfrSrhrdsmpService; + + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入wrpDfrSrhrdsmp") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionWrpDfrSrhrdsmp(param); + IPage pages = wrpDfrSrhrdsmpService.page(Condition.getPage(query), wrapper); + return R.data(WrpDfrSrhrdsmpWrapper.build().pageVO(pages)); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入wrpDfrSrhrdsmp") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionWrpDfrSrhrdsmp(param); + List list = wrpDfrSrhrdsmpService.list(wrapper); + return R.data(WrpDfrSrhrdsmpWrapper.build().listVO(list)); + } + + + /** + * 查询水平位移断面 + */ + @GetMapping("/section") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查询水平位移断面") + public R>> section(HttpServletRequest request,String rscd) { + String deptId=request.getHeader("dept-id"); + if(StringUtils.isBlank(deptId)){ + deptId = AuthUtil.getDeptId(); + } + List> list = wrpDfrSrhrdsmpService.section(deptId,rscd); + //返回断面加仪器数据 + return R.data(list,"查询断面成功"); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入wrpDfrSrhrdsmp") + public R detail(WrpDfrSrhrdsmp wrpDfrSrhrdsmp) { + WrpDfrSrhrdsmp detail = wrpDfrSrhrdsmpService.getOne(Condition.getQueryWrapper(wrpDfrSrhrdsmp)); + return R.data(WrpDfrSrhrdsmpWrapper.build().entityVO(detail)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入wrpDfrSrhrdsmp") + public R save(@RequestBody WrpDfrSrhrdsmp wrpDfrSrhrdsmp) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpDfrSrhrdsmp::getMpcd,wrpDfrSrhrdsmp.getMpcd()); + List list = wrpDfrSrhrdsmpService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"测点编号已存在"); + } + return R.status(wrpDfrSrhrdsmpService.save(wrpDfrSrhrdsmp)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入wrpDfrSrhrdsmp") + public R update(@RequestBody WrpDfrSrhrdsmp wrpDfrSrhrdsmp) { + return R.status(wrpDfrSrhrdsmpService.updateById(wrpDfrSrhrdsmp)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + boolean temp = wrpDfrSrhrdsmpService.deleteLogic(Func.toLongList(ids)); + return R.status(temp); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrvrdsbpController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrvrdsbpController.java new file mode 100644 index 0000000..ed4c9ca --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrvrdsbpController.java @@ -0,0 +1,117 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsbp; +import com.hnac.hzims.damsafety.service.IWrpDfrSrvrdsbpService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.WrpDfrSrvrdsbpVo; +import com.hnac.hzims.damsafety.wrapper.WrpDfrSrvrdsbpWrapper; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/wrpDfrSrvrdsbp") +@AllArgsConstructor +@Api(value = "监测基点表", tags = "监测基点接口") +public class WrpDfrSrvrdsbpController extends BladeController implements CacheNames { + private final IWrpDfrSrvrdsbpService wrpDfrSrvrdsbpService; + + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库代码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "hycncd", value = "水工建筑物id", paramType = "query", dataType = "long"), + @ApiImplicitParam(name = "bpcd", value = "基点编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "bptp", value = "基点类型", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入WrpDfrSrvrdsbp") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionWrpDfrSrvrdsbp(param); + IPage pages = wrpDfrSrvrdsbpService.page(Condition.getPage(query), wrapper); + return R.data(WrpDfrSrvrdsbpWrapper.build().pageVO(pages)); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库代码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "hycncd", value = "水工建筑物id", paramType = "query", dataType = "long"), + @ApiImplicitParam(name = "bpcd", value = "基点编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "bptp", value = "基点类型", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入WrpDfrSrvrdsbp") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionWrpDfrSrvrdsbp(param); + List list = wrpDfrSrvrdsbpService.list(wrapper); + return R.data(WrpDfrSrvrdsbpWrapper.build().listVO(list)); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入wrpDfrSrvrdsbp") + public R detail(WrpDfrSrvrdsbp wrpDfrSrvrdsbp) { + WrpDfrSrvrdsbp detail = wrpDfrSrvrdsbpService.getOne(Condition.getQueryWrapper(wrpDfrSrvrdsbp)); + return R.data(WrpDfrSrvrdsbpWrapper.build().entityVO(detail)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入wrpDfrSrvrdsbp") + public R save(@RequestBody WrpDfrSrvrdsbp wrpDfrSrvrdsbp) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpDfrSrvrdsbp::getBpcd,wrpDfrSrvrdsbp.getBpcd()); + List list = wrpDfrSrvrdsbpService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"基点编号已存在"); + } + return R.status(wrpDfrSrvrdsbpService.save(wrpDfrSrvrdsbp)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入wrpDfrSrvrdsbp") + public R update(@RequestBody WrpDfrSrvrdsbp wrpDfrSrvrdsbp) { + return R.status(wrpDfrSrvrdsbpService.updateById(wrpDfrSrvrdsbp)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + boolean temp = wrpDfrSrvrdsbpService.deleteLogic(Func.toLongList(ids)); + return R.status(temp); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrvrdsmpController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrvrdsmpController.java new file mode 100644 index 0000000..2b5bcdb --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpDfrSrvrdsmpController.java @@ -0,0 +1,135 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsmp; +import com.hnac.hzims.damsafety.service.IWrpDfrSrvrdsmpService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.WrpDfrSrvrdsmpVo; +import com.hnac.hzims.damsafety.wrapper.WrpDfrSrvrdsmpWrapper; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/wrpDfrSrvrdsmp") +@AllArgsConstructor +@Api(value = "垂直位移监测测点", tags = "垂直位移监测测点接口") +public class WrpDfrSrvrdsmpController extends BladeController implements CacheNames { + private final IWrpDfrSrvrdsmpService wrpDfrSrvrdsmpService; + + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入wrpDfrSrvrdsmp") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionWrpDfrSrvrdsmp(param); + IPage pages = wrpDfrSrvrdsmpService.page(Condition.getPage(query), wrapper); + return R.data(WrpDfrSrvrdsmpWrapper.build().pageVO(pages)); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入wrpDfrSrvrdsmp") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionWrpDfrSrvrdsmp(param); + List list = wrpDfrSrvrdsmpService.list(wrapper); + return R.data(WrpDfrSrvrdsmpWrapper.build().listVO(list)); + } + + + /** + * 查询垂直位移断面 + */ + @GetMapping("/section") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查询垂直位移断面") + public R>> section(HttpServletRequest request,String rscd) { + String deptId=request.getHeader("dept-id"); + if(StringUtils.isBlank(deptId)){ + deptId = AuthUtil.getDeptId(); + } + List> list = wrpDfrSrvrdsmpService.section(deptId,rscd); + //返回断面加仪器数据 + return R.data(list,"查询断面成功"); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入wrpDfrSrvrdsmp") + public R detail(WrpDfrSrvrdsmp wrpDfrSrvrdsmp) { + WrpDfrSrvrdsmp detail = wrpDfrSrvrdsmpService.getOne(Condition.getQueryWrapper(wrpDfrSrvrdsmp)); + return R.data(WrpDfrSrvrdsmpWrapper.build().entityVO(detail)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入wrpDfrSrvrdsmp") + public R save(@RequestBody WrpDfrSrvrdsmp wrpDfrSrvrdsmp) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpDfrSrvrdsmp::getMpcd,wrpDfrSrvrdsmp.getMpcd()); + List list = wrpDfrSrvrdsmpService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"测点编号已存在"); + } + return R.status(wrpDfrSrvrdsmpService.save(wrpDfrSrvrdsmp)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入wrpDfrSrvrdsmp") + public R update(@RequestBody WrpDfrSrvrdsmp wrpDfrSrvrdsmp) { + return R.status(wrpDfrSrvrdsmpService.updateById(wrpDfrSrvrdsmp)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + boolean temp = wrpDfrSrvrdsmpService.deleteLogic(Func.toLongList(ids)); + return R.status(temp); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSectionBController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSectionBController.java new file mode 100644 index 0000000..04099e5 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSectionBController.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright Example, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * Example, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.WrpSectionB; +import com.hnac.hzims.damsafety.service.IWrpSectionBService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.WrpSectionBVO; +import com.hnac.hzims.damsafety.wrapper.WrpSectionBWrapper; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Map; + +/** + * 大坝断面控制器 + * + * @author Chill + */ +@RestController +@RequestMapping("/damSafety/wrpSectionB") +@AllArgsConstructor +@Api(value = "大坝断面", tags = "大坝断面接口") +public class WrpSectionBController extends BladeController implements CacheNames { + + private final IWrpSectionBService wrpSectionBService; + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "buildingId", value = "建筑物id", paramType = "query", dataType = "long"), + @ApiImplicitParam(name = "damcd", value = "断面编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damnm", value = "断面名称", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "wallType", value = "防渗墙类型", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入wrpSectionB") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionWrpSectionB(param); + IPage pages = wrpSectionBService.page(Condition.getPage(query), wrapper); + return R.data(WrpSectionBWrapper.build().pageVO(pages)); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "buildingId", value = "建筑物id", paramType = "query", dataType = "long"), + @ApiImplicitParam(name = "damcd", value = "断面编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damnm", value = "断面名称", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "wallType", value = "防渗墙类型", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入wrpSectionB") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionWrpSectionB(param); + List list = wrpSectionBService.list(wrapper); + return R.data(WrpSectionBWrapper.build().listVO(list)); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入wrpSectionB") + public R detail(WrpSectionB WrpSectionB) { + WrpSectionB detail = wrpSectionBService.getOne(Condition.getQueryWrapper(WrpSectionB)); + return R.data(WrpSectionBWrapper.build().entityVO(detail)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入wrpSectionB") + public R save(@RequestBody WrpSectionB wrpSectionB) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpSectionB::getDamcd,wrpSectionB.getDamcd()); + List list = wrpSectionBService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"断面编码已存在"); + } + + wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpSectionB::getDamnm,wrpSectionB.getDamnm()); + list = wrpSectionBService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"断面名称已存在"); + } + + return R.status(wrpSectionBService.save(wrpSectionB)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入wrpSectionB") + public R update(@RequestBody WrpSectionB wrpSectionB) { + return R.status(wrpSectionBService.updateById(wrpSectionB)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + boolean temp = wrpSectionBService.deleteLogic(Func.toLongList(ids)); + return R.status(temp); + } + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgPztbController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgPztbController.java new file mode 100644 index 0000000..771f2c7 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgPztbController.java @@ -0,0 +1,133 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.WrpSpgPztb; +import com.hnac.hzims.damsafety.service.IWrpSpgPztbService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.WrpSpgPztbVo; +import com.hnac.hzims.damsafety.wrapper.WrpSpgPztbWrapper; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/wrpSpgPztb") +@AllArgsConstructor +@Api(value = "测压管测点", tags = "测压管测点接口") +public class WrpSpgPztbController extends BladeController implements CacheNames { + private final IWrpSpgPztbService wrpSpgPztbService; + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入wrpSpgPztb") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionWrpSpgPztb(param); + IPage pages = wrpSpgPztbService.page(Condition.getPage(query), wrapper); + return R.data(WrpSpgPztbWrapper.build().pageVO(pages)); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入wrpSpgPztb") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionWrpSpgPztb(param); + List list = wrpSpgPztbService.list(wrapper); + return R.data(WrpSpgPztbWrapper.build().listVO(list)); + } + + /** + * 查询测压管断面 + */ + @GetMapping("/section") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查询测压管断面") + public R>> section(HttpServletRequest request,String rscd) { + String deptId=request.getHeader("dept-id"); + if(StringUtils.isBlank(deptId)){ + deptId = AuthUtil.getDeptId(); + } + List> list = wrpSpgPztbService.section(deptId,rscd); + //返回断面加仪器数据 + return R.data(list,"查询断面成功"); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入wrpSpgPztb") + public R detail(WrpSpgPztb wrpSpgPztb) { + WrpSpgPztb detail = wrpSpgPztbService.getOne(Condition.getQueryWrapper(wrpSpgPztb)); + return R.data(WrpSpgPztbWrapper.build().entityVO(detail)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入wrpSpgPztb") + public R save(@RequestBody WrpSpgPztb wrpSpgPztb) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpSpgPztb::getMpcd,wrpSpgPztb.getMpcd()); + List list = wrpSpgPztbService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"测点编号已存在"); + } + return R.status(wrpSpgPztbService.save(wrpSpgPztb)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入wrpSpgPztb") + public R update(@RequestBody WrpSpgPztb wrpSpgPztb) { + return R.status(wrpSpgPztbService.updateById(wrpSpgPztb)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + boolean temp = wrpSpgPztbService.deleteLogic(Func.toLongList(ids)); + return R.status(temp); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgSpprmpController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgSpprmpController.java new file mode 100644 index 0000000..cf1c276 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgSpprmpController.java @@ -0,0 +1,139 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.damsafety.entity.WrpSpgSpprmp; +import com.hnac.hzims.damsafety.service.IWrpSpgSpprmpService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.WrpSpgSpprmpVo; +import com.hnac.hzims.damsafety.wrapper.WrpSpgSpprmpWrapper; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/wrpSpgSpprmp") +@AllArgsConstructor +@Api(value = "渗流压力测点信息", tags = "渗流压力测点信息接口") +public class WrpSpgSpprmpController extends BladeController implements CacheNames { + private final IWrpSpgSpprmpService wrpSpgSpprmpService; + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "ch", value = "桩号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入wrpSpgSpprmp") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionWrpSpgSpprmp(param); + IPage pages = wrpSpgSpprmpService.page(Condition.getPage(query), wrapper); + return R.data(WrpSpgSpprmpWrapper.build().pageVO(pages)); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "ch", value = "桩号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入wrpSpgSpprmp") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionWrpSpgSpprmp(param); + List list = wrpSpgSpprmpService.list(wrapper); + return R.data(WrpSpgSpprmpWrapper.build().listVO(list)); + } + + + /** + * 查询渗压断面 + */ + @GetMapping("/section") + @ApiImplicitParams({ + @ApiImplicitParam(name = "rscd", value = "水库编码", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查询渗压断面") + public R>> section(HttpServletRequest request,String rscd) { + String deptId=request.getHeader("dept-id"); + if(StringUtils.isBlank(deptId)){ + deptId = AuthUtil.getDeptId(); + } + List> list = wrpSpgSpprmpService.section(deptId,rscd); + //返回断面加仪器数据 + return R.data(list,"查询断面成功"); + } + + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入wrpSpgSpprmp") + public R detail(WrpSpgSpprmp wrpSpgSpprmp) { + WrpSpgSpprmp detail = wrpSpgSpprmpService.getOne(Condition.getQueryWrapper(wrpSpgSpprmp)); + return R.data(WrpSpgSpprmpWrapper.build().entityVO(detail)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入wrpSpgSpprmp") + public R save(@RequestBody WrpSpgSpprmp wrpSpgSpprmp) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpSpgSpprmp::getMpcd,wrpSpgSpprmp.getMpcd()); + List list = wrpSpgSpprmpService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"测点编号已存在"); + } + return R.status(wrpSpgSpprmpService.save(wrpSpgSpprmp)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入wrpSpgSpprmp") + public R update(@RequestBody WrpSpgSpprmp wrpSpgSpprmp) { + return R.status(wrpSpgSpprmpService.updateById(wrpSpgSpprmp)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + boolean temp = wrpSpgSpprmpService.deleteLogic(Func.toLongList(ids)); + return R.status(temp); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgSpqnmpController.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgSpqnmpController.java new file mode 100644 index 0000000..49bdb81 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/controller/WrpSpgSpqnmpController.java @@ -0,0 +1,133 @@ +package com.hnac.hzims.damsafety.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.common.logs.annotation.OperationAnnotation; +import com.hnac.hzims.damsafety.entity.WrpSpgSpqnmp; +import com.hnac.hzims.damsafety.service.IWrpSpgSpqnmpService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.WrpSpgSpqnmpVo; +import com.hnac.hzims.damsafety.wrapper.WrpSpgSpqnmpWrapper; +import io.swagger.annotations.*; +import lombok.AllArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springblade.common.cache.CacheNames; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/damSafety/wrpSpgSpqnmp") +@AllArgsConstructor +@Api(value = "渗流量测点", tags = "渗流量测点接口") +public class WrpSpgSpqnmpController extends BladeController implements CacheNames { + private final IWrpSpgSpqnmpService wrpSpgSpqnmpService; + + /** + * 分页 + */ + @GetMapping("/pageList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入wrpSpgSpqnmp") + public R> pageList(@ApiIgnore @RequestParam Map param, Query query) { + LambdaQueryWrapper wrapper= ParamUtil.conditionWrpSpgSpqnmp(param); + IPage pages = wrpSpgSpqnmpService.page(Condition.getPage(query), wrapper); + return R.data(WrpSpgSpqnmpWrapper.build().pageVO(pages)); + } + + /** + * 列表 + */ + @GetMapping("/list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "damcd", value = "断面编号", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "mpcd", value = "测点编号", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 2) + @ApiOperation(value = "列表", notes = "传入wrpSpgSpqnmp") + public R> list(@ApiIgnore @RequestParam Map param) { + LambdaQueryWrapper wrapper=ParamUtil.conditionWrpSpgSpqnmp(param); + List list = wrpSpgSpqnmpService.list(wrapper); + return R.data(WrpSpgSpqnmpWrapper.build().listVO(list)); + } + + /** + * 查询渗流断面 + */ + @GetMapping("/section") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查询渗流断面") + public R>> section(HttpServletRequest request,String rscd) { + String deptId=request.getHeader("dept-id"); + if(StringUtils.isBlank(deptId)){ + deptId = AuthUtil.getDeptId(); + } + List> list = wrpSpgSpqnmpService.section(deptId,rscd); + //返回断面加仪器数据 + return R.data(list,"查询断面成功"); + } + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情", notes = "传入wrpSpgSpqnmp") + public R detail(WrpSpgSpqnmp wrpSpgSpqnmp) { + WrpSpgSpqnmp detail = wrpSpgSpqnmpService.getOne(Condition.getQueryWrapper(wrpSpgSpqnmp)); + return R.data(WrpSpgSpqnmpWrapper.build().entityVO(detail)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入wrpSpgSpqnmp") + public R save(@RequestBody WrpSpgSpqnmp wrpSpgSpqnmp) { + LambdaQueryWrapper wrapper=new LambdaQueryWrapper<>(); + wrapper.eq(WrpSpgSpqnmp::getMpcd,wrpSpgSpqnmp.getMpcd()); + List list = wrpSpgSpqnmpService.list(wrapper); + if(list!=null && !list.isEmpty()) { + return R.data(500,false,"测点编号已存在"); + } + return R.status(wrpSpgSpqnmpService.save(wrpSpgSpqnmp)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入wrpSpgSpqnmp") + public R update(@RequestBody WrpSpgSpqnmp wrpSpgSpqnmp) { + return R.status(wrpSpgSpqnmpService.updateById(wrpSpgSpqnmp)); + } + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "逻辑删除", notes = "ids") + public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + boolean temp = wrpSpgSpqnmpService.deleteLogic(Func.toLongList(ids)); + return R.status(temp); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/feign/WrpSectionBClient.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/feign/WrpSectionBClient.java new file mode 100644 index 0000000..fa703eb --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/feign/WrpSectionBClient.java @@ -0,0 +1,28 @@ +package com.hnac.hzims.damsafety.feign; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hnac.hzims.damsafety.entity.WrpSectionB; +import com.hnac.hzims.damsafety.service.IWrpSectionBService; +import com.hnac.hzims.damsafety.util.ParamUtil; +import com.hnac.hzims.damsafety.vo.WrpSectionBVO; +import com.hnac.hzims.damsafety.wrapper.WrpSectionBWrapper; +import org.springblade.core.tool.api.R; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +@RestController +public class WrpSectionBClient implements IWrpSectionBClient { + + @Autowired + private IWrpSectionBService wrpSectionBService; + + @Override + public R> list(Map param) { + LambdaQueryWrapper wrapper= ParamUtil.conditionWrpSectionB(param); + List list = wrpSectionBService.list(wrapper); + return R.data(WrpSectionBWrapper.build().listVO(list)); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbBuildingMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbBuildingMapper.java new file mode 100644 index 0000000..928538d --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbBuildingMapper.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.hnac.hzims.damsafety.entity.TBuilding; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +public interface TbBuildingMapper extends UserDataScopeBaseMapper { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbBuildingMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbBuildingMapper.xml new file mode 100644 index 0000000..7f49d66 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbBuildingMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbProjInfoMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbProjInfoMapper.java new file mode 100644 index 0000000..d7b0e71 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbProjInfoMapper.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.hnac.hzims.damsafety.entity.TProjInfo; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +public interface TbProjInfoMapper extends UserDataScopeBaseMapper { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbProjInfoMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbProjInfoMapper.xml new file mode 100644 index 0000000..d861102 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbProjInfoMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbSectionConfigMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbSectionConfigMapper.java new file mode 100644 index 0000000..ccf23e5 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbSectionConfigMapper.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.damsafety.entity.TSectionConfig; + +public interface TbSectionConfigMapper extends BaseMapper { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbSectionConfigMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbSectionConfigMapper.xml new file mode 100644 index 0000000..a15c7ef --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/TbSectionConfigMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDamsBMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDamsBMapper.java new file mode 100644 index 0000000..6308444 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDamsBMapper.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.damsafety.entity.WrpDamsB; + +public interface WrpDamsBMapper extends BaseMapper { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDamsBMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDamsBMapper.xml new file mode 100644 index 0000000..63025e5 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDamsBMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrhrdsmpMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrhrdsmpMapper.java new file mode 100644 index 0000000..8d7c93d --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrhrdsmpMapper.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrhrdsmp; +import org.apache.ibatis.annotations.Param; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +import java.util.List; +import java.util.Map; + +public interface WrpDfrSrhrdsmpMapper extends UserDataScopeBaseMapper { + List> section(@Param("deptId") String deptId, @Param("rscd") String rscd); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrhrdsmpMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrhrdsmpMapper.xml new file mode 100644 index 0000000..d17bb5d --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrhrdsmpMapper.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsbpMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsbpMapper.java new file mode 100644 index 0000000..09d0ab8 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsbpMapper.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsbp; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +public interface WrpDfrSrvrdsbpMapper extends UserDataScopeBaseMapper { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsbpMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsbpMapper.xml new file mode 100644 index 0000000..b1ea19e --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsbpMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsmpMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsmpMapper.java new file mode 100644 index 0000000..596aece --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsmpMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsmp; +import org.apache.ibatis.annotations.Param; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +import java.util.List; +import java.util.Map; + +public interface WrpDfrSrvrdsmpMapper extends UserDataScopeBaseMapper { + List> section(@Param("deptId") String deptId,@Param("rscd") String rscd); +} + diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsmpMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsmpMapper.xml new file mode 100644 index 0000000..b2052bb --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpDfrSrvrdsmpMapper.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSectionBMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSectionBMapper.java new file mode 100644 index 0000000..2450a83 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSectionBMapper.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright Example, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * Example, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.hnac.hzims.damsafety.mapper; + +import com.hnac.hzims.damsafety.entity.WrpSectionB; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +/** + * Mapper 接口 请不要使用TSectionMapper,否则扫描到的是TSectionMapper 而不是 tSectionMapper 导致找不到mapper + * @author Chill + */ +public interface WrpSectionBMapper extends UserDataScopeBaseMapper { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSectionBMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSectionBMapper.xml new file mode 100644 index 0000000..418b268 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSectionBMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgPztbMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgPztbMapper.java new file mode 100644 index 0000000..7df95c5 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgPztbMapper.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.hnac.hzims.damsafety.entity.WrpSpgPztb; +import org.apache.ibatis.annotations.Param; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +import java.util.List; +import java.util.Map; + +public interface WrpSpgPztbMapper extends UserDataScopeBaseMapper { + List> section(@Param("deptId") String deptId,@Param("rscd") String rscd); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgPztbMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgPztbMapper.xml new file mode 100644 index 0000000..7fac0c9 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgPztbMapper.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpprmpMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpprmpMapper.java new file mode 100644 index 0000000..fe0daf5 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpprmpMapper.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.hnac.hzims.damsafety.entity.WrpSpgSpprmp; +import org.apache.ibatis.annotations.Param; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +import java.util.List; +import java.util.Map; + +public interface WrpSpgSpprmpMapper extends UserDataScopeBaseMapper { + List> section(@Param("deptId") String deptId,@Param("rscd") String rscd); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpprmpMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpprmpMapper.xml new file mode 100644 index 0000000..2e82e78 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpprmpMapper.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpqnmpMapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpqnmpMapper.java new file mode 100644 index 0000000..314cca4 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpqnmpMapper.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.damsafety.mapper; + +import com.hnac.hzims.damsafety.entity.WrpSpgSpqnmp; +import org.apache.ibatis.annotations.Param; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; + +import java.util.List; +import java.util.Map; + +public interface WrpSpgSpqnmpMapper extends UserDataScopeBaseMapper { + List> section(@Param("deptId") String deptId,@Param("rscd") String rscd); +} + diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpqnmpMapper.xml b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpqnmpMapper.xml new file mode 100644 index 0000000..cbbc403 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/mapper/WrpSpgSpqnmpMapper.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IDamSafetyDataService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IDamSafetyDataService.java new file mode 100644 index 0000000..908358f --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IDamSafetyDataService.java @@ -0,0 +1,25 @@ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.entity.Report; +import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; +import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeInstanceFieldVO; +import com.hnac.hzinfo.sdk.analyse.vo.DeviceSinglePropsValueVO; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public interface IDamSafetyDataService { + Report getReportData(List deviceCodes, String type, Integer accessRules, Date begin, Date end, String col); + List getSeepageLine(List deviceCodes, Date begin, Date end, String col); + Report getReportDataByDeviceCode(String deviceCode, String type, Integer accessRules, Date begin, Date end); + List getSignages(String stcd); + + Map getYearSpprReport(String rscd,List deviceCodes, Date begin, Date end,String col); + Map getYearHrdsReport(List deviceCodes,Date begin, Date end); + Report getYearVrdsReport(List deviceCodes,Date begin, Date end,String col); + + Map getDamReport(List deviceCodes,String type, Date begin, Date end,String col,int yearGap); + + List getRealData(String deviceCode); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IFileUploadService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IFileUploadService.java new file mode 100644 index 0000000..a0f3fce --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IFileUploadService.java @@ -0,0 +1,10 @@ +package com.hnac.hzims.damsafety.service; + +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +public interface IFileUploadService { + String addFile(MultipartFile file,String childPath); + List addFiles(MultipartFile[] files,String childPath); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITBuildingService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITBuildingService.java new file mode 100644 index 0000000..29bca9a --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITBuildingService.java @@ -0,0 +1,8 @@ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.damsafety.entity.TBuilding; +import org.springblade.core.mp.base.BaseService; + + +public interface ITBuildingService extends BaseService { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITProjInfoService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITProjInfoService.java new file mode 100644 index 0000000..fee9de9 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITProjInfoService.java @@ -0,0 +1,7 @@ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.damsafety.entity.TProjInfo; +import org.springblade.core.mp.base.BaseService; + +public interface ITProjInfoService extends BaseService { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITSectionConfigService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITSectionConfigService.java new file mode 100644 index 0000000..0465af0 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/ITSectionConfigService.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.damsafety.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.damsafety.entity.TSectionConfig; + +import java.util.List; + +public interface ITSectionConfigService{ + IPage page(IPage page, LambdaQueryWrapper wrapper); + + List list(LambdaQueryWrapper wrapper); + + TSectionConfig getOne(QueryWrapper wrapper); + + boolean save(TSectionConfig entity); + + boolean updateById(TSectionConfig entity); + + boolean delete(Wrapper wrapper); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDamsBService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDamsBService.java new file mode 100644 index 0000000..45d2919 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDamsBService.java @@ -0,0 +1,23 @@ +package com.hnac.hzims.damsafety.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.damsafety.entity.WrpDamsB; + +import java.util.List; + +public interface IWrpDamsBService { + IPage page(IPage page, LambdaQueryWrapper wrapper); + + List list(LambdaQueryWrapper wrapper); + + WrpDamsB getOne(QueryWrapper wrapper); + + boolean save(WrpDamsB entity); + + boolean updateById(WrpDamsB entity); + + boolean delete(Wrapper wrapper); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrhrdsmpService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrhrdsmpService.java new file mode 100644 index 0000000..ee3cf37 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrhrdsmpService.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrhrdsmp; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; +import java.util.Map; + +public interface IWrpDfrSrhrdsmpService extends BaseService { + List> section(String deptId,String rscd); + List> getSection(String deptId,String rscd); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrvrdsbpService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrvrdsbpService.java new file mode 100644 index 0000000..352b70d --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrvrdsbpService.java @@ -0,0 +1,8 @@ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsbp; +import org.springblade.core.mp.base.BaseService; + +public interface IWrpDfrSrvrdsbpService extends BaseService { + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrvrdsmpService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrvrdsmpService.java new file mode 100644 index 0000000..ed89845 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpDfrSrvrdsmpService.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsmp; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; +import java.util.Map; + +public interface IWrpDfrSrvrdsmpService extends BaseService { + List> section(String deptId,String rscd); + List> getSection(String deptId,String rscd); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSectionBService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSectionBService.java new file mode 100644 index 0000000..21ab3ab --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSectionBService.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright Example, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * Example, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.damsafety.entity.WrpSectionB; +import org.springblade.core.mp.base.BaseService; + +/** + * 服务类 + * + * @author Chill + */ +public interface IWrpSectionBService extends BaseService { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgPztbService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgPztbService.java new file mode 100644 index 0000000..d30046d --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgPztbService.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.damsafety.entity.WrpSpgPztb; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; +import java.util.Map; + +public interface IWrpSpgPztbService extends BaseService { + List> section(String deptId,String rscd); + List> getSection(String deptId,String rscd); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgSpprmpService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgSpprmpService.java new file mode 100644 index 0000000..d70efea --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgSpprmpService.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.damsafety.entity.WrpSpgSpprmp; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; +import java.util.Map; + +public interface IWrpSpgSpprmpService extends BaseService { + List> section(String deptId,String rscd); + List> getSection(String deptId,String rscd); +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgSpqnmpService.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgSpqnmpService.java new file mode 100644 index 0000000..fa63027 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/IWrpSpgSpqnmpService.java @@ -0,0 +1,13 @@ +package com.hnac.hzims.damsafety.service; + +import com.hnac.hzims.damsafety.entity.WrpSpgSpqnmp; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; +import java.util.Map; + +public interface IWrpSpgSpqnmpService extends BaseService { + List> section(String deptId,String rscd); + List> getSection(String deptId,String rscd); +} + diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/DamSafetyDataServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/DamSafetyDataServiceImpl.java new file mode 100644 index 0000000..584e6c0 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/DamSafetyDataServiceImpl.java @@ -0,0 +1,647 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.service.IDamSafetyDataService; +import com.hnac.hzims.entity.Report; +import com.hnac.hzims.entity.ReportData; +import com.hnac.hzims.enums.QueryDateTypeEnum; +import com.hnac.hzims.util.CommonUtil; +import com.hnac.hzims.util.ReportDateUtil; +import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; +import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO; +import com.hnac.hzinfo.datasearch.analyse.po.AnalyzeDataConditionPO; +import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; +import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO; +import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeInstanceFieldVO; +import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO; +import com.hnac.hzinfo.sdk.analyse.AnalyseDataSearchClient; +import com.hnac.hzinfo.sdk.analyse.po.ComputeBaseStrategyPO; +import com.hnac.hzinfo.sdk.analyse.vo.DeviceSinglePropsValueQuery; +import com.hnac.hzinfo.sdk.analyse.vo.DeviceSinglePropsValueVO; +import com.hnac.hzinfo.sdk.core.response.Result; +import com.hnac.hzinfo.sdk.real.RealDataSearchClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.*; + +@Service +@Slf4j +public class DamSafetyDataServiceImpl implements IDamSafetyDataService { + + @Autowired + AnalyseDataSearchClient analyseDataSearchClient; + + @Autowired + RealDataSearchClient realDataSearchClient; + + @Override + public Report getReportData(List deviceCodes, String type, Integer accessRules, Date begin, Date end, String col) { + //检查数据是否正常并转化 + final QueryDateTypeEnum dtEnum = CommonUtil.checkType(type); + if(deviceCodes==null || deviceCodes.size()<=0){ + return null; + } + + if(dtEnum ==null){ + return null; + } + + //初始化报表 + Report report = new Report(); + report.initBaseReport(deviceCodes.size(), begin, end, dtEnum); + //设置基础数据 + for (int i = 0; i < deviceCodes.size(); i++) { + String deviceCode = deviceCodes.get(i); + //获取数据库某个站点不同时间要求的数据 + List timeDataList = listDataReport(begin,end,dtEnum,deviceCode,accessRules,col); + + for (ReportData reportData : timeDataList) { + String value=reportData.getVal(); +// if(value!=null && !"-".equals(value) && !"".equals(value.trim())){ +// value = new BigDecimal(value).setScale(3,BigDecimal.ROUND_DOWN).toString(); +// } + if(value == null){ + value = "-"; + } + report.setBaseCell(reportData.getKeyStr(), i, value); + } + } + return report; + } + + @Override + public List getSeepageLine(List deviceCodes, Date begin, Date end, String col) { + return getEightHourData(deviceCodes,"0",begin,end,col); + } + + List getEightHourData(List deviceCodes, String accessRules,Date begin, Date end,String col){ + DeviceSinglePropsValueQuery query=new DeviceSinglePropsValueQuery(); + query.setDeviceCodes(deviceCodes); + query.setSignage(col); + query.setAccessRule(accessRules); + query.setBeginTime(begin); + query.setEndTime(end); + Result> result=analyseDataSearchClient.getValueOfBacthDeviceCode(query); + if(result==null || !result.isSuccess()){ + return null; + } + List list=result.getData(); + return list; + } + + @Override + public List getSignages(String stcd){ + //查询列 + Result> result=analyseDataSearchClient.getInstanceFieldByAnalyseCode(stcd,1,""); + if(result==null || !result.isSuccess()){ + return null; + } + + List analyzeInstanceFieldVOS=result.getData(); + return analyzeInstanceFieldVOS; + } + + @Override + public Map getYearSpprReport(String rscd,List deviceCodes, Date begin, Date end,String col) { + String type="day"; + Report report=getYearDataReport(deviceCodes,type,begin,end,col); + + //根据水库模型获取数据 + Report data=getMaxMinByDeviceCode(rscd,type,6,begin,end); + Map res=new HashMap<>(); + res.put("spprData",report); + res.put("reservoirData",data); + return res; + } + + @Override + public Map getYearHrdsReport(List deviceCodes, Date begin, Date end) { + Report xData=getYearDataReport(deviceCodes,"day",begin,end,"xhrds"); + Report yData=getYearDataReport(deviceCodes,"day",begin,end,"yhrds"); + Map res=new HashMap<>(); + res.put("xData",xData); + res.put("yData",yData); + return res; + } + + @Override + public Report getYearVrdsReport(List deviceCodes, Date begin, Date end, String col) { + return getYearDataReport(deviceCodes,"day",begin,end,col); + } + + @Override + public Map getDamReport(List deviceCodes,String type, Date begin, Date end, String col,int yearGap) { + Map res=new HashMap<>(); + Report report=getYearDataReport(deviceCodes,type,begin,end,col); + res.put("nowData",report); + //历史时间对应的历史数据 + Date historyDate=CommonUtil.getHistoryDate(begin,yearGap); + Report historyData=getHistoryData(deviceCodes,"year", historyDate, end, col); + res.put("historyData",historyData); + return res; + } + + @Override + public List getRealData(String stcd) { + RealDataSearchPO po=new RealDataSearchPO(); + po.setAnalyzeCode(stcd); + List list=getSignages(stcd); + if(list==null && list.isEmpty()){ + return null; + } + List signages=new ArrayList<>(); + for(AnalyzeInstanceFieldVO vo:list){ + signages.add(vo.getSignage()); + } + po.setSignages(signages); + Result> result=realDataSearchClient.getRealDataByDeviceCode(po); + return result.getData(); + } + + public Report getHistoryData(List deviceCodes,String type, Date begin, Date end, String col){ + //检查数据是否正常并转化 + final QueryDateTypeEnum dtEnum = CommonUtil.checkType(type); + if(deviceCodes==null || deviceCodes.size()<=0){ + return null; + } + int count=deviceCodes.size(); + //初始化报表 + Report report = new Report(); + report.initBaseReportHistory(count); + //设置基础数据 + for (int i = 0; i < count; i++) { + String deviceCode = deviceCodes.get(i); +// List dataList = listDataReport(param,dtEnum,deviceCode,1,col); +// dealMaxMin(report,i,dataList); + //获取数据库某个站点不同时间要求的数据 + List maxList = listDataReport(begin, end,dtEnum,deviceCode,1,col); + List minList = listDataReport(begin, end,dtEnum,deviceCode,2,col); + List avgList = listDataReport(begin, end,dtEnum,deviceCode,3,col); + dealHistoryMaxMin(report,i,maxList,minList,avgList); + } + return report; + } + + private void dealHistoryMaxMin(Report report ,int i,List maxList,List minList,List avgList){ + BigDecimal maxValue=null; + BigDecimal minValue=null; + BigDecimal avg=null; + if(maxList!=null && !maxList.isEmpty()){ + ReportData maxObj=maxList.get(0); + if(maxObj!=null && maxObj.getValue()!=null) { + maxValue = new BigDecimal(maxObj.getValue()).setScale(3, BigDecimal.ROUND_HALF_UP); + report.setBaseCell("maxDate", i, ReportDateUtil.getYMDStr(maxObj.getKeyDate())); + }else{ + report.setBaseCell("maxDate", i, "-"); + } + } + + if(minList!=null && !minList.isEmpty()){ + ReportData minObj=minList.get(0); + if(minObj!=null && minObj.getValue()!=null) { + minValue = new BigDecimal(minObj.getValue()).setScale(3, BigDecimal.ROUND_HALF_UP); + report.setBaseCell("minDate", i, ReportDateUtil.getYMDStr(minObj.getKeyDate())); + }else{ + report.setBaseCell("minDate", i, "-"); + } + } + + if(avgList!=null && !avgList.isEmpty()){ + ReportData avgObj=avgList.get(0); + if(avgObj!=null && avgObj.getValue()!=null) { + avg = new BigDecimal(avgObj.getValue()).setScale(3, BigDecimal.ROUND_HALF_UP); + } + } + if(maxValue!=null) { + report.setBaseCell("max", i, String.valueOf(maxValue)); + }else{ + report.setBaseCell("max", i, "-"); + } + + if(minValue!=null) { + report.setBaseCell("min", i, String.valueOf(minValue)); + }else{ + report.setBaseCell("min", i, "-"); + } + + if(avg!=null){ + report.setBaseCell("avg", i, String.valueOf(avg)); + }else{ + report.setBaseCell("avg", i, "-"); + } + + if(maxValue!=null && minValue!=null) { + BigDecimal range = maxValue.subtract(minValue); + BigDecimal tmpRang = range.setScale(3, BigDecimal.ROUND_HALF_UP); + report.setBaseCell("range", i, String.valueOf(tmpRang));//极差 + }else{ + report.setBaseCell("range", i, "-");//极差 + } + } + + private Report getYearDataReport(List deviceCodes,String type, Date begin, Date end, String col){ + //检查数据是否正常并转化 + final QueryDateTypeEnum dtEnum = CommonUtil.checkType(type); + if(deviceCodes==null || deviceCodes.size()<=0){ + return null; + } + + int count=deviceCodes.size(); + //初始化报表 + Report report = new Report(); + report.initBaseReportMaxMin(count, begin, end, dtEnum); + //设置基础数据 + for (int i = 0; i < count; i++) { + String deviceCode = deviceCodes.get(i); + //获取数据库某个站点不同时间要求的数据 + List timeDataList = listDataReport(begin, end,dtEnum,deviceCode,6,col); + + for (ReportData reportData : timeDataList) { + String value=reportData.getVal(); +// if(value!=null && !"-".equals(value) && !"".equals(value.trim())){ +// value = new BigDecimal(value).setScale(3,BigDecimal.ROUND_DOWN).toString(); +// } + if(value == null){ + value = "-"; + } + report.setBaseCell(reportData.getKeyStr(), i, value); + } + dealMaxMin(report,i,timeDataList); + } + return report; + } + +// private void dealMaxMin(Report report ,int i,List timeDataList){ +// if(timeDataList==null || timeDataList.isEmpty()){ +// return; +// } +// +// Optional max = timeDataList.stream().filter(reportData -> reportData.getValue()!=null).max(Comparator.comparingDouble(ReportData::getValue)); +// ReportData maxObj = max.get(); +// double maxValue=maxObj.getValue(); +// +// report.setBaseCell("max", i, String.valueOf(maxValue)); +// report.setBaseCell("maxDate", i, ReportDateUtil.getYMDStr(maxObj.getKeyDate())); +// +// Optional min = timeDataList.stream().filter(reportData -> reportData.getValue()!=null).min(Comparator.comparingDouble(ReportData::getValue)); +// ReportData minObj = min.get(); +// double minValue=minObj.getValue(); +// +// report.setBaseCell("min", i, String.valueOf(minValue)); +// report.setBaseCell("minDate", i, ReportDateUtil.getYMDStr(minObj.getKeyDate())); +// +// +// Double avgs = timeDataList.stream().filter(reportData -> reportData.getValue()!=null).mapToDouble(ReportData::getValue).average().orElse(0D); +// BigDecimal avg=new BigDecimal(String.valueOf(avgs)).setScale(3,BigDecimal.ROUND_HALF_UP); +// report.setBaseCell("avg", i, String.valueOf(avg)); +// +// BigDecimal range=new BigDecimal(maxValue).subtract(new BigDecimal(minValue)); +// BigDecimal tmpRang=range.setScale(3,BigDecimal.ROUND_HALF_UP); +// report.setBaseCell("range", i, String.valueOf(tmpRang.abs()));//极差 0或正值 +// +// } + + private void dealMaxMin(Report report ,int i,List timeDataList){ + if(timeDataList==null || timeDataList.isEmpty()){ + return; + } + + Optional max = timeDataList.stream().filter(reportData -> reportData.getValue()!=null).max(Comparator.comparingDouble(ReportData::getValue)); + + Double maxValue =0.0; + if(max!=null && max.isPresent()) { + ReportData maxObj = max.get(); + maxValue = maxObj.getValue(); + report.setBaseCell("max", i, String.valueOf(maxValue)); + report.setBaseCell("maxDate", i, ReportDateUtil.getYMDStr(maxObj.getKeyDate())); + }else{ + report.setBaseCell("max", i, "-"); + report.setBaseCell("maxDate", i, "-"); + } + + Optional min = timeDataList.stream().filter(reportData -> reportData.getValue()!=null).min(Comparator.comparingDouble(ReportData::getValue)); + + Double minValue=0.0; + if(min!=null && min.isPresent()) { + ReportData minObj = min.get(); + minValue = minObj.getValue(); + report.setBaseCell("min", i, String.valueOf(minValue)); + report.setBaseCell("minDate", i, ReportDateUtil.getYMDStr(minObj.getKeyDate())); + }else{ + report.setBaseCell("min", i, "-"); + report.setBaseCell("minDate", i, "-"); + } + + Double avgs = timeDataList.stream().filter(reportData -> reportData.getValue()!=null).mapToDouble(ReportData::getValue).average().orElse(0D); + BigDecimal avg=new BigDecimal(String.valueOf(avgs)).setScale(3,BigDecimal.ROUND_HALF_UP); + report.setBaseCell("avg", i, String.valueOf(avg)); + + BigDecimal range=new BigDecimal(maxValue).subtract(new BigDecimal(minValue)); + BigDecimal tmpRange=range.setScale(3,BigDecimal.ROUND_HALF_UP); + report.setBaseCell("range", i, String.valueOf(tmpRange));//极差 + + } + + +// public static void main(String[] args) { +// List dd=new ArrayList<>(); +// dd.add(null); +// dd.add(-18.924); +// dd.add(-444.924); +// +// Optional max = dd.stream().filter(aDouble -> aDouble!=null).max(Comparator.comparingDouble(Double::doubleValue)); +// Double maxObj = max.get(); +// System.out.println(maxObj); +// +// Optional min = dd.stream().filter(aDouble -> aDouble!=null).min(Comparator.comparingDouble(Double::doubleValue)); +// Double minObj = min.get(); +// System.out.println(minObj); +// +// Double avgs = dd.stream().filter(reportData -> reportData!=null).mapToDouble(Double::doubleValue).average().orElse(0D); +// BigDecimal avg=new BigDecimal(String.valueOf(avgs)).setScale(3,BigDecimal.ROUND_HALF_UP); +// +// System.out.println(avg); +// } + + + public Report getMaxMinByDeviceCode(String deviceCode, String type, Integer accessRules, Date start, Date end) { + //检查数据是否正常并转化 + final QueryDateTypeEnum dtEnum = CommonUtil.checkType(type); + if(deviceCode==null || "".equals(deviceCode)){ + return null; + } + + if(dtEnum ==null){ + return null; + } + + //设置基础数据 + List signages=getSignages(deviceCode); + if(signages==null || signages.isEmpty()){ + return null; + } + //初始化报表 + Report report = new Report(); + report.initBaseReportMaxMin(signages.size(), start, end, dtEnum); + + //获取数据库某个站点不同时间要求的数据 + List timeDataList = listDataReport(start, end,dtEnum,deviceCode,accessRules,signages); + for(int i=0;i tmpList=CommonUtil.getReportDataBySignage(timeDataList,signage); + + dealMaxMin(report,i,tmpList); + + for (ReportData reportData : tmpList) { + String value = reportData.getVal(); +// if (value != null && !"-".equals(value) && !"".equals(value.trim())) { +// value = new BigDecimal(value).setScale(3, BigDecimal.ROUND_DOWN).toString(); +// } + + if(value == null){ + value = "-"; + } + + report.setBaseCell(reportData.getKeyStr(), i, value); + } + } + + return report; + } + + @Override + public Report getReportDataByDeviceCode(String deviceCode, String type, Integer accessRules, Date start, Date end) { + //检查数据是否正常并转化 + final QueryDateTypeEnum dtEnum = CommonUtil.checkType(type); + if(deviceCode==null || "".equals(deviceCode)){ + return null; + } + + if(dtEnum ==null){ + return null; + } + + //设置基础数据 + List signages=getSignages(deviceCode); + if(signages==null || signages.isEmpty()){ + return null; + } + //初始化报表 + Report report = new Report(); +// List> titles=new ArrayList<>(); +// for(AnalyzeInstanceFieldVO vo:signages){ +// Map title=new HashMap<>(); +// title.put(vo.getSignage(),vo.getFieldName()); +// titles.add(title); +// } +// report.setTitle(titles); + report.initBaseReport(signages.size(), start, end, dtEnum); + + //获取数据库某个站点不同时间要求的数据 + List timeDataList = listDataReport(start, end,dtEnum,deviceCode,accessRules,signages); + for(int i=0;i tmpList=CommonUtil.getReportDataBySignage(timeDataList,signage); + for (ReportData reportData : tmpList) { + String value = reportData.getVal(); +// if (value != null && !"-".equals(value) && !"".equals(value.trim())) { +// value = new BigDecimal(value).setScale(3, BigDecimal.ROUND_DOWN).toString(); +// } + + if(value == null){ + value = "-"; + } + + report.setBaseCell(reportData.getKeyStr(), i, value); + } + } + + return report; + } + + //查询多个code对应的同一个值 + List getDataByDeviceCodes(List deviceCodes,Date begin,Date end,String accessRules,String col){ + DeviceSinglePropsValueQuery query=new DeviceSinglePropsValueQuery(); + query.setBeginTime(begin); + query.setEndTime(end); + query.setDeviceCodes(deviceCodes); + query.setSignage(col); + query.setAccessRule(accessRules); + Result> result=analyseDataSearchClient.getValueOfBacthDeviceCode(query); + List datas=result.getData(); + return datas; + } + + + private List listDataReport(Date begin,Date endSt, QueryDateTypeEnum dtEnum, String deviceCode, Integer accessRules, List signages) { + Integer saveTimeType=2; + if(QueryDateTypeEnum.DAY.equals(dtEnum)){ + saveTimeType = 3; + } + if(QueryDateTypeEnum.MONTH.equals(dtEnum)){ + saveTimeType = 5; + } + if(QueryDateTypeEnum.YEAR.equals(dtEnum)){ + saveTimeType = 6; + } + + LocalDateTime start = LocalDateTime.ofInstant(begin.toInstant(), ZoneId.systemDefault()); + LocalDateTime end = LocalDateTime.ofInstant(endSt.toInstant(), ZoneId.systemDefault()); + + return getDataByDeviceCode(deviceCode,accessRules,saveTimeType,start,end,signages); + } + + + private List listDataReport(Date begin,Date endSt,QueryDateTypeEnum dtEnum,String deviceCode,Integer accessRules,String col) { + + + Integer saveTimeType=2; + if(QueryDateTypeEnum.DAY.equals(dtEnum)){ + saveTimeType = 3; + } + if(QueryDateTypeEnum.MONTH.equals(dtEnum)){ + saveTimeType = 5; + } + if(QueryDateTypeEnum.YEAR.equals(dtEnum)){ + saveTimeType = 6; + } + + LocalDateTime start = LocalDateTime.ofInstant(begin.toInstant(), ZoneId.systemDefault()); + LocalDateTime end = LocalDateTime.ofInstant(endSt.toInstant(), ZoneId.systemDefault()); + //saveTimeType 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时)3->、d(天)4->、w(周)5->、n(自然月)、6->y(自然年) + //accessRules 取数规则0=最早值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值) 6=最新值 + return getDataByDeviceCode(deviceCode, accessRules, saveTimeType, start, end, col); + } + + List getDataByDeviceCode(String deviceCode,Integer accessRules,Integer saveTimeType, + LocalDateTime start,LocalDateTime end,List signages){ + List reportData=new ArrayList<>(); + AnalyseCodeByAnalyseDataPO po=new AnalyseCodeByAnalyseDataPO(); + po.setDeviceCode(deviceCode); + + List signboardConditions=new ArrayList<>(); + + for(AnalyzeInstanceFieldVO vo:signages) { + AnalyzeDataConditionPO conditionPO = new AnalyzeDataConditionPO(); + conditionPO.setBeginTime(start); + conditionPO.setEndTime(end); + conditionPO.setSignages(vo.getSignage()); +// conditionPO.setKeepFigures(3); + conditionPO.setAccessRules(accessRules); + conditionPO.setSaveTimeType(saveTimeType); + conditionPO.setTimeInterval(1); + conditionPO.setFull(1); + signboardConditions.add(conditionPO); + } + + po.setSignboardConditions(signboardConditions); + + Result> result=analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po); + if(result==null){ + return reportData; + } + List datas=result.getData(); + if(datas==null || datas.isEmpty()){ + return reportData; + } + for(AnalyzeDataConditionVO vo:datas){ + List dataTaosVOs=vo.getList(); + for(AnalyseDataTaosVO vv:dataTaosVOs) { + ReportData data=new ReportData(); + data.setKeyStr(CommonUtil.getKeyBySaveTimeType(vv.getTs(),saveTimeType)); + data.setKeyDate(vv.getTs()); + data.setStcd(vo.getSignage());//测站变成属性值 + data.setVal(vv.getVal()); + data.setName(vo.getName()); + reportData.add(data); + } + } + return reportData; + } + + List getDataByDeviceCode(String deviceCode,Integer accessRules,Integer saveTimeType, + LocalDateTime start,LocalDateTime end,String col){ + List reportData=new ArrayList<>(); + AnalyseCodeByAnalyseDataPO po=new AnalyseCodeByAnalyseDataPO(); + po.setDeviceCode(deviceCode); + + List signboardConditions=new ArrayList<>(); + AnalyzeDataConditionPO conditionPO=new AnalyzeDataConditionPO(); + conditionPO.setBeginTime(start); + conditionPO.setEndTime(end); + conditionPO.setSignages(col); +// conditionPO.setKeepFigures(3); + conditionPO.setAccessRules(accessRules); + conditionPO.setSaveTimeType(saveTimeType); + conditionPO.setTimeInterval(1); + conditionPO.setFull(1); + signboardConditions.add(conditionPO); + po.setSignboardConditions(signboardConditions); + Result> result=analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po); + if(result==null){ + return reportData; + } + List datas=result.getData(); + if(datas==null || datas.isEmpty()){ + return reportData; + } + for(AnalyzeDataConditionVO vo:datas){ + List dataTaosVOs=vo.getList(); + for (AnalyseDataTaosVO vv : dataTaosVOs) { + if(vo.getSignage().equals(col)) { + ReportData data = new ReportData(); + data.setKeyStr(CommonUtil.getKeyBySaveTimeType(vv.getTs(), saveTimeType)); + data.setKeyDate(vv.getTs()); + data.setStcd(deviceCode); + data.setVal(vv.getVal()); + data.setName(vo.getName()); + reportData.add(data); + } + } + } + return reportData; + } + + //按时间范围求最大值、最小值 + public List queryMaxOrMin(String deviceCode, Date startTime, Date endTime, + Integer calcType, String col) { + List res=new ArrayList<>(); + + List signages=new ArrayList<>(); + signages.add(col); + ComputeBaseStrategyPO po=new ComputeBaseStrategyPO(); + LocalDateTime start = LocalDateTime.ofInstant(startTime.toInstant(), ZoneId.systemDefault()); + po.setBeginTime(start); + LocalDateTime end = LocalDateTime.ofInstant(endTime.toInstant(), ZoneId.systemDefault()); + po.setEndTime(end); + po.setAccessRules(calcType); + po.setDeviceCode(deviceCode); + po.setSignages(signages); + Result> result=analyseDataSearchClient.getComputeBaseStrategy(po); + if(result==null){ + return res; + } + List datas =result.getData(); + + if(datas!=null && !datas.isEmpty()){ + for(AnalyseDataTaosVO vo:datas) { + if(col.equals(vo.getSignage())) { + ReportData reportData=new ReportData(); + String val=vo.getVal(); + String tm=vo.getTs(); + reportData.setKeyStr(tm); + reportData.setStcd(deviceCode); + reportData.setVal(val); + res.add(reportData); + } + } + } + + return res; + } + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/FileUploadServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/FileUploadServiceImpl.java new file mode 100644 index 0000000..b9a269d --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/FileUploadServiceImpl.java @@ -0,0 +1,63 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.service.IFileUploadService; +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +@Service +public class FileUploadServiceImpl implements IFileUploadService { + @Value("${file.upload.path}") + String fileUploadPath; + + @Override + public String addFile(MultipartFile file,String childPath) { + MultipartFile[] files=new MultipartFile[1]; + files[0] = file; + return addFiles(files,childPath).get(0); + } + + @Override + public List addFiles(MultipartFile[] files,String childPath){ + List list=new ArrayList<>(); + String dirName = UUID.randomUUID().toString().replace("-", ""); + File uploadPath = new File(fileUploadPath, childPath); + uploadPath = new File(uploadPath, dirName); + try { + if(!uploadPath.exists()){ + uploadPath.mkdirs(); + } + for(MultipartFile file:files){ + saveFile(file, uploadPath); + list.add(File.separator+childPath+File.separator+dirName+File.separator+file.getOriginalFilename()); + } + return list; + }catch (IOException e){ + return list; + } + } + + /** + * 保存文件,如果后期有要求需要处理重名情况 + * + * @param file 待保存的文件 + * @param uploadPath 上传的路径 + * @throws IOException + */ + private void saveFile(MultipartFile file, File uploadPath) throws IOException { + String originalName = file.getOriginalFilename(); + File path = new File(uploadPath, originalName); + if(!path.exists()){ + path.createNewFile(); + } + FileUtils.copyInputStreamToFile(file.getInputStream(), path); + } + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TBuildingServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TBuildingServiceImpl.java new file mode 100644 index 0000000..104eddf --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TBuildingServiceImpl.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.entity.TBuilding; +import com.hnac.hzims.damsafety.mapper.TbBuildingMapper; +import com.hnac.hzims.damsafety.service.ITBuildingService; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +public class TBuildingServiceImpl extends BaseServiceImpl implements ITBuildingService { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TProjInfoServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TProjInfoServiceImpl.java new file mode 100644 index 0000000..496cf8f --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TProjInfoServiceImpl.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.entity.TProjInfo; +import com.hnac.hzims.damsafety.mapper.TbProjInfoMapper; +import com.hnac.hzims.damsafety.service.ITProjInfoService; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +public class TProjInfoServiceImpl extends BaseServiceImpl implements ITProjInfoService { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TSectionConfigServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TSectionConfigServiceImpl.java new file mode 100644 index 0000000..97e78ab --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/TSectionConfigServiceImpl.java @@ -0,0 +1,53 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.damsafety.entity.TSectionConfig; +import com.hnac.hzims.damsafety.mapper.TbSectionConfigMapper; +import com.hnac.hzims.damsafety.service.ITSectionConfigService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class TSectionConfigServiceImpl implements ITSectionConfigService { + + @Resource + TbSectionConfigMapper tbSectionConfigMapper; + + @Override + public IPage page(IPage page, LambdaQueryWrapper wrapper) { + return tbSectionConfigMapper.selectPage(page,wrapper); + } + + @Override + public List list(LambdaQueryWrapper wrapper) { + return tbSectionConfigMapper.selectList(wrapper); + } + + @Override + public TSectionConfig getOne(QueryWrapper wrapper) { + return tbSectionConfigMapper.selectOne(wrapper); + } + + @Override + public boolean save(TSectionConfig entity) { + int count=tbSectionConfigMapper.insert(entity); + return count>0; + } + + @Override + public boolean updateById(TSectionConfig entity) { + int count=tbSectionConfigMapper.updateById(entity); + return count>0; + } + + @Override + public boolean delete(Wrapper wrapper) { + int count=tbSectionConfigMapper.delete(wrapper); + return count>0; + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDamsBServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDamsBServiceImpl.java new file mode 100644 index 0000000..ad53a86 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDamsBServiceImpl.java @@ -0,0 +1,57 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.damsafety.entity.WrpDamsB; +import com.hnac.hzims.damsafety.mapper.WrpDamsBMapper; +import com.hnac.hzims.damsafety.service.IWrpDamsBService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class WrpDamsBServiceImpl implements IWrpDamsBService { + + @Resource + WrpDamsBMapper wrpDamsBMapper; + + @Override + public IPage page(IPage page, LambdaQueryWrapper wrapper) { + return wrpDamsBMapper.selectPage(page,wrapper); + } + + @Override + public List list(LambdaQueryWrapper wrapper) { + return wrpDamsBMapper.selectList(wrapper); + } + + @Override + public WrpDamsB getOne(QueryWrapper wrapper) { + return wrpDamsBMapper.selectOne(wrapper); + } + + @Override + public boolean save(WrpDamsB entity) { + int count=wrpDamsBMapper.insert(entity); + return count>0; + } + + @Override + public boolean updateById(WrpDamsB entity) { + LambdaUpdateWrapper wrapper=new LambdaUpdateWrapper(); + wrapper.eq(WrpDamsB::getDamscd,entity.getDamscd()); + int count=wrpDamsBMapper.update(entity,wrapper); + return count>0; + } + + @Override + public boolean delete(Wrapper wrapper) { + int count=wrpDamsBMapper.delete(wrapper); + return count>0; + } + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrhrdsmpServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrhrdsmpServiceImpl.java new file mode 100644 index 0000000..a8b2529 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrhrdsmpServiceImpl.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrhrdsmp; +import com.hnac.hzims.damsafety.mapper.WrpDfrSrhrdsmpMapper; +import com.hnac.hzims.damsafety.service.IWrpDfrSrhrdsmpService; +import com.hnac.hzims.damsafety.util.DealSectionUtil; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service +public class WrpDfrSrhrdsmpServiceImpl extends BaseServiceImpl implements IWrpDfrSrhrdsmpService { + @Resource + WrpDfrSrhrdsmpMapper wrpDfrSrhrdsmpMapper; + + @Override + public List> section(String deptId,String rscd) { + List> list=wrpDfrSrhrdsmpMapper.section(deptId,rscd); + return DealSectionUtil.getSection(list); + } + + @Override + public List> getSection(String deptId,String rscd) { + List> list=wrpDfrSrhrdsmpMapper.section(deptId,rscd); + return list; + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrvrdsbpServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrvrdsbpServiceImpl.java new file mode 100644 index 0000000..15160cc --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrvrdsbpServiceImpl.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsbp; +import com.hnac.hzims.damsafety.mapper.WrpDfrSrvrdsbpMapper; +import com.hnac.hzims.damsafety.service.IWrpDfrSrvrdsbpService; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +public class WrpDfrSrvrdsbpServiceImpl extends BaseServiceImpl implements IWrpDfrSrvrdsbpService { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrvrdsmpServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrvrdsmpServiceImpl.java new file mode 100644 index 0000000..9907aa7 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpDfrSrvrdsmpServiceImpl.java @@ -0,0 +1,28 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsmp; +import com.hnac.hzims.damsafety.mapper.WrpDfrSrvrdsmpMapper; +import com.hnac.hzims.damsafety.service.IWrpDfrSrvrdsmpService; +import com.hnac.hzims.damsafety.util.DealSectionUtil; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service +public class WrpDfrSrvrdsmpServiceImpl extends BaseServiceImpl implements IWrpDfrSrvrdsmpService { + @Resource + WrpDfrSrvrdsmpMapper wrpDfrSrvrdsmpMapper; + @Override + public List> section(String deptId,String rscd) { + List> list=wrpDfrSrvrdsmpMapper.section(deptId,rscd); + return DealSectionUtil.getSection(list); + } + + @Override + public List> getSection(String deptId, String rscd) { + return wrpDfrSrvrdsmpMapper.section(deptId,rscd); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSectionBServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSectionBServiceImpl.java new file mode 100644 index 0000000..1d4b28b --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSectionBServiceImpl.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright Example, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * Example, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.entity.WrpSectionB; +import com.hnac.hzims.damsafety.mapper.WrpSectionBMapper; +import com.hnac.hzims.damsafety.service.IWrpSectionBService; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * 服务实现类 + * @author Chill + */ +@Service +public class WrpSectionBServiceImpl extends BaseServiceImpl implements IWrpSectionBService { +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgPztbServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgPztbServiceImpl.java new file mode 100644 index 0000000..1eeca99 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgPztbServiceImpl.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.entity.WrpSpgPztb; +import com.hnac.hzims.damsafety.mapper.WrpSpgPztbMapper; +import com.hnac.hzims.damsafety.service.IWrpSpgPztbService; +import com.hnac.hzims.damsafety.util.DealSectionUtil; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service +public class WrpSpgPztbServiceImpl extends BaseServiceImpl implements IWrpSpgPztbService { + + @Resource + WrpSpgPztbMapper wrpSpgPztbMapper; + + @Override + public List> section(String deptId,String rscd) { + List> list=wrpSpgPztbMapper.section(deptId,rscd); + return DealSectionUtil.getSection(list); + } + + @Override + public List> getSection(String deptId, String rscd) { + return wrpSpgPztbMapper.section(deptId,rscd); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgSpprmpServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgSpprmpServiceImpl.java new file mode 100644 index 0000000..c8c5a5e --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgSpprmpServiceImpl.java @@ -0,0 +1,32 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.entity.WrpSpgSpprmp; +import com.hnac.hzims.damsafety.mapper.WrpSpgSpprmpMapper; +import com.hnac.hzims.damsafety.service.IWrpSpgSpprmpService; +import com.hnac.hzims.damsafety.util.DealSectionUtil; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service +public class WrpSpgSpprmpServiceImpl extends BaseServiceImpl implements IWrpSpgSpprmpService { + + @Resource + WrpSpgSpprmpMapper wrpSpgSpprmpMapper; + + @Override + public List> section(String deptId,String rscd) { + List> list=wrpSpgSpprmpMapper.section(deptId,rscd); + return DealSectionUtil.getSection(list); + } + + @Override + public List> getSection(String deptId, String rscd) { + return wrpSpgSpprmpMapper.section(deptId,rscd); + } + +} + diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgSpqnmpServiceImpl.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgSpqnmpServiceImpl.java new file mode 100644 index 0000000..2ee717f --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/service/impl/WrpSpgSpqnmpServiceImpl.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.damsafety.service.impl; + +import com.hnac.hzims.damsafety.entity.WrpSpgSpqnmp; +import com.hnac.hzims.damsafety.mapper.WrpSpgSpqnmpMapper; +import com.hnac.hzims.damsafety.service.IWrpSpgSpqnmpService; +import com.hnac.hzims.damsafety.util.DealSectionUtil; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service +public class WrpSpgSpqnmpServiceImpl extends BaseServiceImpl implements IWrpSpgSpqnmpService { + @Resource + WrpSpgSpqnmpMapper wrpSpgSpqnmpMapper; + + @Override + public List> section(String deptId,String rscd) { + List> list=wrpSpgSpqnmpMapper.section(deptId,rscd); + return DealSectionUtil.getSection(list); + } + + @Override + public List> getSection(String deptId,String rscd) { + List> list=wrpSpgSpqnmpMapper.section(deptId,rscd); + return DealSectionUtil.getSection(list); + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/util/DealSectionUtil.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/util/DealSectionUtil.java new file mode 100644 index 0000000..c6b9dbd --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/util/DealSectionUtil.java @@ -0,0 +1,48 @@ +package com.hnac.hzims.damsafety.util; + +import java.util.*; + +public class DealSectionUtil { + public static String getDeviceCode(List> data){ + StringBuilder sb=new StringBuilder(); + for(Map dd:data){ + String stcd=String.valueOf(dd.get("stcd")); + if("".equals(sb.toString())){ + sb.append(stcd); + }else{ + sb.append(","+stcd); + } + } + return sb.toString(); + } + + public static List> getSection(List> list){ + List> res=new ArrayList<>(); + Map>> map = new LinkedHashMap<>(); + for(Map ll:list) { + String damcd=String.valueOf(ll.get("damcd")); + List> tmpList=map.get(damcd); + if(tmpList!=null && !tmpList.isEmpty()) { + tmpList.add(ll); + map.put(damcd, tmpList); + }else{ + tmpList = new ArrayList<>(); + tmpList.add(ll); + map.put(damcd, tmpList); + } + } + + for (Map.Entry>> m : map.entrySet()) { + List> data= m.getValue(); + Map sj=new HashMap<>(); + sj.put("damnm",data.get(0).get("damnm")); + sj.put("rscd",data.get(0).get("rscd")); + sj.put("damcd",m.getKey()); + sj.put("deviceCode",getDeviceCode(data)); + res.add(sj); + } + + return res; + } + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/util/ParamUtil.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/util/ParamUtil.java new file mode 100644 index 0000000..ef37a3d --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/util/ParamUtil.java @@ -0,0 +1,177 @@ +package com.hnac.hzims.damsafety.util; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hnac.hzims.damsafety.entity.*; + +import java.util.Map; + +public class ParamUtil { + public static LambdaQueryWrapper conditionWrpSectionB(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("rscd")!=null) { + wrapper.like(WrpSectionB::getRscd,param.get("rscd")); + } + if(param.get("buildingId")!=null) { + wrapper.eq(WrpSectionB::getBuildingId,param.get("buildingId")); + } + if(param.get("damcd")!=null) { + wrapper.like(WrpSectionB::getDamcd,param.get("damcd")); + } + + if(param.get("damnm")!=null) { + wrapper.like(WrpSectionB::getDamnm,param.get("damnm")); + } + + + if(param.get("wallType")!=null) { + wrapper.eq(WrpSectionB::getWallType,param.get("wallType")); + } + return wrapper; + } + + public static LambdaQueryWrapper conditionTBuilding(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("rscd")!=null) { + wrapper.like(TBuilding::getRscd,param.get("rscd")); + } + if(param.get("name")!=null) { + wrapper.like(TBuilding::getName,param.get("name")); + } + return wrapper; + } + + + public static LambdaQueryWrapper conditionTProjInfo(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("rscd")!=null) { + wrapper.like(TProjInfo::getRscd,param.get("rscd")); + } + if(param.get("projName")!=null) { + wrapper.like(TProjInfo::getProjName,param.get("projName")); + } + if(param.get("projCode")!=null) { + wrapper.like(TProjInfo::getProjCode,param.get("projCode")); + } + return wrapper; + } + + + public static LambdaQueryWrapper conditionTSectionConfig(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("stcd")!=null) { + wrapper.like(TSectionConfig::getStcd,param.get("stcd")); + } + if(param.get("sectionNo")!=null) { + wrapper.like(TSectionConfig::getSectionNo,param.get("sectionNo")); + } + return wrapper; + } + + public static LambdaQueryWrapper conditionWrpDamsB(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("damcd")!=null) { + wrapper.like(WrpDamsB::getDamcd,param.get("damcd")); + } + if(param.get("damscd")!=null) { + wrapper.like(WrpDamsB::getDamscd,param.get("damscd")); + } + if(param.get("damsnm")!=null) { + wrapper.like(WrpDamsB::getDamscd,param.get("damsnm")); + } + return wrapper; + } + + public static LambdaQueryWrapper conditionWrpDfrSrhrdsmp(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("damcd")!=null) { + wrapper.like(WrpDfrSrhrdsmp::getDamcd,param.get("damcd")); + } + if(param.get("stcd")!=null) { + wrapper.like(WrpDfrSrhrdsmp::getStcd,param.get("stcd")); + } + if(param.get("mpcd")!=null) { + wrapper.like(WrpDfrSrhrdsmp::getMpcd,param.get("mpcd")); + } + return wrapper; + } + + public static LambdaQueryWrapper conditionWrpDfrSrvrdsbp(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("rscd")!=null) { + wrapper.like(WrpDfrSrvrdsbp::getRscd,param.get("rscd")); + } + if(param.get("hycncd")!=null) { + wrapper.eq(WrpDfrSrvrdsbp::getHycncd,param.get("hycncd")); + } + if(param.get("bpcd")!=null) { + wrapper.like(WrpDfrSrvrdsbp::getBpcd,param.get("bpcd")); + } + if(param.get("bptp")!=null) { + wrapper.like(WrpDfrSrvrdsbp::getBptp,param.get("bptp")); + } + return wrapper; + } + + + public static LambdaQueryWrapper conditionWrpDfrSrvrdsmp(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("damcd")!=null) { + wrapper.like(WrpDfrSrvrdsmp::getDamcd,param.get("damcd")); + } + if(param.get("stcd")!=null) { + wrapper.like(WrpDfrSrvrdsmp::getStcd,param.get("stcd")); + } + if(param.get("mpcd")!=null) { + wrapper.like(WrpDfrSrvrdsmp::getMpcd,param.get("mpcd")); + } + return wrapper; + } + + public static LambdaQueryWrapper conditionWrpSpgPztb(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("damcd")!=null) { + wrapper.like(WrpSpgPztb::getDamcd,param.get("damcd")); + } + if(param.get("stcd")!=null) { + wrapper.like(WrpSpgPztb::getStcd,param.get("stcd")); + } + if(param.get("mpcd")!=null) { + wrapper.like(WrpSpgPztb::getMpcd,param.get("mpcd")); + } + return wrapper; + } + + public static LambdaQueryWrapper conditionWrpSpgSpprmp(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("damcd")!=null) { + wrapper.like(WrpSpgSpprmp::getDamcd,param.get("damcd")); + } + if(param.get("stcd")!=null) { + wrapper.like(WrpSpgSpprmp::getStcd,param.get("stcd")); + } + if(param.get("mpcd")!=null) { + wrapper.like(WrpSpgSpprmp::getMpcd,param.get("mpcd")); + } + if(param.get("ch")!=null) { + wrapper.like(WrpSpgSpprmp::getCh,param.get("ch")); + } + return wrapper; + } + + + public static LambdaQueryWrapper conditionWrpSpgSpqnmp(Map param){ + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + if(param.get("damcd")!=null) { + wrapper.like(WrpSpgSpqnmp::getDamcd,param.get("damcd")); + } + if(param.get("stcd")!=null) { + wrapper.like(WrpSpgSpqnmp::getStcd,param.get("stcd")); + } + if(param.get("mpcd")!=null) { + wrapper.like(WrpSpgSpqnmp::getMpcd,param.get("mpcd")); + } + return wrapper; + } + + +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/TBuildingWrapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/TBuildingWrapper.java new file mode 100644 index 0000000..fa206c6 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/TBuildingWrapper.java @@ -0,0 +1,24 @@ +package com.hnac.hzims.damsafety.wrapper; + +import com.hnac.hzims.damsafety.entity.TBuilding; +import com.hnac.hzims.damsafety.vo.TBuildingVo; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + + +import java.util.Objects; + +public class TBuildingWrapper extends BaseEntityWrapper { + public TBuildingWrapper() { + } + + public static TBuildingWrapper build() { + return new TBuildingWrapper(); + } + + @Override + public TBuildingVo entityVO(TBuilding entity) { + TBuildingVo tBuildingVo = Objects.requireNonNull(BeanUtil.copy(entity, TBuildingVo.class)); + return tBuildingVo; + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/TProjInfoWrapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/TProjInfoWrapper.java new file mode 100644 index 0000000..42e50c8 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/TProjInfoWrapper.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.damsafety.wrapper; + +import com.hnac.hzims.damsafety.entity.TProjInfo; +import com.hnac.hzims.damsafety.vo.TProjInfoVo; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + +import java.util.Objects; + +public class TProjInfoWrapper extends BaseEntityWrapper { + public TProjInfoWrapper() { + } + + public static TProjInfoWrapper build() { + return new TProjInfoWrapper(); + } + + @Override + public TProjInfoVo entityVO(TProjInfo entity) { + if(entity == null){ + return null; + } + TProjInfoVo tProjInfoVo = Objects.requireNonNull(BeanUtil.copy(entity, TProjInfoVo.class)); + return tProjInfoVo; + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrhrdsmpWrapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrhrdsmpWrapper.java new file mode 100644 index 0000000..d506247 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrhrdsmpWrapper.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.damsafety.wrapper; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrhrdsmp; +import com.hnac.hzims.damsafety.vo.WrpDfrSrhrdsmpVo; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + +import java.util.Objects; + +public class WrpDfrSrhrdsmpWrapper extends BaseEntityWrapper { + public WrpDfrSrhrdsmpWrapper() { + } + + public static WrpDfrSrhrdsmpWrapper build() { + return new WrpDfrSrhrdsmpWrapper(); + } + + @Override + public WrpDfrSrhrdsmpVo entityVO(WrpDfrSrhrdsmp entity) { + if(entity == null){ + return null; + } + WrpDfrSrhrdsmpVo wrpDfrSrhrdsmpVo = Objects.requireNonNull(BeanUtil.copy(entity, WrpDfrSrhrdsmpVo.class)); + + return wrpDfrSrhrdsmpVo; + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrvrdsbpWrapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrvrdsbpWrapper.java new file mode 100644 index 0000000..b1f5417 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrvrdsbpWrapper.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.damsafety.wrapper; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsbp; +import com.hnac.hzims.damsafety.vo.WrpDfrSrvrdsbpVo; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + +import java.util.Objects; + +public class WrpDfrSrvrdsbpWrapper extends BaseEntityWrapper { + public WrpDfrSrvrdsbpWrapper() { + } + + public static WrpDfrSrvrdsbpWrapper build() { + return new WrpDfrSrvrdsbpWrapper(); + } + + @Override + public WrpDfrSrvrdsbpVo entityVO(WrpDfrSrvrdsbp entity) { + if(entity == null){ + return null; + } + WrpDfrSrvrdsbpVo wrpDfrSrvrdsbpVo = Objects.requireNonNull(BeanUtil.copy(entity, WrpDfrSrvrdsbpVo.class)); + + return wrpDfrSrvrdsbpVo; + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrvrdsmpWrapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrvrdsmpWrapper.java new file mode 100644 index 0000000..5e47e27 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpDfrSrvrdsmpWrapper.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.damsafety.wrapper; + +import com.hnac.hzims.damsafety.entity.WrpDfrSrvrdsmp; +import com.hnac.hzims.damsafety.vo.WrpDfrSrvrdsmpVo; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + +import java.util.Objects; + +public class WrpDfrSrvrdsmpWrapper extends BaseEntityWrapper { + public WrpDfrSrvrdsmpWrapper() { + } + + public static WrpDfrSrvrdsmpWrapper build() { + return new WrpDfrSrvrdsmpWrapper(); + } + + @Override + public WrpDfrSrvrdsmpVo entityVO(WrpDfrSrvrdsmp entity) { + if(entity == null){ + return null; + } + WrpDfrSrvrdsmpVo wrpDfrSrvrdsmpVo = Objects.requireNonNull(BeanUtil.copy(entity, WrpDfrSrvrdsmpVo.class)); + + return wrpDfrSrvrdsmpVo; + } +} \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSectionBWrapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSectionBWrapper.java new file mode 100644 index 0000000..77cabaa --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSectionBWrapper.java @@ -0,0 +1,28 @@ +package com.hnac.hzims.damsafety.wrapper; + +import com.hnac.hzims.damsafety.entity.WrpSectionB; +import com.hnac.hzims.damsafety.vo.WrpSectionBVO; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + +import java.util.Objects; + +public class WrpSectionBWrapper extends BaseEntityWrapper { + public WrpSectionBWrapper() { + } + + public static WrpSectionBWrapper build() { + return new WrpSectionBWrapper(); + } + + @Override + public WrpSectionBVO entityVO(WrpSectionB entity) { + if(entity == null){ + return null; + } + WrpSectionBVO wrpSectionBVO = Objects.requireNonNull(BeanUtil.copy(entity, WrpSectionBVO.class)); + //测点集合 + wrpSectionBVO.setPoints(null); + return wrpSectionBVO; + } +} diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgPztbWrapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgPztbWrapper.java new file mode 100644 index 0000000..91e13ea --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgPztbWrapper.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.damsafety.wrapper; + +import com.hnac.hzims.damsafety.entity.WrpSpgPztb; +import com.hnac.hzims.damsafety.vo.WrpSpgPztbVo; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + +import java.util.Objects; + +public class WrpSpgPztbWrapper extends BaseEntityWrapper { + public WrpSpgPztbWrapper() { + } + + public static WrpSpgPztbWrapper build() { + return new WrpSpgPztbWrapper(); + } + + @Override + public WrpSpgPztbVo entityVO(WrpSpgPztb entity) { + if(entity == null){ + return null; + } + WrpSpgPztbVo wrpSpgPztbVo = Objects.requireNonNull(BeanUtil.copy(entity, WrpSpgPztbVo.class)); + + return wrpSpgPztbVo; + } +} \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgSpprmpWrapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgSpprmpWrapper.java new file mode 100644 index 0000000..f34f6f8 --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgSpprmpWrapper.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.damsafety.wrapper; + +import com.hnac.hzims.damsafety.entity.WrpSpgSpprmp; +import com.hnac.hzims.damsafety.vo.WrpSpgSpprmpVo; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + +import java.util.Objects; + +public class WrpSpgSpprmpWrapper extends BaseEntityWrapper { + public WrpSpgSpprmpWrapper() { + } + + public static WrpSpgSpprmpWrapper build() { + return new WrpSpgSpprmpWrapper(); + } + + @Override + public WrpSpgSpprmpVo entityVO(WrpSpgSpprmp entity) { + if(entity == null){ + return null; + } + WrpSpgSpprmpVo wrpSpgSpprmpVo = Objects.requireNonNull(BeanUtil.copy(entity, WrpSpgSpprmpVo.class)); + + return wrpSpgSpprmpVo; + } +} \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgSpqnmpWrapper.java b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgSpqnmpWrapper.java new file mode 100644 index 0000000..bbac35c --- /dev/null +++ b/hzims-service/dam-safety/src/main/java/com/hnac/hzims/damsafety/wrapper/WrpSpgSpqnmpWrapper.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.damsafety.wrapper; + +import com.hnac.hzims.damsafety.entity.WrpSpgSpqnmp; +import com.hnac.hzims.damsafety.vo.WrpSpgSpqnmpVo; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; + +import java.util.Objects; + +public class WrpSpgSpqnmpWrapper extends BaseEntityWrapper { + public WrpSpgSpqnmpWrapper() { + } + + public static WrpSpgSpqnmpWrapper build() { + return new WrpSpgSpqnmpWrapper(); + } + + @Override + public WrpSpgSpqnmpVo entityVO(WrpSpgSpqnmp entity) { + if(entity == null){ + return null; + } + WrpSpgSpqnmpVo wrpSpgSpqnmpVo = Objects.requireNonNull(BeanUtil.copy(entity, WrpSpgSpqnmpVo.class)); + + return wrpSpgSpqnmpVo; + } +} \ No newline at end of file diff --git a/hzims-service/dam-safety/src/main/resources/application-dev.yml b/hzims-service/dam-safety/src/main/resources/application-dev.yml new file mode 100644 index 0000000..50a4ea7 --- /dev/null +++ b/hzims-service/dam-safety/src/main/resources/application-dev.yml @@ -0,0 +1,30 @@ +#服务器端口 +server: + port: 8200 + +#数据源配置 +#spring: +# datasource: +# url: ${blade.datasource.dev.url} +# username: ${blade.datasource.dev.username} +# password: ${blade.datasource.dev.password} + +spring: + #排除DruidDataSourceAutoConfigure + autoconfigure: + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure + datasource: + dynamic: + #设置默认的数据源或者数据源组,默认值即为master + primary: master + datasource: + master: + url: jdbc:mysql://127.0.0.1:3306/equipment?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true + username: root + password: 123456 + slave: + url: jdbc:mysql://127.0.0.1:3306/equipment?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true + username: root + password: 123456 +demo: + name: aaa diff --git a/hzims-service/dam-safety/src/main/resources/application-prod.yml b/hzims-service/dam-safety/src/main/resources/application-prod.yml new file mode 100644 index 0000000..da89262 --- /dev/null +++ b/hzims-service/dam-safety/src/main/resources/application-prod.yml @@ -0,0 +1,28 @@ +#服务器端口 +server: + port: 8200 + +#数据源配置 +#spring: +# datasource: +# url: ${blade.datasource.prod.url} +# username: ${blade.datasource.prod.username} +# password: ${blade.datasource.prod.password} + +spring: + #排除DruidDataSourceAutoConfigure + autoconfigure: + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure + datasource: + dynamic: + #设置默认的数据源或者数据源组,默认值即为master + primary: master + datasource: + master: + url: ${blade.datasource.demo.master.url} + username: ${blade.datasource.demo.master.username} + password: ${blade.datasource.demo.master.password} + slave: + url: ${blade.datasource.demo.slave.url} + username: ${blade.datasource.demo.slave.username} + password: ${blade.datasource.demo.slave.password} diff --git a/hzims-service/dam-safety/src/main/resources/application.yml b/hzims-service/dam-safety/src/main/resources/application.yml new file mode 100644 index 0000000..0952a13 --- /dev/null +++ b/hzims-service/dam-safety/src/main/resources/application.yml @@ -0,0 +1,13 @@ +#mybatis-plus配置 +mybatis-plus: + mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.hnac.hzims.**.entity + +#swagger扫描路径配置 +swagger: + base-packages: + - org.springbalde + - com.hnac + + diff --git a/hzims-service/pom.xml b/hzims-service/pom.xml index 1f3e83c..cac61c1 100644 --- a/hzims-service/pom.xml +++ b/hzims-service/pom.xml @@ -29,6 +29,7 @@ hzims-scheduled base-info digital-twin-display + dam-safety