소스 검색

内蒙山洪灾害运维系统版本提交1.0.15

dylan 3 년 전
부모
커밋
59ec89d7b0
71개의 변경된 파일4289개의 추가작업 그리고 671개의 파일을 삭제
  1. 25 20
      pom.xml
  2. 30 137
      src/main/java/org/springblade/etl/controller/TestController.java
  3. 2 0
      src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptRegionMapper.java
  4. 9 0
      src/main/java/org/springblade/modules/baseinfo/org/mapper/DeptRegionMapper.xml
  5. 1 0
      src/main/java/org/springblade/modules/baseinfo/org/service/IDeptRegionService.java
  6. 4 0
      src/main/java/org/springblade/modules/baseinfo/org/service/impl/DeptRegionServiceImpl.java
  7. 2 1
      src/main/java/org/springblade/modules/baseinfo/rtu/controller/RtuBaseInfoController.java
  8. 4 0
      src/main/java/org/springblade/modules/baseinfo/rtu/mapper/RtuInfoMapper.java
  9. 42 0
      src/main/java/org/springblade/modules/baseinfo/rtu/mapper/RtuInfoMapper.xml
  10. 5 0
      src/main/java/org/springblade/modules/baseinfo/rtu/service/IRtuBaseInfoService.java
  11. 15 0
      src/main/java/org/springblade/modules/baseinfo/rtu/service/impl/RtuBaseInfoServiceImpl.java
  12. 48 6
      src/main/java/org/springblade/modules/business/check/order/controller/RtuCheckOrderController.java
  13. 12 0
      src/main/java/org/springblade/modules/business/check/order/dto/CheckOrderInfoDTO.java
  14. 9 0
      src/main/java/org/springblade/modules/business/check/order/mapper/RtuCheckOrderMapper.java
  15. 83 8
      src/main/java/org/springblade/modules/business/check/order/mapper/RtuCheckOrderMapper.xml
  16. 10 0
      src/main/java/org/springblade/modules/business/check/order/service/IRtuCheckOrderService.java
  17. 27 7
      src/main/java/org/springblade/modules/business/check/order/service/impl/RtuCheckOrderServiceImpl.java
  18. 136 0
      src/main/java/org/springblade/modules/business/check/order/vo/CheckOrderHistroyVO.java
  19. 3 0
      src/main/java/org/springblade/modules/business/check/order/vo/CheckOrderInfoVO.java
  20. 50 12
      src/main/java/org/springblade/modules/business/check/order/wrapper/RtuCheckOrderWrapper.java
  21. 35 0
      src/main/java/org/springblade/modules/business/data/dto/RtuDataGroundDTO.java
  22. 36 1
      src/main/java/org/springblade/modules/business/data/dto/RtuDataRainDTO.java
  23. 36 0
      src/main/java/org/springblade/modules/business/data/dto/RtuDataRiverDTO.java
  24. 2 0
      src/main/java/org/springblade/modules/business/data/mapper/RtuDataGroundMapper.java
  25. 39 0
      src/main/java/org/springblade/modules/business/data/mapper/RtuDataGroundMapper.xml
  26. 3 0
      src/main/java/org/springblade/modules/business/data/mapper/RtuDataRainMapper.java
  27. 45 0
      src/main/java/org/springblade/modules/business/data/mapper/RtuDataRainMapper.xml
  28. 2 0
      src/main/java/org/springblade/modules/business/data/mapper/RtuDataRiverMapper.java
  29. 45 3
      src/main/java/org/springblade/modules/business/data/mapper/RtuDataRiverMapper.xml
  30. 2 0
      src/main/java/org/springblade/modules/business/data/service/IRtuDataGroundService.java
  31. 6 0
      src/main/java/org/springblade/modules/business/data/service/IRtuDataRainService.java
  32. 5 0
      src/main/java/org/springblade/modules/business/data/service/IRtuDataRiverService.java
  33. 5 0
      src/main/java/org/springblade/modules/business/data/service/impl/RtuDataGroundServiceImpl.java
  34. 5 0
      src/main/java/org/springblade/modules/business/data/service/impl/RtuDataRainServiceImpl.java
  35. 5 0
      src/main/java/org/springblade/modules/business/data/service/impl/RtuDataRiverServiceImpl.java
  36. 7 5
      src/main/java/org/springblade/modules/business/equipment/inspection/base/controller/EquipmentInspectionController.java
  37. 3 2
      src/main/java/org/springblade/modules/business/equipment/inspection/base/mapper/EquipmentInspectionMapper.xml
  38. 59 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/vo/EquipmentInspectionInfoVO.java
  39. 90 1
      src/main/java/org/springblade/modules/business/equipment/inspection/base/wrapper/EquipmentInspectionWrapper.java
  40. 24 0
      src/main/java/org/springblade/modules/business/home/Entity/WarnCountInfoEntity.java
  41. 9 0
      src/main/java/org/springblade/modules/business/home/VO/HomeInfoVO.java
  42. 54 0
      src/main/java/org/springblade/modules/business/home/VO/RtuCheckOrderCountInfoVO.java
  43. 70 0
      src/main/java/org/springblade/modules/business/home/VO/RtuInspectionReportCountInfoVO.java
  44. 37 0
      src/main/java/org/springblade/modules/business/home/VO/RtuStatusCountInfoVO.java
  45. 46 0
      src/main/java/org/springblade/modules/business/home/VO/RtuUpDataCountInfoVO.java
  46. 67 0
      src/main/java/org/springblade/modules/business/home/VO/WarnCountInfoVO.java
  47. 80 0
      src/main/java/org/springblade/modules/business/home/VO/WarnKindCountInfoVO.java
  48. 448 7
      src/main/java/org/springblade/modules/business/home/controller/HomeController.java
  49. 10 10
      src/main/java/org/springblade/modules/business/rtumanage/controller/RtuManageController.java
  50. 1 2
      src/main/java/org/springblade/modules/business/rtumanage/mapper/RtuManageMapper.xml
  51. 1 1
      src/main/java/org/springblade/modules/business/rtumanage/wrapper/RtuManageWrapper.java
  52. 385 11
      src/main/java/org/springblade/modules/business/warning/controller/RtuWarningController.java
  53. 3 1
      src/main/java/org/springblade/modules/business/warning/dto/RtuWarningInfoDTO.java
  54. 18 2
      src/main/java/org/springblade/modules/business/warning/entity/RtuWarningInfoEntity.java
  55. 58 0
      src/main/java/org/springblade/modules/business/warning/mapper/RtuWarningMapper.java
  56. 394 0
      src/main/java/org/springblade/modules/business/warning/mapper/RtuWarningMapper.xml
  57. 75 4
      src/main/java/org/springblade/modules/business/warning/service/IRtuWarningService.java
  58. 334 289
      src/main/java/org/springblade/modules/business/warning/service/impl/RtuWarningServiceImpl.java
  59. 15 1
      src/main/java/org/springblade/modules/manage/version/controller/VersionManageController.java
  60. 30 0
      src/main/java/org/springblade/modules/report/WeekReport.java
  61. 1045 0
      src/main/java/org/springblade/modules/report/WeekReportBean.java
  62. 63 107
      src/main/java/org/springblade/mq/kafka/handler/MessageHandler.java
  63. 29 10
      src/main/java/org/springblade/task/RtuImportTask.java
  64. 8 3
      src/main/java/org/springblade/task/SurfDataProcessTask.java
  65. 14 6
      src/main/java/org/springblade/task/TaskManager.java
  66. 2 0
      src/main/java/org/springblade/task/WarningCheckTask.java
  67. 4 3
      src/main/resources/application-dev.yml
  68. 11 9
      src/main/resources/application-test.yml
  69. 2 2
      src/main/resources/application.yml
  70. 2 0
      src/main/resources/log/logback-prod.xml
  71. 3 0
      src/main/resources/log/logback-test.xml

+ 25 - 20
pom.xml

@@ -98,6 +98,7 @@
                 </exclusion>
             </exclusions>
         </dependency>
+
         <!--<dependency>-->
         <!--<groupId>org.springblade</groupId>-->
         <!--<artifactId>BladeX-Boot-Flow</artifactId>-->
@@ -141,6 +142,10 @@
             <groupId>org.springblade</groupId>
             <artifactId>blade-starter-oss</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-starter-report</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.glassfish.jersey.core</groupId>
             <artifactId>jersey-common</artifactId>
@@ -167,26 +172,26 @@
             <artifactId>easyexcel-support</artifactId>
             <version>${revision}</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi</artifactId>
-            <version>4.1.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-ooxml</artifactId>
-            <version>4.1.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-ooxml-schemas</artifactId>
-            <version>4.1.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>ooxml-schemas</artifactId>
-            <version>1.4</version>
-        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.apache.poi</groupId>-->
+            <!--<artifactId>poi</artifactId>-->
+            <!--<version>4.1.2</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.poi</groupId>-->
+            <!--<artifactId>poi-ooxml</artifactId>-->
+            <!--<version>4.1.2</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.poi</groupId>-->
+            <!--<artifactId>poi-ooxml-schemas</artifactId>-->
+            <!--<version>4.1.2</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.poi</groupId>-->
+            <!--<artifactId>ooxml-schemas</artifactId>-->
+            <!--<version>1.4</version>-->
+        <!--</dependency>-->
         <!-- 二维码生成 -->
         <dependency>
             <groupId>com.google.zxing</groupId>

+ 30 - 137
src/main/java/org/springblade/etl/controller/TestController.java

@@ -78,11 +78,10 @@ public class TestController extends BladeController {
 			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()));
+			///	ImmutableList<Variable> variables = netcdfFile.getVariables();
+			//	surfDataProcessTask.submit(filename,Func.formatDateTime(new Date()));
 
 //			log.info("***************************");
 //			log.info("{}",	netcdfFile.getFileTypeId());
@@ -101,7 +100,7 @@ public class TestController extends BladeController {
 //				log.info("Attribute {},{},{}",a.getName(),a.getStringValue(),a.getDataType().toString());
 //			}
 
-		//	List<String> lons = new LinkedList<>();
+			//	List<String> lons = new LinkedList<>();
 //			List<String> lats = new LinkedList<>();
 //			List<String> times = new LinkedList<>();
 //
@@ -189,123 +188,34 @@ public class TestController extends BladeController {
 	@GetMapping("/data/rain/1")
 	@ApiOperationSupport(order = 1)
 	public R<String> addRain1() {
-
-	//	surfDataProcessTask.submitTask("Z_SURF_C_BABJ_20230517080534_P_CMPA_RT_BEHT_0P01_HOR-PRE-2023051708.GRB2");
-//		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-//
-//		Calendar calendar = Calendar.getInstance();
-//		calendar.set(Calendar.HOUR_OF_DAY, 12);
-//		calendar.set(Calendar.MINUTE, 0);
-//		calendar.set(Calendar.SECOND, 0);
-//		etlRainDataEntity.setTm(calendar.getTime());
-//
-//		calendar.set(Calendar.MINUTE, 11);
-//
-//		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 etlRainDataEntity=new EtlRainDataEntity();
-//		etlRainDataEntity.setRtuCode("01751300");
-//		etlRainDataEntity.setIntv(1.0);
-//		etlRainDataEntity.setDrp(2.0);
-//		etlRainDataEntity.setTm(new Date());
-//		etlRainDataEntity.setFromDate(new Date());
-
-		//rtuWarningService.checkRtuOutlierValueStatus(etlRainDataEntity);
+		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() {
-		//	try {
-
-		//101.851139
-		//39.044694
-		//surf left top  0.0 39.039997  101.85
-		//surf left bottom  0.0 39.039997  101.86
-		//surf right top  0.0 39.05  101.85
-		//surf right bottom  0.0 39.05  101.86
-
-
-		String rtuCode = "01751300";
-
-		ValueOperations<String, String> ops = redisTemplate.opsForValue();
-		String key = rtuCode + ".surf.lefttop.value";
-		String value1 = ops.get(key);
-		key = rtuCode + ".surf.lefttop.lon";
-		String ltLon = ops.get(key);
-		key = rtuCode + ".surf.lefttop.lat";
-		String ltLat = ops.get(key);
-
-		key = rtuCode + ".surf.leftbottom.value";
-		String value2 = ops.get(key);
-		key = rtuCode + ".surf.leftbottom.lon";
-		String lbLon = ops.get(key);
-		key = rtuCode + ".surf.leftbottom.lat";
-		String lbLat = ops.get(key);
-
-		key = rtuCode + ".surf.righttop.value";
-		String value3 = ops.get(key);
-		key = rtuCode + ".surf.righttop.lon";
-		String rtLon = ops.get(key);
-		key = rtuCode + ".surf.righttop.lat";
-		String rtLat = ops.get(key);
-
-		key = rtuCode + ".surf.rightbottom.value";
-		String value4 = ops.get(key);
-		key = rtuCode + ".surf.rightbottom.lon";
-		String rbLon = ops.get(key);
-		key = rtuCode + ".surf.rightbottom.lat";
-		String rbLat = ops.get(key);
-
-		if (null != value1 && null != value2 && null != value3 && null != value4) {
-			float count = Func.toFloat(value1) + Func.toFloat(value2) + Func.toFloat(value3) + Func.toFloat(value4);
-			count = count / 4;
-			log.info("测站编码{} 纬度 {} 经度{}",rtuCode,39.044694,101.851139);
-			log.info("网格左上角 值  {} 纬度 {} 经度 {} ",value1,ltLat,ltLon);
-			log.info("网格左下角 值  {} 纬度 {} 经度 {} ",value2,lbLat,lbLon);
-			log.info("网格右上角 值  {} 纬度 {} 经度 {} ",value3,rtLat,rtLon);
-			log.info("网格右下角 值  {} 纬度 {} 经度 {} ",value4,rbLat,rbLon);
-
-			log.info("网格内降雨平均值 {}",count);
-
-		}else{
-			log.info("no surf info");
-		}
-
-
-		//surfDataProcessTask.getSurfValue("94.65","34.899998");
-//		} catch (RocksDBException e) {
-//			e.printStackTrace();
-//		} catch (IOException e) {
-//			e.printStackTrace();
-//		} catch (ClassNotFoundException e) {
-//			e.printStackTrace();
-//		}
-//		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-//
-//		Calendar calendar = Calendar.getInstance();
-//		calendar.set(Calendar.HOUR_OF_DAY, 12);
-//		calendar.set(Calendar.MINUTE, 5);
-//		calendar.set(Calendar.SECOND, 0);
-//		etlRainDataEntity.setTm(calendar.getTime());
-//
-//		calendar.set(Calendar.MINUTE, 5);
-//
-//		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 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");
 	}
 
@@ -313,21 +223,15 @@ public class TestController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	public R<String> addRain3() {
 		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-
 		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 14);
+		calendar.set(Calendar.HOUR_OF_DAY, 3);
 		calendar.set(Calendar.MINUTE, 0);
 		calendar.set(Calendar.SECOND, 0);
 		etlRainDataEntity.setTm(calendar.getTime());
-
-	//	calendar.set(Calendar.MINUTE, 22);
-
 		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");
 	}
@@ -336,17 +240,12 @@ public class TestController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	public R<String> addRain4() {
 		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-
 		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 12);
-		calendar.set(Calendar.MINUTE, 15);
+		calendar.set(Calendar.HOUR_OF_DAY, 4);
+		calendar.set(Calendar.MINUTE, 0);
 		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);
@@ -359,21 +258,15 @@ public class TestController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	public R<String> addRain5() {
 		EtlRainDataEntity etlRainDataEntity = new EtlRainDataEntity();
-
 		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.HOUR_OF_DAY, 12);
-		calendar.set(Calendar.MINUTE, 15);
+		calendar.set(Calendar.HOUR_OF_DAY, 5);
+		calendar.set(Calendar.MINUTE, 0);
 		calendar.set(Calendar.SECOND, 0);
 		etlRainDataEntity.setTm(calendar.getTime());
-
-		calendar.set(Calendar.MINUTE, 27);
-
 		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");
 	}

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

@@ -7,6 +7,7 @@
 package org.springblade.modules.baseinfo.org.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
 
 /***
@@ -18,4 +19,5 @@ import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
  * Remark:认为有必要的其他信息
  */
 public interface DeptRegionMapper extends BaseMapper<DeptRegionEntity> {
+	DeptRegionEntity getRegionByDeptId(@Param("deptId") Long deptId);
 }

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

@@ -8,4 +8,13 @@
         <result column="adcd" property="adcd"/>
     </resultMap>
 
+    <select id="getRegionByDeptId" resultMap="baseinfoOrgResultMap">
+        SELECT
+        n.*
+        FROM
+        blade_dept_region n
+        WHERE
+        n.is_deleted = 0 and n.dept_id = #{deptId}
+        order by n.update_time desc limit 1
+    </select>
 </mapper>

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

@@ -18,4 +18,5 @@ import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
  * Remark:认为有必要的其他信息
  */
 public interface IDeptRegionService extends BaseService<DeptRegionEntity> {
+	DeptRegionEntity getRegionByDeptId(Long deptId);
 }

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

@@ -22,4 +22,8 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class DeptRegionServiceImpl  extends BaseServiceImpl<DeptRegionMapper, DeptRegionEntity> implements IDeptRegionService {
+	@Override
+	public DeptRegionEntity getRegionByDeptId(Long deptId) {
+		return this.baseMapper.getRegionByDeptId(deptId);
+	}
 }

+ 2 - 1
src/main/java/org/springblade/modules/baseinfo/rtu/controller/RtuBaseInfoController.java

