dylan před 2 roky
rodič
revize
053584a994
100 změnil soubory, kde provedl 6909 přidání a 1034 odebrání
  1. binární
      lib/netcdfAll-5.5.3.jar
  2. 14 3
      pom.xml
  3. 41 0
      src/main/java/org/springblade/config/MultipartConfig.java
  4. 2 0
      src/main/java/org/springblade/constant/BusinessConstant.java
  5. 43 0
      src/main/java/org/springblade/constant/RedisBusinessConstant.java
  6. 107 0
      src/main/java/org/springblade/enums/SzyFlowRateMetadataEnum.java
  7. 3 2
      src/main/java/org/springblade/enums/WarningStatusEnum.java
  8. 0 111
      src/main/java/org/springblade/etl/EtlTaskManager.java
  9. 1048 0
      src/main/java/org/springblade/etl/controller/EtlTestController.java
  10. 0 866
      src/main/java/org/springblade/etl/controller/TestController.java
  11. 55 0
      src/main/java/org/springblade/etl/entity/EtlMpDataEntity.java
  12. 40 0
      src/main/java/org/springblade/etl/entity/EtlRtuDataEntity.java
  13. 56 0
      src/main/java/org/springblade/etl/entity/EtlWiuDataEntity.java
  14. 36 0
      src/main/java/org/springblade/etl/entity/EtlWiuWiustDataEntity.java
  15. 51 0
      src/main/java/org/springblade/etl/entity/EtlWiustDataEntity.java
  16. 36 0
      src/main/java/org/springblade/etl/entity/EtlWiustMpDataEntity.java
  17. 1 1
      src/main/java/org/springblade/etl/mapper/EtlAdCdMapper.java
  18. 7 2
      src/main/java/org/springblade/etl/mapper/EtlAdCdMapper.xml
  19. 27 0
      src/main/java/org/springblade/etl/mapper/EtlMpMapper.java
  20. 25 0
      src/main/java/org/springblade/etl/mapper/EtlMpMapper.xml
  21. 27 0
      src/main/java/org/springblade/etl/mapper/EtlRtuMapper.java
  22. 20 0
      src/main/java/org/springblade/etl/mapper/EtlRtuMapper.xml
  23. 27 0
      src/main/java/org/springblade/etl/mapper/EtlWiuMapper.java
  24. 27 0
      src/main/java/org/springblade/etl/mapper/EtlWiuMapper.xml
  25. 27 0
      src/main/java/org/springblade/etl/mapper/EtlWiuWiustMapper.java
  26. 20 0
      src/main/java/org/springblade/etl/mapper/EtlWiuWiustMapper.xml
  27. 27 0
      src/main/java/org/springblade/etl/mapper/EtlWiustMapper.java
  28. 25 0
      src/main/java/org/springblade/etl/mapper/EtlWiustMapper.xml
  29. 27 0
      src/main/java/org/springblade/etl/mapper/EtlWiustMpMapper.java
  30. 20 0
      src/main/java/org/springblade/etl/mapper/EtlWiustMpMapper.xml
  31. 1 1
      src/main/java/org/springblade/etl/service/IEtlAdCdService.java
  32. 26 0
      src/main/java/org/springblade/etl/service/IEtlMpDataService.java
  33. 25 0
      src/main/java/org/springblade/etl/service/IEtlRtuDataService.java
  34. 26 0
      src/main/java/org/springblade/etl/service/IEtlWiuDataService.java
  35. 26 0
      src/main/java/org/springblade/etl/service/IEtlWiuWiustDataService.java
  36. 26 0
      src/main/java/org/springblade/etl/service/IEtlWiustDataService.java
  37. 26 0
      src/main/java/org/springblade/etl/service/IEtlWiustMpDataService.java
  38. 2 2
      src/main/java/org/springblade/etl/service/impl/EtlAdCdServiceImpl.java
  39. 38 0
      src/main/java/org/springblade/etl/service/impl/EtlMpDatadServiceImpl.java
  40. 35 0
      src/main/java/org/springblade/etl/service/impl/EtlRtuDatadServiceImpl.java
  41. 35 0
      src/main/java/org/springblade/etl/service/impl/EtlWiuDatadServiceImpl.java
  42. 38 0
      src/main/java/org/springblade/etl/service/impl/EtlWiuWiustDatadServiceImpl.java
  43. 38 0
      src/main/java/org/springblade/etl/service/impl/EtlWiustDatadServiceImpl.java
  44. 38 0
      src/main/java/org/springblade/etl/service/impl/EtlWiustMpDatadServiceImpl.java
  45. 337 0
      src/main/java/org/springblade/jobtask/RainDataCountProcessor.java
  46. 725 0
      src/main/java/org/springblade/jobtask/ReportCountProcessor.java
  47. 279 0
      src/main/java/org/springblade/jobtask/RtuUpCountProcessor.java
  48. 40 0
      src/main/java/org/springblade/jobtask/TaskManager.java
  49. 379 0
      src/main/java/org/springblade/jobtask/TestDataProcessor.java
  50. 416 0
      src/main/java/org/springblade/jobtask/WarnCheckProcessor.java
  51. 41 0
      src/main/java/org/springblade/launch/LauncherServiceImpl.java
  52. 140 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/controller/MonitorPointController.java
  53. 42 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/dto/MonitorPointInfoDTO.java
  54. 93 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/entity/MonitorPointInfoEntity.java
  55. 58 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/entity/MonitorPointRelEntity.java
  56. 30 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointMapper.java
  57. 83 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointMapper.xml
  58. 30 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointRelMapper.java
  59. 16 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/mapper/MonitorPointRelMapper.xml
  60. 27 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/IMonitorPointRelService.java
  61. 30 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/IMonitorPointService.java
  62. 32 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/impl/MonitorPointRelServiceImpl.java
  63. 41 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/service/impl/MonitorPointServiceImpl.java
  64. 61 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/vo/MonitorPointInfoVO.java
  65. 139 0
      src/main/java/org/springblade/modules/baseinfo/monitorpoint/wrapper/MonitorPointWrapper.java
  66. 182 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/controller/MonitorSiteController.java
  67. 42 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/dto/MonitorSiteInfoDTO.java
  68. 146 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/entity/MonitorSiteInfoEntity.java
  69. 62 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/entity/MonitorSiteRelEntity.java
  70. 32 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteMapper.java
  71. 112 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteMapper.xml
  72. 24 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteRelMapper.java
  73. 14 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/mapper/MonitorSiteRelMapper.xml
  74. 24 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/service/IMonitorSiteRelService.java
  75. 32 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/service/IMonitorSiteService.java
  76. 26 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/service/impl/MonitorSiteRelServiceImpl.java
  77. 44 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/service/impl/MonitorSiteServiceImpl.java
  78. 49 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/vo/MonitorSiteInfoVO.java
  79. 106 0
      src/main/java/org/springblade/modules/baseinfo/monitorsite/wrapper/MonitorSiteWrapper.java
  80. 126 2
      src/main/java/org/springblade/modules/baseinfo/org/controller/BaseOrgController.java
  81. 73 0
      src/main/java/org/springblade/modules/baseinfo/org/entity/OrgInfoEntity.java
  82. 49 0
      src/main/java/org/springblade/modules/baseinfo/org/entity/OrgTreeNodeEntity.java
  83. 29 0
      src/main/java/org/springblade/modules/baseinfo/org/mapper/BaseOrgMapper.java
  84. 66 0
      src/main/java/org/springblade/modules/baseinfo/org/mapper/BaseOrgMapper.xml
  85. 28 0
      src/main/java/org/springblade/modules/baseinfo/org/service/IBaseOrgService.java
  86. 41 0
      src/main/java/org/springblade/modules/baseinfo/org/service/impl/BaseOrgServiceImpl.java
  87. 12 2
      src/main/java/org/springblade/modules/baseinfo/org/vo/OrgInfoVO.java
  88. 13 4
      src/main/java/org/springblade/modules/baseinfo/project/wrapper/ProjectInfoWrapper.java
  89. 6 2
      src/main/java/org/springblade/modules/baseinfo/region/controller/BaseInfoRegionController.java
  90. 15 12
      src/main/java/org/springblade/modules/baseinfo/rtu/controller/RtuBaseInfoController.java
  91. 4 0
      src/main/java/org/springblade/modules/baseinfo/rtu/dto/RtuInfoDTO.java
  92. 2 2
      src/main/java/org/springblade/modules/baseinfo/rtu/mapper/RtuInfoMapper.xml
  93. 9 5
      src/main/java/org/springblade/modules/baseinfo/rtu/wrapper/RtuInfoWrapper.java
  94. 104 0
      src/main/java/org/springblade/modules/baseinfo/warn/controller/BaseWarnController.java
  95. 37 3
      src/main/java/org/springblade/modules/baseinfo/warn/entity/BaseWarnSettingEntity.java
  96. 4 3
      src/main/java/org/springblade/modules/baseinfo/warn/mapper/BaseWarnSettingMapper.java
  97. 4 3
      src/main/java/org/springblade/modules/baseinfo/warn/mapper/BaseWarnSettingMapper.xml
  98. 3 3
      src/main/java/org/springblade/modules/baseinfo/warn/service/IBaseWarnSettingService.java
  99. 5 5
      src/main/java/org/springblade/modules/baseinfo/warn/service/impl/BaseWarnSettingServiceImpl.java
  100. 126 0
      src/main/java/org/springblade/modules/baseinfo/wateruseconsumer/controller/WaterUseConsumerController.java

binární
lib/netcdfAll-5.5.3.jar


+ 14 - 3
pom.xml

@@ -4,12 +4,12 @@
          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.shzhjcyjptywxt</groupId>
-    <artifactId>shzhjcyjptywxt</artifactId>
+    <groupId>org.springblade.xamszyywxt</groupId>
+    <artifactId>xamszyywxt</artifactId>
     <name>${project.artifactId}</name>
     <packaging>jar</packaging>
     <version>1.0-SNAPSHOT</version>
-    <description>系统平台-山洪灾害监测预警平台运维系统</description>
+    <description>系统平台-兴安盟水资源管理平台</description>
 
     <properties>
         <bladex.project.id>blade-api</bladex.project.id>
@@ -213,6 +213,17 @@
             <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>

+ 41 - 0
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();
+	}
+}

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

@@ -74,4 +74,6 @@ public class BusinessConstant {
 	public static final String ACCOUNT_PW_SUFFIX="@8282";
 
 	public static final Long DEPT_ROOT_ID =0L;
+
+	public static final Long DEPT_XAM_ID=1123598813738675201L;
 }

+ 43 - 0
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.";
+
+}

+ 107 - 0
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;
+    }
+}

+ 3 - 2
src/main/java/org/springblade/enums/WarningStatusEnum.java

@@ -1,13 +1,14 @@
 package org.springblade.enums;
 
 public enum WarningStatusEnum {
+
 	/**
-	 * 关闭
+	 * 开启
 	 */
 	STATUS_HAPPEN(0, "预警中"),
 
 	/**
-	 * 开启
+	 * 关闭
 	 */
 	STATUS_CLOSE(1, "恢复");
 

+ 0 - 111
src/main/java/org/springblade/etl/EtlTaskManager.java

@@ -1,111 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/5/23
- */
-package org.springblade.etl;
-
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.kafka.core.KafkaTemplate;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.stereotype.Component;
-
-
-/***
- * Date:2022/5/22
- * Title:  ETL模块
- * Description: 定时任务管理
- * @author swp
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-@Slf4j
-@Component
-@EnableScheduling
-public class EtlTaskManager {
-
-	/**
-	 * 公共线程池
-	 **/
-//	private static ThreadFactory publicThreadFactory = new ThreadFactoryBuilder().setNameFormat("etl-thread-pool-%d").build();
-//	private static ExecutorService publicThreadPool = new ThreadPoolExecutor(1, 1,
-//		0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), publicThreadFactory, new ThreadPoolExecutor.AbortPolicy());
-
-
-	@Autowired
-	private KafkaTemplate<String, String> kafkaTemplate;
-
-	@Autowired
-	private RedisTemplate redisTemplate;
-//
-//	@Resource
-//	private IEtlRainDataService etlRainDataService;
-//
-//	@Resource
-//	private IRtuDataRainService rtuDataRainService;
-//
-//	@Resource
-//	private IEtlRiverDataService etlRiverDataService;
-//
-//	@Resource
-//	private IRtuDataRiverService rtuDataRiverService;
-//
-//	@Resource
-//	private IEtlRsvrDataService etlRsvrDataService;
-//
-//	@Resource
-//	private IRtuDataRsvrService rtuDataRsvrService;
-//
-//	@Resource
-//	private IEtlGroundDataService etlGroundDataService;
-//
-//	@Resource
-//	private IRtuDataGroundService rtuDataGroundService;
-//
-//	@Resource
-//	private IEtlMvAttStBaseService etlMvAttStBaseService;
-//
-//	@Resource
-//	private IMvAttStBaseService mvAttStBaseService;
-//
-//	@Resource
-//	private IRtuBaseInfoService rtuBaseInfoService;
-
-	@Value("${spring.task-config.etl-task}")
-	boolean etlTask;
-//
-//	@Resource
-//	private TaskManager taskManager;
-
-//	@Scheduled(cron = "0 0 0/1 * * ?")
-//	public void attStBaseReadTask() {
-//		try {
-//			if (etlTask) {
-//				EtlMvAttStBaseDataTask mvAttStBaseDataTask = new EtlMvAttStBaseDataTask(etlMvAttStBaseService, mvAttStBaseService);
-//				FutureTask<Integer> futureTask = new FutureTask<>(mvAttStBaseDataTask);
-//				taskManager.submitTask(futureTask);
-//			}
-//		} catch (Exception e) {
-//			log.error("{}", e.getMessage());
-//		}
-//	}
-
-//	@Scheduled(cron = "0 0/5 * * * ?")
-//	public void rtuDataReadTask() {
-//		try {
-//			if (etlTask) {
-//				EtlRtuDataTask etlRtuDataTask = new EtlRtuDataTask(kafkaTemplate, redisTemplate, rtuBaseInfoService, etlRainDataService, rtuDataRainService, etlRiverDataService, rtuDataRiverService, etlRsvrDataService, rtuDataRsvrService, etlGroundDataService, rtuDataGroundService);
-//				FutureTask<Integer> futureTask = new FutureTask<>(etlRtuDataTask);
-//				taskManager.submitTask(futureTask);
-//			}
-//		} catch (Exception e) {
-//			log.error("{}", e.getMessage());
-//		}
-//	}
-
-}

+ 1048 - 0
src/main/java/org/springblade/etl/controller/EtlTestController.java

