소스 검색

内蒙水资源平台版本提交

dylan 2 년 전
부모
커밋
911d2b2720
100개의 변경된 파일9698개의 추가작업 그리고 0개의 파일을 삭제
  1. 600 0
      NMSZYYWXT/doc/galaxy.sql
  2. 321 0
      NMSZYYWXT/pom.xml
  3. 32 0
      NMSZYYWXT/src/main/java/org/springblade/Application.java
  4. 28 0
      NMSZYYWXT/src/main/java/org/springblade/config/GalaxyConfiguration.java
  5. 41 0
      NMSZYYWXT/src/main/java/org/springblade/config/MultipartConfig.java
  6. 85 0
      NMSZYYWXT/src/main/java/org/springblade/constant/BusinessConstant.java
  7. 21 0
      NMSZYYWXT/src/main/java/org/springblade/constant/DictBusinessConstant.java
  8. 5 0
      NMSZYYWXT/src/main/java/org/springblade/constant/MyAppConstant.java
  9. 43 0
      NMSZYYWXT/src/main/java/org/springblade/constant/RedisBusinessConstant.java
  10. 93 0
      NMSZYYWXT/src/main/java/org/springblade/enums/EquipmentActiveEnum.java
  11. 93 0
      NMSZYYWXT/src/main/java/org/springblade/enums/EquipmentStatusEnum.java
  12. 108 0
      NMSZYYWXT/src/main/java/org/springblade/enums/GenderEnum.java
  13. 103 0
      NMSZYYWXT/src/main/java/org/springblade/enums/IsValidEnum.java
  14. 93 0
      NMSZYYWXT/src/main/java/org/springblade/enums/OrderCloseEnum.java
  15. 93 0
      NMSZYYWXT/src/main/java/org/springblade/enums/OrderConfirmEnum.java
  16. 96 0
      NMSZYYWXT/src/main/java/org/springblade/enums/OrderFromEnum.java
  17. 104 0
      NMSZYYWXT/src/main/java/org/springblade/enums/OrderStatusEnum.java
  18. 93 0
      NMSZYYWXT/src/main/java/org/springblade/enums/RtuReportStatusEnum.java
  19. 100 0
      NMSZYYWXT/src/main/java/org/springblade/enums/SiteOwnerTypeEnum.java
  20. 107 0
      NMSZYYWXT/src/main/java/org/springblade/enums/SzyFlowRateMetadataEnum.java
  21. 95 0
      NMSZYYWXT/src/main/java/org/springblade/enums/SzyWaterLevelMetadataEnum.java
  22. 125 0
      NMSZYYWXT/src/main/java/org/springblade/enums/WarnKindEnum.java
  23. 93 0
      NMSZYYWXT/src/main/java/org/springblade/enums/WarningActiveEnum.java
  24. 94 0
      NMSZYYWXT/src/main/java/org/springblade/enums/WarningStatusEnum.java
  25. 104 0
      NMSZYYWXT/src/main/java/org/springblade/enums/WhetherEnum.java
  26. 377 0
      NMSZYYWXT/src/main/java/org/springblade/jobtask/DataShareProcessor.java
  27. 337 0
      NMSZYYWXT/src/main/java/org/springblade/jobtask/RainDataCountProcessor.java
  28. 725 0
      NMSZYYWXT/src/main/java/org/springblade/jobtask/ReportCountProcessor.java
  29. 279 0
      NMSZYYWXT/src/main/java/org/springblade/jobtask/RtuUpCountProcessor.java
  30. 40 0
      NMSZYYWXT/src/main/java/org/springblade/jobtask/TaskManager.java
  31. 416 0
      NMSZYYWXT/src/main/java/org/springblade/jobtask/WarnCheckProcessor.java
  32. 30 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/controller/BaseInfoDictController.java
  33. 75 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/entity/DictInfoEntity.java
  34. 23 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/mapper/DictInfoMapper.java
  35. 32 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/mapper/DictInfoMapper.xml
  36. 22 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/service/IBaseInfoDictService.java
  37. 30 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/service/impl/BaseInfoDictServiceImpl.java
  38. 127 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/controller/MonitorPointController.java
  39. 42 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/dto/MonitorPointInfoDTO.java
  40. 93 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/entity/MonitorPointInfoEntity.java
  41. 58 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/entity/MonitorPointRelEntity.java
  42. 30 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointMapper.java
  43. 83 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointMapper.xml
  44. 30 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointRelMapper.java
  45. 16 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointRelMapper.xml
  46. 36 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/IMonitorPointRelService.java
  47. 47 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/IMonitorPointService.java
  48. 58 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/impl/MonitorPointRelServiceImpl.java
  49. 63 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/impl/MonitorPointServiceImpl.java
  50. 61 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/vo/MonitorPointInfoVO.java
  51. 139 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/wrapper/MonitorPointWrapper.java
  52. 202 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/controller/MonitorSiteController.java
  53. 42 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/dto/MonitorSiteInfoDTO.java
  54. 164 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/entity/MonitorSiteInfoEntity.java
  55. 62 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/entity/MonitorSiteRelEntity.java
  56. 49 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteMapper.java
  57. 122 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteMapper.xml
  58. 24 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteRelMapper.java
  59. 14 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteRelMapper.xml
  60. 29 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/service/IMonitorSiteRelService.java
  61. 62 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/service/IMonitorSiteService.java
  62. 42 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/service/impl/MonitorSiteRelServiceImpl.java
  63. 123 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/service/impl/MonitorSiteServiceImpl.java
  64. 49 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/vo/MonitorSiteInfoVO.java
  65. 106 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/wrapper/MonitorSiteWrapper.java
  66. 303 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/controller/BaseOrgController.java
  67. 30 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/dto/OrgInfoDTO.java
  68. 45 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/entity/DeptRegionEntity.java
  69. 73 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/entity/OrgInfoEntity.java
  70. 49 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/entity/OrgTreeNodeEntity.java
  71. 29 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/mapper/BaseOrgMapper.java
  72. 66 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/mapper/BaseOrgMapper.xml
  73. 23 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptRegionMapper.java
  74. 20 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptRegionMapper.xml
  75. 28 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/service/IBaseOrgService.java
  76. 22 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/service/IDeptRegionService.java
  77. 41 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/service/impl/BaseOrgServiceImpl.java
  78. 29 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/service/impl/DeptRegionServiceImpl.java
  79. 56 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/vo/OrgInfoVO.java
  80. 78 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/wrapper/OrgInfoWrapper.java
  81. 255 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/controller/ProjectBaseInfoController.java
  82. 111 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/entity/ProjectInfoEntity.java
  83. 65 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/entity/ProjectTreeNodeEntity.java
  84. 51 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/entity/ProjectWarningSettingEntity.java
  85. 34 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/mapper/ProjectInfoMapper.java
  86. 55 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/mapper/ProjectInfoMapper.xml
  87. 22 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/mapper/ProjectWarningSettingMapper.java
  88. 15 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/mapper/ProjectWarningSettingMapper.xml
  89. 48 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/service/IProjectBaseInfoService.java
  90. 22 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/service/IProjectWarningSettingService.java
  91. 50 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/service/impl/ProjectBaseInfoServiceImpl.java
  92. 25 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/service/impl/ProjectWarningSettingServiceImpl.java
  93. 45 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/vo/ProjectInfoVO.java
  94. 62 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/wrapper/ProjectInfoWrapper.java
  95. 550 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/controller/BaseInfoRegionController.java
  96. 55 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/dto/RegionInfoDTO.java
  97. 69 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/entity/OrgRegionInfoEntity.java
  98. 69 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/entity/RegionInfoEntity.java
  99. 52 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/entity/RegionTreeNodeEntity.java
  100. 22 0
      NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/mapper/OrgRegionInfoMapper.java

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 600 - 0
NMSZYYWXT/doc/galaxy.sql


+ 321 - 0
NMSZYYWXT/pom.xml