@@ -324,7 +324,8 @@ public class RtuBaseInfoController extends BladeController {
 			rtuStatisticsInfoVO.setRtuCount(rtus);
 
 			RtuWarningInfoDTO rtuWarningInfoDTO = new RtuWarningInfoDTO();
-			rtuWarningInfoDTO.setOrgId(dept.getId());
+			rtuWarningInfoDTO.setDeptId(dept.getId());
+
 			Long warningRtus = rtuWarningService.warningRtuCount(rtuWarningInfoDTO);
 			rtuStatisticsInfoVO.setWarningRtuCount(warningRtus);
 

+ 4 - 0
src/main/java/org/springblade/modules/baseinfo/rtu/mapper/RtuInfoMapper.java

@@ -34,6 +34,10 @@ public interface RtuInfoMapper extends BaseMapper<RtuInfoEntity> {
 
 	Long rtuCount(@Param("adCode") String adCode);
 
+	Long rtuRainCount(@Param("adCode") String adCode);
+	Long rtuRiverCount(@Param("adCode") String adCode);
+	Long rtuGroundCount(@Param("adCode") String adCode);
+
 	List<RtuInfoEntity> rtuList(@Param("rtuInfoDTO") RtuInfoDTO rtuInfoDTO);
 
 	List<RtuInfoVO> getAdcd(@Param("rtuCode") String rtuCode);

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

@@ -180,6 +180,48 @@
         </if>
     </select>
 
+    <select id="rtuRainCount" resultType="java.lang.Long">
+        SELECT
+        count(n.rtu_code)
+        FROM
+        rtu_info n
+        LEFT JOIN data_ad_cd_b a ON a.adcd = n.ad_code and a.is_deleted=0
+        WHERE
+        n.is_deleted = 0 and n.is_rain = 1
+        <if test="adCode!=null">
+            and (n.ad_code =#{adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors like
+            concat(concat('%', #{adCode}), '%')))
+        </if>
+    </select>
+
+    <select id="rtuRiverCount" resultType="java.lang.Long">
+        SELECT
+        count(n.rtu_code)
+        FROM
+        rtu_info n
+        LEFT JOIN data_ad_cd_b a ON a.adcd = n.ad_code and a.is_deleted=0
+        WHERE
+        n.is_deleted = 0 and (n.is_river = 1 or n.is_res = 1)
+        <if test="adCode!=null">
+            and (n.ad_code =#{adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors like
+            concat(concat('%', #{adCode}), '%')))
+        </if>
+    </select>
+
+    <select id="rtuGroundCount" resultType="java.lang.Long">
+        SELECT
+        count(n.rtu_code)
+        FROM
+        rtu_info n
+        LEFT JOIN data_ad_cd_b a ON a.adcd = n.ad_code and a.is_deleted=0
+        WHERE
+        n.is_deleted = 0 and n.is_ground = 1
+        <if test="adCode!=null">
+            and (n.ad_code =#{adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors like
+            concat(concat('%', #{adCode}), '%')))
+        </if>
+    </select>
+
     <select id="getAdcd" resultMap="rtuInfoVOResultMap">
         SELECT
         n.*,a.adcd ,a.adnm

+ 5 - 0
src/main/java/org/springblade/modules/baseinfo/rtu/service/IRtuBaseInfoService.java

@@ -34,6 +34,11 @@ public interface IRtuBaseInfoService extends BaseService<RtuInfoEntity> {
 	RtuInfoEntity rtuInfoByRtuCode(String rtuCode);
 
 	Long rtuCount(String adCode);
+
+	Long rtuRainCount(String adCode);
+	Long rtuRiverCount(String adCode);
+	Long rtuGroundCount(String adCode);
+
 	List<RtuInfoEntity> rtuList(RtuInfoDTO rtuInfoDTO);
 
 	RtuInfoEntity getAdcd(RtuInfoEntity rtuInfoEntity);

+ 15 - 0
src/main/java/org/springblade/modules/baseinfo/rtu/service/impl/RtuBaseInfoServiceImpl.java

@@ -63,6 +63,21 @@ public class RtuBaseInfoServiceImpl extends BaseServiceImpl<RtuInfoMapper, RtuIn
 		return baseMapper.rtuCount(adCode);
 	}
 
+	@Override
+	public Long rtuRainCount(String adCode) {
+		return this.baseMapper.rtuRainCount(adCode);
+	}
+
+	@Override
+	public Long rtuRiverCount(String adCode) {
+		return this.baseMapper.rtuRiverCount(adCode);
+	}
+
+	@Override
+	public Long rtuGroundCount(String adCode) {
+		return this.baseMapper.rtuGroundCount(adCode);
+	}
+
 	@Override
 	public List<RtuInfoEntity> rtuList(RtuInfoDTO rtuInfoDTO) {
        return baseMapper.rtuList(rtuInfoDTO);

+ 48 - 6
src/main/java/org/springblade/modules/business/check/order/controller/RtuCheckOrderController.java

@@ -34,6 +34,7 @@ import org.springblade.modules.business.check.order.entity.CheckOrderSettingEnti
 import org.springblade.modules.business.check.order.service.ICheckOrderSettingService;
 import org.springblade.modules.business.check.order.service.IRtuCheckOrderService;
 import org.springblade.modules.business.check.order.vo.CheckOrderCountVO;
+import org.springblade.modules.business.check.order.vo.CheckOrderHistroyVO;
 import org.springblade.modules.business.check.order.vo.CheckOrderInfoVO;
 import org.springblade.modules.business.check.order.vo.OrgCheckOrderCountVO;
 import org.springblade.modules.business.check.order.wrapper.RtuCheckOrderWrapper;
@@ -127,20 +128,20 @@ public class RtuCheckOrderController extends BladeController {
 					checkOrderInfoDTO.setAdCode(deptRegionEntity.getAdcd());
 				}
 			}
-			 if (BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
-			     if(checkOrderInfoDTO.getOrderConfirm()!=null&&checkOrderInfoDTO.getOrderConfirm()==1 ){
-					 checkOrderInfoDTO.setContactUser(user.getUserId());
-				 }
+			if (BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				if (checkOrderInfoDTO.getOrderConfirm() != null && checkOrderInfoDTO.getOrderConfirm() == 1) {
+					checkOrderInfoDTO.setContactUser(user.getUserId());
+				}
 			}
 		}
-		if (checkOrderInfoDTO.getWarnKind()!=null){
+		if (checkOrderInfoDTO.getWarnKind() != null) {
 			IPage<CheckOrderInfoVO> pages = rtuCheckOrderService.selectWarnPage(Condition.getPage(query), checkOrderInfoDTO);
 			List<CheckOrderInfoVO> list = pages.getRecords();
 			for (CheckOrderInfoVO v : list) {
 				RtuCheckOrderWrapper.build().entityVO(v);
 			}
 			return R.data(pages);
-		}else{
+		} else {
 			IPage<CheckOrderInfoVO> pages = rtuCheckOrderService.selectPage(Condition.getPage(query), checkOrderInfoDTO);
 			List<CheckOrderInfoVO> list = pages.getRecords();
 			for (CheckOrderInfoVO v : list) {
@@ -248,6 +249,45 @@ public class RtuCheckOrderController extends BladeController {
 		return R.data(pages);
 	}
 
+
+	/**
+	 * 按页查询维修任务历史信息
+	 * @param checkOrderInfoDTO
+	 * @param query
+	 * @return
+	 */
+	@GetMapping("/histroy/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "adCode", value = "行政区划编码", paramType = "query", dataType = "string"),
+	})
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入实体类CheckOrderInfoDTO")
+	public R<IPage<CheckOrderHistroyVO>> histroyPage(@ApiIgnore CheckOrderInfoDTO checkOrderInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			if (checkOrderInfoDTO.getAdCode() == null) {
+				checkOrderInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			}
+		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+			if (checkOrderInfoDTO.getAdCode() == null) {
+				LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+				deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+				DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+				checkOrderInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<CheckOrderHistroyVO> pages = rtuCheckOrderService.selectHistoryPage(Condition.getPage(query), checkOrderInfoDTO);
+		List<CheckOrderHistroyVO> list = pages.getRecords();
+		for (CheckOrderHistroyVO v : list) {
+			RtuCheckOrderWrapper.build().entityVO(v);
+		}
+		return R.data(pages);
+	}
+
+
 	/**
 	 * 详情
 	 */
@@ -664,10 +704,12 @@ public class RtuCheckOrderController extends BladeController {
 			return R.status(false);
 		}
 		checkOrderInfoDTO.setOrderClose(0);
+		Long rtuCount=rtuBaseInfoService.rtuCount(checkOrderInfoDTO.getAdCode());
 		Long orderCount = rtuCheckOrderService.orderCount(checkOrderInfoDTO);
 		Long unConfirmOrderCount = rtuCheckOrderService.unconfirmOrderCount(checkOrderInfoDTO);
 		Long unCloseOrderCount = rtuCheckOrderService.unCloseOrderCount(checkOrderInfoDTO);
 		Map<String, Object> data = new HashMap<>();
+		data.put("rtuCount", rtuCount);
 		data.put("orderCount", orderCount);
 		data.put("orderUnconfirm", unConfirmOrderCount);
 		data.put("orderProcessing", unCloseOrderCount);

+ 12 - 0
src/main/java/org/springblade/modules/business/check/order/dto/CheckOrderInfoDTO.java

@@ -72,4 +72,16 @@ public class CheckOrderInfoDTO extends CheckOrderInfoEntity {
 	 */
 	@ApiModelProperty(value = "异常类型")
 	private Integer warnKind;
+
+	/**
+	 * 排序,ascending"  descending
+	 */
+	@ApiModelProperty("排序")
+	private String order;
+
+	/**
+	 * 排序字段
+	 */
+	@ApiModelProperty("排序字段")
+	private String prop;
 }

+ 9 - 0
src/main/java/org/springblade/modules/business/check/order/mapper/RtuCheckOrderMapper.java

@@ -12,6 +12,7 @@ import org.apache.ibatis.annotations.Param;
 import org.springblade.modules.business.check.order.dto.CheckOrderInfoDTO;
 import org.springblade.modules.business.check.order.entity.CheckOrderInfoEntity;
 import org.springblade.modules.business.check.order.vo.CheckOrderCountVO;
+import org.springblade.modules.business.check.order.vo.CheckOrderHistroyVO;
 import org.springblade.modules.business.check.order.vo.CheckOrderInfoVO;
 
 
@@ -103,4 +104,12 @@ public interface RtuCheckOrderMapper extends BaseMapper<CheckOrderInfoEntity> {
 	 */
 	Long unCloseOrderCount(@Param("checkOrderInfoDTO") CheckOrderInfoDTO checkOrderInfoDTO);
 
+	/**
+	 * 查询维修任务历史信息
+	 * @param page
+	 * @param checkOrderInfoDTO
+	 * @return
+	 */
+	List<CheckOrderHistroyVO> selectHistoryPage(IPage page, @Param("checkOrderInfoDTO") CheckOrderInfoDTO checkOrderInfoDTO);
+
 }

+ 83 - 8
src/main/java/org/springblade/modules/business/check/order/mapper/RtuCheckOrderMapper.xml

@@ -54,9 +54,28 @@
         <result column="processing_order_count" property="processingOrderCount"/>
     </resultMap>
 
+    <resultMap id="checkOrderHistroyVOResultMap" type="org.springblade.modules.business.check.order.vo.CheckOrderHistroyVO">
+        <result column="rtu_code" property="rtuCode"/>
+        <result column="rtu_name" property="rtuName"/>
+        <result column="order_count" property="orderCount"/>
+        <result column="adcd" property="adCode"/>
+        <result column="ancestors" property="ancestors"/>
+        <result column="is_rain" property="isRain"/>
+        <result column="is_river" property="isRiver"/>
+        <result column="is_res" property="isRes"/>
+        <result column="is_ground" property="isGround"/>
+        <result column="is_video" property="isVideo"/>
+        <result column="lng" property="lng"/>
+        <result column="lat" property="lat"/>
+        <result column="location_desc" property="locationDesc"/>
+        <result column="ad_city" property="adCity"/>
+        <result column="ad_dist" property="adDist"/>
+    </resultMap>
+
     <select id="allOrders" resultMap="checkOrderInfoVOResultMap">
         SELECT
-        o.*,u.real_name,u.phone AS contact_phone,i.rtu_name,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name AS contact_user_name
+        o.*,u.real_name,u.phone AS contact_phone,i.rtu_name,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name
+        AS contact_user_name
         FROM
         rtu_failure_check_order o
         LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code and i.is_deleted=0
@@ -89,11 +108,11 @@
 
     <select id="selectPage" resultMap="checkOrderInfoVOResultMap">
         SELECT
-        o.*,u.real_name,i.rtu_name,i.is_rain,i.is_river,i.is_res,i.is_ground,i.is_video,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name AS contact_user_name,a.adcd,a.ancestors
+        o.*,u.real_name,i.rtu_name,i.is_rain,i.is_river,i.is_res,i.is_ground,i.is_video,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name
+        AS contact_user_name,a.adcd,a.ancestors
         FROM
         rtu_failure_check_order o
         LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code and i.is_deleted=0
-        LEFT JOIN rtu_warning w ON w.rtu_code = o.rtu_code and w.is_deleted = 0 and w.warning_kind=1
         LEFT JOIN data_ad_cd_b a ON a.adcd = i.ad_code and a.is_deleted=0
         LEFT JOIN blade_user u ON u.id = o.update_user and u.is_deleted=0
         LEFT JOIN blade_user u2 ON u2.id = o.contact_user and u2.is_deleted=0
@@ -118,12 +137,66 @@
             and (a.adcd =#{checkOrderInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE
             ancestors like concat(concat('%', #{checkOrderInfoDTO.adCode}), '%')))
         </if>
-        order by o.order_confirm ,o.order_close,w.warning_kind desc ,o.create_time
+        order by o.order_confirm ,o.order_close,o.create_time
     </select>
 
+    <select id="selectHistoryPage" resultMap="checkOrderHistroyVOResultMap">
+        SELECT
+            orders.rtu_code,
+            orders.order_count,
+            a.adcd,
+            a.ancestors,
+            i.rtu_name,i.is_rain,i.is_river,i.is_res,i.is_ground,i.is_video,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist
+        FROM
+            (
+            SELECT
+                o.rtu_code,
+                count( * ) order_count
+            FROM
+                rtu_failure_check_order o
+            WHERE
+                o.is_deleted = 0
+                AND o.order_confirm = 1
+                AND o.order_close = 1
+            GROUP BY
+                o.rtu_code
+            ) orders
+            LEFT JOIN rtu_info i ON i.rtu_code = orders.rtu_code and i.is_deleted=0
+            LEFT JOIN data_ad_cd_b a ON a.adcd = i.ad_code and a.is_deleted=0
+        WHERE
+            1 = 1
+        <if test="checkOrderInfoDTO.rtuCode!=null">
+            and orders.rtu_code like concat(concat('%', #{checkOrderInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="checkOrderInfoDTO.rtuName!=null">
+            and i.rtu_name like concat(concat('%', #{checkOrderInfoDTO.rtuName}), '%')
+        </if>
+        <if test="checkOrderInfoDTO.adCode!=null">
+            and (a.adcd =#{checkOrderInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE
+            ancestors like concat(concat('%', #{checkOrderInfoDTO.adCode}), '%')))
+        </if>
+        <choose>
+            <when test="checkOrderInfoDTO.order!=null and checkOrderInfoDTO.order=='ascending'">
+                <if test="checkOrderInfoDTO.prop!=null ">
+                    order by orders.order_count
+                </if>
+            </when>
+            <when test="checkOrderInfoDTO.order!=null and checkOrderInfoDTO.order=='descending'">
+                <if test="checkOrderInfoDTO.prop!=null ">
+                    order by orders.order_count desc
+                </if>
+            </when>
+            <otherwise>
+                order by i.ad_code,orders.rtu_code
+            </otherwise>
+        </choose>
+
+  </select>
+
     <select id="selectWarnPage" resultMap="checkOrderInfoVOResultMap">
         SELECT
-        o.*,u.real_name,i.rtu_name,i.is_rain,i.is_river,i.is_res,i.is_ground,i.is_video,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name AS contact_user_name,a.adcd,a.ancestors
+        o.*,u.real_name,i.rtu_name,i.is_rain,i.is_river,i.is_res,i.is_ground,i.is_video,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name
+        AS contact_user_name,a.adcd,a.ancestors
         FROM
         rtu_failure_check_order o
         LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code and i.is_deleted=0
@@ -158,7 +231,8 @@
 
     <select id="selectMyPage" resultMap="checkOrderInfoVOResultMap">
         SELECT
-        o.*,u.real_name,i.rtu_name,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name AS contact_user_name,a.adcd,a.ancestors
+        o.*,u.real_name,i.rtu_name,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name AS
+        contact_user_name,a.adcd,a.ancestors
         FROM
         rtu_failure_check_order o
         LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code and i.is_deleted=0
@@ -186,13 +260,14 @@
             and (a.adcd =#{checkOrderInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE
             ancestors like concat(concat('%', #{checkOrderInfoDTO.adCode}), '%')))
         </if>
-        order by o.order_confirm_time  desc
+        order by o.order_confirm_time desc
     </select>
 
 
     <select id="selectConfirmDelayPage" resultMap="checkOrderInfoVOResultMap">
         SELECT
-        o.*,u.real_name,i.rtu_name,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name AS contact_user_name,a.adcd,a.ancestors
+        o.*,u.real_name,i.rtu_name,i.lng,i.lat,i.location_desc,i.ad_city,i.ad_dist,u2.real_name AS
+        contact_user_name,a.adcd,a.ancestors
         FROM
         rtu_failure_check_order o
         LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code and i.is_deleted=0

+ 10 - 0
src/main/java/org/springblade/modules/business/check/order/service/IRtuCheckOrderService.java

@@ -11,6 +11,7 @@ import org.springblade.core.mp.base.BaseService;
 import org.springblade.modules.business.check.order.dto.CheckOrderInfoDTO;
 import org.springblade.modules.business.check.order.entity.CheckOrderInfoEntity;
 import org.springblade.modules.business.check.order.vo.CheckOrderCountVO;
+import org.springblade.modules.business.check.order.vo.CheckOrderHistroyVO;
 import org.springblade.modules.business.check.order.vo.CheckOrderInfoVO;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
 
@@ -122,4 +123,13 @@ public interface IRtuCheckOrderService extends BaseService<CheckOrderInfoEntity>
 	 * @return
 	 */
 	boolean createOrUpdateOrder(RtuWarningInfoEntity rtuWarningInfoEntity);
+
+	/**
+	 *
+	 * @param page
+	 * @param checkOrderInfoDTO
+	 * @return
+	 */
+	IPage<CheckOrderHistroyVO> selectHistoryPage(IPage<CheckOrderHistroyVO> page, CheckOrderInfoDTO checkOrderInfoDTO);
+
 }

+ 27 - 7
src/main/java/org/springblade/modules/business/check/order/service/impl/RtuCheckOrderServiceImpl.java

@@ -13,10 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.springblade.constant.BusinessConstant;
 import org.springblade.constant.DictBusinessConstant;
 import org.springblade.core.mp.base.BaseServiceImpl;
-import org.springblade.enums.OrderCloseEnum;
-import org.springblade.enums.OrderConfirmEnum;
-import org.springblade.enums.OrderFromEnum;
-import org.springblade.enums.OrderStatusEnum;
+import org.springblade.enums.*;
 import org.springblade.modules.baseinfo.dict.entity.DictInfoEntity;
 import org.springblade.modules.baseinfo.dict.service.IBaseInfoDictService;
 import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
@@ -30,10 +27,12 @@ import org.springblade.modules.business.check.order.entity.CheckOrderInfoEntity;
 import org.springblade.modules.business.check.order.mapper.RtuCheckOrderMapper;
 import org.springblade.modules.business.check.order.service.IRtuCheckOrderService;
 import org.springblade.modules.business.check.order.vo.CheckOrderCountVO;
+import org.springblade.modules.business.check.order.vo.CheckOrderHistroyVO;
 import org.springblade.modules.business.check.order.vo.CheckOrderInfoVO;
 import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
 import org.springblade.modules.business.check.process.service.IRtuOrderProcessService;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
+import org.springblade.modules.business.warning.service.IRtuWarningService;
 import org.springblade.modules.system.entity.Dept;
 import org.springblade.modules.system.entity.Role;
 import org.springblade.modules.system.entity.User;
@@ -80,6 +79,9 @@ public class RtuCheckOrderServiceImpl extends BaseServiceImpl<RtuCheckOrderMappe
 	@Resource
 	private IRoleService roleService;
 
+	@Resource
+	private IRtuWarningService rtuWarningService;
+
 	@Override
 	public List<CheckOrderInfoVO> allOrders(CheckOrderInfoDTO checkOrderInfoDTO) {
 		return baseMapper.allOrders(checkOrderInfoDTO);
@@ -118,14 +120,12 @@ public class RtuCheckOrderServiceImpl extends BaseServiceImpl<RtuCheckOrderMappe
 
 	@Override
 	public boolean updateOrderStatus(CheckOrderInfoEntity orderInfoEntity) {
-
 		LambdaUpdateWrapper<CheckOrderInfoEntity> updateWrapper = Wrappers.<CheckOrderInfoEntity>update().lambda();
 		updateWrapper.eq(CheckOrderInfoEntity::getId, orderInfoEntity.getId());
 		updateWrapper.set(CheckOrderInfoEntity::getOrderStatusKey, orderInfoEntity.getOrderStatusKey());
 		updateWrapper.set(CheckOrderInfoEntity::getOrderDesc, orderInfoEntity.getOrderDesc());
 		updateWrapper.set(CheckOrderInfoEntity::getUpdateTime, new Date());
 		this.update(updateWrapper);
-
 		return false;
 	}
 
@@ -162,7 +162,22 @@ public class RtuCheckOrderServiceImpl extends BaseServiceImpl<RtuCheckOrderMappe
 			this.updateById(checkOrderInfoEntity);
 			//增加工单处理关闭记
 			OrderProcessInfoEntity processInfoEntity = new OrderProcessInfoEntity();
-			processInfoEntity.setProcessDesc("由系统自动关闭维修任务");
+//			LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+//			warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
+			if (null != checkOrderInfoEntity.getWarnId()) {
+				RtuWarningInfoEntity rtuWarningInfoEntity = rtuWarningService.getById(checkOrderInfoEntity.getWarnId());
+				processInfoEntity.setProcessDesc(rtuWarningInfoEntity.getWarningRecoveryDesc());
+			} else {
+				processInfoEntity.setProcessDesc("由系统自动关闭维修任务");
+			}
+//			warningWrapper.eq(RtuWarningInfoEntity::getId, checkOrderInfoDTO.getWarnId());
+//			warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
+//			List<RtuWarningInfoEntity> warningInfoEntityList = rtuWarningService.list(warningWrapper);
+//			if (checkOrderInfoEntity.getWarnId().equals(checkOrderInfoDTO.getWarnId())){
+//				processInfoEntity.setProcessDesc("由系统自动关闭维修任务:"+checkOrderInfoDTO.getOrderDesc());
+//			}else{
+//				processInfoEntity.setProcessDesc("由系统自动关闭维修任务:"+checkOrderInfoDTO.getOrderDesc());
+//			}
 			processInfoEntity.setOrderId(checkOrderInfoEntity.getId());
 			processInfoEntity.setOrderStatusKey(dictInfoEntity.getId());
 			processInfoEntity.setCreateUser(BusinessConstant.SYS_ADMIN_ID);
@@ -263,4 +278,9 @@ public class RtuCheckOrderServiceImpl extends BaseServiceImpl<RtuCheckOrderMappe
 		}
 		return true;
 	}
+
+	@Override
+	public IPage<CheckOrderHistroyVO> selectHistoryPage(IPage<CheckOrderHistroyVO> page, CheckOrderInfoDTO checkOrderInfoDTO) {
+		return page.setRecords(baseMapper.selectHistoryPage(page, checkOrderInfoDTO));
+	}
 }

+ 136 - 0
src/main/java/org/springblade/modules/business/check/order/vo/CheckOrderHistroyVO.java

@@ -0,0 +1,136 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/6/7
+ */
+package org.springblade.modules.business.check.order.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.core.mp.base.BaseEntity;
+
+/***
+ * Date:2023/6/7
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CheckOrderHistroyVO  extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 租户ID
+	 */
+	@ApiModelProperty("租户ID")
+	private String tenantId;
+
+	/**
+	 * 测站编码
+	 */
+	@ApiModelProperty("测站编码")
+	private String rtuCode;
+
+	/**
+	 * 测站名称
+	 */
+	@ApiModelProperty(value = "测站名称")
+	private String rtuName;
+
+	/**
+	 * 经度
+	 */
+	@ApiModelProperty(value = "经度")
+	private String lng;
+
+	/**
+	 * 纬度
+	 */
+	@ApiModelProperty(value = "纬度")
+	private String lat;
+
+	/**
+	 * 测站位置说明
+	 */
+	@ApiModelProperty(value = "测站位置说明")
+	private String locationDesc;
+
+	/**
+	 * 所属盟市
+	 */
+	@ApiModelProperty(value = "所属盟市")
+	private String adCity;
+
+	/**
+	 * 所属盟县旗区
+	 */
+	@ApiModelProperty(value = "所属盟县旗区")
+	private String adDist;
+
+	/**
+	 * 是否雨量站
+	 */
+	@ApiModelProperty(value = "是否雨量站")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer isRain;
+
+	/**
+	 * 是否河道站
+	 */
+	@ApiModelProperty(value = "是否河道站")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer isRiver;
+
+	/**
+	 * 是否水库站
+	 */
+	@ApiModelProperty(value = "是否水库站")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer isRes;
+
+	/**
+	 * 是否墒情站
+	 */
+	@ApiModelProperty(value = "是否墒情站")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer isGround;
+
+	/**
+	 * 是否视频站
+	 */
+	@ApiModelProperty(value = "是否视频站")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer isVideo;
+
+	/**
+	 * 行政区划索引
+	 */
+	@ApiModelProperty(value = "行政区划索引")
+	private String ancestors;
+
+	/**
+	 * 行政区划编码
+	 */
+	@ApiModelProperty(value = "行政区划编码")
+	private String adCode;
+
+	/**
+	 * 运维单位
+	 */
+	@ApiModelProperty(value = "运维单位")
+	private String manageCompany;
+
+	/**
+	 * 维修任务数量
+	 */
+	@ApiModelProperty(value = "维修任务数量")
+	private Integer orderCount;
+
+
+}

+ 3 - 0
src/main/java/org/springblade/modules/business/check/order/vo/CheckOrderInfoVO.java

@@ -158,18 +158,21 @@ public class CheckOrderInfoVO extends CheckOrderInfoEntity {
 	 * 降水
 	 */
 	@ApiModelProperty(value = "降水")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Double drp;
 
 	/**
 	 * 河道站水位
 	 */
 	@ApiModelProperty(value = "河道站水位")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Double z;
 
 	/**
 	 * 水库站水位
 	 */
 	@ApiModelProperty(value = "水库站水位")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Double rz;
 
 	/**

+ 50 - 12
src/main/java/org/springblade/modules/business/check/order/wrapper/RtuCheckOrderWrapper.java

@@ -22,6 +22,7 @@ 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.business.check.order.entity.CheckOrderInfoEntity;
+import org.springblade.modules.business.check.order.vo.CheckOrderHistroyVO;
 import org.springblade.modules.business.check.order.vo.CheckOrderInfoVO;
 import org.springblade.modules.business.data.service.IRtuDataRainService;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
@@ -111,6 +112,40 @@ public class RtuCheckOrderWrapper extends BaseEntityWrapper<CheckOrderInfoEntity
 		return this.entityVO(checkOrderInfoVO);
 	}
 
+
+	public CheckOrderHistroyVO entityVO(CheckOrderHistroyVO vo) {
+		String ancestors = vo.getAncestors();
+		if (null != ancestors && ancestors.length() > 0) {
+			String[] ancestorsList = ancestors.split(",");
+			String adCode;
+			if (ancestorsList.length >= 3) {
+				adCode = ancestorsList[2];
+			} else {
+				adCode = vo.getAdCode();
+			}
+			if (null != adCode) {
+				LambdaQueryWrapper<DeptRegionEntity> wrapper = Wrappers.<DeptRegionEntity>query().lambda();
+				wrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+				wrapper.eq(DeptRegionEntity::getAdcd, adCode);
+				List<DeptRegionEntity> deptRegionEntities = getDeptRegionService().list(wrapper);
+				if (null != deptRegionEntities && deptRegionEntities.size() > 0) {
+					String manageCompany = "";
+					for (DeptRegionEntity deptRegionEntity : deptRegionEntities) {
+						Dept dept = getDeptService().getById(deptRegionEntity.getDeptId());
+						if (null != dept) {
+							if (manageCompany.length() > 0) {
+								manageCompany += " / ";
+							}
+							manageCompany += dept.getDeptName();
+						}
+					}
+					vo.setManageCompany(manageCompany);
+				}
+			}
+		}
+		return vo;
+	}
+
 	public CheckOrderInfoVO entityVO(CheckOrderInfoVO vo) {
 		String areaName = "";
 		if (null != vo.getAdCity()) {
@@ -220,17 +255,20 @@ public class RtuCheckOrderWrapper extends BaseEntityWrapper<CheckOrderInfoEntity
 			taskTime = "1小时内";
 		}
 		vo.setTaskCreateDuration(taskTime);
-		LambdaQueryWrapper<RtuWarningInfoEntity> queryWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
-		queryWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
-		queryWrapper.eq(RtuWarningInfoEntity::getRtuCode, vo.getRtuCode());
-		queryWrapper.eq(RtuWarningInfoEntity::getWarningStatus, 0);
-		List<RtuWarningInfoEntity> rtuWarningInfoEntityList = getRtuWarningService().list(queryWrapper);
-		if (null != rtuWarningInfoEntityList && rtuWarningInfoEntityList.size() > 0) {
+		RtuWarningInfoEntity rtuWarningInfoEntity = getRtuWarningService().getById(vo.getWarnId());
+		//LambdaQueryWrapper<RtuWarningInfoEntity> queryWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+		//queryWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
+		//queryWrapper.eq(RtuWarningInfoEntity::getId,vo.getWarnId());
+		//queryWrapper.eq(RtuWarningInfoEntity::getRtuCode, vo.getRtuCode());
+		//queryWrapper.eq(RtuWarningInfoEntity::getWarningStatus, 0);
+		//List<RtuWarningInfoEntity> rtuWarningInfoEntityList = getRtuWarningService().list(queryWrapper);
+		//if (null != rtuWarningInfoEntityList && rtuWarningInfoEntityList.size() > 0) {
+		if (null != rtuWarningInfoEntity) {
 			String warnKinds = "";
-			for (RtuWarningInfoEntity rtuWarningInfoEntity : rtuWarningInfoEntityList) {
-				if (warnKinds.length() > 0) {
-					warnKinds += "/";
-				}
+			//for (RtuWarningInfoEntity rtuWarningInfoEntity : rtuWarningInfoEntityList) {
+			//	if (warnKinds.length() > 0) {
+				//	warnKinds += "/";
+			//	}
 				if (WarnKindEnum.WARN_CLOCK.getCode() == rtuWarningInfoEntity.getWarningKind()) {
 					warnKinds += "测站时钟异常";
 				} else if (WarnKindEnum.WARN_UP_MIN_DELAY.getCode() == rtuWarningInfoEntity.getWarningKind()) {
@@ -241,14 +279,14 @@ public class RtuCheckOrderWrapper extends BaseEntityWrapper<CheckOrderInfoEntity
 					warnKinds += "雨量站小时报漏报";
 				} else if (WarnKindEnum.WARN_WL_MISS_OUT.getCode() == rtuWarningInfoEntity.getWarningKind()) {
 					warnKinds += "水位站小时报漏报";
-				}else if (WarnKindEnum.WARN_OUTLIER_VALUE.getCode() == rtuWarningInfoEntity.getWarningKind()) {
+				} 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 += "水位站小时上报延时";
 				}
-			}
+			//}
 			vo.setWarnKindInfo(warnKinds);
 		}
 		return vo;

+ 35 - 0
src/main/java/org/springblade/modules/business/data/dto/RtuDataGroundDTO.java

@@ -6,11 +6,15 @@
  */
 package org.springblade.modules.business.data.dto;
 
+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.springblade.modules.business.data.entity.RtuDataGroundEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 /***
  * Date:2022/8/30
@@ -47,4 +51,35 @@ public class RtuDataGroundDTO extends RtuDataGroundEntity {
 	@ApiModelProperty("行政区划编码")
 	private String adCode;
 
+	/**
+	 * 排序,ascending"  descending
+	 */
+	@ApiModelProperty("排序")
+	private String order;
+
+	/**
+	 * 排序字段
+	 */
+	@ApiModelProperty("排序字段")
+	private String prop;
+
+	@ApiModelProperty("开始时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss",
+		timezone = "GMT+8"
+	)
+	private Date beginTime;
+
+	@ApiModelProperty("结束时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss",
+		timezone = "GMT+8"
+	)
+	private Date endTime;
 }

+ 36 - 1
src/main/java/org/springblade/modules/business/data/dto/RtuDataRainDTO.java

@@ -6,11 +6,15 @@
  */
 package org.springblade.modules.business.data.dto;
 
+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.springblade.modules.business.data.entity.RtuDataRainEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 /***
  * Date:2022/8/30
@@ -34,7 +38,6 @@ public class RtuDataRainDTO extends RtuDataRainEntity {
 	@ApiModelProperty("机构ID")
 	private Long orgId;
 
-
 	/**
 	 * 项目ID
 	 */
@@ -46,4 +49,36 @@ public class RtuDataRainDTO extends RtuDataRainEntity {
 	 */
 	@ApiModelProperty("行政区划编码")
 	private String adCode;
+
+	/**
+	 * 排序,ascending"  descending
+	 */
+	@ApiModelProperty("排序")
+	private String order;
+
+	/**
+	 * 排序字段
+	 */
+	@ApiModelProperty("排序字段")
+	private String prop;
+
+	@ApiModelProperty("开始时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss",
+		timezone = "GMT+8"
+	)
+	private Date beginTime;
+
+	@ApiModelProperty("结束时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss",
+		timezone = "GMT+8"
+	)
+	private Date endTime;
 }

+ 36 - 0
src/main/java/org/springblade/modules/business/data/dto/RtuDataRiverDTO.java

@@ -6,11 +6,15 @@
  */
 package org.springblade.modules.business.data.dto;
 
+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.springblade.modules.business.data.entity.RtuDataRiverEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 /***
  * Date:2022/8/30
@@ -46,4 +50,36 @@ public class RtuDataRiverDTO extends RtuDataRiverEntity {
 	 */
 	@ApiModelProperty("行政区划编码")
 	private String adCode;
+
+	/**
+	 * 排序,ascending"  descending
+	 */
+	@ApiModelProperty("排序")
+	private String order;
+
+	/**
+	 * 排序字段
+	 */
+	@ApiModelProperty("排序字段")
+	private String prop;
+
+	@ApiModelProperty("开始时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss",
+		timezone = "GMT+8"
+	)
+	private Date beginTime;
+
+	@ApiModelProperty("结束时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss",
+		timezone = "GMT+8"
+	)
+	private Date endTime;
 }

+ 2 - 0
src/main/java/org/springblade/modules/business/data/mapper/RtuDataGroundMapper.java

@@ -32,4 +32,6 @@ public interface RtuDataGroundMapper extends BaseMapper<RtuDataGroundEntity> {
 	 * @return List<RtuInfoVO>
 	 */
 	List<RtuDataGroundVO> selectPage(IPage page, @Param("groundDTO") RtuDataGroundDTO groundDTO);
+
+	long rtuUpDataCount(@Param("groundDTO") RtuDataGroundDTO groundDTO);
 }

+ 39 - 0
src/main/java/org/springblade/modules/business/data/mapper/RtuDataGroundMapper.xml

@@ -60,6 +60,45 @@
         <if test="groundDTO.adCode!=null">
             and (a.adcd =#{groundDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{groundDTO.adCode}), '%')))
         </if>
+        <choose>
+            <when test="groundDTO.order!=null and groundDTO.order=='ascending'">
+                <if test="groundDTO.prop!=null ">
+                    order by n.tm
+                </if>
+            </when>
+            <when test="groundDTO.order!=null and groundDTO.order=='descending'">
+                <if test="groundDTO.prop!=null ">
+                    order by n.tm desc
+                </if>
+            </when>
+            <otherwise>
+                order by r.ad_code , r.rtu_code
+            </otherwise>
+        </choose>
+    </select>
 
+    <select id="rtuUpDataCount" resultType="java.lang.Long">
+        SELECT
+        count( * )
+        FROM
+        (
+        SELECT
+        w.rtu_code
+        FROM
+        data_att_st_somo_cache w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code
+        AND r.is_deleted = 0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code
+        AND a.is_deleted = 0
+        WHERE
+        w.is_deleted = 0
+        AND w.tm >= #{groundDTO.beginTime}
+        AND w.tm &lt; #{groundDTO.endTime}
+        <if test="groundDTO.adCode!=null">
+            and (a.adcd =#{groundDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{groundDTO.adCode}), '%')))
+        </if>
+        GROUP BY
+        w.rtu_code
+        ) a
     </select>
 </mapper>

+ 3 - 0
src/main/java/org/springblade/modules/business/data/mapper/RtuDataRainMapper.java

@@ -31,4 +31,7 @@ public interface RtuDataRainMapper extends BaseMapper<RtuDataRainEntity> {
 	 * @return List<RtuInfoVO>
 	 */
 	List<RtuDataRainVO> selectPage(IPage page, @Param("rtuDataRainDTO") RtuDataRainDTO rtuDataRainDTO);
+
+	long rtuUpDataCount(@Param("rainDTO") RtuDataRainDTO rainDTO);
+
 }

+ 45 - 0
src/main/java/org/springblade/modules/business/data/mapper/RtuDataRainMapper.xml

@@ -41,6 +41,51 @@
         <if test="rtuDataRainDTO.adCode!=null">
             and (a.adcd =#{rtuDataRainDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuDataRainDTO.adCode}), '%')))
         </if>
+        <choose>
+            <when test="rtuDataRainDTO.order!=null and rtuDataRainDTO.order=='ascending'">
+                <if test="rtuDataRainDTO.prop!=null and rtuDataRainDTO.prop=='tm'">
+                    order by n.tm
+                </if>
+                <if test="rtuDataRainDTO.prop!=null and rtuDataRainDTO.prop=='drp'">
+                    order by n.drp
+                </if>
+            </when>
+            <when test="rtuDataRainDTO.order!=null and rtuDataRainDTO.order=='descending'">
+                <if test="rtuDataRainDTO.prop!=null and rtuDataRainDTO.prop=='tm'">
+                    order by n.tm desc
+                </if>
+                <if test="rtuDataRainDTO.prop!=null and rtuDataRainDTO.prop=='drp'">
+                    order by n.drp desc
+                </if>
+            </when>
+            <otherwise>
+                order by r.ad_code , r.rtu_code
+            </otherwise>
+        </choose>
+    </select>
 
+    <select id="rtuUpDataCount" resultType="java.lang.Long">
+        SELECT
+        count( * )
+        FROM
+        (
+        SELECT
+        w.rtu_code
+        FROM
+        data_att_st_prec_cache w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code
+        AND r.is_deleted = 0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code
+        AND a.is_deleted = 0
+        WHERE
+        w.is_deleted = 0
+        AND w.tm >= #{rainDTO.beginTime}
+        AND w.tm &lt; #{rainDTO.endTime}
+        <if test="rainDTO.adCode!=null">
+            and (a.adcd =#{rainDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rainDTO.adCode}), '%')))
+        </if>
+        GROUP BY
+        w.rtu_code
+        ) a
     </select>
 </mapper>

+ 2 - 0
src/main/java/org/springblade/modules/business/data/mapper/RtuDataRiverMapper.java

@@ -9,6 +9,7 @@ package org.springblade.modules.business.data.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.business.data.dto.RtuDataGroundDTO;
 import org.springblade.modules.business.data.dto.RtuDataRiverDTO;
 import org.springblade.modules.business.data.entity.RtuDataRiverEntity;
 import org.springblade.modules.business.data.vo.RtuDataRiverVO;
@@ -35,4 +36,5 @@ public interface RtuDataRiverMapper extends BaseMapper<RtuDataRiverEntity> {
 
 	List<RtuDataRiverVO> selectWaterPage(IPage page, @Param("riverDTO") RtuDataRiverDTO riverDTO);
 
+	long rtuUpDataCount(@Param("riverDTO") RtuDataRiverDTO riverDTO);
 }

+ 45 - 3
src/main/java/org/springblade/modules/business/data/mapper/RtuDataRiverMapper.xml

@@ -49,15 +49,16 @@
         <if test="riverDTO.adCode!=null">
             and (a.adcd =#{riverDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{riverDTO.adCode}), '%')))
         </if>
+        order by r.ad_code,r.rtu_code
     </select>
 
     <select id="selectWaterPage" resultMap="rtuWaterDataVOResultMap">
         SELECT r.rtu_code,r.rtu_name,res.rz,w.z,res.tm rsvrTm,w.tm,r.ad_city,r.ad_dist
-        FROM rtu_info  r
+        FROM rtu_info r
         LEFT JOIN data_att_st_res_ware_cache res  on res.rtu_code = r.rtu_code and res.is_deleted=0
         LEFT JOIN data_att_st_waco_ware_cache w on w.rtu_code = r.rtu_code and w.is_deleted=0
         LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
-        WHERE r.is_deleted=0 and  (r.is_res=1 or r.is_river=1)
+        WHERE r.is_deleted=0 and  (r.is_res=1 or r.is_river=1) and (res.tm is not null or w.tm is not null)
         <if test="riverDTO.rtuName!=null ">
             and r.rtu_name LIKE concat(concat('%', #{riverDTO.rtuName}), '%')
         </if>
@@ -67,6 +68,47 @@
         <if test="riverDTO.adCode!=null">
             and (r.ad_code =#{riverDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{riverDTO.adCode}), '%')))
         </if>
-        order by res.tm desc,w.tm desc,r.ad_code,r.rtu_code
+        <choose>
+            <when test="riverDTO.order!=null and riverDTO.order=='ascending'">
+                <if test="riverDTO.prop!=null ">
+                    order by res.tm,w.tm
+                </if>
+            </when>
+            <when test="riverDTO.order!=null and riverDTO.order=='descending'">
+                <if test="riverDTO.prop!=null ">
+                    order by res.tm desc,w.tm desc
+                </if>
+            </when>
+            <otherwise>
+                order by r.ad_code,r.rtu_code
+            </otherwise>
+        </choose>
+    </select>
+
+    <select id="rtuUpDataCount" resultType="java.lang.Long">
+        SELECT
+        count( * )
+        FROM
+        (
+        SELECT
+        r.rtu_code
+        FROM
+        rtu_info r
+        LEFT JOIN data_att_st_res_ware_cache res ON res.rtu_code = r.rtu_code AND res.tm >= #{riverDTO.beginTime} AND res.tm &lt; #{riverDTO.endTime}
+        AND res.is_deleted = 0
+        LEFT JOIN data_att_st_waco_ware_cache w ON w.rtu_code = r.rtu_code  AND w.tm >= #{riverDTO.beginTime} AND w.tm &lt; #{riverDTO.endTime}
+        AND w.is_deleted = 0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code
+        AND a.is_deleted = 0
+        WHERE
+        r.is_deleted = 0
+        AND ( r.is_res = 1 OR r.is_river = 1 )
+        AND ( res.tm IS NOT NULL OR w.tm IS NOT NULL )
+        <if test="riverDTO.adCode!=null">
+            and (a.adcd =#{riverDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{riverDTO.adCode}), '%')))
+        </if>
+        GROUP BY
+        r.rtu_code
+        ) a
     </select>
 </mapper>

+ 2 - 0
src/main/java/org/springblade/modules/business/data/service/IRtuDataGroundService.java

@@ -36,4 +36,6 @@ public interface IRtuDataGroundService extends BaseService<RtuDataGroundEntity>
 	 * @return
 	 */
 	boolean updateGroundInfo(EtlGroundDataEntity etlGroundDataEntity);
+
+	long rtuUpDataCount(RtuDataGroundDTO groundDTO);
 }

+ 6 - 0
src/main/java/org/springblade/modules/business/data/service/IRtuDataRainService.java

@@ -10,7 +10,9 @@ package org.springblade.modules.business.data.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.etl.entity.EtlRainDataEntity;
+import org.springblade.modules.business.data.dto.RtuDataGroundDTO;
 import org.springblade.modules.business.data.dto.RtuDataRainDTO;
+import org.springblade.modules.business.data.dto.RtuDataRiverDTO;
 import org.springblade.modules.business.data.entity.RtuDataRainEntity;
 import org.springblade.modules.business.data.vo.RtuDataRainVO;
 
@@ -36,4 +38,8 @@ public interface IRtuDataRainService extends BaseService<RtuDataRainEntity> {
 	 * @return
 	 */
 	boolean updateRainInfo(EtlRainDataEntity etlRainDataEntity);
+
+	long rtuUpDataCount(RtuDataRainDTO rainDTO);
+
+
 }

+ 5 - 0
src/main/java/org/springblade/modules/business/data/service/IRtuDataRiverService.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.etl.entity.EtlRiverDataEntity;
+import org.springblade.modules.business.data.dto.RtuDataGroundDTO;
 import org.springblade.modules.business.data.dto.RtuDataRiverDTO;
 import org.springblade.modules.business.data.entity.RtuDataRiverEntity;
 import org.springblade.modules.business.data.vo.RtuDataRiverVO;
@@ -41,4 +42,8 @@ public interface IRtuDataRiverService extends BaseService<RtuDataRiverEntity> {
 	boolean updateRiverInfo(EtlRiverDataEntity etlRiverDataEntity);
 
 	IPage<RtuDataRiverVO> selectWaterPage(IPage<RtuDataRiverVO> page, RtuDataRiverDTO rtuDataRiverDTO);
+
+	long rtuUpDataCount(RtuDataRiverDTO riverDTO);
+
+
 }

+ 5 - 0
src/main/java/org/springblade/modules/business/data/service/impl/RtuDataGroundServiceImpl.java

@@ -62,4 +62,9 @@ public class RtuDataGroundServiceImpl extends BaseServiceImpl<RtuDataGroundMappe
 		groundDataEntity.setFromTime(etlGroundDataEntity.getFromDate());
 		return this.saveOrUpdate(groundDataEntity);
 	}
+
+	@Override
+	public long rtuUpDataCount(RtuDataGroundDTO groundDTO) {
+		return this.baseMapper.rtuUpDataCount(groundDTO);
+	}
 }

+ 5 - 0
src/main/java/org/springblade/modules/business/data/service/impl/RtuDataRainServiceImpl.java

@@ -57,4 +57,9 @@ public class RtuDataRainServiceImpl extends BaseServiceImpl<RtuDataRainMapper, R
 		rainEntity.setFromTime(etlRainDataEntity.getFromDate());
 		return this.saveOrUpdate(rainEntity);
 	}
+
+	@Override
+	public long rtuUpDataCount(RtuDataRainDTO rainDTO) {
+		return this.baseMapper.rtuUpDataCount(rainDTO);
+	}
 }

+ 5 - 0
src/main/java/org/springblade/modules/business/data/service/impl/RtuDataRiverServiceImpl.java

@@ -61,4 +61,9 @@ public class RtuDataRiverServiceImpl extends BaseServiceImpl<RtuDataRiverMapper,
 	public IPage<RtuDataRiverVO> selectWaterPage(IPage<RtuDataRiverVO> page, RtuDataRiverDTO rtuDataRiverDTO) {
 		return page.setRecords(baseMapper.selectWaterPage(page, rtuDataRiverDTO));
 	}
+
+	@Override
+	public long rtuUpDataCount(RtuDataRiverDTO riverDTO) {
+		return this.baseMapper.rtuUpDataCount(riverDTO);
+	}
 }

+ 7 - 5
src/main/java/org/springblade/modules/business/equipment/inspection/base/controller/EquipmentInspectionController.java

@@ -190,6 +190,12 @@ public class EquipmentInspectionController extends BladeController {
 		return R.data(pages);
 	}
 
+	/**
+	 * 当前汛期待巡检的设备,只返回未巡检过的设备
+	 * @param inspectionInfoDTO
+	 * @param query
+	 * @return
+	 */
 	@GetMapping("/rtu/page")
 	@ApiImplicitParams({
 		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
@@ -236,11 +242,7 @@ public class EquipmentInspectionController extends BladeController {
 		IPage<EquipmentInspectionInfoVO> pages = equipmentInspectionService.selectRtuPage(Condition.getPage(query), inspectionInfoDTO);
 		List<EquipmentInspectionInfoVO> list = pages.getRecords();
 		for (EquipmentInspectionInfoVO vo : list) {
-			LambdaQueryWrapper<EquipmentInspectionInfoEntity> wrapper = Wrappers.<EquipmentInspectionInfoEntity>query().lambda();
-			wrapper.eq(EquipmentInspectionInfoEntity::getIsDeleted, 0);
-			wrapper.ge(EquipmentInspectionInfoEntity::getInspectionDate, inspectionInfoDTO.getInspectionYearStartDate());
-			wrapper.lt(EquipmentInspectionInfoEntity::getInspectionDate, inspectionInfoDTO.getInspectionYearStartDate());
-
+	        EquipmentInspectionWrapper.build().entityVO(vo);
 		}
 		return R.data(pages);
 	}

+ 3 - 2
src/main/java/org/springblade/modules/business/equipment/inspection/base/mapper/EquipmentInspectionMapper.xml

@@ -72,7 +72,7 @@
         rain_season_first_report_user_name,u3.real_name AS rain_season_second_report_user_name,r.ad_city,r.ad_dist
         FROM
         equipment_inspection n
-        LEFT JOIN rtu_info r ON r.rtu_code = n.rtu_code
+        LEFT JOIN rtu_info r ON r.rtu_code = n.rtu_code and r.is_deleted=0
         LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
         LEFT JOIN blade_user u ON u.id = n.before_rain_season_report_user and u.is_deleted=0
         LEFT JOIN blade_user u2 ON u2.id = n.rain_season_first_report_user and u2.is_deleted=0
@@ -121,9 +121,10 @@
 
     <select id="selectRtuPage" resultMap="equipmentInspectionInfoVOResultMap">
         SELECT
-        r.rtu_name,r.rtu_code,r.ad_city,r.ad_dist,r.is_rain,r.is_river,r.is_res,r.is_ground,r.is_video,r.location_desc,r.lng,r.lat
+        r.rtu_name,r.rtu_code,r.ad_city,r.ad_dist,r.is_rain,r.is_river,r.is_res,r.is_ground,r.is_video,r.location_desc,r.lng,r.lat, n.run_status_id,n.last_up_time
         FROM
         rtu_info r
+        LEFT JOIN  rtu_status n ON n.rtu_code = r.rtu_code and  n.is_deleted = 0
         LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
         WHERE
         r.is_deleted = 0

+ 59 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/base/vo/EquipmentInspectionInfoVO.java

@@ -6,12 +6,16 @@
  */
 package org.springblade.modules.business.equipment.inspection.base.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 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.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 /***
  * Date:2022/8/23
@@ -117,4 +121,59 @@ public class EquipmentInspectionInfoVO extends EquipmentInspectionInfoEntity {
 	 */
 	@ApiModelProperty(value = "测站类型概要")
 	private String rtuKindDesc;
+
+	/**
+	 * 测站状态ID
+	 */
+	@ApiModelProperty(value = "测站状态")
+	private Integer runStatusId;
+
+	/**
+	 * 最后上报时间
+	 */
+	@ApiModelProperty(value = "最后上报时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+	)
+	private Date lastUpTime;
+
+	/**
+	 * 预警类别信息
+	 */
+	@ApiModelProperty(value = "预警类别")
+	private String warnKindInfo;
+
+	/**
+	 * 维修任务状态, 0 暂无任务 1 有维修任务
+	 */
+	@ApiModelProperty(value = "维修任务状态")
+	private Integer orderStatus;
+
+	/**
+	 * 工单关闭
+	 */
+	@ApiModelProperty(value = "工单关闭")
+	private Integer orderClose;
+
+	/**
+	 * 工单确认
+	 */
+	@ApiModelProperty(value = "工单确认")
+	private Integer orderConfirm;
+
+	/**
+	 * 我的任务, 0 不是,1 是
+	 */
+	@ApiModelProperty(value = "我的任务")
+	private Integer myOrder;
+
+	/**
+	 * 任务ID
+	 */
+	@ApiModelProperty(value = "任务ID")
+	private Long orderId;
+
 }

+ 90 - 1
src/main/java/org/springblade/modules/business/equipment/inspection/base/wrapper/EquipmentInspectionWrapper.java

@@ -7,11 +7,24 @@
 package org.springblade.modules.business.equipment.inspection.base.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.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.enums.OrderConfirmEnum;
+import org.springblade.enums.WarnKindEnum;
+import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
+import org.springblade.modules.business.check.order.entity.CheckOrderInfoEntity;
+import org.springblade.modules.business.check.order.service.IRtuCheckOrderService;
 import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
 import org.springblade.modules.business.equipment.inspection.base.vo.EquipmentInspectionInfoVO;
+import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
+import org.springblade.modules.business.warning.service.IRtuWarningService;
 
+import java.util.List;
 import java.util.Objects;
 
 /***
@@ -23,11 +36,29 @@ import java.util.Objects;
  * Remark:认为有必要的其他信息
  */
 
-public class EquipmentInspectionWrapper extends BaseEntityWrapper<EquipmentInspectionInfoEntity,EquipmentInspectionInfoVO> {
+public class EquipmentInspectionWrapper extends BaseEntityWrapper<EquipmentInspectionInfoEntity, EquipmentInspectionInfoVO> {
 	public static EquipmentInspectionWrapper build() {
 		return new EquipmentInspectionWrapper();
 	}
 
+	private static IRtuCheckOrderService checkOrderService;
+
+	private static IRtuCheckOrderService getCheckOrderService() {
+		if (checkOrderService == null) {
+			checkOrderService = SpringUtil.getBean(IRtuCheckOrderService.class);
+		}
+		return checkOrderService;
+	}
+
+	private static IRtuWarningService rtuWarningService;
+
+	private static IRtuWarningService getRtuWarningService() {
+		if (rtuWarningService == null) {
+			rtuWarningService = SpringUtil.getBean(IRtuWarningService.class);
+		}
+		return rtuWarningService;
+	}
+
 	@Override
 	public EquipmentInspectionInfoVO entityVO(EquipmentInspectionInfoEntity entity) {
 		EquipmentInspectionInfoVO equipmentInspectionInfoVO = Objects.requireNonNull(BeanUtil.copy(entity, EquipmentInspectionInfoVO.class));
@@ -63,6 +94,64 @@ public class EquipmentInspectionWrapper extends BaseEntityWrapper<EquipmentInspe
 			rtuKindDesc += "视频站";
 		}
 		entity.setRtuKindDesc(rtuKindDesc);
+
+		if (entity.getRunStatusId()!=null && entity.getRunStatusId() ==1) {
+			LambdaQueryWrapper<RtuWarningInfoEntity> queryWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+			queryWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
+			queryWrapper.eq(RtuWarningInfoEntity::getRtuCode, entity.getRtuCode());
+			queryWrapper.eq(RtuWarningInfoEntity::getWarningStatus, 0);
+			List<RtuWarningInfoEntity> rtuWarningInfoEntityList = getRtuWarningService().list(queryWrapper);
+			if (null != rtuWarningInfoEntityList && rtuWarningInfoEntityList.size() > 0) {
+				String warnKinds = "";
+				for (RtuWarningInfoEntity rtuWarningInfoEntity : rtuWarningInfoEntityList) {
+					if (warnKinds.length() > 0) {
+						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 += "水位站小时上报延时";
+					}
+				}
+				entity.setWarnKindInfo(warnKinds);
+			}
+
+			BladeUser user = AuthUtil.getUser();
+
+			LambdaQueryWrapper<CheckOrderInfoEntity> wrapper = Wrappers.<CheckOrderInfoEntity>query().lambda();
+			wrapper.eq(CheckOrderInfoEntity::getIsDeleted, 0);
+			wrapper.eq(CheckOrderInfoEntity::getRtuCode, entity.getRtuCode());
+			wrapper.eq(CheckOrderInfoEntity::getOrderClose, 0);
+
+			entity.setOrderStatus(0);
+			List<CheckOrderInfoEntity> list = getCheckOrderService().list(wrapper);
+			if (null != list && list.size() > 0) {
+				entity.setOrderStatus(1);
+				entity.setOrderConfirm(list.get(0).getOrderConfirm());
+				entity.setOrderClose(list.get(0).getOrderClose());
+				if (entity.getOrderConfirm() == OrderConfirmEnum.ACTIVE_CONFIRM.getCode()){
+					if (list.get(0).getOrderConfirmUser().equals(user.getUserId())){
+						entity.setMyOrder(1);
+					}else{
+						entity.setMyOrder(0);
+					}
+				}
+				entity.setOrderId(list.get(0).getId());
+			}
+		}
+
 		return entity;
 	}
 }

+ 24 - 0
src/main/java/org/springblade/modules/business/home/Entity/WarnCountInfoEntity.java

@@ -0,0 +1,24 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/6/21
+ */
+package org.springblade.modules.business.home.Entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/***
+ * Date:2023/6/21
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WarnCountInfoEntity extends BaseEntity {
+}

+ 9 - 0
src/main/java/org/springblade/modules/business/home/VO/HomeInfoVO.java

@@ -36,6 +36,15 @@ public class HomeInfoVO extends HomeInfoEntity {
 	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Long warningRtus;
 
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long rainUpDataCount;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long riverUpDataCount;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long groundUpDataCount;
+
 	/**
 	 * 维修任务数量
 	 */

+ 54 - 0
src/main/java/org/springblade/modules/business/home/VO/RtuCheckOrderCountInfoVO.java

@@ -0,0 +1,54 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/27
+ */
+package org.springblade.modules.business.home.VO;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.home.Entity.HomeInfoEntity;
+
+
+/***
+ * Date:2022/8/27
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RtuCheckOrderCountInfoVO extends HomeInfoEntity {
+
+	/**
+	 * 维修任务数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long orderCount;
+
+	/**
+	 * 未确认的维修任务
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long unconfirmOrderCount;
+
+	/**
+	 * 超时未确认维修任务
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long delayComfireOrders;
+
+	/**
+	 * 我的任务数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long myOrderCount;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long processCheckOrderCount;
+}

+ 70 - 0
src/main/java/org/springblade/modules/business/home/VO/RtuInspectionReportCountInfoVO.java

@@ -0,0 +1,70 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/27
+ */
+package org.springblade.modules.business.home.VO;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.home.Entity.HomeInfoEntity;
+
+
+/***
+ * Date:2022/8/27
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RtuInspectionReportCountInfoVO extends HomeInfoEntity {
+
+	/**
+	 * 本年度需要巡检的设备数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long equipmentInspectionCount;
+
+	/**
+	 * 本汛期需要巡检的设备数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long equipmentInspectionRainCount;
+
+	/**
+	 * 汛前已巡检设备数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long equipmentInspectionBeforeRainReports;
+
+	/**
+	 * 汛中一已巡检设备数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long equipmentInspectionRainFirstReports;
+
+	/**
+	 * 汛中二已巡检设备数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long equipmentInspectionRainSecondReports;
+
+	/**
+	 * 我巡检的设备数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long myInspectionCount;
+
+	/**
+	 * 本汛期已完成巡检设备百分比
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private String equipmentInspectionPercent;
+
+}

+ 37 - 0
src/main/java/org/springblade/modules/business/home/VO/RtuStatusCountInfoVO.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/27
+ */
+package org.springblade.modules.business.home.VO;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.home.Entity.HomeInfoEntity;
+
+
+/***
+ * Date:2022/8/27
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RtuStatusCountInfoVO extends HomeInfoEntity {
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long rtus;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long warningRtus;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long offlineRtus;
+
+}

+ 46 - 0
src/main/java/org/springblade/modules/business/home/VO/RtuUpDataCountInfoVO.java

@@ -0,0 +1,46 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/27
+ */
+package org.springblade.modules.business.home.VO;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.home.Entity.HomeInfoEntity;
+
+
+/***
+ * Date:2022/8/27
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RtuUpDataCountInfoVO extends HomeInfoEntity {
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long rainRtuCount;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long riverRtuCount;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long groundRtuCount;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long rainUpDataCount;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long riverUpDataCount;
+
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long groundUpDataCount;
+	
+}

+ 67 - 0
src/main/java/org/springblade/modules/business/home/VO/WarnCountInfoVO.java

@@ -0,0 +1,67 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/6/21
+ */
+package org.springblade.modules.business.home.VO;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.home.Entity.WarnCountInfoEntity;
+
+/***
+ * Date:2023/6/21
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WarnCountInfoVO extends WarnCountInfoEntity {
+
+	/**
+	 * 部门ID
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long deptId;
+	/**
+	 * 盟市名称
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private String adCity;
+
+	/**
+	 * 测站数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer rtus;
+
+	/**
+	 * 测站离线
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer warnOffline;
+
+	/**
+	 * 小时漏报
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer warnMissOut;
+
+	/**
+	 * 5分钟延时上报
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer warnUpMinDelay;
+
+	/**
+	 * 小时上报延时
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer warnUpHourDelay;
+}

+ 80 - 0
src/main/java/org/springblade/modules/business/home/VO/WarnKindCountInfoVO.java

@@ -0,0 +1,80 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/6/21
+ */
+package org.springblade.modules.business.home.VO;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.home.Entity.WarnCountInfoEntity;
+
+/***
+ * Date:2023/6/21
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WarnKindCountInfoVO extends WarnCountInfoEntity {
+
+	/**
+	 * 测站数量
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer warnRtus;
+
+	/**
+	 * 测站离线
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer offlineRtus;
+
+	/**
+	 * 时钟
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer clockWarn;
+
+	/**
+	 * 雨量小时漏报
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer rainUpMissOut;
+
+	/**
+	 * 水位小时漏报
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer riverUpMissOut;
+
+	/**
+	 * 5分钟延时上报
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer minUpDelay;
+
+	/**
+	 * 雨量小时上报延时
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer rainHourUpDelay;
+
+	/**
+	 * 水位小时上报延时
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer riverHourUpDelay;
+
+	/**
+	 * 异常值
+	 */
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Integer outlierValue;
+}

+ 448 - 7
src/main/java/org/springblade/modules/business/home/controller/HomeController.java

@@ -21,6 +21,7 @@ import org.springblade.core.tool.utils.ConcurrentDateFormat;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.enums.OrderCloseEnum;
 import org.springblade.enums.OrderConfirmEnum;
+import org.springblade.enums.WarnKindEnum;
 import org.springblade.modules.baseinfo.org.entity.DeptRegionEntity;
 import org.springblade.modules.baseinfo.org.service.IDeptRegionService;
 import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
@@ -34,19 +35,32 @@ import org.springblade.modules.business.check.process.dto.OrderProcessInfoDTO;
 import org.springblade.modules.business.check.process.service.IRtuOrderProcessService;
 import org.springblade.modules.business.check.process.vo.OrderProcessInfoVO;
 import org.springblade.modules.business.check.process.wrapper.RtuOrderProcessWrapper;
+import org.springblade.modules.business.data.dto.RtuDataGroundDTO;
+import org.springblade.modules.business.data.dto.RtuDataRainDTO;
+import org.springblade.modules.business.data.dto.RtuDataRiverDTO;
+import org.springblade.modules.business.data.service.IRtuDataGroundService;
+import org.springblade.modules.business.data.service.IRtuDataRainService;
+import org.springblade.modules.business.data.service.IRtuDataRiverService;
+import org.springblade.modules.business.equipment.inspection.base.dto.EquipmentInspectionInfoDTO;
+import org.springblade.modules.business.equipment.inspection.base.vo.OrgEquipmentInspectionStatisticsVO;
 import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
 import org.springblade.modules.business.equipment.inspection.plan.service.IEquipmentInspectionPlanService;
 import org.springblade.modules.business.equipment.inspection.report.dto.EquipmentInspectionReportDTO;
 import org.springblade.modules.business.equipment.inspection.report.service.IEquipmentInspectionReportService;
 import org.springblade.modules.business.equipment.inspection.report.vo.EquipmentInspectionReportVO;
 import org.springblade.modules.business.equipment.inspection.report.wrapper.EquipmentInspectionReportWrapper;
+import org.springblade.modules.business.home.VO.*;
 import org.springblade.modules.business.notice.dto.NoticeDTO;
 import org.springblade.modules.business.notice.entity.NoticeViewEntity;
 import org.springblade.modules.business.notice.service.INoticeService;
 import org.springblade.modules.business.notice.service.INoticeViewService;
-import org.springblade.modules.business.home.VO.HomeInfoVO;
 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.business.warning.vo.RtuWarningInfoVO;
+import org.springblade.modules.business.warning.wrapper.RtuWarningWrapper;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.service.IDeptService;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -82,7 +96,10 @@ public class HomeController {
 	private final IEquipmentInspectionPlanService planService;
 	private final IRtuOrderProcessService rtuOrderProcessService;
 	private final IEquipmentInspectionReportService equipmentInspectionReportService;
-
+	private final IDeptService deptService;
+	private final IRtuDataRainService rainService;
+	private final IRtuDataRiverService riverService;
+	private final IRtuDataGroundService groundService;
 	@Resource
 	private RedisTemplate redisTemplate;
 
@@ -117,6 +134,7 @@ public class HomeController {
 		warningInfoDTO.setAdCode(adCode);
 		long warningRtuCount = rtuWarningService.warningRtuCount(warningInfoDTO);
 		infoVO.setWarningRtus(warningRtuCount);
+
 		//任务总数
 		CheckOrderInfoDTO checkOrderInfoDTO = new CheckOrderInfoDTO();
 		checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
@@ -166,7 +184,6 @@ public class HomeController {
 			infoVO.setDelayComfireOrders(0L);
 		}
 
-
 		infoVO.setEquipmentInspectionCount(infoVO.getRtus());
 		EquipmentInspectionReportDTO inspectionReportDTO = new EquipmentInspectionReportDTO();
 		Calendar calendar = Calendar.getInstance();
@@ -303,10 +320,7 @@ public class HomeController {
 			infoVO.setHasNewNotice(false);
 			infoVO.setNewNoticeCount(0L);
 		}
-//		} else {
-//			infoVO.setHasNewNotice(false);
-//			infoVO.setNewNoticeCount(0L);
-//		}
+
 		OrderProcessInfoDTO processInfoDTO = new OrderProcessInfoDTO();
 		processInfoDTO.setAdCode(adCode);
 		Date date = new Date();
@@ -333,4 +347,431 @@ public class HomeController {
 		infoVO.setMyOrderCount(count);
 		return R.data(infoVO);
 	}
+
+	@GetMapping("/rtu/status/count/info")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情")
+	public R<RtuStatusCountInfoVO> rtuStatusCountInfo() {
+		BladeUser user = AuthUtil.getUser();
+		String adCode = null;
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			adCode = BusinessConstant.REGION_NM_ADCODE;
+		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+			if (deptRegionEntity != null) {
+				adCode = deptRegionEntity.getAdcd();
+			}
+		}
+		if (null == adCode) {
+			log.error("adcd is null********************");
+			return R.status(false);
+		}
+		RtuStatusCountInfoVO infoVO = new RtuStatusCountInfoVO();
+		//测站数量
+		long count = rtuBaseInfoService.rtuCount(adCode);
+		infoVO.setRtus(count);
+		RtuWarningInfoDTO warningInfoDTO = new RtuWarningInfoDTO();
+		warningInfoDTO.setAdCode(adCode);
+		count = rtuWarningService.warningRtuCount(warningInfoDTO);
+		infoVO.setWarningRtus(count);
+		RtuWarningInfoDTO rtuWarningInfoDTO = new RtuWarningInfoDTO();
+		rtuWarningInfoDTO.setAdCode(adCode);
+		count = rtuWarningService.warningOfflineRtuCount(rtuWarningInfoDTO);
+		infoVO.setOfflineRtus(count);
+
+		return R.data(infoVO);
+	}
+
+	@GetMapping("/rtu/checkorder/count/info")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情")
+	public R<RtuCheckOrderCountInfoVO> rtuCheckOrderCountInfo() {
+		BladeUser user = AuthUtil.getUser();
+		String adCode = null;
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			adCode = BusinessConstant.REGION_NM_ADCODE;
+		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+			if (deptRegionEntity != null) {
+				adCode = deptRegionEntity.getAdcd();
+			}
+		}
+		if (null == adCode) {
+			log.error("adcd is null********************");
+			return R.status(true);
+		}
+		RtuCheckOrderCountInfoVO infoVO = new RtuCheckOrderCountInfoVO();
+
+
+		//任务总数
+		CheckOrderInfoDTO checkOrderInfoDTO = new CheckOrderInfoDTO();
+		checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+		checkOrderInfoDTO.setAdCode(adCode);
+		long count = checkOrderService.orderCount(checkOrderInfoDTO);
+		infoVO.setOrderCount(count);
+		//未确认任务
+		checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CREATE.getCode());
+		count = checkOrderService.orderCount(checkOrderInfoDTO);
+		infoVO.setUnconfirmOrderCount(count);
+
+		checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
+		checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+		if (BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+			checkOrderInfoDTO.setContactUser(user.getUserId());
+		}
+		count = checkOrderService.orderCount(checkOrderInfoDTO);
+		infoVO.setProcessCheckOrderCount(count);
+
+		checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CREATE.getCode());
+		checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+		checkOrderInfoDTO.setAdCode(adCode);
+		List<CheckOrderInfoVO> orderList = checkOrderService.allOrders(checkOrderInfoDTO);
+		if (null != orderList && orderList.size() > 0) {
+			long delayTime = 120;
+			LambdaQueryWrapper<CheckOrderSettingEntity> wrapper = Wrappers.<CheckOrderSettingEntity>query().lambda();
+			wrapper.eq(CheckOrderSettingEntity::getIsDeleted, 0);
+			List<CheckOrderSettingEntity> list = checkOrderSettingService.list(wrapper);
+			if (null != list && list.size() > 0) {
+				delayTime = list.get(0).getOrderComfireDelayTime();
+			}
+			long delayCount = 0;
+			Date dt = new Date();
+			for (CheckOrderInfoVO checkOrderInfoVO : orderList) {
+				Duration duration = Func.between(checkOrderInfoVO.getCreateTime(), dt);
+				long second = duration.getSeconds();
+				if (second > 0) {
+					second = second / 60L;
+					if (second > delayTime) {
+						delayCount += 1;
+					}
+				}
+			}
+			infoVO.setDelayComfireOrders(delayCount);
+		} else {
+			infoVO.setDelayComfireOrders(0L);
+		}
+
+		//我的任务
+		LambdaQueryWrapper<CheckOrderInfoEntity> orderWrapper = Wrappers.<CheckOrderInfoEntity>query().lambda();
+		orderWrapper.eq(CheckOrderInfoEntity::getContactUser, user.getUserId());
+		orderWrapper.eq(CheckOrderInfoEntity::getOrderConfirm, OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
+		orderWrapper.eq(CheckOrderInfoEntity::getOrderClose, OrderCloseEnum.ACTIVE_OPEN.getCode());
+		orderWrapper.eq(CheckOrderInfoEntity::getIsDeleted, 0);
+		count = checkOrderService.count(orderWrapper);
+		infoVO.setMyOrderCount(count);
+		return R.data(infoVO);
+	}
+
+	@GetMapping("/rtu/inspectionreport/count/info")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情")
+	public R<RtuInspectionReportCountInfoVO> rtuInspectionReportCountInfo() {
+		BladeUser user = AuthUtil.getUser();
+		String adCode = null;
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			adCode = BusinessConstant.REGION_NM_ADCODE;
+		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+			if (deptRegionEntity != null) {
+				adCode = deptRegionEntity.getAdcd();
+			}
+		}
+		if (null == adCode) {
+			log.error("adcd is null********************");
+			return R.status(true);
+		}
+		RtuInspectionReportCountInfoVO infoVO = new RtuInspectionReportCountInfoVO();
+		long count = rtuBaseInfoService.rtuCount(adCode);
+		infoVO.setEquipmentInspectionCount(count);
+		EquipmentInspectionReportDTO inspectionReportDTO = new EquipmentInspectionReportDTO();
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(new Date());
+		calendar.set(Calendar.MONTH, 0);
+		calendar.set(Calendar.DAY_OF_MONTH, 1);
+		calendar.set(Calendar.HOUR_OF_DAY, 0);
+		calendar.set(Calendar.MINUTE, 0);
+		calendar.set(Calendar.SECOND, 0);
+		inspectionReportDTO.setInspectionYearStartDate(calendar.getTime());
+		calendar.add(Calendar.YEAR, 1);
+		inspectionReportDTO.setInspectionYearEndDate(calendar.getTime());
+		inspectionReportDTO.setRainSeasonKind(1);
+		inspectionReportDTO.setAdCode(adCode);
+		count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
+		infoVO.setEquipmentInspectionBeforeRainReports(count);
+		inspectionReportDTO.setRainSeasonKind(2);
+		count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
+		infoVO.setEquipmentInspectionRainFirstReports(count);
+		inspectionReportDTO.setRainSeasonKind(3);
+		count = inspectionReportService.equipmentInspectionReportCount(inspectionReportDTO);
+		infoVO.setEquipmentInspectionRainSecondReports(count);
+
+		//处理汛期类别
+		LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
+		wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
+		wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
+		List<EquipmentInspectionPlanEntity> list = planService.list(wrapper);
+		if (null != list && list.size() > 0) {
+			EquipmentInspectionPlanEntity entity = list.get(0);
+			Calendar dt = Calendar.getInstance();
+			dt.setTime(new Date());
+			Calendar calendarStart = Calendar.getInstance();
+			Calendar calendarEnd = Calendar.getInstance();
+			//汛前上报
+			calendarStart.setTime(entity.getBeforeRainSeasonStartTime());
+			calendarEnd.setTime(entity.getBeforeRainSeasonEndTime());
+			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+				infoVO.setEquipmentInspectionRainCount(infoVO.getEquipmentInspectionCount() - infoVO.getEquipmentInspectionBeforeRainReports());
+			}
+
+			//汛中第一次上报
+			calendarStart.setTime(entity.getRainSeasonFirstStartTime());
+			calendarEnd.setTime(entity.getRainSeasonFirstEndTime());
+			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+				infoVO.setEquipmentInspectionRainCount(infoVO.getEquipmentInspectionCount() - infoVO.getEquipmentInspectionRainFirstReports());
+			}
+
+			//汛中第二次上报
+			calendarStart.setTime(entity.getRainSeasonSecondStartTime());
+			calendarEnd.setTime(entity.getRainSeasonSecondEndTime());
+			if ((dt.getTime().getTime() / 1000 == calendarStart.getTime().getTime() / 1000 || dt.after(calendarStart)) && dt.before(calendarEnd)) {
+				infoVO.setEquipmentInspectionRainCount(infoVO.getEquipmentInspectionCount() - infoVO.getEquipmentInspectionRainSecondReports());
+			}
+		} else {
+			Calendar dt = Calendar.getInstance();
+			dt.setTime(new Date());
+			//汛前上报
+			Calendar calendarStart = Calendar.getInstance();
+			calendarStart.setTime(dt.getTime());
+			calendarStart.set(Calendar.MONTH, 4 - 1);
+			calendarStart.set(Calendar.DAY_OF_MONTH, 1);
+			calendarStart.set(Calendar.HOUR_OF_DAY, 0);
+			calendarStart.set(Calendar.MINUTE, 0);
+			calendarStart.set(Calendar.SECOND, 0);
+			Calendar calendarEnd = Calendar.getInstance();
+			calendarEnd.setTime(dt.getTime());
+			calendarEnd.set(Calendar.MONTH, 6 - 1);
+			calendarEnd.set(Calendar.DAY_OF_MONTH, 1);
+			calendarEnd.set(Calendar.HOUR_OF_DAY, 0);
+			calendarEnd.set(Calendar.MINUTE, 0);
+			calendarEnd.set(Calendar.SECOND, 0);
+			if (dt.after(calendarStart) && dt.before(calendarEnd)) {
+				infoVO.setEquipmentInspectionRainCount(infoVO.getEquipmentInspectionCount() - infoVO.getEquipmentInspectionBeforeRainReports());
+			}
+
+			//汛中第一次上报
+			calendarStart.setTime(dt.getTime());
+			calendarStart.set(Calendar.MONTH, 6 - 1);
+			calendarStart.set(Calendar.DAY_OF_MONTH, 1);
+			calendarStart.set(Calendar.HOUR_OF_DAY, 0);
+			calendarStart.set(Calendar.MINUTE, 0);
+			calendarStart.set(Calendar.SECOND, 0);
+			calendarEnd.setTime(dt.getTime());
+			calendarEnd.set(Calendar.MONTH, 8 - 1);
+			calendarEnd.set(Calendar.DAY_OF_MONTH, 15);
+			calendarEnd.set(Calendar.HOUR_OF_DAY, 0);
+			calendarEnd.set(Calendar.MINUTE, 0);
+			calendarEnd.set(Calendar.SECOND, 0);
+			if (dt.after(calendarStart) && dt.before(calendarEnd)) {
+				infoVO.setEquipmentInspectionRainCount(infoVO.getEquipmentInspectionCount() - infoVO.getEquipmentInspectionRainFirstReports());
+			}
+
+			//汛中第二次上报
+			calendarStart.setTime(dt.getTime());
+			calendarStart.set(Calendar.MONTH, 8 - 1);
+			calendarStart.set(Calendar.DAY_OF_MONTH, 15);
+			calendarStart.set(Calendar.HOUR_OF_DAY, 0);
+			calendarStart.set(Calendar.MINUTE, 0);
+			calendarStart.set(Calendar.SECOND, 0);
+			calendarEnd.setTime(dt.getTime());
+			calendarEnd.set(Calendar.MONTH, 10 - 1);
+			calendarEnd.set(Calendar.DAY_OF_MONTH, 1);
+			calendarEnd.set(Calendar.HOUR_OF_DAY, 0);
+			calendarEnd.set(Calendar.MINUTE, 0);
+			calendarEnd.set(Calendar.SECOND, 0);
+			if (dt.after(calendarStart) && dt.before(calendarEnd)) {
+				infoVO.setEquipmentInspectionRainCount(infoVO.getEquipmentInspectionCount() - infoVO.getEquipmentInspectionRainSecondReports());
+			}
+		}
+
+		return R.data(infoVO);
+	}
+
+
+	@GetMapping("/rtu/up/count/info")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情")
+	public R<RtuUpDataCountInfoVO> rtuUpCountInfo() {
+		BladeUser user = AuthUtil.getUser();
+		String adCode = null;
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			adCode = BusinessConstant.REGION_NM_ADCODE;
+		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+			if (deptRegionEntity != null) {
+				adCode = deptRegionEntity.getAdcd();
+			}
+		}
+		if (null == adCode) {
+			log.error("adcd is null********************");
+			return R.status(false);
+		}
+		RtuUpDataCountInfoVO infoVO = new RtuUpDataCountInfoVO();
+		long count = rtuBaseInfoService.rtuRainCount(adCode);
+		infoVO.setRainRtuCount(count);
+		count = rtuBaseInfoService.rtuRiverCount(adCode);
+		infoVO.setRiverRtuCount(count);
+		count = rtuBaseInfoService.rtuGroundCount(adCode);
+		infoVO.setGroundRtuCount(count);
+		Calendar calendar = Calendar.getInstance();
+		calendar.set(Calendar.HOUR_OF_DAY, 0);
+		calendar.set(Calendar.MINUTE, 0);
+		calendar.set(Calendar.SECOND, 0);
+		Date endTime = calendar.getTime();
+		calendar.add(Calendar.DAY_OF_MONTH, -1);
+		Date beiganTime = calendar.getTime();
+		//测站上报统计
+		RtuDataRainDTO rainDTO = new RtuDataRainDTO();
+		rainDTO.setAdCode(adCode);
+		rainDTO.setBeginTime(beiganTime);
+		rainDTO.setEndTime(endTime);
+		count = rainService.rtuUpDataCount(rainDTO);
+		infoVO.setRainUpDataCount(count);
+		RtuDataRiverDTO riverDTO = new RtuDataRiverDTO();
+		riverDTO.setAdCode(adCode);
+		riverDTO.setBeginTime(beiganTime);
+		riverDTO.setEndTime(endTime);
+		count = riverService.rtuUpDataCount(riverDTO);
+		infoVO.setRiverUpDataCount(count);
+		RtuDataGroundDTO groundDTO = new RtuDataGroundDTO();
+		groundDTO.setAdCode(adCode);
+		groundDTO.setBeginTime(beiganTime);
+		groundDTO.setEndTime(endTime);
+		count = groundService.rtuUpDataCount(groundDTO);
+		infoVO.setGroundUpDataCount(count);
+		return R.data(infoVO);
+	}
+
+	@GetMapping("/warn/count/list")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "预警统计列表", notes = "")
+	public R<List<WarnCountInfoVO>> warnCountInfoList() {
+		BladeUser user = AuthUtil.getUser();
+		if (!BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			return R.data(null);
+		}
+		List<WarnCountInfoVO> list = new LinkedList<>();
+//		//合计
+//		WarnCountInfoVO sumVo = new WarnCountInfoVO();
+//		sumVo.setDeptId(0L);
+//		sumVo.setAdCity("合计");
+//		//测站数量
+//		Long count = rtuBaseInfoService.rtuCount(BusinessConstant.REGION_NM_ADCODE);
+//		sumVo.setRtus(count.intValue());
+//		//离线数量
+//		RtuWarningInfoDTO dto = new RtuWarningInfoDTO();
+//		dto.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+//		count = rtuWarningService.warningOfflineRtuCount(dto);
+//		sumVo.setWarnOffline(count.intValue());
+//		//小时漏报
+//		count = rtuWarningService.warningHourMissOutRtuCount(dto);
+//		sumVo.setWarnMissOut(count.intValue());
+//		//5分钟延时
+//		count = rtuWarningService.warningMinUpDelayRtuCount(dto);
+//		sumVo.setWarnUpMinDelay(count.intValue());
+//		//小时报延时
+//		count = rtuWarningService.warningHourUpDelayRtuCount(dto);
+//		sumVo.setWarnUpHourDelay(count.intValue());
+//		list.add(sumVo);
+		//盟市统计
+		LambdaQueryWrapper<Dept> wrapper = Wrappers.<Dept>query().lambda();
+		wrapper.eq(Dept::getIsDeleted, 0);
+		wrapper.eq(Dept::getParentId, Func.toLong(user.getDeptId()));
+		List<Dept> deptList = this.deptService.list(wrapper);
+		for (Dept dept : deptList) {
+			WarnCountInfoVO vo = new WarnCountInfoVO();
+			//盟市名称
+			vo.setDeptId(dept.getId());
+			vo.setAdCity(dept.getDeptName());
+			//测站数量
+			LambdaQueryWrapper<DeptRegionEntity> deptLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+			deptLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+			deptLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, dept.getId());
+			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptLambdaQueryWrapper);
+			Long count = rtuBaseInfoService.rtuCount(deptRegionEntity.getAdcd());
+			vo.setRtus(count.intValue());
+			//离线数量
+			RtuWarningInfoDTO dto = new RtuWarningInfoDTO();
+			dto.setAdCode(deptRegionEntity.getAdcd());
+			count = rtuWarningService.warningOfflineRtuCount(dto);
+			vo.setWarnOffline(count.intValue());
+			//小时漏报
+			count = rtuWarningService.warningHourMissOutRtuCount(dto);
+			vo.setWarnMissOut(count.intValue());
+			//5分钟延时
+			count = rtuWarningService.warningMinUpDelayRtuCount(dto);
+			vo.setWarnUpMinDelay(count.intValue());
+			//小时报延时
+			count = rtuWarningService.warningHourUpDelayRtuCount(dto);
+			vo.setWarnUpHourDelay(count.intValue());
+			list.add(vo);
+		}
+		return R.data(list);
+	}
+
+	@GetMapping("/rtu/warn/kind/count/info")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情")
+	public R<WarnKindCountInfoVO> rtuWarnKindCountInfo() {
+		BladeUser user = AuthUtil.getUser();
+		String adCode = null;
+		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+			adCode = BusinessConstant.REGION_NM_ADCODE;
+		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
+			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
+			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+			if (deptRegionEntity != null) {
+				adCode = deptRegionEntity.getAdcd();
+			}
+		}
+		if (null == adCode) {
+			log.error("adcd is null********************");
+			return R.status(false);
+		}
+		WarnKindCountInfoVO infoVO = new WarnKindCountInfoVO();
+		RtuWarningInfoDTO dto = new RtuWarningInfoDTO();
+		dto.setAdCode(adCode);
+		Long count = rtuWarningService.warningRtuCount(dto);
+		infoVO.setWarnRtus(count.intValue());
+		count = rtuWarningService.warningClockRtuCount(dto);
+		infoVO.setClockWarn(count.intValue());
+		count = rtuWarningService.warningOfflineRtuCount(dto);
+		infoVO.setOfflineRtus(count.intValue());
+		count = rtuWarningService.warningRainHourMissOutRtuCount(dto);
+		infoVO.setRainUpMissOut(count.intValue());
+		count = rtuWarningService.warningRiverHourMissOutRtuCount(dto);
+		infoVO.setRiverUpMissOut(count.intValue());
+		count = rtuWarningService.warningMinUpDelayRtuCount(dto);
+		infoVO.setMinUpDelay(count.intValue());
+		count = rtuWarningService.warningRainHourUpDelayRtuCount(dto);
+		infoVO.setRainHourUpDelay(count.intValue());
+		count = rtuWarningService.warningRiverHourUpDelayRtuCount(dto);
+		infoVO.setRiverHourUpDelay(count.intValue());
+		count = rtuWarningService.warningOutlierValueRtuCount(dto);
+		infoVO.setOutlierValue(count.intValue());
+		return R.data(infoVO);
+	}
 }

+ 10 - 10
src/main/java/org/springblade/modules/business/rtumanage/controller/RtuManageController.java

@@ -307,7 +307,6 @@ public class RtuManageController extends BladeController {
 			} else {
 				entity.setRainSensorModel("");
 			}
-
 			if (rtuInfoEntity.getRainSensorReplaceDate() != null) {
 				entity.setRainSensorReplaceDate(Func.formatDate(rtuInfoEntity.getRainSensorReplaceDate()));
 			} else {
@@ -315,7 +314,9 @@ public class RtuManageController extends BladeController {
 			}
 			if (rtuInfoEntity.getWaterSensorType() != null) {
 				DictBiz dictBiz = dictBizService.getById(rtuInfoEntity.getWaterSensorType());
-				entity.setWaterSensorType(dictBiz.getDictValue());
+				if (null != dictBiz) {
+					entity.setWaterSensorType(dictBiz.getDictValue());
+				}
 			} else {
 				entity.setWaterSensorType("");
 			}
@@ -334,11 +335,11 @@ public class RtuManageController extends BladeController {
 			} else {
 				entity.setWaterSensorReplaceDate("");
 			}
-
-
 			if (rtuInfoEntity.getGroundSensorType() != null) {
 				DictBiz dictBiz = dictBizService.getById(rtuInfoEntity.getGroundSensorType());
-				entity.setGroundSensorType(dictBiz.getDictValue());
+				if(null != dictBiz) {
+					entity.setGroundSensorType(dictBiz.getDictValue());
+				}
 			} else {
 				entity.setGroundSensorType("");
 			}
@@ -357,7 +358,6 @@ public class RtuManageController extends BladeController {
 			} else {
 				entity.setGroundSensorReplaceDate("");
 			}
-
 			if (rtuInfoEntity.getBatteryModel() != null) {
 				entity.setBatteryModel(rtuInfoEntity.getBatteryModel());
 			} else {
@@ -368,7 +368,6 @@ public class RtuManageController extends BladeController {
 			} else {
 				entity.setBatteryReplaceDate("");
 			}
-
 			if (rtuInfoEntity.getSunPowerModel() != null) {
 				entity.setSunPowerModel(rtuInfoEntity.getSunPowerModel());
 			} else {
@@ -389,7 +388,6 @@ public class RtuManageController extends BladeController {
 			} else {
 				entity.setNetworkPayEndDate("");
 			}
-
 			if (rtuInfoEntity.getIsSatellite() != null) {
 				if (rtuInfoEntity.getIsSatellite() == 1) {
 					entity.setIsSatellite("是");
@@ -400,8 +398,10 @@ public class RtuManageController extends BladeController {
 				entity.setIsSatellite("");
 			}
 			if (rtuInfoEntity.getSatelliteModel() != null) {
-				DictBiz dictBiz = dictBizService.getById(rtuInfoEntity.getGroundSensorType());
-				entity.setSatelliteModel(dictBiz.getDictValue());
+				DictBiz dictBiz = dictBizService.getById(rtuInfoEntity.getSatelliteModel());
+				if (dictBiz!=null){
+					entity.setSatelliteModel(dictBiz.getDictValue());
+				}
 			} else {
 				entity.setSatelliteModel("");
 			}

+ 1 - 2
src/main/java/org/springblade/modules/business/rtumanage/mapper/RtuManageMapper.xml

@@ -56,7 +56,6 @@
         FROM
         rtu_info d
         LEFT JOIN  rtu_status n ON n.rtu_code = d.rtu_code and  n.is_deleted = 0
-        LEFT JOIN rtu_warning w ON w.rtu_code = d.rtu_code and w.is_deleted = 0 and w.warning_kind=1
         LEFT JOIN  data_ad_cd_b a ON a.adcd = d.ad_code and a.is_deleted=0
         WHERE
         d.is_deleted = 0
@@ -84,7 +83,7 @@
         <if test="rtuInfoDTO.adCode!=null">
             and (d.ad_code =#{rtuInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuInfoDTO.adCode}), '%')))
         </if>
-        order by IF(isnull(n.run_status_id),1,0) ,n.run_status_id desc,w.warning_kind desc, d.rtu_code asc
+        order by IF(isnull(n.run_status_id),1,0) ,n.run_status_id desc,d.rtu_code asc
     </select>
 
     <select id="selectWarnPage" resultMap="rtuStatusVOResultMap">

+ 1 - 1
src/main/java/org/springblade/modules/business/rtumanage/wrapper/RtuManageWrapper.java

@@ -231,7 +231,7 @@ public class RtuManageWrapper extends BaseEntityWrapper<RtuStatusEntity, RtuStat
 			}
 		}
 
-		if (entity.getRunStatusId() ==1) {
+		if (entity.getRunStatusId()!=null && entity.getRunStatusId() ==1) {
 			LambdaQueryWrapper<RtuWarningInfoEntity> queryWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
 			queryWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
 			queryWrapper.eq(RtuWarningInfoEntity::getRtuCode, entity.getRtuCode());

+ 385 - 11
src/main/java/org/springblade/modules/business/warning/controller/RtuWarningController.java

@@ -52,7 +52,7 @@ import java.util.List;
 public class RtuWarningController extends BladeController {
 	private final IRtuWarningService rtuWarningService;
 	private final IOriginalWarningService originalWarningService;
-    private final IDeptRegionService deptRegionService;
+	private final IDeptRegionService deptRegionService;
 
 	@GetMapping("/list")
 	@ApiOperationSupport(order = 3)
@@ -76,23 +76,397 @@ public class RtuWarningController extends BladeController {
 		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
 		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
 		@ApiImplicitParam(name = "warningStatus", value = "测站名称", paramType = "query", dataType = "int"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+
 	})
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页")
 	public R<IPage<RtuWarningInfoVO>> page(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
 		BladeUser user = AuthUtil.getUser();
-		if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
-			rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
-		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
-			LambdaQueryWrapper<DeptRegionEntity> deptRegionEntityLambdaQueryWrapper = Wrappers.<DeptRegionEntity>query().lambda();
-			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getIsDeleted, 0);
-			deptRegionEntityLambdaQueryWrapper.eq(DeptRegionEntity::getDeptId, Func.toLong(user.getDeptId()));
-			DeptRegionEntity deptRegionEntity = deptRegionService.getOne(deptRegionEntityLambdaQueryWrapper);
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectPage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+	@GetMapping("/clock/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> clockPage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectClockPage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/offline/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> offlinePage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectOfflinePage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/hourmissout/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> hourMissOutPage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectHourMissOutPage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+	@GetMapping("/rain/hourmissout/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> rainHourMissOutPage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectRainHourMissOutPage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+	@GetMapping("/river/hourmissout/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> riverHourMissOutPage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectRiverHourMissOutPage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/minupdelay/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> minUpDelayPage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectMinUpDelayPage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/hourupdelay/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> hourUpDelayPage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectHourUpDelayPage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+	@GetMapping("/rain/hourupdelay/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> rainHourUpDelayPage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectRainHourUpDelayPage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+
+	@GetMapping("/river/hourupdelay/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> riverHourUpDelayPage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
+			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
+		}
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectRiverHourUpDelayPage(Condition.getPage(query), rtuWarningInfoDTO);
+		List<RtuWarningInfoVO> list = pages.getRecords();
+		for (RtuWarningInfoVO vo : list) {
+			RtuWarningWrapper.build().entityVO(vo);
+		}
+		return R.data(pages);
+	}
+
+
+	@GetMapping("/outltervalue/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType = "long"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<RtuWarningInfoVO>> outlterValuePage(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (rtuWarningInfoDTO.getDeptId() != null && rtuWarningInfoDTO.getDeptId() > 0) {
+			DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(rtuWarningInfoDTO.getDeptId());
+			if (null == deptRegionEntity) {
+				return R.status(false);
+			}
 			rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+		} else {
+			if (BusinessConstant.ROLE_SYS_ADMIN.equals(user.getRoleName())) {
+				rtuWarningInfoDTO.setAdCode(BusinessConstant.REGION_NM_ADCODE);
+			} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_COMPANY_SERVICE_PERSON.equals(user.getRoleName())) {
+				DeptRegionEntity deptRegionEntity = deptRegionService.getRegionByDeptId(Func.toLong(user.getDeptId()));
+				if (null == deptRegionEntity) {
+					return R.status(false);
+				}
+				rtuWarningInfoDTO.setAdCode(deptRegionEntity.getAdcd());
+			}
 		}
-		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectPage(Condition.getPage(query),rtuWarningInfoDTO);
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectOutlierValuePage(Condition.getPage(query), rtuWarningInfoDTO);
 		List<RtuWarningInfoVO> list = pages.getRecords();
-		for (RtuWarningInfoVO vo:list){
+		for (RtuWarningInfoVO vo : list) {
 			RtuWarningWrapper.build().entityVO(vo);
 		}
 		return R.data(pages);
@@ -113,7 +487,7 @@ public class RtuWarningController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入RtuWarningInfoEntity")
 	public R<OriginalWarningInfoVO> originalWarnDetail(RtuWarningInfoEntity rtuWarningInfoEntity) {
-		RtuWarningInfoEntity detail=	rtuWarningService.getById(rtuWarningInfoEntity.getId());
+		RtuWarningInfoEntity detail = rtuWarningService.getById(rtuWarningInfoEntity.getId());
 
 
 		OriginalWarningInfoEntity originalDetail = originalWarningService.getById(detail.getDataFromId());

+ 3 - 1
src/main/java/org/springblade/modules/business/warning/dto/RtuWarningInfoDTO.java

@@ -26,7 +26,7 @@ public class RtuWarningInfoDTO extends RtuWarningInfoEntity {
 	 * 机构ID
 	 */
 	@ApiModelProperty("机构ID")
-	private Long orgId;
+	private Long deptId;
 
 	/**
 	 * 行政区划
@@ -39,4 +39,6 @@ public class RtuWarningInfoDTO extends RtuWarningInfoEntity {
 	 */
 	@ApiModelProperty("测站名称")
 	private String  rtuName;
+
+
 }

+ 18 - 2
src/main/java/org/springblade/modules/business/warning/entity/RtuWarningInfoEntity.java

@@ -19,7 +19,7 @@ import java.util.Date;
 
 /***
  * Date:2022/8/24
- * Title:文件所属模块(必须填写)
+ * Title:预警信息表
  * Description:对本文件的详细描述,原则上不能少于30字
  * @author dylan
  * @version 1.0
@@ -48,13 +48,17 @@ public class RtuWarningInfoEntity extends BaseEntity {
 	@ApiModelProperty("预警类型")
 	private Integer warningKind;
 
-
 	/**
 	 * 预警信息
 	 */
 	@ApiModelProperty("预警信息")
 	private String warningDesc;
 
+	/**
+	 * 预警恢复描述说明
+	 */
+	@ApiModelProperty("预警恢复描述说明")
+	private String warningRecoveryDesc;
 
 	/**
 	 * 预警发生时间
@@ -90,4 +94,16 @@ public class RtuWarningInfoEntity extends BaseEntity {
 	 */
 	@ApiModelProperty("原始数据表中ID")
 	private Long dataFromId;
+
+	/**
+	 * 发生预警时测站最后上线时间
+	 */
+	@ApiModelProperty("最后上线时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+	)
+	private Date rtuLastTime;
 }

+ 58 - 0
src/main/java/org/springblade/modules/business/warning/mapper/RtuWarningMapper.java

@@ -32,10 +32,68 @@ public interface RtuWarningMapper extends BaseMapper<RtuWarningInfoEntity> {
 	 */
 	List<RtuWarningInfoVO> selectPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
 
+	List<RtuWarningInfoVO> selectOfflinePage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	List<RtuWarningInfoVO> selectClockPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	List<RtuWarningInfoVO> selectHourMissOutPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+	List<RtuWarningInfoVO> selectRainHourMissOutPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+	List<RtuWarningInfoVO> selectRiverHourMissOutPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	List<RtuWarningInfoVO> selectMinUpDelayPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	List<RtuWarningInfoVO> selectHourUpDelayPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	List<RtuWarningInfoVO> selectRainHourUpDelayPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+	List<RtuWarningInfoVO> selectRiverHourUpDelayPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	List<RtuWarningInfoVO> selectOutlierValuePage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
 	/**
 	 * 设备异常测站数量
 	 * @param rtuWarningInfoDTO
 	 * @return
 	 */
 	Long warningRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningClockRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	/**
+	 * 离线测站数量
+	 * @param rtuWarningInfoDTO
+	 * @return
+	 */
+	Long warningOfflineRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	/**
+	 * 小时报漏报测站数量
+	 * @param rtuWarningInfoDTO
+	 * @return
+	 */
+	Long warningHourMissOutRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRainHourMissOutRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRiverHourMissOutRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	/**
+	 * 分钟报延时测站数量
+	 * @param rtuWarningInfoDTO
+	 * @return
+	 */
+	Long warningMinUpDelayRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	/**
+	 * 小时报延时测站数量
+	 * @param rtuWarningInfoDTO
+	 * @return
+	 */
+	Long warningHourUpDelayRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRainHourUpDelayRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRiverHourUpDelayRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningOutlierValueRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
 }

+ 394 - 0
src/main/java/org/springblade/modules/business/warning/mapper/RtuWarningMapper.xml

@@ -12,6 +12,7 @@
         <result column="warning_recovery_time" property="warningRecoveryTime"/>
         <result column="warning_status" property="warningStatus"/>
         <result column="data_from_id" property="dataFromId"/>
+        <result column="rtu_last_time" property="rtuLastTime"/>
     </resultMap>
 
     <!-- 通用查询映射结果 -->
@@ -23,6 +24,7 @@
         <result column="warning_recovery_time" property="warningRecoveryTime"/>
         <result column="warning_status" property="warningStatus"/>
         <result column="data_from_id" property="dataFromId"/>
+        <result column="rtu_last_time" property="rtuLastTime"/>
         <result column="rtu_name" property="rtuName"/>
         <result column="ad_city" property="adCity"/>
         <result column="ad_dist" property="adDist"/>
@@ -55,6 +57,218 @@
         order by w.warning_happen_time desc
     </select>
 
+    <select id="selectOfflinePage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0 and w.warning_kind = 1
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+    <select id="selectClockPage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0 and w.warning_kind = 2
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+    <select id="selectHourMissOutPage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0 and (w.warning_kind = 3 or  w.warning_kind = 4)
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+    <select id="selectRainHourMissOutPage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0 and w.warning_kind = 3
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+    <select id="selectRiverHourMissOutPage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0 and w.warning_kind = 4
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+    <select id="selectMinUpDelayPage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0 and w.warning_kind = 5
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+
+    <select id="selectHourUpDelayPage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0  and (w.warning_kind = 6 or  w.warning_kind = 7)
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+    <select id="selectRainHourUpDelayPage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0  and w.warning_kind = 6
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+
+    <select id="selectRiverHourUpDelayPage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0  and w.warning_kind = 7
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+    <select id="selectOutlierValuePage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, r.rtu_name,r.ad_city,r.ad_dist,a.ancestors,a.adcd
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON r.rtu_code = w.rtu_code
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0 and w.warning_status = 0  and w.warning_kind = 8
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and r.rtu_code like concat(concat('%', #{rtuWarningInfoDTO.rtuCode}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.rtuName!=null">
+            and r.rtu_name like concat(concat('%', #{rtuWarningInfoDTO.rtuName}), '%')
+        </if>
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
     <select id="warningRtuCount" resultType="java.lang.Long">
         SELECT count(*) FROM
         ( SELECT
@@ -71,4 +285,184 @@
         and w.warning_status = 0
         group by w.rtu_code ) a
     </select>
+
+    <select id="warningOfflineRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and w.warning_kind = 1
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
+
+    <select id="warningClockRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and w.warning_kind = 2
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
+
+    <select id="warningRainHourMissOutRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and w.warning_kind = 3
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
+
+    <select id="warningRiverHourMissOutRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and w.warning_kind = 4
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
+
+    <select id="warningHourMissOutRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and (w.warning_kind = 3 or  w.warning_kind = 4)
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
+
+    <select id="warningMinUpDelayRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and w.warning_kind = 5
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
+
+    <select id="warningHourUpDelayRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and (w.warning_kind = 6 or  w.warning_kind = 7)
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
+
+    <select id="warningRainHourUpDelayRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and w.warning_kind = 6
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
+
+    <select id="warningRiverHourUpDelayRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and w.warning_kind = 7
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
+
+    <select id="warningOutlierValueRtuCount" resultType="java.lang.Long">
+        SELECT count(*) FROM
+        ( SELECT
+        w.rtu_code
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info r ON w.rtu_code = r.rtu_code and r.is_deleted=0
+        LEFT JOIN data_ad_cd_b a ON a.adcd = r.ad_code and a.is_deleted=0
+        WHERE
+        w.is_deleted = 0
+        and w.warning_kind = 8
+        <if test="rtuWarningInfoDTO.adCode!=null">
+            and (a.adcd =#{rtuWarningInfoDTO.adCode} or a.ancestors in (SELECT ancestors FROM data_ad_cd_b WHERE ancestors  like concat(concat('%', #{rtuWarningInfoDTO.adCode}), '%')))
+        </if>
+        and w.warning_status = 0
+        group by w.rtu_code ) a
+    </select>
 </mapper>

+ 75 - 4
src/main/java/org/springblade/modules/business/warning/service/IRtuWarningService.java

@@ -8,6 +8,7 @@ package org.springblade.modules.business.warning.service;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.etl.entity.EtlRainDataEntity;
 import org.springblade.etl.entity.EtlRiverDataEntity;
@@ -18,6 +19,8 @@ import org.springblade.modules.business.warning.dto.RtuWarningInfoDTO;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
 import org.springblade.modules.business.warning.vo.RtuWarningInfoVO;
 
+import java.util.List;
+
 /***
  * Date:2022/8/24
  * Title:预警服务接口模块
@@ -36,6 +39,26 @@ public interface IRtuWarningService extends BaseService<RtuWarningInfoEntity> {
 	 */
 	IPage<RtuWarningInfoVO> selectPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);
 
+	IPage<RtuWarningInfoVO> selectClockPage(IPage<RtuWarningInfoVO> page,RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	IPage<RtuWarningInfoVO> selectOfflinePage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	IPage<RtuWarningInfoVO> selectHourMissOutPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	IPage<RtuWarningInfoVO> selectRainHourMissOutPage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);
+	IPage<RtuWarningInfoVO> selectRiverHourMissOutPage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);
+
+
+	IPage<RtuWarningInfoVO> selectMinUpDelayPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	IPage<RtuWarningInfoVO> selectHourUpDelayPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	IPage<RtuWarningInfoVO> selectRainHourUpDelayPage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);
+	IPage<RtuWarningInfoVO> selectRiverHourUpDelayPage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	IPage<RtuWarningInfoVO> selectOutlierValuePage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);
+
+
 	/**
 	 * 设备异常测站数量
 	 * @param rtuWarningInfoDTO
@@ -43,6 +66,54 @@ public interface IRtuWarningService extends BaseService<RtuWarningInfoEntity> {
 	 */
 	Long warningRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
 
+	/**
+	 * 离线测站数量
+	 * @param rtuWarningInfoDTO
+	 * @return
+	 */
+	Long warningOfflineRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	/**
+	 * 时钟异常
+	 * @param rtuWarningInfoDTO
+	 * @return
+	 */
+	Long warningClockRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	/**
+	 * 小时报漏报测站数量
+	 * @param rtuWarningInfoDTO
+	 * @return
+	 */
+	Long warningHourMissOutRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRainHourMissOutRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRiverHourMissOutRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	/**
+	 * 分钟报延时测站数量
+	 * @param rtuWarningInfoDTO
+	 * @return
+	 */
+	Long warningMinUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	/**
+	 * 小时报延时测站数量
+	 * @param rtuWarningInfoDTO
+	 * @return
+	 */
+	Long warningHourUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRainHourUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRiverHourUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningOutlierValueRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
+
+
+
+
 	/**
 	 * 测站时钟检测
 	 * @param rtuInfoEntity
@@ -98,17 +169,17 @@ public interface IRtuWarningService extends BaseService<RtuWarningInfoEntity> {
 
 	/**
 	 * 测站河道小时报漏报
-	 * @param etlRiverDataEntity
+	 * @param rtuInfoEntity
 	 * @return
 	 */
-	boolean checkRtuRiverMissOutStatus(EtlRiverDataEntity etlRiverDataEntity);
+	boolean checkRtuRiverMissOutStatus(RtuInfoEntity rtuInfoEntity);
 
 	/**
 	 * 测站水库小时报漏报
-	 * @param etlRsvrDataEntity
+	 * @param rtuInfoEntity
 	 * @return
 	 */
-	boolean checkRtuRsvrMissOutStatus(EtlRsvrDataEntity etlRsvrDataEntity);
+	boolean checkRtuRsvrMissOutStatus(RtuInfoEntity rtuInfoEntity);
 
 	/**
 	 * 疑似异常值

+ 334 - 289
src/main/java/org/springblade/modules/business/warning/service/impl/RtuWarningServiceImpl.java

@@ -101,11 +101,111 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 		return page.setRecords(baseMapper.selectPage(page, rtuWarningInfoDTO));
 	}
 
+	@Override
+	public IPage<RtuWarningInfoVO> selectClockPage(IPage page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectClockPage(page, rtuWarningInfoDTO));
+	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectOfflinePage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectOfflinePage(page, rtuWarningInfoDTO));
+	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectHourMissOutPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectHourMissOutPage(page, rtuWarningInfoDTO));
+	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectRainHourMissOutPage(IPage page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectRainHourMissOutPage(page, rtuWarningInfoDTO));
+	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectRiverHourMissOutPage(IPage page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectRiverHourMissOutPage(page, rtuWarningInfoDTO));
+	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectMinUpDelayPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectMinUpDelayPage(page, rtuWarningInfoDTO));
+	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectHourUpDelayPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectHourUpDelayPage(page, rtuWarningInfoDTO));
+	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectRainHourUpDelayPage(IPage page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectRainHourUpDelayPage(page, rtuWarningInfoDTO));
+	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectRiverHourUpDelayPage(IPage page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectRiverHourUpDelayPage(page, rtuWarningInfoDTO));
+	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectOutlierValuePage(IPage page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return page.setRecords(baseMapper.selectOutlierValuePage(page, rtuWarningInfoDTO));
+	}
+
 	@Override
 	public Long warningRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
 		return baseMapper.warningRtuCount(rtuWarningInfoDTO);
 	}
 
+	@Override
+	public Long warningOfflineRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return baseMapper.warningOfflineRtuCount(rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningClockRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return this.baseMapper.warningClockRtuCount(rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningHourMissOutRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return baseMapper.warningHourMissOutRtuCount(rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningRainHourMissOutRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return this.baseMapper.warningRainHourMissOutRtuCount(rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningRiverHourMissOutRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return this.baseMapper.warningRiverHourMissOutRtuCount(rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningMinUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return baseMapper.warningMinUpDelayRtuCount(rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningHourUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return baseMapper.warningHourUpDelayRtuCount(rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningRainHourUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return this.baseMapper.warningRainHourUpDelayRtuCount(rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningRiverHourUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return this.baseMapper.warningHourUpDelayRtuCount(rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningOutlierValueRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return this.baseMapper.warningOutlierValueRtuCount(rtuWarningInfoDTO);
+	}
+
 	/**
 	 * 时钟预警
 	 *
@@ -281,7 +381,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 						}
 					}
 				}
-
 				clockWarnRecovery(rtuInfoEntity, checkTm);
 			}
 		}
@@ -291,7 +390,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 	@Override
 	public boolean checkRtuRainUpHourDelayStatus(EtlRainDataEntity etlRainDataEntity) {
 		Date checkTm = new Date();
-		//HashOperations<String,String,String> hashOperations= redisTemplate.opsForHash();
 		//测站检测参数
 		int warnActive = 0;
 		int delayWarn = 0;
@@ -337,14 +435,11 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 							entity.setWarningHappenTime(checkTm);
 							entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
 							entity.setWarningKind(WarnKindEnum.WARN_RAIN_UP_HOUR_DELAY.getCode());
-							entity.setWarningDesc("雨情整点上报延时上报时间:" + Func.formatDateTime(fromDate) + "," + "测站采集时间:" + Func.formatDateTime(upTime) + ",上报延时设定参数:" + Func.toStr(warnDelayDuration) + "分钟");
+							entity.setWarningDesc("雨情整点上报延时异常,延时设定参数:" + Func.toStr(warnDelayDuration) + "分钟,上报时间:" + Func.formatDateTime(fromDate) + ",测站采集时间:" + Func.formatDateTime(upTime) + ",延时:" + Func.toStr(delayDuration) + "分钟");
 							this.save(entity);
 							kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
 						}
-
 					} else {
-
-
 						//没有检测到预警发生,进行预警恢复操作
 						LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
 						warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
@@ -353,8 +448,8 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 						warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_RAIN_UP_HOUR_DELAY.getCode());
 						RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 						if (null != warningInfoEntity) {
-
 							//恢复
+							warningInfoEntity.setWarningRecoveryDesc("雨情整点上报延时恢复,延时设定参数:" + Func.toStr(warnDelayDuration) + "分钟,上报时间:" + Func.formatDateTime(fromDate) + ",测站采集时间:" + Func.formatDateTime(upTime) + ",延时:" + Func.toStr(delayDuration) + "分钟");
 							warningInfoEntity.setWarningRecoveryTime(checkTm);
 							warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
 							warningInfoEntity.setUpdateTime(checkTm);
@@ -371,7 +466,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 	@Override
 	public boolean checkRtuRiverUpHourDelayStatus(EtlRiverDataEntity etlRiverDataEntity) {
 		Date checkTm = new Date();
-		//HashOperations<String,String,String> hashOperations= redisTemplate.opsForHash();
 		//测站检测参数
 		int warnActive = 0;
 		int delayWarn = 0;
@@ -417,14 +511,11 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 							entity.setWarningHappenTime(checkTm);
 							entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
 							entity.setWarningKind(WarnKindEnum.WARN_WL_UP_HOUR_DELAY.getCode());
-							entity.setWarningDesc("水位整点上报延时上报时间:" + Func.formatDateTime(fromDate) + "," + "测站采集时间:" + Func.formatDateTime(upTime) + ",上报延时设定参数:" + Func.toStr(warnDelayDuration) + "分钟");
+							entity.setWarningDesc("水位整点上报延时异常,延时设定参数:" + Func.toStr(warnDelayDuration) + "分钟,上报时间:" + Func.formatDateTime(fromDate) + ",测站采集时间:" + Func.formatDateTime(upTime) + ",延时:" + Func.toStr(delayDuration) + "分钟");
 							this.save(entity);
 							kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
 						}
-
 					} else {
-
-
 						//没有检测到预警发生,进行预警恢复操作
 						LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
 						warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
@@ -433,8 +524,8 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 						warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_UP_HOUR_DELAY.getCode());
 						RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 						if (null != warningInfoEntity) {
-
 							//恢复
+							warningInfoEntity.setWarningRecoveryDesc("水位整点上报延时恢复,延时设定参数:" + Func.toStr(warnDelayDuration) + "分钟,上报时间:" + Func.formatDateTime(fromDate) + ",测站采集时间:" + Func.formatDateTime(upTime) + ",延时:" + Func.toStr(delayDuration) + "分钟");
 							warningInfoEntity.setWarningRecoveryTime(checkTm);
 							warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
 							warningInfoEntity.setUpdateTime(checkTm);
@@ -451,7 +542,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 	@Override
 	public boolean checkRtuRsvrUpHourDelayStatus(EtlRsvrDataEntity etlRsvrDataEntity) {
 		Date checkTm = new Date();
-		//HashOperations<String,String,String> hashOperations= redisTemplate.opsForHash();
 		//测站检测参数
 		int warnActive = 0;
 		int delayWarn = 0;
@@ -497,13 +587,11 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 							entity.setWarningHappenTime(checkTm);
 							entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
 							entity.setWarningKind(WarnKindEnum.WARN_WL_UP_HOUR_DELAY.getCode());
-							entity.setWarningDesc("水位整点上报延时上报时间:" + Func.formatDateTime(fromDate) + "," + "测站采集时间:" + Func.formatDateTime(upTime) + ",上报延时设定参数:" + Func.toStr(warnDelayDuration) + "分钟");
+							entity.setWarningDesc("水位整点上报延时异常,延时设定参数:" + Func.toStr(warnDelayDuration) + "分钟,上报时间:" + Func.formatDateTime(fromDate) + ",测站采集时间:" + Func.formatDateTime(upTime) + ",延时:" + Func.toStr(delayDuration) + "分钟");
 							this.save(entity);
 							kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
 						}
-
 					} else {
-
 						//没有检测到预警发生,进行预警恢复操作
 						LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
 						warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
@@ -512,8 +600,8 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 						warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_UP_HOUR_DELAY.getCode());
 						RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 						if (null != warningInfoEntity) {
-
 							//恢复
+							warningInfoEntity.setWarningRecoveryDesc("水位整点上报延时恢复,延时设定参数:" + Func.toStr(warnDelayDuration) + "分钟,上报时间:" + Func.formatDateTime(fromDate) + ",测站采集时间:" + Func.formatDateTime(upTime) + ",延时:" + Func.toStr(delayDuration) + "分钟");
 							warningInfoEntity.setWarningRecoveryTime(checkTm);
 							warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
 							warningInfoEntity.setUpdateTime(checkTm);
@@ -553,22 +641,24 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 		if (warnActive == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
 			if (delayWarn == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
 				boolean isBeforeWarn = false;
-				Date upTime = Func.parseDate(beforeUpInfo.getString("tm"), "yyyy-MM-dd HH:mm:ss");
-				Date fromDate = Func.parseDate(beforeUpInfo.getString("from"), "yyyy-MM-dd HH:mm:ss");
-				if (upTime.before(fromDate)) {
+				Date firstUpTime = Func.parseDate(beforeUpInfo.getString("tm"), "yyyy-MM-dd HH:mm:ss");
+				Date firstFromTime = Func.parseDate(beforeUpInfo.getString("from"), "yyyy-MM-dd HH:mm:ss");
+				long firstDelayDuration = 0;
+				if (firstUpTime.before(firstFromTime)) {
 					//延时时长,秒
-					long delayDuration = (fromDate.getTime() - upTime.getTime()) / 1000L;
-					if (delayDuration > rainWarnDelayDuration * 60) {
+					firstDelayDuration = (firstFromTime.getTime() - firstUpTime.getTime()) / 1000L;
+					if (firstDelayDuration > rainWarnDelayDuration * 60) {
 						isBeforeWarn = true;
 					}
 				}
 				boolean isNowWarn = false;
-				upTime = Func.parseDate(nowUpInfo.getString("tm"), "yyyy-MM-dd HH:mm:ss");
-				fromDate = Func.parseDate(nowUpInfo.getString("from"), "yyyy-MM-dd HH:mm:ss");
-				if (upTime.before(fromDate)) {
+				Date secondUpTime = Func.parseDate(nowUpInfo.getString("tm"), "yyyy-MM-dd HH:mm:ss");
+				Date secondFromTime = Func.parseDate(nowUpInfo.getString("from"), "yyyy-MM-dd HH:mm:ss");
+				long secondDelayDuration = 0;
+				if (secondUpTime.before(secondFromTime)) {
 					//延时时长,秒
-					long delayDuration = (fromDate.getTime() - upTime.getTime()) / 1000L;
-					if (delayDuration > rainWarnDelayDuration * 60) {
+					secondDelayDuration = (secondFromTime.getTime() - secondUpTime.getTime()) / 1000L;
+					if (secondDelayDuration > rainWarnDelayDuration * 60) {
 						isNowWarn = true;
 					}
 				}
@@ -581,7 +671,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 					warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_UP_MIN_DELAY.getCode());
 					RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 					if (null != warningInfoEntity) {
-						//warningInfoEntity.setWarningDesc("雨情5分钟上报延时,上报时间:" + Func.formatDateTime(fromDate) + "," + "测站采集时间:" + Func.formatDateTime(upTime) + ",上报延时设定参数:" + Func.toStr(rainWarnDelayDuration) + "分钟");
 						warningInfoEntity.setUpdateTime(checkTm);
 						this.updateById(warningInfoEntity);
 						kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
@@ -591,7 +680,10 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 						entity.setWarningHappenTime(checkTm);
 						entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
 						entity.setWarningKind(WarnKindEnum.WARN_UP_MIN_DELAY.getCode());
-						entity.setWarningDesc("雨情5分钟上报延时,上报时间:" + Func.formatDateTime(fromDate) + "," + "测站采集时间:" + Func.formatDateTime(upTime) + ",上报延时设定参数:" + Func.toStr(rainWarnDelayDuration) + "分钟");
+						String desc = "雨情5分钟上报延时异常,延时设定参数:" + Func.toStr(rainWarnDelayDuration) + "分钟";
+						desc += ",第一个报文上报时间:" + Func.formatDateTime(firstFromTime) + " 采集时间:" + Func.formatDateTime(firstUpTime) + " 延时:" + Func.toStr(firstDelayDuration / 60L) + "分";
+						desc += ",第二个报文上报时间:" + Func.formatDateTime(secondFromTime) + " 采集时间:" + Func.formatDateTime(secondUpTime) + " 延时:" + Func.toStr(secondDelayDuration / 60L) + "分";
+						entity.setWarningDesc(desc);
 						this.save(entity);
 						kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
 					}
@@ -605,6 +697,10 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 					RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 					if (null != warningInfoEntity) {
 						//恢复
+						String desc = "雨情5分钟上报延时恢复,延时设定参数:" + Func.toStr(rainWarnDelayDuration) + "分钟";
+						desc += ",第一个报文上报时间:" + Func.formatDateTime(firstFromTime) + " 采集时间:" + Func.formatDateTime(firstUpTime) + " 延时:" + Func.toStr(firstDelayDuration / 60L) + "分";
+						desc += ",第二个报文上报时间:" + Func.formatDateTime(secondFromTime) + " 采集时间:" + Func.formatDateTime(secondUpTime) + " 延时:" + Func.toStr(secondDelayDuration / 60L) + "分";
+						warningInfoEntity.setWarningRecoveryDesc(desc);
 						warningInfoEntity.setWarningRecoveryTime(checkTm);
 						warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
 						warningInfoEntity.setUpdateTime(checkTm);
@@ -720,7 +816,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 								RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 								if (null != warningInfoEntity) {
 									warningInfoEntity.setUpdateTime(checkTm);
-									//warningInfoEntity.setWarningDesc("测站离线异常" + "," + "判断时间:" + Func.formatDateTime(checkTm) + ",测站最后上线时间:" + Func.formatDateTime(tm) + ",离线延时设定参数:" + Func.toStr(groundWarnOfflineDuration) + "小时");
 									this.updateById(warningInfoEntity);
 									kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
 								} else {
@@ -729,7 +824,8 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 									entity.setWarningHappenTime(checkTm);
 									entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
 									entity.setWarningKind(WarnKindEnum.WARN_OFFLINE.getCode());
-									entity.setWarningDesc("测站离线异常" + "," + "判断时间:" + Func.formatDateTime(checkTm) + ",测站最后上线时间:" + Func.formatDateTime(tm) + ",离线延时设定参数:" + Func.toStr(groundWarnOfflineDuration) + "小时");
+									entity.setWarningDesc("测站离线异常,判断时间:" + Func.formatDateTime(checkTm) + ",测站最后上线时间:" + Func.formatDateTime(tm) + ",离线时长设定参数:" + Func.toStr(rainWarnOfflineDuration) + "小时");
+									entity.setRtuLastTime(tm);
 									this.save(entity);
 									kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
 								}
@@ -742,6 +838,27 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 								RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 								if (null != warningInfoEntity) {
 									//恢复
+									String warningRecoveryDesc = "";
+									Date lastTime = warningInfoEntity.getRtuLastTime();
+									if (null != lastTime) {
+										String offlineDesc = "";
+										long offlineTime = (tm.getTime() - lastTime.getTime()) / 1000L / 60L;
+										if (offlineTime > 60L * 24L) {
+											offlineDesc = "测站离线时长" + Func.toStr(offlineTime / (60L * 24L)) + "天";
+											offlineTime = offlineTime - (60L * 24L);
+											if (offlineTime >= 60L) {
+												offlineDesc += Func.toStr(offlineTime / 60L) + "小时";
+											}
+										} else if (offlineTime > 60L) {
+											offlineDesc = "测站离线时长" + Func.toStr(offlineTime / 60L) + "小时";
+										} else {
+											offlineDesc = "测站离线时长" + Func.toStr(offlineTime) + "分";
+										}
+										warningRecoveryDesc = "测站离线异常恢复,判断时间:" + Func.formatDateTime(checkTm) + ",测站恢复上线时间:" + Func.formatDateTime(tm) + ",离线时长阀值:" + Func.toStr(rainWarnOfflineDuration) + "小时," + offlineDesc;
+									} else {
+										warningRecoveryDesc = "测站离线异常恢复,判断时间:" + Func.formatDateTime(checkTm) + ",测站恢复上线时间:" + Func.formatDateTime(tm) + ",离线时长阀值:" + Func.toStr(rainWarnOfflineDuration) + "小时";
+									}
+									warningInfoEntity.setWarningRecoveryDesc(warningRecoveryDesc);
 									warningInfoEntity.setWarningRecoveryTime(checkTm);
 									warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
 									warningInfoEntity.setUpdateTime(checkTm);
@@ -768,7 +885,8 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 							entity.setWarningHappenTime(checkTm);
 							entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
 							entity.setWarningKind(WarnKindEnum.WARN_OFFLINE.getCode());
-							entity.setWarningDesc("未检测到历史上报数据,测站离线异常" + "," + "判断时间:" + Func.formatDateTime(checkTm) + ",离线延时设定参数:" + Func.toStr(groundWarnOfflineDuration) + "小时");
+							entity.setWarningDesc("未检测到上报数据,测站离线异常" + "," + "判断时间:" + Func.formatDateTime(checkTm) + ",离线延时设定参数:" + Func.toStr(rainWarnOfflineDuration) + "小时");
+
 							this.save(entity);
 							kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
 						}
@@ -791,7 +909,7 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 						entity.setWarningHappenTime(checkTm);
 						entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
 						entity.setWarningKind(WarnKindEnum.WARN_OFFLINE.getCode());
-						entity.setWarningDesc("未检测到历史上报数据,测站离线异常" + "," + "判断时间:" + Func.formatDateTime(checkTm) + ",离线延时设定参数:" + Func.toStr(groundWarnOfflineDuration) + "小时");
+						entity.setWarningDesc("未检测到上报数据,测站离线异常" + "," + "判断时间:" + Func.formatDateTime(checkTm) + ",离线延时设定参数:" + Func.toStr(rainWarnOfflineDuration) + "小时");
 						this.save(entity);
 						kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
 					}
@@ -803,7 +921,14 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 
 	@Override
 	public boolean checkRtuRainMissOutStatus(RtuInfoEntity rtuInfoEntity) {
-		Date checkTm = new Date();
+		//判断测站类型
+		boolean checkSiteKind = false;
+		if (rtuInfoEntity.getIsRain() != null && rtuInfoEntity.getIsRain() == 1) {
+			checkSiteKind = true;
+		}
+		if (!checkSiteKind) {
+			return false;
+		}
 		//测站检测参数
 		int warnActive = 0;
 		int missOutWarn = 0;
@@ -828,7 +953,7 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 				nowDate.set(Calendar.MINUTE, 0);
 				nowDate.set(Calendar.SECOND, 0);
 				if (nowDate.after(checkDate)) {
-					checkTm = checkDate.getTime();
+					Date checkTm = checkDate.getTime();
 					//每天8点以后判断上一天的漏报情况
 					String key = "etl.rain." + rtuInfoEntity.getRtuCode() + ".up.hour";
 					ValueOperations<String, String> ops = redisTemplate.opsForValue();
@@ -839,7 +964,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 						JSONArray array = JSONArray.parseArray(value);
 						checkDate.add(Calendar.DAY_OF_MONTH, -1);
 						for (int i = 0; i < 24; i++) {
-							checkDate.add(Calendar.HOUR_OF_DAY, i);
 							for (int j = 0; j < array.size(); j++) {
 								JSONObject object = array.getJSONObject(j);
 								String tm1 = Func.formatDateTime(checkDate.getTime());
@@ -853,6 +977,7 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 									break;
 								}
 							}
+							checkDate.add(Calendar.HOUR_OF_DAY, 1);
 						}
 						//漏报的报文数量
 						int missCount = 24 - upCount;
@@ -866,11 +991,11 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 							RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 							if (null != warningInfoEntity) {
 								warningInfoEntity.setUpdateTime(checkTm);
-								String warnHappenTime = Func.formatDateTime(warningInfoEntity.getWarningHappenTime());
-								String warnHappenTime2 =Func.formatDateTime(checkTm);
-								if (!warnHappenTime.equals(warnHappenTime2)){
-									warningInfoEntity.setWarningDesc("测站雨量漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
-								}
+//								String warnHappenTime = Func.formatDateTime(warningInfoEntity.getWarningHappenTime());
+//								String warnHappenTime2 = Func.formatDateTime(checkTm);
+//								if (!warnHappenTime.equals(warnHappenTime2)) {
+//									warningInfoEntity.setWarningDesc("测站雨量漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
+//								}
 								this.updateById(warningInfoEntity);
 								kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
 							} else {
@@ -893,6 +1018,7 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 							RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 							if (null != warningInfoEntity) {
 								//恢复
+								warningInfoEntity.setWarningRecoveryDesc("测站雨量漏报恢复,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
 								warningInfoEntity.setWarningRecoveryTime(checkTm);
 								warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
 								warningInfoEntity.setUpdateTime(checkTm);
@@ -908,8 +1034,15 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 	}
 
 	@Override
-	public boolean checkRtuRiverMissOutStatus(EtlRiverDataEntity etlRiverDataEntity) {
-		Date checkTm = new Date();
+	public boolean checkRtuRiverMissOutStatus(RtuInfoEntity rtuInfoEntity) {
+		//判断测站类型
+		boolean checkSiteKind = false;
+		if (rtuInfoEntity.getIsRiver() != null && rtuInfoEntity.getIsRiver() == 1) {
+			checkSiteKind = true;
+		}
+		if (!checkSiteKind) {
+			return false;
+		}
 		//测站检测参数
 		int warnActive = 0;
 		int missOutWarn = 0;
@@ -926,129 +1059,88 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 		}
 		if (warnActive == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
 			if (missOutWarn == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
-				String key = "etl.river." + etlRiverDataEntity.getRtuCode() + ".up.hour";
-				ValueOperations<String, String> ops = redisTemplate.opsForValue();
-				if (redisTemplate.hasKey(key)) {
-					String value = ops.get(key);
-					JSONArray array = JSONArray.parseArray(value);
-					if (array.size() > 0) {
-						log.info(" up time size is {}", array.size());
-						JSONObject lastobject = array.getJSONObject(array.size() - 1);
-						Date hourTime = Func.parseDate(lastobject.getString("tm"), "yyyy-MM-dd HH:mm:ss");
-						Calendar lastDate = Calendar.getInstance();
-						lastDate.setTime(hourTime);
-						lastDate.set(Calendar.SECOND, 0);
-						lastDate.set(Calendar.MINUTE, 0);
-						Calendar nowDate = Calendar.getInstance();
-						nowDate.setTime(etlRiverDataEntity.getTm());
-						nowDate.set(Calendar.SECOND, 0);
-						nowDate.set(Calendar.MINUTE, 0);
-						if (lastDate.get(Calendar.YEAR) == nowDate.get(Calendar.YEAR) && lastDate.get(Calendar.MONTH) == nowDate.get(Calendar.MONTH) && lastDate.get(Calendar.DAY_OF_MONTH) == nowDate.get(Calendar.DAY_OF_MONTH) && lastDate.get(Calendar.HOUR_OF_DAY) == nowDate.get(Calendar.HOUR_OF_DAY)) {
-							log.info(" up time is no process!!");
-						} else {
-							if (array.size() >= 24) {
-								log.info(" up time remove!!");
-								array.remove(0);
-							}
-							log.info("add  up time !");
-							//添加上报时间
-							JSONObject object = new JSONObject();
-							object.put("tm", Func.formatDateTime(etlRiverDataEntity.getTm()));
-							object.put("from", Func.formatDateTime(etlRiverDataEntity.getFromDate()));
-							array.add(object);
-						}
-						if (array.size() >= 24) {
-							log.info(" up time is 24");
-							int upCount = 0;
-							String upTimeMessage = "";
-							Date lastUpTime = etlRiverDataEntity.getTm();
-							nowDate = Calendar.getInstance();
-							nowDate.setTime(lastUpTime);
-							nowDate.set(Calendar.SECOND, 0);
-							nowDate.set(Calendar.MINUTE, 0);
-							for (int i = 0; i < 24; i++) {
-								for (int j = 1; j <= 24; j++) {
-									JSONObject object = array.getJSONObject(24 - j);
-									hourTime = Func.parseDate(object.getString("tm"), "yyyy-MM-dd HH:mm:ss");
-									Calendar beforeDate = Calendar.getInstance();
-									beforeDate.setTime(hourTime);
-									beforeDate.set(Calendar.SECOND, 0);
-									beforeDate.set(Calendar.MINUTE, 0);
-									if (beforeDate.get(Calendar.YEAR) == nowDate.get(Calendar.YEAR) && beforeDate.get(Calendar.MONTH) == nowDate.get(Calendar.MONTH) && beforeDate.get(Calendar.DAY_OF_MONTH) == nowDate.get(Calendar.DAY_OF_MONTH) && beforeDate.get(Calendar.HOUR_OF_DAY) == nowDate.get(Calendar.HOUR_OF_DAY)) {
-										log.info(" before time {} now time {}", beforeDate.getTime(), nowDate.getTime());
-										upCount++;
-										if (upTimeMessage.length() > 0) {
-											upTimeMessage += ",";
-										}
-										upTimeMessage += Func.formatDateTime(beforeDate.getTime());
-										break;
+				Calendar checkDate = Calendar.getInstance();
+				checkDate.set(Calendar.HOUR_OF_DAY, 8);
+				checkDate.set(Calendar.MINUTE, 0);
+				checkDate.set(Calendar.SECOND, 0);
+				Calendar nowDate = Calendar.getInstance();
+				nowDate.set(Calendar.MINUTE, 0);
+				nowDate.set(Calendar.SECOND, 0);
+				if (nowDate.after(checkDate)) {
+					Date checkTm = checkDate.getTime();
+					//每天8点以后判断上一天的漏报情况
+					String key = "etl.river." + rtuInfoEntity.getRtuCode() + ".up.hour";
+					ValueOperations<String, String> ops = redisTemplate.opsForValue();
+					if (redisTemplate.hasKey(key)) {
+						int upCount = 0;
+						String upTimeMessage = "";
+						String value = ops.get(key);
+						JSONArray array = JSONArray.parseArray(value);
+						checkDate.add(Calendar.DAY_OF_MONTH, -1);
+						for (int i = 0; i < 24; i++) {
+							for (int j = 0; j < array.size(); j++) {
+								JSONObject object = array.getJSONObject(j);
+								String tm1 = Func.formatDateTime(checkDate.getTime());
+								String tm2 = object.getString("tm");
+								if (tm1.equals(tm2)) {
+									upCount++;
+									if (upTimeMessage.length() > 0) {
+										upTimeMessage += ",";
 									}
+									upTimeMessage += tm1;
+									break;
 								}
-								nowDate.add(Calendar.HOUR_OF_DAY, -1);
 							}
-							log.info(" find size is {}", upCount);
-							//漏报的报文数量
-							int missCount = 24 - upCount;
-							if (missCount >= missout) {
-								//触发预警
-								LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
-								warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
-								warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, etlRiverDataEntity.getRtuCode());
-								warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
-								warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_MISS_OUT.getCode());
-								RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
-								if (null != warningInfoEntity) {
-									warningInfoEntity.setUpdateTime(checkTm);
-									//warningInfoEntity.setWarningDesc("测站水位漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
-									this.updateById(warningInfoEntity);
-									kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
-								} else {
-									RtuWarningInfoEntity entity = new RtuWarningInfoEntity();
-									entity.setRtuCode(etlRiverDataEntity.getRtuCode());
-									entity.setWarningHappenTime(checkTm);
-									entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
-									entity.setWarningKind(WarnKindEnum.WARN_WL_MISS_OUT.getCode());
-									entity.setWarningDesc("测站水位漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
-									this.save(entity);
-									kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
-								}
+							checkDate.add(Calendar.HOUR_OF_DAY, 1);
+						}
+						//漏报的报文数量
+						int missCount = 24 - upCount;
+						if (missCount >= missout) {
+							//触发预警
+							LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+							warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
+							warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuInfoEntity.getRtuCode());
+							warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
+							warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_MISS_OUT.getCode());
+							RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
+							if (null != warningInfoEntity) {
+								warningInfoEntity.setUpdateTime(checkTm);
+//								String warnHappenTime = Func.formatDateTime(warningInfoEntity.getWarningHappenTime());
+//								String warnHappenTime2 = Func.formatDateTime(checkTm);
+//								if (!warnHappenTime.equals(warnHappenTime2)) {
+//									warningInfoEntity.setWarningDesc("测站水位漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
+//								}
+								this.updateById(warningInfoEntity);
+								kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
 							} else {
+								RtuWarningInfoEntity entity = new RtuWarningInfoEntity();
+								entity.setRtuCode(rtuInfoEntity.getRtuCode());
+								entity.setWarningHappenTime(checkTm);
+								entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
+								entity.setWarningKind(WarnKindEnum.WARN_WL_MISS_OUT.getCode());
+								entity.setWarningDesc("测站水位漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
+								this.save(entity);
+								kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
+							}
+						} else {
+							//恢复
+							LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+							warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
+							warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuInfoEntity.getRtuCode());
+							warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
+							warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_MISS_OUT.getCode());
+							RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
+							if (null != warningInfoEntity) {
 								//恢复
-								LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
-								warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
-								warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, etlRiverDataEntity.getRtuCode());
-								warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
-								warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_MISS_OUT.getCode());
-								RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
-								if (null != warningInfoEntity) {
-									//恢复
-									warningInfoEntity.setWarningRecoveryTime(checkTm);
-									warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
-									warningInfoEntity.setUpdateTime(checkTm);
-									this.updateById(warningInfoEntity);
-									kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
-								}
+								warningInfoEntity.setWarningRecoveryDesc("测站水位漏报恢复,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
+								warningInfoEntity.setWarningRecoveryTime(checkTm);
+								warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
+								warningInfoEntity.setUpdateTime(checkTm);
+								this.updateById(warningInfoEntity);
+								kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
 							}
-
 						}
-						//更新缓存
-						ops.set(key, array.toJSONString());
-					} else {
-						log.info(" up time size is 0");
-						JSONObject object = new JSONObject();
-						object.put("tm", Func.formatDateTime(etlRiverDataEntity.getTm()));
-						object.put("from", Func.formatDateTime(etlRiverDataEntity.getFromDate()));
-						array.add(object);
-						ops.set(key, array.toJSONString());
 					}
-				} else {
-					log.info("no up time");
-					JSONArray array = new JSONArray();
-					JSONObject object = new JSONObject();
-					object.put("tm", Func.formatDateTime(etlRiverDataEntity.getTm()));
-					object.put("from", Func.formatDateTime(etlRiverDataEntity.getFromDate()));
-					array.add(object);
-					ops.set(key, array.toJSONString());
 				}
 			}
 		}
@@ -1056,8 +1148,15 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 	}
 
 	@Override
-	public boolean checkRtuRsvrMissOutStatus(EtlRsvrDataEntity etlRsvrDataEntity) {
-		Date checkTm = new Date();
+	public boolean checkRtuRsvrMissOutStatus(RtuInfoEntity rtuInfoEntity) {
+		//判断测站类型
+		boolean checkSiteKind = false;
+		if (rtuInfoEntity.getIsRes() != null && rtuInfoEntity.getIsRes() == 1) {
+			checkSiteKind = true;
+		}
+		if (!checkSiteKind) {
+			return false;
+		}
 		//测站检测参数
 		int warnActive = 0;
 		int missOutWarn = 0;
@@ -1074,124 +1173,88 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 		}
 		if (warnActive == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
 			if (missOutWarn == WarningActiveEnum.ACTIVE_OPEN.getCode()) {
-				String key = "etl.rsvr." + etlRsvrDataEntity.getRtuCode() + ".up.hour";
-				ValueOperations<String, String> ops = redisTemplate.opsForValue();
-				if (redisTemplate.hasKey(key)) {
-					String value = ops.get(key);
-					JSONArray array = JSONArray.parseArray(value);
-					if (array.size() > 0) {
-						JSONObject lastobject = array.getJSONObject(array.size() - 1);
-						Date hourTime = Func.parseDate(lastobject.getString("tm"), "yyyy-MM-dd HH:mm:ss");
-						Calendar lastDate = Calendar.getInstance();
-						lastDate.setTime(hourTime);
-						lastDate.set(Calendar.SECOND, 0);
-						lastDate.set(Calendar.MINUTE, 0);
-						Calendar nowDate = Calendar.getInstance();
-						nowDate.setTime(etlRsvrDataEntity.getTm());
-						nowDate.set(Calendar.SECOND, 0);
-						nowDate.set(Calendar.MINUTE, 0);
-						//	if (!lastDate.equals(nowDate)) {
-						if (lastDate.get(Calendar.YEAR) == nowDate.get(Calendar.YEAR) && lastDate.get(Calendar.MONTH) == nowDate.get(Calendar.MONTH) && lastDate.get(Calendar.DAY_OF_MONTH) == nowDate.get(Calendar.DAY_OF_MONTH) && lastDate.get(Calendar.HOUR_OF_DAY) == nowDate.get(Calendar.HOUR_OF_DAY)) {
-							log.info(" up time is no process!!");
-						} else {
-							if (array.size() >= 24) {
-								array.remove(0);
-							}
-							//添加上报时间
-							JSONObject object = new JSONObject();
-							object.put("tm", Func.formatDateTime(etlRsvrDataEntity.getTm()));
-							object.put("from", Func.formatDateTime(etlRsvrDataEntity.getFromDate()));
-							array.add(object);
-						}
-						if (array.size() >= 24) {
-							int upCount = 0;
-							String upTimeMessage = "";
-							Date lastUpTime = etlRsvrDataEntity.getTm();
-							nowDate = Calendar.getInstance();
-							nowDate.setTime(lastUpTime);
-							nowDate.set(Calendar.SECOND, 0);
-							nowDate.set(Calendar.MINUTE, 0);
-							for (int i = 0; i < 24; i++) {
-								for (int j = 1; j <= 24; j++) {
-									JSONObject object = array.getJSONObject(24 - j);
-									hourTime = Func.parseDate(object.getString("tm"), "yyyy-MM-dd HH:mm:ss");
-									Calendar beforeDate = Calendar.getInstance();
-									beforeDate.setTime(hourTime);
-									beforeDate.set(Calendar.SECOND, 0);
-									beforeDate.set(Calendar.MINUTE, 0);
-									if (beforeDate.get(Calendar.YEAR) == nowDate.get(Calendar.YEAR) && beforeDate.get(Calendar.MONTH) == nowDate.get(Calendar.MONTH) && beforeDate.get(Calendar.DAY_OF_MONTH) == nowDate.get(Calendar.DAY_OF_MONTH) && beforeDate.get(Calendar.HOUR_OF_DAY) == nowDate.get(Calendar.HOUR_OF_DAY)) {
-										log.info(" before time {} now time {}", beforeDate.getTime(), nowDate.getTime());
-										upCount++;
-										if (upTimeMessage.length() > 0) {
-											upTimeMessage += ",";
-										}
-										upTimeMessage += Func.formatDateTime(beforeDate.getTime());
-										break;
+				Calendar checkDate = Calendar.getInstance();
+				checkDate.set(Calendar.HOUR_OF_DAY, 8);
+				checkDate.set(Calendar.MINUTE, 0);
+				checkDate.set(Calendar.SECOND, 0);
+				Calendar nowDate = Calendar.getInstance();
+				nowDate.set(Calendar.MINUTE, 0);
+				nowDate.set(Calendar.SECOND, 0);
+				if (nowDate.after(checkDate)) {
+					Date checkTm = checkDate.getTime();
+					//每天8点以后判断上一天的漏报情况
+					String key = "etl.rsvr." + rtuInfoEntity.getRtuCode() + ".up.hour";
+					ValueOperations<String, String> ops = redisTemplate.opsForValue();
+					if (redisTemplate.hasKey(key)) {
+						int upCount = 0;
+						String upTimeMessage = "";
+						String value = ops.get(key);
+						JSONArray array = JSONArray.parseArray(value);
+						checkDate.add(Calendar.DAY_OF_MONTH, -1);
+						for (int i = 0; i < 24; i++) {
+							for (int j = 0; j < array.size(); j++) {
+								JSONObject object = array.getJSONObject(j);
+								String tm1 = Func.formatDateTime(checkDate.getTime());
+								String tm2 = object.getString("tm");
+								if (tm1.equals(tm2)) {
+									upCount++;
+									if (upTimeMessage.length() > 0) {
+										upTimeMessage += ",";
 									}
+									upTimeMessage += tm1;
+									break;
 								}
-								nowDate.add(Calendar.HOUR_OF_DAY, -1);
 							}
-							log.info(" find size is {}", upCount);
-							//漏报的报文数量
-							int missCount = 24 - upCount;
-							if (missCount >= missout) {
-								//触发预警
-								LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
-								warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
-								warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, etlRsvrDataEntity.getRtuCode());
-								warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
-								warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_MISS_OUT.getCode());
-								RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
-								if (null != warningInfoEntity) {
-									warningInfoEntity.setUpdateTime(checkTm);
-									//warningInfoEntity.setWarningDesc("测站水位漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
-									this.updateById(warningInfoEntity);
-									kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
-								} else {
-									RtuWarningInfoEntity entity = new RtuWarningInfoEntity();
-									entity.setRtuCode(etlRsvrDataEntity.getRtuCode());
-									entity.setWarningHappenTime(checkTm);
-									entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
-									entity.setWarningKind(WarnKindEnum.WARN_WL_MISS_OUT.getCode());
-									entity.setWarningDesc("测站水位漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
-									this.save(entity);
-									kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
-								}
+							checkDate.add(Calendar.HOUR_OF_DAY, 1);
+						}
+						//漏报的报文数量
+						int missCount = 24 - upCount;
+						if (missCount >= missout) {
+							//触发预警
+							LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+							warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
+							warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuInfoEntity.getRtuCode());
+							warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
+							warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_MISS_OUT.getCode());
+							RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
+							if (null != warningInfoEntity) {
+								warningInfoEntity.setUpdateTime(checkTm);
+//								String warnHappenTime = Func.formatDateTime(warningInfoEntity.getWarningHappenTime());
+//								String warnHappenTime2 = Func.formatDateTime(checkTm);
+//								if (!warnHappenTime.equals(warnHappenTime2)) {
+//									warningInfoEntity.setWarningDesc("测站水位漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
+//								}
+								this.updateById(warningInfoEntity);
+								kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
 							} else {
+								RtuWarningInfoEntity entity = new RtuWarningInfoEntity();
+								entity.setRtuCode(rtuInfoEntity.getRtuCode());
+								entity.setWarningHappenTime(checkTm);
+								entity.setWarningStatus(WarningStatusEnum.STATUS_HAPPEN.getCode());
+								entity.setWarningKind(WarnKindEnum.WARN_WL_MISS_OUT.getCode());
+								entity.setWarningDesc("测站水位漏报异常,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
+								this.save(entity);
+								kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(entity));
+							}
+						} else {
+							//恢复
+							LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+							warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
+							warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuInfoEntity.getRtuCode());
+							warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
+							warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_MISS_OUT.getCode());
+							RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
+							if (null != warningInfoEntity) {
 								//恢复
-								LambdaQueryWrapper<RtuWarningInfoEntity> warningWrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
-								warningWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
-								warningWrapper.eq(RtuWarningInfoEntity::getRtuCode, etlRsvrDataEntity.getRtuCode());
-								warningWrapper.eq(RtuWarningInfoEntity::getWarningStatus, WarningStatusEnum.STATUS_HAPPEN.getCode());
-								warningWrapper.eq(RtuWarningInfoEntity::getWarningKind, WarnKindEnum.WARN_WL_MISS_OUT.getCode());
-								RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
-								if (null != warningInfoEntity) {
-									//恢复
-									warningInfoEntity.setWarningRecoveryTime(checkTm);
-									warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
-									warningInfoEntity.setUpdateTime(checkTm);
-									this.updateById(warningInfoEntity);
-									kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
-								}
+								warningInfoEntity.setWarningRecoveryDesc("测站水位漏报恢复,判断时间:" + Func.formatDateTime(checkTm) + ",24小时采集时间:" + upTimeMessage + ",漏报数量:" + missCount);
+								warningInfoEntity.setWarningRecoveryTime(checkTm);
+								warningInfoEntity.setWarningStatus(WarningStatusEnum.STATUS_CLOSE.getCode());
+								warningInfoEntity.setUpdateTime(checkTm);
+								this.updateById(warningInfoEntity);
+								kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
 							}
-
 						}
-						//更新缓存
-						ops.set(key, array.toJSONString());
-					} else {
-						JSONObject object = new JSONObject();
-						object.put("tm", Func.formatDateTime(etlRsvrDataEntity.getTm()));
-						object.put("from", Func.formatDateTime(etlRsvrDataEntity.getFromDate()));
-						array.add(object);
-						ops.set(key, array.toJSONString());
 					}
-				} else {
-					JSONArray array = new JSONArray();
-					JSONObject object = new JSONObject();
-					object.put("tm", Func.formatDateTime(etlRsvrDataEntity.getTm()));
-					object.put("from", Func.formatDateTime(etlRsvrDataEntity.getFromDate()));
-					array.add(object);
-					ops.set(key, array.toJSONString());
 				}
 			}
 		}
@@ -1213,9 +1276,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 		calendar.setTime(surfTm);
 		calendar.set(Calendar.MINUTE, 0);
 		calendar.set(Calendar.SECOND, 0);
-
-		//surfTm = calendar.getTime();
-
 		ListOperations<String, String> listOps = redisTemplate.opsForList();
 		String hourCacheKey = "etl.rain." + rtuCode + ".hour.cache";
 		if (!redisTemplate.hasKey(hourCacheKey)) {
@@ -1229,25 +1289,19 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 			calendar2.setTime(etlRainDataEntity.getTm());
 			calendar2.set(Calendar.MINUTE, 0);
 			calendar2.set(Calendar.SECOND, 0);
-
 			if (calendar.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR) && calendar.get(Calendar.MONTH) == calendar2.get(Calendar.MONTH) && calendar.get(Calendar.DAY_OF_MONTH) == calendar2.get(Calendar.DAY_OF_MONTH) && calendar.get(Calendar.HOUR_OF_DAY) == calendar2.get(Calendar.HOUR_OF_DAY) && calendar.get(Calendar.MINUTE) == calendar2.get(Calendar.MINUTE) && calendar.get(Calendar.SECOND) == calendar2.get(Calendar.SECOND)) {
-
 				String value1 = ops.get(surfkey, "lefttop.value");
 //		String ltLon = ops.get(key,"lefttop.lon");
 //		String ltLat = ops.get(key,"lefttop.lat");
-
 				String value2 = ops.get(surfkey, "leftbottom.value");
 //		String lbLon = ops.get(key,"leftbottom.lon");
 //		String lbLat = ops.get(key,"leftbottom.lat");
-
 				String value3 = ops.get(surfkey, "righttop.value");
 //		String rtLon = ops.get(key,"righttop.lon");
 //		String rtLat = ops.get(key,"righttop.lat");
-
 				String value4 = ops.get(surfkey, "rightbottom.value");
 //		String rbLon = ops.get(key,"rightbottom.lon");
 //		String rbLat = ops.get(key,"rightbottom.lat");
-
 				if (null != value1 && null != value2 && null != value3 && null != value4) {
 					float count = Func.toFloat(value1) + Func.toFloat(value2) + Func.toFloat(value3) + Func.toFloat(value4);
 					if (count > 0) {
@@ -1259,7 +1313,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 //			log.info("网格右上角 值  {} 纬度 {} 经度 {} ", value3, rtLat, rtLon);
 //			log.info("网格右下角 值  {} 纬度 {} 经度 {} ", value4, rbLat, rbLon);
 //			log.info("网格内降雨平均值 {}", count);
-
 					Double drp = etlRainDataEntity.getDrp();
 					if (drp != null) {
 						double baseValue = drp.doubleValue() - count;
@@ -1273,11 +1326,6 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 							RtuWarningInfoEntity warningInfoEntity = this.getOne(warningWrapper);
 							if (null != warningInfoEntity) {
 								warningInfoEntity.setUpdateTime(checkTm);
-//						String desc="测站采集雨量大于面雨量20%,疑似异常值,";
-//						desc += "雨量采集时间:"+Func.formatDateTime(etlRainDataEntity.getTm());
-//						desc += ",时段降雨:"+Func.toStr(etlRainDataEntity.getDrp());
-//						desc += ",平均面雨量:"+Func.toStr(count);
-//						warningInfoEntity.setWarningDesc(desc);
 								this.updateById(warningInfoEntity);
 								kafkaTemplate.send(topicYwxtWarning, JsonUtil.toJson(warningInfoEntity));
 							} else {
@@ -1297,15 +1345,12 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 							}
 						}
 					}
-
 				} else {
 					log.info("no surf info");
 				}
 				break;
 			}
 		}
-
-
 		return true;
 	}
 }

+ 15 - 1
src/main/java/org/springblade/modules/manage/version/controller/VersionManageController.java

@@ -63,6 +63,9 @@ public class VersionManageController extends BladeController {
 	@Value("${spring.apk.save-path}")
 	String apkSavePaht;
 
+	@Value("${spring.apk.qr-url}")
+	String qrUrl;
+
 	/**
 	 * 工单查询,分页
 	 */
@@ -100,6 +103,17 @@ public class VersionManageController extends BladeController {
 		return R.data(vo);
 	}
 
+	@GetMapping("/app/qr/url")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "版本信息")
+	public String appQrUrl() {
+		LambdaQueryWrapper<VersionInfoEntity> wrapper = Wrappers.<VersionInfoEntity>query().lambda();
+		wrapper.eq(VersionInfoEntity::getIsDeleted, 0);
+		VersionInfoEntity versionInfoEntity = versionManageService.getOne(wrapper);
+		String url = apkUrl + "/" + versionInfoEntity.getAppPath() + "/" + versionInfoEntity.getAppName();
+		return url;
+	}
+
 	@GetMapping("/app")
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "版本信息")
@@ -114,7 +128,7 @@ public class VersionManageController extends BladeController {
 			String qrPath = apkSavePaht + File.separator + versionInfoEntity.getAppPath() + File.separator + versionInfoEntity.getAppPath() + ".jpg";
 			File file = new File(qrPath);
 			if (!file.exists()) {
-				QRCodeUtils.encode2(url, versionInfoEntity.getAppPath(), apkSavePaht + File.separator + versionInfoEntity.getAppPath() + File.separator);
+				QRCodeUtils.encode2(qrUrl, versionInfoEntity.getAppPath(), apkSavePaht + File.separator + versionInfoEntity.getAppPath() + File.separator);
 			}
 			String qrurl = apkUrl + "/" + versionInfoEntity.getAppPath() + "/" + versionInfoEntity.getAppPath() + ".jpg";
 			vo.setApkQrUrl(qrurl);

+ 30 - 0
src/main/java/org/springblade/modules/report/WeekReport.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/6/26
+ */
+package org.springblade.modules.report;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/***
+ * Date:2023/6/26
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Configuration
+public class WeekReport {
+	@Bean
+	public WeekReportBean weekReportBean() {
+		return new WeekReportBean();
+	}
+}

+ 1045 - 0
src/main/java/org/springblade/modules/report/WeekReportBean.java

@@ -0,0 +1,1045 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/6/26
+ */
+package org.springblade.modules.report;
+
+import lombok.Data;
+import org.springblade.core.tool.utils.Func;
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/***
+ * Date:2023/6/26
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+public class WeekReportBean {
+
+	public List<Map<String, Object>> reportCountTime(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+
+		Map<String, Object> d = new HashMap<>();
+		d.put("reportTime", "统计时间:2023年6月20日-28日第四周");
+		list.add(d);
+
+		return list;
+	}
+
+	public List<Map<String, Object>> orgCheckOrderCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "呼和浩特市");
+		d.put("orderSum", 20);
+		d.put("completeOrderCount", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "包头市");
+		d.put("orderSum", 14);
+		d.put("completeOrderCount", 2);
+		d.put("type","");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "乌海市");
+		d.put("orderSum", 30);
+		d.put("completeOrderCount", 1);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "赤峰市");
+		d.put("orderSum", 28);
+		d.put("completeOrderCount", 9);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "鄂尔多斯市");
+		d.put("orderSum", 5);
+		d.put("completeOrderCount", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "兴安盟");
+		d.put("orderSum", 33);
+		d.put("completeOrderCount", 12);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "阿拉善盟");
+		d.put("orderSum", 10);
+		d.put("completeOrderCount", 1);
+		list.add(d);
+		return list;
+	}
+
+	public List<Map<String, Object>> orgCheckOrderPieCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+		d.put("orgName", "呼和浩特市");
+		d.put("value", 20);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "呼和浩特市");
+		d.put("type", "周完成量");
+		d.put("value", 2);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "呼和浩特市");
+		d.put("type", "未维修数量");
+		d.put("value", 18);
+		list.add(d);
+
+
+		d = new HashMap<>();
+		d.put("orgName", "包头市");
+		d.put("value", 14);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "包头市");
+		d.put("type", "周完成量");
+		d.put("value", 2);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "包头市");
+		d.put("type", "未维修数量");
+		d.put("value", 12);
+		list.add(d);
+
+
+		d = new HashMap<>();
+		d.put("orgName", "乌海市");
+		d.put("value", 30);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "乌海市");
+		d.put("type", "周完成量");
+		d.put("value", 1);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "乌海市");
+		d.put("type", "未维修数量");
+		d.put("value", 29);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "赤峰市");
+		d.put("value", 28);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "赤峰市");
+		d.put("type", "周完成量");
+		d.put("value", 9);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "赤峰市");
+		d.put("type", "未维修数量");
+		d.put("value", 19);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "鄂尔多斯市");
+		d.put("value", 5);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "鄂尔多斯市");
+		d.put("type", "周完成量");
+		d.put("value", 0);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "鄂尔多斯市");
+		d.put("type", "未维修数量");
+		d.put("value", 5);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "兴安盟");
+		d.put("value", 33);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "兴安盟");
+		d.put("type", "周完成量");
+		d.put("value", 12);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "兴安盟");
+		d.put("type", "未维修数量");
+		d.put("value", 21);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "阿拉善盟");
+		d.put("value", 10);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "阿拉善盟");
+		d.put("type", "周完成量");
+		d.put("value", 9);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "阿拉善盟");
+		d.put("type", "未维修数量");
+		d.put("value", 1);
+		list.add(d);
+		return list;
+	}
+
+	public List<Map<String, Object>> orgCheckOrderGroupCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+
+		d.put("orgName", "呼和浩特市");
+		d.put("value", 20);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "呼和浩特市");
+		d.put("type", "周完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "包头市");
+		d.put("value", 14);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "包头市");
+		d.put("type", "周完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "乌海市");
+		d.put("value", 30);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "乌海市");
+		d.put("type", "周完成量");
+		d.put("value", 1);
+		list.add(d);
+
+
+		d = new HashMap<>();
+		d.put("orgName", "赤峰市");
+		d.put("value", 28);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "赤峰市");
+		d.put("type", "周完成量");
+		d.put("value", 9);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "鄂尔多斯市");
+		d.put("value", 5);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "鄂尔多斯市");
+		d.put("type", "周完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "兴安盟");
+		d.put("value", 33);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "兴安盟");
+		d.put("type", "周完成量");
+		d.put("value", 12);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "阿拉善盟");
+		d.put("value", 10);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "阿拉善盟");
+		d.put("type", "周完成量");
+		d.put("value", 9);
+		list.add(d);
+
+		return list;
+	}
+
+	public List<Map<String, Object>> fhhtCheckOrderLineCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+
+		d.put("week", "周一");
+		d.put("value", 4);
+		d.put("type", "维修任务总量");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周一");
+		d.put("type", "完成量");
+		d.put("value", 1);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周二");
+		d.put("value", 3);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周二");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周三");
+		d.put("value", 3);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周三");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+
+		d = new HashMap<>();
+		d.put("week", "周四");
+		d.put("value", 3);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周四");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周五");
+		d.put("value", 3);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周五");
+		d.put("type", "完成量");
+		d.put("value", 1);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周六");
+		d.put("value", 2);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周六");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "周日");
+		d.put("value", 2);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "周日");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		return list;
+	}
+
+
+	public List<Map<String, Object>> otherCheckOrderLineCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+
+		d.put("week", "周一");
+		d.put("value", 1);
+		d.put("type", "维修任务总量");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周一");
+		d.put("type", "完成量");
+		d.put("value", 1);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周二");
+		d.put("value", 0);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周二");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周三");
+		d.put("value", 0);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周三");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+
+		d = new HashMap<>();
+		d.put("week", "周四");
+		d.put("value", 1);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周四");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周五");
+		d.put("value", 1);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周五");
+		d.put("type", "完成量");
+		d.put("value", 1);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周六");
+		d.put("value", 0);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周六");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "周日");
+		d.put("value", 0);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "周日");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		return list;
+	}
+
+
+	public List<Map<String, Object>> orgCheckOrderLineCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+
+		d.put("week", "周一");
+		d.put("value", 20);
+		d.put("type", "维修任务总量");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周一");
+		d.put("type", "完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周二");
+		d.put("value", 14);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周二");
+		d.put("type", "完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周三");
+		d.put("value", 30);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周三");
+		d.put("type", "完成量");
+		d.put("value", 1);
+		list.add(d);
+
+
+		d = new HashMap<>();
+		d.put("week", "周四");
+		d.put("value", 28);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周四");
+		d.put("type", "完成量");
+		d.put("value", 9);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周五");
+		d.put("value", 5);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周五");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周六");
+		d.put("value", 33);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周六");
+		d.put("type", "完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "周日");
+		d.put("value", 10);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "周日");
+		d.put("type", "完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		return list;
+	}
+
+
+	public List<Map<String, Object>> rtuUpTableCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "呼和浩特市");
+		d.put("rtuCount", 200);
+		d.put("upCount", 192);
+		d.put("percent",  String.format("%.2f",(192.0/200.0)*100.0));
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 2);
+		d.put("orgName", "包头市");
+		d.put("rtuCount", 120);
+		d.put("upCount", 119);
+		d.put("percent", String.format("%.2f",(119.0/120.0)*100.0));
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 3);
+		d.put("orgName", "乌海市");
+		d.put("rtuCount", 220);
+		d.put("upCount", 211);
+		d.put("percent",  String.format("%.2f",(192.0/200.0)*100.0) );
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 4);
+		d.put("orgName", "赤峰市");
+		d.put("rtuCount", 320);
+		d.put("upCount", 300);
+		d.put("percent",  String.format("%.2f",(192.0/200.0)*100.0));
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 5);
+		d.put("orgName", "鄂尔多斯市");
+		d.put("rtuCount", 198);
+		d.put("upCount", 180);
+		d.put("percent",  String.format("%.2f",(192.0/200.0)*100.0));
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index",6);
+		d.put("orgName", "兴安盟");
+		d.put("rtuCount", 96);
+		d.put("upCount", 90);
+		d.put("percent",  String.format("%.2f",(192.0/200.0)*100.0));
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 7);
+		d.put("orgName", "阿拉善盟");
+		d.put("rtuCount", 80);
+		d.put("upCount", 60);
+		d.put("percent",   String.format("%.2f",(60.0/80.0)*100.0));
+		list.add(d);
+		return list;
+	}
+
+	public List<Map<String, Object>> rtuUpBarGroupCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+		d.put("type", "测站数量");
+		d.put("orgName", "呼和浩特市");
+		d.put("value", 200);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("type", "上报测站");
+		d.put("orgName", "呼和浩特市");
+		d.put("value", 192);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("type", "测站数量");
+		d.put("orgName", "包头市");
+		d.put("value", 120);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("type", "上报测站");
+		d.put("orgName", "包头市");
+		d.put("value", 119);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("type", "测站数量");
+		d.put("orgName", "乌海市");
+		d.put("value", 220);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("type", "上报测站");
+		d.put("orgName", "乌海市");
+		d.put("value", 211);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("type", "测站数量");
+		d.put("orgName", "赤峰市");
+		d.put("value", 320);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("type", "上报测站");
+		d.put("orgName", "赤峰市");
+		d.put("value", 300);
+		list.add(d);
+
+
+		d = new HashMap<>();
+		d.put("type", "测站数量");
+		d.put("orgName", "鄂尔多斯市");
+		d.put("value", 198);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("type", "上报测站");
+		d.put("orgName", "鄂尔多斯市");
+		d.put("value", 180);
+		list.add(d);
+
+
+		d = new HashMap<>();
+		d.put("type", "测站数量");
+		d.put("orgName", "兴安盟");
+		d.put("value", 96);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("type", "上报测站");
+		d.put("orgName", "兴安盟");
+		d.put("value", 90);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("type", "测站数量");
+		d.put("orgName", "阿拉善盟");
+		d.put("value", 80);
+		list.add(d);
+		d = new HashMap<>();
+		d.put("type", "上报测站");
+		d.put("orgName", "阿拉善盟");
+		d.put("value", 60);
+		list.add(d);
+
+		return list;
+	}
+
+	public List<Map<String, Object>> rtuUpLineCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+
+		d.put("week", "周一");
+		d.put("value", 20);
+		d.put("type", "维修任务总量");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周一");
+		d.put("type", "完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周二");
+		d.put("value", 14);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周二");
+		d.put("type", "完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周三");
+		d.put("value", 30);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周三");
+		d.put("type", "完成量");
+		d.put("value", 1);
+		list.add(d);
+
+
+		d = new HashMap<>();
+		d.put("week", "周四");
+		d.put("value", 28);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周四");
+		d.put("type", "完成量");
+		d.put("value", 9);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周五");
+		d.put("value", 5);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周五");
+		d.put("type", "完成量");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("week", "周六");
+		d.put("value", 33);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("week", "周六");
+		d.put("type", "完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("orgName", "周日");
+		d.put("value", 10);
+		d.put("type", "维修任务总量");
+		list.add(d);
+		d = new HashMap<>();
+		d.put("orgName", "周日");
+		d.put("type", "完成量");
+		d.put("value", 2);
+		list.add(d);
+
+		return list;
+	}
+
+	/**
+	 * 维修更换统计
+	 * @param n
+	 * @param n1
+	 * @param p
+	 * @return
+	 */
+	public List<Map<String, Object>> checkOrderReplaceEquipmentCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+		d.put("equipmentName", "RTU");
+		d.put("value", 4);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("equipmentName", "翻斗式雨量计");
+		d.put("value", 5);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("equipmentName", "水位计");
+		d.put("value", 1);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("equipmentName", "墒情传感器");
+		d.put("value", 1);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("equipmentName", "蓄电池");
+		d.put("value", 6);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("equipmentName", "太阳能板");
+		d.put("value", 0);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("equipmentName", "欠费");
+		d.put("value", 10);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("equipmentName", "网络信号");
+		d.put("value", 8);
+		list.add(d);
+
+		return list;
+	}
+
+
+	/**
+	 * 维修站点清单
+	 * @param n
+	 * @param n1
+	 * @param p
+	 * @return
+	 */
+	public List<Map<String, Object>> rtuOrderProcessTableCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "呼和浩特市");
+		d.put("rtuCode", "008285478");
+		d.put("rtuName", "呼-小水库1");
+		d.put("processDesc", "RTU更换");
+		d.put("processCount", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 2);
+		d.put("orgName", "呼和浩特市");
+		d.put("rtuCode", "008285479");
+		d.put("rtuName", "呼-小水库2");
+		d.put("processDesc", "水位计更换");
+		d.put("processCount", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 3);
+		d.put("orgName", "赤峰市");
+		d.put("rtuCode", "0015025888");
+		d.put("rtuName", "赤-小水库1");
+		d.put("processDesc", "RTU更换");
+		d.put("processCount", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 4);
+		d.put("orgName", "鄂尔多斯市");
+		d.put("rtuCode", "00150250000");
+		d.put("rtuName", "鄂-小水库1");
+		d.put("processDesc", "蓄电池更换");
+		d.put("processCount", 2);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 5);
+		d.put("orgName", "鄂尔多斯市");
+		d.put("rtuCode", "00150250001");
+		d.put("rtuName", "鄂-小水库2");
+		d.put("processDesc", "水位计更换");
+		d.put("processCount", 1);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index",6);
+		d.put("orgName", "阿拉善盟");
+		d.put("rtuCode", "00150250200");
+		d.put("rtuName", "阿-小水库1");
+		d.put("processDesc", "欠费");
+		d.put("processCount", 1);
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 7);
+		d.put("orgName", "阿拉善盟");
+		d.put("rtuCode", "00150250201");
+		d.put("rtuName", "阿-小水库2");
+		d.put("processDesc", "无网络信号");
+		d.put("processCount", 1);
+		list.add(d);
+		return list;
+	}
+
+	/**
+	 * 设备更换清单
+	 * @param n
+	 * @param n1
+	 * @param p
+	 * @return
+	 */
+	public List<Map<String, Object>> rtuEquiomentReplaceTableCount(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		Map<String, Object> d = new HashMap<>();
+		d.put("index", 1);
+		d.put("orgName", "呼和浩特市");
+		d.put("rtuCode", "008285478");
+		d.put("rtuName", "呼-小水库1");
+		d.put("processDesc", "RTU更换");
+		d.put("replaceTime", "2023-6-22");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 2);
+		d.put("orgName", "呼和浩特市");
+		d.put("rtuCode", "008285478");
+		d.put("rtuName", "呼-小水库1");
+		d.put("processDesc", "RTU更换");
+		d.put("replaceTime", "2023-6-25");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index",3);
+		d.put("orgName", "呼和浩特市");
+		d.put("rtuCode", "008285479");
+		d.put("rtuName", "呼-小水库2");
+		d.put("processDesc", "水位计更换");
+		d.put("replaceTime", "2023-6-19");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index",4);
+		d.put("orgName", "呼和浩特市");
+		d.put("rtuCode", "008285479");
+		d.put("rtuName", "呼-小水库2");
+		d.put("processDesc", "水位计更换");
+		d.put("replaceTime", "2023-6-25");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 5);
+		d.put("orgName", "赤峰市");
+		d.put("rtuCode", "0015025888");
+		d.put("rtuName", "赤-小水库1");
+		d.put("processDesc", "RTU更换");
+		d.put("replaceTime",  "2023-6-25");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 6);
+		d.put("orgName", "赤峰市");
+		d.put("rtuCode", "0015025888");
+		d.put("rtuName", "赤-小水库1");
+		d.put("processDesc", "RTU更换");
+		d.put("replaceTime",  "2023-6-25");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 7);
+		d.put("orgName", "鄂尔多斯市");
+		d.put("rtuCode", "00150250000");
+		d.put("rtuName", "鄂-小水库1");
+		d.put("processDesc", "蓄电池更换");
+		d.put("replaceTime",  "2023-6-25");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 8);
+		d.put("orgName", "鄂尔多斯市");
+		d.put("rtuCode", "00150250000");
+		d.put("rtuName", "鄂-小水库1");
+		d.put("processDesc", "蓄电池更换");
+		d.put("replaceTime",  "2023-6-25");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index",9);
+		d.put("orgName", "鄂尔多斯市");
+		d.put("rtuCode", "00150250001");
+		d.put("rtuName", "鄂-小水库2");
+		d.put("processDesc", "水位计更换");
+		d.put("replaceTime",  "2023-6-25");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index",10);
+		d.put("orgName", "阿拉善盟");
+		d.put("rtuCode", "00150250200");
+		d.put("rtuName", "阿-小水库1");
+		d.put("processDesc", "欠费");
+		d.put("replaceTime",  "2023-6-25");
+		list.add(d);
+
+		d = new HashMap<>();
+		d.put("index", 11);
+		d.put("orgName", "阿拉善盟");
+		d.put("rtuCode", "00150250201");
+		d.put("rtuName", "阿-小水库2");
+		d.put("processDesc", "无网络信号");
+		d.put("replaceTime",  "2023-6-25");
+		list.add(d);
+		return list;
+	}
+
+	public List<Map<String, Object>> test(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		for (int i = 0; i < 10; i++) {
+			Map<String, Object> d = new HashMap<>();
+			d.put("index", i);
+			d.put("rtuCode", "1111111111111");
+			d.put("rtuName", "小水库" + (i + 1));
+			list.add(d);
+		}
+		return list;
+	}
+
+	public List<Map<String, Object>> getPie(String n, String n1, Map<String, Object> p) {
+		List<Map<String, Object>> list = new LinkedList<>();
+		for (int i = 0; i < 4; i++) {
+			Map<String, Object> d = new HashMap<>();
+			d.put("value", 20);
+			d.put("name", "小水库" + (i + 1));
+			list.add(d);
+		}
+		Map<String, Object> d = new HashMap<>();
+		d.put("value", 20);
+		d.put("name", "小水库1");
+		list.add(d);
+		return list;
+	}
+}

+ 63 - 107
src/main/java/org/springblade/mq/kafka/handler/MessageHandler.java

@@ -39,6 +39,7 @@ import org.springframework.kafka.support.Acknowledgment;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
@@ -89,6 +90,8 @@ public class MessageHandler {
 	@Value("${spring.mq-topic.ywxt-rtu-status}")
 	private String topicYwxtRtuStatus;
 
+
+
 	/**
 	 * ETL任务执行信息
 	 *
@@ -170,7 +173,7 @@ public class MessageHandler {
 					//清空5分钟报文记录
 					JSONArray array = new JSONArray();
 					ops.set(key, array.toJSONString());
-					//记录整点报
+					//记录整点报数据
 					ListOperations<String, String> listOps = redisTemplate.opsForList();
 					key = "etl.rain." + rainDataEntity.getRtuCode() + ".hour.cache";
 					if (redisTemplate.hasKey(key)) {
@@ -180,21 +183,33 @@ public class MessageHandler {
 						}
 					}
 					listOps.rightPush(key, JSON.toJSONString(rainDataEntity));
-					//漏报检测
+					//定时报数据
 					key = "etl.rain." + rainDataEntity.getRtuCode() + ".up.hour";
+					array = new JSONArray();
 					if (redisTemplate.hasKey(key)) {
 						String value = ops.get(key);
 						array = JSONArray.parseArray(value);
-					} else {
-						array = new JSONArray();
+					}
+					Calendar checkDate = Calendar.getInstance();
+					checkDate.set(Calendar.HOUR_OF_DAY, 7);
+					checkDate.set(Calendar.MINUTE, 0);
+					checkDate.set(Calendar.SECOND, 0);
+					checkDate.add(Calendar.DAY_OF_MONTH, -1);
+					Date checkTm = checkDate.getTime();
+					JSONArray newarray = new JSONArray();
+					for (int i = 0; i < array.size(); i++) {
+						JSONObject object = array.getJSONObject(i);
+						String tmStr = object.getString("tm");
+						Date tm = Func.parseDate(tmStr, "yyyy-MM-dd HH:mm:ss");
+						if (tm.after(checkTm)) {
+							newarray.add(object);
+						}
 					}
 					JSONObject object = new JSONObject();
 					object.put("tm", Func.formatDateTime(rainDataEntity.getTm()));
 					object.put("from", Func.formatDateTime(rainDataEntity.getFromDate()));
-					array.add(object);
-					ops.set(key, array.toJSONString());
-
-					//rtuWarningService.checkRtuRainMissOutStatus(rainDataEntity);
+					newarray.add(object);
+					ops.set(key, newarray.toJSONString());
 					//小时报延时检测
 					rtuWarningService.checkRtuRainUpHourDelayStatus(rainDataEntity);
 				}
@@ -234,63 +249,34 @@ public class MessageHandler {
 			if (count > 0) {
 				//更新数据
 				rtuDataRiverService.updateRiverInfo(riverDataEntity);
-				//延时检测
 				ValueOperations<String, String> ops = redisTemplate.opsForValue();
-//				String key = "etl.river." + riverDataEntity.getRtuCode() + ".up.5min";
-//				//记录5分钟报文
-//				if (redisTemplate.hasKey(key)) {
-//					String value = ops.get(key);
-//					JSONArray array = JSONArray.parseArray(value);
-//					if (array.size() > 0) {
-//						JSONObject object = new JSONObject();
-//						object.put("tm", Func.formatDateTime(riverDataEntity.getTm()));
-//						object.put("from", Func.formatDateTime(riverDataEntity.getFromDate()));
-//						//连续接收到2次5分钟报文时,进行检测
-//						JSONObject beforeObject = array.getJSONObject(array.size() - 1);
-//						String upTimeText = beforeObject.getString("tm");
-//						Date beforeUpTime = Func.parseDate(upTimeText, "yyyy-MM-dd HH:mm:ss");
-//						Calendar beforeDate = Calendar.getInstance();
-//						beforeDate.setTime(beforeUpTime);
-//						beforeDate.set(Calendar.SECOND, 0);
-//						beforeDate.add(Calendar.MINUTE, 5);
-//						Calendar nowDate = Calendar.getInstance();
-//						nowDate.setTime(riverDataEntity.getTm());
-//						nowDate.set(Calendar.SECOND, 0);
-//						if (beforeDate.get(Calendar.YEAR) == nowDate.get(Calendar.YEAR) && beforeDate.get(Calendar.MONTH) == nowDate.get(Calendar.MONTH) && beforeDate.get(Calendar.DAY_OF_MONTH) == nowDate.get(Calendar.DAY_OF_MONTH) && beforeDate.get(Calendar.HOUR_OF_DAY) == nowDate.get(Calendar.HOUR_OF_DAY) && beforeDate.get(Calendar.MINUTE) == nowDate.get(Calendar.MINUTE)) {
-//							//连续收到5分钟报文
-//							rtuWarningService.checkRtuRiverUpDelayStatus(riverDataEntity.getRtuCode(), beforeObject, object);
-//						}
-//						array.clear();
-//						array.add(object);
-//					} else {
-//						JSONObject object = new JSONObject();
-//						object.put("tm", Func.formatDateTime(riverDataEntity.getTm()));
-//						object.put("from", Func.formatDateTime(riverDataEntity.getFromDate()));
-//						array.add(object);
-//					}
-//					ops.set(key, array.toJSONString());
-//				} else {
-//					JSONArray array = new JSONArray();
-//					JSONObject object = new JSONObject();
-//					object.put("tm", Func.formatDateTime(riverDataEntity.getTm()));
-//					object.put("from", Func.formatDateTime(riverDataEntity.getFromDate()));
-//					array.add(object);
-//					ops.set(key, array.toJSONString());
-//				}
-				JSONArray array = new JSONArray();
-				//漏报检测
+				//定时报数据
 				String key = "etl.river." + riverDataEntity.getRtuCode() + ".up.hour";
+				JSONArray array = new JSONArray();
 				if (redisTemplate.hasKey(key)) {
 					String value = ops.get(key);
 					array = JSONArray.parseArray(value);
 				}
+				Calendar checkDate = Calendar.getInstance();
+				checkDate.set(Calendar.HOUR_OF_DAY, 7);
+				checkDate.set(Calendar.MINUTE, 0);
+				checkDate.set(Calendar.SECOND, 0);
+				checkDate.add(Calendar.DAY_OF_MONTH, -1);
+				Date checkTm = checkDate.getTime();
+				JSONArray newarray = new JSONArray();
+				for (int i = 0; i < array.size(); i++) {
+					JSONObject object = array.getJSONObject(i);
+					String tmStr = object.getString("tm");
+					Date tm = Func.parseDate(tmStr, "yyyy-MM-dd HH:mm:ss");
+					if (tm.after(checkTm)) {
+						newarray.add(object);
+					}
+				}
 				JSONObject object = new JSONObject();
 				object.put("tm", Func.formatDateTime(riverDataEntity.getTm()));
 				object.put("from", Func.formatDateTime(riverDataEntity.getFromDate()));
-				array.add(object);
-				ops.set(key, array.toJSONString());
-
-				//rtuWarningService.checkRtuRiverMissOutStatus(riverDataEntity);
+				newarray.add(object);
+				ops.set(key, newarray.toJSONString());
 				//小时报延时检测
 				rtuWarningService.checkRtuRiverUpHourDelayStatus(riverDataEntity);
 				//测站状态检测
@@ -329,66 +315,34 @@ public class MessageHandler {
 			if (count > 0) {
 				//更新数据
 				rtuDataRsvrService.updateRsvrInfo(rsvrDataEntity);
-//				//延时检测
-//				ValueOperations<String, String> ops = redisTemplate.opsForValue();
-//				String key = "etl.river." + rsvrDataEntity.getRtuCode() + ".up.5min";
-//				//记录5分钟报文
-//				if (redisTemplate.hasKey(key)) {
-//					String value = ops.get(key);
-//					JSONArray array = JSONArray.parseArray(value);
-//					if (array.size() > 0) {
-//						JSONObject object = new JSONObject();
-//						object.put("tm", Func.formatDateTime(rsvrDataEntity.getTm()));
-//						object.put("from", Func.formatDateTime(rsvrDataEntity.getFromDate()));
-//						//连续接收到2次5分钟报文时,进行检测
-//						JSONObject beforeObject = array.getJSONObject(array.size() - 1);
-//						String upTimeText = beforeObject.getString("tm");
-//						Date beforeUpTime = Func.parseDate(upTimeText, "yyyy-MM-dd HH:mm:ss");
-//						Calendar beforeDate = Calendar.getInstance();
-//						beforeDate.setTime(beforeUpTime);
-//						beforeDate.set(Calendar.SECOND, 0);
-//						beforeDate.add(Calendar.MINUTE, 5);
-//						Calendar nowDate = Calendar.getInstance();
-//						nowDate.setTime(rsvrDataEntity.getTm());
-//						nowDate.set(Calendar.SECOND, 0);
-//						if (beforeDate.get(Calendar.YEAR) == nowDate.get(Calendar.YEAR) && beforeDate.get(Calendar.MONTH) == nowDate.get(Calendar.MONTH) && beforeDate.get(Calendar.DAY_OF_MONTH) == nowDate.get(Calendar.DAY_OF_MONTH) && beforeDate.get(Calendar.HOUR_OF_DAY) == nowDate.get(Calendar.HOUR_OF_DAY) && beforeDate.get(Calendar.MINUTE) == nowDate.get(Calendar.MINUTE)) {
-//							//连续收到5分钟报文
-//							rtuWarningService.checkRtuRsvrUpDelayStatus(rsvrDataEntity.getRtuCode(), beforeObject, object);
-//						}
-//						array.clear();
-//						array.add(object);
-//					} else {
-//						JSONObject object = new JSONObject();
-//						object.put("tm", Func.formatDateTime(rsvrDataEntity.getTm()));
-//						object.put("from", Func.formatDateTime(rsvrDataEntity.getFromDate()));
-//						array.add(object);
-//					}
-//					ops.set(key, array.toJSONString());
-//				} else {
-//					JSONArray array = new JSONArray();
-//					JSONObject object = new JSONObject();
-//					object.put("tm", Func.formatDateTime(rsvrDataEntity.getTm()));
-//					object.put("from", Func.formatDateTime(rsvrDataEntity.getFromDate()));
-//					array.add(object);
-//					ops.set(key, array.toJSONString());
-//				}
-				//漏报检测
+				//定时报数据
 				String key = "etl.rsvr." + rsvrDataEntity.getRtuCode() + ".up.hour";
 				ValueOperations<String, String> ops = redisTemplate.opsForValue();
 				JSONArray array = new JSONArray();
-				//漏报检测
-
 				if (redisTemplate.hasKey(key)) {
 					String value = ops.get(key);
 					array = JSONArray.parseArray(value);
 				}
+				Calendar checkDate = Calendar.getInstance();
+				checkDate.set(Calendar.HOUR_OF_DAY, 7);
+				checkDate.set(Calendar.MINUTE, 0);
+				checkDate.set(Calendar.SECOND, 0);
+				checkDate.add(Calendar.DAY_OF_MONTH, -1);
+				Date checkTm = checkDate.getTime();
+				JSONArray newarray = new JSONArray();
+				for (int i = 0; i < array.size(); i++) {
+					JSONObject object = array.getJSONObject(i);
+					String tmStr = object.getString("tm");
+					Date tm = Func.parseDate(tmStr, "yyyy-MM-dd HH:mm:ss");
+					if (tm.after(checkTm)) {
+						newarray.add(object);
+					}
+				}
 				JSONObject object = new JSONObject();
 				object.put("tm", Func.formatDateTime(rsvrDataEntity.getTm()));
 				object.put("from", Func.formatDateTime(rsvrDataEntity.getFromDate()));
-				array.add(object);
-				ops.set(key, array.toJSONString());
-
-				//rtuWarningService.checkRtuRsvrMissOutStatus(rsvrDataEntity);
+				newarray.add(object);
+				ops.set(key, newarray.toJSONString());
 				//小时报延时检测
 				rtuWarningService.checkRtuRsvrUpHourDelayStatus(rsvrDataEntity);
 				//测站状态检测
@@ -571,9 +525,11 @@ public class MessageHandler {
 					statusEntity.setRtuCode(warningInfoEntity.getRtuCode());
 					statusEntity.setRunStatusId(EquipmentStatusEnum.STATUS_RUN.getCode());
 					rtuManageService.updateRtuStatus(statusEntity);
-					//没有预警,可以关闭维修任务工单
+					//所有预警已经关闭,可以关闭维修任务工单
 					CheckOrderInfoDTO checkOrderInfoDTO = new CheckOrderInfoDTO();
 					checkOrderInfoDTO.setRtuCode(warningInfoEntity.getRtuCode());
+					checkOrderInfoDTO.setWarnId(warningInfoEntity.getId());
+					checkOrderInfoDTO.setOrderDesc(warningInfoEntity.getWarningRecoveryDesc());
 					rtuCheckOrderService.closeOrder(checkOrderInfoDTO);
 				}
 			}

+ 29 - 10
src/main/java/org/springblade/task/RtuImportTask.java

@@ -9,11 +9,15 @@ package org.springblade.task;
 
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.read.builder.ExcelReaderBuilder;
+import com.alibaba.excel.read.builder.ExcelReaderSheetBuilder;
 import com.alibaba.excel.read.listener.ReadListener;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.extern.slf4j.Slf4j;
 import org.springblade.common.cache.DictBizCache;
+import org.springblade.core.excel.listener.DataListener;
+import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.tool.utils.ConcurrentDateFormat;
 import org.springblade.core.tool.utils.Func;
@@ -26,6 +30,7 @@ import org.springblade.modules.manage.service.IRtuImportRecordDetailService;
 import org.springblade.modules.manage.service.IRtuImportRecordService;
 import org.springblade.modules.system.entity.DictBiz;
 
+import java.io.BufferedInputStream;
 import java.io.InputStream;
 import java.net.HttpURLConnection;
 import java.net.URL;
@@ -68,21 +73,37 @@ public class RtuImportTask implements Callable<Integer> {
 			//防止屏蔽程序抓取而返回403错误
 			conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
 			//处理百分比
-			float recordSize = 0;
-			float processCount = 0;
+//			float recordSize = 0;
+//			float processCount = 0;
 			//得到输入流
 			InputStream inputStream = conn.getInputStream();
-
 			String fileName = bladeFile.getOriginalName();
-			LambdaQueryWrapper<RtuInfoEntity> statusWwrapper = Wrappers.<RtuInfoEntity>query().lambda();
-			statusWwrapper.eq(RtuInfoEntity::getIsDeleted, 0);
-			List<RtuInfoEntity> rtuList = rtuBaseInfoService.list(statusWwrapper);
+//			LambdaQueryWrapper<RtuInfoEntity> statusWwrapper = Wrappers.<RtuInfoEntity>query().lambda();
+//			statusWwrapper.eq(RtuInfoEntity::getIsDeleted, 0);
+//			List<RtuInfoEntity> rtuList = rtuBaseInfoService.list(statusWwrapper);
 //			Map<String, Integer> rtuStatus = new HashMap<>(rtuList.size());
 //			for (RtuInfoEntity entity : rtuList) {
 //				rtuStatus.put(entity.getRtuCode(), 0);
 //			}
+			if(!fileName.endsWith("xlsx")){
+				recordEntity.setImportStatus(2L);
+				rtuImportRecordService.saveOrUpdate(recordEntity);
+			    return 0;
+			}
+			DataListener<RtuInfoTableDataEntity> dataListener = new DataListener<>();
+			InputStream inputStreambuff = new BufferedInputStream(inputStream);
+			ExcelReaderBuilder builder = EasyExcel.read(inputStreambuff, RtuInfoTableDataEntity.class, dataListener);
+			((ExcelReaderSheetBuilder)builder.sheet(0).headRowNumber(3)).doRead();
+			List<RtuInfoTableDataEntity> list= dataListener.getDataList();
+			if (null != list && list.size()>0){
+				for (RtuInfoTableDataEntity entity:list){
+                       log.info(entity.getRtuCode());
+				}
+			}
 
-			List<RtuInfoTableDataEntity> list = new LinkedList<>();
+			//List<NoticeExcel> list = ExcelUtil.read(inputStream, 0, RtuInfoTableDataEntity.class);
+
+		//	List<RtuInfoTableDataEntity> list = new LinkedList<>();
 			if (fileName.endsWith("xlsx")) {
 				EasyExcel.read(inputStream, RtuInfoTableDataEntity.class, new ReadListener() {
 					@Override
@@ -170,9 +191,7 @@ public class RtuImportTask implements Callable<Integer> {
 							for (int i = 2; i < list.size(); i++) {
 								RtuInfoTableDataEntity dataEntity = list.get(i);
 								String rtuCode = dataEntity.getRtuCode().trim();
-//										if (rtuStatus.containsKey(rtuCode)) {
-//											rtuStatus.put(rtuCode, 1);
-//										}
+
 								RtuInfoEntity rtuInfoEntity = new RtuInfoEntity();
 								rtuInfoEntity.setRtuCode(rtuCode);
 								if (null != dataEntity.getCity()) {

+ 8 - 3
src/main/java/org/springblade/task/SurfDataProcessTask.java

@@ -87,6 +87,9 @@ public class SurfDataProcessTask {
 	@Value("${rockdb-config.save-path}")
 	private String rockdbSavePath;
 
+	@Value("${spring.task-config.warning-check-task}")
+	private boolean taskRun;
+
 	static {
 		RocksDB.loadLibrary();
 	}
@@ -104,9 +107,11 @@ public class SurfDataProcessTask {
 	@Scheduled(cron = "0 0/30 * * * * ")
 	public void surfDataFtpTask() {
 		try {
-			FtpSurfDataTask task = new FtpSurfDataTask();
-			FutureTask<Integer> futureTask = new FutureTask<>(task);
-			publicThreadPool.execute(futureTask);
+			if (taskRun) {
+				FtpSurfDataTask task = new FtpSurfDataTask();
+				FutureTask<Integer> futureTask = new FutureTask<>(task);
+				publicThreadPool.execute(futureTask);
+			}
 		} catch (Exception e) {
 			log.error("{}", e.getMessage());
 		}

+ 14 - 6
src/main/java/org/springblade/task/TaskManager.java

@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder;
 import org.springblade.modules.baseinfo.rtu.service.IRtuBaseInfoService;
 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;
@@ -44,12 +45,17 @@ public class TaskManager {
 	@Resource
 	private IRtuWarningService rtuWarningService;
 
+	@Value("${spring.task-config.warning-check-task}")
+	private boolean taskRun;
+
 	@Scheduled(cron = "0 0/20 * * * * ")
 	public void warnTask() {
 		try {
-			WarningCheckTask warningTask = new WarningCheckTask(rtuBaseInfoService, rtuWarningService);
-			FutureTask<Integer> futureTask = new FutureTask<>(warningTask);
-			publicThreadPool.execute(futureTask);
+			if (taskRun) {
+				WarningCheckTask warningTask = new WarningCheckTask(rtuBaseInfoService, rtuWarningService);
+				FutureTask<Integer> futureTask = new FutureTask<>(warningTask);
+				publicThreadPool.execute(futureTask);
+			}
 		} catch (Exception e) {
 			log.error("{}", e.getMessage());
 		}
@@ -58,9 +64,11 @@ public class TaskManager {
 	@Scheduled(cron = "0 0/5 * * * * ")
 	public void offlineWarnTask() {
 		try {
-			OfflineWarningCheckTask warningTask = new OfflineWarningCheckTask(rtuBaseInfoService, rtuWarningService);
-			FutureTask<Integer> futureTask = new FutureTask<>(warningTask);
-			publicThreadPool.execute(futureTask);
+			if (taskRun) {
+				OfflineWarningCheckTask warningTask = new OfflineWarningCheckTask(rtuBaseInfoService, rtuWarningService);
+				FutureTask<Integer> futureTask = new FutureTask<>(warningTask);
+				publicThreadPool.execute(futureTask);
+			}
 		} catch (Exception e) {
 			log.error("{}", e.getMessage());
 		}

+ 2 - 0
src/main/java/org/springblade/task/WarningCheckTask.java

@@ -53,6 +53,8 @@ public class WarningCheckTask implements Callable<Integer> {
 					rtuWarningService.checkRtuOutlierValueStatus(entity);
 					//漏报检测
 					rtuWarningService.checkRtuRainMissOutStatus(entity);
+					rtuWarningService.checkRtuRiverMissOutStatus(entity);
+					rtuWarningService.checkRtuRsvrMissOutStatus(entity);
 				}
 			}
 		} catch (Exception e) {

+ 4 - 3
src/main/resources/application-dev.yml

@@ -2,10 +2,10 @@
 spring:
   redis:
     ##redis 单机环境配置
-    host: 172.9.0.165
+    host: 172.31.1.228
     port: 6379
-    password:  123456
-    database: 1
+    password:  Dh@82828800
+    database: 2
     ssl: false
     ##redis 集群环境配置
     #cluster:
@@ -66,6 +66,7 @@ spring:
     topic-etl-ground: topic-etl-ground-data
     topic-etl-promptly-collect:  topic-etl-promptly-collect
   apk:
+    qr-url: http://111.204.228.227:20002/api/galaxy-business/version/app/qr/url
     url: http://111.204.228.227:20002/app/apk
     save-path: D:\\tmp
   task-config:

+ 11 - 9
src/main/resources/application-test.yml

@@ -2,10 +2,10 @@
 spring:
   redis:
     ##redis 单机环境配置
-    host: 172.9.0.165
+    host: 172.31.1.228
     port: 6379
-    password:  123456
-    database: 1
+    password:  Dh@82828800
+    database: 2
     ssl: false
     ##redis 集群环境配置
     #cluster:
@@ -66,8 +66,9 @@ spring:
     topic-etl-ground: topic-etl-ground-data
     topic-etl-promptly-collect:  topic-etl-promptly-collect
   apk:
+    qr-url: http://111.204.228.227:20002/api/galaxy-business/version/app/qr/url
     url: http://111.204.228.227:20002/app/apk
-    save-path: D:\\tmp
+    save-path: /home/apk
   task-config:
     etl-task: false
     warning-check-task: false
@@ -76,7 +77,7 @@ spring:
     delay-time: 120
 
 export-config:
-  workdir: D:\\tmp\\export
+  workdir: /home/export
   equipment-info-template: equipment-template.xlsx
   inspection-remainingproblems-template: inspection-remainingproblems-template.xlsx
   inspection-unfinished-template: inspection-unfinished-template.xlsx
@@ -86,11 +87,14 @@ ftp-config:
   port: 2221
   username: admin
   password: admin
-  workdir: D:\\tmp\\ftp
+  workdir: /home/ftp
   targetdir: ANALYSIS/CLDAS
 
 rockdb-config:
-  save-path: D:\\tmp\\rockdb
+  save-path: /home/rockdb
+
+warn-config:
+  missout: 5
 
 #第三方登陆
 social:
@@ -111,5 +115,3 @@ blade:
     remote-mode: true
     upload-domain: http://localhost:8999
     remote-path: /usr/share/nginx/html
-
-

+ 2 - 2
src/main/resources/application.yml

@@ -122,10 +122,10 @@ flowable:
 
 #报表配置
 report:
-  enabled: false
+  enabled: true
 #  database:
 #    provider:
-#      prefix: galaxy-
+#      prefix: blade-
 
 #oss默认配置
 oss:

+ 2 - 0
src/main/resources/log/logback-prod.xml

@@ -148,4 +148,6 @@
     <!-- 减少nacos日志 -->
     <logger name="com.alibaba.nacos" level="ERROR"/>
 
+    <!-- 减少mybatis-plus拦截器打印的sql日志,不配置会打印很多sql出来 -->
+    <Logger name="org.springblade.core.mp.plugins.SqlLogInterceptor" level="ERROR"/>
 </configuration>

+ 3 - 0
src/main/resources/log/logback-test.xml

@@ -148,4 +148,7 @@
     <!-- 减少nacos日志 -->
     <logger name="com.alibaba.nacos" level="ERROR"/>
 
+    <!-- 减少mybatis-plus拦截器打印的sql日志,不配置会打印很多sql出来 -->
+    <Logger name="org.springblade.core.mp.plugins.SqlLogInterceptor" level="ERROR"/>
+
 </configuration>