@@ -0,0 +1,1048 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.etl.controller;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.ConcurrentDateFormat;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.etl.entity.*;
+
+import org.springblade.etl.service.*;
+
+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.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.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.warning.service.IRtuWarningService;
+import org.springblade.surfacerain.SurfaceRainDataProcessor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.kafka.core.KafkaTemplate;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import ucar.nc2.NetcdfFile;
+import ucar.nc2.NetcdfFiles;
+
+import javax.annotation.Resource;
+
+import java.util.*;
+
+
+/***
+ * Date:2022/8/22
+ * Title:行政区划管理
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@RestController
+@RequestMapping("galaxy-test/etl/test")
+@AllArgsConstructor
+@Api(value = "业务字典", tags = "业务字典")
+@Slf4j
+public class EtlTestController extends BladeController {
+    private final IRtuBaseInfoService rtuBaseInfoService;
+    private final IEtlRainDataService etlRainDataService;
+
+    private final IRtuWarningService rtuWarningService;
+
+    @Resource
+    private RedisTemplate redisTemplate;
+    @Autowired
+    private KafkaTemplate<String, String> kafkaTemplate;
+
+    @Resource
+    private SurfaceRainDataProcessor surfDataProcessTask;
+
+    private final IEtlRtuDataService rtuDataService;
+
+    private final IEtlWiuDataService wiuDataService;
+
+    private final IWaterUseConsumerService waterUseConsumerService;
+
+    private final IEtlWiustDataService wiustDataService;
+
+    private final IMonitorSiteService monitorSiteService;
+
+    private final IEtlMpDataService mpDataService;
+
+    private final IMonitorPointService monitorPointService;
+
+    private final IEtlWiuWiustDataService wiuWiustDataService;
+    private final IMonitorSiteRelService monitorSiteRelService;
+
+    private final IEtlWiustMpDataService wiustMpDataService;
+    private final IMonitorPointRelService monitorPointRelService;
+
+
+    @GetMapping("/rtu")
+    @ApiOperationSupport(order = 1)
+    public R<String> updateEtlRtu() {
+        EtlRtuDataEntity etlRtuDataEntity = new EtlRtuDataEntity();
+        List<EtlRtuDataEntity> list = rtuDataService.selectList(etlRtuDataEntity);
+        for (EtlRtuDataEntity entity : list) {
+            RtuInfoEntity rtuInfoEntity = new RtuInfoEntity();
+            rtuInfoEntity.setRtuCode(entity.getRtuCd());
+            rtuInfoEntity.setAdCode(entity.getOrgCode());
+            if ("00".equals(entity.getOrgCode())) {
+                rtuInfoEntity.setOrgId(1123598813738675201L);
+            } else if ("11".equals(entity.getOrgCode())) {
+                rtuInfoEntity.setOrgId(1715215595639267330L);
+            } else if ("12".equals(entity.getOrgCode())) {
+                rtuInfoEntity.setOrgId(1715215690510229506L);
+            } else if ("10".equals(entity.getOrgCode())) {
+                rtuInfoEntity.setOrgId(1715215884710699010L);
+            } else if ("13".equals(entity.getOrgCode())) {
+                rtuInfoEntity.setOrgId(1715215952884916226L);
+            } else if ("14".equals(entity.getOrgCode())) {
+                rtuInfoEntity.setOrgId(1715216007264067585L);
+            } else if ("15".equals(entity.getOrgCode())) {
+                rtuInfoEntity.setOrgId(1715216066533777409L);
+            } else if ("713".equals(entity.getOrgCode())) {
+                rtuInfoEntity.setOrgId(1715215779899236354L);
+            } else if ("111".equals(entity.getOrgCode())) {
+                rtuInfoEntity.setOrgId(1715216136150835201L);
+            }
+            rtuBaseInfoService.save(rtuInfoEntity);
+        }
+
+        return R.success("ok");
+    }
+
+    @GetMapping("/wiu")
+    @ApiOperationSupport(order = 1)
+    public R<String> updateEtlWiu() {
+        EtlWiuDataEntity dataEntity = new EtlWiuDataEntity();
+        List<EtlWiuDataEntity> list = wiuDataService.selectList(dataEntity);
+        for (EtlWiuDataEntity entity : list) {
+            WaterUseConsumerInfoEntity waterUseConsumerInfoEntity = new WaterUseConsumerInfoEntity();
+            waterUseConsumerInfoEntity.setWiuCd(entity.getWiuCd());
+            waterUseConsumerInfoEntity.setWiuNm(entity.getWiuNm());
+            waterUseConsumerInfoEntity.setLrNm(entity.getLrNm());
+            waterUseConsumerInfoEntity.setTradTp(entity.getTradTp());
+            waterUseConsumerInfoEntity.setEcoTp(entity.getEcoTp());
+            waterUseConsumerInfoEntity.setMonLevel(entity.getMong());
+            waterUseConsumerInfoEntity.setWiuTp(entity.getWiuTp());
+            waterUseConsumerInfoEntity.setAddr(entity.getAddr());
+            if ("00".equals(entity.getOrgCode())) {
+                waterUseConsumerInfoEntity.setOrgId(1123598813738675201L);
+            } else if ("11".equals(entity.getOrgCode())) {
+                waterUseConsumerInfoEntity.setOrgId(1715215595639267330L);
+            } else if ("12".equals(entity.getOrgCode())) {
+                waterUseConsumerInfoEntity.setOrgId(1715215690510229506L);
+            } else if ("10".equals(entity.getOrgCode())) {
+                waterUseConsumerInfoEntity.setOrgId(1715215884710699010L);
+            } else if ("13".equals(entity.getOrgCode())) {
+                waterUseConsumerInfoEntity.setOrgId(1715215952884916226L);
+            } else if ("14".equals(entity.getOrgCode())) {
+                waterUseConsumerInfoEntity.setOrgId(1715216007264067585L);
+            } else if ("15".equals(entity.getOrgCode())) {
+                waterUseConsumerInfoEntity.setOrgId(1715216066533777409L);
+            } else if ("713".equals(entity.getOrgCode())) {
+                waterUseConsumerInfoEntity.setOrgId(1715215779899236354L);
+            } else if ("111".equals(entity.getOrgCode())) {
+                waterUseConsumerInfoEntity.setOrgId(1715216136150835201L);
+            }
+            waterUseConsumerService.save(waterUseConsumerInfoEntity);
+        }
+
+        return R.success("ok");
+    }
+
+    @GetMapping("/wiust")
+    @ApiOperationSupport(order = 1)
+    public R<String> updateEtlWiust() {
+        EtlWiustDataEntity dataEntity = new EtlWiustDataEntity();
+        List<EtlWiustDataEntity> list = wiustDataService.selectList(dataEntity);
+        for (EtlWiustDataEntity entity : list) {
+            MonitorSiteInfoEntity monitorSiteInfoEntity = new MonitorSiteInfoEntity();
+            monitorSiteInfoEntity.setWiustCd(entity.getWiustCd());
+            monitorSiteInfoEntity.setWiustNm(entity.getWiustNm());
+            monitorSiteInfoEntity.setWiustTp(entity.getWiustTp());
+            monitorSiteInfoEntity.setLoc(entity.getLoc());
+            monitorSiteInfoEntity.setDatTp(entity.getDatTp());
+            monitorSiteInfoEntity.setWellTp(entity.getWellTp());
+            String tm = entity.getEstStYm() + "01120000";
+            monitorSiteInfoEntity.setEstStYm(Func.parse(tm, ConcurrentDateFormat.of("yyyyMMddHHmmss")));
+
+            monitorSiteService.save(monitorSiteInfoEntity);
+        }
+
+        return R.success("ok");
+    }
+
+
+    @GetMapping("/mp")
+    @ApiOperationSupport(order = 1)
+    public R<String> updateEtlMp() {
+        EtlMpDataEntity dataEntity = new EtlMpDataEntity();
+        List<EtlMpDataEntity> list = mpDataService.selectList(dataEntity);
+        for (EtlMpDataEntity entity : list) {
+            MonitorPointInfoEntity pointInfoEntity = new MonitorPointInfoEntity();
+            pointInfoEntity.setMpCd(entity.getMpCd());
+            pointInfoEntity.setMpNm(entity.getMpNm());
+            pointInfoEntity.setMpAddr(entity.getMpAddr());
+            pointInfoEntity.setMpItem(entity.getMpItem());
+            pointInfoEntity.setIsAuto(entity.getIsAuto());
+            pointInfoEntity.setSourTp(entity.getSourTp());
+            pointInfoEntity.setLat(entity.getWeiDu());
+            pointInfoEntity.setLng(entity.getJingDu());
+
+            monitorPointService.save(pointInfoEntity);
+        }
+
+        return R.success("ok");
+    }
+
+    @GetMapping("/rel/mp")
+    @ApiOperationSupport(order = 1)
+    public R<String> updateEtlWiustMp() {
+        EtlWiustMpDataEntity dataEntity = new EtlWiustMpDataEntity();
+        List<EtlWiustMpDataEntity> list = wiustMpDataService.selectList(dataEntity);
+        for (EtlWiustMpDataEntity entity : list) {
+            MonitorPointRelEntity pointInfoEntity = new MonitorPointRelEntity();
+            pointInfoEntity.setMpCd(entity.getMpCd());
+            pointInfoEntity.setWiustCd(entity.getWiustCd());
+            monitorPointRelService.save(pointInfoEntity);
+        }
+
+        return R.success("ok");
+    }
+
+    @GetMapping("/rel/wiust")
+    @ApiOperationSupport(order = 1)
+    public R<String> updateEtlWiuWiust() {
+        EtlWiuWiustDataEntity dataEntity = new EtlWiuWiustDataEntity();
+        List<EtlWiuWiustDataEntity> list = wiuWiustDataService.selectList(dataEntity);
+        for (EtlWiuWiustDataEntity entity : list) {
+            MonitorSiteRelEntity pointInfoEntity = new MonitorSiteRelEntity();
+            pointInfoEntity.setWiuCd(entity.getWiuCd());
+            pointInfoEntity.setWiustCd(entity.getWiustCd());
+
+
+            monitorSiteRelService.save(pointInfoEntity);
+        }
+
+        return R.success("ok");
+    }
+
+    @GetMapping("/data/rain")
+    @ApiOperationSupport(order = 1)
+    public R<String> addRain(@RequestParam(name = "rtuCode") String rtuCode) {
+        try {
+            String filename = "D:\\tmp\\test\\Z_SURF_C_BABJ_20230517112343_P_CMPA_RT_BEHT_0P01_HOR-PRE-2023051711.GRB2";
+
+
+            //NetcdfFile netcdfFile = NetcdfFiles.open(filename, null);
+            NetcdfFile netcdfFile = NetcdfFiles.open(filename);
+            ///	ImmutableList<Variable> variables = netcdfFile.getVariables();
+            //	surfDataProcessTask.submit(filename,Func.formatDateTime(new Date()));
+
+//			log.info("***************************");
+//			log.info("{}",	netcdfFile.getFileTypeId());
+//			log.info("***************************");
+//			log.info("{}",	netcdfFile.getTitle());
+//			log.info("***************************");
+//			log.info("{}",	netcdfFile.getDetailInfo());
+//			log.info("***************************");
+//			log.info("{}",netcdfFile.getLocation());
+//			log.info("***************************");
+            //	ImmutableDescriptor
+            //ImmutableList<Variable> variables = netcdfFile.getVariables();
+//			ImmutableList<Attribute> attributeIterator =	netcdfFile.getGlobalAttributes();
+//			for(Attribute a:attributeIterator){
+//				log.info("***************************");
+//				log.info("Attribute {},{},{}",a.getName(),a.getStringValue(),a.getDataType().toString());
+//			}
+
+            //	List<String> lons = new LinkedList<>();
+//			List<String> lats = new LinkedList<>();
+//			List<String> times = new LinkedList<>();
+//
+//			List<Map<String, String>> values = new LinkedList<>();
+//
+//			for (Variable v : variables) {
+//				log.info("***************************");
+//				log.info("{},{},{}", v.getFullName(), v.getDataType().toString(), v.getDimensionsString());
+//				log.info("***************************");
+//				if (v.getFullName().equals("lon")) {
+//					log.info("lon size {}", v.getSize());
+//					Array datas = v.read();
+//					Index index = datas.getIndex();
+//					int[] shapelist = v.getShape();
+//					for (int i = 0; i < shapelist[0]; i++) {
+//						float lonv = datas.getFloat(index.set(i));
+//						lons.add(Func.toStr(lonv));
+//					}
+//				}
+//				log.info("***************************");
+//				if (v.getFullName().equals("lat")) {
+//					log.info("lat size {}", v.getSize());
+//					Array datas = v.read();
+//					Index index = datas.getIndex();
+//					int[] shapelist = v.getShape();
+//					for (int i = 0; i < shapelist[0]; i++) {
+//						float latv = datas.getFloat(index.set(i));
+//						lats.add(Func.toStr(latv));
+//					}
+//				}
+//				log.info("***************************");
+//				if (v.getFullName().equals("time")) {
+//					log.info("time size {}", v.getSize());
+//					Array datas = v.read();
+//					Index index = datas.getIndex();
+//					int[] shapelist = v.getShape();
+//					for (int i = 0; i < shapelist[0]; i++) {
+//						double timev = datas.getDouble(index.set(i));
+//						times.add(Func.toStr(timev));
+//					}
+//				}
+//				log.info("***************************");
+//				if (v.getFullName().equals("reftime")) {
+//					log.info("reftime size {}", v.getSize());
+////					Array datas = v.read();
+////					Index index= datas.getIndex();
+////					int[] shapelist= v.getShape();
+////					for (int i = 0; i < shapelist[0]; i++) {
+////						double timev=	datas.getDouble(index.set(i));
+////						times.add(Func.toStr(timev));
+////					}
+//				}
+//
+//
+//				log.info("***************************");
+//				if (v.getFullName().equals("Total_precipitation_surface")) {
+//					log.info("surface size {}", v.getSize());
+//					Array datas = v.read();
+//					int[] shapelist = v.getShape();
+//					Index index = datas.getIndex();
+//					//按时间
+//					for (int i = 0; i < shapelist[0]; i++) {
+//						// 按维度
+//						for (int n = 0; n < shapelist[1]; n++) {
+//							// 按经度
+//							for (int k = 0; k < 100; k++) {
+//								// 按照对应索引获取数据并转换为string类型添加到数组中
+//								float dval = datas.getFloat(index.set(i, n, k));
+//								log.info("shape {} {} {}", i, n, k);
+//								log.info("time,lat,lon,value:    {},{},{}", lats.get(n), lons.get(k), dval);
+//							}
+//						}
+//					}
+//				}
+//
+//			}
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return R.data("ok");
+    }
+
+    @GetMapping("/data/rain/1")
+    @ApiOperationSupport(order = 1)
+    public R<String> addRain1() {
+        EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
+        Calendar calendar = Calendar.getInstance();
+        //calendar.set(Calendar.HOUR_OF_DAY, 1);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01710140");
+        etlRainDataEntity.setIntv(1.0);
+        etlRainDataEntity.setDrp(3.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+        return R.data("ok");
+    }
+
+    @GetMapping("/data/rain/2")
+    @ApiOperationSupport(order = 1)
+    public R<String> addRain2() {
+        EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 2);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01740030");
+        etlRainDataEntity.setIntv(1.0);
+        etlRainDataEntity.setDrp(3.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+        return R.data("ok");
+    }
+
+    @GetMapping("/data/rain/3")
+    @ApiOperationSupport(order = 1)
+    public R<String> addRain3() {
+        EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 3);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01740030");
+        etlRainDataEntity.setIntv(1.0);
+        etlRainDataEntity.setDrp(3.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+        return R.data("ok");
+    }
+
+    @GetMapping("/data/rain/4")
+    @ApiOperationSupport(order = 1)
+    public R<String> addRain4() {
+        EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 4);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+        return R.data("ok");
+    }
+
+    @GetMapping("/data/rain/5")
+    @ApiOperationSupport(order = 1)
+    public R<String> addRain5() {
+        EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 5);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(1.0);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+        return R.data("ok");
+    }
+
+    @GetMapping("/data/river/0")
+    @ApiOperationSupport(order = 1)
+    public R<String> addriver0() {
+        ValueOperations<String, String> ops = redisTemplate.opsForValue();
+        String key = "etl.river.40516502.up.5min";
+        JSONArray array = new JSONArray();
+        ops.set(key, array.toJSONString());
+        return R.data("ok");
+    }
+
+    @GetMapping("/data/river/1")
+    @ApiOperationSupport(order = 1)
+    public R<String> addriver1() {
+
+        EtlRsvrDataEntity etlRsvrDataEntity = new EtlRsvrDataEntity();
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 9);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        etlRsvrDataEntity.setTm(calendar.getTime());
+
+        calendar.set(Calendar.HOUR_OF_DAY, 11);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        etlRsvrDataEntity.setFromDate(calendar.getTime());
+
+        etlRsvrDataEntity.setRtuCode("20911190");
+        etlRsvrDataEntity.setRz(0.05);
+
+
+        kafkaTemplate.send("topic-etl-rsvr-data", JSONObject.toJSONString(etlRsvrDataEntity));
+        return R.data("ok");
+    }
+
+    @GetMapping("/data/river/2")
+    @ApiOperationSupport(order = 1)
+    public R<String> addriver2() {
+        EtlRsvrDataEntity etlRsvrDataEntity = new EtlRsvrDataEntity();
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 9);
+        calendar.set(Calendar.MINUTE, 10);
+        calendar.set(Calendar.SECOND, 0);
+        etlRsvrDataEntity.setTm(calendar.getTime());
+
+        calendar.set(Calendar.HOUR_OF_DAY, 12);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+
+        etlRsvrDataEntity.setFromDate(calendar.getTime());
+
+        etlRsvrDataEntity.setRtuCode("01718530");
+        etlRsvrDataEntity.setRz(0.05);
+
+
+        kafkaTemplate.send("topic-etl-rsvr-data", JSONObject.toJSONString(etlRsvrDataEntity));
+        return R.data("ok");
+
+
+    }
+
+    @GetMapping("/data/river/3")
+    @ApiOperationSupport(order = 1)
+    public R<String> addriver3() {
+        EtlRsvrDataEntity etlRsvrDataEntity = new EtlRsvrDataEntity();
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 12);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRsvrDataEntity.setTm(calendar.getTime());
+
+        calendar.set(Calendar.MINUTE, 27);
+
+        etlRsvrDataEntity.setFromDate(calendar.getTime());
+
+        etlRsvrDataEntity.setRtuCode("20911190");
+        etlRsvrDataEntity.setRz(0.05);
+
+
+        kafkaTemplate.send("topic-etl-rsvr-data", JSONObject.toJSONString(etlRsvrDataEntity));
+        return R.data("ok");
+
+
+    }
+
+    @GetMapping("/data/river/4")
+    @ApiOperationSupport(order = 1)
+    public R<String> addriver4() {
+        EtlRsvrDataEntity etlRsvrDataEntity = new EtlRsvrDataEntity();
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 12);
+        calendar.set(Calendar.MINUTE, 20);
+        calendar.set(Calendar.SECOND, 0);
+        etlRsvrDataEntity.setTm(calendar.getTime());
+
+        calendar.set(Calendar.MINUTE, 35);
+
+        etlRsvrDataEntity.setFromDate(calendar.getTime());
+
+        etlRsvrDataEntity.setRtuCode("20911190");
+        etlRsvrDataEntity.setRz(0.05);
+
+
+        kafkaTemplate.send("topic-etl-rsvr-data", JSONObject.toJSONString(etlRsvrDataEntity));
+        return R.data("ok");
+
+
+    }
+
+    @GetMapping("/data/rain/hour/0")
+    @ApiOperationSupport(order = 1)
+    public R<String> addrainhour0() {
+        String key = "etl.rain.01751310.up.hour";
+
+        ValueOperations<String, String> ops = redisTemplate.opsForValue();
+
+        JSONArray array = new JSONArray();
+        ops.set(key, array.toJSONString());
+        return R.data("ok");
+    }
+
+    @GetMapping("/data/rain/hour")
+    @ApiOperationSupport(order = 1)
+    public R<String> addrainhour() {
+        EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH, 9);
+        calendar.set(Calendar.HOUR_OF_DAY, 12);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH, 9);
+        calendar.set(Calendar.HOUR_OF_DAY, 13);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH, 9);
+        calendar.set(Calendar.HOUR_OF_DAY, 13);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+//		 etlRainDataEntity= new EtlRainDataEntity();
+//		 calendar=Calendar.getInstance();
+//		calendar.set(Calendar.DAY_OF_MONTH,9);
+//		calendar.set(Calendar.HOUR_OF_DAY,14);
+//		calendar.set(Calendar.MINUTE,15);
+//		calendar.set(Calendar.SECOND,0);
+//		etlRainDataEntity.setTm(calendar.getTime());
+//		calendar.set(Calendar.MINUTE,27);
+//		etlRainDataEntity.setFromDate(calendar.getTime());
+//		etlRainDataEntity.setRtuCode("01751310");
+//		etlRainDataEntity.setIntv(0.05);
+//		etlRainDataEntity.setDrp(1.0);
+//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+//		 etlRainDataEntity= new EtlRainDataEntity();
+//		 calendar=Calendar.getInstance();
+//		calendar.set(Calendar.DAY_OF_MONTH,9);
+//		calendar.set(Calendar.HOUR_OF_DAY,15);
+//		calendar.set(Calendar.MINUTE,15);
+//		calendar.set(Calendar.SECOND,0);
+//		etlRainDataEntity.setTm(calendar.getTime());
+//		calendar.set(Calendar.MINUTE,27);
+//		etlRainDataEntity.setFromDate(calendar.getTime());
+//		etlRainDataEntity.setRtuCode("01751310");
+//		etlRainDataEntity.setIntv(0.05);
+//		etlRainDataEntity.setDrp(1.0);
+//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+//		 etlRainDataEntity= new EtlRainDataEntity();
+//		 calendar=Calendar.getInstance();
+//		calendar.set(Calendar.DAY_OF_MONTH,9);
+//		calendar.set(Calendar.HOUR_OF_DAY,16);
+//		calendar.set(Calendar.MINUTE,15);
+//		calendar.set(Calendar.SECOND,0);
+//		etlRainDataEntity.setTm(calendar.getTime());
+//		calendar.set(Calendar.MINUTE,27);
+//		etlRainDataEntity.setFromDate(calendar.getTime());
+//		etlRainDataEntity.setRtuCode("01751310");
+//		etlRainDataEntity.setIntv(0.05);
+//		etlRainDataEntity.setDrp(1.0);
+//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH, 9);
+        calendar.set(Calendar.HOUR_OF_DAY, 17);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH, 9);
+        calendar.set(Calendar.HOUR_OF_DAY, 18);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+//		 etlRainDataEntity= new EtlRainDataEntity();
+//		 calendar=Calendar.getInstance();
+//		calendar.set(Calendar.DAY_OF_MONTH,9);
+//		calendar.set(Calendar.HOUR_OF_DAY,19);
+//		calendar.set(Calendar.MINUTE,15);
+//		calendar.set(Calendar.SECOND,0);
+//		etlRainDataEntity.setTm(calendar.getTime());
+//		calendar.set(Calendar.MINUTE,27);
+//		etlRainDataEntity.setFromDate(calendar.getTime());
+//		etlRainDataEntity.setRtuCode("01751310");
+//		etlRainDataEntity.setIntv(0.05);
+//		etlRainDataEntity.setDrp(1.0);
+//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+//		 etlRainDataEntity= new EtlRainDataEntity();
+//		 calendar=Calendar.getInstance();
+//		calendar.set(Calendar.DAY_OF_MONTH,9);
+//		calendar.set(Calendar.HOUR_OF_DAY,20);
+//		calendar.set(Calendar.MINUTE,15);
+//		calendar.set(Calendar.SECOND,0);
+//		etlRainDataEntity.setTm(calendar.getTime());
+//		calendar.set(Calendar.MINUTE,27);
+//		etlRainDataEntity.setFromDate(calendar.getTime());
+//		etlRainDataEntity.setRtuCode("01751310");
+//		etlRainDataEntity.setIntv(0.05);
+//		etlRainDataEntity.setDrp(1.0);
+//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH, 9);
+        calendar.set(Calendar.HOUR_OF_DAY, 21);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH, 9);
+        calendar.set(Calendar.HOUR_OF_DAY, 22);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH, 9);
+        calendar.set(Calendar.HOUR_OF_DAY, 23);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 1);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 2);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 3);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 4);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 5);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 6);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 7);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+//		etlRainDataEntity= new EtlRainDataEntity();
+//		calendar=Calendar.getInstance();
+//		calendar.set(Calendar.HOUR_OF_DAY,8);
+//		calendar.set(Calendar.MINUTE,15);
+//		calendar.set(Calendar.SECOND,0);
+//		etlRainDataEntity.setTm(calendar.getTime());
+//		calendar.set(Calendar.MINUTE,27);
+//		etlRainDataEntity.setFromDate(calendar.getTime());
+//		etlRainDataEntity.setRtuCode("01751310");
+//		etlRainDataEntity.setIntv(0.05);
+//		etlRainDataEntity.setDrp(1.0);
+//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 9);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 10);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 11);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 12);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 13);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+//
+//		etlRainDataEntity= new EtlRainDataEntity();
+//		calendar=Calendar.getInstance();
+//		calendar.set(Calendar.HOUR_OF_DAY,14);
+//		calendar.set(Calendar.MINUTE,15);
+//		calendar.set(Calendar.SECOND,0);
+//		etlRainDataEntity.setTm(calendar.getTime());
+//		calendar.set(Calendar.MINUTE,27);
+//		etlRainDataEntity.setFromDate(calendar.getTime());
+//		etlRainDataEntity.setRtuCode("01751310");
+//		etlRainDataEntity.setIntv(0.05);
+//		etlRainDataEntity.setDrp(1.0);
+//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 15);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 16);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+//
+//
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 17);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 18);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 19);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+
+        etlRainDataEntity = new EtlRainDataEntity();
+        calendar = Calendar.getInstance();
+        calendar.set(Calendar.HOUR_OF_DAY, 20);
+        calendar.set(Calendar.MINUTE, 15);
+        calendar.set(Calendar.SECOND, 0);
+        etlRainDataEntity.setTm(calendar.getTime());
+        calendar.set(Calendar.MINUTE, 27);
+        etlRainDataEntity.setFromDate(calendar.getTime());
+        etlRainDataEntity.setRtuCode("01751310");
+        etlRainDataEntity.setIntv(0.05);
+        etlRainDataEntity.setDrp(1.0);
+        kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
+
+        return R.data("ok");
+    }
+}

+ 0 - 866
src/main/java/org/springblade/etl/controller/TestController.java

@@ -1,866 +0,0 @@
-/**
- * Copyright 2019 DH
- * All right reserved.
- * 项目名称: 大恒泰山系统
- * 创建日期:2022/8/22
- */
-package org.springblade.etl.controller;
-
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-
-import io.swagger.annotations.Api;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springblade.core.boot.ctrl.BladeController;
-import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.etl.entity.EtlRainDataEntity;
-
-import org.springblade.etl.entity.EtlRsvrDataEntity;
-
-import org.springblade.etl.service.IEtlRainDataService;
-
-import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
-import org.springblade.modules.business.warning.service.IRtuWarningService;
-import org.springblade.task.SurfDataProcessTask;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.ValueOperations;
-import org.springframework.kafka.core.KafkaTemplate;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-import ucar.nc2.NetcdfFile;
-import ucar.nc2.NetcdfFiles;
-
-import javax.annotation.Resource;
-
-import java.util.*;
-
-
-/***
- * Date:2022/8/22
- * Title:行政区划管理
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author dylan
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-@RestController
-@RequestMapping("galaxy-test/test")
-@AllArgsConstructor
-@Api(value = "业务字典", tags = "业务字典")
-@Slf4j
-public class TestController extends BladeController {
-	private final IRtuBaseInfoService rtuBaseInfoService;
-	private final IEtlRainDataService etlRainDataService;
-
-	private final IRtuWarningService rtuWarningService;
-
-	@Resource
-	private RedisTemplate redisTemplate;
-	@Autowired
-	private KafkaTemplate<String, String> kafkaTemplate;
-
-	@Resource
-	private SurfDataProcessTask surfDataProcessTask;
-
-
-	@GetMapping("/data/rain")
-	@ApiOperationSupport(order = 1)
-	public R<String> addRain(@RequestParam(name = "rtuCode") String rtuCode) {
-		try {
-			String filename = "D:\\tmp\\test\\Z_SURF_C_BABJ_20230517112343_P_CMPA_RT_BEHT_0P01_HOR-PRE-2023051711.GRB2";
-
-
-			//NetcdfFile netcdfFile = NetcdfFiles.open(filename, null);
-			NetcdfFile netcdfFile = NetcdfFiles.open(filename);
-			///	ImmutableList<Variable> variables = netcdfFile.getVariables();
-			//	surfDataProcessTask.submit(filename,Func.formatDateTime(new Date()));
-
-//			log.info("***************************");
-//			log.info("{}",	netcdfFile.getFileTypeId());
-//			log.info("***************************");
-//			log.info("{}",	netcdfFile.getTitle());
-//			log.info("***************************");
-//			log.info("{}",	netcdfFile.getDetailInfo());
-//			log.info("***************************");
-//			log.info("{}",netcdfFile.getLocation());
-//			log.info("***************************");
-			//	ImmutableDescriptor
-			//ImmutableList<Variable> variables = netcdfFile.getVariables();
-//			ImmutableList<Attribute> attributeIterator =	netcdfFile.getGlobalAttributes();
-//			for(Attribute a:attributeIterator){
-//				log.info("***************************");
-//				log.info("Attribute {},{},{}",a.getName(),a.getStringValue(),a.getDataType().toString());
-//			}
-
-			//	List<String> lons = new LinkedList<>();
-//			List<String> lats = new LinkedList<>();
-//			List<String> times = new LinkedList<>();
-//
-//			List<Map<String, String>> values = new LinkedList<>();
-//
-//			for (Variable v : variables) {
-//				log.info("***************************");
-//				log.info("{},{},{}", v.getFullName(), v.getDataType().toString(), v.getDimensionsString());
-//				log.info("***************************");
-//				if (v.getFullName().equals("lon")) {
-//					log.info("lon size {}", v.getSize());
-//					Array datas = v.read();
-//					Index index = datas.getIndex();
-//					int[] shapelist = v.getShape();
-//					for (int i = 0; i < shapelist[0]; i++) {
-//						float lonv = datas.getFloat(index.set(i));
-//						lons.add(Func.toStr(lonv));
-//					}
-//				}
-//				log.info("***************************");
-//				if (v.getFullName().equals("lat")) {
-//					log.info("lat size {}", v.getSize());
-//					Array datas = v.read();
-//					Index index = datas.getIndex();
-//					int[] shapelist = v.getShape();
-//					for (int i = 0; i < shapelist[0]; i++) {
-//						float latv = datas.getFloat(index.set(i));
-//						lats.add(Func.toStr(latv));
-//					}
-//				}
-//				log.info("***************************");
-//				if (v.getFullName().equals("time")) {
-//					log.info("time size {}", v.getSize());
-//					Array datas = v.read();
-//					Index index = datas.getIndex();
-//					int[] shapelist = v.getShape();
-//					for (int i = 0; i < shapelist[0]; i++) {
-//						double timev = datas.getDouble(index.set(i));
-//						times.add(Func.toStr(timev));
-//					}
-//				}
-//				log.info("***************************");
-//				if (v.getFullName().equals("reftime")) {
-//					log.info("reftime size {}", v.getSize());
-////					Array datas = v.read();
-////					Index index= datas.getIndex();
-////					int[] shapelist= v.getShape();
-////					for (int i = 0; i < shapelist[0]; i++) {
-////						double timev=	datas.getDouble(index.set(i));
-////						times.add(Func.toStr(timev));
-////					}
-//				}
-//
-//
-//				log.info("***************************");
-//				if (v.getFullName().equals("Total_precipitation_surface")) {
-//					log.info("surface size {}", v.getSize());
-//					Array datas = v.read();
-//					int[] shapelist = v.getShape();
-//					Index index = datas.getIndex();
-//					//按时间
-//					for (int i = 0; i < shapelist[0]; i++) {
-//						// 按维度
-//						for (int n = 0; n < shapelist[1]; n++) {
-//							// 按经度
-//							for (int k = 0; k < 100; k++) {
-//								// 按照对应索引获取数据并转换为string类型添加到数组中
-//								float dval = datas.getFloat(index.set(i, n, k));
-//								log.info("shape {} {} {}", i, n, k);
-//								log.info("time,lat,lon,value:    {},{},{}", lats.get(n), lons.get(k), dval);
-//							}
-//						}
-//					}
-//				}
-//
-//			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		return R.data("ok");
-	}
-
-	@GetMapping("/data/rain/1")
-	@ApiOperationSupport(order = 1)
-	public R<String> addRain1() {
-		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-		Calendar calendar = Calendar.getInstance();
-		//calendar.set(Calendar.HOUR_OF_DAY, 1);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01710140");
-		etlRainDataEntity.setIntv(1.0);
-		etlRainDataEntity.setDrp(3.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-		return R.data("ok");
-	}
-
-	@GetMapping("/data/rain/2")
-	@ApiOperationSupport(order = 1)
-	public R<String> addRain2() {
-		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 2);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01740030");
-		etlRainDataEntity.setIntv(1.0);
-		etlRainDataEntity.setDrp(3.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-		return R.data("ok");
-	}
-
-	@GetMapping("/data/rain/3")
-	@ApiOperationSupport(order = 1)
-	public R<String> addRain3() {
-		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 3);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01740030");
-		etlRainDataEntity.setIntv(1.0);
-		etlRainDataEntity.setDrp(3.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-		return R.data("ok");
-	}
-
-	@GetMapping("/data/rain/4")
-	@ApiOperationSupport(order = 1)
-	public R<String> addRain4() {
-		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 4);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-		return R.data("ok");
-	}
-
-	@GetMapping("/data/rain/5")
-	@ApiOperationSupport(order = 1)
-	public R<String> addRain5() {
-		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 5);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(1.0);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-		return R.data("ok");
-	}
-
-	@GetMapping("/data/river/0")
-	@ApiOperationSupport(order = 1)
-	public R<String> addriver0() {
-		ValueOperations<String, String> ops = redisTemplate.opsForValue();
-		String key = "etl.river.40516502.up.5min";
-		JSONArray array = new JSONArray();
-		ops.set(key, array.toJSONString());
-		return R.data("ok");
-	}
-
-	@GetMapping("/data/river/1")
-	@ApiOperationSupport(order = 1)
-	public R<String> addriver1() {
-
-		EtlRsvrDataEntity etlRsvrDataEntity = new EtlRsvrDataEntity();
-
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 9);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		etlRsvrDataEntity.setTm(calendar.getTime());
-
-		calendar.set(Calendar.HOUR_OF_DAY, 11);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		etlRsvrDataEntity.setFromDate(calendar.getTime());
-
-		etlRsvrDataEntity.setRtuCode("20911190");
-		etlRsvrDataEntity.setRz(0.05);
-
-
-		kafkaTemplate.send("topic-etl-rsvr-data", JSONObject.toJSONString(etlRsvrDataEntity));
-		return R.data("ok");
-	}
-
-	@GetMapping("/data/river/2")
-	@ApiOperationSupport(order = 1)
-	public R<String> addriver2() {
-		EtlRsvrDataEntity etlRsvrDataEntity = new EtlRsvrDataEntity();
-
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 9);
-		calendar.set(Calendar.MINUTE, 10);
-		calendar.set(Calendar.SECOND, 0);
-		etlRsvrDataEntity.setTm(calendar.getTime());
-
-		calendar.set(Calendar.HOUR_OF_DAY, 12);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-
-		etlRsvrDataEntity.setFromDate(calendar.getTime());
-
-		etlRsvrDataEntity.setRtuCode("01718530");
-		etlRsvrDataEntity.setRz(0.05);
-
-
-		kafkaTemplate.send("topic-etl-rsvr-data", JSONObject.toJSONString(etlRsvrDataEntity));
-		return R.data("ok");
-
-
-	}
-
-	@GetMapping("/data/river/3")
-	@ApiOperationSupport(order = 1)
-	public R<String> addriver3() {
-		EtlRsvrDataEntity etlRsvrDataEntity = new EtlRsvrDataEntity();
-
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 12);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRsvrDataEntity.setTm(calendar.getTime());
-
-		calendar.set(Calendar.MINUTE, 27);
-
-		etlRsvrDataEntity.setFromDate(calendar.getTime());
-
-		etlRsvrDataEntity.setRtuCode("20911190");
-		etlRsvrDataEntity.setRz(0.05);
-
-
-		kafkaTemplate.send("topic-etl-rsvr-data", JSONObject.toJSONString(etlRsvrDataEntity));
-		return R.data("ok");
-
-
-	}
-
-	@GetMapping("/data/river/4")
-	@ApiOperationSupport(order = 1)
-	public R<String> addriver4() {
-		EtlRsvrDataEntity etlRsvrDataEntity = new EtlRsvrDataEntity();
-
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 12);
-		calendar.set(Calendar.MINUTE, 20);
-		calendar.set(Calendar.SECOND, 0);
-		etlRsvrDataEntity.setTm(calendar.getTime());
-
-		calendar.set(Calendar.MINUTE, 35);
-
-		etlRsvrDataEntity.setFromDate(calendar.getTime());
-
-		etlRsvrDataEntity.setRtuCode("20911190");
-		etlRsvrDataEntity.setRz(0.05);
-
-
-		kafkaTemplate.send("topic-etl-rsvr-data", JSONObject.toJSONString(etlRsvrDataEntity));
-		return R.data("ok");
-
-
-	}
-
-	@GetMapping("/data/rain/hour/0")
-	@ApiOperationSupport(order = 1)
-	public R<String> addrainhour0() {
-		String key = "etl.rain.01751310.up.hour";
-
-		ValueOperations<String, String> ops = redisTemplate.opsForValue();
-
-		JSONArray array = new JSONArray();
-		ops.set(key, array.toJSONString());
-		return R.data("ok");
-	}
-
-	@GetMapping("/data/rain/hour")
-	@ApiOperationSupport(order = 1)
-	public R<String> addrainhour() {
-		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.DAY_OF_MONTH, 9);
-		calendar.set(Calendar.HOUR_OF_DAY, 12);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.DAY_OF_MONTH, 9);
-		calendar.set(Calendar.HOUR_OF_DAY, 13);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.DAY_OF_MONTH, 9);
-		calendar.set(Calendar.HOUR_OF_DAY, 13);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-//		 etlRainDataEntity= new EtlRainDataEntity();
-//		 calendar=Calendar.getInstance();
-//		calendar.set(Calendar.DAY_OF_MONTH,9);
-//		calendar.set(Calendar.HOUR_OF_DAY,14);
-//		calendar.set(Calendar.MINUTE,15);
-//		calendar.set(Calendar.SECOND,0);
-//		etlRainDataEntity.setTm(calendar.getTime());
-//		calendar.set(Calendar.MINUTE,27);
-//		etlRainDataEntity.setFromDate(calendar.getTime());
-//		etlRainDataEntity.setRtuCode("01751310");
-//		etlRainDataEntity.setIntv(0.05);
-//		etlRainDataEntity.setDrp(1.0);
-//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-//		 etlRainDataEntity= new EtlRainDataEntity();
-//		 calendar=Calendar.getInstance();
-//		calendar.set(Calendar.DAY_OF_MONTH,9);
-//		calendar.set(Calendar.HOUR_OF_DAY,15);
-//		calendar.set(Calendar.MINUTE,15);
-//		calendar.set(Calendar.SECOND,0);
-//		etlRainDataEntity.setTm(calendar.getTime());
-//		calendar.set(Calendar.MINUTE,27);
-//		etlRainDataEntity.setFromDate(calendar.getTime());
-//		etlRainDataEntity.setRtuCode("01751310");
-//		etlRainDataEntity.setIntv(0.05);
-//		etlRainDataEntity.setDrp(1.0);
-//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-//		 etlRainDataEntity= new EtlRainDataEntity();
-//		 calendar=Calendar.getInstance();
-//		calendar.set(Calendar.DAY_OF_MONTH,9);
-//		calendar.set(Calendar.HOUR_OF_DAY,16);
-//		calendar.set(Calendar.MINUTE,15);
-//		calendar.set(Calendar.SECOND,0);
-//		etlRainDataEntity.setTm(calendar.getTime());
-//		calendar.set(Calendar.MINUTE,27);
-//		etlRainDataEntity.setFromDate(calendar.getTime());
-//		etlRainDataEntity.setRtuCode("01751310");
-//		etlRainDataEntity.setIntv(0.05);
-//		etlRainDataEntity.setDrp(1.0);
-//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.DAY_OF_MONTH, 9);
-		calendar.set(Calendar.HOUR_OF_DAY, 17);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.DAY_OF_MONTH, 9);
-		calendar.set(Calendar.HOUR_OF_DAY, 18);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-//		 etlRainDataEntity= new EtlRainDataEntity();
-//		 calendar=Calendar.getInstance();
-//		calendar.set(Calendar.DAY_OF_MONTH,9);
-//		calendar.set(Calendar.HOUR_OF_DAY,19);
-//		calendar.set(Calendar.MINUTE,15);
-//		calendar.set(Calendar.SECOND,0);
-//		etlRainDataEntity.setTm(calendar.getTime());
-//		calendar.set(Calendar.MINUTE,27);
-//		etlRainDataEntity.setFromDate(calendar.getTime());
-//		etlRainDataEntity.setRtuCode("01751310");
-//		etlRainDataEntity.setIntv(0.05);
-//		etlRainDataEntity.setDrp(1.0);
-//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-//		 etlRainDataEntity= new EtlRainDataEntity();
-//		 calendar=Calendar.getInstance();
-//		calendar.set(Calendar.DAY_OF_MONTH,9);
-//		calendar.set(Calendar.HOUR_OF_DAY,20);
-//		calendar.set(Calendar.MINUTE,15);
-//		calendar.set(Calendar.SECOND,0);
-//		etlRainDataEntity.setTm(calendar.getTime());
-//		calendar.set(Calendar.MINUTE,27);
-//		etlRainDataEntity.setFromDate(calendar.getTime());
-//		etlRainDataEntity.setRtuCode("01751310");
-//		etlRainDataEntity.setIntv(0.05);
-//		etlRainDataEntity.setDrp(1.0);
-//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.DAY_OF_MONTH, 9);
-		calendar.set(Calendar.HOUR_OF_DAY, 21);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.DAY_OF_MONTH, 9);
-		calendar.set(Calendar.HOUR_OF_DAY, 22);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.DAY_OF_MONTH, 9);
-		calendar.set(Calendar.HOUR_OF_DAY, 23);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 0);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 1);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 2);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 3);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 4);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 5);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 6);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 7);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-//		etlRainDataEntity= new EtlRainDataEntity();
-//		calendar=Calendar.getInstance();
-//		calendar.set(Calendar.HOUR_OF_DAY,8);
-//		calendar.set(Calendar.MINUTE,15);
-//		calendar.set(Calendar.SECOND,0);
-//		etlRainDataEntity.setTm(calendar.getTime());
-//		calendar.set(Calendar.MINUTE,27);
-//		etlRainDataEntity.setFromDate(calendar.getTime());
-//		etlRainDataEntity.setRtuCode("01751310");
-//		etlRainDataEntity.setIntv(0.05);
-//		etlRainDataEntity.setDrp(1.0);
-//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 9);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 10);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 11);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 12);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 13);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-//
-//		etlRainDataEntity= new EtlRainDataEntity();
-//		calendar=Calendar.getInstance();
-//		calendar.set(Calendar.HOUR_OF_DAY,14);
-//		calendar.set(Calendar.MINUTE,15);
-//		calendar.set(Calendar.SECOND,0);
-//		etlRainDataEntity.setTm(calendar.getTime());
-//		calendar.set(Calendar.MINUTE,27);
-//		etlRainDataEntity.setFromDate(calendar.getTime());
-//		etlRainDataEntity.setRtuCode("01751310");
-//		etlRainDataEntity.setIntv(0.05);
-//		etlRainDataEntity.setDrp(1.0);
-//		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 15);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 16);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-//
-//
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 17);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 18);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 19);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-
-		etlRainDataEntity = new EtlRainDataEntity();
-		calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 20);
-		calendar.set(Calendar.MINUTE, 15);
-		calendar.set(Calendar.SECOND, 0);
-		etlRainDataEntity.setTm(calendar.getTime());
-		calendar.set(Calendar.MINUTE, 27);
-		etlRainDataEntity.setFromDate(calendar.getTime());
-		etlRainDataEntity.setRtuCode("01751310");
-		etlRainDataEntity.setIntv(0.05);
-		etlRainDataEntity.setDrp(1.0);
-		kafkaTemplate.send("topic-etl-rain-data", JSONObject.toJSONString(etlRainDataEntity));
-
-		return R.data("ok");
-	}
-}

+ 55 - 0
src/main/java/org/springblade/etl/entity/EtlMpDataEntity.java

@@ -0,0 +1,55 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.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/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WR_MP_B")
+public class EtlMpDataEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("监测点代码")
+	private String mpCd;
+
+	@ApiModelProperty("监测点名称")
+	private String mpNm;
+
+	@ApiModelProperty("监测点地址")
+	private String mpAddr;
+
+	@ApiModelProperty("监测项目")
+	private String mpItem;
+
+	@ApiModelProperty("监测类型")
+	private String isAuto;
+
+	@ApiModelProperty("水源类型")
+	private String sourTp;
+
+	@ApiModelProperty("纬度")
+	private String weiDu;
+
+	@ApiModelProperty("经度")
+	private String jingDu;
+
+
+}

+ 40 - 0
src/main/java/org/springblade/etl/entity/EtlRtuDataEntity.java

@@ -0,0 +1,40 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.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:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WR_RTU_B")
+public class EtlRtuDataEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("编码")
+	private String rtuCd;
+
+	@ApiModelProperty("机构")
+	private String orgCode;
+
+}

+ 56 - 0
src/main/java/org/springblade/etl/entity/EtlWiuDataEntity.java

@@ -0,0 +1,56 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.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/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WR_WIU_B")
+public class EtlWiuDataEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("编码")
+	private String wiuCd;
+
+	@ApiModelProperty("名称")
+	private String wiuNm;
+
+	@ApiModelProperty("法人代表")
+	private String lrNm;
+
+	@ApiModelProperty("行业类别")
+	private String tradTp;
+
+	@ApiModelProperty("经济类型")
+	private String ecoTp;
+
+	@ApiModelProperty("监控级别")
+	private String mong;
+
+	@ApiModelProperty("取用类别")
+	private String wiuTp;
+
+	@ApiModelProperty("地址")
+	private String addr;
+
+	@ApiModelProperty("机构")
+	private String orgCode;
+}

+ 36 - 0
src/main/java/org/springblade/etl/entity/EtlWiuWiustDataEntity.java

@@ -0,0 +1,36 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.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/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("REL_WIU_WIUST")
+public class EtlWiuWiustDataEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("用水户")
+	private String wiuCd;
+
+	@ApiModelProperty("测站")
+	private String wiustCd;
+
+}

+ 51 - 0
src/main/java/org/springblade/etl/entity/EtlWiustDataEntity.java

@@ -0,0 +1,51 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.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/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WR_WIUST_B")
+public class EtlWiustDataEntity extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("取用水测站代码")
+    private String wiustCd;
+
+    @ApiModelProperty("取用水测站名称")
+    private String wiustNm;
+
+    @ApiModelProperty("取用水测站类别")
+    private String wiustTp;
+
+    @ApiModelProperty("所在地")
+    private String loc;
+
+    @ApiModelProperty("基面类型")
+    private String datTp;
+
+    @ApiModelProperty("测井类型")
+    private String wellTp;
+
+    @ApiModelProperty("设站年月")
+    private String estStYm;
+
+}

+ 36 - 0
src/main/java/org/springblade/etl/entity/EtlWiustMpDataEntity.java

@@ -0,0 +1,36 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.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/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("REL_WIUST_MP")
+public class EtlWiustMpDataEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("取用水测点代码")
+	private String mpCd;
+
+	@ApiModelProperty("取用水测站代码")
+	private String wiustCd;
+
+}

+ 1 - 1
src/main/java/org/springblade/etl/mapper/EtlAdCdMapper.java

@@ -23,5 +23,5 @@ import java.util.List;
  * Remark:认为有必要的其他信息
  */
 public interface EtlAdCdMapper extends BaseMapper<EtlAdCdEntity> {
-	List<EtlAdCdEntity> selectList(@Param("parentCode") String parentCode);
+	List<EtlAdCdEntity> selectList(@Param("entity") EtlAdCdEntity entity);
 }