@@ -0,0 +1,321 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.springblade.xamszyywxt</groupId>
+    <artifactId>nmszyywxt</artifactId>
+    <name>${project.artifactId}</name>
+    <packaging>jar</packaging>
+    <version>1.0-SNAPSHOT</version>
+    <description>系统平台-内蒙水资源管理平台</description>
+
+    <properties>
+        <bladex.project.id>blade-api</bladex.project.id>
+        <bladex.project.version>2.9.1.RELEASE</bladex.project.version>
+
+        <java.version>1.8</java.version>
+        <maven.plugin.version>3.8.1</maven.plugin.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+        <spring.boot.version>2.3.12.RELEASE</spring.boot.version>
+        <spring.platform.version>Cairo-SR8</spring.platform.version>
+        <!--<poi.version>4.1.1</poi.version>-->
+        <!--<easypoi.version>4.1.2</easypoi.version>-->
+        <revision>3.1.1</revision>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springblade.platform</groupId>
+                <artifactId>blade-bom</artifactId>
+                <version>${bladex.project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>io.spring.platform</groupId>
+                <artifactId>platform-bom</artifactId>
+                <version>${spring.platform.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
+        </dependencies>
+    </dependencyManagement>
+
+
+    <dependencies>
+        <!-- lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>edu.ucar</groupId>
+            <artifactId>netcdfAll</artifactId>
+            <version>5.5.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>BladeX-Boot-Common</artifactId>
+            <version>${bladex.project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springblade</groupId>
+                    <artifactId>blade-starter-report</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.springblade</groupId>
+                    <artifactId>blade-starter-flowable</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.springblade</groupId>
+                    <artifactId>blade-starter-oss</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>BladeX-Boot-Base</artifactId>
+            <version>${bladex.project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springblade</groupId>
+                    <artifactId>BladeX-Boot-Common</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <!--<dependency>-->
+        <!--<groupId>org.springblade</groupId>-->
+        <!--<artifactId>BladeX-Boot-Flow</artifactId>-->
+        <!--<version>${bladex.project.version}</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+        <!--<groupId>org.springframework.boot</groupId>-->
+        <!--<artifactId>spring-boot-starter-amqp</artifactId>-->
+        <!--</dependency>-->
+        <dependency>
+            <groupId>org.springframework.kafka</groupId>
+            <artifactId>spring-kafka</artifactId>
+        </dependency>
+        <!--<dependency>-->
+        <!--<groupId>org.springframework.kafka</groupId>-->
+        <!--<artifactId>spring-kafka</artifactId>-->
+        <!--<version>2.5.14.RELEASE</version>-->
+        <!--<exclusions>-->
+        <!--<exclusion>-->
+        <!--<groupId>org.apache.kafka</groupId>-->
+        <!--<artifactId>kafka-clients</artifactId>-->
+        <!--</exclusion>-->
+        <!--</exclusions>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+        <!--<groupId>org.apache.kafka</groupId>-->
+        <!--<artifactId>kafka-clients</artifactId>-->
+        <!--<version>3.0.0</version>-->
+        <!--</dependency>-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-starter-oss</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-starter-report</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.core</groupId>
+            <artifactId>jersey-common</artifactId>
+            <version>2.28</version>
+        </dependency>
+
+        <!--<dependency>-->
+        <!--<groupId>cn.afterturn</groupId>-->
+        <!--<artifactId>easypoi-spring-boot-starter</artifactId>-->
+        <!--<version>4.1.2</version>-->
+        <!--</dependency>-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel-core</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel-support</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.apache.poi</groupId>-->
+            <!--<artifactId>poi</artifactId>-->
+            <!--<version>4.1.2</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.poi</groupId>-->
+            <!--<artifactId>poi-ooxml</artifactId>-->
+            <!--<version>4.1.2</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.poi</groupId>-->
+            <!--<artifactId>poi-ooxml-schemas</artifactId>-->
+            <!--<version>4.1.2</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.poi</groupId>-->
+            <!--<artifactId>ooxml-schemas</artifactId>-->
+            <!--<version>1.4</version>-->
+        <!--</dependency>-->
+        <!-- 二维码生成 -->
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+            <version>3.3.3</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>javase</artifactId>
+            <version>3.3.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-net</groupId>
+            <artifactId>commons-net</artifactId>
+            <version>3.8.0</version>
+        </dependency>
+
+        <!--<dependency>-->
+            <!--<groupId>com.baomidou</groupId>-->
+            <!--<artifactId>dynamic-datasource-spring-boot-starter</artifactId>-->
+        <!--</dependency>-->
+
+        <!--<dependency>-->
+            <!--<groupId>org.springblade</groupId>-->
+            <!--<artifactId>blade-core-auto</artifactId>-->
+            <!--<version>2.9.1.RELEASE</version>-->
+        <!--</dependency>-->
+    </dependencies>
+
+    <build>
+        <finalName>${project.artifactId}</finalName>
+
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring.boot.version}</version>
+                <configuration>
+                    <mainClass>org.springblade.Application</mainClass>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>${maven.plugin.version}</version>
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <encoding>UTF-8</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.12.4</version>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
+
+    <repositories>
+        <repository>
+            <id>spring-milestones</id>
+            <name>Spring Milestones</name>
+            <url>https://repo.spring.io/milestone</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+        <repository>
+            <id>nexus</id>
+            <url>http://nexus.zhkrc.com/repository/maven-public/</url>
+        </repository>
+        <!--<repository>-->
+        <!--<id>osgeo</id>-->
+        <!--<name>repo.osgeo.org</name>-->
+        <!--<url>https://repo.osgeo.org/repository/release/</url>-->
+        <!--<snapshots>-->
+        <!--<enabled>false</enabled>-->
+        <!--</snapshots>-->
+        <!--<releases><enabled>true</enabled></releases>-->
+        <!--</repository>-->
+    </repositories>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>aliyun-plugin</id>
+            <url>https://maven.aliyun.com/repository/public/</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+    <distributionManagement>
+        <repository>
+            <id>maven-releases</id>
+            <name>Maven Release Repository</name>
+            <url>http://nexus.zhkrc.com/repository/maven-releases/</url>
+        </repository>
+    </distributionManagement>
+
+</project>

+ 32 - 0
NMSZYYWXT/src/main/java/org/springblade/Application.java

@@ -0,0 +1,32 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/3/29
+ */
+package org.springblade;
+
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.core.launch.BladeApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+/***
+ * Date:2022/3/29
+ * Title:启动器
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @Author: admin
+ * @Mender:(文件的修改者,文件创建者之外的人)
+ * @Version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@EnableScheduling
+@SpringBootApplication
+public class Application {
+
+	public static void main(String[] args) {
+		BladeApplication.run(CommonConstant.APPLICATION_NAME, Application.class, args);
+	}
+
+}
+

+ 28 - 0
NMSZYYWXT/src/main/java/org/springblade/config/GalaxyConfiguration.java

@@ -0,0 +1,28 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022-03-04
+ */
+package org.springblade.config;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springblade.props.GalaxyProperties;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+
+/***
+ * Date:2022-03-04
+ * Title:配置类(配置feign、mybatis包名、properties)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author Blade
+ * @mender:(文件的修改者,文件创建者之外的人)
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Configuration
+@EnableConfigurationProperties(GalaxyProperties.class)
+public class GalaxyConfiguration {
+
+}

+ 41 - 0
NMSZYYWXT/src/main/java/org/springblade/config/MultipartConfig.java

@@ -0,0 +1,41 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/8
+ */
+package org.springblade.config;
+
+import cn.hutool.core.io.FileUtil;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.web.servlet.MultipartConfigFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.servlet.MultipartConfigElement;
+
+/***
+ * Date:2023/10/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Configuration
+public class MultipartConfig {
+	@Value("${spring.servlet.multipart.location}")
+	private String tmpLocation;
+
+	@Bean
+	public MultipartConfigElement multipartConfigElement() {
+		MultipartConfigFactory factory = new MultipartConfigFactory();
+		System.out.println("******************************* MultipartConfigElement");
+		// 若没有该目录,则创建,此处使用了第三方插件的FileUtil,各位可以使用原生File实现该逻辑
+		if (!FileUtil.exist(tmpLocation)) {
+			FileUtil.mkdir(tmpLocation);
+		}
+		factory.setLocation(tmpLocation);
+		return factory.createMultipartConfig();
+	}
+}

+ 85 - 0
NMSZYYWXT/src/main/java/org/springblade/constant/BusinessConstant.java

@@ -0,0 +1,85 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/3/7
+ */
+package org.springblade.constant;
+
+/***
+ * Date:2022/3/7
+ * Title:业务常量类
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author admin
+ * @mender:(文件的修改者,文件创建者之外的人)
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public class BusinessConstant {
+	/**
+	 * 超级管理员角色
+	 */
+	public static final  String ROLE_SUPER_ADMIN ="administrator";
+	/**
+	 * 系统管理员角色
+	 */
+	public static final  String ROLE_SYS_ADMIN ="sys_admin";
+	/**
+	 * 盟市机构管理员角色
+	 */
+	public static final  String ROLE_ORG_ADMIN ="org_admin";
+	/**
+	 * 运维公司管理员角色
+	 */
+	public static final  String ROLE_COMPANY_ADMIN ="company_admin";
+	/**
+	 * 运维公司技术人员角色
+	 */
+	public static final  String ROLE_COMPANY_SERVICE_PERSON ="company_servcie_person";
+	/**
+	 * 盟市机构管理员角色ID
+	 */
+	public static final  String ROLE_ORG_ADMIN_ID ="1641334028382662657";
+	/**
+	 * 公司运维管理员角色ID
+	 */
+	public static final  String ROLE_COMPANY_ADMIN_ID ="1641334149732265985";
+	/**
+	 * 公司运维人员角色ID
+	 */
+	public static final  String ROLE_COMPANY_SERVICE_PERSON_ID ="1641334272017199106";
+	/**
+	 * 管理岗位
+	 */
+	public static final  String POST_ADMIN_ID ="1562989286284906498";
+	/**
+	 * 技术员岗位
+	 */
+	public static final  String POST_SERVICE_PERSON_ID ="1562994107637354498";
+	/**
+	 * 系统管理员用户ID
+	 */
+	public static final Long SYS_ADMIN_ID =1499007300681326593L;
+	/**
+	 * 根行政区划编码
+	 */
+	public static final String REGION_ROOT_ADCODE="00";
+	/**
+	 * 自治区行政区划编码
+	 */
+	public static final String REGION_NM_ADCODE="150000000000000";
+	/**
+	 * 帐号密码后缀
+	 */
+	public static final String ACCOUNT_PW_SUFFIX="@8282";
+
+	public static final Long DEPT_ROOT_ID =0L;
+
+	public static final Long DEPT_XAM_ID=1123598813738675201L;
+
+
+	//public static final String DATA_SHARE_JS_SERVER="https://waterintake.goldenwater.com.cn";
+
+	public static final String DATA_SHARE_AREA ="150000_CHANGSHANG2";
+	public static final String DATA_SHARE_KEY ="0D51AE4820720735E0630EC3010A9497";
+}

+ 21 - 0
NMSZYYWXT/src/main/java/org/springblade/constant/DictBusinessConstant.java

@@ -0,0 +1,21 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/3/27
+ */
+package org.springblade.constant;
+
+/***
+ * Date:2022/3/27
+ * Title:字典常量定义类
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @Author: admin
+ * @Mender:(文件的修改者,文件创建者之外的人)
+ * @Version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public class DictBusinessConstant {
+	public static final  String ORDER_STATUS_CODE ="rtu_check_order_status";
+	public static final  String ORDER_FROM_CODE ="rtu_check_order_from";
+}

+ 5 - 0
NMSZYYWXT/src/main/java/org/springblade/constant/MyAppConstant.java

@@ -0,0 +1,5 @@
+package org.springblade.constant;
+
+public interface MyAppConstant {
+	String APPLICATION_BUSINESS_NAME="galaxy-business";
+}

+ 43 - 0
NMSZYYWXT/src/main/java/org/springblade/constant/RedisBusinessConstant.java

@@ -0,0 +1,43 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 山洪灾害运维系统
+ * 创建日期:2023/8/15
+ */
+package org.springblade.constant;
+
+/*** 
+ * Date:2023/8/15
+ * Title: REDIS常量定义
+ * Description: REDIS定义
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public class RedisBusinessConstant {
+
+	public static final  String KEY_RTU_RUN_INFO ="rtu.up.run.info.";
+
+	public static final  String KEY_RTU_RUN_INFO_LAST_TIME ="last_up_time";
+
+	public static final  String KEY_RTU_RUN_INFO_OFFLINE_CHECK_POINT_TIME ="warn_offline_check_point_datetime";
+
+	public static final  String KEY_RTU_RUN_INFO_WARN_KIND ="warn_kind_";
+
+	public static final  String KEY_SURF_DATA ="surf.data.";
+
+	public static final  String KEY_ETL_RAIN_UP_LAST ="etl.rain.up.last.";
+
+	public static final  String KEY_ETL_RAIN_HOUR_UP_LAST ="etl.rain.hour.up.last.";
+
+	public static final  String KEY_ETL_RIVER_UP_LAST ="etl.river.up.last.";
+
+	public static final  String KEY_ETL_RIVER_HOUR_UP_LAST ="etl.river.hour.up.last.";
+
+	public static final  String KEY_ETL_RSVR_UP_LAST ="etl.rsvr.up.last.";
+
+	public static final  String KEY_ETL_RSVR_HOUR_UP_LAST ="etl.rsvr.hour.up.last.";
+
+	public static final  String KEY_ETL_GROUND_UP_LAST ="etl.ground.up.last.";
+
+}

+ 93 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/EquipmentActiveEnum.java

@@ -0,0 +1,93 @@
+package org.springblade.enums;
+
+public enum EquipmentActiveEnum {
+	/**
+	 * 关闭
+	 */
+	ACTIVE_OFF(0, "关闭"),
+
+	/**
+	 * 开启
+	 */
+	ACTIVE_OPEN(1, "开启");
+
+
+
+	private int code;
+
+	private String name;
+
+	private EquipmentActiveEnum(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(int code) {
+		for (EquipmentActiveEnum type : EquipmentActiveEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static EquipmentActiveEnum getEnumByCode(int code) {
+		for (EquipmentActiveEnum type : EquipmentActiveEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static EquipmentActiveEnum getEnumByName(String name) {
+		for (EquipmentActiveEnum type : EquipmentActiveEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 93 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/EquipmentStatusEnum.java

@@ -0,0 +1,93 @@
+package org.springblade.enums;
+
+public enum EquipmentStatusEnum {
+	/**
+	 * 正常
+	 */
+	STATUS_RUN(0, "正常"),
+
+	/**
+	 * 故障
+	 */
+	STATUS_FAILURE(1, "故障");
+
+
+
+	private int code;
+
+	private String name;
+
+	private EquipmentStatusEnum(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(int code) {
+		for (EquipmentStatusEnum type : EquipmentStatusEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static EquipmentStatusEnum getEnumByCode(int code) {
+		for (EquipmentStatusEnum type : EquipmentStatusEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static EquipmentStatusEnum getEnumByName(String name) {
+		for (EquipmentStatusEnum type : EquipmentStatusEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 108 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/GenderEnum.java

@@ -0,0 +1,108 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/3/7
+ */
+package org.springblade.enums;
+
+/***
+ * Date:2022/3/7
+ * Title:性别枚举类
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author admin
+ * @mender:(文件的修改者,文件创建者之外的人)
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public enum GenderEnum {
+
+    /** 男 */
+    SEX_M(1, "男"),
+
+    /** 女 */
+    SEX_W(2, "女"),
+
+	/** 未知 */
+	SEX_NONE(3, "未知"),
+
+	;
+
+	private int code;
+
+	private String name;
+
+    private GenderEnum(int code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    /**
+     * Function:根据code来获取对应的name
+     * Author: Admin
+     * Date:2021/6/26
+     * @param code
+     * @return java.lang.String
+     * @throws Exception
+     */
+    public static String getName(int code) {
+        for (GenderEnum type : GenderEnum.values()) {
+            if (type.code == code) {
+                return type.name;
+            }
+        }
+        return "";
+    }
+
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.IsValid
+	 * @throws Exception
+	 */
+	public static GenderEnum getEnumByCode(int code) {
+		for (GenderEnum type : GenderEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static GenderEnum getEnumByName(String name) {
+		for (GenderEnum type : GenderEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+}

+ 103 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/IsValidEnum.java

@@ -0,0 +1,103 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/3/7
+ */
+package org.springblade.enums;
+
+/***
+ * Date:2022/3/7
+ * Title:是否有效枚举类
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author admin
+ * @mender:(文件的修改者,文件创建者之外的人)
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public enum IsValidEnum {
+
+    /** 无效 */
+    VALID_1(1, "无效"),
+
+    /** 有效 */
+    VALID_2(2, "有效");
+
+    private int code;
+
+    private String name;
+
+	private IsValidEnum(int code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    /**
+     * Function:根据code来获取对应的name
+     * Author: Admin
+     * Date:2021/6/26
+      * @param code
+     * @return java.lang.String
+     * @throws Exception
+     */
+    public static String getName(int code) {
+        for (IsValidEnum type : IsValidEnum.values()) {
+            if (type.code == code) {
+                return type.name;
+            }
+        }
+        return "";
+    }
+
+    /**
+     * Function:根据code来获取对应的枚举常量
+     * Author: Admin
+     * Date:2021/6/26
+      * @param code
+     * @return com.zhgzjg.web.enums.IsValid
+     * @throws Exception
+     */
+    public static IsValidEnum getEnumByCode(int code) {
+        for (IsValidEnum type : IsValidEnum.values()) {
+			if (type.code == code) {
+                return type;
+            }
+        }
+        return null;
+    }
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static IsValidEnum getEnumByName(String name) {
+		for (IsValidEnum type : IsValidEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+    public Integer getCode() {
+    return code;
+}
+
+    public void setCode(int code) {
+    this.code = code;
+}
+
+    public String getName() {
+    return name;
+}
+
+    public void setName(String name) {
+    this.name = name;
+}
+
+}

+ 93 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/OrderCloseEnum.java

@@ -0,0 +1,93 @@
+package org.springblade.enums;
+
+public enum OrderCloseEnum {
+	/**
+	 * 进行中
+	 */
+	ACTIVE_OPEN(0, "进行中"),
+
+	/**
+	 * 关闭
+	 */
+	ACTIVE_CLOSE(1, "关闭");
+
+
+
+	private int code;
+
+	private String name;
+
+	private OrderCloseEnum(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(int code) {
+		for (OrderCloseEnum type : OrderCloseEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static OrderCloseEnum getEnumByCode(int code) {
+		for (OrderCloseEnum type : OrderCloseEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static OrderCloseEnum getEnumByName(String name) {
+		for (OrderCloseEnum type : OrderCloseEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 93 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/OrderConfirmEnum.java

@@ -0,0 +1,93 @@
+package org.springblade.enums;
+
+public enum OrderConfirmEnum {
+	/**
+	 * 正常
+	 */
+	ACTIVE_CREATE(0, "正常"),
+
+	/**
+	 * 确认
+	 */
+	ACTIVE_CONFIRM(1, "确认");
+
+
+
+	private int code;
+
+	private String name;
+
+	private OrderConfirmEnum(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(int code) {
+		for (OrderConfirmEnum type : OrderConfirmEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static OrderConfirmEnum getEnumByCode(int code) {
+		for (OrderConfirmEnum type : OrderConfirmEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static OrderConfirmEnum getEnumByName(String name) {
+		for (OrderConfirmEnum type : OrderConfirmEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 96 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/OrderFromEnum.java

@@ -0,0 +1,96 @@
+package org.springblade.enums;
+
+public enum OrderFromEnum {
+	/**
+	 * 人工添加
+	 */
+	FROM_MANUALLY("manually", "人工添加"),
+
+	/**
+	 * 设备预警
+	 */
+	FROM_WARNING("warning", "设备预警"),
+
+	/**
+	 * 设备巡检
+	 */
+	FROM_INSPECTION("inspection", "设备巡检");
+
+	private String code;
+
+	private String name;
+
+	private OrderFromEnum(String code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(String code) {
+		for (OrderFromEnum type : OrderFromEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static OrderFromEnum getEnumByCode(String code) {
+		for (OrderFromEnum type : OrderFromEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static OrderFromEnum getEnumByName(String name) {
+		for (OrderFromEnum type : OrderFromEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 104 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/OrderStatusEnum.java

@@ -0,0 +1,104 @@
+package org.springblade.enums;
+
+public enum OrderStatusEnum {
+	/**
+	 * 工单创建
+	 */
+	STATUS_CREATE("1", "工单创建"),
+
+	/**
+	 * 工单接单
+	 */
+	STATUS_CONFIRM("2", "工单接单"),
+
+	/**
+	 * 工单处理
+	 */
+	STATUS_PROCESS("3", "工单处理"),
+
+	/**
+	 * 工单关闭
+	 */
+	STATUS_CLOSE("4", "工单关闭");
+
+	private String code;
+
+	private String name;
+
+	private OrderStatusEnum(String code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 *
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(String code) {
+		for (OrderStatusEnum type : OrderStatusEnum.values()) {
+			if (type.code.equals(code)) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 *
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static OrderStatusEnum getEnumByCode(String code) {
+		for (OrderStatusEnum type : OrderStatusEnum.values()) {
+			if (type.code.equals(code)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 *
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static OrderStatusEnum getEnumByName(String name) {
+		for (OrderStatusEnum type : OrderStatusEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 93 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/RtuReportStatusEnum.java

@@ -0,0 +1,93 @@
+package org.springblade.enums;
+
+public enum RtuReportStatusEnum {
+	/**
+	 * 未填报
+	 */
+	STATUS_0(0, "未填报"),
+
+	/**
+	 * 已提交
+	 */
+	STATUS_1(1, "已提交");
+
+
+
+	private int code;
+
+	private String name;
+
+	private RtuReportStatusEnum(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(int code) {
+		for (RtuReportStatusEnum type : RtuReportStatusEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static RtuReportStatusEnum getEnumByCode(int code) {
+		for (RtuReportStatusEnum type : RtuReportStatusEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static RtuReportStatusEnum getEnumByName(String name) {
+		for (RtuReportStatusEnum type : RtuReportStatusEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 100 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/SiteOwnerTypeEnum.java

@@ -0,0 +1,100 @@
+package org.springblade.enums;
+
+public enum SiteOwnerTypeEnum {
+    /**
+     * 国控转计量
+     */
+    LEVEL_0(1, "国控转计量"),
+
+    /**
+     * 用户安装的计量设施
+     */
+    LEVEL_1(2, "用户安装的计量设施"),
+
+    /**
+     * 中央专项资金
+     */
+    LEVEL_2(3, "中央专项资金");
+
+
+    private int code;
+
+    private String name;
+
+    private SiteOwnerTypeEnum(int code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    /**
+     * Function:根据code来获取对应的name
+     * Author: Admin
+     * Date:2021/6/26
+     *
+     * @param code
+     * @return java.lang.String
+     * @throws Exception
+     */
+    public static String getName(int code) {
+        for (SiteOwnerTypeEnum type : SiteOwnerTypeEnum.values()) {
+            if (type.code == code) {
+                return type.name;
+            }
+        }
+        return "";
+    }
+
+    /**
+     * Function:根据code来获取对应的枚举常量
+     * Author: Admin
+     * Date:2021/6/26
+     *
+     * @param code
+     * @return com.zhgzjg.web.enums.DeleteFlag
+     * @throws Exception
+     */
+    public static SiteOwnerTypeEnum getEnumByCode(int code) {
+        for (SiteOwnerTypeEnum type : SiteOwnerTypeEnum.values()) {
+            if (type.code == code) {
+                return type;
+            }
+        }
+        return null;
+    }
+
+
+    /**
+     * Function:根据name来获取对应的枚举常量
+     * Author: Admin
+     * Date:2021/6/26
+     *
+     * @param name
+     * @return com.zhgzjg.web.enums.DeleteFlag
+     * @throws Exception
+     */
+    public static SiteOwnerTypeEnum getEnumByName(String name) {
+        for (SiteOwnerTypeEnum type : SiteOwnerTypeEnum.values()) {
+            if (type.name.equals(name)) {
+                return type;
+            }
+        }
+        return null;
+    }
+
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 107 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/SzyFlowRateMetadataEnum.java

@@ -0,0 +1,107 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/31
+ */
+package org.springblade.enums;
+
+/*** 
+ * Date:2023/10/31
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public enum SzyFlowRateMetadataEnum {
+    /**
+     * 接收时间
+     */
+    METADATA_FROM_TIME(0, "from_time"),
+
+    /**
+     * 采集时间
+     */
+    METADATA_COLLECT_TIME(1, "tm"),
+
+    /**
+     * 上报时间
+     */
+    METADATA_UP_TIME(2, "up_time"),
+    /**
+     * 测站编码
+     */
+    METADATA_RTU_CODE(4, "rtu_code"),
+    /**
+     * 瞬时流量
+     */
+    METADATA_CODE_Q(0, "q"),
+    /**
+     * 累计流量
+     */
+    METADATA_CODE_ACC_Q(1, "acc_q"),
+    /**
+     * 1小时用水量
+     */
+    METADATA_CODE_HOUR_Q(2, "hour_q"),
+    /**
+     * 1小时累计流量
+     */
+    METADATA_CODE_HOUR_ACC_Q(3, "hour_acc_q")
+    ;
+
+    private int code;
+
+    private String name;
+
+    SzyFlowRateMetadataEnum(int code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * 根据CODE查名称
+     *
+     * @param code
+     * @return
+     */
+    public static String getName(int code) {
+        for (SzyFlowRateMetadataEnum point : SzyFlowRateMetadataEnum.values()) {
+            if (point.code == code) {
+                return point.name;
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 根据名称查代码
+     * @param name
+     * @return
+     */
+    public static int getCode(String name) {
+        for (SzyFlowRateMetadataEnum point : SzyFlowRateMetadataEnum.values()) {
+            if (point.name.equals(name)) {
+                return point.code;
+            }
+        }
+        return -1;
+    }
+}

+ 95 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/SzyWaterLevelMetadataEnum.java

@@ -0,0 +1,95 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/31
+ */
+package org.springblade.enums;
+
+/*** 
+ * Date:2023/10/31
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public enum SzyWaterLevelMetadataEnum {
+    /**
+     * 接收时间
+     */
+    METADATA_FROM_TIME(0, "from_time"),
+
+    /**
+     * 采集时间
+     */
+    METADATA_COLLECT_TIME(1, "tm"),
+
+    /**
+     * 上报时间
+     */
+    METADATA_UP_TIME(2, "up_time"),
+    /**
+     * 测站编码
+     */
+    METADATA_RTU_CODE(3, "rtu_code"),
+    /**
+     * 水位
+     */
+    METADATA_CODE_LEVEL(4, "water_level")
+    ;
+
+    private int code;
+
+    private String name;
+
+    SzyWaterLevelMetadataEnum(int code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * 根据CODE查名称
+     *
+     * @param code
+     * @return
+     */
+    public static String getName(int code) {
+        for (SzyWaterLevelMetadataEnum point : SzyWaterLevelMetadataEnum.values()) {
+            if (point.code == code) {
+                return point.name;
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 根据名称查代码
+     * @param name
+     * @return
+     */
+    public static int getCode(String name) {
+        for (SzyWaterLevelMetadataEnum point : SzyWaterLevelMetadataEnum.values()) {
+            if (point.name.equals(name)) {
+                return point.code;
+            }
+        }
+        return -1;
+    }
+}

+ 125 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/WarnKindEnum.java

@@ -0,0 +1,125 @@
+package org.springblade.enums;
+
+public enum WarnKindEnum {
+
+	/**
+	 * 测站离线
+	 */
+	WARN_OFFLINE(1, "测站离线"),
+
+	/**
+	 * 测站时钟异常
+	 */
+	WARN_CLOCK(2, "测站时钟异常"),
+
+	/**
+	 * 测站雨量小时报漏报
+	 */
+	WARN_RAIN_MISS_OUT(3, "测站雨量小时报漏报"),
+
+	/**
+	 * 测站水位小时报漏报
+	 */
+	WARN_WL_MISS_OUT(4, "测站水位小时报漏报"),
+
+	/**
+	 * 5分钟上报延时
+	 */
+	WARN_UP_MIN_DELAY(5, "雨量5分钟上报延时"),
+
+	/**
+	 * 小时上报延时
+	 */
+	WARN_RAIN_UP_HOUR_DELAY(6, "雨量站小时上报延时"),
+
+	/**
+	 * 水位站小时上报延时
+	 */
+	WARN_WL_UP_HOUR_DELAY(7, "水位站小时上报延时"),
+
+	/**
+	 * 雨量疑似异常值
+	 */
+	WARN_OUTLIER_VALUE(8, "雨量疑似异常值");
+
+	private int code;
+
+	private String name;
+
+	private WarnKindEnum(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 *
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(int code) {
+		for (WarnKindEnum type : WarnKindEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 *
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static WarnKindEnum getEnumByCode(int code) {
+		for (WarnKindEnum type : WarnKindEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 *
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static WarnKindEnum getEnumByName(String name) {
+		for (WarnKindEnum type : WarnKindEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 93 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/WarningActiveEnum.java

@@ -0,0 +1,93 @@
+package org.springblade.enums;
+
+public enum WarningActiveEnum {
+	/**
+	 * 关闭
+	 */
+	ACTIVE_OFF(0, "关闭"),
+
+	/**
+	 * 开启
+	 */
+	ACTIVE_OPEN(1, "开启");
+
+
+
+	private int code;
+
+	private String name;
+
+	private WarningActiveEnum(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(int code) {
+		for (WarningActiveEnum type : WarningActiveEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static WarningActiveEnum getEnumByCode(int code) {
+		for (WarningActiveEnum type : WarningActiveEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static WarningActiveEnum getEnumByName(String name) {
+		for (WarningActiveEnum type : WarningActiveEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 94 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/WarningStatusEnum.java

@@ -0,0 +1,94 @@
+package org.springblade.enums;
+
+public enum WarningStatusEnum {
+
+	/**
+	 * 开启
+	 */
+	STATUS_HAPPEN(0, "预警中"),
+
+	/**
+	 * 关闭
+	 */
+	STATUS_CLOSE(1, "恢复");
+
+
+
+	private int code;
+
+	private String name;
+
+	private WarningStatusEnum(int code, String name) {
+		this.code = code;
+		this.name = name;
+	}
+
+	/**
+	 * Function:根据code来获取对应的name
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return java.lang.String
+	 * @throws Exception
+	 */
+	public static String getName(int code) {
+		for (WarningStatusEnum type : WarningStatusEnum.values()) {
+			if (type.code == code) {
+				return type.name;
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static WarningStatusEnum getEnumByCode(int code) {
+		for (WarningStatusEnum type : WarningStatusEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static WarningStatusEnum getEnumByName(String name) {
+		for (WarningStatusEnum type : WarningStatusEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 104 - 0
NMSZYYWXT/src/main/java/org/springblade/enums/WhetherEnum.java

@@ -0,0 +1,104 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/3/7
+ */
+package org.springblade.enums;
+
+/***
+ * Date:2022/3/7
+ * Title:是否枚举类
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author admin
+ * @mender:(文件的修改者,文件创建者之外的人)
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public enum WhetherEnum {
+
+    /** 否 */
+    TYPE_1(1, "否"),
+
+    /** 是 */
+    TYPE_2(2, "是");
+
+    private int code;
+
+    private String name;
+
+    private WhetherEnum(int code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    /**
+     * Function:根据code来获取对应的name
+     * Author: Admin
+     * Date:2021/6/26
+     * @param code
+     * @return java.lang.String
+     * @throws Exception
+     */
+    public static String getName(int code) {
+        for (WhetherEnum type : WhetherEnum.values()) {
+            if (type.code == code) {
+                return type.name;
+            }
+        }
+        return "";
+    }
+
+	/**
+	 * Function:根据code来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param code
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static WhetherEnum getEnumByCode(int code) {
+		for (WhetherEnum type : WhetherEnum.values()) {
+			if (type.code == code) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+	/**
+	 * Function:根据name来获取对应的枚举常量
+	 * Author: Admin
+	 * Date:2021/6/26
+	 * @param name
+	 * @return com.zhgzjg.web.enums.DeleteFlag
+	 * @throws Exception
+	 */
+	public static WhetherEnum getEnumByName(String name) {
+		for (WhetherEnum type : WhetherEnum.values()) {
+			if (type.name.equals(name)) {
+				return type;
+			}
+		}
+		return null;
+	}
+
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}
+

+ 377 - 0
NMSZYYWXT/src/main/java/org/springblade/jobtask/DataShareProcessor.java

@@ -0,0 +1,377 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/11/16
+ */
+package org.springblade.jobtask;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.constant.BusinessConstant;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.enums.IsValidEnum;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointRelService;
+import org.springblade.modules.baseinfo.monitorsite.dto.MonitorSiteInfoDTO;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteRelService;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteService;
+import org.springblade.modules.baseinfo.rtu.dto.RtuInfoDTO;
+import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
+import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.baseinfo.wateruseconsumer.entity.WaterUseConsumerInfoEntity;
+import org.springblade.modules.baseinfo.wateruseconsumer.service.IWaterUseConsumerService;
+import org.springblade.modules.business.monitor.entity.WaterFlowRateInfoEntity;
+import org.springblade.modules.business.monitor.service.IWaterFlowRateHistoryService;
+import org.springblade.modules.business.monitor.service.IWaterFlowRateService;
+import org.springblade.modules.share.entity.DataShareLogEntity;
+import org.springblade.modules.share.service.IDataShareLogServcie;
+import org.springblade.utils.HttpRequestUtil;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.HashOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.Callable;
+import java.util.concurrent.FutureTask;
+
+/***
+ * Date:2023/11/16
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+@Component
+@EnableScheduling
+public class DataShareProcessor {
+    @Resource
+    private TaskManager taskManager;
+
+//    @Resource
+//    private IMonitorSiteService monitorSiteService;
+
+//    @Resource
+//    private IMonitorPointRelService monitorPointRelService;
+//
+//    @Resource
+//    private IMonitorSiteRelService monitorSiteRelService;
+
+//    @Resource
+//    private IWaterUseConsumerService waterUseConsumerService;
+
+    @Resource
+    private IRtuBaseInfoService rtuBaseInfoService;
+
+    @Resource
+    private IWaterFlowRateService waterFlowRateService;
+
+    @Resource
+    private IWaterFlowRateHistoryService waterFlowRateHistoryService;
+
+    @Resource
+    private IDataShareLogServcie dataShareLogServcie;
+
+    @Resource
+    private RedisTemplate<String, String> redisTemplate;
+
+    @Value("${spring.task-config.data-share-server}")
+    private String dataShareServer;
+
+    @Value("${spring.task-config.data-share-rtu}")
+    private boolean dataShareRtuActive;
+
+    @Value("${spring.task-config.data-share-data}")
+    private boolean dataShareDataActive;
+
+
+    /**
+     * 超时时间,单位:毫秒
+     */
+    private int nTimeOut = 20 * 1000;
+
+    /**
+     * 计量设施数据同步,每天执行一次
+     */
+//    @Scheduled(cron = "10 0 0 * * ?")
+//    @Scheduled(cron = "0 0 0/1 * * ?")
+    @Scheduled(cron = "0 0/1 * * * ?")
+    public void siteShareDataTaskScheduled() {
+        try {
+            if (dataShareRtuActive) {
+                Date dt = new Date();
+                log.info("计量设施任务创建 {}", Func.formatDateTime(dt));
+                SiteShareDataTask task = new SiteShareDataTask(dt);
+                FutureTask<Integer> futureTask = new FutureTask<>(task);
+                taskManager.submitTask(futureTask);
+            }
+        } catch (Exception e) {
+            log.error("{}", e.getMessage());
+        }
+    }
+
+    /**
+     * 实时流量数据同步,每小时执行一次
+     */
+//    @Scheduled(cron = "30 0/1 * * * ?")
+//    @Scheduled(cron = "30 0 0/1 * * ?")
+    public void waterFlowRateShareDataTaskScheduled() {
+        try {
+            if (dataShareDataActive){
+                Date dt = new Date();
+                log.info("实时流量数据任务创建 {}", Func.formatDateTime(dt));
+                WaterFlowRateShareDataTask task = new WaterFlowRateShareDataTask(dt);
+                FutureTask<Integer> futureTask = new FutureTask<>(task);
+                taskManager.submitTask(futureTask);
+            }
+        } catch (Exception e) {
+            log.error("{}", e.getMessage());
+        }
+    }
+
+    private class SiteShareDataTask implements Callable<Integer> {
+        private Date countTime;
+
+        public SiteShareDataTask(Date countTime) {
+            this.countTime = countTime;
+        }
+
+        @Override
+        public Integer call() throws Exception {
+            try {
+                log.info("计量设施同步任务开始执行 {}", Func.formatDateTime(countTime));
+                List<JSONObject> datas = new ArrayList<>();
+                RtuInfoDTO dto = new RtuInfoDTO();
+                List<RtuInfoEntity> list = rtuBaseInfoService.rtuList(dto);
+
+                if (Func.notNull(list)) {
+                    for (RtuInfoEntity entity : list) {
+                        if (Func.notNull(entity.getDataShareActive()) && IsValidEnum.VALID_2.getCode() == entity.getDataShareActive().intValue()) {
+                            log.info("同步计量设施{}",entity.getRtuCode());
+                            JSONObject data = new JSONObject();
+                            data.put("id", BusinessConstant.DATA_SHARE_AREA + "_" + entity.getRtuCode());
+                            data.put("measName", entity.getRtuName());
+                            data.put("measCode", entity.getRtuCode());
+                            //计量方式代码,参考输入参数说明下的字典项(以电折水计量涉及的样本井、普通井选用其他计量-以电量、柴油和其他动力消耗折算水量)
+                            data.put("measTypeCode", "24");
+                            //计量方式
+                            data.put("measType", "7");
+                            //使用状态 5、正常;4故障;3停用
+                            data.put("status", "5");
+                            //是否有效字段,1有效,0无效(删除的数据)新增时不传默认为1
+                            data.put("flagValid", "1");
+                            //传输方式代码,1、在线计量;2、非在线计量样本井的话传1,普通井传2
+                            data.put("transModeCode", "1");
+                            //取水地址行政编码,县级行政区划代码
+                            data.put("intLocDivCode", entity.getAdCode());
+                            //是否修改行政区划代码 ,修改时,默认传1,不传不修改行政区划。
+                            data.put("isAddvcd", "1");
+                            //首次发证证件编号/证照编号
+                            data.put("ecBaseInfoId", entity.getSiteCertId());
+                            //数据接收路径 ,1.部级 2.省级(默认省级)(传编码)
+                            data.put("dataReceivePath", "2");
+                            //数据来源类型,1、国控转计量; 2、用户安装的计量设施;3、中央专项资金;
+                            data.put("source", entity.getSiteOwner());
+                            //数据来源类型,如要修改已传输的计量设施数据来源,维护该字段
+                            data.put("updateSource", entity.getSiteOwner());
+                            datas.add(data);
+
+                        }
+                    }
+                }
+                if (datas.size() > 0) {
+                    HashOperations<String, String, String> hashops = redisTemplate.opsForHash();
+                    String date = hashops.get("datashare", "date");
+                    int dsBatchCount = 1;
+                    if (Func.isNull(date)) {
+                        date = Func.formatDate(countTime);
+                    } else {
+                        String today = Func.formatDate(countTime);
+                        if (!today.equals(date)) {
+                            date = today;
+                            dsBatchCount = 1;
+                        } else {
+                            String dsBatch = hashops.get("datashare", "dsBatch");
+                            if (Func.isNull(dsBatch)) {
+                                dsBatchCount = 1;
+                            } else {
+                                dsBatchCount = Func.toInt(dsBatch) + 1;
+                            }
+                        }
+                    }
+                    String dsBatch = BusinessConstant.DATA_SHARE_AREA + "-" + date + "-" + String.format("%04d", dsBatchCount);
+                    JSONObject post = new JSONObject();
+                    post.put("dsBatch", dsBatch);
+                    post.put("timestamp", countTime);
+                    post.put("data", datas);
+                    log.info("json post {}", post.toJSONString());
+                    String url = dataShareServer + "/wr_web_manager/api/wr/datasync/fac/infoinsertOrUpdate";
+                    // 请求头
+                    Map<String, String> headers = new HashMap<>();
+                    headers.put("area", BusinessConstant.DATA_SHARE_AREA);
+                    headers.put("key", BusinessConstant.DATA_SHARE_KEY);
+                    JSONObject res = HttpRequestUtil.doHttpPostRequest("计量设施数据同步", url, headers, post.toJSONString(), nTimeOut);
+                    if (Func.notNull(res)) {
+                        log.info("接口返回 {}", res.toJSONString());
+                    }
+                    //更新同步批次
+                    hashops.put("datashare", "date", date);
+                    hashops.put("datashare", "dsBatch", Func.toStr(dsBatchCount));
+                    //记录请求日志
+                    DataShareLogEntity logEntity = new DataShareLogEntity();
+                    logEntity.setRequestDesc("计量设施数据同步");
+                    logEntity.setCountTime(countTime);
+                    logEntity.setPostUrl(url);
+                    if (Func.notNull(res)) {
+                        logEntity.setRequestResult(res.toJSONString());
+                    }
+                    int timeLong = (int) (System.currentTimeMillis() - countTime.getTime());
+                    logEntity.setTaskTimeLong(timeLong);
+                    dataShareLogServcie.save(logEntity);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                log.error("计量设施同步任务异常 {}", e.getMessage());
+            } finally {
+                log.info("计量设施同步任务完成 {} 毫秒", System.currentTimeMillis() - countTime.getTime());
+            }
+            return 0;
+        }
+    }
+
+    private class WaterFlowRateShareDataTask implements Callable<Integer> {
+
+        private Date countTime;
+
+        public WaterFlowRateShareDataTask(Date countTime) {
+            this.countTime = countTime;
+        }
+
+        @Override
+        public Integer call() throws Exception {
+            try {
+                log.info("实时流量同步任务开始执行 {}", Func.formatDateTime(countTime));
+                List<JSONObject> datas = new ArrayList<>();
+                RtuInfoDTO dto = new RtuInfoDTO();
+                List<RtuInfoEntity> list = rtuBaseInfoService.rtuList(dto);
+                if (Func.notNull(list)) {
+                    for (RtuInfoEntity entity : list) {
+                        if (Func.notNull(entity.getDataShareActive()) && IsValidEnum.VALID_2.getCode() == entity.getDataShareActive().intValue()) {
+                            log.info("同步数据{}",entity.getRtuCode());
+                            LambdaQueryWrapper<WaterFlowRateInfoEntity> dataWrapper = Wrappers.<WaterFlowRateInfoEntity>query().lambda();
+                            dataWrapper.eq(WaterFlowRateInfoEntity::getMpcd, entity.getRtuCode());
+                            dataWrapper.last("limit 1");
+                            WaterFlowRateInfoEntity waterFlowRateInfoEntity = waterFlowRateService.getOne(dataWrapper);
+                            if (Func.notNull(waterFlowRateInfoEntity)) {
+                                JSONObject data = new JSONObject();
+                                data.put("mpCd", BusinessConstant.DATA_SHARE_AREA + "_" + entity.getRtuCode());
+                                //double dayAccw = waterFlowRateHistoryService.getDayAccw(entity.getRtuCode());
+                                data.put("dayW", 0.0);
+                                Calendar calendar = Calendar.getInstance();
+                                calendar.setTime(countTime);
+                                calendar.set(Calendar.HOUR_OF_DAY, 0);
+                                calendar.set(Calendar.MINUTE, 0);
+                                calendar.set(Calendar.SECOND, 0);
+                                calendar.set(Calendar.MILLISECOND, 0);
+                                calendar.add(Calendar.DAY_OF_MONTH, -1);
+                                data.put("dt", Func.formatDate(calendar.getTime()));
+                                data.put("inTime", Func.formatDate(calendar.getTime()));
+                                datas.add(data);
+                            } else {
+                                JSONObject data = new JSONObject();
+                                data.put("mpCd", BusinessConstant.DATA_SHARE_AREA + "_" + entity.getRtuCode());
+                                data.put("dayW", 0.0);
+                                Calendar calendar = Calendar.getInstance();
+                                calendar.setTime(countTime);
+                                calendar.set(Calendar.HOUR_OF_DAY, 0);
+                                calendar.set(Calendar.MINUTE, 0);
+                                calendar.set(Calendar.SECOND, 0);
+                                calendar.set(Calendar.MILLISECOND, 0);
+                                calendar.add(Calendar.DAY_OF_MONTH, -1);
+                                data.put("dt", Func.formatDate(calendar.getTime()));
+                                data.put("inTime", Func.formatDate(calendar.getTime()));
+                                datas.add(data);
+                            }
+                        }
+                    }
+                }
+
+                if (datas.size() > 0) {
+                    HashOperations<String, String, String> hashops = redisTemplate.opsForHash();
+                    String date = hashops.get("datashare", "date");
+                    int dsBatchCount = 1;
+                    if (Func.isNull(date)) {
+                        date = Func.formatDate(countTime);
+                    } else {
+                        String today = Func.formatDate(countTime);
+                        if (!today.equals(date)) {
+                            date = today;
+                            dsBatchCount = 1;
+                        } else {
+                            String dsBatch = hashops.get("datashare", "dsBatch");
+                            if (Func.isNull(dsBatch)) {
+                                dsBatchCount = 1;
+                            } else {
+                                dsBatchCount = Func.toInt(dsBatch) + 1;
+                            }
+                        }
+                    }
+                    String dsBatch = BusinessConstant.DATA_SHARE_AREA + "-" + date + "-" + String.format("%04d", dsBatchCount);
+                    JSONObject post = new JSONObject();
+                    post.put("dsBatch", dsBatch);
+                    post.put("timestamp", countTime);
+                    post.put("data", datas);
+                    log.info("json post {}", post.toJSONString());
+                    String url = dataShareServer + "/wr_web_manager/api/wr/datasync/wiwrDayWr/insertOrUpdate";
+                    // 请求头
+                    Map<String, String> headers = new HashMap<>();
+                    headers.put("area", BusinessConstant.DATA_SHARE_AREA);
+                    headers.put("key", BusinessConstant.DATA_SHARE_KEY);
+                    JSONObject res = HttpRequestUtil.doHttpPostRequest("实时流量数据同步", url, headers, post.toJSONString(), nTimeOut);
+                    if (Func.notNull(res)) {
+                        log.info("接口返回 {}", res.toJSONString());
+                    }
+                    //更新同步批次
+                    hashops.put("datashare", "date", date);
+                    hashops.put("datashare", "dsBatch", Func.toStr(dsBatchCount));
+                    //记录请求日志
+                    DataShareLogEntity logEntity = new DataShareLogEntity();
+                    logEntity.setRequestDesc("实时流量数据同步");
+                    logEntity.setCountTime(countTime);
+                    logEntity.setPostUrl(url);
+                    if (Func.notNull(res)) {
+                        logEntity.setRequestResult(res.toJSONString());
+                    }
+                    int timeLong = (int) (System.currentTimeMillis() - countTime.getTime());
+                    logEntity.setTaskTimeLong(timeLong);
+                    dataShareLogServcie.save(logEntity);
+                }
+            } catch (Exception e) {
+                // e.printStackTrace();
+                log.error("实时流量同步任务异常 {}", e.getMessage());
+                //记录请求日志
+                DataShareLogEntity logEntity = new DataShareLogEntity();
+                logEntity.setRequestDesc("实时流量数据同步");
+                logEntity.setCountTime(countTime);
+                logEntity.setPostUrl(dataShareServer + "/wr_web_manager/api/wr/datasync/wiwrDayWr/insertOrUpdate");
+                logEntity.setRequestResult("实时流量同步任务异常 " + e.getMessage());
+                int timeLong = (int) (System.currentTimeMillis() - countTime.getTime());
+                logEntity.setTaskTimeLong(timeLong);
+                dataShareLogServcie.save(logEntity);
+            } finally {
+                log.info("实时流量同步任务完成 {} 毫秒", System.currentTimeMillis() - countTime.getTime());
+            }
+            return 0;
+        }
+    }
+}

+ 337 - 0
NMSZYYWXT/src/main/java/org/springblade/jobtask/RainDataCountProcessor.java

@@ -0,0 +1,337 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 山洪灾害运维系统
+ * 创建日期:2023/8/4
+ */
+package org.springblade.jobtask;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.business.data.dto.RtuDataRainDTO;
+import org.springblade.modules.business.data.entity.*;
+import org.springblade.modules.business.data.service.*;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.*;
+
+/***
+ * Date:2023/8/4
+ * Title: 雨量统计
+ * Description:统计雨量5分钟数据,生成1小时、3小时、6小时、12小时及24小时成果表
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+@Component
+@EnableScheduling
+public class RainDataCountProcessor {
+
+	private static ThreadFactory rainDataCountThreadFactory = new ThreadFactoryBuilder().setNameFormat("rain-data-count-thread-pool-%d").build();
+	private static ExecutorService rainDataCountThreadPool = new ThreadPoolExecutor(1, 1,
+		0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), rainDataCountThreadFactory, new ThreadPoolExecutor.AbortPolicy());
+
+	@Resource
+	private IRtuDataRainH1Service h1Service;
+
+	@Resource
+	private IRtuDataRainH3Service h3Service;
+
+	@Resource
+	private IRtuDataRainH6Service h6Service;
+
+	@Resource
+	private IRtuDataRainH12Service h12Service;
+
+	@Resource
+	private IRtuDataRainH24Service h24Service;
+
+	@Resource
+	private IRtuDataRainStoreService rainStoreService;
+
+	@Resource
+	private IRtuDataRainService rainService;
+
+	@Value("${spring.task-config.rain-count-task}")
+	private boolean rainCountTaskRun;
+
+//	@Scheduled(cron = "0 0/5 * * * * ")
+	public void rainDataCountTask() {
+		try {
+			if (rainCountTaskRun) {
+				Date dt = new Date();
+				log.info("雨量统计任务创建 {}", Func.formatDateTime(dt));
+				RainDataCountTask task = new RainDataCountTask(dt);
+				FutureTask<Integer> futureTask = new FutureTask<>(task);
+				rainDataCountThreadPool.execute(futureTask);
+			}
+		} catch (Exception e) {
+			log.error("{}", e.getMessage());
+		}
+	}
+
+	private RtuDataRainH1Entity updateH1RainData(Date countTime, String rtuCode, Double drp) {
+		try {
+			LambdaQueryWrapper<RtuDataRainH1Entity> rainh1Wrapper = Wrappers.<RtuDataRainH1Entity>query().lambda();
+			rainh1Wrapper.eq(RtuDataRainH1Entity::getIsDeleted, 0);
+			rainh1Wrapper.eq(RtuDataRainH1Entity::getRtuCode, rtuCode);
+			RtuDataRainH1Entity rainH1Entity = h1Service.getOne(rainh1Wrapper);
+			if (null == rainH1Entity) {
+				rainH1Entity = new RtuDataRainH1Entity();
+				rainH1Entity.setRtuCode(rtuCode);
+			}
+			rainH1Entity.setDrp(drp);
+			rainH1Entity.setTm(countTime);
+			rainH1Entity.setFromTime(countTime);
+			return rainH1Entity;
+		} catch (Exception e) {
+			log.error(e.getMessage());
+			return null;
+		}
+	}
+
+	private RtuDataRainH3Entity updateH3RainData(Date countTime, String rtuCode, Double drp) {
+		try {
+			LambdaQueryWrapper<RtuDataRainH3Entity> rainh3Wrapper = Wrappers.<RtuDataRainH3Entity>query().lambda();
+			rainh3Wrapper.eq(RtuDataRainH3Entity::getIsDeleted, 0);
+			rainh3Wrapper.eq(RtuDataRainH3Entity::getRtuCode, rtuCode);
+			RtuDataRainH3Entity rainH3Entity = h3Service.getOne(rainh3Wrapper);
+			if (null == rainH3Entity) {
+				rainH3Entity = new RtuDataRainH3Entity();
+				rainH3Entity.setRtuCode(rtuCode);
+			}
+			rainH3Entity.setDrp(drp);
+			rainH3Entity.setTm(countTime);
+			rainH3Entity.setFromTime(countTime);
+			return rainH3Entity;
+		} catch (Exception e) {
+			log.error(e.getMessage());
+			return null;
+		}
+	}
+
+	private RtuDataRainH6Entity updateH6RainData(Date countTime, String rtuCode, Double drp) {
+		try {
+			LambdaQueryWrapper<RtuDataRainH6Entity> rainh6Wrapper = Wrappers.<RtuDataRainH6Entity>query().lambda();
+			rainh6Wrapper.eq(RtuDataRainH6Entity::getIsDeleted, 0);
+			rainh6Wrapper.eq(RtuDataRainH6Entity::getRtuCode, rtuCode);
+			RtuDataRainH6Entity rainH6Entity = h6Service.getOne(rainh6Wrapper);
+			if (null == rainH6Entity) {
+				rainH6Entity = new RtuDataRainH6Entity();
+				rainH6Entity.setRtuCode(rtuCode);
+			}
+			rainH6Entity.setDrp(drp);
+			rainH6Entity.setTm(countTime);
+			rainH6Entity.setFromTime(countTime);
+			return rainH6Entity;
+		} catch (Exception e) {
+			log.error(e.getMessage());
+			return null;
+		}
+	}
+
+	private RtuDataRainH12Entity updateH12RainData(Date countTime, String rtuCode, Double drp) {
+		try {
+			LambdaQueryWrapper<RtuDataRainH12Entity> rainh12Wrapper = Wrappers.<RtuDataRainH12Entity>query().lambda();
+			rainh12Wrapper.eq(RtuDataRainH12Entity::getIsDeleted, 0);
+			rainh12Wrapper.eq(RtuDataRainH12Entity::getRtuCode, rtuCode);
+			RtuDataRainH12Entity rainH12Entity = h12Service.getOne(rainh12Wrapper);
+			if (null == rainH12Entity) {
+				rainH12Entity = new RtuDataRainH12Entity();
+				rainH12Entity.setRtuCode(rtuCode);
+			}
+			rainH12Entity.setDrp(drp);
+			rainH12Entity.setTm(countTime);
+			rainH12Entity.setFromTime(countTime);
+			return rainH12Entity;
+		} catch (Exception e) {
+			log.error(e.getMessage());
+			return null;
+		}
+	}
+
+	private RtuDataRainH24Entity updateH24RainData(Date countTime, String rtuCode, Double drp) {
+		try {
+			LambdaQueryWrapper<RtuDataRainH24Entity> rainh24Wrapper = Wrappers.<RtuDataRainH24Entity>query().lambda();
+			rainh24Wrapper.eq(RtuDataRainH24Entity::getIsDeleted, 0);
+			rainh24Wrapper.eq(RtuDataRainH24Entity::getRtuCode, rtuCode);
+			RtuDataRainH24Entity rainH24Entity = h24Service.getOne(rainh24Wrapper);
+			if (null == rainH24Entity) {
+				rainH24Entity = new RtuDataRainH24Entity();
+				rainH24Entity.setRtuCode(rtuCode);
+			}
+			rainH24Entity.setDrp(drp);
+			rainH24Entity.setTm(countTime);
+			rainH24Entity.setFromTime(countTime);
+			return rainH24Entity;
+		} catch (Exception e) {
+			log.error(e.getMessage());
+			return null;
+		}
+	}
+
+	private class RainDataCountTask implements Callable<Integer> {
+
+		private Date countTime;
+
+		public RainDataCountTask(Date countTime) {
+			this.countTime = countTime;
+		}
+
+		@Override
+		public Integer call() throws Exception {
+			try {
+				log.info("雨量统计任务开始执行 {}", Func.formatDateTime(countTime));
+				LambdaQueryWrapper<RtuDataRainEntity> dataWrapper = Wrappers.<RtuDataRainEntity>query().lambda();
+				dataWrapper.eq(RtuDataRainEntity::getIsDeleted, 0);
+				List<RtuDataRainEntity> list = rainService.list(dataWrapper);
+				if (null != list && list.size() > 0) {
+					List<RtuDataRainH1Entity> h1EntityList = new LinkedList<>();
+					List<RtuDataRainH3Entity> h3EntityList = new LinkedList<>();
+					List<RtuDataRainH6Entity> h6EntityList = new LinkedList<>();
+					List<RtuDataRainH12Entity> h12EntityList = new LinkedList<>();
+					List<RtuDataRainH24Entity> h24EntityList = new LinkedList<>();
+					Calendar calendar = Calendar.getInstance();
+					//近1小时
+					calendar.setTime(countTime);
+					calendar.set(Calendar.SECOND, 0);
+					calendar.add(Calendar.HOUR_OF_DAY, -1);
+					log.info("近1小时统计时间 {}", Func.formatDateTime(calendar.getTime()));
+					Date h1Time = calendar.getTime();
+					//近3小时
+					calendar.setTime(countTime);
+					calendar.set(Calendar.SECOND, 0);
+					calendar.add(Calendar.HOUR_OF_DAY, -3);
+					log.info("近3小时统计时间 {}", Func.formatDateTime(calendar.getTime()));
+					Date h3Time = calendar.getTime();
+					//近6小时
+					calendar.setTime(countTime);
+					calendar.set(Calendar.SECOND, 0);
+					calendar.add(Calendar.HOUR_OF_DAY, -6);
+					log.info("近6小时统计时间 {}", Func.formatDateTime(calendar.getTime()));
+					Date h6Time = calendar.getTime();
+					//近12小时
+					calendar.setTime(countTime);
+					calendar.set(Calendar.SECOND, 0);
+					calendar.add(Calendar.HOUR_OF_DAY, -12);
+					log.info("近12小时统计时间 {}", Func.formatDateTime(calendar.getTime()));
+					Date h12Time = calendar.getTime();
+					//近24小时
+					calendar.setTime(countTime);
+					calendar.set(Calendar.SECOND, 0);
+					calendar.add(Calendar.HOUR_OF_DAY, -24);
+					log.info("近24小时统计时间 {}", Func.formatDateTime(countTime));
+					Date h24Time = calendar.getTime();
+					for (RtuDataRainEntity entity : list) {
+						//log.info("upcount code {}", entity.getRtuCode());
+						Double h1Drp = 0.0;
+						Double h3Drp = 0.0;
+						Double h6Drp = 0.0;
+						Double h12Drp = 0.0;
+						Double h24Drp = 0.0;
+
+//						RtuDataRainDTO dataRainDTO = new RtuDataRainDTO();
+//						dataRainDTO.setRtuCode(entity.getRtuCode());
+//						dataRainDTO.setBeginTime(h1Time);
+//						Double drp = rainStoreService.rainDrpCount(dataRainDTO);
+//						if (null != drp) {
+//							h1Drp = drp;
+//						}
+//						dataRainDTO.setBeginTime(h3Time);
+//						drp = rainStoreService.rainDrpCount(dataRainDTO);
+//						if (null != drp) {
+//							h3Drp = drp;
+//						}
+//						dataRainDTO.setBeginTime(h6Time);
+//						drp = rainStoreService.rainDrpCount(dataRainDTO);
+//						if (null != drp) {
+//							h6Drp = drp;
+//						}
+//						dataRainDTO.setBeginTime(h12Time);
+//						drp = rainStoreService.rainDrpCount(dataRainDTO);
+//						if (null != drp) {
+//							h12Drp = drp;
+//						}
+//						dataRainDTO.setBeginTime(h24Time);
+//						drp = rainStoreService.rainDrpCount(dataRainDTO);
+//						if (null != drp) {
+//							h24Drp = drp;
+//						}
+
+
+						RtuDataRainDTO dataRainDTO = new RtuDataRainDTO();
+						dataRainDTO.setRtuCode(entity.getRtuCode());
+						dataRainDTO.setBeginTime(h24Time);
+						List<RtuDataRainStoreEntity> rainStoreEntityList = rainStoreService.selectList(dataRainDTO);
+						if (rainStoreEntityList != null && rainStoreEntityList.size() > 0) {
+							for (RtuDataRainStoreEntity rainStoreEntity : rainStoreEntityList) {
+								//近1小时
+								if (rainStoreEntity.getTm().after(h1Time)) {
+									h1Drp += rainStoreEntity.getDrp();
+								}
+								//近3小时
+								if (rainStoreEntity.getTm().after(h3Time)) {
+									h3Drp += rainStoreEntity.getDrp();
+								}
+								//近6小时
+								if (rainStoreEntity.getTm().after(h6Time)) {
+									h6Drp += rainStoreEntity.getDrp();
+								}
+								//近12小时
+								if (rainStoreEntity.getTm().after(h12Time)) {
+									h12Drp += rainStoreEntity.getDrp();
+								}
+								//近24小时
+								h24Drp += rainStoreEntity.getDrp();
+							}
+						}
+
+						RtuDataRainH1Entity h1Entity = updateH1RainData(countTime, entity.getRtuCode(), h1Drp);
+						if (h1Entity != null) {
+							h1EntityList.add(h1Entity);
+						}
+						RtuDataRainH3Entity h3Entity = updateH3RainData(countTime, entity.getRtuCode(), h3Drp);
+						if (h3Entity != null) {
+							h3EntityList.add(h3Entity);
+						}
+						RtuDataRainH6Entity h6Entity = updateH6RainData(countTime, entity.getRtuCode(), h6Drp);
+						if (h6Entity != null) {
+							h6EntityList.add(h6Entity);
+						}
+						RtuDataRainH12Entity h12Entity = updateH12RainData(countTime, entity.getRtuCode(), h12Drp);
+						if (h12Entity != null) {
+							h12EntityList.add(h12Entity);
+						}
+						RtuDataRainH24Entity h24Entity = updateH24RainData(countTime, entity.getRtuCode(), h24Drp);
+						if (h24Entity != null) {
+							h24EntityList.add(h24Entity);
+						}
+					}
+					h1Service.saveOrUpdateBatch(h1EntityList);
+					h3Service.saveOrUpdateBatch(h3EntityList);
+					h6Service.saveOrUpdateBatch(h6EntityList);
+					h12Service.saveOrUpdateBatch(h12EntityList);
+					h24Service.saveOrUpdateBatch(h24EntityList);
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+				log.error("雨量数据统计任务异常 {}", e.getMessage());
+			} finally {
+				log.error("雨量数据统计任务完成 {} 毫秒", System.currentTimeMillis() - countTime.getTime());
+			}
+			return 0;
+		}
+	}
+}

+ 725 - 0
NMSZYYWXT/src/main/java/org/springblade/jobtask/ReportCountProcessor.java

@@ -0,0 +1,725 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 山洪灾害运维系统
+ * 创建日期:2023/8/7
+ */
+package org.springblade.jobtask;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder;
+import org.springblade.constant.BusinessConstant;
+import org.springblade.constant.DictBusinessConstant;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.enums.OrderCloseEnum;
+import org.springblade.enums.OrderConfirmEnum;
+import org.springblade.enums.OrderStatusEnum;
+import org.springblade.enums.WarnKindEnum;
+import org.springblade.modules.baseinfo.dict.entity.DictInfoEntity;
+import org.springblade.modules.baseinfo.dict.service.IBaseInfoDictService;
+import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
+import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
+import org.springblade.modules.baseinfo.region.entity.RegionInfoEntity;
+import org.springblade.modules.baseinfo.region.service.IBaseInfoRegionService;
+import org.springblade.modules.baseinfo.rtu.dto.RtuInfoDTO;
+import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.business.check.order.dto.CheckOrderInfoDTO;
+import org.springblade.modules.business.check.order.service.IRtuCheckOrderService;
+import org.springblade.modules.business.check.process.service.IRtuOrderProcessService;
+import org.springblade.modules.business.check.process.vo.OrderProcessInfoVO;
+import org.springblade.modules.business.rtumanage.dto.RtuStatusDTO;
+import org.springblade.modules.business.rtumanage.service.IRtuManageService;
+import org.springblade.modules.business.warning.dto.RtuWarningInfoDTO;
+import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
+import org.springblade.modules.business.warning.service.IRtuWarningService;
+import org.springblade.modules.report.entity.*;
+import org.springblade.modules.report.service.*;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.service.IDeptService;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.*;
+
+/***
+ * Date:2023/8/7
+ * Title:报表统计
+ * Description:按自治区进行周报统计、按盟市统计维修任务信息
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+@Component
+@EnableScheduling
+public class ReportCountProcessor {
+	private static ThreadFactory reportCountThreadFactory = new ThreadFactoryBuilder().setNameFormat("report-count-thread-pool-%d").build();
+	private static ExecutorService reportCountThreadPool = new ThreadPoolExecutor(1, 1,
+		0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), reportCountThreadFactory, new ThreadPoolExecutor.AbortPolicy());
+
+
+	@Resource
+	private IWeekOrgCountService weekReportService;
+
+	@Resource
+	private IWeekOrgRtuFailureService weekOrgRtuFailureService;
+
+	@Resource
+	private IWeekOrgCheckOrderService weekOrgCheckOrderService;
+
+	@Resource
+	private IWeekOrgRtuUpService weekOrgRtuUpService;
+
+	@Resource
+	private IWeekOrgCheckOrderReportService weekOrgCheckOrderReportService;
+
+	@Resource
+	private IWeekOrgEquipmentReplaceService weekOrgEquipmentReplaceService;
+
+	@Resource
+	private IWeekOrgCheckOrderDayService orgCheckOrderDayService;
+
+	@Resource
+	private IRtuBaseInfoService rtuBaseInfoService;
+
+	@Resource
+	private IRtuCheckOrderService checkOrderService;
+
+	@Resource
+	private IRtuOrderProcessService orderProcessService;
+
+	@Resource
+	private IRtuWarningService rtuWarningService;
+
+	@Resource
+	private IBaseInfoDictService dictService;
+
+	@Resource
+	private IDeptRegionService deptRegionService;
+
+	@Resource
+	private IBaseInfoRegionService regionService;
+
+	@Resource
+	private IDeptService deptService;
+
+	@Resource
+	private IRtuManageService rtuManageService;
+
+	@Value("${spring.task-config.report-task}")
+	private boolean reportTaskRun;
+
+//	@Scheduled(cron = "10 0 0 * * MON")
+	public void reportWeekOrgCountTask() {
+		if (reportTaskRun) {
+			Date dt = new Date();
+			log.info("周报表统计任务创建 {}", Func.formatDateTime(dt));
+			WeekOrgCountTask task = new WeekOrgCountTask(dt);
+			FutureTask<Integer> futureTask = new FutureTask<>(task);
+			reportCountThreadPool.execute(futureTask);
+		}
+	}
+
+//	@Scheduled(cron = "20 0 0 0/1 * *")
+	public void reportWeekOrgOrderDayCountTask() {
+		if (reportTaskRun) {
+			Date dt = new Date();
+			log.info("盟市按日维修任务数据统计任务创建 {}", Func.formatDateTime(dt));
+			WeekOrgDayCountTask task = new WeekOrgDayCountTask(dt);
+			FutureTask<Integer> futureTask = new FutureTask<>(task);
+			reportCountThreadPool.execute(futureTask);
+		}
+	}
+
+//	@Scheduled(cron = "30 0 0 1 * * ")
+	public void reportMonthCountTask() {
+		try {
+			if (reportTaskRun) {
+				Date dt = new Date();
+				log.info("月统计任务创建 {}", Func.formatDateTime(dt));
+			}
+		} catch (Exception e) {
+			log.error("{}", e.getMessage());
+		}
+	}
+
+	private class WeekOrgDayCountTask implements Callable<Integer> {
+		private Date reportTime;
+
+		public WeekOrgDayCountTask(Date reportTime) {
+			this.reportTime = reportTime;
+		}
+
+		@Override
+		public Integer call() throws Exception {
+			try {
+				log.info("盟市周统计,按天统计维修任务 {} {}", Func.formatDateTime(reportTime), Func.formatDateTime(new Date()));
+				Calendar calendar = Calendar.getInstance();
+				calendar.setTime(reportTime);
+				calendar.set(Calendar.HOUR_OF_DAY, 0);
+				calendar.set(Calendar.MINUTE, 0);
+				calendar.set(Calendar.SECOND, 0);
+				calendar.set(Calendar.MILLISECOND, 0);
+				calendar.add(Calendar.DAY_OF_MONTH, -1);
+				log.info("统计日期  {}", Func.formatDateTime(calendar.getTime()));
+				LambdaQueryWrapper<WeekOrgCheckOrderDayInfoEntity> wrapper = Wrappers.<WeekOrgCheckOrderDayInfoEntity>query().lambda();
+				wrapper.eq(WeekOrgCheckOrderDayInfoEntity::getIsDeleted, 0);
+				wrapper.eq(WeekOrgCheckOrderDayInfoEntity::getCountTime, calendar.getTime());
+				long size = orgCheckOrderDayService.count(wrapper);
+				if (size == 0) {
+					calendar.setTime(reportTime);
+					calendar.set(Calendar.HOUR_OF_DAY, 0);
+					calendar.set(Calendar.MINUTE, 0);
+					calendar.set(Calendar.SECOND, 0);
+					calendar.set(Calendar.MILLISECOND, 0);
+					Date endTm = calendar.getTime();
+					calendar.add(Calendar.DAY_OF_MONTH, -1);
+					int day = calendar.get(Calendar.DAY_OF_WEEK);
+					String weekName = "";
+					if (1 == day) {
+						weekName = "周日";
+					} else if (2 == day) {
+						weekName = "周一";
+					} else if (3 == day) {
+						weekName = "周二";
+					} else if (4 == day) {
+						weekName = "周三";
+					} else if (5 == day) {
+						weekName = "周四";
+					} else if (6 == day) {
+						weekName = "周五";
+					} else if (7 == day) {
+						weekName = "周六";
+					}
+					Date startTm = calendar.getTime();
+					log.info("统计日期区间  {} {}", Func.formatDateTime(startTm), Func.formatDateTime(endTm));
+					String adCode = BusinessConstant.REGION_NM_ADCODE;
+					WeekOrgCheckOrderDayInfoEntity dayInfoEntity = new WeekOrgCheckOrderDayInfoEntity();
+					dayInfoEntity.setCountTime(calendar.getTime());
+					dayInfoEntity.setWeekName(weekName);
+					//任务总数
+					CheckOrderInfoDTO checkOrderInfoDTO = new CheckOrderInfoDTO();
+					checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+					checkOrderInfoDTO.setAdCode(adCode);
+					checkOrderInfoDTO.setReportEndDate(endTm);
+					long count = checkOrderService.orderCount(checkOrderInfoDTO);
+					dayInfoEntity.setOrderCount((int) count);
+
+					//未确认任务
+					checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CREATE.getCode());
+					checkOrderInfoDTO.setReportEndDate(endTm);
+					count = checkOrderService.orderCount(checkOrderInfoDTO);
+					dayInfoEntity.setUnconfirmOrderCount((int) count);
+
+					//处理中任务
+					checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
+					checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+					checkOrderInfoDTO.setReportEndDate(endTm);
+					DictInfoEntity biz = dictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_CONFIRM.getCode());
+					if (biz != null) {
+						checkOrderInfoDTO.setOrderStatusKey(biz.getId());
+					}
+					long unCloseOrderCount = checkOrderService.unCloseOrderCount(checkOrderInfoDTO);
+					dayInfoEntity.setProcessingOrderCount((int) unCloseOrderCount);
+
+					//已处理维修任务数量
+					checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
+					checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+					checkOrderInfoDTO.setReportStartDate(startTm);
+					checkOrderInfoDTO.setReportEndDate(endTm);
+					DictInfoEntity orderProcessDict = dictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_PROCESS.getCode());
+					if (orderProcessDict != null) {
+						checkOrderInfoDTO.setOrderStatusKey(orderProcessDict.getId());
+					}
+					long reports = checkOrderService.reportCount(checkOrderInfoDTO);
+					dayInfoEntity.setReportOrderCount((int) reports);
+
+					orgCheckOrderDayService.save(dayInfoEntity);
+				}
+
+			} catch (Exception e) {
+				e.printStackTrace();
+				log.error(e.getMessage());
+			} finally {
+				log.info("盟市周统计,按天统计维修任务,运行完成 {}", Func.formatDateTime(new Date()));
+			}
+			return 0;
+		}
+	}
+
+	private class WeekOrgCountTask implements Callable<Integer> {
+
+		private Date reportTime;
+
+		public WeekOrgCountTask(Date reportTime) {
+			this.reportTime = reportTime;
+		}
+
+		@Override
+		public Integer call() throws Exception {
+			try {
+				log.info("盟市周统计 {} {}", Func.formatDateTime(reportTime), Func.formatDateTime(new Date()));
+				Calendar calendar = Calendar.getInstance();
+				calendar.setTime(reportTime);
+				calendar.add(Calendar.WEEK_OF_MONTH, 0);
+				calendar.set(Calendar.DAY_OF_WEEK, 2);
+				calendar.set(Calendar.HOUR_OF_DAY, 0);
+				calendar.set(Calendar.MINUTE, 0);
+				calendar.set(Calendar.SECOND, 0);
+				calendar.set(Calendar.MILLISECOND, 0);
+				//统计第几周
+				int week = calendar.get(Calendar.WEEK_OF_MONTH);
+				if (week == 1) {
+					week = 4;
+				} else {
+					week = week - 1;
+				}
+				LambdaQueryWrapper<WeekOrgCountInfoEntity> wrapper = Wrappers.<WeekOrgCountInfoEntity>query().lambda();
+				wrapper.eq(WeekOrgCountInfoEntity::getIsDeleted, 0);
+				wrapper.eq(WeekOrgCountInfoEntity::getReportTime, calendar.getTime());
+				List<WeekOrgCountInfoEntity> weekReportInfoEntityList = weekReportService.list(wrapper);
+				if (null == weekReportInfoEntityList || weekReportInfoEntityList.size() == 0) {
+					String adCode = BusinessConstant.REGION_NM_ADCODE;
+					//生成周报主记录
+					WeekOrgCountInfoEntity entity = new WeekOrgCountInfoEntity();
+					entity.setName("weekorgcount.ureport.xml");
+					entity.setReportTime(calendar.getTime());
+					SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy年MM月dd日");
+					calendar.setTime(reportTime);
+					calendar.add(Calendar.WEEK_OF_MONTH, -1);
+					calendar.set(Calendar.DAY_OF_WEEK, 2);
+					calendar.set(Calendar.HOUR_OF_DAY, 0);
+					calendar.set(Calendar.MINUTE, 0);
+					calendar.set(Calendar.SECOND, 0);
+					calendar.set(Calendar.MILLISECOND, 0);
+					entity.setReportStartTime(calendar.getTime());
+					String weekTm1 = timeFormat.format(calendar.getTime());
+					calendar.add(Calendar.DAY_OF_MONTH, 6);
+					String weekTm2 = timeFormat.format(calendar.getTime());
+					calendar.add(Calendar.DAY_OF_MONTH, 1);
+					entity.setReportEndTime(calendar.getTime());
+					entity.setReportTitle("统计时间:" + weekTm1 + "-" + weekTm2 + "第" + week + "周");
+					//测站总数
+					RtuInfoDTO rtuInfoDTO = new RtuInfoDTO();
+					rtuInfoDTO.setAdCode(adCode);
+					long rtuCount = rtuBaseInfoService.rtuCount(rtuInfoDTO);
+					entity.setRtuCount((int) rtuCount);
+					//任务总数
+					CheckOrderInfoDTO checkOrderInfoDTO = new CheckOrderInfoDTO();
+					checkOrderInfoDTO.setAdCode(adCode);
+					checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+					checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+					long count = checkOrderService.orderCount(checkOrderInfoDTO);
+					entity.setCheckOrderCount((int) count);
+					//未确认任务
+					checkOrderInfoDTO = new CheckOrderInfoDTO();
+					checkOrderInfoDTO.setAdCode(adCode);
+					checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+					checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CREATE.getCode());
+					count = checkOrderService.orderCount(checkOrderInfoDTO);
+					entity.setUnconfirmOrderCount((int) count);
+					//处理中任务
+					checkOrderInfoDTO = new CheckOrderInfoDTO();
+					checkOrderInfoDTO.setAdCode(adCode);
+					checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+					checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
+					checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+					DictInfoEntity biz = dictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_CONFIRM.getCode());
+					if (biz != null) {
+						checkOrderInfoDTO.setOrderStatusKey(biz.getId());
+					}
+					count = checkOrderService.orderCount(checkOrderInfoDTO);
+					entity.setProcessingOrderCount((int) count);
+					//本周已处理维修任务数量
+					checkOrderInfoDTO = new CheckOrderInfoDTO();
+					checkOrderInfoDTO.setAdCode(adCode);
+					checkOrderInfoDTO.setReportStartDate(entity.getReportStartTime());
+					checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+					count = checkOrderService.orderReportCount(checkOrderInfoDTO);
+					entity.setReportCheckOrderCount((int) count);
+					//异常测站
+					RtuWarningInfoDTO warningInfoDTO = new RtuWarningInfoDTO();
+					warningInfoDTO.setAdCode(adCode);
+					warningInfoDTO.setEndDate(entity.getReportEndTime());
+					long warnCount = rtuWarningService.warningRtuCount(warningInfoDTO);
+					entity.setWarnRtuCount((int) warnCount);
+					//离线测站
+					warningInfoDTO = new RtuWarningInfoDTO();
+					warningInfoDTO.setAdCode(adCode);
+					warningInfoDTO.setEndDate(entity.getReportEndTime());
+					long offlineCount = rtuWarningService.warningOfflineRtuCount(warningInfoDTO);
+					entity.setOfflineRtuCount((int) offlineCount);
+					//其他异常测站
+					entity.setOthersWarnRtuCount((int) (warnCount - offlineCount));
+					weekReportService.save(entity);
+
+					//统计一周故障
+					Map<String, Integer> failureCountMap = new HashMap<>();
+					failureCountMap.put("rtu", 0);
+					failureCountMap.put("rainSensor", 0);
+					failureCountMap.put("waterLevelSensor", 0);
+					failureCountMap.put("groundLevelSensor", 0);
+					failureCountMap.put("bt", 0);
+					failureCountMap.put("sun", 0);
+					failureCountMap.put("net", 0);
+					failureCountMap.put("signl", 0);
+					checkOrderInfoDTO = new CheckOrderInfoDTO();
+					checkOrderInfoDTO.setAdCode(adCode);
+					checkOrderInfoDTO.setReportStartDate(entity.getReportStartTime());
+					checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+					DictInfoEntity orderProcessDict = dictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_PROCESS.getCode());
+					if (orderProcessDict != null) {
+						checkOrderInfoDTO.setOrderStatusKey(orderProcessDict.getId());
+					}
+					List<OrderProcessInfoVO> processInfoVOList = orderProcessService.selectReportList(checkOrderInfoDTO);
+					if (null != processInfoVOList && processInfoVOList.size() > 0) {
+						for (OrderProcessInfoVO processInfoVO : processInfoVOList) {
+							StringBuilder stringBuffer = new StringBuilder();
+							if (null != processInfoVO.getRtuStatus() && processInfoVO.getRtuStatus() == 1) {
+								stringBuffer.append("站点故障;");
+							}
+							if (null != processInfoVO.getRtuReplace() && processInfoVO.getRtuReplace() == 1) {
+								int v = failureCountMap.get("rtu");
+								v += 1;
+								failureCountMap.put("rtu", v);
+								stringBuffer.append("更换RTU;");
+							}
+							if (null != processInfoVO.getRainSensorReplace() && processInfoVO.getRainSensorReplace() == 1) {
+								int v = failureCountMap.get("rainSensor");
+								v += 1;
+								failureCountMap.put("rainSensor", v);
+								stringBuffer.append("更换雨量计;");
+							}
+							if (null != processInfoVO.getWaterSensorReplace() && processInfoVO.getWaterSensorReplace() == 1) {
+								int v = failureCountMap.get("waterLevelSensor");
+								v += 1;
+								failureCountMap.put("waterLevelSensor", v);
+								stringBuffer.append("更换水位计;");
+							}
+							if (null != processInfoVO.getGroundSensorReplace() && processInfoVO.getGroundSensorReplace() == 1) {
+								int v = failureCountMap.get("groundLevelSensor");
+								v += 1;
+								failureCountMap.put("groundLevelSensor", v);
+								stringBuffer.append("更换墒情计;");
+							}
+							if (null != processInfoVO.getBatteryReplace() && processInfoVO.getBatteryReplace() == 1) {
+								int v = failureCountMap.get("bt");
+								v += 1;
+								failureCountMap.put("bt", v);
+								stringBuffer.append("更换蓄电池;");
+							}
+							if (null != processInfoVO.getSunPowerReplace() && processInfoVO.getSunPowerReplace() == 1) {
+								int v = failureCountMap.get("sun");
+								v += 1;
+								failureCountMap.put("sun", v);
+								stringBuffer.append("更换太阳能板;");
+							}
+							if (null != processInfoVO.getNetworkOverdue() && processInfoVO.getNetworkOverdue() == 1) {
+								int v = failureCountMap.get("net");
+								v += 1;
+								failureCountMap.put("net", v);
+								stringBuffer.append("物联网卡欠费;");
+							}
+							if (null != processInfoVO.getNetworkStatus() && processInfoVO.getNetworkStatus() == 1) {
+								int v = failureCountMap.get("signl");
+								v += 1;
+								failureCountMap.put("signl", v);
+								stringBuffer.append("网络故障;");
+							}
+
+							//一周站点维修信息清单
+							WeekOrgCheckOrderReportInfoEntity reportInfoEntity = new WeekOrgCheckOrderReportInfoEntity();
+							reportInfoEntity.setReportId(entity.getId());
+							reportInfoEntity.setOrgName(processInfoVO.getAdCity());
+							reportInfoEntity.setRtuName(processInfoVO.getRtuName());
+							reportInfoEntity.setOrderId(processInfoVO.getOrderId());
+							if (null != processInfoVO.getWarnId()) {
+								RtuWarningInfoEntity rtuWarningInfoEntity = rtuWarningService.getById(processInfoVO.getWarnId());
+								if (null != rtuWarningInfoEntity) {
+									String warnKinds = "";
+									if (WarnKindEnum.WARN_CLOCK.getCode() == rtuWarningInfoEntity.getWarningKind()) {
+										warnKinds = "测站时钟异常";
+									} else if (WarnKindEnum.WARN_UP_MIN_DELAY.getCode() == rtuWarningInfoEntity.getWarningKind()) {
+										warnKinds = "5分钟上报延时";
+									} else if (WarnKindEnum.WARN_OFFLINE.getCode() == rtuWarningInfoEntity.getWarningKind()) {
+										warnKinds = "测站离线";
+									} else if (WarnKindEnum.WARN_RAIN_MISS_OUT.getCode() == rtuWarningInfoEntity.getWarningKind()) {
+										warnKinds = "雨量站小时报漏报";
+									} else if (WarnKindEnum.WARN_WL_MISS_OUT.getCode() == rtuWarningInfoEntity.getWarningKind()) {
+										warnKinds = "水位站小时报漏报";
+									} else if (WarnKindEnum.WARN_OUTLIER_VALUE.getCode() == rtuWarningInfoEntity.getWarningKind()) {
+										warnKinds = "雨量疑似异常值";
+									} else if (WarnKindEnum.WARN_RAIN_UP_HOUR_DELAY.getCode() == rtuWarningInfoEntity.getWarningKind()) {
+										warnKinds = "雨量站小时上报延时";
+									} else if (WarnKindEnum.WARN_WL_UP_HOUR_DELAY.getCode() == rtuWarningInfoEntity.getWarningKind()) {
+										warnKinds = "水位站小时上报延时";
+									}
+									reportInfoEntity.setWarnInfo(warnKinds);
+								}
+							}
+							if (stringBuffer.toString().length() > 0) {
+								reportInfoEntity.setProcessDesc(stringBuffer.toString());
+							} else {
+								reportInfoEntity.setProcessDesc(processInfoVO.getProcessDesc());
+							}
+							weekOrgCheckOrderReportService.save(reportInfoEntity);
+						}
+					}
+					WeekOrgRtuFailureInfoEntity failureInfoEntity = new WeekOrgRtuFailureInfoEntity();
+					failureInfoEntity.setReportId(entity.getId());
+					failureInfoEntity.setEquipmentName("RTU");
+					failureInfoEntity.setFailureCount(failureCountMap.get("rtu"));
+					weekOrgRtuFailureService.save(failureInfoEntity);
+					failureInfoEntity = new WeekOrgRtuFailureInfoEntity();
+					failureInfoEntity.setReportId(entity.getId());
+					failureInfoEntity.setEquipmentName("雨量计");
+					failureInfoEntity.setFailureCount(failureCountMap.get("rainSensor"));
+					weekOrgRtuFailureService.save(failureInfoEntity);
+					failureInfoEntity = new WeekOrgRtuFailureInfoEntity();
+					failureInfoEntity.setReportId(entity.getId());
+					failureInfoEntity.setEquipmentName("水位计");
+					failureInfoEntity.setFailureCount(failureCountMap.get("waterLevelSensor"));
+					weekOrgRtuFailureService.save(failureInfoEntity);
+					failureInfoEntity = new WeekOrgRtuFailureInfoEntity();
+					failureInfoEntity.setReportId(entity.getId());
+					failureInfoEntity.setEquipmentName("墒情计");
+					failureInfoEntity.setFailureCount(failureCountMap.get("groundLevelSensor"));
+					weekOrgRtuFailureService.save(failureInfoEntity);
+					failureInfoEntity = new WeekOrgRtuFailureInfoEntity();
+					failureInfoEntity.setReportId(entity.getId());
+					failureInfoEntity.setEquipmentName("蓄电池");
+					failureInfoEntity.setFailureCount(failureCountMap.get("bt"));
+					weekOrgRtuFailureService.save(failureInfoEntity);
+					failureInfoEntity = new WeekOrgRtuFailureInfoEntity();
+					failureInfoEntity.setReportId(entity.getId());
+					failureInfoEntity.setEquipmentName("太阳能板");
+					failureInfoEntity.setFailureCount(failureCountMap.get("sun"));
+					weekOrgRtuFailureService.save(failureInfoEntity);
+					failureInfoEntity = new WeekOrgRtuFailureInfoEntity();
+					failureInfoEntity.setReportId(entity.getId());
+					failureInfoEntity.setEquipmentName("物联网卡欠费");
+					failureInfoEntity.setFailureCount(failureCountMap.get("net"));
+					weekOrgRtuFailureService.save(failureInfoEntity);
+					failureInfoEntity = new WeekOrgRtuFailureInfoEntity();
+					failureInfoEntity.setReportId(entity.getId());
+					failureInfoEntity.setEquipmentName("网络信号故障");
+					failureInfoEntity.setFailureCount(failureCountMap.get("signl"));
+					weekOrgRtuFailureService.save(failureInfoEntity);
+
+					//统计维修任务、上报率
+					LambdaQueryWrapper<Dept> deptwrapper = Wrappers.<Dept>query().lambda();
+					deptwrapper.eq(Dept::getIsDeleted, 0);
+					deptwrapper.eq(Dept::getParentId, BusinessConstant.DEPT_XAM_ID);
+					List<Dept> root = deptService.list(deptwrapper);
+					for (Dept dept : root) {
+						WeekOrgCheckOrderInfoEntity weekOrgCheckOrderInfoEntity = new WeekOrgCheckOrderInfoEntity();
+						weekOrgCheckOrderInfoEntity.setReportId(entity.getId());
+						weekOrgCheckOrderInfoEntity.setOrgName(dept.getDeptName());
+						LambdaQueryWrapper<DeptRegionEntity> deptLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+						deptLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, dept.getId());
+						DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptLambdaQueryWrapper);
+						LambdaQueryWrapper<RegionInfoEntity> nodeQueryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+						nodeQueryWrapper.eq(RegionInfoEntity::getAdcd, deptRegionEntity.getAdcd());
+						RegionInfoEntity nodeRegion = regionService.getOne(nodeQueryWrapper);
+						int excludecode = 0;
+						if (nodeRegion.getParentCode().equals(BusinessConstant.REGION_NM_ADCODE)) {
+							excludecode = 1;
+						}
+						//按盟市统计维修任务
+						checkOrderInfoDTO = new CheckOrderInfoDTO();
+						checkOrderInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+						checkOrderInfoDTO.setExcludeCode(excludecode);
+						checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+						//任务数量
+						checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+						long orderCount = checkOrderService.orderCount(checkOrderInfoDTO);
+						weekOrgCheckOrderInfoEntity.setOrderCount((int) orderCount);
+						//未确认
+						checkOrderInfoDTO = new CheckOrderInfoDTO();
+						checkOrderInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+						checkOrderInfoDTO.setExcludeCode(excludecode);
+						checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+						checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+						checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CREATE.getCode());
+						count = checkOrderService.unconfirmOrderCount(checkOrderInfoDTO);
+						weekOrgCheckOrderInfoEntity.setUnconfirmOrderCount((int) count);
+						//处理中
+						checkOrderInfoDTO = new CheckOrderInfoDTO();
+						checkOrderInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+						checkOrderInfoDTO.setExcludeCode(excludecode);
+						checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+						checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+						checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
+						biz = dictService.getDict(DictBusinessConstant.ORDER_STATUS_CODE, OrderStatusEnum.STATUS_CONFIRM.getCode());
+						if (biz != null) {
+							checkOrderInfoDTO.setOrderStatusKey(biz.getId());
+						}
+						count = checkOrderService.unCloseOrderCount(checkOrderInfoDTO);
+						weekOrgCheckOrderInfoEntity.setProcessingOrderCount((int) count);
+						//已处理
+						checkOrderInfoDTO = new CheckOrderInfoDTO();
+						checkOrderInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+						checkOrderInfoDTO.setExcludeCode(excludecode);
+						checkOrderInfoDTO.setReportStartDate(entity.getReportStartTime());
+						checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+						long reportCount = checkOrderService.orderReportCount(checkOrderInfoDTO);
+						weekOrgCheckOrderInfoEntity.setReportOrderCount((int) reportCount);
+						weekOrgCheckOrderService.save(weekOrgCheckOrderInfoEntity);
+
+						//盟市上报率统计
+						WeekOrgRtuUpInfoEntity weekOrgRtuUpInfoEntity = new WeekOrgRtuUpInfoEntity();
+						weekOrgRtuUpInfoEntity.setReportId(entity.getId());
+						weekOrgRtuUpInfoEntity.setOrgName(dept.getDeptName());
+						rtuInfoDTO = new RtuInfoDTO();
+						rtuInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+						rtuInfoDTO.setExcludeCode(excludecode);
+						count = rtuBaseInfoService.rtuCount(rtuInfoDTO);
+						weekOrgRtuUpInfoEntity.setRtuCount(count);
+						RtuStatusDTO rtuStatusDTO = new RtuStatusDTO();
+						rtuStatusDTO.setAdCode(deptRegionEntity.getAdcd());
+						rtuStatusDTO.setExcludeCode(excludecode);
+						rtuStatusDTO.setBeginTime(entity.getReportStartTime());
+						rtuStatusDTO.setEndTime(entity.getReportEndTime());
+						count = rtuManageService.rtuUpDataCount(rtuStatusDTO);
+						weekOrgRtuUpInfoEntity.setUpCount(count);
+						weekOrgRtuUpService.save(weekOrgRtuUpInfoEntity);
+
+						//一周站点设备更换信息
+						Map<String, Integer> orgEquipmentReplace = new HashMap<>();
+						orgEquipmentReplace.put("rtu", 0);
+						orgEquipmentReplace.put("rainSensor", 0);
+						orgEquipmentReplace.put("waterLevelSensor", 0);
+						orgEquipmentReplace.put("groundLevelSensor", 0);
+						orgEquipmentReplace.put("bt", 0);
+						orgEquipmentReplace.put("sun", 0);
+						orgEquipmentReplace.put("net", 0);
+						checkOrderInfoDTO = new CheckOrderInfoDTO();
+						checkOrderInfoDTO.setExcludeCode(excludecode);
+						checkOrderInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+						checkOrderInfoDTO.setReportStartDate(entity.getReportStartTime());
+						checkOrderInfoDTO.setReportEndDate(entity.getReportEndTime());
+						if (orderProcessDict != null) {
+							checkOrderInfoDTO.setOrderStatusKey(orderProcessDict.getId());
+						}
+						processInfoVOList = orderProcessService.selectReportList(checkOrderInfoDTO);
+						if (null != processInfoVOList && processInfoVOList.size() > 0) {
+							for (OrderProcessInfoVO processInfoVO : processInfoVOList) {
+								if (null != processInfoVO.getRtuReplace() && processInfoVO.getRtuReplace() == 1) {
+									int v = orgEquipmentReplace.get("rtu");
+									v += 1;
+									orgEquipmentReplace.put("rtu", v);
+								}
+								if (null != processInfoVO.getRainSensorReplace() && processInfoVO.getRainSensorReplace() == 1) {
+									int v = orgEquipmentReplace.get("rainSensor");
+									v += 1;
+									orgEquipmentReplace.put("rainSensor", v);
+								}
+								if (null != processInfoVO.getWaterSensorReplace() && processInfoVO.getWaterSensorReplace() == 1) {
+									int v = orgEquipmentReplace.get("waterLevelSensor");
+									v += 1;
+									orgEquipmentReplace.put("waterLevelSensor", v);
+								}
+								if (null != processInfoVO.getGroundSensorReplace() && processInfoVO.getGroundSensorReplace() == 1) {
+									int v = orgEquipmentReplace.get("groundLevelSensor");
+									v += 1;
+									orgEquipmentReplace.put("groundLevelSensor", v);
+								}
+								if (null != processInfoVO.getBatteryReplace() && processInfoVO.getBatteryReplace() == 1) {
+									int v = orgEquipmentReplace.get("bt");
+									v += 1;
+									orgEquipmentReplace.put("bt", v);
+								}
+								if (null != processInfoVO.getSunPowerReplace() && processInfoVO.getSunPowerReplace() == 1) {
+									int v = orgEquipmentReplace.get("sun");
+									v += 1;
+									orgEquipmentReplace.put("sun", v);
+								}
+								if (null != processInfoVO.getNetworkOverdue() && processInfoVO.getNetworkOverdue() == 1) {
+									int v = orgEquipmentReplace.get("net");
+									v += 1;
+									orgEquipmentReplace.put("net", v);
+								}
+							}
+						}
+						//一周站点更换信息清单
+						int replaceCount = orgEquipmentReplace.get("rtu");
+						if (replaceCount > 0) {
+							WeekOrgEquipmentReplaceInfoEntity equipmentReplaceInfoEntity = new WeekOrgEquipmentReplaceInfoEntity();
+							equipmentReplaceInfoEntity.setReportId(entity.getId());
+							equipmentReplaceInfoEntity.setOrgName(dept.getDeptName());
+							equipmentReplaceInfoEntity.setEquipmentName("RTU");
+							equipmentReplaceInfoEntity.setReplaceCount(replaceCount);
+							weekOrgEquipmentReplaceService.save(equipmentReplaceInfoEntity);
+						}
+						replaceCount = orgEquipmentReplace.get("rainSensor");
+						if (replaceCount > 0) {
+							WeekOrgEquipmentReplaceInfoEntity equipmentReplaceInfoEntity = new WeekOrgEquipmentReplaceInfoEntity();
+							equipmentReplaceInfoEntity.setReportId(entity.getId());
+							equipmentReplaceInfoEntity.setOrgName(dept.getDeptName());
+							equipmentReplaceInfoEntity.setEquipmentName("雨量计");
+							equipmentReplaceInfoEntity.setReplaceCount(replaceCount);
+							weekOrgEquipmentReplaceService.save(equipmentReplaceInfoEntity);
+						}
+						replaceCount = orgEquipmentReplace.get("waterLevelSensor");
+						if (replaceCount > 0) {
+							WeekOrgEquipmentReplaceInfoEntity equipmentReplaceInfoEntity = new WeekOrgEquipmentReplaceInfoEntity();
+							equipmentReplaceInfoEntity.setReportId(entity.getId());
+							equipmentReplaceInfoEntity.setOrgName(dept.getDeptName());
+							equipmentReplaceInfoEntity.setEquipmentName("水位计");
+							equipmentReplaceInfoEntity.setReplaceCount(replaceCount);
+							weekOrgEquipmentReplaceService.save(equipmentReplaceInfoEntity);
+						}
+						replaceCount = orgEquipmentReplace.get("groundLevelSensor");
+						if (replaceCount > 0) {
+							WeekOrgEquipmentReplaceInfoEntity equipmentReplaceInfoEntity = new WeekOrgEquipmentReplaceInfoEntity();
+							equipmentReplaceInfoEntity.setReportId(entity.getId());
+							equipmentReplaceInfoEntity.setOrgName(dept.getDeptName());
+							equipmentReplaceInfoEntity.setEquipmentName("墒情计");
+							equipmentReplaceInfoEntity.setReplaceCount(replaceCount);
+							weekOrgEquipmentReplaceService.save(equipmentReplaceInfoEntity);
+						}
+						replaceCount = orgEquipmentReplace.get("bt");
+						if (replaceCount > 0) {
+							WeekOrgEquipmentReplaceInfoEntity equipmentReplaceInfoEntity = new WeekOrgEquipmentReplaceInfoEntity();
+							equipmentReplaceInfoEntity.setReportId(entity.getId());
+							equipmentReplaceInfoEntity.setOrgName(dept.getDeptName());
+							equipmentReplaceInfoEntity.setEquipmentName("蓄电池");
+							equipmentReplaceInfoEntity.setReplaceCount(replaceCount);
+							weekOrgEquipmentReplaceService.save(equipmentReplaceInfoEntity);
+						}
+						replaceCount = orgEquipmentReplace.get("sun");
+						if (replaceCount > 0) {
+							WeekOrgEquipmentReplaceInfoEntity equipmentReplaceInfoEntity = new WeekOrgEquipmentReplaceInfoEntity();
+							equipmentReplaceInfoEntity.setReportId(entity.getId());
+							equipmentReplaceInfoEntity.setOrgName(dept.getDeptName());
+							equipmentReplaceInfoEntity.setEquipmentName("太阳能板");
+							equipmentReplaceInfoEntity.setReplaceCount(replaceCount);
+							weekOrgEquipmentReplaceService.save(equipmentReplaceInfoEntity);
+						}
+						replaceCount = orgEquipmentReplace.get("net");
+						if (replaceCount > 0) {
+							WeekOrgEquipmentReplaceInfoEntity equipmentReplaceInfoEntity = new WeekOrgEquipmentReplaceInfoEntity();
+							equipmentReplaceInfoEntity.setReportId(entity.getId());
+							equipmentReplaceInfoEntity.setOrgName(dept.getDeptName());
+							equipmentReplaceInfoEntity.setEquipmentName("物联网卡欠费");
+							equipmentReplaceInfoEntity.setReplaceCount(replaceCount);
+							weekOrgEquipmentReplaceService.save(equipmentReplaceInfoEntity);
+						}
+					}
+				}
+			} catch (Exception e) {
+				log.error("{}", e.getMessage());
+			} finally {
+				log.info("周统计结束 {}", Func.formatDateTime(new Date()));
+			}
+			return 0;
+		}
+	}
+}

+ 279 - 0
NMSZYYWXT/src/main/java/org/springblade/jobtask/RtuUpCountProcessor.java

@@ -0,0 +1,279 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 山洪灾害运维系统
+ * 创建日期:2023/8/21
+ */
+package org.springblade.jobtask;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
+import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.business.data.dto.*;
+import org.springblade.modules.business.data.service.*;
+import org.springblade.modules.business.upcount.dto.RtuUpCountInfoDTO;
+import org.springblade.modules.business.upcount.entity.RtuUpCountInfoEntity;
+import org.springblade.modules.business.upcount.service.IRtuUpCountService;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.*;
+
+/***
+ * Date:2023/8/21
+ * Title: 测站上报率统计
+ * Description:按小时统计上报率,按天统计上报率
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+@Component
+@EnableScheduling
+public class RtuUpCountProcessor {
+	private static ThreadFactory upCountThreadFactory = new ThreadFactoryBuilder().setNameFormat("up-count-thread-pool-%d").build();
+	private static ExecutorService upCountThreadPool = new ThreadPoolExecutor(1, 1,
+		0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), upCountThreadFactory, new ThreadPoolExecutor.AbortPolicy());
+
+	@Resource
+	private IRtuUpCountService upCountService;
+
+	@Resource
+	private IRtuBaseInfoService rtuBaseInfoService;
+
+	@Resource
+	private IRtuDataRainStoreService rainStoreService;
+
+	@Resource
+	private IRtuDataWaterLevelStoreService waterLevelStoreService;
+
+	@Resource
+	private IRtuDataGroundStoreService groundStoreService;
+
+	@Value("${spring.task-config.rtu-datagram-up-task}")
+	private boolean rtuDatagramUpRun;
+
+
+//	@Scheduled(cron = "10 0 0/1 * * *")
+	public void upHourCountTask() {
+		if(rtuDatagramUpRun) {
+			log.info("按小时上报率统计任务创建 {}", Func.formatDateTime(new Date()));
+			UpHourCountTask task = new UpHourCountTask(LocalDateTime.now());
+			FutureTask<Integer> futureTask = new FutureTask<>(task);
+			upCountThreadPool.execute(futureTask);
+		}
+	}
+
+//	@Scheduled(cron = "20 0 0 0/1 * *")
+	public void upDayCountTask() {
+		if(rtuDatagramUpRun) {
+			log.info("按天上报率统计任务创建 {}", Func.formatDateTime(new Date()));
+			UpDayCountTask task = new UpDayCountTask(LocalDateTime.now());
+			FutureTask<Integer> futureTask = new FutureTask<>(task);
+			upCountThreadPool.execute(futureTask);
+		}
+	}
+
+	private class UpHourCountTask implements Callable<Integer> {
+		private LocalDateTime checkTime;
+
+		public UpHourCountTask(LocalDateTime checkTime) {
+			this.checkTime = checkTime;
+		}
+
+		@Override
+		public Integer call() throws Exception {
+			LambdaQueryWrapper<RtuInfoEntity> rtuWrapper = Wrappers.<RtuInfoEntity>query().lambda();
+			rtuWrapper.eq(RtuInfoEntity::getIsDeleted, 0);
+			List<RtuInfoEntity> list = rtuBaseInfoService.list(rtuWrapper);
+			for (RtuInfoEntity entity : list) {
+				//统计雨量站
+				if (entity.getIsRain() != null && entity.getIsRain() == 1) {
+					LambdaQueryWrapper<RtuUpCountInfoEntity> wrapper = Wrappers.<RtuUpCountInfoEntity>query().lambda();
+					wrapper.eq(RtuUpCountInfoEntity::getRtuCode, entity.getRtuCode());
+					wrapper.eq(RtuUpCountInfoEntity::getTimeKind, 1);
+					wrapper.eq(RtuUpCountInfoEntity::getUpKind, 1);
+					LocalDateTime et = checkTime.withMinute(0).withSecond(0).withNano(0);
+					LocalDateTime st = et.minusHours(1);
+					wrapper.eq(RtuUpCountInfoEntity::getCountTime, Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+					long count = upCountService.count(wrapper);
+					if (count == 0) {
+						RtuDataRainDTO dataRainDTO = new RtuDataRainDTO();
+						dataRainDTO.setRtuCode(entity.getRtuCode());
+						dataRainDTO.setBeginTime(Date.from(st.atZone(ZoneId.systemDefault()).toInstant()));
+						dataRainDTO.setEndTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						long upCount = rainStoreService.rtuUpDataCount(dataRainDTO);
+						RtuUpCountInfoEntity rtuUpCountInfoEntity = new RtuUpCountInfoEntity();
+						rtuUpCountInfoEntity.setRtuCode(entity.getRtuCode());
+						rtuUpCountInfoEntity.setTimeKind(1);
+						rtuUpCountInfoEntity.setUpKind(1);
+						rtuUpCountInfoEntity.setCountTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						rtuUpCountInfoEntity.setUpCount((int) upCount);
+						upCountService.save(rtuUpCountInfoEntity);
+					}
+				}
+				//统计水位
+				if ((entity.getIsRes() != null && entity.getIsRes() == 1) || (entity.getIsRiver() != null && entity.getIsRiver() == 1)) {
+					LambdaQueryWrapper<RtuUpCountInfoEntity> wrapper = Wrappers.<RtuUpCountInfoEntity>query().lambda();
+					wrapper.eq(RtuUpCountInfoEntity::getRtuCode, entity.getRtuCode());
+					wrapper.eq(RtuUpCountInfoEntity::getTimeKind, 1);
+					wrapper.eq(RtuUpCountInfoEntity::getUpKind, 3);
+					LocalDateTime et = checkTime.withMinute(0).withSecond(0).withNano(0);
+					LocalDateTime st = et.minusHours(1);
+					wrapper.eq(RtuUpCountInfoEntity::getCountTime, Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+					long count = upCountService.count(wrapper);
+					if (count == 0) {
+						RtuDataWaterLevelDTO dto = new RtuDataWaterLevelDTO();
+						dto.setRtuCode(entity.getRtuCode());
+						dto.setBeginTime(Date.from(st.atZone(ZoneId.systemDefault()).toInstant()));
+						dto.setEndTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						long upCount = waterLevelStoreService.rtuUpDataCount(dto);
+						RtuUpCountInfoEntity rtuUpCountInfoEntity = new RtuUpCountInfoEntity();
+						rtuUpCountInfoEntity.setRtuCode(entity.getRtuCode());
+						rtuUpCountInfoEntity.setTimeKind(1);
+						rtuUpCountInfoEntity.setUpKind(3);
+						rtuUpCountInfoEntity.setCountTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						rtuUpCountInfoEntity.setUpCount((int) upCount);
+						upCountService.save(rtuUpCountInfoEntity);
+					}
+				}
+				//墒情
+				if (entity.getIsGround() != null && entity.getIsGround() == 1) {
+					LambdaQueryWrapper<RtuUpCountInfoEntity> wrapper = Wrappers.<RtuUpCountInfoEntity>query().lambda();
+					wrapper.eq(RtuUpCountInfoEntity::getRtuCode, entity.getRtuCode());
+					wrapper.eq(RtuUpCountInfoEntity::getTimeKind, 1);
+					wrapper.eq(RtuUpCountInfoEntity::getUpKind, 4);
+					LocalDateTime et = checkTime.withMinute(0).withSecond(0).withNano(0);
+					LocalDateTime st = et.minusHours(1);
+					wrapper.eq(RtuUpCountInfoEntity::getCountTime, Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+					long count = upCountService.count(wrapper);
+					if (count == 0) {
+						RtuDataGroundDTO dataGroundDTO = new RtuDataGroundDTO();
+						dataGroundDTO.setRtuCode(entity.getRtuCode());
+						dataGroundDTO.setBeginTime(Date.from(st.atZone(ZoneId.systemDefault()).toInstant()));
+						dataGroundDTO.setEndTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						long upCount = groundStoreService.rtuUpDataCount(dataGroundDTO);
+						RtuUpCountInfoEntity rtuUpCountInfoEntity = new RtuUpCountInfoEntity();
+						rtuUpCountInfoEntity.setRtuCode(entity.getRtuCode());
+						rtuUpCountInfoEntity.setTimeKind(1);
+						rtuUpCountInfoEntity.setUpKind(4);
+						rtuUpCountInfoEntity.setCountTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						rtuUpCountInfoEntity.setUpCount((int) upCount);
+						upCountService.save(rtuUpCountInfoEntity);
+					}
+				}
+			}
+			return 0;
+		}
+	}
+
+	private class UpDayCountTask implements Callable<Integer> {
+		private LocalDateTime checkTime;
+
+		public UpDayCountTask(LocalDateTime checkTime) {
+			this.checkTime = checkTime;
+		}
+
+		@Override
+		public Integer call() throws Exception {
+			LambdaQueryWrapper<RtuInfoEntity> rtuWrapper = Wrappers.<RtuInfoEntity>query().lambda();
+			rtuWrapper.eq(RtuInfoEntity::getIsDeleted, 0);
+			List<RtuInfoEntity> list = rtuBaseInfoService.list(rtuWrapper);
+			for (RtuInfoEntity entity : list) {
+				//统计雨量站
+				if (entity.getIsRain() != null && entity.getIsRain() == 1) {
+					LambdaQueryWrapper<RtuUpCountInfoEntity> wrapper = Wrappers.<RtuUpCountInfoEntity>query().lambda();
+					wrapper.eq(RtuUpCountInfoEntity::getRtuCode, entity.getRtuCode());
+					wrapper.eq(RtuUpCountInfoEntity::getTimeKind, 2);
+					wrapper.eq(RtuUpCountInfoEntity::getUpKind, 1);
+					LocalDateTime et = checkTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
+					LocalDateTime st = et.minusDays(1);
+					wrapper.eq(RtuUpCountInfoEntity::getCountTime, Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+					long count = upCountService.count(wrapper);
+					if (count == 0) {
+						RtuUpCountInfoDTO dto = new RtuUpCountInfoDTO();
+						dto.setRtuCode(entity.getRtuCode());
+						dto.setUpKind(1);
+						dto.setTimeKind(1);
+						dto.setBeginTime(Date.from(st.atZone(ZoneId.systemDefault()).toInstant()));
+						dto.setEndTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						long upCount = upCountService.upCount(dto);
+						RtuUpCountInfoEntity rtuUpCountInfoEntity = new RtuUpCountInfoEntity();
+						rtuUpCountInfoEntity.setRtuCode(entity.getRtuCode());
+						rtuUpCountInfoEntity.setTimeKind(2);
+						rtuUpCountInfoEntity.setUpKind(1);
+						rtuUpCountInfoEntity.setCountTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						rtuUpCountInfoEntity.setUpCount((int) upCount);
+						upCountService.save(rtuUpCountInfoEntity);
+					}
+				}
+				//统计水位
+				if ((entity.getIsRes() != null && entity.getIsRes() == 1) || (entity.getIsRiver() != null && entity.getIsRiver() == 1)) {
+					LambdaQueryWrapper<RtuUpCountInfoEntity> wrapper = Wrappers.<RtuUpCountInfoEntity>query().lambda();
+					wrapper.eq(RtuUpCountInfoEntity::getRtuCode, entity.getRtuCode());
+					wrapper.eq(RtuUpCountInfoEntity::getTimeKind, 2);
+					wrapper.eq(RtuUpCountInfoEntity::getUpKind, 3);
+					LocalDateTime et = checkTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
+					LocalDateTime st = et.minusDays(1);
+					wrapper.eq(RtuUpCountInfoEntity::getCountTime, Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+					long count = upCountService.count(wrapper);
+					if (count == 0) {
+						RtuUpCountInfoDTO dto = new RtuUpCountInfoDTO();
+						dto.setRtuCode(entity.getRtuCode());
+						dto.setUpKind(3);
+						dto.setTimeKind(1);
+						dto.setBeginTime(Date.from(st.atZone(ZoneId.systemDefault()).toInstant()));
+						dto.setEndTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						long upCount = upCountService.upCount(dto);
+						RtuUpCountInfoEntity rtuUpCountInfoEntity = new RtuUpCountInfoEntity();
+						rtuUpCountInfoEntity.setRtuCode(entity.getRtuCode());
+						rtuUpCountInfoEntity.setTimeKind(2);
+						rtuUpCountInfoEntity.setUpKind(3);
+						rtuUpCountInfoEntity.setCountTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						rtuUpCountInfoEntity.setUpCount((int) upCount);
+						upCountService.save(rtuUpCountInfoEntity);
+					}
+				}
+				//墒情
+				if (entity.getIsGround() != null && entity.getIsGround() == 1) {
+					LambdaQueryWrapper<RtuUpCountInfoEntity> wrapper = Wrappers.<RtuUpCountInfoEntity>query().lambda();
+					wrapper.eq(RtuUpCountInfoEntity::getRtuCode, entity.getRtuCode());
+					wrapper.eq(RtuUpCountInfoEntity::getTimeKind, 2);
+					wrapper.eq(RtuUpCountInfoEntity::getUpKind, 4);
+					LocalDateTime et = checkTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
+					LocalDateTime st = et.minusDays(1);
+					wrapper.eq(RtuUpCountInfoEntity::getCountTime, Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+					long count = upCountService.count(wrapper);
+					if (count == 0) {
+						RtuUpCountInfoDTO dto = new RtuUpCountInfoDTO();
+						dto.setRtuCode(entity.getRtuCode());
+						dto.setUpKind(4);
+						dto.setTimeKind(1);
+						dto.setBeginTime(Date.from(st.atZone(ZoneId.systemDefault()).toInstant()));
+						dto.setEndTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						long upCount = upCountService.upCount(dto);
+						RtuUpCountInfoEntity rtuUpCountInfoEntity = new RtuUpCountInfoEntity();
+						rtuUpCountInfoEntity.setRtuCode(entity.getRtuCode());
+						rtuUpCountInfoEntity.setTimeKind(2);
+						rtuUpCountInfoEntity.setUpKind(4);
+						rtuUpCountInfoEntity.setCountTime(Date.from(et.atZone(ZoneId.systemDefault()).toInstant()));
+						rtuUpCountInfoEntity.setUpCount((int) upCount);
+						upCountService.save(rtuUpCountInfoEntity);
+					}
+				}
+			}
+			return 0;
+		}
+	}
+}

+ 40 - 0
NMSZYYWXT/src/main/java/org/springblade/jobtask/TaskManager.java

@@ -0,0 +1,40 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:运维系统
+ * 创建日期:2022/5/23
+ */
+package org.springblade.jobtask;
+
+
+import lombok.extern.slf4j.Slf4j;
+import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.stereotype.Component;
+
+import java.util.concurrent.*;
+
+/***
+ * Date:2022/5/22
+ * Title: 任务执行线程池
+ * Description:任务执行线程池
+ * @author swp
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+@Component
+@EnableScheduling
+public class TaskManager {
+
+	/**
+	 * 公共线程池
+	 **/
+	private static ThreadFactory publicThreadFactory = new ThreadFactoryBuilder().setNameFormat("task-thread-pool-%d").build();
+	private static ExecutorService publicThreadPool = new ThreadPoolExecutor(2, 4,
+		0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), publicThreadFactory, new ThreadPoolExecutor.AbortPolicy());
+
+	public void submitTask(FutureTask<Integer> futureTask) {
+		publicThreadPool.execute(futureTask);
+	}
+}

+ 416 - 0
NMSZYYWXT/src/main/java/org/springblade/jobtask/WarnCheckProcessor.java

@@ -0,0 +1,416 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 山洪灾害运维系统
+ * 创建日期:2023/8/4
+ */
+package org.springblade.jobtask;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.enums.WarningActiveEnum;
+import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
+import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.baseinfo.warn.entity.BaseWarnSettingEntity;
+import org.springblade.modules.baseinfo.warn.service.IBaseWarnSettingService;
+import org.springblade.modules.business.warning.service.IRtuWarningService;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.*;
+
+/***
+ * Date:2023/8/4
+ * Title: 预警统计功能
+ * Description: 雨量5分钟延时预警、离线预警、漏报预警、延时预警、时钟预警、异常值预警
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+@Component
+@EnableScheduling
+public class WarnCheckProcessor {
+	private static ThreadFactory warnCheckThreadFactory = new ThreadFactoryBuilder().setNameFormat("warn-check-thread-pool-%d").build();
+	private static ExecutorService warnCheckThreadPool = new ThreadPoolExecutor(1, 1,
+		0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), warnCheckThreadFactory, new ThreadPoolExecutor.AbortPolicy());
+
+	@Value("${spring.task-config.warning-check-task}")
+	private boolean warnCheckTaskRun;
+
+	@Value("${spring.warn-config.delay-duration}")
+	private Integer hourDelayduration;
+
+	@Value("${spring.warn-config.delay-min-duration}")
+	private Integer minDelayduration;
+
+	@Value("${spring.warn-config.missout}")
+	private Integer missOutNum;
+
+	@Resource
+	private IRtuBaseInfoService rtuBaseInfoService;
+
+	@Resource
+	private IRtuWarningService rtuWarningService;
+
+	@Resource
+	private IBaseWarnSettingService warnSettingService;
+
+	/**
+	 * 每5分钟执行一次
+	 */
+//	@Scheduled(cron = "10 0/5 * * * * ")
+	public void warnMinTask() {
+		try {
+			if (warnCheckTaskRun) {
+				log.info("雨量5分钟延时预警统计任务创建 {}", Func.formatDateTime(new Date()));
+				LocalDateTime now = LocalDateTime.now();
+				WarningCheckMinTask warningTask = new WarningCheckMinTask(now.withSecond(0).withNano(0));
+				FutureTask<Integer> futureTask = new FutureTask<>(warningTask);
+				warnCheckThreadPool.execute(futureTask);
+			}
+		} catch (Exception e) {
+			log.error("{}", e.getMessage());
+		}
+	}
+
+	/**
+	 * 每10分钟执行一次
+	 */
+	@Scheduled(cron = "20 0/10 * * * * ")
+	public void warnHourTask() {
+		try {
+			if (warnCheckTaskRun) {
+				log.info("预警统计任务创建 {}", Func.formatDateTime(new Date()));
+				LocalDateTime now = LocalDateTime.now();
+				WarningCheckTask warningTask = new WarningCheckTask(now.withSecond(0).withNano(0));
+				FutureTask<Integer> futureTask = new FutureTask<>(warningTask);
+				warnCheckThreadPool.execute(futureTask);
+			}
+		} catch (Exception e) {
+			log.error("{}", e.getMessage());
+		}
+	}
+
+	private class WarningCheckMinTask implements Callable<Integer> {
+
+		private LocalDateTime checkTime;
+
+		public WarningCheckMinTask(LocalDateTime checkTime) {
+			this.checkTime = checkTime;
+		}
+
+		@Override
+		public Integer call() throws Exception {
+			long startTime = System.currentTimeMillis();
+			try {
+				log.info("每5分钟预警检测任务开始执行 {}", Func.formatDateTime(checkTime));
+				//测站检测参数
+				BaseWarnSettingEntity warnSettingEntity = new BaseWarnSettingEntity();
+				//预警开关
+				warnSettingEntity.setWarnActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnClockActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnOfflineActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnMissOutActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnOutlierValueActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnHourUpDelayActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnMinUpDelayActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				//延时,小时
+				warnSettingEntity.setWarnRainDelayHourDuration(hourDelayduration);
+				warnSettingEntity.setWarnRiverDelayHourDuration(hourDelayduration);
+				warnSettingEntity.setWarnRsvrDelayHourDuration(hourDelayduration);
+				warnSettingEntity.setWarnGroundDelayHourDuration(hourDelayduration);
+				//延时,分钟
+				warnSettingEntity.setWarnRainDelayMinDuration(minDelayduration);
+				warnSettingEntity.setWarnRiverDelayMinDuration(minDelayduration);
+				warnSettingEntity.setWarnRsvrDelayMinDuration(minDelayduration);
+				warnSettingEntity.setWarnGroundDelayMinDuration(minDelayduration);
+				//延时,离线
+				warnSettingEntity.setWarnRainOfflineDuration(minDelayduration);
+				warnSettingEntity.setWarnRiverOfflineDuration(minDelayduration);
+				warnSettingEntity.setWarnRsvrOfflineDuration(minDelayduration);
+				warnSettingEntity.setWarnGroundOfflineDuration(minDelayduration);
+				//漏报,预警数量
+				warnSettingEntity.setWarnMissNum(missOutNum);
+				//读取预警配置
+				LambdaQueryWrapper<BaseWarnSettingEntity> warnSettingWrapper = Wrappers.<BaseWarnSettingEntity>query().lambda();
+				warnSettingWrapper.eq(BaseWarnSettingEntity::getIsDeleted, 0);
+				List<BaseWarnSettingEntity> warnSettingEntityList = warnSettingService.list(warnSettingWrapper);
+				if (null != warnSettingEntityList && warnSettingEntityList.size() > 0) {
+					if (warnSettingEntityList.get(0).getWarnActive() != null) {
+						warnSettingEntity.setWarnActive(warnSettingEntityList.get(0).getWarnActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnClockActive() != null) {
+						warnSettingEntity.setWarnClockActive(warnSettingEntityList.get(0).getWarnClockActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnOfflineActive() != null) {
+						warnSettingEntity.setWarnOfflineActive(warnSettingEntityList.get(0).getWarnOfflineActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnMissOutActive() != null) {
+						warnSettingEntity.setWarnMissOutActive(warnSettingEntityList.get(0).getWarnMissOutActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnOutlierValueActive() != null) {
+						warnSettingEntity.setWarnOutlierValueActive(warnSettingEntityList.get(0).getWarnOutlierValueActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnHourUpDelayActive() != null) {
+						warnSettingEntity.setWarnHourUpDelayActive(warnSettingEntityList.get(0).getWarnHourUpDelayActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnMinUpDelayActive() != null) {
+						warnSettingEntity.setWarnMinUpDelayActive(warnSettingEntityList.get(0).getWarnMinUpDelayActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnRainDelayHourDuration() != null) {
+						warnSettingEntity.setWarnRainDelayHourDuration(warnSettingEntityList.get(0).getWarnRainDelayHourDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRiverDelayHourDuration() != null) {
+						warnSettingEntity.setWarnRiverDelayHourDuration(warnSettingEntityList.get(0).getWarnRiverDelayHourDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRsvrDelayHourDuration() != null) {
+						warnSettingEntity.setWarnRsvrDelayHourDuration(warnSettingEntityList.get(0).getWarnRsvrDelayHourDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnGroundDelayHourDuration() != null) {
+						warnSettingEntity.setWarnGroundDelayHourDuration(warnSettingEntityList.get(0).getWarnGroundDelayHourDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRainDelayMinDuration() != null) {
+						warnSettingEntity.setWarnRainDelayMinDuration(warnSettingEntityList.get(0).getWarnRainDelayMinDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRiverDelayMinDuration() != null) {
+						warnSettingEntity.setWarnRiverDelayMinDuration(warnSettingEntityList.get(0).getWarnRiverDelayMinDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRsvrDelayMinDuration() != null) {
+						warnSettingEntity.setWarnRsvrDelayMinDuration(warnSettingEntityList.get(0).getWarnRsvrDelayMinDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnGroundDelayMinDuration() != null) {
+						warnSettingEntity.setWarnGroundDelayMinDuration(warnSettingEntityList.get(0).getWarnGroundDelayMinDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRainOfflineDuration() != null) {
+						warnSettingEntity.setWarnRainOfflineDuration(warnSettingEntityList.get(0).getWarnRainOfflineDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRiverOfflineDuration() != null) {
+						warnSettingEntity.setWarnRiverOfflineDuration(warnSettingEntityList.get(0).getWarnRiverOfflineDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRsvrOfflineDuration() != null) {
+						warnSettingEntity.setWarnRsvrOfflineDuration(warnSettingEntityList.get(0).getWarnRsvrOfflineDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnGroundOfflineDuration() != null) {
+						warnSettingEntity.setWarnGroundOfflineDuration(warnSettingEntityList.get(0).getWarnGroundOfflineDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnMissNum() != null) {
+						warnSettingEntity.setWarnMissNum(warnSettingEntityList.get(0).getWarnMissNum());
+					}
+				}
+				//开始检测
+				if (warnSettingEntity.getWarnActive() == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
+					LambdaQueryWrapper<RtuInfoEntity> dataWrapper = Wrappers.<RtuInfoEntity>query().lambda();
+					dataWrapper.eq(RtuInfoEntity::getIsDeleted, 0);
+					dataWrapper.orderByAsc(RtuInfoEntity::getRtuCode);
+					List<RtuInfoEntity> list = rtuBaseInfoService.list(dataWrapper);
+					if (null != list && list.size() > 0) {
+						for (RtuInfoEntity entity : list) {
+							if (warnSettingEntity.getWarnMinUpDelayActive() == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
+
+								if (entity.getIsRain() == 1) {
+									//雨量报5分钟延时检测
+									rtuWarningService.checkRtuRainUpDelayStatus(entity, warnSettingEntity, checkTime);
+								}
+							}
+						}
+					}
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+				log.error("每5分钟预警检测任务异常 {}", e.getMessage());
+			} finally {
+				log.info("每5分钟预警检测任务完成 {} 毫秒", System.currentTimeMillis() - startTime);
+			}
+			return 0;
+		}
+	}
+
+	private class WarningCheckTask implements Callable<Integer> {
+
+		private LocalDateTime checkTime;
+
+		public WarningCheckTask(LocalDateTime checkTime) {
+			this.checkTime = checkTime;
+		}
+
+		@Override
+		public Integer call() throws Exception {
+			long startTime = System.currentTimeMillis();
+			try {
+				log.info("每小时预警检测任务开始执行 {}", Func.formatDateTime(checkTime));
+				//测站检测参数
+				BaseWarnSettingEntity warnSettingEntity = new BaseWarnSettingEntity();
+				//预警开关
+				warnSettingEntity.setWarnActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnClockActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnOfflineActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnMissOutActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnOutlierValueActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnHourUpDelayActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				warnSettingEntity.setWarnMinUpDelayActive(WarningActiveEnum.ACTIVE_OFF.getCode());
+				//延时,小时
+				warnSettingEntity.setWarnRainDelayHourDuration(hourDelayduration);
+				warnSettingEntity.setWarnRiverDelayHourDuration(hourDelayduration);
+				warnSettingEntity.setWarnRsvrDelayHourDuration(hourDelayduration);
+				warnSettingEntity.setWarnGroundDelayHourDuration(hourDelayduration);
+				//延时,分钟
+				warnSettingEntity.setWarnRainDelayMinDuration(minDelayduration);
+				warnSettingEntity.setWarnRiverDelayMinDuration(minDelayduration);
+				warnSettingEntity.setWarnRsvrDelayMinDuration(minDelayduration);
+				warnSettingEntity.setWarnGroundDelayMinDuration(minDelayduration);
+				//延时,离线
+				warnSettingEntity.setWarnRainOfflineDuration(minDelayduration);
+				warnSettingEntity.setWarnRiverOfflineDuration(minDelayduration);
+				warnSettingEntity.setWarnRsvrOfflineDuration(minDelayduration);
+				warnSettingEntity.setWarnGroundOfflineDuration(minDelayduration);
+				//漏报,预警数量
+				warnSettingEntity.setWarnMissNum(missOutNum);
+				//读取预警配置
+				LambdaQueryWrapper<BaseWarnSettingEntity> warnSettingWrapper = Wrappers.<BaseWarnSettingEntity>query().lambda();
+				warnSettingWrapper.eq(BaseWarnSettingEntity::getIsDeleted, 0);
+				List<BaseWarnSettingEntity> warnSettingEntityList = warnSettingService.list(warnSettingWrapper);
+				if (null != warnSettingEntityList && warnSettingEntityList.size() > 0) {
+					if (warnSettingEntityList.get(0).getWarnActive() != null) {
+						warnSettingEntity.setWarnActive(warnSettingEntityList.get(0).getWarnActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnClockActive() != null) {
+						warnSettingEntity.setWarnClockActive(warnSettingEntityList.get(0).getWarnClockActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnOfflineActive() != null) {
+						warnSettingEntity.setWarnOfflineActive(warnSettingEntityList.get(0).getWarnOfflineActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnMissOutActive() != null) {
+						warnSettingEntity.setWarnMissOutActive(warnSettingEntityList.get(0).getWarnMissOutActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnOutlierValueActive() != null) {
+						warnSettingEntity.setWarnOutlierValueActive(warnSettingEntityList.get(0).getWarnOutlierValueActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnHourUpDelayActive() != null) {
+						warnSettingEntity.setWarnHourUpDelayActive(warnSettingEntityList.get(0).getWarnHourUpDelayActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnMinUpDelayActive() != null) {
+						warnSettingEntity.setWarnMinUpDelayActive(warnSettingEntityList.get(0).getWarnMinUpDelayActive());
+					}
+					if (warnSettingEntityList.get(0).getWarnRainDelayHourDuration() != null) {
+						warnSettingEntity.setWarnRainDelayHourDuration(warnSettingEntityList.get(0).getWarnRainDelayHourDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRiverDelayHourDuration() != null) {
+						warnSettingEntity.setWarnRiverDelayHourDuration(warnSettingEntityList.get(0).getWarnRiverDelayHourDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRsvrDelayHourDuration() != null) {
+						warnSettingEntity.setWarnRsvrDelayHourDuration(warnSettingEntityList.get(0).getWarnRsvrDelayHourDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnGroundDelayHourDuration() != null) {
+						warnSettingEntity.setWarnGroundDelayHourDuration(warnSettingEntityList.get(0).getWarnGroundDelayHourDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRainDelayMinDuration() != null) {
+						warnSettingEntity.setWarnRainDelayMinDuration(warnSettingEntityList.get(0).getWarnRainDelayMinDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRiverDelayMinDuration() != null) {
+						warnSettingEntity.setWarnRiverDelayMinDuration(warnSettingEntityList.get(0).getWarnRiverDelayMinDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRsvrDelayMinDuration() != null) {
+						warnSettingEntity.setWarnRsvrDelayMinDuration(warnSettingEntityList.get(0).getWarnRsvrDelayMinDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnGroundDelayMinDuration() != null) {
+						warnSettingEntity.setWarnGroundDelayMinDuration(warnSettingEntityList.get(0).getWarnGroundDelayMinDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRainOfflineDuration() != null) {
+						warnSettingEntity.setWarnRainOfflineDuration(warnSettingEntityList.get(0).getWarnRainOfflineDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRiverOfflineDuration() != null) {
+						warnSettingEntity.setWarnRiverOfflineDuration(warnSettingEntityList.get(0).getWarnRiverOfflineDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnRsvrOfflineDuration() != null) {
+						warnSettingEntity.setWarnRsvrOfflineDuration(warnSettingEntityList.get(0).getWarnRsvrOfflineDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnGroundOfflineDuration() != null) {
+						warnSettingEntity.setWarnGroundOfflineDuration(warnSettingEntityList.get(0).getWarnGroundOfflineDuration());
+					}
+					if (warnSettingEntityList.get(0).getWarnMissNum() != null) {
+						warnSettingEntity.setWarnMissNum(warnSettingEntityList.get(0).getWarnMissNum());
+					}
+				}
+				//开始检测
+				if (warnSettingEntity.getWarnActive() == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
+					LambdaQueryWrapper<RtuInfoEntity> dataWrapper = Wrappers.<RtuInfoEntity>query().lambda();
+					dataWrapper.eq(RtuInfoEntity::getIsDeleted, 0);
+					dataWrapper.orderByAsc(RtuInfoEntity::getRtuCode);
+					List<RtuInfoEntity> list = rtuBaseInfoService.list(dataWrapper);
+					if (null != list && list.size() > 0) {
+						for (RtuInfoEntity entity : list) {
+							boolean isOffline = false;
+							if (warnSettingEntity.getWarnOfflineActive() == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
+								//检测离线状态
+								isOffline = rtuWarningService.checkRtuOfflineStatus(entity, warnSettingEntity, checkTime);
+							}
+//							if (warnSettingEntity.getWarnClockActive() == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
+//								//检测测站时钟状态
+//								if (!isOffline) {
+//									rtuWarningService.checkRtuClockStatus(entity, warnSettingEntity, checkTime);
+//								}
+//							}
+//							if (warnSettingEntity.getWarnMissOutActive() == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
+//								//离线时,不检测漏报异常
+//								if (!isOffline) {
+//									if (entity.getIsRain() == 1) {
+//										//雨量站小时漏报检测
+//										rtuWarningService.checkRtuRainMissOutStatus(entity, warnSettingEntity, checkTime);
+//									}
+//									if (entity.getIsRiver() == 1) {
+//										//河道站小时漏报检测
+//										rtuWarningService.checkRtuRiverMissOutStatus(entity, warnSettingEntity, checkTime);
+//									}
+//									if (entity.getIsRes() == 1) {
+//										//水库站小时漏报检测
+//										rtuWarningService.checkRtuRsvrMissOutStatus(entity, warnSettingEntity, checkTime);
+//									}
+//								}
+//							}
+							if (warnSettingEntity.getWarnHourUpDelayActive() == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
+								if (!isOffline) {
+//									if (entity.getIsRain() == 1) {
+//										//雨量小时报延时检测
+//										rtuWarningService.checkRtuRainUpHourDelayStatus(entity, warnSettingEntity, checkTime);
+//									}
+									//if (entity.getIsRiver() == 1) {
+										//河道小时报延时检测
+										rtuWarningService.checkRtuRiverUpHourDelayStatus(entity, warnSettingEntity, checkTime);
+									//}
+//									if (entity.getIsRes() == 1) {
+//										//水库小时报延时检测
+//										rtuWarningService.checkRtuRsvrUpHourDelayStatus(entity, warnSettingEntity, checkTime);
+//									}
+								}
+							}
+//							if (warnSettingEntity.getWarnOutlierValueActive() == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
+//								if (!isOffline) {
+//									if (entity.getIsRain() == 1) {
+//										//疑似异常值
+//										rtuWarningService.checkRtuOutlierValueStatus(entity, warnSettingEntity, checkTime);
+//									}
+//								}
+//							}
+						}
+					}
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+				log.error("预警检测任务异常 {}", e.getMessage());
+			} finally {
+				log.info("预警检测任务完成 {} 毫秒", System.currentTimeMillis() - startTime);
+			}
+			return 0;
+		}
+	}
+}

+ 30 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/controller/BaseInfoDictController.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.dict.controller;
+
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/***
+ * Date:2022/8/22
+ * Title:行政区划管理
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@RestController
+@RequestMapping("galaxy-business/baseinfo/dict")
+@AllArgsConstructor
+@Api(value = "业务字典", tags = "业务字典")
+public class BaseInfoDictController extends BladeController {
+
+}

+ 75 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/entity/DictInfoEntity.java

@@ -0,0 +1,75 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/3/9
+ */
+package org.springblade.modules.baseinfo.dict.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;
+
+
+/**
+ * 运维单位实体
+ *
+ * @author swp
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("blade_dict_biz")
+public class DictInfoEntity extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 租户ID
+	 */
+	@ApiModelProperty("租户ID")
+	private String tenantId;
+
+	/**
+	 * 父主键
+	 */
+	@ApiModelProperty(value = "父主键")
+	private Long parentId;
+
+	/**
+	 * 字典码
+	 */
+	@ApiModelProperty(value = "字典码")
+	private String code;
+
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
+	/**
+	 * 是否已封存
+	 */
+	@ApiModelProperty(value = "是否已封存")
+	private Integer isSealed;
+
+	/**
+	 * 字典值
+	 */
+	@ApiModelProperty(value = "字典值")
+	private String dictKey;
+
+	/**
+	 * 字典名称
+	 */
+	@ApiModelProperty(value = "字典名称")
+	private String dictValue;
+
+	/**
+	 * 部门全称
+	 */
+	@ApiModelProperty(value = "部门全称")
+	private String remark;
+}

+ 23 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/mapper/DictInfoMapper.java

@@ -0,0 +1,23 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.dict.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.baseinfo.dict.entity.DictInfoEntity;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface DictInfoMapper extends BaseMapper<DictInfoEntity> {
+	DictInfoEntity getDict(@Param("code") String code, @Param("key") String key);
+}

+ 32 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/mapper/DictInfoMapper.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.baseinfo.dict.mapper.DictInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="baseinfoDictResultMap" type="org.springblade.modules.baseinfo.dict.entity.DictInfoEntity">
+        <result column="parent_id" property="parentId"/>
+        <result column="code" property="code"/>
+        <result column="dict_key" property="dictKey"/>
+        <result column="dict_value" property="dictValue"/>
+        <result column="sort" property="sort"/>
+        <result column="remark" property="remark"/>
+        <result column="is_sealed" property="isSealed"/>
+    </resultMap>
+
+    <select id="getDict" resultMap="baseinfoDictResultMap">
+        SELECT
+        n.*
+        FROM
+        blade_dict_biz n
+        WHERE
+        n.is_deleted = 0
+        <if test="code!=null">
+            and n.code = #{code}
+        </if>
+        <if test="key!=null">
+            and n.dict_key = #{key}
+        </if>
+        limit 1
+
+    </select>
+</mapper>

+ 22 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/service/IBaseInfoDictService.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.dict.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.dict.entity.DictInfoEntity;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IBaseInfoDictService extends BaseService<DictInfoEntity> {
+	DictInfoEntity getDict(String code, String key);
+}

+ 30 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/dict/service/impl/BaseInfoDictServiceImpl.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.dict.service.impl;
+
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.baseinfo.dict.entity.DictInfoEntity;
+import org.springblade.modules.baseinfo.dict.mapper.DictInfoMapper;
+import org.springblade.modules.baseinfo.dict.service.IBaseInfoDictService;
+import org.springframework.stereotype.Service;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class BaseInfoDictServiceImpl extends BaseServiceImpl<DictInfoMapper, DictInfoEntity> implements IBaseInfoDictService {
+
+	@Override
+	public DictInfoEntity getDict(String code, String key) {
+		return this.baseMapper.getDict(code,key);
+	}
+}

+ 127 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/controller/MonitorPointController.java

@@ -0,0 +1,127 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+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.springblade.modules.baseinfo.monitorpoint.dto.MonitorPointInfoDTO;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointRelService;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointService;
+import org.springblade.modules.baseinfo.monitorpoint.vo.MonitorPointInfoVO;
+import org.springblade.modules.baseinfo.monitorpoint.wrapper.MonitorPointWrapper;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@RestController
+@RequestMapping("galaxy-business/base/monitorpoint")
+@AllArgsConstructor
+@Api(value = "监测点模块", tags = "监测点接口")
+public class MonitorPointController extends BladeController {
+
+    private final IMonitorPointService monitorPointService;
+
+    private final IMonitorPointRelService monitorPointRelService;
+
+    /**
+     * 多表联合查询自定义分页
+     */
+    @GetMapping("/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mpCd", value = "监测点代码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "mpNm", value = "监测点名称", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "orgId", value = "机构ID", paramType = "query", dataType = "long"),
+            @ApiImplicitParam(name = "wiustNm", value = "监测站名称", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页")
+    public R<IPage<MonitorPointInfoVO>> page(@ApiIgnore MonitorPointInfoDTO dto, Query query) {
+        IPage<MonitorPointInfoVO> pages = monitorPointService.selectPage(Condition.getPage(query), dto);
+        List<MonitorPointInfoVO> list = pages.getRecords();
+        for (MonitorPointInfoVO vo : list) {
+            MonitorPointWrapper.build().entityVO(vo);
+        }
+        return R.data(pages);
+    }
+
+    /**
+     * 详情
+     */
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "")
+    public R<MonitorPointInfoVO> detail(MonitorPointInfoEntity dto) {
+        MonitorPointInfoEntity detail = monitorPointService.getOne(Condition.getQueryWrapper(dto));
+        return R.data(MonitorPointWrapper.build().entityVO(detail));
+    }
+
+    /**
+     * 新增
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增", notes = "")
+    public R save(@RequestBody MonitorPointInfoDTO dto) {
+        if (Func.isNull(dto.getWiustCd()) || Func.isNull(dto.getMpCd())) {
+            return R.fail("参数错误");
+        }
+        LambdaQueryWrapper<MonitorPointInfoEntity> wrapper = Wrappers.<MonitorPointInfoEntity>query().lambda();
+        wrapper.eq(MonitorPointInfoEntity::getIsDeleted, 0);
+        wrapper.eq(MonitorPointInfoEntity::getMpCd, dto.getMpCd());
+        long count = monitorPointService.count(wrapper);
+        if (count > 0) {
+            return R.fail("测点已经存在");
+        }
+        monitorPointRelService.addRel(dto.getWiustCd(), dto.getMpCd());
+        return R.status(monitorPointService.save(dto));
+    }
+
+    /**
+     * 修改
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "")
+    public R update(@RequestBody MonitorPointInfoEntity dto) {
+        return R.status(monitorPointService.updateById(dto));
+    }
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "")
+    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+        List<Long> idArr = Func.toLongList(ids);
+        for (Long id : idArr) {
+            MonitorPointInfoEntity entity = monitorPointService.getById(id);
+            monitorPointRelService.removeRel(entity.getMpCd());
+        }
+        boolean temp = monitorPointService.deleteLogic(Func.toLongList(ids));
+        return R.status(temp);
+    }
+}

+ 42 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/dto/MonitorPointInfoDTO.java

@@ -0,0 +1,42 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class MonitorPointInfoDTO extends MonitorPointInfoEntity {
+    /**
+     * 取用水测站代码
+     */
+    @ApiModelProperty(value = "取用水测站代码")
+    private String wiustCd;
+
+    /**
+     * 取用水测站名称
+     */
+    @ApiModelProperty(value = "取用水测站名称")
+    private String wiustNm;
+
+    /**
+     * 机构ID
+     */
+    @ApiModelProperty(value = "机构ID")
+    private Long orgId;
+}

+ 93 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/entity/MonitorPointInfoEntity.java

@@ -0,0 +1,93 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.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;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("base_mp_info")
+public class MonitorPointInfoEntity extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 租户ID
+     */
+    @ApiModelProperty("租户ID")
+    private String tenantId;
+
+    /**
+     * 监测点代码
+     */
+    @ApiModelProperty(value = "监测点代码")
+    private String mpCd;
+
+    /**
+     * 监测点名称
+     */
+    @ApiModelProperty(value = "监测点名称")
+    private String mpNm;
+
+    /**
+     * 监测点地址
+     */
+    @ApiModelProperty(value = "监测点地址")
+    private String mpAddr;
+
+    /**
+     * 监测项目
+     */
+    @ApiModelProperty(value = "监测项目")
+    private String mpItem;
+
+    /**
+     * 监测类型
+     */
+    @ApiModelProperty(value = "监测类型")
+    private String isAuto;
+
+    /**
+     * 水源类型
+     */
+    @ApiModelProperty(value = "水源类型")
+    private String sourTp;
+
+    /**
+     * 时间戳
+     */
+    @ApiModelProperty(value = "时间戳")
+    private String ts;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String nt;
+
+    /**
+     * 经度
+     */
+    @ApiModelProperty(value = "经度")
+    private String lng;
+
+    /**
+     * 纬度
+     */
+    @ApiModelProperty(value = "纬度")
+    private String lat;
+}

+ 58 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/entity/MonitorPointRelEntity.java

@@ -0,0 +1,58 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.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;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("base_wiust_mp_rel")
+public class MonitorPointRelEntity extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 租户ID
+     */
+    @ApiModelProperty("租户ID")
+    private String tenantId;
+
+    /**
+     * 监测点代码
+     */
+    @ApiModelProperty(value = "监测点代码")
+    private String mpCd;
+
+    /**
+     * 取用水测站代码
+     */
+    @ApiModelProperty(value = "取用水测站代码")
+    private String wiustCd;
+
+    /**
+     * 时间戳
+     */
+    @ApiModelProperty(value = "时间戳")
+    private String ts;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String nt;
+
+}

+ 30 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointMapper.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.baseinfo.monitorpoint.dto.MonitorPointInfoDTO;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+import org.springblade.modules.baseinfo.monitorpoint.vo.MonitorPointInfoVO;
+
+import java.util.List;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface MonitorPointMapper extends BaseMapper<MonitorPointInfoEntity> {
+    List<MonitorPointInfoVO> selectPage(IPage<MonitorPointInfoVO> page, @Param("dto") MonitorPointInfoEntity dto);
+    Long gtMonitorPointCount(@Param("dto") MonitorPointInfoDTO dto);
+}

+ 83 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointMapper.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.baseinfo.monitorpoint.mapper.MonitorPointMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="monitorPointInfoResultMap"
+               type="org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity">
+
+        <result column="mp_cd" property="mpCd"/>
+        <result column="mp_nm" property="mpNm"/>
+        <result column="mp_addr" property="mpAddr"/>
+        <result column="mp_item" property="mpItem"/>
+        <result column="is_auto" property="isAuto"/>
+        <result column="sour_tp" property="sourTp"/>
+        <result column="ts" property="ts"/>
+        <result column="nt" property="nt"/>
+
+    </resultMap>
+
+    <resultMap id="monitorPointInfoVOResultMap"
+               type="org.springblade.modules.baseinfo.monitorpoint.vo.MonitorPointInfoVO">
+
+        <result column="mp_cd" property="mpCd"/>
+        <result column="mp_nm" property="mpNm"/>
+        <result column="mp_addr" property="mpAddr"/>
+        <result column="mp_item" property="mpItem"/>
+        <result column="is_auto" property="isAuto"/>
+        <result column="sour_tp" property="sourTp"/>
+        <result column="ts" property="ts"/>
+        <result column="nt" property="nt"/>
+        <result column="org_id" property="orgId"/>
+        <result column="dept_name" property="orgName"/>
+        <result column="wiu_cd" property="wiuCd"/>
+        <result column="wiu_nm" property="wiuNm"/>
+        <result column="wiust_cd" property="wiustCd"/>
+        <result column="wiust_nm" property="wiustNm"/>
+    </resultMap>
+
+    <select id="selectPage" resultMap="monitorPointInfoVOResultMap">
+        SELECT
+        n.*,w.wiust_cd,w.wiust_nm,u.wiu_cd,u.wiu_nm,d.dept_name,u.org_id
+        FROM
+        base_mp_info n
+        LEFT JOIN base_wiust_mp_rel wp ON wp.mp_cd = n.mp_cd and wp.is_deleted=0
+        LEFT JOIN base_wiust_info w ON w.wiust_cd = wp.wiust_cd and w.is_deleted=0
+        LEFT JOIN base_wiu_wiust_rel ww ON ww.wiust_cd = w.wiust_cd and ww.is_deleted=0
+        LEFT JOIN base_wr_wiu_info u ON u.wiu_cd = ww.wiu_cd and u.is_deleted=0
+        LEFT JOIN blade_dept d ON d.id = u.org_id and d.is_deleted=0
+        WHERE
+        n.is_deleted = 0
+        <if test="dto.mpNm!=null">
+            and n.mp_nm like concat(concat('%', #{dto.mpNm}), '%')
+        </if>
+        <if test="dto.mpCd!=null">
+            and n.mp_cd like concat(concat('%', #{dto.mpCd}), '%')
+        </if>
+        <if test="dto.wiustNm!=null">
+            and w.wiust_nm like concat(concat('%', #{dto.wiustNm}), '%')
+        </if>
+        <if test="dto.orgId!=null">
+            and (d.id =#{dto.orgId} or FIND_IN_SET(#{dto.orgId} ,d.ancestors) >0 )
+        </if>
+        order by n.mp_cd
+    </select>
+
+    <select id="gtMonitorPointCount" resultType="java.lang.Long">
+        SELECT
+        count(n.mp_cd)
+        FROM
+        base_mp_info n
+        LEFT JOIN base_wiust_mp_rel wp ON wp.mp_cd = n.mp_cd and wp.is_deleted=0
+        LEFT JOIN base_wiust_info w ON w.wiust_cd = wp.wiust_cd and w.is_deleted=0
+        LEFT JOIN base_wiu_wiust_rel ww ON ww.wiust_cd = w.wiust_cd and ww.is_deleted=0
+        LEFT JOIN base_wr_wiu_info u ON u.wiu_cd = ww.wiu_cd and u.is_deleted=0
+        LEFT JOIN blade_dept d ON d.id = u.org_id and d.is_deleted=0
+        WHERE
+        n.is_deleted = 0
+        <if test="dto.orgId!=null">
+            and (d.id =#{dto.orgId} or FIND_IN_SET(#{dto.orgId} ,d.ancestors) >0 )
+        </if>
+    </select>
+
+</mapper>

+ 30 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointRelMapper.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity;
+import org.springblade.modules.baseinfo.monitorpoint.vo.MonitorPointInfoVO;
+
+import java.util.List;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface MonitorPointRelMapper extends BaseMapper<MonitorPointRelEntity> {
+
+
+}

+ 16 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointRelMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.baseinfo.monitorpoint.mapper.MonitorPointRelMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="monitorPointRelResultMap"
+               type="org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity">
+
+        <result column="mp_cd" property="mpCd"/>
+        <result column="wiust_cd" property="wiustCd"/>
+        <result column="ts" property="ts"/>
+        <result column="nt" property="nt"/>
+
+    </resultMap>
+
+</mapper>

+ 36 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/IMonitorPointRelService.java

@@ -0,0 +1,36 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IMonitorPointRelService extends BaseService<MonitorPointRelEntity> {
+     /**
+      * 添加点位关联
+      * @param siteCode
+      * @param mpCd
+      * @return
+      */
+     boolean addRel(String siteCode,String mpCd);
+
+     /**
+      * 删除点位关联
+      * @param mpCd
+      * @return
+      */
+     boolean removeRel(String mpCd);
+}

+ 47 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/IMonitorPointService.java

@@ -0,0 +1,47 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.monitorpoint.dto.MonitorPointInfoDTO;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+import org.springblade.modules.baseinfo.monitorpoint.vo.MonitorPointInfoVO;
+
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IMonitorPointService extends BaseService<MonitorPointInfoEntity> {
+    /**
+     * 分页查询
+     * @param page
+     * @param dto
+     * @return
+     */
+    IPage<MonitorPointInfoVO> selectPage(IPage<MonitorPointInfoVO> page, MonitorPointInfoEntity dto);
+
+    /**
+     * 查询点位数量
+     * @param dto
+     * @return
+     */
+    long getMonitorPointCount(MonitorPointInfoDTO dto);
+
+    /**
+     * 删除点位
+     * @param mpCd
+     * @return
+     */
+    boolean removePoint(String mpCd);
+}

+ 58 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/impl/MonitorPointRelServiceImpl.java

@@ -0,0 +1,58 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity;
+import org.springblade.modules.baseinfo.monitorpoint.mapper.MonitorPointRelMapper;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointRelService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class MonitorPointRelServiceImpl extends BaseServiceImpl<MonitorPointRelMapper, MonitorPointRelEntity> implements IMonitorPointRelService {
+
+
+    @Override
+    public boolean addRel(String siteCode, String mpCd) {
+        LambdaQueryWrapper<MonitorPointRelEntity> wrapper = Wrappers.<MonitorPointRelEntity>query().lambda();
+        wrapper.eq(MonitorPointRelEntity::getIsDeleted, 0);
+        wrapper.eq(MonitorPointRelEntity::getMpCd, mpCd);
+        List<MonitorPointRelEntity> list = this.list(wrapper);
+        for (MonitorPointRelEntity entity : list) {
+            this.deleteLogic(Func.toLongList(Func.toStr(entity.getId())));
+        }
+        MonitorPointRelEntity relEntity = new MonitorPointRelEntity();
+        relEntity.setWiustCd(siteCode);
+        relEntity.setMpCd(mpCd);
+        return this.save(relEntity);
+    }
+
+    @Override
+    public boolean removeRel(String mpCd) {
+        LambdaQueryWrapper<MonitorPointRelEntity> wrapper = Wrappers.<MonitorPointRelEntity>query().lambda();
+        wrapper.eq(MonitorPointRelEntity::getIsDeleted, 0);
+        wrapper.eq(MonitorPointRelEntity::getMpCd, mpCd);
+        List<MonitorPointRelEntity> list = this.list(wrapper);
+        for (MonitorPointRelEntity entity : list) {
+            this.deleteLogic(Func.toLongList(Func.toStr(entity.getId())));
+        }
+        return true;
+    }
+}

+ 63 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/impl/MonitorPointServiceImpl.java

@@ -0,0 +1,63 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.baseinfo.monitorpoint.dto.MonitorPointInfoDTO;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+import org.springblade.modules.baseinfo.monitorpoint.mapper.MonitorPointMapper;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointRelService;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointService;
+import org.springblade.modules.baseinfo.monitorpoint.vo.MonitorPointInfoVO;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class MonitorPointServiceImpl extends BaseServiceImpl<MonitorPointMapper, MonitorPointInfoEntity> implements IMonitorPointService {
+
+    @Resource
+    private IMonitorPointRelService monitorPointRelService;
+
+    @Override
+    public IPage<MonitorPointInfoVO> selectPage(IPage<MonitorPointInfoVO> page, MonitorPointInfoEntity dto) {
+        return page.setRecords(baseMapper.selectPage(page, dto));
+    }
+
+    @Override
+    public long getMonitorPointCount(MonitorPointInfoDTO dto) {
+        return baseMapper.gtMonitorPointCount(dto);
+    }
+
+    @Override
+    public boolean removePoint(String mpCd) {
+        LambdaQueryWrapper<MonitorPointInfoEntity> wrapper = Wrappers.<MonitorPointInfoEntity>query().lambda();
+        wrapper.eq(MonitorPointInfoEntity::getIsDeleted, 0);
+        wrapper.eq(MonitorPointInfoEntity::getMpCd, mpCd);
+        List<MonitorPointInfoEntity> points = this.list(wrapper);
+        for (MonitorPointInfoEntity point : points) {
+            monitorPointRelService.removeRel(point.getMpCd());
+            this.deleteLogic(Func.toLongList(Func.toStr(point.getId())));
+        }
+        return true;
+    }
+
+}

+ 61 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/vo/MonitorPointInfoVO.java

@@ -0,0 +1,61 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class MonitorPointInfoVO extends MonitorPointInfoEntity {
+    /**
+     * 机构ID
+     */
+    @ApiModelProperty(value = "机构ID")
+    private Long orgId;
+
+    /**
+     * 机构名称
+     */
+    @ApiModelProperty(value = "机构名称")
+    private String orgName;
+
+    /**
+     * 取用水户代码
+     */
+    @ApiModelProperty(value = "取用水户代码")
+    private String wiuCd;
+
+    /**
+     * 取用水户名称
+     */
+    @ApiModelProperty(value = "取用水户名称")
+    private String wiuNm;
+
+    /**
+     * 取用水测站代码
+     */
+    @ApiModelProperty(value = "取用水测站代码")
+    private String wiustCd;
+
+    /**
+     * 取用水测站名称
+     */
+    @ApiModelProperty(value = "取用水测站名称")
+    private String wiustNm;
+}

+ 139 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorpoint/wrapper/MonitorPointWrapper.java

@@ -0,0 +1,139 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.wrapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointRelService;
+import org.springblade.modules.baseinfo.monitorpoint.vo.MonitorPointInfoVO;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteRelService;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteService;
+import org.springblade.modules.baseinfo.wateruseconsumer.entity.WaterUseConsumerInfoEntity;
+import org.springblade.modules.baseinfo.wateruseconsumer.service.IWaterUseConsumerService;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.service.IDeptService;
+
+
+import java.util.Objects;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public class MonitorPointWrapper extends BaseEntityWrapper<MonitorPointInfoEntity, MonitorPointInfoVO> {
+    public static MonitorPointWrapper build() {
+        return new MonitorPointWrapper();
+    }
+
+    private static IDeptService deptService;
+
+    private static IDeptService getDeptService() {
+        if (deptService == null) {
+            deptService = SpringUtil.getBean(IDeptService.class);
+        }
+        return deptService;
+    }
+
+    private static IMonitorPointRelService monitorPointRelService;
+
+    private static IMonitorPointRelService getMonitorPointRelService() {
+        if (monitorPointRelService == null) {
+            monitorPointRelService = SpringUtil.getBean(IMonitorPointRelService.class);
+        }
+        return monitorPointRelService;
+    }
+
+    private static IMonitorSiteRelService monitorSiteRelService;
+
+    private static IMonitorSiteRelService getMonitorSiteRelService() {
+        if (monitorSiteRelService == null) {
+            monitorSiteRelService = SpringUtil.getBean(IMonitorSiteRelService.class);
+        }
+        return monitorSiteRelService;
+    }
+
+    private static IMonitorSiteService monitorSiteService;
+
+    private static IMonitorSiteService getMonitorSiteService() {
+        if (monitorSiteService == null) {
+            monitorSiteService = SpringUtil.getBean(IMonitorSiteService.class);
+        }
+        return monitorSiteService;
+    }
+
+
+    private static IWaterUseConsumerService waterUseConsumerService;
+
+    private static IWaterUseConsumerService getWaterUseConsumerService() {
+        if (waterUseConsumerService == null) {
+            waterUseConsumerService = SpringUtil.getBean(IWaterUseConsumerService.class);
+        }
+        return waterUseConsumerService;
+    }
+
+    @Override
+    public MonitorPointInfoVO entityVO(MonitorPointInfoEntity entity) {
+        MonitorPointInfoVO vo = Objects.requireNonNull(BeanUtil.copy(entity, MonitorPointInfoVO.class));
+        if (vo.getWiustNm() == null) {
+            LambdaQueryWrapper<MonitorPointRelEntity> wrapper = Wrappers.<MonitorPointRelEntity>query().lambda();
+            wrapper.eq(MonitorPointRelEntity::getMpCd, entity.getMpCd());
+            wrapper.last("limit 1");
+            MonitorPointRelEntity relEntity = getMonitorPointRelService().getOne(wrapper);
+            if (null != relEntity) {
+                LambdaQueryWrapper<MonitorSiteInfoEntity> wrapper2 = Wrappers.<MonitorSiteInfoEntity>query().lambda();
+                wrapper2.eq(MonitorSiteInfoEntity::getWiustCd, relEntity.getWiustCd());
+                wrapper2.last("limit 1");
+                MonitorSiteInfoEntity siteInfoEntity = getMonitorSiteService().getOne(wrapper2);
+                if (null != siteInfoEntity) {
+                    vo.setWiustCd(siteInfoEntity.getWiustCd());
+                    vo.setWiustNm(siteInfoEntity.getWiustNm());
+                }
+            }
+        }
+        if (vo.getWiuNm() == null) {
+            LambdaQueryWrapper<MonitorSiteRelEntity> wrapper = Wrappers.<MonitorSiteRelEntity>query().lambda();
+            wrapper.eq(MonitorSiteRelEntity::getWiustCd, vo.getWiustCd());
+            wrapper.last("limit 1");
+            MonitorSiteRelEntity relEntity = getMonitorSiteRelService().getOne(wrapper);
+            if (null != relEntity) {
+                LambdaQueryWrapper<WaterUseConsumerInfoEntity> wrapper2 = Wrappers.<WaterUseConsumerInfoEntity>query().lambda();
+                wrapper2.eq(WaterUseConsumerInfoEntity::getWiuCd, relEntity.getWiuCd());
+                wrapper2.last("limit 1");
+                WaterUseConsumerInfoEntity waterUseConsumerInfoEntity = getWaterUseConsumerService().getOne(wrapper2);
+                if (null != waterUseConsumerInfoEntity) {
+                    vo.setWiuCd(waterUseConsumerInfoEntity.getWiuCd());
+                    vo.setWiuNm(waterUseConsumerInfoEntity.getWiuNm());
+                }
+            }
+        }
+        if (vo.getOrgName() == null) {
+            LambdaQueryWrapper<WaterUseConsumerInfoEntity> wrapper2 = Wrappers.<WaterUseConsumerInfoEntity>query().lambda();
+            wrapper2.eq(WaterUseConsumerInfoEntity::getWiuCd, vo.getWiuCd());
+            wrapper2.last("limit 1");
+            WaterUseConsumerInfoEntity waterUseConsumerInfoEntity = getWaterUseConsumerService().getOne(wrapper2);
+            if (null != waterUseConsumerInfoEntity) {
+                Dept dept = getDeptService().getById(waterUseConsumerInfoEntity.getOrgId());
+                if (null != dept) {
+                    vo.setOrgId(waterUseConsumerInfoEntity.getOrgId());
+                    vo.setOrgName(dept.getDeptName());
+                }
+            }
+        }
+        return vo;
+    }
+}

+ 202 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/controller/MonitorSiteController.java

@@ -0,0 +1,202 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+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.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointRelService;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointService;
+import org.springblade.modules.baseinfo.monitorsite.dto.MonitorSiteInfoDTO;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteRelService;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteService;
+import org.springblade.modules.baseinfo.monitorsite.vo.MonitorSiteInfoVO;
+import org.springblade.modules.baseinfo.monitorsite.wrapper.MonitorSiteWrapper;
+import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
+import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.baseinfo.wateruseconsumer.entity.WaterUseConsumerInfoEntity;
+import org.springblade.modules.baseinfo.wateruseconsumer.service.IWaterUseConsumerService;
+import org.springblade.modules.business.rtumanage.entity.RtuStatusEntity;
+import org.springblade.modules.business.rtumanage.service.IRtuManageService;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@RestController
+@RequestMapping("galaxy-business/base/monitorsite")
+@AllArgsConstructor
+@Api(value = "监测站模块", tags = "监测站接口")
+public class MonitorSiteController extends BladeController {
+    private final IMonitorSiteService monitorSiteService;
+    private final IMonitorSiteRelService monitorSiteRelService;
+    private final IRtuBaseInfoService rtuBaseInfoService;
+    private final IWaterUseConsumerService waterUseConsumerService;
+    private final IMonitorPointRelService monitorPointRelService;
+    private final IMonitorPointService monitorPointService;
+    private final IRtuManageService rtuManageService;
+
+
+    /**
+     * 多表联合查询自定义分页
+     */
+    @GetMapping("/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wiustCd", value = "监测站代码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "wiustNm", value = "监测站名称", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "orgId", value = "机构ID", paramType = "query", dataType = "long"),
+            @ApiImplicitParam(name = "wiuNm", value = "用水户名称", paramType = "query", dataType = "string"),
+
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页")
+    public R<IPage<MonitorSiteInfoVO>> page(@ApiIgnore MonitorSiteInfoDTO dto, Query query) {
+        IPage<MonitorSiteInfoVO> pages = monitorSiteService.selectPage(Condition.getPage(query), dto);
+        List<MonitorSiteInfoVO> list = pages.getRecords();
+        for (MonitorSiteInfoVO vo : list) {
+            MonitorSiteWrapper.build().entityVO(vo);
+        }
+        return R.data(pages);
+    }
+
+    @GetMapping("/list")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wiustCd", value = "监测站代码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "wiustNm", value = "监测站名称", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页")
+    public R<List<MonitorSiteInfoVO>> list(@ApiIgnore MonitorSiteInfoEntity dto) {
+        List<MonitorSiteInfoEntity> list = monitorSiteService.selectAll(dto);
+        return R.data(MonitorSiteWrapper.build().listVO(list));
+    }
+
+    /**
+     * 详情
+     */
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "")
+    public R<MonitorSiteInfoVO> detail(MonitorSiteInfoEntity dto) {
+        MonitorSiteInfoEntity detail = monitorSiteService.getOne(Condition.getQueryWrapper(dto));
+        return R.data(MonitorSiteWrapper.build().entityVO(detail));
+    }
+
+    /**
+     * 新增
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增", notes = "")
+    public R save(@RequestBody MonitorSiteInfoDTO dto) {
+        if (Func.isNull(dto.getWiustCd()) || Func.isNull(dto.getWiuCd())) {
+            return R.fail("参数错误");
+        }
+        LambdaQueryWrapper<MonitorSiteInfoEntity> wrapper = Wrappers.<MonitorSiteInfoEntity>query().lambda();
+        wrapper.eq(MonitorSiteInfoEntity::getIsDeleted, 0);
+        wrapper.eq(MonitorSiteInfoEntity::getWiustCd, dto.getWiustCd());
+        long count = monitorSiteService.count(wrapper);
+        if (count > 0) {
+            return R.fail("测站已经存在");
+        }
+        //添加RTU
+        RtuInfoEntity rtuInfoEntity = rtuBaseInfoService.rtuInfoByRtuCode(dto.getWiustCd());
+        if (Func.isNull(rtuInfoEntity)) {
+            rtuInfoEntity = new RtuInfoEntity();
+        }
+        rtuInfoEntity.setRtuCode(dto.getWiustCd());
+        rtuInfoEntity.setRtuName(dto.getWiustNm());
+        LambdaQueryWrapper<WaterUseConsumerInfoEntity> wrapper2 = Wrappers.<WaterUseConsumerInfoEntity>query().lambda();
+        wrapper2.eq(WaterUseConsumerInfoEntity::getIsDeleted, 0);
+        wrapper2.eq(WaterUseConsumerInfoEntity::getWiuCd, dto.getWiuCd());
+        WaterUseConsumerInfoEntity waterUseConsumerInfoEntity = waterUseConsumerService.getOne(wrapper2);
+        if (Func.notNull(waterUseConsumerInfoEntity)) {
+            rtuInfoEntity.setOrgId(waterUseConsumerInfoEntity.getOrgId());
+        }
+        rtuBaseInfoService.saveOrUpdate(rtuInfoEntity);
+        //测站和用水户关联表
+        monitorSiteRelService.removeRel(dto.getWiustCd());
+        MonitorSiteRelEntity relEntity = new MonitorSiteRelEntity();
+        relEntity.setWiustCd(dto.getWiustCd());
+        relEntity.setWiuCd(dto.getWiuCd());
+        monitorSiteRelService.save(relEntity);
+        return R.status(monitorSiteService.save(dto));
+    }
+
+    /**
+     * 修改
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "")
+    public R update(@RequestBody MonitorSiteInfoDTO dto) {
+        if (Func.isNull(dto.getId())) {
+            return R.fail("参数错误");
+        }
+        if (monitorSiteService.updateById(dto)) {
+            RtuInfoEntity rtuInfoEntity = rtuBaseInfoService.rtuInfoByRtuCode(dto.getWiustCd());
+            if (Func.notNull(rtuInfoEntity)) {
+                rtuInfoEntity.setRtuName(dto.getWiustNm());
+                rtuBaseInfoService.updateById(rtuInfoEntity);
+            }
+        }
+        return R.status(true);
+    }
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "")
+    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+        List<Long> idArr = Func.toLongList(ids);
+        for (Long id : idArr) {
+            MonitorSiteInfoEntity entity = monitorSiteService.getById(id);
+            //删除RTU
+            RtuInfoEntity rtuInfoEntity = rtuBaseInfoService.rtuInfoByRtuCode(entity.getWiustCd());
+            if (Func.notNull(rtuInfoEntity)) {
+                rtuBaseInfoService.deleteLogic(Func.toLongList(Func.toStr(rtuInfoEntity.getId())));
+            }
+            //删除RTU状态
+//            LambdaQueryWrapper<RtuStatusEntity> wrapper = Wrappers.<RtuStatusEntity>query().lambda();
+//            wrapper.eq(RtuStatusEntity::getIsDeleted, 0);
+//            wrapper.eq(RtuStatusEntity::getRtuCode, entity.getWiustCd());
+//            RtuStatusEntity rtuStatusEntity = rtuManageService.getOne(wrapper);
+//            if (Func.notNull(rtuStatusEntity)) {
+//                rtuManageService.deleteLogic(Func.toLongList(Func.toStr(rtuStatusEntity.getId())));
+//            }
+            //删除站点下点位
+            monitorSiteService.removeRelPoints(entity.getWiustCd());
+            //删除测站和用水户关联表
+            monitorSiteRelService.removeRel(entity.getWiustCd());
+        }
+        //删除站点
+        boolean temp = monitorSiteService.deleteLogic(Func.toLongList(ids));
+        return R.status(true);
+    }
+}

+ 42 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/dto/MonitorSiteInfoDTO.java

@@ -0,0 +1,42 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class MonitorSiteInfoDTO extends MonitorSiteInfoEntity {
+    /**
+     * 取用水户代码
+     */
+    @ApiModelProperty(value = "取用水户代码")
+    private String wiuCd;
+
+    /**
+     * 取用水户名称
+     */
+    @ApiModelProperty(value = "取用水户名称")
+    private String wiuNm;
+
+    /**
+     * 机构ID
+     */
+    @ApiModelProperty(value = "机构ID")
+    private Long orgId;
+}

+ 164 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/entity/MonitorSiteInfoEntity.java

@@ -0,0 +1,164 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.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 org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("base_wiust_info")
+public class MonitorSiteInfoEntity extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 租户ID
+     */
+    @ApiModelProperty("租户ID")
+    private String tenantId;
+
+    /**
+     * 取用水测站代码
+     */
+    @ApiModelProperty(value = "取用水测站代码")
+    private String wiustCd;
+
+    /**
+     * 取用水测站名称
+     */
+    @ApiModelProperty(value = "取用水测站名称")
+    private String wiustNm;
+
+    /**
+     * 取用水测站类别
+     */
+    @ApiModelProperty(value = "取用水测站类别")
+    private String wiustTp;
+
+    /**
+     * 所在地
+     */
+    @ApiModelProperty(value = "所在地")
+    private String loc;
+
+    /**
+     * 基面类型
+     */
+    @ApiModelProperty(value = "基面类型")
+    private String datTp;
+
+    /**
+     * 基面高程
+     */
+    @ApiModelProperty(value = "基面高程")
+    private String datElev;
+
+    /**
+     * 修正基值
+     */
+    @ApiModelProperty(value = "修正基值")
+    private String modBasVal;
+
+    /**
+     * 修正参数
+     */
+    @ApiModelProperty(value = "修正参数")
+    private String modPara;
+
+    /**
+     * 测井类型
+     */
+    @ApiModelProperty(value = "测井类型")
+    private String wellTp;
+
+    /**
+     * 测井地面高程
+     */
+    @ApiModelProperty(value = "测井地面高程")
+    private String wellLandElev;
+
+    /**
+     * 设站年月
+     */
+    @ApiModelProperty(value = "设站年月")
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss",
+            timezone = "GMT+8"
+    )
+    private Date estStYm;
+
+    /**
+     * 运行状况
+     */
+    @ApiModelProperty(value = "运行状况")
+    private String runCond;
+
+    /**
+     * 管理单位代码
+     */
+    @ApiModelProperty(value = "管理单位代码")
+    private String engManCd;
+
+    /**
+     * 时间
+     */
+    @ApiModelProperty(value = "时间")
+    private String ts;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String nt;
+
+    /**
+     * 水资源类型
+     */
+    @ApiModelProperty(value = "水资源类型")
+    private String waterType;
+
+    /**
+     * 用户类型
+     */
+    @ApiModelProperty(value = "用户类型")
+    private String useType;
+
+    /**
+     * 证照编号
+     */
+    @ApiModelProperty(value = "证照编号")
+    private String siteCertId;
+
+    /**
+     * 0 国控转计量,1用户安装的计量设施,2 中央专项资金
+     */
+    @ApiModelProperty(value = "站点建设来源类型")
+    private String siteOwner;
+
+    /**
+     * 是否同步到金水平台
+     */
+    @ApiModelProperty(value = "是否同步到金水平台")
+    private Integer dataShareActive;
+}

+ 62 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/entity/MonitorSiteRelEntity.java

@@ -0,0 +1,62 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.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 org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("base_wiu_wiust_rel")
+public class MonitorSiteRelEntity extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 租户ID
+     */
+    @ApiModelProperty("租户ID")
+    private String tenantId;
+
+    /**
+     * 用水户代码
+     */
+    @ApiModelProperty(value = "用水户代码")
+    private String wiuCd;
+
+    /**
+     * 监测站代码
+     */
+    @ApiModelProperty(value = "监测站代码")
+    private String wiustCd;
+
+    /**
+     * 时间
+     */
+    @ApiModelProperty(value = "时间")
+    private String ts;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String nt;
+
+}

+ 49 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteMapper.java

@@ -0,0 +1,49 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.baseinfo.monitorsite.dto.MonitorSiteInfoDTO;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+import org.springblade.modules.baseinfo.monitorsite.vo.MonitorSiteInfoVO;
+
+import java.util.List;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface MonitorSiteMapper extends BaseMapper<MonitorSiteInfoEntity> {
+    /**
+     * 分页查询
+     * @param page
+     * @param dto
+     * @return
+     */
+    List<MonitorSiteInfoVO> selectPage(IPage<MonitorSiteInfoVO> page, @Param("dto") MonitorSiteInfoEntity dto);
+
+    /**
+     * 查询所有站点
+     * @param dto
+     * @return
+     */
+    List<MonitorSiteInfoEntity> selectAll(@Param("dto") MonitorSiteInfoEntity dto);
+
+    /**
+     * 查询站点数量
+     * @param dto
+     * @return
+     */
+    Long  getMonitorSiteCount(@Param("dto") MonitorSiteInfoDTO dto);
+}

+ 122 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteMapper.xml

@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.baseinfo.monitorsite.mapper.MonitorSiteMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="monitorSiteInfoResultMap"
+               type="org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity">
+
+        <result column="wiust_cd" property="wiustCd"/>
+        <result column="wiust_nm" property="wiustNm"/>
+        <result column="wiust_tp" property="wiustTp"/>
+        <result column="loc" property="loc"/>
+        <result column="dat_tp" property="datTp"/>
+        <result column="dat_elev" property="datElev"/>
+        <result column="mod_bas_val" property="modBasVal"/>
+        <result column="mod_para" property="modPara"/>
+        <result column="well_tp" property="wellTp"/>
+        <result column="well_land_elev" property="wellLandElev"/>
+        <result column="est_st_ym" property="estStYm"/>
+        <result column="run_cond" property="runCond"/>
+        <result column="eng_man_cd" property="engManCd"/>
+        <result column="water_type" property="waterType"/>
+        <result column="use_type" property="useType"/>
+        <result column="ts" property="ts"/>
+        <result column="nt" property="nt"/>
+        <result column="site_cert_id" property="siteCertId"/>
+        <result column="site_owner" property="siteOwner"/>
+        <result column="data_share_active" property="dataShareActive"/>
+
+    </resultMap>
+
+    <resultMap id="monitorSiteInfoVOResultMap"
+               type="org.springblade.modules.baseinfo.monitorsite.vo.MonitorSiteInfoVO">
+
+        <result column="wiust_cd" property="wiustCd"/>
+        <result column="wiust_nm" property="wiustNm"/>
+        <result column="wiust_tp" property="wiustTp"/>
+        <result column="loc" property="loc"/>
+        <result column="dat_tp" property="datTp"/>
+        <result column="dat_elev" property="datElev"/>
+        <result column="mod_bas_val" property="modBasVal"/>
+        <result column="mod_para" property="modPara"/>
+        <result column="well_tp" property="wellTp"/>
+        <result column="well_land_elev" property="wellLandElev"/>
+        <result column="est_st_ym" property="estStYm"/>
+        <result column="run_cond" property="runCond"/>
+        <result column="eng_man_cd" property="engManCd"/>
+        <result column="water_type" property="waterType"/>
+        <result column="use_type" property="useType"/>
+        <result column="ts" property="ts"/>
+        <result column="nt" property="nt"/>
+        <result column="site_cert_id" property="siteCertId"/>
+        <result column="site_owner" property="siteOwner"/>
+        <result column="data_share_active" property="dataShareActive"/>
+        <result column="wiu_cd" property="wiuCd"/>
+        <result column="wiu_nm" property="wiuNm"/>
+        <result column="org_id" property="orgId"/>
+        <result column="dept_name" property="orgName"/>
+
+    </resultMap>
+
+    <select id="selectPage" resultMap="monitorSiteInfoVOResultMap">
+        SELECT
+        n.*,u.wiu_cd,u.wiu_nm,u.org_id,d.dept_name
+        FROM
+        base_wiust_info n
+        LEFT JOIN base_wiu_wiust_rel ww ON ww.wiust_cd = n.wiust_cd and ww.is_deleted=0
+        LEFT JOIN base_wr_wiu_info u ON u.wiu_cd = ww.wiu_cd and u.is_deleted=0
+        LEFT JOIN blade_dept d ON d.id = u.org_id and d.is_deleted=0
+        WHERE
+        n.is_deleted = 0
+        <if test="dto.wiustNm!=null">
+            and n.wiust_nm like concat(concat('%', #{dto.wiustNm}), '%')
+        </if>
+        <if test="dto.wiustCd!=null">
+            and n.wiust_cd like concat(concat('%', #{dto.wiustCd}), '%')
+        </if>
+        <if test="dto.wiuNm!=null">
+            and u.wiu_nm like concat(concat('%', #{dto.wiuNm}), '%')
+        </if>
+        <if test="dto.orgId!=null">
+            and (d.id =#{dto.orgId} or  FIND_IN_SET(#{dto.orgId} ,d.ancestors) >0 )
+        </if>
+        order by n.wiust_cd
+    </select>
+
+    <select id="selectAll" resultMap="monitorSiteInfoResultMap">
+        SELECT
+        n.*
+        FROM
+        base_wiust_info n
+        WHERE
+        n.is_deleted = 0
+        <if test="dto.wiustNm!=null">
+            and n.wiust_nm like concat(concat('%', #{dto.wiustNm}), '%')
+        </if>
+        <if test="dto.wiustCd!=null">
+            and n.wiust_cd like concat(concat('%', #{dto.wiustCd}), '%')
+        </if>
+        <if test="dto.dataShareActive!=null">
+            and n.data_share_active = #{dto.dataShareActive}
+        </if>
+        order by n.wiust_cd
+    </select>
+
+    <select id="getMonitorSiteCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        n.wiust_cd
+        FROM
+        base_wiust_info n
+        LEFT JOIN base_wiu_wiust_rel ww ON ww.wiust_cd = n.wiust_cd and ww.is_deleted=0
+        LEFT JOIN base_wr_wiu_info u ON u.wiu_cd = ww.wiu_cd and u.is_deleted=0
+        LEFT JOIN blade_dept d ON d.id = u.org_id and d.is_deleted=0
+        WHERE
+        n.is_deleted = 0
+        <if test="dto.orgId!=null">
+            and (d.id =#{dto.orgId} or  FIND_IN_SET(#{dto.orgId} ,d.ancestors) >0 )
+        </if>
+        group by n.wiust_cd ) a
+    </select>
+</mapper>

+ 24 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteRelMapper.java

@@ -0,0 +1,24 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity;
+
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface MonitorSiteRelMapper extends BaseMapper<MonitorSiteRelEntity> {
+
+}

+ 14 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteRelMapper.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.baseinfo.monitorsite.mapper.MonitorSiteRelMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="monitorSiteRelResultMap"
+               type="org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity">
+        <result column="wiu_cd" property="wiuCd"/>
+        <result column="wiust_cd" property="wiustCd"/>
+        <result column="ts" property="ts"/>
+        <result column="nt" property="nt"/>
+    </resultMap>
+
+</mapper>

+ 29 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/service/IMonitorSiteRelService.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity;
+
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IMonitorSiteRelService extends BaseService<MonitorSiteRelEntity> {
+    /**
+     * 删除站点关联
+     * @param siteCode
+     * @return
+     */
+    boolean removeRel(String siteCode);
+}

+ 62 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/service/IMonitorSiteService.java

@@ -0,0 +1,62 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.monitorsite.dto.MonitorSiteInfoDTO;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+import org.springblade.modules.baseinfo.monitorsite.vo.MonitorSiteInfoVO;
+
+import java.util.List;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IMonitorSiteService extends BaseService<MonitorSiteInfoEntity> {
+    /**
+     * 分页查询站点
+     * @param page
+     * @param dto
+     * @return
+     */
+    IPage<MonitorSiteInfoVO> selectPage(IPage<MonitorSiteInfoVO> page, MonitorSiteInfoEntity dto);
+
+    /**
+     * 查询所有站点
+     * @param dto
+     * @return
+     */
+    List<MonitorSiteInfoEntity> selectAll(MonitorSiteInfoEntity dto);
+
+    /**
+     * 查询站点数量
+     * @param dto
+     * @return
+     */
+    Long getMonitorSiteCount(MonitorSiteInfoDTO dto);
+
+    /**
+     * 删除站点关联点位
+     * @param siteCode
+     * @return
+     */
+    boolean removeRelPoints(String siteCode);
+
+    /**
+     * 删除用水户下站点
+     * @param wiuCode
+     * @return
+     */
+    boolean removeSite(String wiuCode);
+}

+ 42 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/service/impl/MonitorSiteRelServiceImpl.java

@@ -0,0 +1,42 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity;
+import org.springblade.modules.baseinfo.monitorsite.mapper.MonitorSiteRelMapper;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteRelService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class MonitorSiteRelServiceImpl extends BaseServiceImpl<MonitorSiteRelMapper, MonitorSiteRelEntity> implements IMonitorSiteRelService {
+
+    @Override
+    public boolean removeRel(String siteCode) {
+        LambdaQueryWrapper<MonitorSiteRelEntity> wrapper = Wrappers.<MonitorSiteRelEntity>query().lambda();
+        wrapper.eq(MonitorSiteRelEntity::getIsDeleted, 0);
+        wrapper.eq(MonitorSiteRelEntity::getWiustCd, siteCode);
+        List<MonitorSiteRelEntity> list = this.list(wrapper);
+        for (MonitorSiteRelEntity entity : list) {
+            this.deleteLogic(Func.toLongList(Func.toStr(entity.getId())));
+        }
+        return true;
+    }
+}

+ 123 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/service/impl/MonitorSiteServiceImpl.java

@@ -0,0 +1,123 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointRelService;
+import org.springblade.modules.baseinfo.monitorpoint.service.IMonitorPointService;
+import org.springblade.modules.baseinfo.monitorsite.dto.MonitorSiteInfoDTO;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity;
+import org.springblade.modules.baseinfo.monitorsite.mapper.MonitorSiteMapper;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteRelService;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteService;
+import org.springblade.modules.baseinfo.monitorsite.vo.MonitorSiteInfoVO;
+import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
+import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
+import org.springblade.modules.business.rtumanage.entity.RtuStatusEntity;
+import org.springblade.modules.business.rtumanage.service.IRtuManageService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class MonitorSiteServiceImpl extends BaseServiceImpl<MonitorSiteMapper, MonitorSiteInfoEntity> implements IMonitorSiteService {
+
+    @Resource
+    private IMonitorPointService monitorPointService;
+
+    @Resource
+    private IMonitorPointRelService pointRelService;
+
+    @Resource
+    private IMonitorSiteRelService siteRelService;
+
+    @Resource
+    private IRtuBaseInfoService rtuBaseInfoService;
+
+    @Resource
+    private IRtuManageService rtuManageService;
+
+
+    @Override
+    public IPage<MonitorSiteInfoVO> selectPage(IPage<MonitorSiteInfoVO> page, MonitorSiteInfoEntity dto) {
+        return page.setRecords(baseMapper.selectPage(page, dto));
+    }
+
+    @Override
+    public List<MonitorSiteInfoEntity> selectAll(MonitorSiteInfoEntity dto) {
+        return baseMapper.selectAll(dto);
+    }
+
+    @Override
+    public Long getMonitorSiteCount(MonitorSiteInfoDTO dto) {
+        return baseMapper.getMonitorSiteCount(dto);
+    }
+
+    @Override
+    public boolean removeRelPoints(String siteCode) {
+        //删除点位
+        LambdaQueryWrapper<MonitorPointRelEntity> wrapper = Wrappers.<MonitorPointRelEntity>query().lambda();
+        wrapper.eq(MonitorPointRelEntity::getIsDeleted, 0);
+        wrapper.eq(MonitorPointRelEntity::getWiustCd, siteCode);
+        List<MonitorPointRelEntity> list = pointRelService.list(wrapper);
+        for (MonitorPointRelEntity entity : list) {
+            monitorPointService.removePoint(entity.getMpCd());
+        }
+        return true;
+    }
+
+    @Override
+    public boolean removeSite(String wiuCode) {
+        LambdaQueryWrapper<MonitorSiteRelEntity> wrapper = Wrappers.<MonitorSiteRelEntity>query().lambda();
+        wrapper.eq(MonitorSiteRelEntity::getIsDeleted, 0);
+        wrapper.eq(MonitorSiteRelEntity::getWiuCd, wiuCode);
+        List<MonitorSiteRelEntity> relEntityList = siteRelService.list(wrapper);
+        for (MonitorSiteRelEntity relEntity : relEntityList) {
+            LambdaQueryWrapper<MonitorSiteInfoEntity> wrapper2 = Wrappers.<MonitorSiteInfoEntity>query().lambda();
+            wrapper2.eq(MonitorSiteInfoEntity::getIsDeleted, 0);
+            wrapper2.eq(MonitorSiteInfoEntity::getWiustCd, relEntity.getWiustCd());
+            List<MonitorSiteInfoEntity> list = this.list(wrapper2);
+            for (MonitorSiteInfoEntity entity : list) {
+                //删除站点下的点位
+                this.removeRelPoints(entity.getWiustCd());
+                //删除RTU
+                RtuInfoEntity rtuInfoEntity = rtuBaseInfoService.rtuInfoByRtuCode(entity.getWiustCd());
+                if (Func.notNull(rtuInfoEntity)) {
+                    rtuBaseInfoService.deleteLogic(Func.toLongList(Func.toStr(rtuInfoEntity.getId())));
+                }
+                //删除RTU状态
+//                LambdaQueryWrapper<RtuStatusEntity> wrapper3 = Wrappers.<RtuStatusEntity>query().lambda();
+//                wrapper3.eq(RtuStatusEntity::getIsDeleted, 0);
+//                wrapper3.eq(RtuStatusEntity::getRtuCode, entity.getWiustCd());
+//                RtuStatusEntity rtuStatusEntity = rtuManageService.getOne(wrapper3);
+//                if (Func.notNull(rtuStatusEntity)) {
+//                    rtuManageService.deleteLogic(Func.toLongList(Func.toStr(rtuStatusEntity.getId())));
+//                }
+                //删除站点
+                this.deleteLogic(Func.toLongList(Func.toStr(entity.getId())));
+            }
+            //删除站点关联
+            siteRelService.removeRel(relEntity.getWiustCd());
+        }
+        return true;
+    }
+}

+ 49 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/vo/MonitorSiteInfoVO.java

@@ -0,0 +1,49 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class MonitorSiteInfoVO extends MonitorSiteInfoEntity {
+    /**
+     * 机构ID
+     */
+    @ApiModelProperty(value = "机构ID")
+    private Long orgId;
+
+    /**
+     * 机构名称
+     */
+    @ApiModelProperty(value = "机构名称")
+    private String orgName;
+
+    /**
+     * 取用水户代码
+     */
+    @ApiModelProperty(value = "取用水户代码")
+    private String wiuCd;
+
+    /**
+     * 取用水户名称
+     */
+    @ApiModelProperty(value = "取用水户名称")
+    private String wiuNm;
+}

+ 106 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/monitorsite/wrapper/MonitorSiteWrapper.java

@@ -0,0 +1,106 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.wrapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteRelService;
+import org.springblade.modules.baseinfo.monitorsite.vo.MonitorSiteInfoVO;
+import org.springblade.modules.baseinfo.region.service.IBaseInfoRegionService;
+import org.springblade.modules.baseinfo.wateruseconsumer.entity.WaterUseConsumerInfoEntity;
+import org.springblade.modules.baseinfo.wateruseconsumer.service.IWaterUseConsumerService;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.service.IDeptService;
+
+import java.util.Objects;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public class MonitorSiteWrapper extends BaseEntityWrapper<MonitorSiteInfoEntity, MonitorSiteInfoVO> {
+    public static MonitorSiteWrapper build() {
+        return new MonitorSiteWrapper();
+    }
+
+    private static IDeptService deptService;
+
+    private static IDeptService getDeptService() {
+        if (deptService == null) {
+            deptService = SpringUtil.getBean(IDeptService.class);
+        }
+        return deptService;
+    }
+
+    private static IMonitorSiteRelService monitorSiteRelService;
+
+    private static IMonitorSiteRelService getMonitorSiteRelService() {
+        if (monitorSiteRelService == null) {
+            monitorSiteRelService = SpringUtil.getBean(IMonitorSiteRelService.class);
+        }
+        return monitorSiteRelService;
+    }
+
+    private static IWaterUseConsumerService waterUseConsumerService;
+
+    private static IWaterUseConsumerService getWaterUseConsumerService() {
+        if (waterUseConsumerService == null) {
+            waterUseConsumerService = SpringUtil.getBean(IWaterUseConsumerService.class);
+        }
+        return waterUseConsumerService;
+    }
+
+    @Override
+    public MonitorSiteInfoVO entityVO(MonitorSiteInfoEntity entity) {
+        MonitorSiteInfoVO vo = Objects.requireNonNull(BeanUtil.copy(entity, MonitorSiteInfoVO.class));
+        if (vo.getWiuNm() == null) {
+            LambdaQueryWrapper<MonitorSiteRelEntity> wrapper = Wrappers.<MonitorSiteRelEntity>query().lambda();
+            wrapper.eq(MonitorSiteRelEntity::getWiustCd, entity.getWiustCd());
+            wrapper.last("limit 1");
+            MonitorSiteRelEntity relEntity = getMonitorSiteRelService().getOne(wrapper);
+            if (null != relEntity) {
+                LambdaQueryWrapper<WaterUseConsumerInfoEntity> wrapper2 = Wrappers.<WaterUseConsumerInfoEntity>query().lambda();
+                wrapper2.eq(WaterUseConsumerInfoEntity::getWiuCd, relEntity.getWiuCd());
+                wrapper2.last("limit 1");
+                WaterUseConsumerInfoEntity waterUseConsumerInfoEntity = getWaterUseConsumerService().getOne(wrapper2);
+                if (null != waterUseConsumerInfoEntity) {
+                    vo.setWiuCd(waterUseConsumerInfoEntity.getWiuCd());
+                    vo.setWiuNm(waterUseConsumerInfoEntity.getWiuNm());
+                }
+            }
+        }
+        if (vo.getOrgName() == null) {
+            LambdaQueryWrapper<MonitorSiteRelEntity> wrapper = Wrappers.<MonitorSiteRelEntity>query().lambda();
+            wrapper.eq(MonitorSiteRelEntity::getWiustCd, entity.getWiustCd());
+            wrapper.last("limit 1");
+            MonitorSiteRelEntity relEntity = getMonitorSiteRelService().getOne(wrapper);
+            if (null != relEntity) {
+                LambdaQueryWrapper<WaterUseConsumerInfoEntity> wrapper2 = Wrappers.<WaterUseConsumerInfoEntity>query().lambda();
+                wrapper2.eq(WaterUseConsumerInfoEntity::getWiuCd, relEntity.getWiuCd());
+                wrapper2.last("limit 1");
+                WaterUseConsumerInfoEntity waterUseConsumerInfoEntity = getWaterUseConsumerService().getOne(wrapper2);
+                if (null != waterUseConsumerInfoEntity) {
+                    Dept dept = getDeptService().getById(waterUseConsumerInfoEntity.getOrgId());
+                    if (null != dept) {
+                        vo.setOrgId(waterUseConsumerInfoEntity.getOrgId());
+                        vo.setOrgName(dept.getDeptName());
+                    }
+                }
+            }
+        }
+        return vo;
+    }
+}

+ 303 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/controller/BaseOrgController.java

@@ -0,0 +1,303 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.org.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.constant.BusinessConstant;
+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.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.baseinfo.org.dto.OrgInfoDTO;
+import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
+import org.springblade.modules.baseinfo.org.entity.OrgTreeNodeEntity;
+import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
+import org.springblade.modules.baseinfo.org.vo.OrgInfoVO;
+import org.springblade.modules.baseinfo.org.wrapper.OrgInfoWrapper;
+import org.springblade.modules.baseinfo.region.service.IBaseInfoRegionService;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.service.IDeptService;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.LinkedList;
+import java.util.List;
+
+
+/***
+ * Date:2022/8/22
+ * Title: 组织机构管理
+ * Description:系统管理员管理盟市,盟市管理员管理运维单位
+ * @author swp
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@RestController
+@RequestMapping("galaxy-business/base/org")
+@AllArgsConstructor
+@Api(value = "运维单位管理", tags = "运维单位管理")
+public class BaseOrgController extends BladeController {
+	private final IDeptService deptService;
+	private final IDeptRegionService deptRegionService;
+	private final IBaseInfoRegionService regionService;
+
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "分页")
+	public R<List<OrgInfoVO>> list() {
+		BladeUser user = AuthUtil.getUser();
+		LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
+		wrapper.eq(Dept::getIsDeleted, 0);
+		wrapper.eq(Dept::getParentId, Func.toLong(user.getDeptId()));
+		List<Dept> pages = deptService.list(wrapper);
+		return R.data(OrgInfoWrapper.build().listVO(pages));
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "deptName", value = "机构名称", paramType = "query", dataType = "string"),
+	})
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "分页")
+	public R<IPage<OrgInfoVO>> page(@ApiIgnore Dept entity, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
+		wrapper.eq(Dept::getIsDeleted, 0);
+		wrapper.eq(Dept::getParentId, Func.toLong(user.getDeptId()));
+		if (entity.getDeptName() != null && entity.getDeptName().length() > 0) {
+			wrapper.like(Dept::getDeptName, entity.getDeptName());
+		}
+		IPage<Dept> pages = deptService.page(Condition.getPage(query), wrapper);
+		return R.data(OrgInfoWrapper.build().pageVO(pages));
+	}
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "详情", notes = "传入 Dept")
+	public R<Dept> detail(Dept dept) {
+		Dept vo = deptService.getById(dept.getId());
+		return R.data(vo);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "新增", notes = "传入 Dept")
+	@Transactional
+	public R save(@RequestBody OrgInfoDTO dept) {
+		BladeUser user = AuthUtil.getUser();
+		dept.setFullName(dept.getDeptName());
+		dept.setParentId(Func.toLong(user.getDeptId()));
+		Dept parentDept = this.deptService.getById(Func.toLong(user.getDeptId()));
+		dept.setAncestors(parentDept.getAncestors() + "," + parentDept.getId());
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			dept.setDeptCategory(2);
+		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName())) {
+			dept.setDeptCategory(1);
+		}
+		this.deptService.save(dept);
+		DeptRegionEntity deptRegionEntity = new DeptRegionEntity();
+		deptRegionEntity.setDeptId(dept.getId());
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			deptRegionEntity.setAdcd(dept.getAdcd());
+		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName())) {
+			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+			DeptRegionEntity orgAdmindRegion = this.deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+			deptRegionEntity.setAdcd(orgAdmindRegion.getAdcd());
+		}
+		this.deptRegionService.save(deptRegionEntity);
+		this.regionService.updateAdminRegionCache();
+		return R.status(true);
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "修改", notes = "传入 Dept")
+	public R update(@RequestBody Dept dept) {
+		return R.status(deptService.updateById(dept));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入 Dept")
+	public R submit(@RequestBody Dept dept) {
+		deptService.saveOrUpdate(dept);
+		return R.status(deptService.saveOrUpdate(dept));
+	}
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ID数组")
+	public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+		BladeUser user = AuthUtil.getUser();
+		if (null == ids) {
+			return R.status(false);
+		}
+		List<Long> list = Func.toLongList(ids);
+		for (Long id : list) {
+			deptService.removeById(id);
+			LambdaUpdateWrapper<DeptRegionEntity> updateWrapper = Wrappers.<DeptRegionEntity>update().lambda();
+			updateWrapper.set(DeptRegionEntity::getIsDeleted, 1);
+			updateWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+			updateWrapper.eq(DeptRegionEntity::getDeptId, id);
+			deptRegionService.update(updateWrapper);
+		}
+		this.regionService.updateAdminRegionCache();
+		return R.status(true);
+	}
+
+	@GetMapping("/lazy-tree")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "parentId", value = "行政区划代码", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "树")
+	public R<List<OrgTreeNodeEntity>> lazyTree(@ApiIgnore OrgInfoDTO dto) {
+		List<OrgTreeNodeEntity> nodeEntities = new LinkedList<>();
+		BladeUser user = AuthUtil.getUser();
+		LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
+		if (dto.getParentId() == null) {
+			wrapper.eq(Dept::getId, Func.toLong(user.getDeptId()));
+		} else {
+			wrapper.eq(Dept::getParentId, Func.toLong(dto.getParentId()));
+		}
+		List<Dept> list = this.deptService.list(wrapper);
+		for (Dept entity : list) {
+			OrgTreeNodeEntity nodeEntity = new OrgTreeNodeEntity();
+			nodeEntity.setId(Func.toStr(entity.getId()));
+			nodeEntity.setValue(Func.toStr(entity.getId()));
+			nodeEntity.setTitle(entity.getDeptName());
+			nodeEntity.setText(entity.getDeptName());
+			nodeEntity.setKey(Func.toStr(entity.getId()));
+			nodeEntity.setParentId(Func.toStr(entity.getParentId()));
+			LambdaQueryWrapper<Dept> childrenWrapper = Wrappers.<Dept>query().lambda();
+			childrenWrapper.eq(Dept::getParentId, entity.getId());
+			long count = this.deptService.count(childrenWrapper);
+			if (count > 0) {
+				nodeEntity.setHasChildren(true);
+			} else {
+				nodeEntity.setHasChildren(false);
+			}
+			nodeEntities.add(nodeEntity);
+		}
+
+		return R.data(nodeEntities);
+	}
+
+	@GetMapping("/tree")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "树")
+	public R<List<OrgTreeNodeEntity>> orgTree() {
+		//ValueOperations<String, String> opsHash = redisTemplate.opsForValue();
+		List<OrgTreeNodeEntity> nodeEntities = new LinkedList<>();
+		BladeUser user = AuthUtil.getUser();
+		LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
+		wrapper.eq(Dept::getId, Func.toLong(user.getDeptId()));
+		List<Dept> list = this.deptService.list(wrapper);
+		for (Dept entity : list) {
+			OrgTreeNodeEntity nodeEntity = new OrgTreeNodeEntity();
+			nodeEntity.setId(Func.toStr(entity.getId()));
+			nodeEntity.setValue(Func.toStr(entity.getId()));
+			nodeEntity.setTitle(entity.getDeptName());
+			nodeEntity.setText(entity.getDeptName());
+			nodeEntity.setKey(Func.toStr(entity.getId()));
+			nodeEntity.setParentId(Func.toStr(entity.getParentId()));
+			getChildren(nodeEntity, entity);
+			if (nodeEntity.getChildren() != null && nodeEntity.getChildren().size() > 0) {
+				nodeEntity.setHasChildren(true);
+			} else {
+				nodeEntity.setHasChildren(false);
+			}
+			nodeEntities.add(nodeEntity);
+		}
+		return R.data(nodeEntities);
+	}
+
+
+	@GetMapping("/tree/{orgId}")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "树")
+	public R<List<OrgTreeNodeEntity>> orgTree(@PathVariable(name = "orgId") String orgId) {
+		List<OrgTreeNodeEntity> nodeEntities = new LinkedList<>();
+		LambdaQueryWrapper<Dept> deptRegionEntityLambdaQueryWrapper = Wrappers.<Dept>query().lambda();
+		deptRegionEntityLambdaQueryWrapper.eq(Dept::getIsDeleted, 0);
+		deptRegionEntityLambdaQueryWrapper.eq(Dept::getId, Func.toLong(orgId));
+		List<Dept> list = deptService.list(deptRegionEntityLambdaQueryWrapper);
+		for (Dept entity : list) {
+			OrgTreeNodeEntity nodeEntity = new OrgTreeNodeEntity();
+			nodeEntity.setId(Func.toStr(entity.getId()));
+			nodeEntity.setValue(Func.toStr(entity.getId()));
+			nodeEntity.setTitle(entity.getDeptName());
+			nodeEntity.setText(entity.getDeptName());
+			nodeEntity.setKey(Func.toStr(entity.getId()));
+			nodeEntity.setParentId(Func.toStr(entity.getParentId()));
+			getChildren(nodeEntity, entity);
+			if (nodeEntity.getChildren() != null && nodeEntity.getChildren().size() > 0) {
+				nodeEntity.setHasChildren(true);
+			} else {
+				nodeEntity.setHasChildren(false);
+			}
+			nodeEntities.add(nodeEntity);
+		}
+		return R.data(nodeEntities);
+	}
+
+	private void getChildren(OrgTreeNodeEntity nodeEntity, Dept orgEntity) {
+		LambdaQueryWrapper<Dept> queryWrapper = Wrappers.<Dept>query().lambda();
+		queryWrapper.eq(Dept::getParentId, Func.toLong(orgEntity.getId()));
+		List<Dept> list = deptService.list(queryWrapper);
+		if (null != list && list.size() > 0) {
+			List<OrgTreeNodeEntity> nodeEntities = new LinkedList<>();
+			for (Dept entity : list) {
+				OrgTreeNodeEntity node = new OrgTreeNodeEntity();
+				node.setId(Func.toStr(entity.getId()));
+				node.setValue(Func.toStr(entity.getId()));
+				node.setTitle(entity.getDeptName());
+				node.setText(entity.getDeptName());
+				node.setKey(Func.toStr(entity.getId()));
+				node.setParentId(Func.toStr(entity.getParentId()));
+				getChildren(node, entity);
+				if (node.getChildren() != null && node.getChildren().size() > 0) {
+					node.setHasChildren(true);
+				} else {
+					node.setHasChildren(false);
+				}
+				nodeEntities.add(node);
+			}
+			nodeEntity.setChildren(nodeEntities);
+		}
+	}
+}

+ 30 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/dto/OrgInfoDTO.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/2/22
+ */
+package org.springblade.modules.baseinfo.org.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.system.entity.Dept;
+
+/***
+ * Date:2023/2/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OrgInfoDTO extends Dept {
+	/**
+	 * 区划
+	 */
+	@ApiModelProperty(value = "区划")
+	private String adcd;
+}

+ 45 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/entity/DeptRegionEntity.java

@@ -0,0 +1,45 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:运维系统
+ * 创建日期:2022/3/9
+ */
+package org.springblade.modules.baseinfo.org.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;
+
+
+/**
+ * 机构与行政区划绑定信息实体类
+ *
+ * @author swp
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("blade_dept_region")
+public class DeptRegionEntity extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 租户ID
+	 */
+	@ApiModelProperty("租户ID")
+	private String tenantId;
+
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty(value = "机构ID")
+	private Long deptId;
+
+	/**
+	 * 行政区划编码
+	 */
+	@ApiModelProperty(value = "行政区划编码")
+	private String adcd;
+}

+ 73 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/entity/OrgInfoEntity.java

@@ -0,0 +1,73 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/6/30
+ */
+package org.springblade.modules.baseinfo.org.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;
+
+/***
+ * Date:2023/6/30
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("blade_dept")
+public class OrgInfoEntity extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * 租户ID
+     */
+    @ApiModelProperty("租户ID")
+    private String tenantId;
+
+    /**
+     * 机构父ID
+     */
+    @ApiModelProperty(value = "机构父ID")
+    private Long parentId;
+
+    /**
+     * 祖级列表
+     */
+    @ApiModelProperty(value = "祖级列表")
+    private String ancestors;
+
+    /**
+     * 机构名称
+     */
+    @ApiModelProperty(value = "机构名称")
+    private String deptName;
+
+    /**
+     * 机构名称全称
+     */
+    @ApiModelProperty(value = "机构名称全称")
+    private String fullName;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    /**
+     * 部门类型
+     */
+    @ApiModelProperty(value = "部门类型")
+    private Integer deptCategory;
+
+}

+ 49 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/entity/OrgTreeNodeEntity.java

@@ -0,0 +1,49 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/9/6
+ */
+package org.springblade.modules.baseinfo.org.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/***
+ * Date:2022/9/6
+ * Title: 行政区划功能模块
+ * Description:树节点实体类,AVUE TREE 适用
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+public class OrgTreeNodeEntity {
+
+	@ApiModelProperty("ID")
+	private String id;
+
+	@ApiModelProperty("父ID")
+	private String parentId;
+
+	@ApiModelProperty("键")
+	private String key;
+
+	@ApiModelProperty("节点值")
+	private String value;
+
+	@ApiModelProperty("标题")
+	private String  title;
+
+	@ApiModelProperty("标题")
+	private String  text;
+
+	@ApiModelProperty("子节点")
+	List<OrgTreeNodeEntity> children;
+
+	@ApiModelProperty("是否有子节点")
+	private Boolean hasChildren;
+
+}

+ 29 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/mapper/BaseOrgMapper.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/2/23
+ */
+package org.springblade.modules.baseinfo.org.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.baseinfo.org.dto.OrgInfoDTO;
+import org.springblade.modules.baseinfo.org.entity.OrgInfoEntity;
+import org.springblade.modules.baseinfo.org.vo.OrgInfoVO;
+
+import java.util.List;
+
+/***
+ * Date:2023/2/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface BaseOrgMapper extends BaseMapper<OrgInfoEntity> {
+    List<OrgInfoVO> selectPage(IPage page, @Param("dto") OrgInfoDTO dto);
+    List<OrgInfoVO> selectList(@Param("dto") OrgInfoDTO dto);
+}

+ 66 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/mapper/BaseOrgMapper.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.baseinfo.org.mapper.BaseOrgMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="orgResultMap" type="org.springblade.modules.baseinfo.org.entity.OrgInfoEntity">
+        <result column="parent_id" property="parentId"/>
+        <result column="ancestors" property="ancestors"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="full_name" property="fullName"/>
+        <result column="remark" property="remark"/>
+
+    </resultMap>
+
+    <resultMap id="orgVoResultMap" type="org.springblade.modules.baseinfo.org.vo.OrgInfoVO">
+        <result column="parent_id" property="parentId"/>
+        <result column="ancestors" property="ancestors"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="full_name" property="fullName"/>
+        <result column="remark" property="remark"/>
+        <result column="reg_type" property="regType"/>
+    </resultMap>
+
+    <select id="selectPage" resultMap="orgVoResultMap">
+        SELECT
+        d.*,a.reg_type
+        FROM
+        blade_dept d
+        LEFT JOIN blade_dept_att a ON a.dept_id = d.id and a.is_deleted = 0
+        WHERE
+        d.is_deleted = 0
+        <if test="dto.regType!=null">
+            and d.reg_type = #{dto.regType}
+        </if>
+        <if test="dto.deptName!=null">
+            and d.full_name like concat(concat('%', #{dto.deptName}), '%')
+        </if>
+        <if test="dto.parentId!=null">
+            and (d.parent_id = #{dto.parentId} or FIND_IN_SET(#{dto.parentId},ancestors) > 0)
+        </if>
+        ORDER BY
+        d.full_name
+    </select>
+
+    <select id="selectList" resultMap="orgVoResultMap">
+        SELECT
+        d.*,a.reg_type
+        FROM
+        blade_dept d
+        LEFT JOIN blade_dept_att a ON a.dept_id = d.id and a.is_deleted = 0
+        WHERE
+        d.is_deleted = 0
+        <if test="dto.parentId!=null">
+            and d.parent_id = #{dto.parentId}
+        </if>
+        <if test="dto.regType!=null">
+            and d.reg_type = #{dto.regType}
+        </if>
+        <if test="dto.deptName!=null">
+            and d.full_name like concat(concat('%', #{dto.deptName}), '%')
+        </if>
+        ORDER BY
+        d.full_name
+    </select>
+
+</mapper>

+ 23 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptRegionMapper.java

@@ -0,0 +1,23 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/2/23
+ */
+package org.springblade.modules.baseinfo.org.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
+
+/***
+ * Date:2023/2/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface DeptRegionMapper extends BaseMapper<DeptRegionEntity> {
+	DeptRegionEntity getRegionByDeptId(@Param("deptId") Long deptId);
+}

+ 20 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptRegionMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.baseinfo.org.mapper.DeptRegionMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="baseinfoOrgResultMap" type="org.springblade.modules.baseinfo.org.entity.DeptRegionEntity">
+        <result column="dept_id" property="deptId"/>
+        <result column="adcd" property="adcd"/>
+    </resultMap>
+
+    <select id="getRegionByDeptId" resultMap="baseinfoOrgResultMap">
+        SELECT
+        n.*
+        FROM
+        blade_dept_region n
+        WHERE
+        n.is_deleted = 0 and n.dept_id = #{deptId}
+        order by n.update_time desc limit 1
+    </select>
+</mapper>

+ 28 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/service/IBaseOrgService.java

@@ -0,0 +1,28 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/6/30
+ */
+package org.springblade.modules.baseinfo.org.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.org.dto.OrgInfoDTO;
+import org.springblade.modules.baseinfo.org.entity.OrgInfoEntity;
+import org.springblade.modules.baseinfo.org.vo.OrgInfoVO;
+
+import java.util.List;
+
+/***
+ * Date:2023/6/30
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IBaseOrgService extends BaseService<OrgInfoEntity> {
+    IPage<OrgInfoVO> selectPage(IPage<OrgInfoVO> page, OrgInfoDTO dto);
+    List<OrgInfoVO> selectList(OrgInfoDTO dto);
+}

+ 22 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/service/IDeptRegionService.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/2/23
+ */
+package org.springblade.modules.baseinfo.org.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
+
+/***
+ * Date:2023/2/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IDeptRegionService extends BaseService<DeptRegionEntity> {
+	DeptRegionEntity getRegionByDeptId(Long deptId);
+}

+ 41 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/service/impl/BaseOrgServiceImpl.java

@@ -0,0 +1,41 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/6/30
+ */
+package org.springblade.modules.baseinfo.org.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.baseinfo.org.dto.OrgInfoDTO;
+import org.springblade.modules.baseinfo.org.entity.OrgInfoEntity;
+import org.springblade.modules.baseinfo.org.mapper.BaseOrgMapper;
+import org.springblade.modules.baseinfo.org.service.IBaseOrgService;
+import org.springblade.modules.baseinfo.org.vo.OrgInfoVO;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/***
+ * Date:2023/6/30
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class BaseOrgServiceImpl extends BaseServiceImpl<BaseOrgMapper, OrgInfoEntity> implements IBaseOrgService {
+    @Override
+    public IPage<OrgInfoVO> selectPage(IPage<OrgInfoVO> page, OrgInfoDTO dto) {
+        return page.setRecords(baseMapper.selectPage(page,dto));
+    }
+
+    @Override
+    public List<OrgInfoVO> selectList(OrgInfoDTO dto) {
+        return baseMapper.selectList(dto);
+    }
+
+
+}

+ 29 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/service/impl/DeptRegionServiceImpl.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2023/2/23
+ */
+package org.springblade.modules.baseinfo.org.service.impl;
+
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
+import org.springblade.modules.baseinfo.org.mapper.DeptRegionMapper;
+import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
+import org.springframework.stereotype.Service;
+
+/***
+ * Date:2023/2/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class DeptRegionServiceImpl  extends BaseServiceImpl<DeptRegionMapper, DeptRegionEntity> implements IDeptRegionService {
+	@Override
+	public DeptRegionEntity getRegionByDeptId(Long deptId) {
+		return this.baseMapper.getRegionByDeptId(deptId);
+	}
+}

+ 56 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/vo/OrgInfoVO.java

@@ -0,0 +1,56 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.org.vo;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.baseinfo.org.entity.OrgInfoEntity;
+import org.springblade.modules.system.entity.Dept;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OrgInfoVO extends OrgInfoEntity {
+
+
+	/**
+	 * 注册类型
+	 */
+	@ApiModelProperty(value = "注册类型")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer regType;
+
+	/**
+	 * 机构名称
+	 */
+	@ApiModelProperty(value = "机构名称")
+	private String dictValue;
+
+	/**
+	 * 区划编码
+	 */
+	@ApiModelProperty(value = "区划编码")
+	private String adcd;
+
+
+	/**
+	 * 区划名称
+	 */
+	@ApiModelProperty(value = "区划名称")
+	private String adnm;
+
+}

+ 78 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/org/wrapper/OrgInfoWrapper.java

@@ -0,0 +1,78 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.org.wrapper;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
+import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
+import org.springblade.modules.baseinfo.org.vo.OrgInfoVO;
+import org.springblade.modules.baseinfo.region.entity.RegionInfoEntity;
+import org.springblade.modules.baseinfo.region.service.IBaseInfoRegionService;
+import org.springblade.modules.system.entity.Dept;
+
+import java.util.Objects;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public class OrgInfoWrapper extends BaseEntityWrapper<Dept, OrgInfoVO> {
+
+	public static OrgInfoWrapper build() {
+		return new OrgInfoWrapper();
+	}
+
+	private static IBaseInfoRegionService baseInfoRegionService;
+
+	private static IBaseInfoRegionService getBaseInfoRegionService() {
+		if (baseInfoRegionService == null) {
+			baseInfoRegionService = SpringUtil.getBean(IBaseInfoRegionService.class);
+		}
+		return baseInfoRegionService;
+	}
+
+	private static IDeptRegionService deptRegionService;
+
+	private static IDeptRegionService getDeptRegionService() {
+		if (deptRegionService == null) {
+			deptRegionService = SpringUtil.getBean(IDeptRegionService.class);
+		}
+		return deptRegionService;
+	}
+
+
+	@Override
+	public OrgInfoVO entityVO(Dept entity) {
+		OrgInfoVO orgInfoVO = Objects.requireNonNull(BeanUtil.copy(entity, OrgInfoVO.class));
+		orgInfoVO.setDictValue(entity.getDeptName());
+		LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+		deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+		deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, entity.getId());
+		DeptRegionEntity deptRegionEntity = getDeptRegionService().getOne(deptRegionEntityLambdaQueryWrapper);
+		if (deptRegionEntity != null) {
+			LambdaQueryWrapper<RegionInfoEntity> regionInfoEntityLambdaQueryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+			regionInfoEntityLambdaQueryWrapper.eq(RegionInfoEntity::getIsDeleted, 0);
+			regionInfoEntityLambdaQueryWrapper.eq(RegionInfoEntity::getAdcd, deptRegionEntity.getAdcd());
+			RegionInfoEntity regionInfoEntity = getBaseInfoRegionService().getOne(regionInfoEntityLambdaQueryWrapper);
+			if (null != regionInfoEntity) {
+				orgInfoVO.setAdcd(regionInfoEntity.getAdcd());
+				orgInfoVO.setAdnm(regionInfoEntity.getAdnm());
+			}
+		}
+		return orgInfoVO;
+	}
+
+}

+ 255 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/controller/ProjectBaseInfoController.java

@@ -0,0 +1,255 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.project.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.constant.BusinessConstant;
+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.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.baseinfo.project.entity.ProjectInfoEntity;
+import org.springblade.modules.baseinfo.project.entity.ProjectTreeNodeEntity;
+import org.springblade.modules.baseinfo.project.service.IProjectBaseInfoService;
+import org.springblade.modules.baseinfo.project.service.IProjectWarningSettingService;
+import org.springblade.modules.baseinfo.project.vo.ProjectInfoVO;
+import org.springblade.modules.baseinfo.project.wrapper.ProjectInfoWrapper;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.service.IUserService;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.LinkedList;
+import java.util.List;
+
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@RestController
+@RequestMapping("galaxy-business/project/base")
+@AllArgsConstructor
+@Api(value = "项目信息基础管理", tags = "项目信息基础管理")
+public class ProjectBaseInfoController extends BladeController {
+	private final IProjectBaseInfoService projectBaseInfoService;
+	private final IProjectWarningSettingService warningSettingService;
+	private final IDeptService deptService;
+	private final IUserService userService;
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<ProjectInfoVO>> list(Query query) {
+		IPage<ProjectInfoEntity> pages = projectBaseInfoService.page(Condition.getPage(query));
+		return R.data(ProjectInfoWrapper.build().pageVO(pages));
+	}
+
+	@GetMapping("/org/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<List<ProjectInfoVO>> orglist() {
+		LambdaQueryWrapper<ProjectInfoEntity> wrapper = Wrappers.<ProjectInfoEntity>query().lambda();
+		BladeUser user = AuthUtil.getUser();
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+
+		} else if (BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+			wrapper.eq(ProjectInfoEntity::getOrgId, user.getDeptId());
+		}
+		wrapper.eq(ProjectInfoEntity::getIsDeleted, 0);
+		List<ProjectInfoEntity> pages = projectBaseInfoService.list(wrapper);
+		return R.data(ProjectInfoWrapper.build().listVO(pages));
+	}
+
+	/**
+	 * 多表联合查询自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "projectName", value = "项目名称", paramType = "query", dataType = "string"),
+
+	})
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页")
+	public R<IPage<ProjectInfoVO>> page(@ApiIgnore  ProjectInfoEntity entity, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+
+		} else if (BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+			entity.setOrgId(Func.toLong(user.getDeptId()));
+		}
+		IPage<ProjectInfoVO> pages = projectBaseInfoService.selectPage(entity, Condition.getPage(query));
+		return R.data(pages);
+	}
+
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入projectInfoEntity")
+	public R<ProjectInfoVO> detail(ProjectInfoEntity projectInfoEntity) {
+		ProjectInfoEntity detail = projectBaseInfoService.getOne(Condition.getQueryWrapper(projectInfoEntity));
+		return R.data(ProjectInfoWrapper.build().entityVO(detail));
+	}
+
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入ProjectInfoEntity")
+	public R save(@RequestBody ProjectInfoEntity projectInfoEntity) {
+		return R.status(projectBaseInfoService.save(projectInfoEntity));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入ProjectInfoEntity")
+	public R update(@RequestBody ProjectInfoEntity projectInfoEntity) {
+		return R.status(projectBaseInfoService.updateById(projectInfoEntity));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入projectInfoEntity")
+	public R submit(@RequestBody ProjectInfoEntity projectInfoEntity) {
+		return R.status(projectBaseInfoService.saveOrUpdate(projectInfoEntity));
+	}
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入projectInfoEntity")
+	public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+		boolean temp = projectBaseInfoService.deleteLogic(Func.toLongList(ids));
+		return R.status(temp);
+	}
+
+	/**
+	 * 项目预警配置保存或修改
+	 *
+	 * @param projectInfoEntity
+	 * @return
+	 */
+	@PostMapping("/setting/warning/submit")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "id", value = "项目ID", paramType = "query", dataType = "long"),
+		@ApiImplicitParam(name = "warnActive", value = "预警开关", paramType = "query", dataType = "int"),
+		@ApiImplicitParam(name = "delayTime", value = "延时", paramType = "query", dataType = "int")
+	})
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "项目预警配置新增或修改", notes = "传入warningSettingEntity")
+	public R warningSubmit(@ApiIgnore ProjectInfoEntity projectInfoEntity) {
+		//return R.status(warningSettingService.saveOrUpdate(warningSettingEntity));
+
+		LambdaUpdateWrapper<ProjectInfoEntity> wrapper = Wrappers.<ProjectInfoEntity>update().lambda();
+		wrapper.set(ProjectInfoEntity::getWarnActive, projectInfoEntity.getWarnActive());
+		wrapper.set(ProjectInfoEntity::getDelayTime, projectInfoEntity.getDelayTime());
+		wrapper.eq(ProjectInfoEntity::getId, projectInfoEntity.getId());
+
+		this.projectBaseInfoService.update(wrapper);
+
+		return R.success("预警设置操作成功");
+	}
+
+	@GetMapping("/tree")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情")
+	public R<List<ProjectTreeNodeEntity>> projectTree() {
+		BladeUser user = AuthUtil.getUser();
+		List<ProjectTreeNodeEntity> tree = new LinkedList<>();
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
+			wrapper.eq(Dept::getParentId, 0);
+			Dept dept = this.deptService.getOne(wrapper);
+			ProjectTreeNodeEntity root = new ProjectTreeNodeEntity();
+			root.setText(dept.getDeptName());
+			root.setValue("" + dept.getId() + "-0");
+			root.setOrgId(dept.getId());
+
+			List<ProjectTreeNodeEntity> orgNode = new LinkedList<>();
+			root.setChildren(orgNode);
+			tree.add(root);
+			List<Dept> childs = this.deptService.getDeptChild(dept.getId());
+			if (null != childs && childs.size() > 0) {
+				for (Dept child : childs) {
+					ProjectTreeNodeEntity entity = new ProjectTreeNodeEntity();
+					entity.setText(child.getDeptName());
+					entity.setValue("" + child.getId() + "-0");
+					entity.setOrgId(child.getId());
+
+					List<ProjectTreeNodeEntity> projectNode = new LinkedList<>();
+					entity.setChildren(projectNode);
+					orgNode.add(entity);
+					LambdaQueryWrapper<ProjectInfoEntity> projectwrapper = Wrappers.<ProjectInfoEntity>query().lambda();
+					projectwrapper.eq(ProjectInfoEntity::getOrgId, child.getId());
+
+					List<ProjectInfoEntity> projectInfoEntities = this.projectBaseInfoService.list(projectwrapper);
+					for (ProjectInfoEntity p : projectInfoEntities) {
+						entity = new ProjectTreeNodeEntity();
+						entity.setText(p.getProjectName());
+						entity.setValue("" + child.getId() + "-" + p.getId());
+						entity.setOrgId(child.getId());
+						entity.setProjectId(p.getId());
+						projectNode.add(entity);
+					}
+				}
+			}
+
+		} else if (BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+
+			ProjectTreeNodeEntity root = new ProjectTreeNodeEntity();
+			root.setText("北京大恒");
+			root.setValue("0");
+			List<ProjectTreeNodeEntity> projectNode = new LinkedList<>();
+			root.setChildren(projectNode);
+			tree.add(root);
+
+			ProjectTreeNodeEntity entity = new ProjectTreeNodeEntity();
+			entity.setText("赤峰市");
+			entity.setValue("1");
+			projectNode.add(entity);
+
+			entity = new ProjectTreeNodeEntity();
+			entity.setText("锡盟");
+			entity.setValue("2");
+			projectNode.add(entity);
+
+		}
+
+		return R.data(tree);
+	}
+
+}

+ 111 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/entity/ProjectInfoEntity.java

@@ -0,0 +1,111 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.project.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 org.springframework.format.annotation.DateTimeFormat;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("project_info")
+public class ProjectInfoEntity extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 租户ID
+	 */
+	@ApiModelProperty("租户ID")
+	private String tenantId;
+
+
+	/**
+	 * 项目名称
+	 */
+	@ApiModelProperty(value = "项目名称")
+	private String projectName;
+
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty(value = "机构ID")
+	private Long orgId;
+
+	/**
+	 * 项目负责人
+	 */
+	@ApiModelProperty(value = "项目负责人")
+	private String manageName;
+
+	/**
+	 * 联系电话
+	 */
+	@ApiModelProperty(value = "联系电话")
+	private String contactPhone;
+
+	/**
+	 * 邮箱
+	 */
+	@ApiModelProperty(value = "邮箱")
+	private String mail;
+
+	/**
+	 * 规约ID
+	 */
+	@ApiModelProperty(value = "规约ID")
+	private Long agreementId;
+
+	/**
+	 * 供电方式ID
+	 */
+	@ApiModelProperty(value = "供电方式ID")
+	private Long powerTypeId;
+
+
+	/**
+	 * 备注说明
+	 */
+	@ApiModelProperty(value = "备注说明")
+	private String remark;
+
+	/**
+	 * 测站导入时间
+	 */
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss",
+		timezone = "GMT+8"
+	)
+	@ApiModelProperty(value = "测站导入时间")
+	private String importTime;
+
+	/**
+	 * 预警开关
+	 */
+	@ApiModelProperty(value = "预警开关")
+	private Integer warnActive;
+
+	/**
+	 * 延时时长
+	 */
+	@ApiModelProperty(value = "延时时长")
+	private Integer delayTime;
+}

+ 65 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/entity/ProjectTreeNodeEntity.java

@@ -0,0 +1,65 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/28
+ */
+package org.springblade.modules.baseinfo.project.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.util.List;
+
+/***
+ * Date:2022/8/28
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProjectTreeNodeEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 租户ID
+	 */
+	@ApiModelProperty("租户ID")
+	private String tenantId;
+	/**
+	 * 标题
+	 */
+	@ApiModelProperty("标题")
+	private String text;
+
+	/**
+	 * 值
+	 */
+	@ApiModelProperty("值")
+	private String value;
+
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty("机构ID")
+	private Long orgId;
+
+
+	/**
+	 * 项目ID
+	 */
+	@ApiModelProperty("项目ID")
+	private Long projectId;
+
+
+	/**
+	 * 子列表
+	 */
+	@ApiModelProperty("子列表")
+	private List<ProjectTreeNodeEntity> children;
+}

+ 51 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/entity/ProjectWarningSettingEntity.java

@@ -0,0 +1,51 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/23
+ */
+package org.springblade.modules.baseinfo.project.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;
+
+/***
+ * Date:2022/8/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("project_warning_setting")
+public class ProjectWarningSettingEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 租户ID
+	 */
+	@ApiModelProperty("租户ID")
+	private String tenantId;
+
+	/**
+	 * 项目ID
+	 */
+	@ApiModelProperty("项目ID")
+	private long projectId;
+
+	/**
+	 * 预警开关
+	 */
+	@ApiModelProperty("预警开关")
+	private int warningActive;
+
+	/**
+	 * 报文充许延时时长,单位分钟
+	 */
+	@ApiModelProperty("报文充许延时时长")
+	private int datagramDelayTime;
+}

+ 34 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/mapper/ProjectInfoMapper.java

@@ -0,0 +1,34 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.project.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.baseinfo.project.entity.ProjectInfoEntity;
+import org.springblade.modules.baseinfo.project.vo.ProjectInfoVO;
+
+
+import java.util.List;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface ProjectInfoMapper extends BaseMapper<ProjectInfoEntity> {
+	/**
+	 * 自定义分页
+	 *
+	 * @param page   分页
+	 * @return List<RtuInfoVO>
+	 */
+	List<ProjectInfoVO> selectPage(@Param("projectInfoEntity") ProjectInfoEntity projectInfoEntity, IPage page);
+}

+ 55 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/mapper/ProjectInfoMapper.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.baseinfo.project.mapper.ProjectInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="projectInfoResultMap" type="org.springblade.modules.baseinfo.project.entity.ProjectInfoEntity">
+        <result column="project_name" property="projectName"/>
+        <result column="org_id" property="orgId"/>
+        <result column="manage_name" property="manageName"/>
+        <result column="contact_phone" property="contactPhone"/>
+        <result column="mail" property="mail"/>
+        <result column="agreement_id" property="agreementId"/>
+        <result column="power_type_id" property="powerTypeId"/>
+        <result column="remark" property="remark"/>
+        <result column="import_time" property="importTime"/>
+        <result column="warn_active" property="warnActive"/>
+        <result column="delay_time" property="delayTime"/>
+    </resultMap>
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="projectInfoVOResultMap" type="org.springblade.modules.baseinfo.project.vo.ProjectInfoVO">
+
+        <result column="project_name" property="projectName"/>
+        <result column="org_id" property="orgId"/>
+        <result column="dept_name" property="orgName"/>
+        <result column="manage_name" property="manageName"/>
+        <result column="contact_phone" property="contactPhone"/>
+        <result column="mail" property="mail"/>
+        <result column="agreement_id" property="agreementId"/>
+        <result column="power_type_id" property="powerTypeId"/>
+        <result column="remark" property="remark"/>
+        <result column="import_time" property="importTime"/>
+        <result column="warn_active" property="warnActive"/>
+        <result column="delay_time" property="delayTime"/>
+    </resultMap>
+
+
+    <select id="selectPage" resultMap="projectInfoVOResultMap">
+        SELECT
+        n.*
+        ,d.dept_name
+        FROM
+        project_info n
+        LEFT JOIN blade_dept d ON d.id = n.org_id
+        WHERE
+        n.is_deleted = 0
+        <if test="projectInfoEntity.projectName!=null">
+            and n.project_name like concat(concat('%', #{projectInfoEntity.projectName}), '%')
+        </if>
+        <if test="projectInfoEntity.orgId!=null">
+            and n.org_id = #{projectInfoEntity.orgId}
+        </if>
+
+    </select>
+</mapper>

+ 22 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/mapper/ProjectWarningSettingMapper.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/23
+ */
+package org.springblade.modules.baseinfo.project.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.modules.baseinfo.project.entity.ProjectWarningSettingEntity;
+
+/***
+ * Date:2022/8/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface ProjectWarningSettingMapper extends BaseMapper<ProjectWarningSettingEntity> {
+}

+ 15 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/mapper/ProjectWarningSettingMapper.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.baseinfo.project.mapper.ProjectWarningSettingMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="projectInfoResultMap" type="org.springblade.modules.baseinfo.project.entity.ProjectWarningSettingEntity">
+
+        <result column="project_id" property="projectId"/>
+        <result column="warning_active" property="warningActive"/>
+        <result column="datagram_delay_time" property="datagramDelayTime"/>
+
+    </resultMap>
+
+
+</mapper>

+ 48 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/service/IProjectBaseInfoService.java

@@ -0,0 +1,48 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.project.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.project.entity.ProjectInfoEntity;
+import org.springblade.modules.baseinfo.project.entity.ProjectWarningSettingEntity;
+import org.springblade.modules.baseinfo.project.vo.ProjectInfoVO;
+
+import java.util.Date;
+
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IProjectBaseInfoService extends BaseService<ProjectInfoEntity> {
+	/**
+	 * 自定义分页
+	 * @param page
+	 * @return
+	 */
+	IPage<ProjectInfoVO> selectPage(ProjectInfoEntity entity, IPage<ProjectInfoVO> page);
+
+	/**
+	 * 项目预警配置
+	 * @param warningSettingEntity
+	 * @return
+	 */
+	boolean  warningSaveOrUpdate(ProjectWarningSettingEntity warningSettingEntity);
+
+	/**
+	 * 更新测站导入时间
+	 * @param date
+	 * @return
+	 */
+	boolean  updateImportTime(Long projectId, Date date);
+
+}

+ 22 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/service/IProjectWarningSettingService.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/23
+ */
+package org.springblade.modules.baseinfo.project.service;
+
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.baseinfo.project.entity.ProjectWarningSettingEntity;
+
+/***
+ * Date:2022/8/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IProjectWarningSettingService extends BaseService<ProjectWarningSettingEntity> {
+}

+ 50 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/service/impl/ProjectBaseInfoServiceImpl.java

@@ -0,0 +1,50 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.project.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.baseinfo.project.entity.ProjectInfoEntity;
+import org.springblade.modules.baseinfo.project.entity.ProjectWarningSettingEntity;
+import org.springblade.modules.baseinfo.project.mapper.ProjectInfoMapper;
+import org.springblade.modules.baseinfo.project.service.IProjectBaseInfoService;
+import org.springblade.modules.baseinfo.project.vo.ProjectInfoVO;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class ProjectBaseInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, ProjectInfoEntity> implements IProjectBaseInfoService {
+	@Override
+	public IPage<ProjectInfoVO> selectPage(ProjectInfoEntity entity, IPage<ProjectInfoVO> page) {
+		return page.setRecords(baseMapper.selectPage(entity,page));
+	}
+
+	@Override
+	public boolean warningSaveOrUpdate(ProjectWarningSettingEntity warningSettingEntity) {
+
+		return false;
+	}
+
+	@Override
+	public boolean updateImportTime(Long projectId,Date date) {
+		LambdaUpdateWrapper<ProjectInfoEntity> wrapper = Wrappers.<ProjectInfoEntity>update().lambda();
+		wrapper.set(ProjectInfoEntity::getImportTime,date);
+		wrapper.eq(ProjectInfoEntity::getId,projectId);
+		return this.update(wrapper);
+	}
+}

+ 25 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/service/impl/ProjectWarningSettingServiceImpl.java

@@ -0,0 +1,25 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/23
+ */
+package org.springblade.modules.baseinfo.project.service.impl;
+
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.baseinfo.project.entity.ProjectWarningSettingEntity;
+import org.springblade.modules.baseinfo.project.mapper.ProjectWarningSettingMapper;
+import org.springblade.modules.baseinfo.project.service.IProjectWarningSettingService;
+import org.springframework.stereotype.Service;
+
+/***
+ * Date:2022/8/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class ProjectWarningSettingServiceImpl extends BaseServiceImpl<ProjectWarningSettingMapper, ProjectWarningSettingEntity> implements IProjectWarningSettingService {
+}

+ 45 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/vo/ProjectInfoVO.java

@@ -0,0 +1,45 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.project.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.baseinfo.project.entity.ProjectInfoEntity;
+
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProjectInfoVO extends ProjectInfoEntity {
+
+	/**
+	 * 机构名称
+	 */
+	@ApiModelProperty(value = "机构名称")
+	private String orgName;
+
+
+	/**
+	 * 规约名称
+	 */
+	@ApiModelProperty(value = "规约名称")
+	private String agreementName;
+
+	/**
+	 * 供电方式名称
+	 */
+	@ApiModelProperty(value = "供电方式名称")
+	private String powerTypeName;
+}

+ 62 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/project/wrapper/ProjectInfoWrapper.java

@@ -0,0 +1,62 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.project.wrapper;
+
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.modules.baseinfo.project.entity.ProjectInfoEntity;
+import org.springblade.modules.baseinfo.project.vo.ProjectInfoVO;
+import org.springblade.modules.system.entity.DictBiz;
+import org.springblade.modules.system.service.IDictBizService;
+
+import java.util.Objects;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public class ProjectInfoWrapper extends BaseEntityWrapper<ProjectInfoEntity, ProjectInfoVO> {
+	public static ProjectInfoWrapper build() {
+		return new ProjectInfoWrapper();
+	}
+
+	private static IDictBizService dictBizService;
+
+	private static IDictBizService getDictBizService() {
+		if (dictBizService == null) {
+			dictBizService = SpringUtil.getBean(IDictBizService.class);
+		}
+		return dictBizService;
+	}
+
+	@Override
+	public ProjectInfoVO entityVO(ProjectInfoEntity entity) {
+
+		ProjectInfoVO projectInfoVO = Objects.requireNonNull(BeanUtil.copy(entity, ProjectInfoVO.class));
+		if (entity.getAgreementId() != null){
+			DictBiz biz = getDictBizService().getById(entity.getAgreementId());
+			if (null != biz){
+				projectInfoVO.setAgreementName(biz.getDictValue());
+			}
+		}
+		if (entity.getPowerTypeId() != null){
+			DictBiz biz = getDictBizService().getById(entity.getPowerTypeId());
+			if (null != biz){
+				projectInfoVO.setPowerTypeName(biz.getDictValue());
+			}
+		}
+
+
+		return projectInfoVO;
+	}
+}

+ 550 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/controller/BaseInfoRegionController.java

@@ -0,0 +1,550 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.region.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.mysql.cj.log.Log;
+import io.swagger.annotations.*;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.constant.BusinessConstant;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
+import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
+import org.springblade.modules.baseinfo.region.dto.RegionInfoDTO;
+import org.springblade.modules.baseinfo.region.entity.RegionInfoEntity;
+import org.springblade.modules.baseinfo.region.entity.RegionTreeNodeEntity;
+import org.springblade.modules.baseinfo.region.service.IBaseInfoRegionService;
+import org.springblade.modules.baseinfo.region.service.IOrgRegionInfoService;
+import org.springblade.modules.baseinfo.region.vo.RegionInfoVO;
+import org.springblade.modules.baseinfo.region.wrapper.RegionInfoWrapper;
+import org.springblade.modules.etl.entity.EtlAdCdEntity;
+import org.springblade.modules.etl.service.IEtlAdCdService;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.service.IDeptService;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.LinkedList;
+import java.util.List;
+
+
+/***
+ * Date:2022/8/22
+ * Title:行政区划管理
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@RestController
+@Slf4j
+@RequestMapping("galaxy-business/baseinfo/region")
+@RequiredArgsConstructor
+@Api(value = "行政区划管理", tags = "行政区划管理")
+public class BaseInfoRegionController extends BladeController {
+	private final IBaseInfoRegionService baseInfoRegionService;
+	private final IDeptService deptService;
+	private final IEtlAdCdService etlAdCdService;
+	private final IDeptRegionService deptRegionService;
+
+	@Value("${region-ver-config.ver}")
+	private String regionVer;
+
+	@Value("${region-ver-config.original-ver}")
+	private String originalRgionVer;
+
+	@Resource
+	private RedisTemplate redisTemplate;
+
+	/**
+	 * 排除行政区划
+	 *
+	 * @param dto
+	 * @return
+	 */
+	@PostMapping("/exclude")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "修改", notes = "传入 RegionInfoDTO")
+	public R excludeRegion(@RequestBody RegionInfoDTO dto) {
+		this.baseInfoRegionService.excludeRegion(dto);
+		this.baseInfoRegionService.updateAdminRegionCache();
+		this.baseInfoRegionService.updateDeptRegionCache(dto.getDeptId());
+		return R.status(true);
+	}
+
+	/**
+	 * 重置行政区划
+	 *
+	 * @param dto
+	 * @return
+	 */
+	@PostMapping("/reset")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "修改", notes = "传入 RegionInfoDTO")
+	public R resetRegion(@RequestBody RegionInfoDTO dto) {
+		this.baseInfoRegionService.resetRegion(dto);
+		this.baseInfoRegionService.updateAdminRegionCache();
+		this.baseInfoRegionService.updateDeptRegionCache(dto.getDeptId());
+		return R.status(true);
+	}
+
+
+	@GetMapping("/children/list")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "分页")
+	public R<List<RegionInfoEntity>> childrenList() {
+		BladeUser user = AuthUtil.getUser();
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			LambdaQueryWrapper<RegionInfoEntity> wrapper = Wrappers.<RegionInfoEntity>query().lambda();
+			wrapper.eq(RegionInfoEntity::getIsDeleted, 0);
+			wrapper.eq(RegionInfoEntity::getParentCode, BusinessConstant.REGION_NM_ADCODE);
+			List<RegionInfoEntity> list = baseInfoRegionService.list(wrapper);
+			return R.data(list);
+		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName())) {
+			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+			LambdaQueryWrapper<RegionInfoEntity> regionInfoEntityLambdaQueryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+			regionInfoEntityLambdaQueryWrapper.eq(RegionInfoEntity::getIsDeleted, 0);
+			regionInfoEntityLambdaQueryWrapper.eq(RegionInfoEntity::getParentCode, deptRegionEntity.getAdcd());
+			List<RegionInfoEntity> list = baseInfoRegionService.list(regionInfoEntityLambdaQueryWrapper);
+			return R.data(list);
+		}
+		return R.data(null);
+	}
+
+	@GetMapping("/children/list/{parentCode}")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "分页")
+	public R<List<RegionInfoEntity>> childrenList(@PathVariable(name = "parentCode") String parentCode) {
+		LambdaQueryWrapper<RegionInfoEntity> wrapper = Wrappers.<RegionInfoEntity>query().lambda();
+		wrapper.eq(RegionInfoEntity::getIsDeleted, 0);
+		wrapper.eq(RegionInfoEntity::getParentCode, parentCode);
+		List<RegionInfoEntity> list = baseInfoRegionService.list(wrapper);
+		return R.data(list);
+	}
+
+	@GetMapping("/original/tree")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "树")
+	public R<List<RegionTreeNodeEntity>> regionTree() {
+		ValueOperations<String, String> opsHash = redisTemplate.opsForValue();
+		List<RegionTreeNodeEntity> nodeEntities = new LinkedList<>();
+		BladeUser user = AuthUtil.getUser();
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			boolean updateRegion = false;
+			String redisRegionVer = opsHash.get("region.original.ver.admin");
+			if (null == redisRegionVer || redisRegionVer.length() == 0 || !redisRegionVer.equals(this.originalRgionVer)) {
+				updateRegion = true;
+			} else {
+				String regionJson = opsHash.get("region.original.admin");
+				if (null != regionJson) {
+					nodeEntities = JSON.parseObject(regionJson, new TypeReference<List<RegionTreeNodeEntity>>() {
+					});
+				} else {
+					updateRegion = true;
+				}
+			}
+			if (updateRegion) {
+				LambdaQueryWrapper<RegionInfoEntity> queryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+				queryWrapper.eq(RegionInfoEntity::getParentCode, BusinessConstant.REGION_ROOT_ADCODE);
+				List<RegionInfoEntity> list = baseInfoRegionService.list(queryWrapper);
+				for (RegionInfoEntity entity : list) {
+					RegionTreeNodeEntity nodeEntity = new RegionTreeNodeEntity();
+					nodeEntity.setId(entity.getAdcd());
+					nodeEntity.setValue(entity.getAdcd());
+					nodeEntity.setTitle(entity.getAdnm());
+					nodeEntity.setText(entity.getAdnm());
+					nodeEntity.setKey(entity.getAdcd());
+					nodeEntity.setParentId(entity.getParentCode());
+					if (getOriginalTreeChildren(nodeEntity, entity)) {
+						if (nodeEntity.getChildren() != null && nodeEntity.getChildren().size() > 0) {
+							nodeEntity.setHasChildren(true);
+						} else {
+							nodeEntity.setHasChildren(false);
+						}
+					}
+					nodeEntities.add(nodeEntity);
+				}
+				opsHash.set("region.original.admin", JSON.toJSONString(nodeEntities));
+				opsHash.set("region.original.ver.admin", this.originalRgionVer);
+			}
+		} else {
+			boolean updateRegion = false;
+			String redisRegionVer = opsHash.get("region.original.ver." + user.getDeptId());
+			if (null == redisRegionVer || redisRegionVer.length() == 0 || !redisRegionVer.equals(this.originalRgionVer)) {
+				updateRegion = true;
+			} else {
+				String regionJson = opsHash.get("region.original." + user.getDeptId());
+				if (null != regionJson) {
+					nodeEntities = JSON.parseObject(regionJson, new TypeReference<List<RegionTreeNodeEntity>>() {
+					});
+				} else {
+					updateRegion = true;
+				}
+			}
+			if (updateRegion) {
+				LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+				DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+				LambdaQueryWrapper<RegionInfoEntity> queryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+				queryWrapper.eq(RegionInfoEntity::getAdcd, deptRegionEntity.getAdcd());
+				List<RegionInfoEntity> list = baseInfoRegionService.list(queryWrapper);
+				for (RegionInfoEntity entity : list) {
+					RegionTreeNodeEntity nodeEntity = new RegionTreeNodeEntity();
+					nodeEntity.setId(entity.getAdcd());
+					nodeEntity.setValue(entity.getAdcd());
+					nodeEntity.setTitle(entity.getAdnm());
+					nodeEntity.setText(entity.getAdnm());
+					nodeEntity.setKey(entity.getAdcd());
+					nodeEntity.setParentId(entity.getParentCode());
+					if (getOriginalTreeChildren(nodeEntity, entity)) {
+						if (nodeEntity.getChildren() != null && nodeEntity.getChildren().size() > 0) {
+							nodeEntity.setHasChildren(true);
+						} else {
+							nodeEntity.setHasChildren(false);
+						}
+					}
+					nodeEntities.add(nodeEntity);
+				}
+				opsHash.set("region.original." + user.getDeptId(), JSON.toJSONString(nodeEntities));
+				opsHash.set("region.original.ver." + user.getDeptId(), this.originalRgionVer);
+			}
+		}
+		return R.data(nodeEntities);
+	}
+
+
+	@GetMapping("/original/tree/{adcd}")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "树")
+	public R<List<RegionTreeNodeEntity>> regionTree(@PathVariable(name = "adcd") String adcd) {
+		List<RegionTreeNodeEntity> nodeEntities = new LinkedList<>();
+		LambdaQueryWrapper<RegionInfoEntity> queryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+		queryWrapper.eq(RegionInfoEntity::getAdcd, adcd);
+		List<RegionInfoEntity> list = baseInfoRegionService.list(queryWrapper);
+		for (RegionInfoEntity entity : list) {
+			RegionTreeNodeEntity nodeEntity = new RegionTreeNodeEntity();
+			nodeEntity.setId(entity.getAdcd());
+			nodeEntity.setValue(entity.getAdcd());
+			nodeEntity.setTitle(entity.getAdnm());
+			nodeEntity.setText(entity.getAdnm());
+			nodeEntity.setKey(entity.getAdcd());
+			nodeEntity.setParentId(entity.getParentCode());
+			if (getOriginalTreeChildren(nodeEntity, entity)) {
+				if (nodeEntity.getChildren() != null && nodeEntity.getChildren().size() > 0) {
+					nodeEntity.setHasChildren(true);
+				} else {
+					nodeEntity.setHasChildren(false);
+				}
+			}
+			nodeEntities.add(nodeEntity);
+		}
+		return R.data(nodeEntities);
+	}
+
+	private boolean getOriginalTreeChildren(RegionTreeNodeEntity nodeEntity, RegionInfoEntity regionInfoEntity) {
+		LambdaQueryWrapper<RegionInfoEntity> queryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+		queryWrapper.eq(RegionInfoEntity::getParentCode, regionInfoEntity.getAdcd());
+		List<RegionInfoEntity> list = baseInfoRegionService.list(queryWrapper);
+		if (null != list && list.size() > 0) {
+			List<RegionTreeNodeEntity> nodeEntities = new LinkedList<>();
+			for (RegionInfoEntity entity : list) {
+				RegionTreeNodeEntity node = new RegionTreeNodeEntity();
+				node.setId(entity.getAdcd());
+				node.setValue(entity.getAdcd());
+				node.setTitle(entity.getAdnm());
+				node.setText(entity.getAdnm());
+				node.setKey(entity.getAdcd());
+				node.setParentId(entity.getParentCode());
+				if (getOriginalTreeChildren(node, entity)) {
+					if (node.getChildren() != null && node.getChildren().size() > 0) {
+						node.setHasChildren(true);
+					} else {
+						node.setHasChildren(false);
+					}
+				}
+				nodeEntities.add(node);
+			}
+			nodeEntity.setChildren(nodeEntities);
+		}
+		return true;
+	}
+
+	@GetMapping("/tree")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "树")
+	public R<List<RegionTreeNodeEntity>> virtuallyRegionTree() {
+		ValueOperations<String, String> opsHash = redisTemplate.opsForValue();
+		List<RegionTreeNodeEntity> nodeEntities = new LinkedList<>();
+		BladeUser user = AuthUtil.getUser();
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			String redisRegionVer = opsHash.get("region.ver.admin");
+			boolean updateRegion = false;
+			if (null == redisRegionVer || redisRegionVer.length() == 0 || !redisRegionVer.equals(this.regionVer)) {
+				updateRegion = true;
+			} else {
+				String regionJson = opsHash.get("region.admin");
+				if (null != regionJson) {
+					nodeEntities = JSON.parseObject(regionJson, new TypeReference<List<RegionTreeNodeEntity>>() {
+					});
+				} else {
+					updateRegion = true;
+				}
+			}
+			if (updateRegion) {
+				//根节点
+				LambdaQueryWrapper<RegionInfoEntity> queryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+				queryWrapper.eq(RegionInfoEntity::getAdcd, BusinessConstant.REGION_NM_ADCODE);
+				RegionInfoEntity nmRegion = baseInfoRegionService.getOne(queryWrapper);
+				RegionTreeNodeEntity nmEntity = new RegionTreeNodeEntity();
+				nmEntity.setId(nmRegion.getAdcd());
+				nmEntity.setValue(nmRegion.getAdcd());
+				nmEntity.setTitle(nmRegion.getAdnm());
+				nmEntity.setText(nmRegion.getAdnm());
+				nmEntity.setKey(nmRegion.getAdcd());
+				nmEntity.setExclude(0);
+				nmEntity.setParentId(nmRegion.getParentCode());
+				//查找子节点
+				LambdaQueryWrapper<Dept> deptqueryWrapper = Wrappers.<Dept>query().lambda();
+				deptqueryWrapper.eq(Dept::getParentId, Func.toLong(user.getDeptId()));
+				List<Dept> deptList = deptService.list(deptqueryWrapper);
+				if (null != deptList) {
+					List<RegionTreeNodeEntity> subNodeEntities = new LinkedList<>();
+					for (Dept dept : deptList) {
+						LambdaQueryWrapper<DeptRegionEntity> deptRegionQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+						deptRegionQueryWrapper.eq(DeptRegionEntity::getDeptId, dept.getId());
+						DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionQueryWrapper);
+						if (null != deptRegionEntity) {
+							LambdaQueryWrapper<RegionInfoEntity> nodeQueryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+							nodeQueryWrapper.eq(RegionInfoEntity::getAdcd, deptRegionEntity.getAdcd());
+							RegionInfoEntity nodeRegion = baseInfoRegionService.getOne(nodeQueryWrapper);
+							if (null != nodeRegion) {
+								RegionTreeNodeEntity node = new RegionTreeNodeEntity();
+								node.setId(nodeRegion.getAdcd());
+								node.setValue(nodeRegion.getAdcd());
+								node.setTitle(nodeRegion.getAdnm());
+								node.setText(nodeRegion.getAdnm());
+								node.setKey(nodeRegion.getAdcd());
+								int excludeCode = 0;
+								if (nodeRegion.getParentCode().equals(BusinessConstant.REGION_NM_ADCODE)) {
+									excludeCode = 1;
+								}
+								node.setExclude(excludeCode);
+								node.setParentId(nodeRegion.getParentCode());
+								if (getChildren(node, nodeRegion, excludeCode)) {
+									if (node.getChildren() != null && node.getChildren().size() > 0) {
+										node.setHasChildren(true);
+									} else {
+										node.setHasChildren(false);
+									}
+								}
+								subNodeEntities.add(node);
+							}
+						}
+					}
+					nmEntity.setChildren(subNodeEntities);
+				}
+				if (nmEntity.getChildren() != null && nmEntity.getChildren().size() > 0) {
+					nmEntity.setHasChildren(true);
+				} else {
+					nmEntity.setHasChildren(false);
+				}
+				nodeEntities.add(nmEntity);
+				//更新缓存
+				opsHash.set("region.admin", JSON.toJSONString(nodeEntities));
+				opsHash.set("region.ver.admin", this.regionVer);
+			}
+		} else {
+			String redisRegionVer = opsHash.get("region.ver." + user.getDeptId());
+			boolean updateRegion = false;
+			if (null == redisRegionVer || redisRegionVer.length() == 0 || !redisRegionVer.equals(this.regionVer)) {
+				updateRegion = true;
+			} else {
+				String regionJson = opsHash.get("region." + user.getDeptId());
+				if (null != regionJson) {
+					nodeEntities = JSON.parseObject(regionJson, new TypeReference<List<RegionTreeNodeEntity>>() {
+					});
+				} else {
+					updateRegion = true;
+				}
+			}
+			if (updateRegion) {
+				//根节点
+				LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+				DeptRegionEntity rootDeptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+				if (null != rootDeptRegionEntity) {
+					LambdaQueryWrapper<RegionInfoEntity> queryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+					queryWrapper.eq(RegionInfoEntity::getAdcd, rootDeptRegionEntity.getAdcd());
+					RegionInfoEntity orgRegion = baseInfoRegionService.getOne(queryWrapper);
+					int excludeCode = 0;
+					if (orgRegion.getParentCode().equals(BusinessConstant.REGION_NM_ADCODE)) {
+						excludeCode = 1;
+					}
+					RegionTreeNodeEntity orgEntity = new RegionTreeNodeEntity();
+					orgEntity.setId(orgRegion.getAdcd());
+					orgEntity.setValue(orgRegion.getAdcd());
+					orgEntity.setTitle(orgRegion.getAdnm());
+					orgEntity.setText(orgRegion.getAdnm());
+					orgEntity.setKey(orgRegion.getAdcd());
+					orgEntity.setExclude(excludeCode);
+					orgEntity.setParentId(orgRegion.getParentCode());
+					//查找子节点
+					if (getChildren(orgEntity, orgRegion, excludeCode)) {
+						if (orgEntity.getChildren() != null && orgEntity.getChildren().size() > 0) {
+							orgEntity.setHasChildren(true);
+						} else {
+							orgEntity.setHasChildren(false);
+						}
+					}
+					nodeEntities.add(orgEntity);
+					opsHash.set("region." + user.getDeptId(), JSON.toJSONString(nodeEntities));
+					opsHash.set("region.ver." + user.getDeptId(), this.regionVer);
+				}
+			}
+		}
+		return R.data(nodeEntities);
+	}
+
+	private boolean getChildren(RegionTreeNodeEntity nodeEntity, RegionInfoEntity regionInfoEntity, int exclude) {
+		LambdaQueryWrapper<RegionInfoEntity> queryWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+		queryWrapper.eq(RegionInfoEntity::getParentCode, regionInfoEntity.getAdcd());
+		if (exclude == 1) {
+			queryWrapper.eq(RegionInfoEntity::getExcludeAd, 0);
+		}
+		List<RegionInfoEntity> list = baseInfoRegionService.list(queryWrapper);
+		if (null != list && list.size() > 0) {
+			List<RegionTreeNodeEntity> nodeEntities = new LinkedList<>();
+			for (RegionInfoEntity entity : list) {
+				RegionTreeNodeEntity node = new RegionTreeNodeEntity();
+				node.setId(entity.getAdcd());
+				node.setValue(entity.getAdcd());
+				node.setTitle(entity.getAdnm());
+				node.setText(entity.getAdnm());
+				node.setKey(entity.getAdcd());
+				node.setExclude(exclude);
+				node.setParentId(entity.getParentCode());
+				if (getChildren(node, entity, exclude)) {
+					if (node.getChildren() != null && node.getChildren().size() > 0) {
+						node.setHasChildren(true);
+					} else {
+						node.setHasChildren(false);
+					}
+				}
+				nodeEntities.add(node);
+			}
+			nodeEntity.setChildren(nodeEntities);
+		}
+		return true;
+	}
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入RegionInfoEntity")
+	public R<RegionInfoVO> detail(RegionInfoDTO regionInfoDTO) {
+		regionInfoDTO.setAdcd(regionInfoDTO.getCode());
+		regionInfoDTO.setIsDeleted(0);
+		RegionInfoEntity detail = baseInfoRegionService.getOne(Condition.getQueryWrapper(regionInfoDTO));
+		return R.data(RegionInfoWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 从宏图数据导入
+	 */
+	@PostMapping("/import")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "regionLevel", value = "行政区划层级", paramType = "query", dataType = "int"),
+		@ApiImplicitParam(name = "isCovered", value = "是否覆盖", paramType = "query", dataType = "int"),
+	})
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "导入", notes = "传入RegionInfoDTO")
+	public R importSubmit(@RequestBody RegionInfoDTO regionInfoDTO) {
+		if (regionInfoDTO.getIsCovered() == 1) {
+			LambdaUpdateWrapper<RegionInfoEntity> updateWrapper = Wrappers.<RegionInfoEntity>update().lambda();
+			updateWrapper.ne(RegionInfoEntity::getAdcd, "00");
+			updateWrapper.eq(RegionInfoEntity::getIsDeleted, 0);
+			baseInfoRegionService.remove(updateWrapper);
+		}
+		EtlAdCdEntity dto = new EtlAdCdEntity();
+		dto.setSuperioradcd("0");
+		List<EtlAdCdEntity> list = etlAdCdService.selectList(dto);
+		if (null != list && list.size() == 1) {
+			String code = list.get(0).getAdcd();
+			LambdaQueryWrapper<RegionInfoEntity> requestWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+			requestWrapper.eq(RegionInfoEntity::getAdcd, code);
+			requestWrapper.eq(RegionInfoEntity::getIsDeleted, 0);
+			RegionInfoEntity regionInfoEntity = baseInfoRegionService.getOne(requestWrapper);
+			if (null != regionInfoEntity) {
+				regionInfoEntity.setAdnm(list.get(0).getAdnm());
+				baseInfoRegionService.updateById(regionInfoEntity);
+			} else {
+				regionInfoEntity = new RegionInfoEntity();
+				regionInfoEntity.setAdcd(code);
+				regionInfoEntity.setAdnm(list.get(0).getAdnm());
+				regionInfoEntity.setParentCode("00");
+				regionInfoEntity.setAncestors("00");
+				regionInfoEntity.setStatus(1);
+				regionInfoEntity.setIsDeleted(0);
+				baseInfoRegionService.save(regionInfoEntity);
+			}
+			this.importAdcd(regionInfoDTO.getRegionLevel(), 2, code, "00," + code);
+		}
+		return R.status(true);
+	}
+
+	private boolean importAdcd(int level, int currLevel, String parentCode, String ancestors) {
+		if (currLevel > level) {
+			return true;
+		}
+		EtlAdCdEntity dto = new EtlAdCdEntity();
+		dto.setSuperioradcd(parentCode);
+		List<EtlAdCdEntity> list = etlAdCdService.selectList(dto);
+		if (null != list && list.size() > 0) {
+			for (EtlAdCdEntity adCdEntity : list) {
+				LambdaQueryWrapper<RegionInfoEntity> requestWrapper = Wrappers.<RegionInfoEntity>query().lambda();
+				requestWrapper.eq(RegionInfoEntity::getAdcd, adCdEntity.getAdcd());
+				requestWrapper.eq(RegionInfoEntity::getIsDeleted, 0);
+				RegionInfoEntity regionInfoEntity = baseInfoRegionService.getOne(requestWrapper);
+				if (null != regionInfoEntity) {
+					regionInfoEntity.setAdnm(adCdEntity.getAdnm());
+					baseInfoRegionService.updateById(regionInfoEntity);
+				} else {
+					regionInfoEntity = new RegionInfoEntity();
+					regionInfoEntity.setAdcd(adCdEntity.getAdcd());
+					regionInfoEntity.setAdnm(adCdEntity.getAdnm());
+					regionInfoEntity.setParentCode(parentCode);
+					regionInfoEntity.setAncestors(ancestors);
+					regionInfoEntity.setStatus(1);
+					regionInfoEntity.setIsDeleted(0);
+					baseInfoRegionService.save(regionInfoEntity);
+				}
+				importAdcd(level, currLevel + 1, adCdEntity.getAdcd(), ancestors + "," + adCdEntity.getAdcd());
+			}
+		}
+		return true;
+	}
+
+}

+ 55 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/dto/RegionInfoDTO.java

@@ -0,0 +1,55 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.region.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.baseinfo.region.entity.RegionInfoEntity;
+
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RegionInfoDTO extends RegionInfoEntity {
+
+	/**
+	 * 行政区划名称
+	 */
+	@ApiModelProperty(value = "行政区划名称")
+	private String name;
+
+	/**
+	 * 父级行政区划名称
+	 */
+	@ApiModelProperty(value = "父级行政区划名称")
+	private String parentName;
+
+	/**
+	 * 行政区划代码
+	 */
+	@ApiModelProperty(value = "行政区划代码")
+	private String code;
+
+	@ApiModelProperty(value = "行政区划层级")
+	private Integer regionLevel;
+
+	@ApiModelProperty(value = "是否覆盖")
+	private Integer isCovered;
+
+	@ApiModelProperty(value = "部门ID")
+	private Long deptId;
+
+
+}

+ 69 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/entity/OrgRegionInfoEntity.java

@@ -0,0 +1,69 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/3/9
+ */
+package org.springblade.modules.baseinfo.region.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;
+
+
+/**
+ * 运维单位行政机构信息
+ *
+ * @author swp
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("base_data_custom_region")
+public class OrgRegionInfoEntity extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 租户ID
+	 */
+	@ApiModelProperty("租户ID")
+	private String tenantId;
+
+	/**
+	 * 部门ID
+	 */
+	@ApiModelProperty(value = "部门ID")
+	private Long deptId;
+
+	/**
+	 * 行政区划代码
+	 */
+	@ApiModelProperty(value = "行政区划代码")
+	private String adcd;
+
+	/**
+	 * 行政区划名称
+	 */
+	@ApiModelProperty(value = "行政区划名称")
+	private String adnm;
+
+	/**
+	 * 父行政区划
+	 */
+	@ApiModelProperty(value = "父行政区划")
+	private String parentCode;
+
+	/**
+	 * 祖级列表,行政区划代码
+	 */
+	@ApiModelProperty(value = "祖级列表,行政区划代码")
+	private String ancestors;
+
+	/**
+	 * 政区类型
+	 */
+	@ApiModelProperty(value = "政区类型")
+	private String addType;
+}

+ 69 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/entity/RegionInfoEntity.java

@@ -0,0 +1,69 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/3/9
+ */
+package org.springblade.modules.baseinfo.region.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;
+
+
+/**
+ * 业务行政区划实体类,用于实际所需的行政区划管理,本项目只管理内蒙的行政区划
+ *
+ * @author swp
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("data_ad_cd_b")
+public class RegionInfoEntity extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 租户ID
+	 */
+	@ApiModelProperty("租户ID")
+	private String tenantId;
+
+	/**
+	 * 行政区划代码
+	 */
+	@ApiModelProperty(value = "行政区划代码")
+	private String adcd;
+
+	/**
+	 * 行政区划名称
+	 */
+	@ApiModelProperty(value = "行政区划名称")
+	private String adnm;
+
+	/**
+	 * 父行政区划
+	 */
+	@ApiModelProperty(value = "父行政区划")
+	private String parentCode;
+
+	/**
+	 * 祖级列表,行政区划代码
+	 */
+	@ApiModelProperty(value = "祖级列表,行政区划代码")
+	private String ancestors;
+
+	/**
+	 * 政区类型
+	 */
+	@ApiModelProperty(value = "政区类型")
+	private String addType;
+
+	/**
+	 * 排除: 默认不排除 0 , 排除 1
+	 */
+	@ApiModelProperty(value = "排除行政区")
+	private int  excludeAd;
+}

+ 52 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/entity/RegionTreeNodeEntity.java

@@ -0,0 +1,52 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/9/6
+ */
+package org.springblade.modules.baseinfo.region.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/***
+ * Date:2022/9/6
+ * Title: 行政区划功能模块
+ * Description:树节点实体类,AVUE TREE 适用
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+public class RegionTreeNodeEntity {
+
+	@ApiModelProperty("ID")
+	private String id;
+
+	@ApiModelProperty("父ID")
+	private String parentId;
+
+	@ApiModelProperty("键")
+	private String key;
+
+	@ApiModelProperty("节点值")
+	private String value;
+
+	@ApiModelProperty("标题")
+	private String title;
+
+	@ApiModelProperty("标题")
+	private String text;
+
+	@ApiModelProperty("此节点是否排除")
+	private Integer exclude;
+
+	@ApiModelProperty("子节点")
+	List<RegionTreeNodeEntity> children;
+
+	@ApiModelProperty("是否有子节点")
+	private Boolean hasChildren;
+
+}

+ 22 - 0
NMSZYYWXT/src/main/java/org/springblade/modules/baseinfo/region/mapper/OrgRegionInfoMapper.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.baseinfo.region.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.modules.baseinfo.region.entity.OrgRegionInfoEntity;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface OrgRegionInfoMapper extends BaseMapper<OrgRegionInfoEntity> {
+
+}

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.