+ 7 - 2
src/main/java/org/springblade/etl/mapper/EtlAdCdMapper.xml

@@ -19,8 +19,13 @@
         FROM
         etl_ad_cd_b d
         WHERE 1=1
-        <if test="parentCode!=null">
-            and d.SUPERIORADCD = #{parentCode}
+
+        <if test="entity.adcd!=null">
+            and d.ADCD = #{entity.adcd}
+        </if>
+
+        <if test="entity.superioradcd!=null">
+            and d.SUPERIORADCD = #{entity.superioradcd}
         </if>
 
     </select>

+ 27 - 0
src/main/java/org/springblade/etl/mapper/EtlMpMapper.java

@@ -0,0 +1,27 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/24
+ */
+package org.springblade.etl.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.etl.entity.EtlMpDataEntity;
+import org.springblade.etl.entity.EtlWiustDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/8/24
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface EtlMpMapper extends BaseMapper<EtlMpDataEntity> {
+	List<EtlMpDataEntity> selectList(@Param("entity") EtlMpDataEntity entity);
+}

+ 25 - 0
src/main/java/org/springblade/etl/mapper/EtlMpMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.etl.mapper.EtlMpMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.etl.entity.EtlMpDataEntity">
+        <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="wei_du" property="weiDu"/>
+        <result column="jing_du" property="jingDu"/>
+
+    </resultMap>
+
+    <select id="selectList" resultMap="entityResultMap">
+        SELECT
+        d.MP_CD,d.MP_NM,d.MP_ADDR,d.MP_ITEM,d.IS_AUTO,d.SOUR_TP,d.wei_du,d.jing_du
+        FROM
+        WR_MP_B d
+        WHERE 1=1
+    </select>
+</mapper>

+ 27 - 0
src/main/java/org/springblade/etl/mapper/EtlRtuMapper.java

@@ -0,0 +1,27 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/24
+ */
+package org.springblade.etl.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.etl.entity.EtlAdCdEntity;
+import org.springblade.etl.entity.EtlRtuDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/8/24
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface EtlRtuMapper extends BaseMapper<EtlRtuDataEntity> {
+	List<EtlRtuDataEntity> selectList(@Param("entity") EtlRtuDataEntity entity);
+}

+ 20 - 0
src/main/java/org/springblade/etl/mapper/EtlRtuMapper.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.etl.mapper.EtlRtuMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.etl.entity.EtlRtuDataEntity">
+        <result column="RTU_CD" property="rtuCd"/>
+        <result column="org_code" property="orgCode"/>
+
+
+    </resultMap>
+
+    <select id="selectList" resultMap="entityResultMap">
+        SELECT
+        d.RTU_CD,d.org_code
+        FROM
+        WR_RTU_B d
+        WHERE 1=1
+    </select>
+</mapper>

+ 27 - 0
src/main/java/org/springblade/etl/mapper/EtlWiuMapper.java

@@ -0,0 +1,27 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/24
+ */
+package org.springblade.etl.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.etl.entity.EtlRtuDataEntity;
+import org.springblade.etl.entity.EtlWiuDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/8/24
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface EtlWiuMapper extends BaseMapper<EtlWiuDataEntity> {
+	List<EtlWiuDataEntity> selectList(@Param("entity") EtlWiuDataEntity entity);
+}

+ 27 - 0
src/main/java/org/springblade/etl/mapper/EtlWiuMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.etl.mapper.EtlWiuMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.etl.entity.EtlWiuDataEntity">
+        <result column="WIU_CD" property="wiuCd"/>
+        <result column="WIU_NM" property="wiuNm"/>
+        <result column="LR_NM" property="lrNm"/>
+        <result column="TRAD_TP" property="tradTp"/>
+        <result column="ECO_TP" property="ecoTp"/>
+        <result column="MON_G" property="mong"/>
+        <result column="WIU_TP" property="wiuTp"/>
+        <result column="ADDR" property="addr"/>
+        <result column="org_code" property="orgCode"/>
+
+
+    </resultMap>
+
+    <select id="selectList" resultMap="entityResultMap">
+        SELECT
+        d.WIU_CD,d.WIU_NM,d.LR_NM,d.TRAD_TP,d.ECO_TP,d.MON_G,d.WIU_TP,d.ADDR,d.org_code
+        FROM
+        WR_WIU_B d
+        WHERE 1=1
+    </select>
+</mapper>

+ 27 - 0
src/main/java/org/springblade/etl/mapper/EtlWiuWiustMapper.java

@@ -0,0 +1,27 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/24
+ */
+package org.springblade.etl.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.etl.entity.EtlRtuDataEntity;
+import org.springblade.etl.entity.EtlWiuWiustDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/8/24
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface EtlWiuWiustMapper extends BaseMapper<EtlWiuWiustDataEntity> {
+	List<EtlWiuWiustDataEntity> selectList(@Param("entity") EtlWiuWiustDataEntity entity);
+}

+ 20 - 0
src/main/java/org/springblade/etl/mapper/EtlWiuWiustMapper.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.etl.mapper.EtlWiuWiustMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.etl.entity.EtlWiuWiustDataEntity">
+        <result column="WIUST_CD" property="wiustCd"/>
+        <result column="WIU_CD" property="wiuCd"/>
+
+
+    </resultMap>
+
+    <select id="selectList" resultMap="entityResultMap">
+        SELECT
+        d.WIUST_CD,d.WIU_CD
+        FROM
+        REL_WIU_WIUST d
+        WHERE 1=1
+    </select>
+</mapper>

+ 27 - 0
src/main/java/org/springblade/etl/mapper/EtlWiustMapper.java

@@ -0,0 +1,27 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/24
+ */
+package org.springblade.etl.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.etl.entity.EtlWiuDataEntity;
+import org.springblade.etl.entity.EtlWiustDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/8/24
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface EtlWiustMapper extends BaseMapper<EtlWiustDataEntity> {
+	List<EtlWiustDataEntity> selectList(@Param("entity") EtlWiustDataEntity entity);
+}

+ 25 - 0
src/main/java/org/springblade/etl/mapper/EtlWiustMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.etl.mapper.EtlWiustMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.etl.entity.EtlWiustDataEntity">
+        <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="WELL_TP" property="wellTp"/>
+        <result column="EST_ST_YM" property="estStYm"/>
+
+
+    </resultMap>
+
+    <select id="selectList" resultMap="entityResultMap">
+        SELECT
+        d.WIUST_CD,d.WIUST_NM,d.WIUST_TP,d.LOC,d.DAT_TP,d.WELL_TP,d.EST_ST_YM
+        FROM
+        WR_WIUST_B d
+        WHERE 1=1
+    </select>
+</mapper>

+ 27 - 0
src/main/java/org/springblade/etl/mapper/EtlWiustMpMapper.java

@@ -0,0 +1,27 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/24
+ */
+package org.springblade.etl.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.etl.entity.EtlRtuDataEntity;
+import org.springblade.etl.entity.EtlWiustMpDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/8/24
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface EtlWiustMpMapper extends BaseMapper<EtlWiustMpDataEntity> {
+	List<EtlWiustMpDataEntity> selectList(@Param("entity") EtlWiustMpDataEntity entity);
+}

+ 20 - 0
src/main/java/org/springblade/etl/mapper/EtlWiustMpMapper.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.etl.mapper.EtlWiustMpMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.etl.entity.EtlWiustMpDataEntity">
+        <result column="MP_CD" property="mpCd"/>
+        <result column="WIUST_CD" property="wiustCd"/>
+
+
+    </resultMap>
+
+    <select id="selectList" resultMap="entityResultMap">
+        SELECT
+        d.MP_CD,d.WIUST_CD
+        FROM
+        REL_WIUST_MP d
+        WHERE 1=1
+    </select>
+</mapper>

+ 1 - 1
src/main/java/org/springblade/etl/service/IEtlAdCdService.java

@@ -23,5 +23,5 @@ import java.util.List;
  * Remark:认为有必要的其他信息
  */
 public interface IEtlAdCdService extends BaseService<EtlAdCdEntity> {
-	List<EtlAdCdEntity> selectList(String parentCode);
+	List<EtlAdCdEntity> selectList(EtlAdCdEntity entity);
 }

+ 26 - 0
src/main/java/org/springblade/etl/service/IEtlMpDataService.java

@@ -0,0 +1,26 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.etl.entity.EtlMpDataEntity;
+import org.springblade.etl.entity.EtlWiustDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IEtlMpDataService extends BaseService<EtlMpDataEntity> {
+	List<EtlMpDataEntity> selectList(EtlMpDataEntity entity);
+}

+ 25 - 0
src/main/java/org/springblade/etl/service/IEtlRtuDataService.java

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

+ 26 - 0
src/main/java/org/springblade/etl/service/IEtlWiuDataService.java

@@ -0,0 +1,26 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.etl.entity.EtlRtuDataEntity;
+import org.springblade.etl.entity.EtlWiuDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IEtlWiuDataService extends BaseService<EtlWiuDataEntity> {
+	List<EtlWiuDataEntity> selectList(EtlWiuDataEntity entity);
+}

+ 26 - 0
src/main/java/org/springblade/etl/service/IEtlWiuWiustDataService.java

@@ -0,0 +1,26 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.etl.entity.EtlWiuDataEntity;
+import org.springblade.etl.entity.EtlWiuWiustDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IEtlWiuWiustDataService extends BaseService<EtlWiuWiustDataEntity> {
+	List<EtlWiuWiustDataEntity> selectList(EtlWiuWiustDataEntity entity);
+}

+ 26 - 0
src/main/java/org/springblade/etl/service/IEtlWiustDataService.java

@@ -0,0 +1,26 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.etl.entity.EtlWiuDataEntity;
+import org.springblade.etl.entity.EtlWiustDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IEtlWiustDataService extends BaseService<EtlWiustDataEntity> {
+	List<EtlWiustDataEntity> selectList(EtlWiustDataEntity entity);
+}

+ 26 - 0
src/main/java/org/springblade/etl/service/IEtlWiustMpDataService.java

@@ -0,0 +1,26 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.etl.entity.EtlWiuDataEntity;
+import org.springblade.etl.entity.EtlWiustMpDataEntity;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IEtlWiustMpDataService extends BaseService<EtlWiustMpDataEntity> {
+    List<EtlWiustMpDataEntity> selectList(EtlWiustMpDataEntity entity);
+}

+ 2 - 2
src/main/java/org/springblade/etl/service/impl/EtlAdCdServiceImpl.java

@@ -30,7 +30,7 @@ import java.util.List;
 public class EtlAdCdServiceImpl extends BaseServiceImpl<EtlAdCdMapper, EtlAdCdEntity> implements IEtlAdCdService {
 
 	@Override
-	public List<EtlAdCdEntity> selectList(String parentCode) {
-		return baseMapper.selectList(parentCode);
+	public List<EtlAdCdEntity> selectList(EtlAdCdEntity entity) {
+		return baseMapper.selectList(entity);
 	}
 }

+ 38 - 0
src/main/java/org/springblade/etl/service/impl/EtlMpDatadServiceImpl.java

@@ -0,0 +1,38 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.etl.entity.EtlMpDataEntity;
+import org.springblade.etl.entity.EtlWiustDataEntity;
+import org.springblade.etl.mapper.EtlMpMapper;
+import org.springblade.etl.mapper.EtlWiustMapper;
+import org.springblade.etl.service.IEtlMpDataService;
+import org.springblade.etl.service.IEtlWiustDataService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+@DS("sqlserver_1")
+public class EtlMpDatadServiceImpl extends BaseServiceImpl<EtlMpMapper, EtlMpDataEntity> implements IEtlMpDataService {
+
+    @Override
+    public List<EtlMpDataEntity> selectList(EtlMpDataEntity entity) {
+        return baseMapper.selectList(entity);
+    }
+}

+ 35 - 0
src/main/java/org/springblade/etl/service/impl/EtlRtuDatadServiceImpl.java

@@ -0,0 +1,35 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.etl.entity.EtlRtuDataEntity;
+import org.springblade.etl.mapper.EtlRtuMapper;
+import org.springblade.etl.service.IEtlRtuDataService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+@DS("sqlserver_1")
+public class EtlRtuDatadServiceImpl extends BaseServiceImpl<EtlRtuMapper, EtlRtuDataEntity> implements IEtlRtuDataService {
+
+    @Override
+    public List<EtlRtuDataEntity> selectList(EtlRtuDataEntity entity) {
+        return baseMapper.selectList(entity);
+    }
+}

+ 35 - 0
src/main/java/org/springblade/etl/service/impl/EtlWiuDatadServiceImpl.java

@@ -0,0 +1,35 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.etl.entity.EtlWiuDataEntity;
+import org.springblade.etl.mapper.EtlWiuMapper;
+import org.springblade.etl.service.IEtlWiuDataService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+@DS("sqlserver_1")
+public class EtlWiuDatadServiceImpl extends BaseServiceImpl<EtlWiuMapper, EtlWiuDataEntity> implements IEtlWiuDataService {
+
+    @Override
+    public List<EtlWiuDataEntity> selectList(EtlWiuDataEntity entity) {
+        return baseMapper.selectList(entity);
+    }
+}

+ 38 - 0
src/main/java/org/springblade/etl/service/impl/EtlWiuWiustDatadServiceImpl.java

@@ -0,0 +1,38 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.etl.entity.EtlWiuWiustDataEntity;
+import org.springblade.etl.entity.EtlWiustDataEntity;
+import org.springblade.etl.mapper.EtlWiuWiustMapper;
+import org.springblade.etl.mapper.EtlWiustMapper;
+import org.springblade.etl.service.IEtlWiuWiustDataService;
+import org.springblade.etl.service.IEtlWiustDataService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+@DS("sqlserver_1")
+public class EtlWiuWiustDatadServiceImpl extends BaseServiceImpl<EtlWiuWiustMapper, EtlWiuWiustDataEntity> implements IEtlWiuWiustDataService {
+
+    @Override
+    public List<EtlWiuWiustDataEntity> selectList(EtlWiuWiustDataEntity entity) {
+        return baseMapper.selectList(entity);
+    }
+}

+ 38 - 0
src/main/java/org/springblade/etl/service/impl/EtlWiustDatadServiceImpl.java

@@ -0,0 +1,38 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.etl.entity.EtlWiuDataEntity;
+import org.springblade.etl.entity.EtlWiustDataEntity;
+import org.springblade.etl.mapper.EtlWiuMapper;
+import org.springblade.etl.mapper.EtlWiustMapper;
+import org.springblade.etl.service.IEtlWiuDataService;
+import org.springblade.etl.service.IEtlWiustDataService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+@DS("sqlserver_1")
+public class EtlWiustDatadServiceImpl extends BaseServiceImpl<EtlWiustMapper, EtlWiustDataEntity> implements IEtlWiustDataService {
+
+    @Override
+    public List<EtlWiustDataEntity> selectList(EtlWiustDataEntity entity) {
+        return baseMapper.selectList(entity);
+    }
+}

+ 38 - 0
src/main/java/org/springblade/etl/service/impl/EtlWiustMpDatadServiceImpl.java

@@ -0,0 +1,38 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.etl.entity.EtlWiustDataEntity;
+import org.springblade.etl.entity.EtlWiustMpDataEntity;
+import org.springblade.etl.mapper.EtlWiustMapper;
+import org.springblade.etl.mapper.EtlWiustMpMapper;
+import org.springblade.etl.service.IEtlWiustDataService;
+import org.springblade.etl.service.IEtlWiustMpDataService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+@DS("sqlserver_1")
+public class EtlWiustMpDatadServiceImpl extends BaseServiceImpl<EtlWiustMpMapper, EtlWiustMpDataEntity> implements IEtlWiustMpDataService {
+
+    @Override
+    public List<EtlWiustMpDataEntity> selectList(EtlWiustMpDataEntity entity) {
+        return baseMapper.selectList(entity);
+    }
+}

+ 337 - 0
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
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
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
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(1, 2,
+		0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), publicThreadFactory, new ThreadPoolExecutor.AbortPolicy());
+
+	public void submitTask(FutureTask<Integer> futureTask) {
+		publicThreadPool.execute(futureTask);
+	}
+}

+ 379 - 0
src/main/java/org/springblade/jobtask/TestDataProcessor.java

@@ -0,0 +1,379 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2023/8/4
+ */
+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.glassfish.jersey.internal.guava.ThreadFactoryBuilder;
+import org.springblade.etl.entity.EtlGroundDataEntity;
+import org.springblade.etl.entity.EtlRainDataEntity;
+import org.springblade.etl.entity.EtlRiverDataEntity;
+import org.springblade.etl.entity.EtlRsvrDataEntity;
+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.springframework.beans.factory.annotation.Value;
+import org.springframework.kafka.core.KafkaTemplate;
+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.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.*;
+
+/***
+ * Date:2023/8/4
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+@Component
+@EnableScheduling
+public class TestDataProcessor {
+
+
+	private static ThreadFactory testDataThreadFactory = new ThreadFactoryBuilder().setNameFormat("test-data-task-thread-pool-%d").build();
+	private static ExecutorService testDataThreadPool = new ThreadPoolExecutor(1, 2,
+		0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), testDataThreadFactory, new ThreadPoolExecutor.AbortPolicy());
+
+	@Value("${spring.task-config.test-task}")
+	private boolean testTaskRun;
+
+	@Resource
+	private KafkaTemplate<String, String> kafkaTemplate;
+
+	@Resource
+	private IRtuBaseInfoService rtuBaseInfoService;
+
+	/**
+	 * 测试线程,5分钟执行一次
+	 */
+//	@Scheduled(cron = "5 0/5 * * * * ")
+	public void testMinTask() {
+		try {
+			if (testTaskRun) {
+//				Calendar calendar = Calendar.getInstance();
+//				int min = calendar.get(Calendar.MINUTE);
+//				if (min > 0) {
+//					TestDataTask warningTask = new TestDataTask(new Date());
+//					FutureTask<Integer> futureTask = new FutureTask<>(warningTask);
+//					testDataThreadPool.execute(futureTask);
+//				}
+			}
+		} catch (Exception e) {
+			log.error("{}", e.getMessage());
+		}
+	}
+
+	/**
+	 * 测试线程,1小时执行一次
+	 */
+//	@Scheduled(cron = "10 0 0/1 * * * ")
+	public void testHourTask() {
+		try {
+			if (testTaskRun) {
+//				TestDataHourTask warningTask = new TestDataHourTask(new Date());
+//				FutureTask<Integer> futureTask = new FutureTask<>(warningTask);
+//				testDataThreadPool.execute(futureTask);
+			}
+		} catch (Exception e) {
+			log.error("{}", e.getMessage());
+		}
+	}
+
+	private class TestDataTask implements Callable<Integer> {
+		private Date dt;
+
+		public TestDataTask(Date dt) {
+			this.dt = dt;
+		}
+
+		@Override
+		public Integer call() throws Exception {
+			try {
+				LambdaQueryWrapper<RtuInfoEntity> dataWrapper = Wrappers.<RtuInfoEntity>query().lambda();
+				dataWrapper.eq(RtuInfoEntity::getIsDeleted, 0);
+				List<RtuInfoEntity> list = rtuBaseInfoService.list(dataWrapper);
+				for (RtuInfoEntity entity : list) {
+					//log.info("test data {}", entity.getRtuCode());
+//					if (entity.getRtuCode().equals("01718525") || entity.getRtuCode().equals("01718530") || entity.getRtuCode().equals("01718550") || entity.getRtuCode().equals("01740030")) {
+//						continue;
+//					}
+//					if (entity.getRtuCode().equals("01740040") || entity.getRtuCode().equals("01740110") || entity.getRtuCode().equals("01740150") || entity.getRtuCode().equals("01740160")) {
+//						continue;
+//					}
+
+					if (entity.getIsRain() != null && entity.getIsRain() == 1) {
+						String topic = "topic-etl-rain-data";
+						EtlRainDataEntity lastRainDataEntity = new EtlRainDataEntity();
+						lastRainDataEntity.setRtuCode(entity.getRtuCode());
+
+						lastRainDataEntity.setDrp(1.5);
+						Calendar calendar = Calendar.getInstance();
+						calendar.setTime(dt);
+						calendar.set(Calendar.SECOND, 0);
+						//	lastRainDataEntity.setTm(calendar.getTime());
+//						if (entity.getRtuCode().equals("01740330")) {
+//							calendar.set(Calendar.SECOND, 1);
+//							lastRainDataEntity.setFromDate(calendar.getTime());
+//							calendar.set(Calendar.SECOND, 0);
+//							calendar.add(Calendar.MINUTE, -15);
+//							lastRainDataEntity.setTm(calendar.getTime());
+//						} else if (entity.getRtuCode().equals("40517675")) {
+//							calendar.set(Calendar.SECOND, 1);
+//							lastRainDataEntity.setFromDate(calendar.getTime());
+//							calendar.set(Calendar.SECOND, 0);
+//							calendar.add(Calendar.MINUTE, -20);
+//							lastRainDataEntity.setTm(calendar.getTime());
+//						} else if (entity.getRtuCode().equals("01751240")) {
+//							calendar.set(Calendar.SECOND, 1);
+//							lastRainDataEntity.setFromDate(calendar.getTime());
+//							calendar.set(Calendar.SECOND, 0);
+//							calendar.add(Calendar.MINUTE, -20);
+//							lastRainDataEntity.setTm(calendar.getTime());
+//						} else {
+						lastRainDataEntity.setTm(calendar.getTime());
+						calendar.set(Calendar.SECOND, 1);
+						lastRainDataEntity.setFromDate(calendar.getTime());
+						//}
+//						lastRainDataEntity.setTm(calendar.getTime());
+//						calendar.set(Calendar.SECOND, 1);
+//						lastRainDataEntity.setFromDate(calendar.getTime());
+
+						lastRainDataEntity.setIntv(0.05);
+						//通过KAFKA发送最新一条数据
+						String jsonText = JSONObject.toJSONString(lastRainDataEntity);
+						kafkaTemplate.send(topic, jsonText);
+					}
+					if (entity.getIsRes() != null && entity.getIsRes() == 1) {
+						String topic = "topic-etl-rsvr-data";
+						EtlRsvrDataEntity rsvrDataEntity = new EtlRsvrDataEntity();
+						rsvrDataEntity.setRtuCode(entity.getRtuCode());
+
+						rsvrDataEntity.setRz(15.0);
+						Calendar calendar = Calendar.getInstance();
+						calendar.setTime(dt);
+						calendar.set(Calendar.SECOND, 0);
+
+
+						rsvrDataEntity.setTm(calendar.getTime());
+						calendar.set(Calendar.SECOND, 1);
+						rsvrDataEntity.setFromDate(calendar.getTime());
+
+
+						//通过KAFKA发送最新一条数据
+						String jsonText = JSONObject.toJSONString(rsvrDataEntity);
+						kafkaTemplate.send(topic, jsonText);
+					}
+					if (entity.getIsRiver() != null && entity.getIsRiver() == 1) {
+						String topic = "topic-etl-river-data";
+						EtlRiverDataEntity riverDataEntity = new EtlRiverDataEntity();
+						riverDataEntity.setRtuCode(entity.getRtuCode());
+
+						riverDataEntity.setZ(1.5);
+						Calendar calendar = Calendar.getInstance();
+						calendar.setTime(dt);
+						calendar.set(Calendar.SECOND, 0);
+
+						;
+						riverDataEntity.setTm(calendar.getTime());
+						calendar.set(Calendar.SECOND, 1);
+						riverDataEntity.setFromDate(calendar.getTime());
+
+
+						//通过KAFKA发送最新一条数据
+						String jsonText = JSONObject.toJSONString(riverDataEntity);
+						kafkaTemplate.send(topic, jsonText);
+					}
+				}
+
+			} catch (Exception e) {
+				e.printStackTrace();
+				log.error("测试数据任务异常 {}", e.getMessage());
+			}
+			return 0;
+		}
+	}
+
+
+	private class TestDataHourTask implements Callable<Integer> {
+		private Date dt;
+
+		public TestDataHourTask(Date dt) {
+			this.dt = dt;
+		}
+
+		@Override
+		public Integer call() throws Exception {
+			try {
+				RtuInfoDTO dto = new RtuInfoDTO();
+				List<RtuInfoEntity> list = rtuBaseInfoService.rtuList(dto);
+				for (RtuInfoEntity entity : list) {
+//					if (entity.getRtuCode().equals("01718525") || entity.getRtuCode().equals("01718530") || entity.getRtuCode().equals("01718550") || entity.getRtuCode().equals("01740030")) {
+//						continue;
+//					}
+//					if (entity.getRtuCode().equals("01740040") || entity.getRtuCode().equals("01740110") || entity.getRtuCode().equals("01740150") || entity.getRtuCode().equals("01740160")) {
+//						continue;
+//					}
+//					if (entity.getRtuCode().equals("01717200")) {
+//						log.info("01717200");
+//					}
+					if (entity.getIsRain() != null && entity.getIsRain() == 1) {
+						String topic = "topic-etl-rain-data";
+						EtlRainDataEntity lastRainDataEntity = new EtlRainDataEntity();
+						lastRainDataEntity.setRtuCode(entity.getRtuCode());
+						lastRainDataEntity.setDrp(1.5);
+						Calendar calendar = Calendar.getInstance();
+						calendar.setTime(dt);
+						calendar.set(Calendar.SECOND, 0);
+						calendar.set(Calendar.MINUTE, 0);
+//						if (entity.getRtuCode().equals("40509005")) {
+//							calendar.set(Calendar.SECOND, 1);
+//							lastRainDataEntity.setFromDate(calendar.getTime());
+//
+//
+//							calendar.add(Calendar.HOUR_OF_DAY, -1);
+//							calendar.add(Calendar.MINUTE, -1);
+//							lastRainDataEntity.setTm(calendar.getTime());
+//
+//						} else {
+						lastRainDataEntity.setTm(calendar.getTime());
+						calendar.set(Calendar.SECOND, 1);
+						lastRainDataEntity.setFromDate(calendar.getTime());
+						//}
+						lastRainDataEntity.setIntv(1.0);
+						//通过KAFKA发送最新一条数据
+						String jsonText = JSONObject.toJSONString(lastRainDataEntity);
+						kafkaTemplate.send(topic, jsonText);
+					}
+					if (entity.getIsRes() != null && entity.getIsRes() == 1) {
+						String topic = "topic-etl-rsvr-data";
+						EtlRsvrDataEntity rsvrDataEntity = new EtlRsvrDataEntity();
+						rsvrDataEntity.setRtuCode(entity.getRtuCode());
+						rsvrDataEntity.setRz(15.0);
+						Calendar calendar = Calendar.getInstance();
+						calendar.setTime(dt);
+						calendar.set(Calendar.SECOND, 0);
+						calendar.set(Calendar.MINUTE, 0);
+//						if (entity.getRtuCode().equals("10001001")) {
+//							calendar.set(Calendar.SECOND, 1);
+//							rsvrDataEntity.setFromDate(calendar.getTime());
+//
+//							calendar.add(Calendar.HOUR_OF_DAY, -1);
+//							calendar.add(Calendar.MINUTE, -1);
+//							rsvrDataEntity.setTm(calendar.getTime());
+//
+//						}
+//						 if (entity.getRtuCode().equals("01710140")) {
+//							calendar.set(Calendar.SECOND, 1);
+//							rsvrDataEntity.setFromDate(calendar.getTime());
+//
+//							calendar.add(Calendar.HOUR_OF_DAY, -1);
+//							calendar.add(Calendar.MINUTE, -1);
+//							rsvrDataEntity.setTm(calendar.getTime());
+//
+//
+//						} else {
+						rsvrDataEntity.setTm(calendar.getTime());
+						calendar.set(Calendar.SECOND, 1);
+						rsvrDataEntity.setFromDate(calendar.getTime());
+						//}
+
+						//通过KAFKA发送最新一条数据
+						String jsonText = JSONObject.toJSONString(rsvrDataEntity);
+						kafkaTemplate.send(topic, jsonText);
+					}
+					if (entity.getIsRiver() != null && entity.getIsRiver() == 1) {
+						String topic = "topic-etl-river-data";
+						EtlRiverDataEntity riverDataEntity = new EtlRiverDataEntity();
+						riverDataEntity.setRtuCode(entity.getRtuCode());
+						riverDataEntity.setZ(1.5);
+						Calendar calendar = Calendar.getInstance();
+						calendar.setTime(dt);
+						calendar.set(Calendar.SECOND, 0);
+						calendar.set(Calendar.MINUTE, 0);
+//						if (entity.getRtuCode().equals("11300640")) {
+//							calendar.set(Calendar.SECOND, 1);
+//							riverDataEntity.setFromDate(calendar.getTime());
+//
+//
+//							calendar.add(Calendar.HOUR_OF_DAY, -1);
+//							calendar.add(Calendar.MINUTE, -1);
+//							riverDataEntity.setTm(calendar.getTime());
+//
+//						} else if (entity.getRtuCode().equals("10215700")) {
+//							calendar.set(Calendar.SECOND, 1);
+//							riverDataEntity.setFromDate(calendar.getTime());
+//
+//
+//							calendar.add(Calendar.HOUR_OF_DAY, -1);
+//							calendar.add(Calendar.MINUTE, -1);
+//							riverDataEntity.setTm(calendar.getTime());
+//
+//						} else {
+						riverDataEntity.setTm(calendar.getTime());
+						calendar.set(Calendar.SECOND, 1);
+						riverDataEntity.setFromDate(calendar.getTime());
+						//	}
+
+						//通过KAFKA发送最新一条数据
+						String jsonText = JSONObject.toJSONString(riverDataEntity);
+						kafkaTemplate.send(topic, jsonText);
+					}
+					if (entity.getIsGround() != null && entity.getIsGround() == 1) {
+						String topic = "topic-etl-ground-data";
+						EtlGroundDataEntity groundDataEntity = new EtlGroundDataEntity();
+						groundDataEntity.setRtuCode(entity.getRtuCode());
+						groundDataEntity.setMoco10cm(23.5);
+						groundDataEntity.setMoco20cm(20.5);
+						groundDataEntity.setMoco30cm(12.5);
+						groundDataEntity.setMoco40cm(11.5);
+						groundDataEntity.setMoco50cm(10.5);
+						groundDataEntity.setMoco60cm(3.5);
+						groundDataEntity.setMoco80cm(3.2);
+						groundDataEntity.setMoco100cm(3.0);
+						Calendar calendar = Calendar.getInstance();
+						calendar.setTime(dt);
+						calendar.set(Calendar.SECOND, 0);
+						calendar.set(Calendar.MINUTE, 0);
+//						if (entity.getRtuCode().equals("102A0020")) {
+//							calendar.set(Calendar.SECOND, 1);
+//							groundDataEntity.setFromDate(calendar.getTime());
+//
+//							calendar.add(Calendar.HOUR_OF_DAY, -1);
+//							calendar.add(Calendar.MINUTE, -1);
+//							groundDataEntity.setTm(calendar.getTime());
+//
+//						} else {
+						groundDataEntity.setTm(calendar.getTime());
+						calendar.set(Calendar.SECOND, 1);
+						groundDataEntity.setFromDate(calendar.getTime());
+						//	}
+
+						//通过KAFKA发送最新一条数据
+						String jsonText = JSONObject.toJSONString(groundDataEntity);
+						kafkaTemplate.send(topic, jsonText);
+					}
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+				log.error("测试数据任务异常 {}", e.getMessage());
+			}
+			return 0;
+		}
+	}
+}

+ 416 - 0
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;
+		}
+	}
+}

+ 41 - 0
src/main/java/org/springblade/launch/LauncherServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.launch;
+
+import org.springblade.core.auto.service.AutoService;
+import org.springblade.core.launch.service.LauncherService;
+import org.springblade.core.launch.utils.PropsUtil;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+
+import java.util.Properties;
+
+/**
+ * 启动参数拓展
+ *
+ * @author smallchil
+ */
+@AutoService(LauncherService.class)
+public class LauncherServiceImpl implements LauncherService {
+
+	@Override
+	public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
+		Properties props = System.getProperties();
+		// 通用注册
+		PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "true");
+	}
+
+}

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

@@ -0,0 +1,140 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+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.entity.MonitorPointRelEntity;
+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.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteRelEntity;
+import org.springblade.modules.baseinfo.monitorsite.vo.MonitorSiteInfoVO;
+import org.springblade.modules.baseinfo.monitorsite.wrapper.MonitorSiteWrapper;
+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 (monitorPointService.save(dto)) {
+            MonitorPointRelEntity relEntity = new MonitorPointRelEntity();
+            relEntity.setWiustCd(dto.getWiustCd());
+            relEntity.setMpCd(dto.getMpCd());
+            return R.status(monitorPointRelService.save(relEntity));
+        }
+        return R.status(false);
+    }
+
+    /**
+     * 修改
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "")
+    public R update(@RequestBody MonitorPointInfoEntity dto) {
+        return R.status(monitorPointService.updateById(dto));
+    }
+
+    /**
+     * 新增或修改
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改", notes = "")
+    public R submit(@RequestBody MonitorPointInfoDTO dto) {
+        if (dto.getId() != null) {
+            return R.status(monitorPointService.updateById(dto));
+        } else {
+            if (monitorPointService.save(dto)) {
+                MonitorPointRelEntity relEntity = new MonitorPointRelEntity();
+                relEntity.setWiustCd(dto.getWiustCd());
+                relEntity.setMpCd(dto.getMpCd());
+                return R.status(monitorPointRelService.save(relEntity));
+            }
+        }
+        return R.status(false);
+    }
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "")
+    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+        boolean temp = monitorPointService.deleteLogic(Func.toLongList(ids));
+        return R.status(temp);
+    }
+}

+ 42 - 0
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
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
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
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
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
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
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>

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

@@ -0,0 +1,27 @@
+/**
+ * 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.entity.MonitorPointInfoEntity;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity;
+import org.springblade.modules.baseinfo.monitorpoint.vo.MonitorPointInfoVO;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IMonitorPointRelService extends BaseService<MonitorPointRelEntity> {
+
+
+}

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

@@ -0,0 +1,30 @@
+/**
+ * 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;
+
+import java.util.List;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IMonitorPointService extends BaseService<MonitorPointInfoEntity> {
+    IPage<MonitorPointInfoVO> selectPage(IPage<MonitorPointInfoVO> page, MonitorPointInfoEntity dto);
+
+    long gtMonitorPointCount(MonitorPointInfoDTO dto);
+}

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

@@ -0,0 +1,32 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointInfoEntity;
+import org.springblade.modules.baseinfo.monitorpoint.entity.MonitorPointRelEntity;
+import org.springblade.modules.baseinfo.monitorpoint.mapper.MonitorPointMapper;
+import org.springblade.modules.baseinfo.monitorpoint.mapper.MonitorPointRelMapper;
+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;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class MonitorPointRelServiceImpl extends BaseServiceImpl<MonitorPointRelMapper, MonitorPointRelEntity> implements IMonitorPointRelService {
+
+
+}

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

@@ -0,0 +1,41 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorpoint.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+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.IMonitorPointService;
+import org.springblade.modules.baseinfo.monitorpoint.vo.MonitorPointInfoVO;
+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 MonitorPointServiceImpl extends BaseServiceImpl<MonitorPointMapper, MonitorPointInfoEntity> implements IMonitorPointService {
+    @Override
+    public IPage<MonitorPointInfoVO> selectPage(IPage<MonitorPointInfoVO> page, MonitorPointInfoEntity dto) {
+        return page.setRecords(baseMapper.selectPage(page, dto));
+    }
+
+    @Override
+    public long gtMonitorPointCount(MonitorPointInfoDTO dto) {
+        return baseMapper.gtMonitorPointCount(dto);
+    }
+
+
+}

+ 61 - 0
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
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;
+    }
+}

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

@@ -0,0 +1,182 @@
+/**
+ * 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.vo.MonitorPointInfoVO;
+import org.springblade.modules.baseinfo.monitorpoint.wrapper.MonitorPointWrapper;
+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.system.entity.Dept;
+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;
+
+    /**
+     * 多表联合查询自定义分页
+     */
+    @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 (monitorSiteService.save(dto)) {
+
+            RtuInfoEntity rtuInfoEntity = new RtuInfoEntity();
+            rtuInfoEntity.setRtuCode(dto.getWiustCd());
+            rtuInfoEntity.setRtuName(dto.getWiustNm());
+//            LambdaQueryWrapper<MonitorSiteRelEntity> wrapper = Wrappers.<MonitorSiteRelEntity>query().lambda();
+//            wrapper.eq(MonitorSiteRelEntity::getWiustCd, dto.getWiustCd());
+//            wrapper.last("limit 1");
+//            MonitorSiteRelEntity relEntity = monitorSiteRelService.getOne(wrapper);
+            LambdaQueryWrapper<WaterUseConsumerInfoEntity> wrapper2 = Wrappers.<WaterUseConsumerInfoEntity>query().lambda();
+            wrapper2.eq(WaterUseConsumerInfoEntity::getWiuCd, dto.getWiuCd());
+            wrapper2.last("limit 1");
+            WaterUseConsumerInfoEntity waterUseConsumerInfoEntity = waterUseConsumerService.getOne(wrapper2);
+            rtuInfoEntity.setOrgId(waterUseConsumerInfoEntity.getOrgId());
+            rtuBaseInfoService.save(rtuInfoEntity);
+
+            MonitorSiteRelEntity relEntity = new MonitorSiteRelEntity();
+            relEntity.setWiustCd(dto.getWiustCd());
+            relEntity.setWiuCd(dto.getWiuCd());
+            return R.status(monitorSiteRelService.save(relEntity));
+        }
+        return R.status(false);
+    }
+
+    /**
+     * 修改
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "")
+    public R update(@RequestBody MonitorSiteInfoDTO dto) {
+//        LambdaQueryWrapper<MonitorSiteRelEntity> wrapper = Wrappers.<MonitorSiteRelEntity>query().lambda();
+//        wrapper.eq(MonitorSiteRelEntity::getWiustCd, dto.getWiustCd());
+//        wrapper.last("limit 1");
+//        MonitorSiteRelEntity relEntity = monitorSiteRelService.getOne(wrapper);
+//        relEntity.setWiuCd(dto.getWiuCd());
+//        monitorSiteRelService.updateById(relEntity);
+        return R.status(monitorSiteService.updateById(dto));
+    }
+
+    /**
+     * 新增或修改
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改", notes = "")
+    public R submit(@RequestBody MonitorSiteInfoDTO dto) {
+        if (dto.getId() != null) {
+            return R.status(monitorSiteService.updateById(dto));
+        } else {
+            if (monitorSiteService.save(dto)) {
+                MonitorSiteRelEntity relEntity = new MonitorSiteRelEntity();
+                relEntity.setWiustCd(dto.getWiustCd());
+                relEntity.setWiuCd(dto.getWiuCd());
+                return R.status(monitorSiteRelService.save(relEntity));
+            }
+        }
+        return R.status(false);
+    }
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "")
+    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+        boolean temp = monitorSiteService.deleteLogic(Func.toLongList(ids));
+        return R.status(temp);
+    }
+}

+ 42 - 0
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;
+}

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

@@ -0,0 +1,146 @@
+/**
+ * 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;
+}

+ 62 - 0
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;
+
+}

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

@@ -0,0 +1,32 @@
+/**
+ * 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.monitorpoint.entity.MonitorPointInfoEntity;
+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> {
+    List<MonitorSiteInfoVO> selectPage(IPage<MonitorSiteInfoVO> page, @Param("dto") MonitorSiteInfoEntity dto);
+    List<MonitorSiteInfoEntity> selectAll(@Param("dto") MonitorSiteInfoEntity dto);
+    Long  getMonitorSiteCount(@Param("dto") MonitorSiteInfoDTO dto);
+}

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

@@ -0,0 +1,112 @@
+<?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"/>
+
+    </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="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>
+        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
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
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>

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

@@ -0,0 +1,24 @@
+/**
+ * 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> {
+
+}

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

@@ -0,0 +1,32 @@
+/**
+ * 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.monitorpoint.entity.MonitorPointInfoEntity;
+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 org.springblade.modules.baseinfo.wateruseconsumer.dto.WaterUseConsumerInfoDTO;
+
+import java.util.List;
+
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+public interface IMonitorSiteService extends BaseService<MonitorSiteInfoEntity> {
+    IPage<MonitorSiteInfoVO> selectPage(IPage<MonitorSiteInfoVO> page, MonitorSiteInfoEntity dto);
+    List<MonitorSiteInfoEntity> selectAll(MonitorSiteInfoEntity dto);
+    Long  getMonitorSiteCount(MonitorSiteInfoDTO dto);
+}

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

@@ -0,0 +1,26 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.service.impl;
+
+import org.springblade.core.mp.base.BaseServiceImpl;
+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;
+
+/***
+ * Date:2023/10/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Service
+public class MonitorSiteRelServiceImpl extends BaseServiceImpl<MonitorSiteRelMapper, MonitorSiteRelEntity> implements IMonitorSiteRelService {
+
+}

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

@@ -0,0 +1,44 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.monitorsite.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.baseinfo.monitorsite.dto.MonitorSiteInfoDTO;
+import org.springblade.modules.baseinfo.monitorsite.entity.MonitorSiteInfoEntity;
+import org.springblade.modules.baseinfo.monitorsite.mapper.MonitorSiteMapper;
+import org.springblade.modules.baseinfo.monitorsite.service.IMonitorSiteService;
+import org.springblade.modules.baseinfo.monitorsite.vo.MonitorSiteInfoVO;
+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 MonitorSiteServiceImpl extends BaseServiceImpl<MonitorSiteMapper, MonitorSiteInfoEntity> implements IMonitorSiteService {
+    @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);
+    }
+}

+ 49 - 0
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
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;
+    }
+}

+ 126 - 2
src/main/java/org/springblade/modules/baseinfo/org/controller/BaseInfoOrgController.java → src/main/java/org/springblade/modules/baseinfo/org/controller/BaseOrgController.java

@@ -23,6 +23,7 @@ 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;
@@ -33,6 +34,7 @@ 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;
 
 
@@ -45,10 +47,10 @@ import java.util.List;
  * Remark:认为有必要的其他信息
  */
 @RestController
-@RequestMapping("galaxy-business/baseinfo/org")
+@RequestMapping("galaxy-business/base/org")
 @AllArgsConstructor
 @Api(value = "运维单位管理", tags = "运维单位管理")
-public class BaseInfoOrgController extends BladeController {
+public class BaseOrgController extends BladeController {
 	private final IDeptService deptService;
 	private final IDeptRegionService deptRegionService;
 	private final IBaseInfoRegionService regionService;
@@ -176,4 +178,126 @@ public class BaseInfoOrgController extends BladeController {
 		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);
+		}
+	}
 }

+ 73 - 0
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
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
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
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>

+ 28 - 0
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);
+}

+ 41 - 0
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);
+    }
+
+
+}

+ 12 - 2
src/main/java/org/springblade/modules/baseinfo/org/vo/OrgInfoVO.java

@@ -6,9 +6,12 @@
  */
 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;
 
 /***
@@ -21,7 +24,15 @@ import org.springblade.modules.system.entity.Dept;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-public class OrgInfoVO extends Dept {
+public class OrgInfoVO extends OrgInfoEntity {
+
+
+	/**
+	 * 注册类型
+	 */
+	@ApiModelProperty(value = "注册类型")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer regType;
 
 	/**
 	 * 机构名称
@@ -42,5 +53,4 @@ public class OrgInfoVO extends Dept {
 	@ApiModelProperty(value = "区划名称")
 	private String adnm;
 
-
 }

+ 13 - 4
src/main/java/org/springblade/modules/baseinfo/project/wrapper/ProjectInfoWrapper.java

@@ -1,17 +1,19 @@
 /**
  * Copyright 2019 DH
  * All right reserved.
- * 项目名称: 大恒泰山系统
+ * 项目名称: 运维系统
  * 创建日期:2022/8/22
  */
 package org.springblade.modules.baseinfo.project.wrapper;
 
-import org.springblade.common.cache.DictBizCache;
+
 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;
 
@@ -28,20 +30,27 @@ public class ProjectInfoWrapper extends BaseEntityWrapper<ProjectInfoEntity, Pro
 		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 = DictBizCache.getById(entity.getAgreementId());
+			DictBiz biz = getDictBizService().getById(entity.getAgreementId());
 			if (null != biz){
 				projectInfoVO.setAgreementName(biz.getDictValue());
 			}
 		}
 		if (entity.getPowerTypeId() != null){
-			DictBiz biz = DictBizCache.getById(entity.getPowerTypeId());
+			DictBiz biz = getDictBizService().getById(entity.getPowerTypeId());
 			if (null != biz){
 				projectInfoVO.setPowerTypeName(biz.getDictValue());
 			}

+ 6 - 2
src/main/java/org/springblade/modules/baseinfo/region/controller/BaseInfoRegionController.java

@@ -488,7 +488,9 @@ public class BaseInfoRegionController extends BladeController {
 			updateWrapper.eq(RegionInfoEntity::getIsDeleted, 0);
 			baseInfoRegionService.remove(updateWrapper);
 		}
-		List<EtlAdCdEntity> list = etlAdCdService.selectList("0");
+		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();
@@ -517,7 +519,9 @@ public class BaseInfoRegionController extends BladeController {
 		if (currLevel > level) {
 			return true;
 		}
-		List<EtlAdCdEntity> list = etlAdCdService.selectList(parentCode);
+		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();

+ 15 - 12
src/main/java/org/springblade/modules/baseinfo/rtu/controller/RtuBaseInfoController.java

@@ -13,7 +13,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
-import org.springblade.common.cache.DictBizCache;
 import org.springblade.constant.BusinessConstant;
 import org.springblade.core.boot.ctrl.BladeController;
 
@@ -98,7 +97,7 @@ public class RtuBaseInfoController extends BladeController {
 			rtuInfoDTO.setIsRain(1);
 		} else if (rtuInfoDTO.getRtuKind() != null && "2".equals(rtuInfoDTO.getRtuKind())) {
 			rtuInfoDTO.setIsRiver(1);
-			rtuInfoDTO.setIsRes(1);
+			//rtuInfoDTO.setIsRes(1);
 		} else if (rtuInfoDTO.getRtuKind() != null && "3".equals(rtuInfoDTO.getRtuKind())) {
 			rtuInfoDTO.setIsGround(1);
 		} else if (rtuInfoDTO.getRtuKind() != null && "4".equals(rtuInfoDTO.getRtuKind())) {
@@ -152,7 +151,7 @@ public class RtuBaseInfoController extends BladeController {
 			rtuInfoDTO.setIsRain(1);
 		} else if (rtuInfoDTO.getRtuKind() != null && "2".equals(rtuInfoDTO.getRtuKind())) {
 			rtuInfoDTO.setIsRiver(1);
-			rtuInfoDTO.setIsRes(1);
+			//rtuInfoDTO.setIsRes(1);
 		} else if (rtuInfoDTO.getRtuKind() != null && "3".equals(rtuInfoDTO.getRtuKind())) {
 			rtuInfoDTO.setIsGround(1);
 		} else if (rtuInfoDTO.getRtuKind() != null && "4".equals(rtuInfoDTO.getRtuKind())) {
@@ -273,10 +272,12 @@ public class RtuBaseInfoController extends BladeController {
 				if ("1".equals(kind)) {
 					dto.setIsRain(1);
 				} else if ("2".equals(kind)) {
-					dto.setIsRes(1);
+					dto.setIsRiver(1);
 				} else if ("3".equals(kind)) {
-					dto.setIsGround(1);
+					dto.setIsRes(1);
 				} else if ("4".equals(kind)) {
+					dto.setIsGround(1);
+				} else if ("5".equals(kind)) {
 					dto.setIsVideo(1);
 				}
 			}
@@ -319,10 +320,12 @@ public class RtuBaseInfoController extends BladeController {
 				if ("1".equals(kind)) {
 					dto.setIsRain(1);
 				} else if ("2".equals(kind)) {
-					dto.setIsRes(1);
+					dto.setIsRiver(1);
 				} else if ("3".equals(kind)) {
-					dto.setIsGround(1);
+					dto.setIsRes(1);
 				} else if ("4".equals(kind)) {
+					dto.setIsGround(1);
+				} else if ("5".equals(kind)) {
 					dto.setIsVideo(1);
 				}
 			}
@@ -365,10 +368,12 @@ public class RtuBaseInfoController extends BladeController {
 				if ("1".equals(kind)) {
 					dto.setIsRain(1);
 				} else if ("2".equals(kind)) {
-					dto.setIsRes(1);
+					dto.setIsRiver(1);
 				} else if ("3".equals(kind)) {
-					dto.setIsGround(1);
+					dto.setIsRes(1);
 				} else if ("4".equals(kind)) {
+					dto.setIsGround(1);
+				} else if ("5".equals(kind)) {
 					dto.setIsVideo(1);
 				}
 			}
@@ -399,12 +404,10 @@ public class RtuBaseInfoController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页")
 	public R<List<DictBiz>> dictList(@RequestParam String code) {
-		List<DictBiz> dicts = DictBizCache.getList(code);
-
+		List<DictBiz> dicts = dictBizService.getList(code);
 		return R.data(dicts);
 	}
 
-
 	/**
 	 * 按机构统计测站信息
 	 *

+ 4 - 0
src/main/java/org/springblade/modules/baseinfo/rtu/dto/RtuInfoDTO.java

@@ -6,10 +6,14 @@
  */
 package org.springblade.modules.baseinfo.rtu.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 
 /***

+ 2 - 2
src/main/java/org/springblade/modules/baseinfo/rtu/mapper/RtuInfoMapper.xml

@@ -154,7 +154,7 @@
             and n.is_rain = #{rtuInfoDTO.isRain}
         </if>
         <if test="rtuInfoDTO.isRiver!=null">
-            and n.is_river = #{rtuInfoDTO.isRiver}
+            and (n.is_river = #{rtuInfoDTO.isRiver} or  n.is_res = #{rtuInfoDTO.isRiver})
         </if>
         <if test="rtuInfoDTO.isRes!=null">
             and n.is_res = #{rtuInfoDTO.isRes}
@@ -269,7 +269,7 @@
             and n.is_rain = #{rtuInfoDTO.isRain}
         </if>
         <if test="rtuInfoDTO.isRiver!=null">
-            and n.is_river = #{rtuInfoDTO.isRiver}
+            and (n.is_river = #{rtuInfoDTO.isRiver} or  n.is_res = #{rtuInfoDTO.isRiver})
         </if>
         <if test="rtuInfoDTO.isRes!=null">
             and n.is_res = #{rtuInfoDTO.isRes}

+ 9 - 5
src/main/java/org/springblade/modules/baseinfo/rtu/wrapper/RtuInfoWrapper.java

@@ -65,32 +65,36 @@ public class RtuInfoWrapper extends BaseEntityWrapper<RtuInfoEntity, RtuInfoVO>
 			rtuKindDesc = "雨量站";
 			siteKinds.add("1");
 		}
-		if (entity.getIsRes() != null && entity.getIsRes() == 1) {
+
+		if (entity.getIsRiver() != null && entity.getIsRiver() == 1) {
 			if (rtuKindDesc.length() > 0) {
 				rtuKindDesc += "/";
 			}
 			rtuKindDesc += "水位站";
 			siteKinds.add("2");
-		} else if (entity.getIsRiver() != null && entity.getIsRiver() == 1) {
+		}
+
+		if (entity.getIsRes() != null && entity.getIsRes() == 1) {
 			if (rtuKindDesc.length() > 0) {
 				rtuKindDesc += "/";
 			}
 			rtuKindDesc += "水位站";
-			siteKinds.add("2");
+			siteKinds.add("3");
 		}
+
 		if (entity.getIsGround() != null && entity.getIsGround() == 1) {
 			if (rtuKindDesc.length() > 0) {
 				rtuKindDesc += "/";
 			}
 			rtuKindDesc += "墒情站";
-			siteKinds.add("3");
+			siteKinds.add("4");
 		}
 		if (entity.getIsVideo() != null && entity.getIsVideo() == 1) {
 			if (rtuKindDesc.length() > 0) {
 				rtuKindDesc += "/";
 			}
 			rtuKindDesc += "视频站";
-			siteKinds.add("4");
+			siteKinds.add("5");
 		}
 		entity.setRtuKindDesc(rtuKindDesc);
 		String[] kinds = siteKinds.toArray(new String[siteKinds.size()]);

+ 104 - 0
src/main/java/org/springblade/modules/baseinfo/warn/controller/BaseWarnController.java

@@ -0,0 +1,104 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 运维系统
+ * 创建日期:2022/8/24
+ */
+package org.springblade.modules.baseinfo.warn.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.api.R;
+import org.springblade.modules.baseinfo.warn.entity.BaseWarnSettingEntity;
+import org.springblade.modules.baseinfo.warn.service.IBaseWarnSettingService;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/***
+ * Date:2022/8/24
+ * Title: 预警信息管理模块
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@RestController
+@RequestMapping("galaxy-business/base/warn")
+@RequiredArgsConstructor
+@Api(value = "测站预警管理模块", tags = "测站预警管理模块")
+public class BaseWarnController extends BladeController {
+
+    private final IBaseWarnSettingService warnSettingService;
+
+    @Value("${spring.warn-config.missout}")
+    private Integer missout;
+
+
+    /**
+     * 查询预警配置
+     */
+    @GetMapping("/setting/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "设置详情")
+    public R<BaseWarnSettingEntity> getSettingDetail() {
+        LambdaQueryWrapper<BaseWarnSettingEntity> wrapper = Wrappers.<BaseWarnSettingEntity>query().lambda();
+        wrapper.eq(BaseWarnSettingEntity::getIsDeleted, 0);
+        List<BaseWarnSettingEntity> list = warnSettingService.list(wrapper);
+        if (null != list && list.size() > 0) {
+            return R.data(list.get(0));
+        } else {
+            BaseWarnSettingEntity entity = new BaseWarnSettingEntity();
+            entity.setWarnActive(0);
+            entity.setWarnClockActive(0);
+            entity.setWarnHourUpDelayActive(0);
+            entity.setWarnMinUpDelayActive(0);
+            entity.setWarnOfflineActive(0);
+            entity.setWarnMissOutActive(0);
+            entity.setWarnOutlierValueActive(0);
+            entity.setWarnClockAutoTask(0);
+            entity.setWarnHourUpDelayAutoTask(0);
+            entity.setWarnDelayAutoTask(0);
+            entity.setWarnOfflineAutoTask(0);
+            entity.setWarnMissOutAutoTask(0);
+            entity.setWarnOutlierValueAutoTask(0);
+            entity.setWarnRainDelayHourDuration(10);
+            entity.setWarnRiverDelayMinDuration(10);
+            entity.setWarnRsvrDelayMinDuration(10);
+            entity.setWarnGroundDelayMinDuration(10);
+            entity.setWarnRainDelayHourDuration(120);
+            entity.setWarnRiverDelayHourDuration(120);
+            entity.setWarnRsvrDelayHourDuration(120);
+            entity.setWarnGroundDelayHourDuration(120);
+            entity.setWarnRainOfflineDuration(24);
+            entity.setWarnRiverOfflineDuration(24);
+            entity.setWarnRsvrOfflineDuration(24);
+            entity.setWarnGroundOfflineDuration(24);
+            entity.setWarnMissNum(missout);
+            return R.data(entity);
+        }
+    }
+
+    /**
+     * 提交预警配置
+     */
+    @PostMapping("/setting/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改", notes = "")
+    public R settingSubmit(@RequestBody BaseWarnSettingEntity warnSettingEntity) {
+        if (warnSettingEntity.getId() <= 0L) {
+            warnSettingEntity.setId(null);
+        }
+        warnSettingEntity.setWarnRsvrOfflineDuration(warnSettingEntity.getWarnRiverOfflineDuration());
+        warnSettingEntity.setWarnRsvrDelayHourDuration(warnSettingEntity.getWarnRiverDelayHourDuration());
+        warnSettingEntity.setWarnRsvrDelayMinDuration(warnSettingEntity.getWarnRiverDelayMinDuration());
+        return R.status(warnSettingService.saveOrUpdate(warnSettingEntity));
+    }
+
+}

+ 37 - 3
src/main/java/org/springblade/modules/business/warning/entity/RtuWarnSettingEntity.java → src/main/java/org/springblade/modules/baseinfo/warn/entity/BaseWarnSettingEntity.java

@@ -4,9 +4,11 @@
  * 项目名称: 大恒泰山系统
  * 创建日期:2022/8/24
  */
-package org.springblade.modules.business.warning.entity;
+package org.springblade.modules.baseinfo.warn.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
+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;
@@ -22,8 +24,8 @@ import org.springblade.core.mp.base.BaseEntity;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-@TableName("rtu_warning_setting")
-public class RtuWarnSettingEntity extends BaseEntity {
+@TableName("base_warning_setting")
+public class BaseWarnSettingEntity extends BaseEntity {
 	private static final long serialVersionUID = 1L;
 	/**
 	 * 租户ID
@@ -35,42 +37,49 @@ public class RtuWarnSettingEntity extends BaseEntity {
 	 * 预警总开关,0 关闭,1 打开,默认关闭
 	 */
 	@ApiModelProperty("预警总开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnActive;
 
 	/**
 	 * 时钟预警开关,0 关闭,1 打开,默认关闭
 	 */
 	@ApiModelProperty("时钟预警开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnClockActive;
 
 	/**
 	 * 5分钟上报延时预警开关,0 关闭,1 打开,默认关闭
 	 */
 	@ApiModelProperty("5分钟上报延时预警开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnMinUpDelayActive;
 
 	/**
 	 * 离线预警开关,0 关闭,1 打开,默认关闭
 	 */
 	@ApiModelProperty("离线预警开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnOfflineActive;
 
 	/**
 	 * 漏报预警开关,0 关闭,1 打开,默认关闭
 	 */
 	@ApiModelProperty("漏报预警开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnMissOutActive;
 
 	/**
 	 * 雨量疑似异常值,, 0 关闭,1 打开
 	 */
 	@ApiModelProperty("雨量疑似异常值预警开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnOutlierValueActive;
 
 	/**
 	 * 小时上报延时预警开关,0 关闭,1 打开,默认关闭
 	 */
 	@ApiModelProperty("小时上报延时预警开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnHourUpDelayActive;
 
 
@@ -78,6 +87,7 @@ public class RtuWarnSettingEntity extends BaseEntity {
 	 * 时钟预警是否自动产生任务,0,否,1是,默认 0
 	 */
 	@ApiModelProperty("时钟预警自动产生任务开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnClockAutoTask;
 
 
@@ -85,54 +95,63 @@ public class RtuWarnSettingEntity extends BaseEntity {
 	 * 上报延时预警是否自动产生任务,0,否,1是,默认 0
 		*/
 	@ApiModelProperty("上报延时预警是否自动产生任务开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnDelayAutoTask;
 
 	/**
 	 * 离线预警是否自动产生任务,0,否,1是,默认 0
 	 */
 	@ApiModelProperty("离线预警是否自动产生任务开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnOfflineAutoTask;
 
 	/**
 	 * 漏报预警是否自动产生任务,0,否,1是,默认 0
 	 */
 	@ApiModelProperty("漏报预警是否自动产生任务开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnMissOutAutoTask;
 
 	/**
 	 * 雨量疑似异常值是否自动产生任务,0,否,1是,默认 0
 	 */
 	@ApiModelProperty("雨量疑似异常值是否自动产生任务开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnOutlierValueAutoTask;
 
 	/**
 	 * 小时上报延时预警是否自动产生任务,0,否,1是,默认 0
 	 */
 	@ApiModelProperty("小时上报延时预警是否自动产生任务开关")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnHourUpDelayAutoTask;
 
 	/**
 	 * 5分钟雨情上报延时,单位分钟
 	 */
 	@ApiModelProperty("雨情上报延时时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnRainDelayMinDuration;
 
 	/**
 	 * 5分钟河道水情上报延时,单位分钟
 	 */
 	@ApiModelProperty("河道水情上报延时时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnRiverDelayMinDuration;
 
 	/**
 	 * 5分钟水库水情上报延时,单位分钟
 	 */
 	@ApiModelProperty("水库水情上报延时时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnRsvrDelayMinDuration;
 
 	/**
 	 * 5分钟墒情上报延时,单位分钟
 	 */
 	@ApiModelProperty("墒情上报延时时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnGroundDelayMinDuration;
 
 
@@ -140,47 +159,62 @@ public class RtuWarnSettingEntity extends BaseEntity {
 	 * 小时雨情上报延时,单位分钟
 	 */
 	@ApiModelProperty("小时雨情上报延时时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnRainDelayHourDuration;
 
 	/**
 	 * 小时河道水情上报延时,单位分钟
 	 */
 	@ApiModelProperty("小时河道水情上报延时时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnRiverDelayHourDuration;
 
 	/**
 	 * 小时水库水情上报延时,单位分钟
 	 */
 	@ApiModelProperty("小时水库水情上报延时时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnRsvrDelayHourDuration;
 
 	/**
 	 * 小时墒情上报延时,单位分钟
 	 */
 	@ApiModelProperty("小时墒情上报延时时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnGroundDelayHourDuration;
 
 	/**
 	 * 雨情测站离线时长,单位小时
 	 */
 	@ApiModelProperty("雨情测站离线时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnRainOfflineDuration;
 
 	/**
 	 * 河道水情测站离线时长,单位小时
 	 */
 	@ApiModelProperty("河道水情测站离线时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnRiverOfflineDuration;
 
 	/**
 	 * 水库水情测站离线时长,单位小时
 	 */
 	@ApiModelProperty("水库水情测站离线时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnRsvrOfflineDuration;
 
 	/**
 	 * 墒情测站离线时长,单位小时
 	 */
 	@ApiModelProperty("墒情测站离线时长")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer warnGroundOfflineDuration;
+
+	/**
+	 * 漏报数量阀值
+	 */
+	@ApiModelProperty("漏报数量阀值")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer warnMissNum;
 }

+ 4 - 3
src/main/java/org/springblade/modules/business/warning/mapper/RtuWarnSettingMapper.java → src/main/java/org/springblade/modules/baseinfo/warn/mapper/BaseWarnSettingMapper.java

@@ -4,10 +4,11 @@
  * 项目名称: 大恒泰山系统
  * 创建日期:2023/4/23
  */
-package org.springblade.modules.business.warning.mapper;
+package org.springblade.modules.baseinfo.warn.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.springblade.modules.business.warning.entity.RtuWarnSettingEntity;
+import org.springblade.modules.baseinfo.warn.entity.BaseWarnSettingEntity;
+
 
 
 /***
@@ -18,5 +19,5 @@ import org.springblade.modules.business.warning.entity.RtuWarnSettingEntity;
  * @version 1.0
  * Remark:认为有必要的其他信息
  */
-public interface RtuWarnSettingMapper extends BaseMapper<RtuWarnSettingEntity> {
+public interface BaseWarnSettingMapper extends BaseMapper<BaseWarnSettingEntity> {
 }

+ 4 - 3
src/main/java/org/springblade/modules/business/warning/mapper/RtuWarnSettingMapper.xml → src/main/java/org/springblade/modules/baseinfo/warn/mapper/BaseWarnSettingMapper.xml

@@ -1,10 +1,10 @@
 <?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.business.warning.mapper.RtuWarnSettingMapper">
+<mapper namespace="org.springblade.modules.baseinfo.warn.mapper.BaseWarnSettingMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="rtuWarnSettingEntityResultMap"
-               type="org.springblade.modules.business.warning.entity.RtuWarnSettingEntity">
+    <resultMap id="warnSettingEntityResultMap"
+               type="org.springblade.modules.baseinfo.warn.entity.BaseWarnSettingEntity">
         <result column="warn_active" property="warnActive"/>
         <result column="warn_clock_active" property="warnClockActive"/>
         <result column="warn_min_up_delay_active" property="warnMinUpDelayActive"/>
@@ -30,5 +30,6 @@
         <result column="warn_river_offline_duration" property="warnRiverOfflineDuration"/>
         <result column="warn_rsvr_offline_duration" property="warnRsvrOfflineDuration"/>
         <result column="warn_ground_offline_duration" property="warnGroundOfflineDuration"/>
+        <result column="warn_miss_num" property="warnMissNum"/>
     </resultMap>
 </mapper>

+ 3 - 3
src/main/java/org/springblade/modules/business/warning/service/IRtuWarnSettingService.java → src/main/java/org/springblade/modules/baseinfo/warn/service/IBaseWarnSettingService.java

@@ -4,10 +4,10 @@
  * 项目名称: 大恒泰山系统
  * 创建日期:2023/4/23
  */
-package org.springblade.modules.business.warning.service;
+package org.springblade.modules.baseinfo.warn.service;
 
 import org.springblade.core.mp.base.BaseService;
-import org.springblade.modules.business.warning.entity.RtuWarnSettingEntity;
+import org.springblade.modules.baseinfo.warn.entity.BaseWarnSettingEntity;
 
 
 /***
@@ -18,5 +18,5 @@ import org.springblade.modules.business.warning.entity.RtuWarnSettingEntity;
  * @version 1.0
  * Remark:认为有必要的其他信息
  */
-public interface IRtuWarnSettingService extends BaseService<RtuWarnSettingEntity> {
+public interface IBaseWarnSettingService extends BaseService<BaseWarnSettingEntity> {
 }

+ 5 - 5
src/main/java/org/springblade/modules/business/warning/service/impl/RtuWarnSettingServiceImpl.java → src/main/java/org/springblade/modules/baseinfo/warn/service/impl/BaseWarnSettingServiceImpl.java

@@ -4,13 +4,13 @@
  * 项目名称: 大恒泰山系统
  * 创建日期:2023/4/23
  */
-package org.springblade.modules.business.warning.service.impl;
+package org.springblade.modules.baseinfo.warn.service.impl;
 
 import lombok.extern.slf4j.Slf4j;
 import org.springblade.core.mp.base.BaseServiceImpl;
-import org.springblade.modules.business.warning.entity.RtuWarnSettingEntity;
-import org.springblade.modules.business.warning.mapper.RtuWarnSettingMapper;
-import org.springblade.modules.business.warning.service.IRtuWarnSettingService;
+import org.springblade.modules.baseinfo.warn.entity.BaseWarnSettingEntity;
+import org.springblade.modules.baseinfo.warn.mapper.BaseWarnSettingMapper;
+import org.springblade.modules.baseinfo.warn.service.IBaseWarnSettingService;
 import org.springframework.stereotype.Service;
 
 /***
@@ -23,5 +23,5 @@ import org.springframework.stereotype.Service;
  */
 @Slf4j
 @Service
-public class RtuWarnSettingServiceImpl extends BaseServiceImpl<RtuWarnSettingMapper, RtuWarnSettingEntity> implements IRtuWarnSettingService {
+public class BaseWarnSettingServiceImpl extends BaseServiceImpl<BaseWarnSettingMapper, BaseWarnSettingEntity> implements IBaseWarnSettingService {
 }

+ 126 - 0
src/main/java/org/springblade/modules/baseinfo/wateruseconsumer/controller/WaterUseConsumerController.java

@@ -0,0 +1,126 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/10/19
+ */
+package org.springblade.modules.baseinfo.wateruseconsumer.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+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.wateruseconsumer.entity.WaterUseConsumerInfoEntity;
+import org.springblade.modules.baseinfo.wateruseconsumer.service.IWaterUseConsumerService;
+import org.springblade.modules.baseinfo.wateruseconsumer.vo.WaterUseConsumerInfoVO;
+import org.springblade.modules.baseinfo.wateruseconsumer.wrapper.WaterUseConsumerWrapper;
+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/wateruse")
+@AllArgsConstructor
+@Api(value = "监测点模块", tags = "监测点接口")
+public class WaterUseConsumerController extends BladeController {
+    private final IWaterUseConsumerService waterUseConsumerService;
+
+    /**
+     * 多表联合查询自定义分页
+     */
+    @GetMapping("/page")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wiuCd", value = "用水户代码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "wiuNm", value = "用水户名称", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页")
+    public R<IPage<WaterUseConsumerInfoVO>> page(@ApiIgnore WaterUseConsumerInfoEntity dto, Query query) {
+        IPage<WaterUseConsumerInfoVO> pages = waterUseConsumerService.selectPage(Condition.getPage(query), dto);
+        List<WaterUseConsumerInfoVO> list = pages.getRecords();
+        for (WaterUseConsumerInfoVO vo : list) {
+            WaterUseConsumerWrapper.build().entityVO(vo);
+        }
+        return R.data(pages);
+    }
+
+    @GetMapping("/list")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wiuCd", value = "用水户代码", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "wiuNm", value = "用水户名称", paramType = "query", dataType = "string"),
+    })
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页")
+    public R<List<WaterUseConsumerInfoVO>> list(@ApiIgnore WaterUseConsumerInfoEntity dto) {
+        List<WaterUseConsumerInfoEntity> list = waterUseConsumerService.selectAll(dto);
+        return R.data( WaterUseConsumerWrapper.build().listVO(list));
+    }
+
+    /**
+     * 详情
+     */
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "")
+    public R<WaterUseConsumerInfoVO> detail(WaterUseConsumerInfoEntity entity) {
+        WaterUseConsumerInfoEntity detail = waterUseConsumerService.getOne(Condition.getQueryWrapper(entity));
+        return R.data(WaterUseConsumerWrapper.build().entityVO(detail));
+    }
+
+
+    /**
+     * 新增
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增", notes = "")
+    public R save(@RequestBody WaterUseConsumerInfoEntity dto) {
+        return R.status(waterUseConsumerService.save(dto));
+    }
+
+    /**
+     * 修改
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "")
+    public R update(@RequestBody WaterUseConsumerInfoEntity dto) {
+        return R.status(waterUseConsumerService.updateById(dto));
+    }
+
+    /**
+     * 新增或修改
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改", notes = "")
+    public R submit(@RequestBody WaterUseConsumerInfoEntity dto) {
+        return R.status(waterUseConsumerService.saveOrUpdate(dto));
+    }
+
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "")
+    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+        boolean temp = waterUseConsumerService.deleteLogic(Func.toLongList(ids));
+        return R.status(temp);
+    }
+}

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů