dylan 3 жил өмнө
parent
commit
0f22912887
82 өөрчлөгдсөн 2491 нэмэгдсэн , 358 устгасан
  1. 13 0
      pom.xml
  2. 84 0
      src/main/java/org/springblade/etl/EtlGroundDataTask.java
  3. 84 0
      src/main/java/org/springblade/etl/EtlRainDataTask.java
  4. 84 0
      src/main/java/org/springblade/etl/EtlRiverDataTask.java
  5. 84 0
      src/main/java/org/springblade/etl/EtlRsvrDataTask.java
  6. 0 116
      src/main/java/org/springblade/etl/EtlTask.java
  7. 26 20
      src/main/java/org/springblade/etl/EtlTaskManager.java
  8. 1 1
      src/main/java/org/springblade/etl/EtlWarningTask.java
  9. 49 15
      src/main/java/org/springblade/etl/TestDataTask.java
  10. 102 0
      src/main/java/org/springblade/etl/entity/EtlGroundDataEntity.java
  11. 78 0
      src/main/java/org/springblade/etl/entity/EtlRainDataEntity.java
  12. 54 0
      src/main/java/org/springblade/etl/entity/EtlRiverDataEntity.java
  13. 54 0
      src/main/java/org/springblade/etl/entity/EtlRsvrDataEntity.java
  14. 27 0
      src/main/java/org/springblade/etl/mapper/EtlGroundDataMapper.java
  15. 33 0
      src/main/java/org/springblade/etl/mapper/EtlGroundDataMapper.xml
  16. 26 0
      src/main/java/org/springblade/etl/mapper/EtlRainDataMapper.java
  17. 29 0
      src/main/java/org/springblade/etl/mapper/EtlRainDataMapper.xml
  18. 27 0
      src/main/java/org/springblade/etl/mapper/EtlRiverDataMapper.java
  19. 26 0
      src/main/java/org/springblade/etl/mapper/EtlRiverDataMapper.xml
  20. 26 0
      src/main/java/org/springblade/etl/mapper/EtlRsvrDataMapper.java
  21. 25 0
      src/main/java/org/springblade/etl/mapper/EtlRsvrDataMapper.xml
  22. 27 0
      src/main/java/org/springblade/etl/service/IEtlGroundDataService.java
  23. 26 0
      src/main/java/org/springblade/etl/service/IEtlRainDataService.java
  24. 27 0
      src/main/java/org/springblade/etl/service/IEtlRiverDataService.java
  25. 27 0
      src/main/java/org/springblade/etl/service/IEtlRsvrDataService.java
  26. 36 0
      src/main/java/org/springblade/etl/service/impl/EtlGroundDataServiceImpl.java
  27. 33 0
      src/main/java/org/springblade/etl/service/impl/EtlRainDataServiceImpl.java
  28. 36 0
      src/main/java/org/springblade/etl/service/impl/EtlRiverDataServiceImpl.java
  29. 33 0
      src/main/java/org/springblade/etl/service/impl/EtlRsvrDataServiceImpl.java
  30. 94 26
      src/main/java/org/springblade/modules/business/check/order/controller/RtuCheckOrderController.java
  31. 16 0
      src/main/java/org/springblade/modules/business/check/order/entity/CheckOrderInfoEntity.java
  32. 12 0
      src/main/java/org/springblade/modules/business/check/order/mapper/RtuCheckOrderMapper.java
  33. 65 50
      src/main/java/org/springblade/modules/business/check/order/mapper/RtuCheckOrderMapper.xml
  34. 9 0
      src/main/java/org/springblade/modules/business/check/order/service/IRtuCheckOrderService.java
  35. 21 0
      src/main/java/org/springblade/modules/business/check/order/service/impl/RtuCheckOrderServiceImpl.java
  36. 48 0
      src/main/java/org/springblade/modules/business/check/order/vo/CheckOrderCountVO.java
  37. 48 0
      src/main/java/org/springblade/modules/business/check/order/vo/OrgCheckOrderCountVO.java
  38. 41 8
      src/main/java/org/springblade/modules/business/check/process/controller/RtuOrderProcessController.java
  39. 31 0
      src/main/java/org/springblade/modules/business/check/process/dto/OrderProcessInfoDTO.java
  40. 8 0
      src/main/java/org/springblade/modules/business/check/process/mapper/RtuOrderProcessMapper.java
  41. 84 0
      src/main/java/org/springblade/modules/business/check/process/mapper/RtuOrderProcessMapper.xml
  42. 11 0
      src/main/java/org/springblade/modules/business/check/process/service/IRtuOrderProcessService.java
  43. 9 0
      src/main/java/org/springblade/modules/business/check/process/service/impl/RtuOrderProcessServiceImpl.java
  44. 16 0
      src/main/java/org/springblade/modules/business/check/process/vo/OrderProcessInfoVO.java
  45. 89 2
      src/main/java/org/springblade/modules/business/equipment/inspection/base/controller/EquipmentInspectionController.java
  46. 36 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/dto/EquipmentInspectionInfoDTO.java
  47. 6 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/mapper/EquipmentInspectionMapper.java
  48. 38 1
      src/main/java/org/springblade/modules/business/equipment/inspection/base/mapper/EquipmentInspectionMapper.xml
  49. 10 1
      src/main/java/org/springblade/modules/business/equipment/inspection/base/service/IEquipmentInspectionService.java
  50. 11 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/service/impl/EquipmentInspectionServiceImpl.java
  51. 44 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/vo/EquipmentInspectionStatisticsVO.java
  52. 50 0
      src/main/java/org/springblade/modules/business/equipment/inspection/base/vo/OrgEquipmentInspectionStatisticsVO.java
  53. 6 2
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/mapper/EquipmentInspectionPlanRtuMapper.xml
  54. 4 3
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/service/impl/EquipmentInspectionPlanRtuServiceImpl.java
  55. 6 6
      src/main/java/org/springblade/modules/business/equipment/inspection/plan/wrapper/EquipmentInspectionPlanWrapper.java
  56. 59 17
      src/main/java/org/springblade/modules/business/equipment/inspection/report/controller/EquipmentInspectionReportController.java
  57. 3 0
      src/main/java/org/springblade/modules/business/equipment/inspection/report/mapper/EquipmentInspectionReportMapper.java
  58. 23 1
      src/main/java/org/springblade/modules/business/equipment/inspection/report/mapper/EquipmentInspectionReportMapper.xml
  59. 6 0
      src/main/java/org/springblade/modules/business/equipment/inspection/report/service/IEquipmentInspectionReportService.java
  60. 7 0
      src/main/java/org/springblade/modules/business/equipment/inspection/report/service/impl/EquipmentInspectionReportServiceImpl.java
  61. 28 10
      src/main/java/org/springblade/modules/business/project/servicePerson/controller/ProjectServicePersonController.java
  62. 6 0
      src/main/java/org/springblade/modules/business/project/servicePerson/entity/ServicePersonEntity.java
  63. 5 0
      src/main/java/org/springblade/modules/business/project/servicePerson/mapper/ProjectServicePersonMapper.java
  64. 34 0
      src/main/java/org/springblade/modules/business/project/servicePerson/mapper/ProjectServicePersonMapper.xml
  65. 4 0
      src/main/java/org/springblade/modules/business/project/servicePerson/service/IProjectServicePersonService.java
  66. 7 0
      src/main/java/org/springblade/modules/business/project/servicePerson/service/impl/ProjectServicePersonServiceImpl.java
  67. 39 0
      src/main/java/org/springblade/modules/business/project/servicePerson/vo/OrgPersonContactVO.java
  68. 6 0
      src/main/java/org/springblade/modules/business/project/servicePerson/vo/ServicePersonVO.java
  69. 44 1
      src/main/java/org/springblade/modules/business/rtu/base/controller/RtuBaseInfoController.java
  70. 0 1
      src/main/java/org/springblade/modules/business/rtu/base/vo/RtuInfoVO.java
  71. 50 0
      src/main/java/org/springblade/modules/business/rtu/base/vo/RtuStatisticsInfoVO.java
  72. 6 0
      src/main/java/org/springblade/modules/business/rtu/data/entity/RtuDataRainEntity.java
  73. 9 9
      src/main/java/org/springblade/modules/business/warning/controller/RtuWarningController.java
  74. 6 0
      src/main/java/org/springblade/modules/business/warning/dto/RtuWarningInfoDTO.java
  75. 7 0
      src/main/java/org/springblade/modules/business/warning/mapper/RtuWarningMapper.java
  76. 31 22
      src/main/java/org/springblade/modules/business/warning/mapper/RtuWarningMapper.xml
  77. 8 0
      src/main/java/org/springblade/modules/business/warning/service/IRtuWarningService.java
  78. 13 0
      src/main/java/org/springblade/modules/business/warning/service/impl/RtuWarningServiceImpl.java
  79. 6 0
      src/main/java/org/springblade/modules/business/warning/vo/RtuWarningInfoVO.java
  80. 2 0
      src/main/java/org/springblade/realData/VO/RealDataHomeInfoVO.java
  81. 84 38
      src/main/java/org/springblade/realData/controller/RealDataController.java
  82. 8 8
      src/main/resources/application-dev.yml

+ 13 - 0
pom.xml

@@ -87,6 +87,19 @@
         <dependency>
             <groupId>org.springframework.kafka</groupId>
             <artifactId>spring-kafka</artifactId>
+            <version>2.5.14.RELEASE</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.kafka</groupId>
+                    <artifactId>kafka-clients</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.kafka</groupId>
+            <artifactId>kafka-clients</artifactId>
+            <version>3.0.0</version>
+
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 84 - 0
src/main/java/org/springblade/etl/EtlGroundDataTask.java

@@ -0,0 +1,84 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/5/22
+ */
+package org.springblade.etl;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.utils.ConcurrentDateFormat;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.etl.entity.EtlRainDataEntity;
+import org.springblade.etl.service.IEtlRainDataService;
+import org.springblade.modules.business.rtu.data.entity.RtuDataRainEntity;
+import org.springblade.modules.business.rtu.data.service.IRtuDataRainService;
+import org.springframework.data.redis.core.HashOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+/***
+ * Date:2022/5/22
+ * Title: 环境辐射与气象监测系统(KRS) 模块
+ * Description:MODBUS TCP 协议传输 ,读取任务
+ * @author swp
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+public class EtlGroundDataTask implements Callable<Integer> {
+
+	private RedisTemplate redisTemplate;
+	private IEtlRainDataService etlRainDataService;
+	private IRtuDataRainService rtuDataRainService;
+
+
+	EtlGroundDataTask(RedisTemplate redisTemplate, IEtlRainDataService rainDataService, IRtuDataRainService rtuDataRainService) {
+		this.redisTemplate = redisTemplate;
+		this.etlRainDataService = rainDataService;
+		this.rtuDataRainService = rtuDataRainService;
+	}
+
+	@Override
+	public Integer call() {
+		try {
+			HashOperations<String, String, String> opsHash = redisTemplate.opsForHash();
+			Date date = new Date();
+			if (opsHash.hasKey("etl", "rain_update_time")) {
+				String dt = opsHash.get("etl", "rain_update_time");
+				date = Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd"));
+			} else {
+				String dt = Func.formatDateTime(date);
+				date = Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd"));
+			}
+			EtlRainDataEntity dto = new EtlRainDataEntity();
+			dto.setTm(date);
+			List<EtlRainDataEntity> list = etlRainDataService.selectLastList(dto);
+			if (list != null && list.size() > 0) {
+				for (int i = 0; i < list.size(); i++) {
+					EtlRainDataEntity entity = list.get(i);
+					LambdaQueryWrapper<RtuDataRainEntity> dataWrapper = Wrappers.<RtuDataRainEntity>query().lambda();
+					dataWrapper.eq(RtuDataRainEntity::getRtuCode, entity.getRtuCode());
+					RtuDataRainEntity rainEntity = rtuDataRainService.getOne(dataWrapper);
+					if (null == rainEntity) {
+						rainEntity = new RtuDataRainEntity();
+					}
+					rainEntity.setDrp(entity.getDrp());
+					rainEntity.setIntv(entity.getIntv());
+					rainEntity.setRtuCode(entity.getRtuCode());
+					rainEntity.setTm(entity.getTm());
+					rtuDataRainService.saveOrUpdate(rainEntity);
+				}
+			}
+		} catch (Exception e) {
+			log.error("实时数据统计任务异常 {}", e.getMessage());
+		}
+		return 0;
+	}
+}

+ 84 - 0
src/main/java/org/springblade/etl/EtlRainDataTask.java

@@ -0,0 +1,84 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/5/22
+ */
+package org.springblade.etl;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.utils.ConcurrentDateFormat;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.etl.entity.EtlRainDataEntity;
+import org.springblade.etl.service.IEtlRainDataService;
+import org.springblade.modules.business.rtu.data.entity.RtuDataRainEntity;
+import org.springblade.modules.business.rtu.data.service.IRtuDataRainService;
+import org.springframework.data.redis.core.HashOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+/***
+ * Date:2022/5/22
+ * Title: 环境辐射与气象监测系统(KRS) 模块
+ * Description:MODBUS TCP 协议传输 ,读取任务
+ * @author swp
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+public class EtlRainDataTask implements Callable<Integer> {
+
+	private RedisTemplate redisTemplate;
+	private IEtlRainDataService etlRainDataService;
+	private IRtuDataRainService rtuDataRainService;
+
+
+	EtlRainDataTask(RedisTemplate redisTemplate, IEtlRainDataService rainDataService, IRtuDataRainService rtuDataRainService) {
+		this.redisTemplate = redisTemplate;
+		this.etlRainDataService = rainDataService;
+		this.rtuDataRainService = rtuDataRainService;
+	}
+
+	@Override
+	public Integer call() {
+		try {
+			HashOperations<String, String, String> opsHash = redisTemplate.opsForHash();
+			Date date = new Date();
+			if (opsHash.hasKey("etl", "rain_update_time")) {
+				String dt = opsHash.get("etl", "rain_update_time");
+				date = Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd"));
+			} else {
+				String dt = Func.formatDateTime(date);
+				date = Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd"));
+			}
+			EtlRainDataEntity dto = new EtlRainDataEntity();
+			dto.setTm(date);
+			List<EtlRainDataEntity> list = etlRainDataService.selectLastList(dto);
+			if (list != null && list.size() > 0) {
+				for (int i = 0; i < list.size(); i++) {
+					EtlRainDataEntity entity = list.get(i);
+					LambdaQueryWrapper<RtuDataRainEntity> dataWrapper = Wrappers.<RtuDataRainEntity>query().lambda();
+					dataWrapper.eq(RtuDataRainEntity::getRtuCode, entity.getRtuCode());
+					RtuDataRainEntity rainEntity = rtuDataRainService.getOne(dataWrapper);
+					if (null == rainEntity) {
+						rainEntity = new RtuDataRainEntity();
+					}
+					rainEntity.setDrp(entity.getDrp());
+					rainEntity.setIntv(entity.getIntv());
+					rainEntity.setRtuCode(entity.getRtuCode());
+					rainEntity.setTm(entity.getTm());
+					rtuDataRainService.saveOrUpdate(rainEntity);
+				}
+			}
+		} catch (Exception e) {
+			log.error("实时数据统计任务异常 {}", e.getMessage());
+		}
+		return 0;
+	}
+}

+ 84 - 0
src/main/java/org/springblade/etl/EtlRiverDataTask.java

@@ -0,0 +1,84 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/5/22
+ */
+package org.springblade.etl;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.utils.ConcurrentDateFormat;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.etl.entity.EtlRainDataEntity;
+import org.springblade.etl.service.IEtlRainDataService;
+import org.springblade.modules.business.rtu.data.entity.RtuDataRainEntity;
+import org.springblade.modules.business.rtu.data.service.IRtuDataRainService;
+import org.springframework.data.redis.core.HashOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+/***
+ * Date:2022/5/22
+ * Title: 环境辐射与气象监测系统(KRS) 模块
+ * Description:MODBUS TCP 协议传输 ,读取任务
+ * @author swp
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+public class EtlRiverDataTask implements Callable<Integer> {
+
+	private RedisTemplate redisTemplate;
+	private IEtlRainDataService etlRainDataService;
+	private IRtuDataRainService rtuDataRainService;
+
+
+	EtlRiverDataTask(RedisTemplate redisTemplate, IEtlRainDataService rainDataService, IRtuDataRainService rtuDataRainService) {
+		this.redisTemplate = redisTemplate;
+		this.etlRainDataService = rainDataService;
+		this.rtuDataRainService = rtuDataRainService;
+	}
+
+	@Override
+	public Integer call() {
+		try {
+			HashOperations<String, String, String> opsHash = redisTemplate.opsForHash();
+			Date date = new Date();
+			if (opsHash.hasKey("etl", "rain_update_time")) {
+				String dt = opsHash.get("etl", "rain_update_time");
+				date = Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd"));
+			} else {
+				String dt = Func.formatDateTime(date);
+				date = Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd"));
+			}
+			EtlRainDataEntity dto = new EtlRainDataEntity();
+			dto.setTm(date);
+			List<EtlRainDataEntity> list = etlRainDataService.selectLastList(dto);
+			if (list != null && list.size() > 0) {
+				for (int i = 0; i < list.size(); i++) {
+					EtlRainDataEntity entity = list.get(i);
+					LambdaQueryWrapper<RtuDataRainEntity> dataWrapper = Wrappers.<RtuDataRainEntity>query().lambda();
+					dataWrapper.eq(RtuDataRainEntity::getRtuCode, entity.getRtuCode());
+					RtuDataRainEntity rainEntity = rtuDataRainService.getOne(dataWrapper);
+					if (null == rainEntity) {
+						rainEntity = new RtuDataRainEntity();
+					}
+					rainEntity.setDrp(entity.getDrp());
+					rainEntity.setIntv(entity.getIntv());
+					rainEntity.setRtuCode(entity.getRtuCode());
+					rainEntity.setTm(entity.getTm());
+					rtuDataRainService.saveOrUpdate(rainEntity);
+				}
+			}
+		} catch (Exception e) {
+			log.error("实时数据统计任务异常 {}", e.getMessage());
+		}
+		return 0;
+	}
+}

+ 84 - 0
src/main/java/org/springblade/etl/EtlRsvrDataTask.java

@@ -0,0 +1,84 @@
+/**
+ * Copyright
+ * All right reserved.
+ * 项目名称:
+ * 创建日期:2022/5/22
+ */
+package org.springblade.etl;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.utils.ConcurrentDateFormat;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.etl.entity.EtlRainDataEntity;
+import org.springblade.etl.service.IEtlRainDataService;
+import org.springblade.modules.business.rtu.data.entity.RtuDataRainEntity;
+import org.springblade.modules.business.rtu.data.service.IRtuDataRainService;
+import org.springframework.data.redis.core.HashOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+/***
+ * Date:2022/5/22
+ * Title: 环境辐射与气象监测系统(KRS) 模块
+ * Description:MODBUS TCP 协议传输 ,读取任务
+ * @author swp
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Slf4j
+public class EtlRsvrDataTask implements Callable<Integer> {
+
+	private RedisTemplate redisTemplate;
+	private IEtlRainDataService etlRainDataService;
+	private IRtuDataRainService rtuDataRainService;
+
+
+	EtlRsvrDataTask(RedisTemplate redisTemplate, IEtlRainDataService rainDataService, IRtuDataRainService rtuDataRainService) {
+		this.redisTemplate = redisTemplate;
+		this.etlRainDataService = rainDataService;
+		this.rtuDataRainService = rtuDataRainService;
+	}
+
+	@Override
+	public Integer call() {
+		try {
+			HashOperations<String, String, String> opsHash = redisTemplate.opsForHash();
+			Date date = new Date();
+			if (opsHash.hasKey("etl", "rain_update_time")) {
+				String dt = opsHash.get("etl", "rain_update_time");
+				date = Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd"));
+			} else {
+				String dt = Func.formatDateTime(date);
+				date = Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd"));
+			}
+			EtlRainDataEntity dto = new EtlRainDataEntity();
+			dto.setTm(date);
+			List<EtlRainDataEntity> list = etlRainDataService.selectLastList(dto);
+			if (list != null && list.size() > 0) {
+				for (int i = 0; i < list.size(); i++) {
+					EtlRainDataEntity entity = list.get(i);
+					LambdaQueryWrapper<RtuDataRainEntity> dataWrapper = Wrappers.<RtuDataRainEntity>query().lambda();
+					dataWrapper.eq(RtuDataRainEntity::getRtuCode, entity.getRtuCode());
+					RtuDataRainEntity rainEntity = rtuDataRainService.getOne(dataWrapper);
+					if (null == rainEntity) {
+						rainEntity = new RtuDataRainEntity();
+					}
+					rainEntity.setDrp(entity.getDrp());
+					rainEntity.setIntv(entity.getIntv());
+					rainEntity.setRtuCode(entity.getRtuCode());
+					rainEntity.setTm(entity.getTm());
+					rtuDataRainService.saveOrUpdate(rainEntity);
+				}
+			}
+		} catch (Exception e) {
+			log.error("实时数据统计任务异常 {}", e.getMessage());
+		}
+		return 0;
+	}
+}

+ 0 - 116
src/main/java/org/springblade/etl/EtlTask.java

@@ -1,116 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/5/22
- */
-package org.springblade.etl;
-
-import cn.hutool.core.date.DateUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import lombok.extern.slf4j.Slf4j;
-import org.springblade.etl.entity.EtlWarningInfoEntity;
-import org.springblade.etl.service.IEtlWarningService;
-import org.springblade.modules.business.rtu.base.service.IRtuBaseInfoService;
-import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
-import org.springblade.modules.business.warning.service.IRtuWarningService;
-import org.springframework.data.redis.core.HashOperations;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.messaging.simp.SimpMessagingTemplate;
-
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.Callable;
-
-/***
- * Date:2022/5/22
- * Title: 环境辐射与气象监测系统(KRS) 模块
- * Description:MODBUS TCP 协议传输 ,读取任务
- * @author swp
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-@Slf4j
-public class EtlTask implements Callable<Integer> {
-
-	private RedisTemplate redisTemplate;
-	private IEtlWarningService etlWarningService;
-	private SimpMessagingTemplate messagingTemplate;
-
-	public EtlTask(RedisTemplate redisTemplate, IEtlWarningService etlWarningService,  SimpMessagingTemplate messagingTemplate){
-		this.redisTemplate=redisTemplate;
-		this.etlWarningService=etlWarningService;
-		this.messagingTemplate=messagingTemplate;
-	}
-
-	@Override
-	public Integer call()  {
-		try {
-
-//			HashOperations<String, String, String> opsHash = redisTemplate.opsForHash();
-//			SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//
-//			Calendar calendar = Calendar.getInstance();
-//			calendar.set(Calendar.HOUR_OF_DAY, 0);
-//			calendar.set(Calendar.MINUTE, 0);
-//			calendar.set(Calendar.SECOND, 0);
-//			Date lastProcessDate = calendar.getTime();
-//			if (opsHash.hasKey("data_process_time", "warning")) {
-//				String dt = opsHash.get("data_process_time", "warning");
-//				lastProcessDate = timeFormat.parse(dt);
-//			}
-//			List<EtlWarningInfoEntity> list = etlWarningService.getEtlWarning(lastProcessDate);
-//			if (null != list && list.size() > 0) {
-//				for (WarningInfo warningInfo : list) {
-//					String jsonObject = JSONObject.toJSONString(warningInfo);
-//					DataProcessHolder.newInstance().dataProcess.kafkaTemplate.send("ywxt.warning", jsonObject);
-//					LogHelper.info("find warning : "+jsonObject);
-//				}
-//				WarningInfo lastwarn= list.get(list.size()-1);
-//				opsHash.put("data_process_time", "warning", timeFormat.format(lastwarn.getCreateTime()));
-//			}
-//
-//
-//
-//			Date startTm = new Date();
-//			String timeStartText = DateUtil.format(startTm, "yyyy年MM月dd日 HH时mm分ss秒");
-//
-//
-//			HashOperations<String, String, String> opsHash = redisTemplate.opsForHash();
-//
-//			long rtus =rtuBaseInfoService.count();
-//
-//			opsHash.put("real_data_info","rtus",Long.toString(rtus));
-//
-//
-//			LambdaUpdateWrapper<RtuWarningInfoEntity> updateWrapper = Wrappers.<RtuWarningInfoEntity>update().lambda();
-//			updateWrapper.eq(RtuWarningInfoEntity::getIsDeleted, 0);
-//			updateWrapper.eq(RtuWarningInfoEntity::getWarningStatus, 0);
-//			long warningRtus=rtuWarningService.count(updateWrapper);
-//
-//			opsHash.put("real_data_info","warningRtus",Long.toString(warningRtus));
-//
-//			opsHash.put("real_data_info","delayOrders","1");
-//			opsHash.put("real_data_info","equipmentInspectionCount","0");
-//
-//
-//			JSONObject info = new JSONObject();
-//			info.put("rtus",rtus);
-//			info.put("warningRtus",warningRtus);
-//			info.put("delayOrders",0);
-//			info.put("equipmentInspectionCount",0);
-//
-//		//	messagingTemplate.convertAndSend("real_data_info", info.toJSONString());
-//
-//			Date endTime = new Date();
-			//log.info("实时数据统计任务结束 用时:{} 毫秒", (endTime.getTime() - startTm.getTime()));
-		} catch (Exception e) {
-			log.error("实时数据统计任务异常 {}", e.getMessage());
-		}
-		return 0;
-	}
-}

+ 26 - 20
src/main/java/org/springblade/etl/EtlTaskManager.java

@@ -9,7 +9,7 @@ package org.springblade.etl;
 
 import lombok.extern.slf4j.Slf4j;
 import org.glassfish.jersey.internal.guava.ThreadFactoryBuilder;
-import org.springblade.etl.service.IEtlWarningService;
+import org.springblade.etl.service.*;
 import org.springblade.modules.business.project.base.service.IProjectBaseInfoService;
 import org.springblade.modules.business.rtu.base.service.IRtuBaseInfoService;
 import org.springblade.modules.business.rtu.data.service.IRtuDataGroundService;
@@ -52,10 +52,10 @@ public class EtlTaskManager {
 		0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), publicThreadFactory, new ThreadPoolExecutor.AbortPolicy());
 
 	@Resource
-	private  IEtlWarningService etlWarningService;
+	private IEtlWarningService etlWarningService;
 
 	@Resource
-	private IRtuWarningService  rtuWarningService;
+	private IRtuWarningService rtuWarningService;
 
 	@Resource
 	private IRtuBaseInfoService rtuBaseInfoService;
@@ -85,7 +85,7 @@ public class EtlTaskManager {
 	private RedisTemplate redisTemplate;
 
 	@Resource
-	private IDictBizService  dictBizService;
+	private IDictBizService dictBizService;
 
 	@Resource
 	private IRtuManageService rtuManageService;
@@ -93,34 +93,40 @@ public class EtlTaskManager {
 	@Resource
 	private IOriginalWarningService originalWarningService;
 
+	@Resource
+	private IEtlRainDataService etlRainDataService;
+
+	@Resource
+	private IEtlRiverDataService etlRiverDataService;
+
+	@Resource
+	private IEtlRsvrDataService etlRsvrDataService;
 
-	@Scheduled(cron = "0 0 0/1 * * * ")
+	@Resource
+	private IEtlGroundDataService etlGroundDataService;
+
+
+	@Scheduled(cron = "0 0/5 * * * * ")
 	public void warnTask() {
 		try {
-
-//			TestDataTask task = new TestDataTask(redisTemplate, kafkaTemplate, messagingTemplate, etlWarningService, rtuWarningService, rtuBaseInfoService, projectBaseInfoService, dataRainService, dataRiverService, dataRsvrService, dataGroundService, dictBizService, rtuManageService);
+//			EtlRainDataTask task = new EtlRainDataTask(redisTemplate, etlRainDataService, dataRainService);
 //			FutureTask<Integer> futureTask = new FutureTask<>(task);
 //			publicThreadPool.execute(futureTask);
 
+
 //			TestWarnTask task2 = new TestWarnTask(redisTemplate,kafkaTemplate,messagingTemplate,etlWarningService,rtuWarningService,rtuBaseInfoService,projectBaseInfoService,dataRainService,dataRiverService,dataRsvrService,dataGroundService,originalWarningService);
 //			FutureTask<Integer> futureTask2 = new FutureTask<>(task2);
 //			publicThreadPool.execute(futureTask2);
 
-		} catch (Exception e) {
-			log.error("{}",e.getMessage());
-		}
-	}
 
-//	@Scheduled(cron = "0 3 0/1 * * * ")
-//	public void dataTask() {
-//		try {
-//			TestDataTask task = new TestDataTask(redisTemplate,kafkaTemplate,messagingTemplate,etlWarningService,rtuWarningService,rtuBaseInfoService,projectBaseInfoService,dataRainService,dataRiverService,dataRsvrService,dataGroundService,dictBizService,rtuManageService);
+//			TestDataTask task = new TestDataTask(redisTemplate, kafkaTemplate, messagingTemplate, etlWarningService, rtuWarningService, rtuBaseInfoService, projectBaseInfoService, dataRainService, dataRiverService, dataRsvrService, dataGroundService, dictBizService, rtuManageService,etlRainDataService,etlRiverDataService,etlRsvrDataService,etlGroundDataService);
 //			FutureTask<Integer> futureTask = new FutureTask<>(task);
 //			publicThreadPool.execute(futureTask);
-//
-//		} catch (Exception e) {
-//			log.error("{}",e.getMessage());
-//		}
-//	}
+
+
+		} catch (Exception e) {
+			log.error("{}", e.getMessage());
+		}
+	}
 
 }

+ 1 - 1
src/main/java/org/springblade/etl/EtlWarningTask.java

@@ -77,7 +77,7 @@ public class EtlWarningTask implements Callable<Integer> {
 			}
 
 		} catch (Exception e) {
-			log.error("测试数据任务异常 {}", e.getMessage());
+			log.error("数据任务异常 {}", e.getMessage());
 		}
 		return 0;
 	}

+ 49 - 15
src/main/java/org/springblade/etl/TestDataTask.java

@@ -18,8 +18,10 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.enums.EquipmentStatusEnum;
 import org.springblade.enums.OrderFromEnum;
 import org.springblade.enums.WarningStatusEnum;
+import org.springblade.etl.entity.EtlRainDataEntity;
+import org.springblade.etl.entity.EtlRsvrDataEntity;
 import org.springblade.etl.entity.EtlWarningInfoEntity;
-import org.springblade.etl.service.IEtlWarningService;
+import org.springblade.etl.service.*;
 import org.springblade.modules.business.project.base.entity.ProjectInfoEntity;
 import org.springblade.modules.business.project.base.service.IProjectBaseInfoService;
 import org.springblade.modules.business.rtu.base.entity.RtuInfoEntity;
@@ -64,7 +66,7 @@ public class TestDataTask implements Callable<Integer> {
 	private RedisTemplate redisTemplate;
 	private SimpMessagingTemplate messagingTemplate;
 	private KafkaTemplate<String, String> kafkaTemplate;
-	private IEtlWarningService etlWarningService;
+
 	private IRtuWarningService rtuWarningService;
 	private IRtuBaseInfoService rtuBaseInfoService;
 	private IProjectBaseInfoService projectBaseInfoService;
@@ -75,7 +77,14 @@ public class TestDataTask implements Callable<Integer> {
 	private IDictBizService dictBizService;
 	private IRtuManageService manageService;
 
-	public TestDataTask(RedisTemplate redisTemplate, KafkaTemplate<String, String> kafkaTemplate, SimpMessagingTemplate messagingTemplate, IEtlWarningService etlWarningService, IRtuWarningService rtuWarningService, IRtuBaseInfoService rtuBaseInfoService, IProjectBaseInfoService projectBaseInfoService, IRtuDataRainService dataRainService, IRtuDataRiverService dataRiverService, IRtuDataRsvrService dataRsvrService, IRtuDataGroundService dataGroundService, IDictBizService dictBizService, IRtuManageService manageService) {
+	private IEtlWarningService etlWarningService;
+	private IEtlRainDataService etlRainDataService;
+	private IEtlRiverDataService etlRiverDataService;
+	private IEtlRsvrDataService etlRsvrDataService;
+	private IEtlGroundDataService etlGroundDataService;
+
+
+	public TestDataTask(RedisTemplate redisTemplate, KafkaTemplate<String, String> kafkaTemplate, SimpMessagingTemplate messagingTemplate, IEtlWarningService etlWarningService, IRtuWarningService rtuWarningService, IRtuBaseInfoService rtuBaseInfoService, IProjectBaseInfoService projectBaseInfoService, IRtuDataRainService dataRainService, IRtuDataRiverService dataRiverService, IRtuDataRsvrService dataRsvrService, IRtuDataGroundService dataGroundService, IDictBizService dictBizService, IRtuManageService manageService, IEtlRainDataService etlRainDataService, IEtlRiverDataService etlRiverDataService, IEtlRsvrDataService etlRsvrDataService, IEtlGroundDataService etlGroundDataService) {
 		this.redisTemplate = redisTemplate;
 		this.kafkaTemplate = kafkaTemplate;
 		this.messagingTemplate = messagingTemplate;
@@ -89,6 +98,10 @@ public class TestDataTask implements Callable<Integer> {
 		this.dataRsvrService = dataRsvrService;
 		this.dictBizService = dictBizService;
 		this.manageService = manageService;
+		this.etlRainDataService = etlRainDataService;
+		this.etlRiverDataService = etlRiverDataService;
+		this.etlRsvrDataService = etlRsvrDataService;
+		this.etlGroundDataService = etlGroundDataService;
 	}
 
 	@Override
@@ -134,12 +147,20 @@ public class TestDataTask implements Callable<Integer> {
 											if (null == rainEntity) {
 												rainEntity = new RtuDataRainEntity();
 											}
-											java.util.Random random = new java.util.Random();
-											Double drp = random.nextDouble();
-											rainEntity.setDrp(drp);
-											rainEntity.setRtuCode(rtuInfoEntity.getRtuCode());
-											rainEntity.setTm(calendar.getTime());
-											dataRainService.saveOrUpdate(rainEntity);
+
+											LambdaQueryWrapper<EtlRainDataEntity> etlWrapper = Wrappers.<EtlRainDataEntity>query().lambda();
+											etlWrapper.eq(EtlRainDataEntity::getRtuCode, rtuInfoEntity.getRtuCode());
+											etlWrapper.orderByDesc(EtlRainDataEntity::getTm);
+											etlWrapper.last("limit 1");
+											//java.util.Random random = new java.util.Random();
+											//Double drp = random.nextDouble();
+											EtlRainDataEntity etlRainDataEntity = etlRainDataService.getOne(etlWrapper);
+											if (etlRainDataEntity != null) {
+												rainEntity.setDrp(etlRainDataEntity.getDrp());
+												rainEntity.setRtuCode(rtuInfoEntity.getRtuCode());
+												rainEntity.setTm(calendar.getTime());
+												dataRainService.saveOrUpdate(rainEntity);
+											}
 
 
 										} else if (biz.getDictKey().equals("ground")) {
@@ -164,7 +185,7 @@ public class TestDataTask implements Callable<Integer> {
 											groundEntity.setSlm100(random.nextDouble());
 
 											groundEntity.setTm(calendar.getTime());
-											dataGroundService.saveOrUpdate(groundEntity);
+											//	dataGroundService.saveOrUpdate(groundEntity);
 
 
 										} else if (biz.getDictKey().equals("river")) {
@@ -180,7 +201,7 @@ public class TestDataTask implements Callable<Integer> {
 											java.util.Random random = new java.util.Random();
 											riverEntity.setZ(random.nextDouble());
 											riverEntity.setTm(calendar.getTime());
-											dataRiverService.saveOrUpdate(riverEntity);
+											//	dataRiverService.saveOrUpdate(riverEntity);
 
 
 										} else if (biz.getDictKey().equals("rsvr")) {
@@ -192,10 +213,23 @@ public class TestDataTask implements Callable<Integer> {
 											}
 
 											rsvrEntity.setRtuCode(rtuInfoEntity.getRtuCode());
-											java.util.Random random = new java.util.Random();
-											rsvrEntity.setRz(random.nextDouble());
-											rsvrEntity.setTm(calendar.getTime());
-											dataRsvrService.saveOrUpdate(rsvrEntity);
+
+
+											//	java.util.Random random = new java.util.Random();
+											//	rsvrEntity.setRz(random.nextDouble());
+
+											LambdaQueryWrapper<EtlRsvrDataEntity> etlWrapper = Wrappers.<EtlRsvrDataEntity>query().lambda();
+											etlWrapper.eq(EtlRsvrDataEntity::getRtuCode, rtuInfoEntity.getRtuCode());
+											etlWrapper.orderByDesc(EtlRsvrDataEntity::getTm);
+											etlWrapper.last("limit 1");
+											//java.util.Random random = new java.util.Random();
+											//Double drp = random.nextDouble();
+											EtlRsvrDataEntity etlRsvrDataEntity = etlRsvrDataService.getOne(etlWrapper);
+											if (etlRsvrDataEntity != null) {
+												rsvrEntity.setRz(etlRsvrDataEntity.getRz());
+												rsvrEntity.setTm(calendar.getTime());
+												dataRsvrService.saveOrUpdate(rsvrEntity);
+											}
 
 
 										}

+ 102 - 0
src/main/java/org/springblade/etl/entity/EtlGroundDataEntity.java

@@ -0,0 +1,102 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("etl_att_st_somo")
+public class EtlGroundDataEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("GUID")
+	private String guid;
+
+	@ApiModelProperty("编码")
+	private String rtuCode;
+
+	@ApiModelProperty("降水量值截止时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+	)
+	private Date tm;
+
+	/**
+	 * 垂线平均含水量
+	 */
+	@ApiModelProperty("垂线平均含水量")
+	private Double vtavslm;
+
+	/**
+	 * 表层含水量
+	 */
+	@ApiModelProperty("表层含水量")
+	private Double srlslm;
+
+	/**
+	 * 10CM深度含水量
+	 */
+	@ApiModelProperty("10CM深度含水量")
+	private Double slm10;
+
+	/**
+	 * 20CM深度含水量
+	 */
+	@ApiModelProperty("20CM深度含水量")
+	private Double slm20;
+
+	/**
+	 * 30CM深度含水量
+	 */
+	@ApiModelProperty("30CM深度含水量")
+	private Double slm30;
+
+	/**
+	 * 40CM深度含水量
+	 */
+	@ApiModelProperty("40CM深度含水量")
+	private Double slm40;
+
+	/**
+	 * 60CM深度含水量
+	 */
+	@ApiModelProperty("60CM深度含水量")
+	private Double slm60;
+
+	/**
+	 * 80CM深度含水量
+	 */
+	@ApiModelProperty("80CM深度含水量")
+	private Double slm80;
+
+	/**
+	 * 100CM深度含水量
+	 */
+	@ApiModelProperty("100CM深度含水量")
+	private Double slm100;
+
+}

+ 78 - 0
src/main/java/org/springblade/etl/entity/EtlRainDataEntity.java

@@ -0,0 +1,78 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("etl_att_st_prec")
+public class EtlRainDataEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("GUID")
+	private String guid;
+
+	@ApiModelProperty("编码")
+	private String rtuCode;
+
+	@ApiModelProperty("降水量值截止时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+	)
+	private Date tm;
+
+	/**
+	 * 降水量
+	 */
+	@ApiModelProperty("降水量")
+	private Double drp;
+
+	/**
+	 * 时段长
+	 */
+	@ApiModelProperty("时段长")
+	private Double intv;
+
+	/**
+	 * 降水历时,格式 HH.NN
+	 */
+	@ApiModelProperty("降水历时,格式 HH.NN")
+	private Double pdr;
+
+	/**
+	 * 日降水量,前一天8时到当前8时,24小时降水量
+	 */
+	@ApiModelProperty("日降水量,前一天8时到当前8时,24小时降水量")
+	private Double dyp;
+
+	/**
+	 * 天气状况
+	 */
+	@ApiModelProperty("天气状况")
+	private String wth;
+
+}

+ 54 - 0
src/main/java/org/springblade/etl/entity/EtlRiverDataEntity.java

@@ -0,0 +1,54 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("etl_att_st_waco_ware")
+public class EtlRiverDataEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("GUID")
+	private String guid;
+
+	@ApiModelProperty("编码")
+	private String rtuCode;
+
+	@ApiModelProperty("降水量值截止时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+	)
+	private Date tm;
+
+	/**
+	 * 河道水位
+	 */
+	@ApiModelProperty("河道水位")
+	private Double z;
+
+}

+ 54 - 0
src/main/java/org/springblade/etl/entity/EtlRsvrDataEntity.java

@@ -0,0 +1,54 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/8
+ */
+package org.springblade.etl.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/***
+ * Date:2022/9/8
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("etl_att_st_res_ware")
+public class EtlRsvrDataEntity extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("GUID")
+	private String guid;
+
+	@ApiModelProperty("编码")
+	private String rtuCode;
+
+	@ApiModelProperty("降水量值截止时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+	)
+	private Date tm;
+
+	/**
+	 * 库上水位
+	 */
+	@ApiModelProperty("库上水位")
+	private Double rz;
+
+}

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

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

+ 33 - 0
src/main/java/org/springblade/etl/mapper/EtlGroundDataMapper.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.etl.mapper.EtlGroundDataMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="groundDataEntityResultMap" type="org.springblade.etl.entity.EtlGroundDataEntity">
+        <result column="GUID" property="guid"/>
+        <result column="ST_CODE" property="rtuCode"/>
+        <result column="TM" property="tm"/>
+        <result column="VTAVSLM" property="vtavslm"/>
+        <result column="SRLSLM" property="srlslm"/>
+        <result column="SLM10" property="slm10"/>
+        <result column="SLM20" property="slm20"/>
+        <result column="SLM30" property="slm30"/>
+        <result column="SLM40" property="slm40"/>
+        <result column="SLM60" property="slm60"/>
+        <result column="SLM80" property="slm80"/>
+        <result column="SLM100" property="slm100"/>
+    </resultMap>
+
+
+    <select id="selectLastList" resultMap="groundDataEntityResultMap">
+        SELECT
+        d.*
+        FROM
+        etl_att_st_somo d
+        WHERE 1=1
+        <if test="etlGroundDataEntity.tm!=null">
+            and d.tm > #{etlGroundDataEntity.tm}
+        </if>
+        order  by d.tm asc
+    </select>
+</mapper>

+ 26 - 0
src/main/java/org/springblade/etl/mapper/EtlRainDataMapper.java

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

+ 29 - 0
src/main/java/org/springblade/etl/mapper/EtlRainDataMapper.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.etl.mapper.EtlRainDataMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="rainDataEntityResultMap" type="org.springblade.etl.entity.EtlRainDataEntity">
+        <result column="GUID" property="guid"/>
+        <result column="ST_CODE" property="rtuCode"/>
+        <result column="TM" property="tm"/>
+        <result column="DRP" property="drp"/>
+        <result column="INTV" property="intv"/>
+        <result column="PDR" property="pdr"/>
+        <result column="DYP" property="dyp"/>
+        <result column="WTH" property="wth"/>
+    </resultMap>
+
+
+    <select id="selectLastList" resultMap="rainDataEntityResultMap">
+        SELECT
+        d.*
+        FROM
+        etl_att_st_prec d
+        WHERE 1=1
+        <if test="etlRainDataEntity.tm!=null">
+            and d.tm > #{etlRainDataEntity.tm}
+        </if>
+        order  by d.tm asc
+    </select>
+</mapper>

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

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

+ 26 - 0
src/main/java/org/springblade/etl/mapper/EtlRiverDataMapper.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.etl.mapper.EtlRiverDataMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="riverDataEntityResultMap" type="org.springblade.etl.entity.EtlRiverDataEntity">
+        <result column="GUID" property="guid"/>
+        <result column="ST_CODE" property="rtuCode"/>
+        <result column="TM" property="tm"/>
+        <result column="Z" property="z"/>
+
+    </resultMap>
+
+
+    <select id="selectLastList" resultMap="riverDataEntityResultMap">
+        SELECT
+        d.*
+        FROM
+        etl_att_st_waco_ware d
+        WHERE 1=1
+        <if test="etlRiverDataEntity.tm!=null">
+            and d.tm > #{etlRiverDataEntity.tm}
+        </if>
+        order  by d.tm asc
+    </select>
+</mapper>

+ 26 - 0
src/main/java/org/springblade/etl/mapper/EtlRsvrDataMapper.java

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

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

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.etl.mapper.EtlRsvrDataMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="rsvrDataEntityResultMap" type="org.springblade.etl.entity.EtlRsvrDataEntity">
+        <result column="GUID" property="guid"/>
+        <result column="ST_CODE" property="rtuCode"/>
+        <result column="TM" property="tm"/>
+        <result column="RZ" property="rz"/>
+    </resultMap>
+
+
+    <select id="selectLastList" resultMap="rsvrDataEntityResultMap">
+        SELECT
+        d.*
+        FROM
+        etl_att_st_prec d
+        WHERE 1=1
+        <if test="etlRsvrDataEntity.tm!=null">
+            and d.tm > #{etlRsvrDataEntity.tm}
+        </if>
+        order  by d.tm asc
+    </select>
+</mapper>

+ 27 - 0
src/main/java/org/springblade/etl/service/IEtlGroundDataService.java

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

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

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

+ 27 - 0
src/main/java/org/springblade/etl/service/IEtlRiverDataService.java

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

+ 27 - 0
src/main/java/org/springblade/etl/service/IEtlRsvrDataService.java

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

+ 36 - 0
src/main/java/org/springblade/etl/service/impl/EtlGroundDataServiceImpl.java

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

+ 33 - 0
src/main/java/org/springblade/etl/service/impl/EtlRainDataServiceImpl.java

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

+ 36 - 0
src/main/java/org/springblade/etl/service/impl/EtlRiverDataServiceImpl.java

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

+ 33 - 0
src/main/java/org/springblade/etl/service/impl/EtlRsvrDataServiceImpl.java

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

+ 94 - 26
src/main/java/org/springblade/modules/business/check/order/controller/RtuCheckOrderController.java

@@ -29,7 +29,9 @@ 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.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.CheckOrderInfoVO;
+import org.springblade.modules.business.check.order.vo.OrgCheckOrderCountVO;
 import org.springblade.modules.business.check.order.wrapper.RtuCheckOrderWrapper;
 import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
 import org.springblade.modules.business.check.process.service.IRtuOrderProcessService;
@@ -37,11 +39,17 @@ import org.springblade.modules.business.check.process.vo.OrderProcessInfoVO;
 import org.springblade.modules.business.check.process.wrapper.RtuOrderProcessWrapper;
 import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
 import org.springblade.modules.business.project.base.entity.ProjectTreeNodeEntity;
+import org.springblade.modules.business.rtu.base.entity.RtuInfoEntity;
+import org.springblade.modules.business.rtu.base.vo.RtuStatisticsInfoVO;
 import org.springblade.modules.business.rtumanage.entity.RtuStatusEntity;
 import org.springblade.modules.business.rtumanage.service.IRtuManageService;
+import org.springblade.modules.business.warning.dto.RtuWarningInfoDTO;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
 import org.springblade.modules.business.warning.service.IRtuWarningService;
+import org.springblade.modules.system.entity.Dept;
 import org.springblade.modules.system.entity.DictBiz;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.IDeptService;
 import org.springblade.modules.system.service.IDictBizService;
 import org.springblade.modules.system.service.IUserService;
 import org.springframework.web.bind.annotation.*;
@@ -70,7 +78,8 @@ public class RtuCheckOrderController extends BladeController {
 	private final IRtuWarningService warningService;
 	private final IDictBizService dictBizService;
 	private final IRtuManageService manageService;
-
+	private final IUserService userService;
+	private final IDeptService deptService;
 	@GetMapping("/list")
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "列表", notes = "传入CheckOrderInfoDTO")
@@ -90,7 +99,7 @@ public class RtuCheckOrderController extends BladeController {
 	}
 
 	/**
-	 * 多表联合查询自定义分页
+	 * 工单查询,分页
 	 */
 	@GetMapping("/page")
 	@ApiImplicitParams({
@@ -103,17 +112,14 @@ public class RtuCheckOrderController extends BladeController {
 	@ApiOperation(value = "分页", notes = "传入checkOrderInfoDTO")
 	public R<IPage<CheckOrderInfoVO>> page(@ApiIgnore CheckOrderInfoDTO checkOrderInfoDTO, Query query) {
 		BladeUser user = AuthUtil.getUser();
-		if (BusinessConstant.ROLE_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_SUPER_ADMIN.equals(user.getRoleName())) {
+		if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_ORG_SERVICE_PERSON.equals(user.getRoleName())) {
+			checkOrderInfoDTO.setOrgId(Func.toLong(user.getDeptId()));
+		} else {
 			if (user.getDeptId().equals("" + checkOrderInfoDTO.getOrgId())) {
 				checkOrderInfoDTO.setOrgId(null);
 				checkOrderInfoDTO.setProjectId(null);
 			}
-		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_ORG_SERVICE_PERSON.equals(user.getRoleName())) {
-			if (checkOrderInfoDTO.getOrgId() == null) {
-				checkOrderInfoDTO.setOrgId(Func.toLong(user.getDeptId()));
-			}
 		}
-
 		IPage<CheckOrderInfoVO> pages = checkOrderService.selectPage(Condition.getPage(query), checkOrderInfoDTO);
 		List<CheckOrderInfoVO> list = pages.getRecords();
 		for (CheckOrderInfoVO v : list) {
@@ -123,7 +129,7 @@ public class RtuCheckOrderController extends BladeController {
 	}
 
 	/**
-	 * 多表联合查询自定义分页
+	 * 我的工单查询,分页
 	 */
 	@GetMapping("/my/page")
 	@ApiImplicitParams({
@@ -135,6 +141,8 @@ public class RtuCheckOrderController extends BladeController {
 	public R<IPage<CheckOrderInfoVO>> mypage(@ApiIgnore CheckOrderInfoDTO checkOrderInfoDTO, Query query) {
 		BladeUser user = AuthUtil.getUser();
 		checkOrderInfoDTO.setOrderConfirmUser(user.getUserId());
+		checkOrderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
+		checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
 		IPage<CheckOrderInfoVO> pages = checkOrderService.selectPage(Condition.getPage(query), checkOrderInfoDTO);
 		List<CheckOrderInfoVO> list = pages.getRecords();
 		for (CheckOrderInfoVO v : list) {
@@ -160,20 +168,15 @@ public class RtuCheckOrderController extends BladeController {
 		} else {
 			checkOrderInfoDTO.setOrgId(null);
 		}
-//		Date date = new Date();
-//		String dt = Func.formatDateTime(date);
-//		checkOrderInfoDTO.setCreateTime(Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd")));
-		List<CheckOrderInfoVO> list = checkOrderService.unconfirmOrderList( checkOrderInfoDTO);
-		//List<CheckOrderInfoVO> list = pages.getRecords();
+		List<CheckOrderInfoVO> list = checkOrderService.unconfirmOrderList(checkOrderInfoDTO);
 		for (CheckOrderInfoVO v : list) {
 			RtuCheckOrderWrapper.build().addInfoVO(v);
 		}
-
 		return R.data(list);
 	}
 
 	/**
-	 * 多表联合查询自定义分页
+	 * 今日工单动态
 	 */
 	@GetMapping("/today/page")
 	@ApiImplicitParams({
@@ -288,17 +291,25 @@ public class RtuCheckOrderController extends BladeController {
 			}
 		}
 
-		checkOrderService.updateOrderStatus(checkOrderInfoEntity);
+		CheckOrderInfoEntity detail = this.checkOrderService.getById(checkOrderInfoEntity.getId());
+		if (null == detail || detail.getOrderClose() == OrderCloseEnum.ACTIVE_CLOSE.getCode()) {
+			return R.status(false);
+		}
+		detail.setOrderStatusKey(checkOrderInfoEntity.getOrderStatusKey());
+		detail.setOrderClose(OrderCloseEnum.ACTIVE_CLOSE.getCode());
+		detail.setUpdateTime(new Date());
+		detail.setUpdateUser(user.getUserId());
+		checkOrderService.updateById(detail);
+
 		OrderProcessInfoEntity processInfoEntity = new OrderProcessInfoEntity();
-		processInfoEntity.setOrderId(checkOrderInfoEntity.getId());
-		processInfoEntity.setOrderStatusKey(checkOrderInfoEntity.getOrderStatusKey());
+		processInfoEntity.setOrderId(detail.getId());
+		processInfoEntity.setOrderStatusKey(detail.getOrderStatusKey());
 		processInfoEntity.setProcessDesc(checkOrderInfoEntity.getOrderDesc());
-
 		processInfoEntity.setCreateUser(user.getUserId());
 		processInfoEntity.setUpdateUser(user.getUserId());
 		processService.save(processInfoEntity);
 
-		CheckOrderInfoEntity detail = this.checkOrderService.getById(checkOrderInfoEntity.getId());
+
 		List<DictBiz> orderFromDict = dictBizService.getList("rtu_check_order_from");
 		for (DictBiz biz : orderFromDict) {
 			if (biz.getDictKey().equals(OrderFromEnum.FROM_WARNING.getCode())) {
@@ -353,26 +364,83 @@ public class RtuCheckOrderController extends BladeController {
 			}
 		}
 		BladeUser user = AuthUtil.getUser();
+		User userInfo = userService.getById(user.getUserId());
+
 		CheckOrderInfoEntity detail = this.checkOrderService.getById(checkOrderInfoEntity.getId());
 		if (null == detail || null != detail.getOrderConfirmUser()) {
 			return R.status(false);
 		}
 
-		//LambdaUpdateWrapper<CheckOrderInfoEntity> wrapper = Wrappers.<CheckOrderInfoEntity>update().lambda();
-		//wrapper.set(CheckOrderInfoEntity::getOrderStatusKey,checkOrderInfoEntity.getOrderStatusKey());
-		//wrapper.set(CheckOrderInfoEntity::getOrderConfirmUser,user.getUserId());
+        detail.setOrderConfirm(OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
 		detail.setOrderStatusKey(checkOrderInfoEntity.getOrderStatusKey());
 		detail.setOrderConfirmUser(user.getUserId());
+		detail.setOrderConfirmTime(new Date());
 		detail.setUpdateTime(new Date());
 		checkOrderService.updateById(detail);
 
-
 		OrderProcessInfoEntity processInfoEntity = new OrderProcessInfoEntity();
 		processInfoEntity.setOrderId(checkOrderInfoEntity.getId());
 		processInfoEntity.setOrderStatusKey(checkOrderInfoEntity.getOrderStatusKey());
-		processInfoEntity.setProcessDesc(user.getRoleName() + " " + user.getUserName() + " 已经确认工单");
+		processInfoEntity.setProcessDesc("工单确认: "+userInfo.getRealName());
 		return R.status(processService.save(processInfoEntity));
 	}
 
 
+	/**
+	 * 工单统计
+	 * @return
+	 */
+	@GetMapping("/statistics")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "统计表格")
+	public R<List<CheckOrderCountVO>> orderStatistics() {
+		CheckOrderInfoDTO checkOrderInfoDTO = new CheckOrderInfoDTO();
+		BladeUser user = AuthUtil.getUser();
+		if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_ORG_SERVICE_PERSON.equals(user.getRoleName())) {
+			checkOrderInfoDTO.setOrgId(Func.toLong(user.getDeptId()));
+		} else {
+			checkOrderInfoDTO.setOrgId(null);
+		}
+		List<CheckOrderCountVO> pages = checkOrderService.orderReportCount(checkOrderInfoDTO);
+		return R.data(pages);
+	}
+
+	/**
+	 * 按机构统计工单
+	 * @return
+	 */
+	@GetMapping("/org/statistics")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "统计表格")
+	public R<List<OrgCheckOrderCountVO>> orgOrderStatistics() {
+		List<OrgCheckOrderCountVO> list = new LinkedList<>();
+		BladeUser user = AuthUtil.getUser();
+		List<Dept> root = this.deptService.getDeptChild(Func.toLong(user.getDeptId()));
+
+		for (Dept dept : root) {
+			OrgCheckOrderCountVO orgCheckOrderCountVO = new OrgCheckOrderCountVO();
+			orgCheckOrderCountVO.setId(dept.getId());
+			orgCheckOrderCountVO.setOrgName(dept.getDeptName());
+
+			CheckOrderInfoDTO checkOrderInfoDTO = new CheckOrderInfoDTO();
+
+			checkOrderInfoDTO.setOrgId(Func.toLong(dept.getId()));
+
+			Long orderCount = checkOrderService.orderCount(checkOrderInfoDTO);
+
+			checkOrderInfoDTO.setOrderClose(OrderCloseEnum.ACTIVE_OPEN.getCode());
+			Long unCloseOrderCount = checkOrderService.unCloseOrderCount(checkOrderInfoDTO);
+
+
+			orgCheckOrderCountVO.setOrderCount(orderCount);
+			orgCheckOrderCountVO.setProcessingOrderCount(unCloseOrderCount);
+
+
+			list.add(orgCheckOrderCountVO);
+		}
+
+
+		return R.data(list);
+	}
+
 }

+ 16 - 0
src/main/java/org/springblade/modules/business/check/order/entity/CheckOrderInfoEntity.java

@@ -7,10 +7,14 @@
 package org.springblade.modules.business.check.order.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.core.mp.base.BaseEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 /***
  * Date:2022/8/22
@@ -79,5 +83,17 @@ public class CheckOrderInfoEntity extends BaseEntity {
 	@ApiModelProperty(value = "工单确认")
 	private Integer orderConfirm;
 
+	/**
+	 * 工单确认时间
+	 */
+	@ApiModelProperty(value = "工单确认时间")
+	@DateTimeFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss"
+	)
+	@JsonFormat(
+		pattern = "yyyy-MM-dd HH:mm:ss",
+		timezone = "GMT+8"
+	)
+	private Date orderConfirmTime;
 
 }

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

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 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.CheckOrderInfoVO;
 
 
@@ -35,4 +36,15 @@ public interface RtuCheckOrderMapper extends BaseMapper<CheckOrderInfoEntity> {
 	List<CheckOrderInfoVO> selectPage(IPage page, @Param("checkOrderInfoDTO") CheckOrderInfoDTO checkOrderInfoDTO);
 
 	List<CheckOrderInfoVO> unconfirmOrderList(@Param("checkOrderInfoDTO") CheckOrderInfoDTO checkOrderInfoDTO);
+
+
+	Long unconfirmOrderCount(@Param("checkOrderInfoDTO") CheckOrderInfoDTO checkOrderInfoDTO);
+
+
+	List<CheckOrderCountVO> orderReportCount(@Param("checkOrderInfoDTO") CheckOrderInfoDTO checkOrderInfoDTO);
+
+	Long orderCount(@Param("checkOrderInfoDTO") CheckOrderInfoDTO checkOrderInfoDTO);
+
+	Long unCloseOrderCount(@Param("checkOrderInfoDTO") CheckOrderInfoDTO checkOrderInfoDTO);
+
 }

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

@@ -3,7 +3,8 @@
 <mapper namespace="org.springblade.modules.business.check.order.mapper.RtuCheckOrderMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="checkOrderInfoResultMap" type="org.springblade.modules.business.check.order.entity.CheckOrderInfoEntity">
+    <resultMap id="checkOrderInfoResultMap"
+               type="org.springblade.modules.business.check.order.entity.CheckOrderInfoEntity">
         <result column="id" property="id"/>
         <result column="create_user" property="createUser"/>
         <result column="create_time" property="createTime"/>
@@ -19,6 +20,7 @@
         <result column="warn_id" property="warnId"/>
         <result column="order_close" property="orderClose"/>
         <result column="order_confirm" property="orderConfirm"/>
+        <result column="order_confirm_time" property="orderConfirmTime"/>
 
     </resultMap>
 
@@ -36,22 +38,30 @@
         <result column="order_from_key" property="orderFromKey"/>
         <result column="order_status_key" property="orderStatusKey"/>
         <result column="order_confirm_user" property="orderConfirmUser"/>
-        <result column="rtu_name" property="rtuName"/>
-        <result column="real_name" property="processorName"/>
-        <result column="project_name" property="projectName"/>
-        <result column="org_name" property="orgName"/>
         <result column="warn_id" property="warnId"/>
         <result column="order_close" property="orderClose"/>
         <result column="order_confirm" property="orderConfirm"/>
+        <result column="order_confirm_time" property="orderConfirmTime"/>
         <result column="lng" property="lng"/>
         <result column="lat" property="lat"/>
         <result column="location_desc" property="locationDesc"/>
+        <result column="rtu_name" property="rtuName"/>
+        <result column="real_name" property="processorName"/>
+        <result column="project_name" property="projectName"/>
+        <result column="org_name" property="orgName"/>
     </resultMap>
 
+    <resultMap id="checkOrderCountVOResultMap" type="org.springblade.modules.business.check.order.vo.CheckOrderCountVO">
+        <result column="id" property="id"/>
+        <result column="real_name" property="servicePersonName"/>
+        <result column="order_count" property="orderCount"/>
+        <result column="processing_order_count" property="processingOrderCount"/>
+
+    </resultMap>
 
     <select id="selectPage" resultMap="checkOrderInfoVOResultMap">
         SELECT
-         o.*,u.real_name,i.rtu_name,p.project_name,d2.dept_name AS org_name,i.lng,i.lat,i.location_desc
+        o.*,u.real_name,i.rtu_name,p.project_name,d2.dept_name AS org_name,i.lng,i.lat,i.location_desc
         FROM
         rtu_failure_check_order o
         LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code
@@ -76,23 +86,44 @@
         <if test="checkOrderInfoDTO.orderConfirmUser!=null">
             and o.order_confirm_user = #{checkOrderInfoDTO.orderConfirmUser}
         </if>
-
-        <if test="checkOrderInfoDTO.createTime!=null">
-            and o.create_time >= #{checkOrderInfoDTO.createTime}
+        <if test="checkOrderInfoDTO.orderConfirm!=null">
+            and o.order_confirm = #{checkOrderInfoDTO.orderConfirm}
         </if>
-
-
         <if test="checkOrderInfoDTO.orderClose!=null">
-            and o.order_close >= #{checkOrderInfoDTO.orderClose}
+            and o.order_close = #{checkOrderInfoDTO.orderClose}
         </if>
+        order by o.order_confirm ASC ,o.order_close ASC,o.update_time desc
+    </select>
 
 
-        <if test="checkOrderInfoDTO.orderConfirm!=null">
-            and o.order_confirm >= #{checkOrderInfoDTO.orderConfirm}
+    <select id="orderCount" resultType="java.lang.Long">
+        SELECT
+        count(*)
+        FROM
+        rtu_failure_check_order o
+        LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code
+        WHERE
+        o.is_deleted = 0
+        <if test="checkOrderInfoDTO.orgId!=null">
+            and i.org_id = #{checkOrderInfoDTO.orgId}
         </if>
+    </select>
 
-         order by o.update_time desc
 
+    <select id="unCloseOrderCount" resultType="java.lang.Long">
+        SELECT
+        count(*)
+        FROM
+        rtu_failure_check_order o
+        LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code
+        WHERE
+        o.is_deleted = 0
+        <if test="checkOrderInfoDTO.orgId!=null">
+            and i.org_id = #{checkOrderInfoDTO.orgId}
+        </if>
+        <if test="checkOrderInfoDTO.orderClose!=null">
+            and o.order_close = #{checkOrderInfoDTO.orderClose}
+        </if>
     </select>
 
     <select id="unconfirmOrderList" resultMap="checkOrderInfoVOResultMap">
@@ -107,63 +138,47 @@
         LEFT JOIN blade_dept d2 ON ud.dept_id = d2.id
         WHERE
         o.is_deleted = 0
-
         <if test="checkOrderInfoDTO.orgId!=null">
             and i.org_id = #{checkOrderInfoDTO.orgId}
         </if>
-
-
         <if test="checkOrderInfoDTO.orderConfirm!=null">
             and o.order_confirm = #{checkOrderInfoDTO.orderConfirm}
         </if>
-
         order by o.create_time desc
-
     </select>
 
-    <select id="selectPage" resultMap="checkOrderInfoVOResultMap">
+
+    <select id="unconfirmOrderCount" resultType="java.lang.Long">
         SELECT
-        o.*,u.real_name,i.rtu_name,p.project_name,d2.dept_name AS org_name,i.lng,i.lat,i.location_desc
+        count(*)
         FROM
         rtu_failure_check_order o
         LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code
-        LEFT JOIN blade_user u ON u.id = o.update_user
-        LEFT JOIN project_info p ON i.project_id = p.id
-        LEFT JOIN blade_user_dept ud ON ud.user_id=u.id
-        LEFT JOIN blade_dept d2 ON ud.dept_id = d2.id
         WHERE
         o.is_deleted = 0
-        <if test="checkOrderInfoDTO.rtuCode!=null">
-            and o.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.orgId!=null">
             and i.org_id = #{checkOrderInfoDTO.orgId}
         </if>
-        <if test="checkOrderInfoDTO.projectId !=null">
-            and i.project_id = #{checkOrderInfoDTO.projectId}
-        </if>
-        <if test="checkOrderInfoDTO.orderConfirmUser!=null">
-            and o.order_confirm_user = #{checkOrderInfoDTO.orderConfirmUser}
-        </if>
-
-        <if test="checkOrderInfoDTO.createTime!=null">
-            and o.create_time >= #{checkOrderInfoDTO.createTime}
-        </if>
-
-
-        <if test="checkOrderInfoDTO.orderClose!=null">
-            and o.order_close >= #{checkOrderInfoDTO.orderClose}
+        <if test="checkOrderInfoDTO.orderConfirm!=null">
+            and o.order_confirm = #{checkOrderInfoDTO.orderConfirm}
         </if>
 
+    </select>
 
-        <if test="checkOrderInfoDTO.orderConfirm!=null">
-            and o.order_confirm >= #{checkOrderInfoDTO.orderConfirm}
+    <select id="orderReportCount" resultMap="checkOrderCountVOResultMap">
+        SELECT u.real_name,u.id,o.order_count,o2.processing_order_count FROM blade_user u LEFT JOIN
+        (SELECT order_confirm_user,count(id) as order_count FROM rtu_failure_check_order WHERE is_deleted=0 AND
+        order_confirm_user is not null  AND order_confirm =1 GROUP BY order_confirm_user) o
+        on u.id = o.order_confirm_user
+        LEFT JOIN
+        (SELECT order_confirm_user,count(id) as processing_order_count FROM rtu_failure_check_order WHERE is_deleted=0 AND
+        order_confirm_user is not null AND order_confirm =1 AND order_close=0 GROUP BY order_confirm_user) o2
+        on u.id = o2.order_confirm_user
+         WHERE u.is_deleted =0
+        <if test="checkOrderInfoDTO.orgId!=null">
+            AND u.dept_id = #{checkOrderInfoDTO.orgId}
         </if>
+    </select>
 
-        order by o.update_time desc
 
-    </select>
 </mapper>

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

@@ -7,9 +7,11 @@
 package org.springblade.modules.business.check.order.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
 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.CheckOrderInfoVO;
 import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
 import org.springblade.modules.business.project.base.entity.ProjectInfoEntity;
@@ -35,6 +37,8 @@ public interface IRtuCheckOrderService extends BaseService<CheckOrderInfoEntity>
 	 */
 	IPage<CheckOrderInfoVO> selectPage(IPage<CheckOrderInfoVO> page, CheckOrderInfoDTO checkOrderInfoDTO);
 
+	Long unconfirmOrderCount(CheckOrderInfoDTO checkOrderInfoDTO);
+
 	List<CheckOrderInfoVO> unconfirmOrderList(CheckOrderInfoDTO checkOrderInfoDTO);
 
 
@@ -45,5 +49,10 @@ public interface IRtuCheckOrderService extends BaseService<CheckOrderInfoEntity>
 	 */
 	boolean updateOrderStatus(CheckOrderInfoEntity orderInfoEntity);
 
+	List<CheckOrderCountVO> orderReportCount( CheckOrderInfoDTO checkOrderInfoDTO);
+
+	Long orderCount(CheckOrderInfoDTO checkOrderInfoDTO);
+
+	Long unCloseOrderCount(CheckOrderInfoDTO checkOrderInfoDTO);
 
 }

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

@@ -15,6 +15,7 @@ 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.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.CheckOrderInfoVO;
 import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
 import org.springframework.stereotype.Service;
@@ -37,6 +38,11 @@ public class RtuCheckOrderServiceImpl extends BaseServiceImpl<RtuCheckOrderMappe
 		return page.setRecords(baseMapper.selectPage(page, checkOrderInfoDTO));
 	}
 
+	@Override
+	public Long unconfirmOrderCount(CheckOrderInfoDTO checkOrderInfoDTO) {
+		return baseMapper.unconfirmOrderCount(checkOrderInfoDTO);
+	}
+
 	@Override
 	public List<CheckOrderInfoVO> unconfirmOrderList(CheckOrderInfoDTO checkOrderInfoDTO) {
 
@@ -55,4 +61,19 @@ public class RtuCheckOrderServiceImpl extends BaseServiceImpl<RtuCheckOrderMappe
 
 		return false;
 	}
+
+	@Override
+	public List<CheckOrderCountVO> orderReportCount(CheckOrderInfoDTO checkOrderInfoDTO) {
+		return baseMapper.orderReportCount(checkOrderInfoDTO);
+	}
+
+	@Override
+	public Long orderCount(CheckOrderInfoDTO checkOrderInfoDTO) {
+		return baseMapper.orderCount(checkOrderInfoDTO);
+	}
+
+	@Override
+	public Long unCloseOrderCount(CheckOrderInfoDTO checkOrderInfoDTO) {
+		return baseMapper.unCloseOrderCount(checkOrderInfoDTO);
+	}
 }

+ 48 - 0
src/main/java/org/springblade/modules/business/check/order/vo/CheckOrderCountVO.java

@@ -0,0 +1,48 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/22
+ */
+package org.springblade.modules.business.check.order.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/***
+ * Date:2022/9/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CheckOrderCountVO extends BaseEntity {
+	/**
+	 * 运维人员ID
+	 */
+	@ApiModelProperty(value = "运维人员ID")
+	private Long id;
+
+	/**
+	 * 运维人员名称
+	 */
+	@ApiModelProperty(value = "运维人员名称")
+	private String servicePersonName;
+
+	/**
+	 * 接单数量
+	 */
+	@ApiModelProperty(value = "接单数量")
+	private Long orderCount;
+
+	/**
+	 * 处理中工单数量
+	 */
+	@ApiModelProperty(value = "处理中工单数量")
+	private Long processingOrderCount;
+}

+ 48 - 0
src/main/java/org/springblade/modules/business/check/order/vo/OrgCheckOrderCountVO.java

@@ -0,0 +1,48 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/22
+ */
+package org.springblade.modules.business.check.order.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/***
+ * Date:2022/9/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OrgCheckOrderCountVO extends BaseEntity {
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty(value = "机构ID")
+	private Long id;
+
+	/**
+	 * 机构名称
+	 */
+	@ApiModelProperty(value = "机构名称")
+	private String orgName;
+
+	/**
+	 * 接单数量
+	 */
+	@ApiModelProperty(value = "接单数量")
+	private Long orderCount;
+
+	/**
+	 * 处理中工单数量
+	 */
+	@ApiModelProperty(value = "处理中工单数量")
+	private Long processingOrderCount;
+}

+ 41 - 8
src/main/java/org/springblade/modules/business/check/process/controller/RtuOrderProcessController.java

@@ -10,12 +10,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
+import org.apache.poi.ss.usermodel.DataFormatter;
 import org.springblade.common.cache.DictBizCache;
+import org.springblade.constant.BusinessConstant;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.launch.constant.AppConstant;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.ConcurrentDateFormat;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.enums.OrderStatusEnum;
 import org.springblade.modules.business.check.order.dto.CheckOrderInfoDTO;
@@ -23,6 +28,7 @@ import org.springblade.modules.business.check.order.entity.CheckOrderInfoEntity;
 import org.springblade.modules.business.check.order.service.IRtuCheckOrderService;
 import org.springblade.modules.business.check.order.vo.CheckOrderInfoVO;
 import org.springblade.modules.business.check.order.wrapper.RtuCheckOrderWrapper;
+import org.springblade.modules.business.check.process.dto.OrderProcessInfoDTO;
 import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
 import org.springblade.modules.business.check.process.service.IRtuOrderProcessService;
 import org.springblade.modules.business.check.process.vo.OrderProcessInfoVO;
@@ -33,6 +39,8 @@ import org.springblade.modules.system.service.IUserService;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
+import java.text.DateFormat;
+import java.util.Date;
 import java.util.List;
 
 /***
@@ -50,7 +58,7 @@ import java.util.List;
 public class RtuOrderProcessController extends BladeController {
 	private final IRtuOrderProcessService rtuOrderProcessService;
 	private final IRtuCheckOrderService checkOrderService;
-    private final IUserService userService;
+	private final IUserService userService;
 
 	/**
 	 * 分页
@@ -63,6 +71,29 @@ public class RtuOrderProcessController extends BladeController {
 		return R.data(RtuOrderProcessWrapper.build().pageVO(pages));
 	}
 
+	/**
+	 * 查询当天填报的工单信息
+	 *
+	 * @return
+	 */
+	@GetMapping("/today/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<List<OrderProcessInfoVO>> todayList() {
+		BladeUser user = AuthUtil.getUser();
+		OrderProcessInfoDTO processInfoDTO = new OrderProcessInfoDTO();
+		if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_ORG_SERVICE_PERSON.equals(user.getRoleName())) {
+			processInfoDTO.setOrgId(Func.toLong(user.getDeptId()));
+		} else {
+			processInfoDTO.setOrgId(null);
+		}
+		Date date = new Date();
+		String dt = Func.formatDateTime(date);
+		processInfoDTO.setCreateTime(Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd")));
+		List<OrderProcessInfoVO> list = rtuOrderProcessService.selectTodayProcessList(processInfoDTO);
+		return R.data(list);
+	}
+
 
 	/**
 	 * 多表联合查询自定义分页
@@ -90,11 +121,13 @@ public class RtuOrderProcessController extends BladeController {
 	@ApiOperation(value = "详情", notes = "传入orderProcessInfoEntity")
 	public R<OrderProcessInfoVO> detail(OrderProcessInfoEntity orderProcessInfoEntity) {
 		OrderProcessInfoEntity detail = rtuOrderProcessService.getOne(Condition.getQueryWrapper(orderProcessInfoEntity));
-		OrderProcessInfoVO vo =RtuOrderProcessWrapper.build().entityVO(detail);
+		OrderProcessInfoVO vo = RtuOrderProcessWrapper.build().entityVO(detail);
 		CheckOrderInfoEntity checkOrderInfoEntity = checkOrderService.getById(vo.getOrderId());
-		User user= userService.getById(checkOrderInfoEntity.getOrderConfirmUser());
-		vo.setOrderConfirmUserName(user.getRealName());
-		DictBiz biz= DictBizCache.getById(checkOrderInfoEntity.getOrderFromKey());
+		if (checkOrderInfoEntity.getOrderConfirmUser() != null){
+			User user = userService.getById(checkOrderInfoEntity.getOrderConfirmUser());
+			vo.setOrderConfirmUserName(user.getRealName());
+		}
+		DictBiz biz = DictBizCache.getById(checkOrderInfoEntity.getOrderFromKey());
 		vo.setOrderFromText(biz.getDictValue());
 		return R.data(vo);
 	}
@@ -109,9 +142,9 @@ public class RtuOrderProcessController extends BladeController {
 	public R save(@RequestBody OrderProcessInfoEntity orderProcessInfoEntity) {
 		CheckOrderInfoEntity checkOrderInfoEntity = new CheckOrderInfoEntity();
 		checkOrderInfoEntity.setId(orderProcessInfoEntity.getOrderId());
-		List<DictBiz> statusdicts= DictBizCache.getList("rtu_check_order_status");
-		for (DictBiz biz:statusdicts){
-			if (biz.getDictKey().equals(""+OrderStatusEnum.STATUS_PROCESS.getCode())){
+		List<DictBiz> statusdicts = DictBizCache.getList("rtu_check_order_status");
+		for (DictBiz biz : statusdicts) {
+			if (biz.getDictKey().equals("" + OrderStatusEnum.STATUS_PROCESS.getCode())) {
 				checkOrderInfoEntity.setOrderStatusKey(biz.getId());
 				break;
 			}

+ 31 - 0
src/main/java/org/springblade/modules/business/check/process/dto/OrderProcessInfoDTO.java

@@ -0,0 +1,31 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.business.check.process.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OrderProcessInfoDTO extends OrderProcessInfoEntity {
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty("机构ID")
+	private Long orgId;
+
+}

+ 8 - 0
src/main/java/org/springblade/modules/business/check/process/mapper/RtuOrderProcessMapper.java

@@ -10,7 +10,9 @@ 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.check.order.dto.CheckOrderInfoDTO;
+import org.springblade.modules.business.check.process.dto.OrderProcessInfoDTO;
 import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
+import org.springblade.modules.business.check.process.vo.OrderProcessInfoVO;
 
 import java.util.List;
 
@@ -24,4 +26,10 @@ import java.util.List;
  */
 public interface RtuOrderProcessMapper  extends BaseMapper<OrderProcessInfoEntity> {
 	List<OrderProcessInfoEntity> selectPage(IPage page, @Param("checkOrderInfoDTO") CheckOrderInfoDTO checkOrderInfoDTO);
+	/**
+	 * 查询当天提交的工单填报信息
+	 * @param processInfoDTO
+	 * @return
+	 */
+	List<OrderProcessInfoVO> selectTodayProcessList(@Param("processInfoDTO") OrderProcessInfoDTO processInfoDTO);
 }

+ 84 - 0
src/main/java/org/springblade/modules/business/check/process/mapper/RtuOrderProcessMapper.xml

@@ -70,6 +70,67 @@
 
     </resultMap>
 
+    <resultMap id="orderProcessInfoVOResultMap"
+               type="org.springblade.modules.business.check.process.vo.OrderProcessInfoVO">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="order_id" property="orderId"/>
+        <result column="process_desc" property="processDesc"/>
+        <result column="order_status_key" property="orderStatusKey"/>
+        <result column="rtu_replace" property="rtuReplace"/>
+        <result column="rtu_desc" property="rtuDesc"/>
+        <result column="rtu_status" property="rtuStatus"/>
+        <result column="rain_sensor_replace" property="rainSensorReplace"/>
+        <result column="rain_sensor_desc" property="rainSensorDesc"/>
+        <result column="rain_sensor_status" property="rainSensorStatus"/>
+        <result column="rain_sensor_active" property="rainSensorActive"/>
+        <result column="water_sensor_replace" property="waterSensorReplace"/>
+        <result column="water_sensor_desc" property="waterSensorDesc"/>
+        <result column="water_level_sensor_status" property="waterLevelSensorStatus"/>
+        <result column="water_level_sensor_active" property="waterLevelSensorActive"/>
+        <result column="ground_sensor_replace_date" property="groundSensorReplace"/>
+        <result column="ground_sensor_desc" property="groundSensorDesc"/>
+        <result column="ground_water_sensor_status" property="groundWaterSensorStatus"/>
+        <result column="ground_water_sensor_active" property="groundWaterSensorActive"/>
+        <result column="battery_replace" property="batteryReplace"/>
+        <result column="sun_power_replace" property="sunPowerReplace"/>
+        <result column="power_desc" property="powerDesc"/>
+        <result column="power_status" property="powerStatus"/>
+        <result column="network_overdue" property="networkOverdue"/>
+        <result column="network_desc" property="networkDesc"/>
+        <result column="network_status" property="networkStatus"/>
+        <result column="network_active" property="networkActive"/>
+        <result column="satellite_desc" property="satelliteDesc"/>
+        <result column="satellite_status" property="satelliteStatus"/>
+        <result column="satellite_active" property="satelliteActive"/>
+        <result column="base_photo1_take" property="basePhoto1Take"/>
+        <result column="base_photo1_url" property="basePhoto1Url"/>
+        <result column="base_photo2_take" property="basePhoto2Take"/>
+        <result column="base_photo2_url" property="basePhoto2Url"/>
+        <result column="rtu_photo_take" property="rtuPhotoTake"/>
+        <result column="rtu_photo_url" property="rtuPhotoUrl"/>
+        <result column="rain_sensor_photo_take" property="rainSensorPhotoTake"/>
+        <result column="rain_sensor_photo_url" property="rainSensorPhotoUrl"/>
+        <result column="water_sensor_photo_take" property="waterSensorPhotoTake"/>
+        <result column="water_sensor_photo_url" property="waterSensorPhotoUrl"/>
+        <result column="ground_sensor_photo_take" property="groundSensorPhotoTake"/>
+        <result column="ground_sensor_photo_url" property="groundSensorPhotoUrl"/>
+        <result column="battery_photo_take" property="batteryPhotoTake"/>
+        <result column="battery_photo_url" property="batteryPhotoUrl"/>
+        <result column="sun_photo_take" property="sunPhotoTake"/>
+        <result column="sun_photo_url" property="sunPhotoUrl"/>
+        <result column="rtu_name" property="rtuName"/>
+        <result column="rtu_code" property="rtuCode"/>
+        <result column="real_name" property="orderProcessUserName"/>
+        <result column="dict_value" property="orderStatusName"/>
+
+
+    </resultMap>
 
     <select id="selectPage" resultMap="orderProcessInfoResultMap">
         SELECT
@@ -86,4 +147,27 @@
 
     </select>
 
+    <select id="selectTodayProcessList" resultMap="orderProcessInfoVOResultMap">
+        SELECT
+        p.*,r.rtu_code,r.rtu_name,u.real_name,d.dict_value
+        FROM
+        rtu_failure_check_order_process p
+        LEFT JOIN rtu_failure_check_order o ON o.id=p.order_id
+        LEFT JOIN rtu_info r ON r.rtu_code = o.rtu_code
+        LEFT JOIN blade_user u ON u.id=p.create_user
+        LEFT JOIN  blade_dict_biz d ON p.order_status_key=d.id
+        WHERE
+        p.is_deleted = 0
+        <if test="processInfoDTO.orgId!=null">
+            and r.org_id =#{processInfoDTO.orgId}
+        </if>
+
+        <if test="processInfoDTO.createTime!=null">
+            and p.create_time >= #{processInfoDTO.createTime}
+        </if>
+
+        order by p.create_time desc
+
+    </select>
+
 </mapper>

+ 11 - 0
src/main/java/org/springblade/modules/business/check/process/service/IRtuOrderProcessService.java

@@ -9,7 +9,11 @@ package org.springblade.modules.business.check.process.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.modules.business.check.order.dto.CheckOrderInfoDTO;
+import org.springblade.modules.business.check.process.dto.OrderProcessInfoDTO;
 import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
+import org.springblade.modules.business.check.process.vo.OrderProcessInfoVO;
+
+import java.util.List;
 
 /***
  * Date:2022/8/22
@@ -27,4 +31,11 @@ public interface IRtuOrderProcessService extends BaseService<OrderProcessInfoEnt
 	 * @return
 	 */
 	IPage<OrderProcessInfoEntity> selectPage(IPage<OrderProcessInfoEntity> page, CheckOrderInfoDTO checkOrderInfoDTO);
+
+	/**
+	 * 查询当天提交的工单填报信息
+	 * @param processInfoDTO
+	 * @return
+	 */
+	List<OrderProcessInfoVO> selectTodayProcessList(OrderProcessInfoDTO processInfoDTO);
 }

+ 9 - 0
src/main/java/org/springblade/modules/business/check/process/service/impl/RtuOrderProcessServiceImpl.java

@@ -9,11 +9,15 @@ package org.springblade.modules.business.check.process.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.modules.business.check.order.dto.CheckOrderInfoDTO;
+import org.springblade.modules.business.check.process.dto.OrderProcessInfoDTO;
 import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
 import org.springblade.modules.business.check.process.mapper.RtuOrderProcessMapper;
 import org.springblade.modules.business.check.process.service.IRtuOrderProcessService;
+import org.springblade.modules.business.check.process.vo.OrderProcessInfoVO;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 
 /***
  * Date:2022/8/22
@@ -29,4 +33,9 @@ public class RtuOrderProcessServiceImpl  extends BaseServiceImpl<RtuOrderProcess
 	public IPage<OrderProcessInfoEntity> selectPage(IPage<OrderProcessInfoEntity> page, CheckOrderInfoDTO checkOrderInfoDTO) {
 		return page.setRecords(baseMapper.selectPage(page, checkOrderInfoDTO));
 	}
+
+	@Override
+	public List<OrderProcessInfoVO> selectTodayProcessList(OrderProcessInfoDTO processInfoDTO) {
+		return baseMapper.selectTodayProcessList(processInfoDTO);
+	}
 }

+ 16 - 0
src/main/java/org/springblade/modules/business/check/process/vo/OrderProcessInfoVO.java

@@ -40,6 +40,22 @@ public class OrderProcessInfoVO extends OrderProcessInfoEntity {
 	@ApiModelProperty("工单来源")
 	private String orderFromText;
 
+	/**
+	 * 工单填报人名称
+	 */
+	@ApiModelProperty("工单填报人名称")
+	private String orderProcessUserName;
 
 
+	/**
+	 * 测站编码
+	 */
+	@ApiModelProperty("测站编码")
+	private String rtuCode;
+
+	/**
+	 * 测站名称
+	 */
+	@ApiModelProperty("测站名称")
+	private String rtuName;
 }

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

@@ -7,22 +7,42 @@
 package org.springblade.modules.business.equipment.inspection.base.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.constant.BusinessConstant;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.launch.constant.AppConstant;
 import org.springblade.core.mp.support.Condition;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.enums.OrderCloseEnum;
+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.OrgCheckOrderCountVO;
+import org.springblade.modules.business.equipment.inspection.base.dto.EquipmentInspectionInfoDTO;
 import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
 import org.springblade.modules.business.equipment.inspection.base.service.IEquipmentInspectionService;
 import org.springblade.modules.business.equipment.inspection.base.vo.EquipmentInspectionInfoVO;
+import org.springblade.modules.business.equipment.inspection.base.vo.EquipmentInspectionStatisticsVO;
+import org.springblade.modules.business.equipment.inspection.base.vo.OrgEquipmentInspectionStatisticsVO;
 import org.springblade.modules.business.equipment.inspection.base.wrapper.EquipmentInspectionWrapper;
+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.rtu.base.entity.RtuInfoEntity;
+import org.springblade.modules.business.rtu.base.service.IRtuBaseInfoService;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.service.IDeptService;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.LinkedList;
 import java.util.List;
 
 /***
@@ -39,8 +59,9 @@ import java.util.List;
 @Api(value = "设备巡检管理模块", tags = "设备巡检管理模块")
 public class EquipmentInspectionController extends BladeController {
 	private final IEquipmentInspectionService equipmentInspectionService;
-
-
+	private final IEquipmentInspectionPlanService planService;
+	private final IDeptService deptService;
+	private final IRtuBaseInfoService rtuBaseInfoService;
 	/**
 	 * 全部列表
 	 */
@@ -106,4 +127,70 @@ public class EquipmentInspectionController extends BladeController {
 		return R.status(temp);
 	}
 
+	/**
+	 * 巡检统计
+	 *
+	 * @return
+	 */
+	@GetMapping("/statistics")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "统计表格")
+	public R<List<EquipmentInspectionStatisticsVO>> inspectionStatistics() {
+		EquipmentInspectionInfoDTO inspectionInfoDTO = new EquipmentInspectionInfoDTO();
+		BladeUser user = AuthUtil.getUser();
+		if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_ORG_SERVICE_PERSON.equals(user.getRoleName())) {
+			inspectionInfoDTO.setOrgId(Func.toLong(user.getDeptId()));
+		} else {
+			inspectionInfoDTO.setOrgId(null);
+		}
+		EquipmentInspectionPlanEntity planEntity = planService.yearPlan();
+		inspectionInfoDTO.setPlanId(planEntity.getId());
+		List<EquipmentInspectionStatisticsVO> pages = equipmentInspectionService.inspectionReportCount(inspectionInfoDTO);
+		return R.data(pages);
+	}
+
+
+	/**
+	 * 巡检统计
+	 *
+	 * @return
+	 */
+	@GetMapping("/org/statistics")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "统计表格")
+	public R<List<OrgEquipmentInspectionStatisticsVO>> orgInspectionStatistics() {
+		List<OrgEquipmentInspectionStatisticsVO> list = new LinkedList<>();
+		BladeUser user = AuthUtil.getUser();
+		List<Dept> root = this.deptService.getDeptChild(Func.toLong(user.getDeptId()));
+
+		for (Dept dept : root) {
+			OrgEquipmentInspectionStatisticsVO orgEquipmentInspectionStatisticsVO = new OrgEquipmentInspectionStatisticsVO();
+			orgEquipmentInspectionStatisticsVO.setId(dept.getId());
+			orgEquipmentInspectionStatisticsVO.setOrgName(dept.getDeptName());
+
+			LambdaQueryWrapper<RtuInfoEntity> wrapper = Wrappers.<RtuInfoEntity>query().lambda();
+			wrapper.eq(RtuInfoEntity::getIsDeleted,0);
+			wrapper.eq(RtuInfoEntity::getOrgId,dept.getId());
+			Long rtuCount =rtuBaseInfoService.count(wrapper);
+			orgEquipmentInspectionStatisticsVO.setRtuCount(rtuCount);
+
+			EquipmentInspectionPlanEntity planEntity = planService.yearPlan();
+			EquipmentInspectionInfoDTO inspectionInfoDTO = new EquipmentInspectionInfoDTO();
+			inspectionInfoDTO.setPlanId(planEntity.getId());
+			inspectionInfoDTO.setOrgId(dept.getId());
+
+			Long inspectionCount = equipmentInspectionService.inspectionCount(inspectionInfoDTO);
+
+			orgEquipmentInspectionStatisticsVO.setCompleteCount(inspectionCount);
+
+
+
+
+			list.add(orgEquipmentInspectionStatisticsVO);
+		}
+
+
+		return R.data(list);
+	}
+
 }

+ 36 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/base/dto/EquipmentInspectionInfoDTO.java

@@ -0,0 +1,36 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/23
+ */
+package org.springblade.modules.business.equipment.inspection.base.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
+
+/***
+ * Date:2022/8/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class EquipmentInspectionInfoDTO extends EquipmentInspectionInfoEntity {
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty("机构ID")
+	private Long orgId;
+
+	/**
+	 * 计划ID
+	 */
+	@ApiModelProperty("计划ID")
+	private Long planId;
+}

+ 6 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/base/mapper/EquipmentInspectionMapper.java

@@ -9,7 +9,11 @@ package org.springblade.modules.business.equipment.inspection.base.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.business.equipment.inspection.base.dto.EquipmentInspectionInfoDTO;
 import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
+import org.springblade.modules.business.equipment.inspection.base.vo.EquipmentInspectionStatisticsVO;
+
+import java.util.List;
 
 /***
  * Date:2022/8/23
@@ -20,5 +24,7 @@ import org.springblade.modules.business.equipment.inspection.base.entity.Equipme
  * Remark:认为有必要的其他信息
  */
 public interface EquipmentInspectionMapper  extends BaseMapper<EquipmentInspectionInfoEntity> {
+	List<EquipmentInspectionStatisticsVO> inspectionReportCount(@Param("inspectionInfoDTO") EquipmentInspectionInfoDTO inspectionInfoDTO);
 
+	Long inspectionCount(@Param("inspectionInfoDTO") EquipmentInspectionInfoDTO inspectionInfoDTO);
 }

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

@@ -3,7 +3,8 @@
 <mapper namespace="org.springblade.modules.business.equipment.inspection.base.mapper.EquipmentInspectionMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="EquipmentInspectionInfoResultMap" type="org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity">
+    <resultMap id="EquipmentInspectionInfoResultMap"
+               type="org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity">
         <result column="id" property="id"/>
         <result column="create_user" property="createUser"/>
         <result column="create_time" property="createTime"/>
@@ -16,5 +17,41 @@
     </resultMap>
 
 
+    <resultMap id="equipmentInspectionStatisticsVOResultMap"
+               type="org.springblade.modules.business.equipment.inspection.base.vo.EquipmentInspectionStatisticsVO">
+        <result column="id" property="id"/>
+        <result column="real_name" property="servicePersonName"/>
+        <result column="complete_count" property="completeCount"/>
+    </resultMap>
+
+    <select id="inspectionReportCount" resultMap="equipmentInspectionStatisticsVOResultMap">
+        SELECT u.real_name,u.id,s.complete_count FROM blade_user u LEFT JOIN
+        (SELECT create_user,count(create_user) AS complete_count FROM equipment_inspection_report_info WHERE is_deleted
+        =0
+        <if test="inspectionInfoDTO.planId!=null">
+            AND plan_id= #{inspectionInfoDTO.planId}
+        </if>
+        GROUP BY create_user) s
+        on s.create_user = u.id
+        WHERE u.is_deleted=0
+        <if test="inspectionInfoDTO.orgId!=null">
+            AND u.dept_id = #{inspectionInfoDTO.orgId}
+        </if>
+    </select>
 
+    <select id="inspectionCount" resultType="java.lang.Long">
+        SELECT
+        count(*)
+        FROM
+        equipment_inspection_report_info o
+        LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code
+        WHERE
+        o.is_deleted = 0
+        <if test="inspectionInfoDTO.orgId!=null">
+            and i.org_id = #{inspectionInfoDTO.orgId}
+        </if>
+        <if test="inspectionInfoDTO.planId!=null">
+            AND o.plan_id= #{inspectionInfoDTO.planId}
+        </if>
+    </select>
 </mapper>

+ 10 - 1
src/main/java/org/springblade/modules/business/equipment/inspection/base/service/IEquipmentInspectionService.java

@@ -7,8 +7,16 @@
 package org.springblade.modules.business.equipment.inspection.base.service;
 
 
+import org.apache.ibatis.annotations.Param;
 import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.business.check.order.dto.CheckOrderInfoDTO;
+import org.springblade.modules.business.check.order.vo.CheckOrderCountVO;
+import org.springblade.modules.business.equipment.inspection.base.dto.EquipmentInspectionInfoDTO;
 import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
+import org.springblade.modules.business.equipment.inspection.base.vo.EquipmentInspectionStatisticsVO;
+import org.springblade.modules.business.equipment.inspection.report.dto.EquipmentInspectionReportDTO;
+
+import java.util.List;
 
 /***
  * Date:2022/8/23
@@ -19,5 +27,6 @@ import org.springblade.modules.business.equipment.inspection.base.entity.Equipme
  * Remark:认为有必要的其他信息
  */
 public interface IEquipmentInspectionService extends BaseService<EquipmentInspectionInfoEntity> {
-
+	List<EquipmentInspectionStatisticsVO> inspectionReportCount(EquipmentInspectionInfoDTO inspectionInfoDTO);
+	Long inspectionCount( EquipmentInspectionInfoDTO inspectionInfoDTO);
 }

+ 11 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/base/service/impl/EquipmentInspectionServiceImpl.java

@@ -13,9 +13,11 @@ import org.springblade.core.mp.support.Condition;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.enums.RtuReportStatusEnum;
+import org.springblade.modules.business.equipment.inspection.base.dto.EquipmentInspectionInfoDTO;
 import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
 import org.springblade.modules.business.equipment.inspection.base.mapper.EquipmentInspectionMapper;
 import org.springblade.modules.business.equipment.inspection.base.service.IEquipmentInspectionService;
+import org.springblade.modules.business.equipment.inspection.base.vo.EquipmentInspectionStatisticsVO;
 import org.springblade.modules.business.equipment.inspection.plan.vo.EquipmentInspectionRtuVO;
 import org.springframework.stereotype.Service;
 
@@ -33,4 +35,13 @@ import java.util.List;
 public class EquipmentInspectionServiceImpl  extends BaseServiceImpl<EquipmentInspectionMapper, EquipmentInspectionInfoEntity> implements IEquipmentInspectionService {
 
 
+	@Override
+	public List<EquipmentInspectionStatisticsVO> inspectionReportCount(EquipmentInspectionInfoDTO inspectionInfoDTO) {
+		return baseMapper.inspectionReportCount(inspectionInfoDTO);
+	}
+
+	@Override
+	public Long inspectionCount(EquipmentInspectionInfoDTO inspectionInfoDTO) {
+		return baseMapper.inspectionCount(inspectionInfoDTO);
+	}
 }

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

@@ -0,0 +1,44 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/23
+ */
+package org.springblade.modules.business.equipment.inspection.base.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
+
+/***
+ * Date:2022/8/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class EquipmentInspectionStatisticsVO extends EquipmentInspectionInfoEntity {
+	/**
+	 * 运维人员ID
+	 */
+	@ApiModelProperty(value = "运维人员ID")
+	private Long id;
+
+	/**
+	 * 运维人员名称
+	 */
+	@ApiModelProperty(value = "运维人员名称")
+	private String servicePersonName;
+
+	/**
+	 * 已巡检任务
+	 */
+	@ApiModelProperty(value = "已巡检任务")
+	private Long completeCount;
+
+
+}

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

@@ -0,0 +1,50 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/23
+ */
+package org.springblade.modules.business.equipment.inspection.base.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.business.equipment.inspection.base.entity.EquipmentInspectionInfoEntity;
+
+/***
+ * Date:2022/8/23
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OrgEquipmentInspectionStatisticsVO extends EquipmentInspectionInfoEntity {
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty(value = "机构ID")
+	private Long id;
+
+	/**
+	 * 机构名称
+	 */
+	@ApiModelProperty(value = "机构名称")
+	private String orgName;
+
+	/**
+	 * 巡检任务
+	 */
+	@ApiModelProperty(value = "巡检任务")
+	private Long rtuCount;
+
+	/**
+	 * 已巡检任务
+	 */
+	@ApiModelProperty(value = "已巡检任务")
+	private Long completeCount;
+
+
+}

+ 6 - 2
src/main/java/org/springblade/modules/business/equipment/inspection/plan/mapper/EquipmentInspectionPlanRtuMapper.xml

@@ -149,6 +149,12 @@
         LEFT JOIN rtu_status s ON s.rtu_code = n.rtu_code
         WHERE
         n.is_deleted = 0
+        <if test="rtuDTO.rtu_code!=null">
+            and n.rtu_code = #{rtuDTO.rtu_code}
+        </if>
+        <if test="rtuDTO.planId!=null">
+            and r.plan_id = #{rtuDTO.planId}
+        </if>
         <if test="rtuDTO.orgId!=null">
             and n.org_id = #{rtuDTO.orgId}
         </if>
@@ -158,9 +164,7 @@
         <if test="rtuDTO.planId!=null">
             and r.plan_id = #{rtuDTO.planId}
         </if>
-
         order  by n.org_id,n.project_id,n.rtu_code,r.create_time
-
     </select>
 
     <select id="myPage" resultMap="equipmentInspectionVOResultMap">

+ 4 - 3
src/main/java/org/springblade/modules/business/equipment/inspection/plan/service/impl/EquipmentInspectionPlanRtuServiceImpl.java

@@ -33,7 +33,6 @@ import org.springframework.stereotype.Service;
 public class EquipmentInspectionPlanRtuServiceImpl extends BaseServiceImpl<EquipmentInspectionPlanRtuMapper, EquipmentInspectionRtuEntity> implements IEquipmentInspectionPlanRtuService {
 
 
-
 	@Override
 	public IPage<EquipmentInspectionRtuVO> selectPage(IPage<EquipmentInspectionRtuVO> page, EquipmentInspectionRtuDTO rtuDTO) {
 		return page.setRecords(baseMapper.selectPage(page, rtuDTO));
@@ -42,8 +41,10 @@ public class EquipmentInspectionPlanRtuServiceImpl extends BaseServiceImpl<Equip
 	@Override
 	public Long yearPlanEquipmentInspectionCount(Long orgId) {
 		LambdaQueryWrapper<EquipmentInspectionRtuEntity> wrapper = Wrappers.<EquipmentInspectionRtuEntity>query().lambda();
-		wrapper.eq(EquipmentInspectionRtuEntity::getOrgId, orgId);
-		wrapper.eq(EquipmentInspectionRtuEntity::getIsDeleted,0);
+		if (null != orgId) {
+			wrapper.eq(EquipmentInspectionRtuEntity::getOrgId, orgId);
+		}
+		wrapper.eq(EquipmentInspectionRtuEntity::getIsDeleted, 0);
 		return baseMapper.selectCount(wrapper);
 	}
 

+ 6 - 6
src/main/java/org/springblade/modules/business/equipment/inspection/plan/wrapper/EquipmentInspectionPlanWrapper.java

@@ -36,12 +36,12 @@ public class EquipmentInspectionPlanWrapper extends BaseEntityWrapper<EquipmentI
 	public EquipmentInspectionPlanVO entityVO(EquipmentInspectionPlanEntity entity) {
 		EquipmentInspectionPlanVO equipmentInspectionPlanVO = Objects.requireNonNull(BeanUtil.copy(entity, EquipmentInspectionPlanVO.class));
 
-		Date dt = new Date();
-		if (dt.after(entity.getInspectionEndTime())){
-			equipmentInspectionPlanVO.setPlanClose(IsValidEnum.VALID_1.getCode());
-		}else{
-			equipmentInspectionPlanVO.setPlanClose(IsValidEnum.VALID_2.getCode());
-		}
+//		Date dt = new Date();
+//		if (dt.after(entity.getInspectionEndTime())){
+//			equipmentInspectionPlanVO.setPlanClose(IsValidEnum.VALID_1.getCode());
+//		}else{
+//			equipmentInspectionPlanVO.setPlanClose(IsValidEnum.VALID_2.getCode());
+//		}
 
 		return equipmentInspectionPlanVO;
 	}

+ 59 - 17
src/main/java/org/springblade/modules/business/equipment/inspection/report/controller/EquipmentInspectionReportController.java

@@ -12,15 +12,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
+import org.springblade.constant.BusinessConstant;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.launch.constant.AppConstant;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.ConcurrentDateFormat;
 import org.springblade.core.tool.utils.Func;
 
 
+import org.springblade.modules.business.check.process.dto.OrderProcessInfoDTO;
+import org.springblade.modules.business.check.process.vo.OrderProcessInfoVO;
 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.entity.EquipmentInspectionReportEntity;
 import org.springblade.modules.business.equipment.inspection.report.service.IEquipmentInspectionReportService;
@@ -30,6 +37,7 @@ import org.springblade.modules.business.rtu.base.entity.RtuInfoEntity;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -47,7 +55,7 @@ import java.util.Map;
 @Api(value = "设备巡检填报管理模块", tags = "设备巡检填报管理模块")
 public class EquipmentInspectionReportController extends BladeController {
 	private final IEquipmentInspectionReportService reportService;
-
+	private final IEquipmentInspectionPlanService planService;
 
 	/**
 	 * 分页
@@ -60,7 +68,7 @@ public class EquipmentInspectionReportController extends BladeController {
 	@ApiOperation(value = "分页")
 	public R<IPage<EquipmentInspectionReportVO>> list(@ApiIgnore @RequestParam Map<String, Object> reportEntity, Query query) {
 		EquipmentInspectionReportWrapper.build().reportQuery(reportEntity);
-		IPage<EquipmentInspectionReportEntity> pages = reportService.page(Condition.getPage(query),Condition.getQueryWrapper(reportEntity, EquipmentInspectionReportEntity.class));
+		IPage<EquipmentInspectionReportEntity> pages = reportService.page(Condition.getPage(query), Condition.getQueryWrapper(reportEntity, EquipmentInspectionReportEntity.class));
 		return R.data(EquipmentInspectionReportWrapper.build().pageVO(pages));
 	}
 
@@ -78,14 +86,36 @@ public class EquipmentInspectionReportController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页")
 	public R<IPage<EquipmentInspectionReportVO>> page(@ApiIgnore EquipmentInspectionReportDTO reportDTO, Query query) {
-//		LambdaQueryWrapper<EquipmentInspectionReportEntity> wrapper = Wrappers.<EquipmentInspectionReportEntity>query().lambda();
-//		wrapper.eq(EquipmentInspectionReportEntity::getIsDeleted,0L);
-//		wrapper.eq(EquipmentInspectionReportEntity::getPlanId,reportDTO.getPlanId());
-
-		IPage<EquipmentInspectionReportVO> pages = reportService.selectPage(Condition.getPage(query),reportDTO);
+		IPage<EquipmentInspectionReportVO> pages = reportService.selectPage(Condition.getPage(query), reportDTO);
 		return R.data(pages);
 	}
 
+	/**
+	 * 查询我填报的巡检信息
+	 */
+	@GetMapping("/my/page")
+	@ApiImplicitParams({
+		@ApiImplicitParam(name = "rtuName", value = "测站名称", paramType = "query", dataType = "string"),
+		@ApiImplicitParam(name = "rtuCode", value = "测站编码", paramType = "query", dataType = "string"),
+	})
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<IPage<EquipmentInspectionReportVO>> myPage(@ApiIgnore EquipmentInspectionReportDTO reportDTO, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		EquipmentInspectionPlanEntity planEntity = planService.yearPlan();
+		reportDTO.setPlanId(planEntity.getId());
+		if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName())) {
+			reportDTO.setOrgId(Func.toLong(user.getDeptId()));
+		} else if (BusinessConstant.ROLE_ORG_SERVICE_PERSON.equals(user.getRoleName())) {
+			reportDTO.setOrgId(Func.toLong(user.getDeptId()));
+			reportDTO.setCreateUser(user.getUserId());
+		} else {
+			reportDTO.setOrgId(null);
+		}
+
+		IPage<EquipmentInspectionReportVO> pages = reportService.selectPage(Condition.getPage(query), reportDTO);
+		return R.data(pages);
+	}
 
 	/**
 	 * 详情
@@ -101,7 +131,6 @@ public class EquipmentInspectionReportController extends BladeController {
 		return R.data(EquipmentInspectionReportWrapper.build().entityVO(detail));
 	}
 
-
 	/**
 	 * 新增
 	 */
@@ -109,6 +138,8 @@ public class EquipmentInspectionReportController extends BladeController {
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入reportEntity")
 	public R save(@RequestBody EquipmentInspectionReportEntity reportEntity) {
+		EquipmentInspectionPlanEntity planEntity = planService.yearPlan();
+		reportEntity.setPlanId(planEntity.getId());
 		return R.status(reportService.save(reportEntity));
 	}
 
@@ -129,6 +160,8 @@ public class EquipmentInspectionReportController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入reportEntity")
 	public R submit(@RequestBody EquipmentInspectionReportEntity reportEntity) {
+		EquipmentInspectionPlanEntity planEntity = planService.yearPlan();
+		reportEntity.setPlanId(planEntity.getId());
 		return R.status(reportService.saveOrUpdate(reportEntity));
 	}
 
@@ -144,17 +177,26 @@ public class EquipmentInspectionReportController extends BladeController {
 	}
 
 	/**
-	 * 查询最新的数据
+	 * 查询当天的巡检填报信息
 	 */
-	@GetMapping("/last/list")
+	@GetMapping("/today/list")
 	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页")
-	public R<List<EquipmentInspectionReportVO>> lastList() {
-		LambdaQueryWrapper<EquipmentInspectionReportEntity> wrapper = Wrappers.<EquipmentInspectionReportEntity>query().lambda();
-		wrapper.orderByDesc(EquipmentInspectionReportEntity::getUpdateTime);
-		wrapper.last("limit 1");
-		List<EquipmentInspectionReportEntity> pages = reportService.list(wrapper);
-		return R.data(EquipmentInspectionReportWrapper.build().listVO(pages));
+	@ApiOperation(value = "查询")
+	public R<List<EquipmentInspectionReportVO>> todayList() {
+		BladeUser user = AuthUtil.getUser();
+		EquipmentInspectionReportDTO reportDTO = new EquipmentInspectionReportDTO();
+		if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_ORG_SERVICE_PERSON.equals(user.getRoleName())) {
+			reportDTO.setOrgId(Func.toLong(user.getDeptId()));
+		} else {
+			reportDTO.setOrgId(null);
+		}
+		Date date = new Date();
+		String dt = Func.formatDateTime(date);
+		reportDTO.setCreateTime(Func.parse(dt, ConcurrentDateFormat.of("yyyy-MM-dd")));
+		EquipmentInspectionPlanEntity planEntity = planService.yearPlan();
+		reportDTO.setPlanId(planEntity.getId());
+		List<EquipmentInspectionReportVO> list = reportService.selectTodayReportList(reportDTO);
+		return R.data(list);
 	}
 
 }

+ 3 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/report/mapper/EquipmentInspectionReportMapper.java

@@ -36,4 +36,7 @@ public interface EquipmentInspectionReportMapper extends BaseMapper<EquipmentIns
 	List<EquipmentInspectionReportVO> selectPage(IPage page, @Param("reportDTO") EquipmentInspectionReportDTO reportDTO);
 
     Long yearPlanEquipmentInspectionReportCount(@Param("planId") Long planId,@Param("orgId") Long orgId);
+
+
+	List<EquipmentInspectionReportVO> selectTodayReportList(@Param("reportDTO") EquipmentInspectionReportDTO reportDTO);
 }

+ 23 - 1
src/main/java/org/springblade/modules/business/equipment/inspection/report/mapper/EquipmentInspectionReportMapper.xml

@@ -226,7 +226,10 @@
         <if test="reportDTO.projectId!=null ">
             and rtu.project_id = #{reportDTO.projectId}
         </if>
-        order by r.rtu_code
+        <if test="reportDTO.createUser!=null ">
+            and r.create_user = #{reportDTO.createUser}
+        </if>
+        order by  r.create_time desc
     </select>
 
     <select id="yearPlanEquipmentInspectionReportCount" resultType="java.lang.Long">
@@ -244,4 +247,23 @@
             and rtu.org_id = #{orgId}
         </if>
     </select>
+
+    <select id="selectTodayReportList" resultMap="reportVOResultMap">
+        SELECT
+        r.*, rtu.rtu_name,rtu.org_id,rtu.project_id,u.real_name
+        FROM
+        equipment_inspection_report_info r
+        LEFT JOIN  rtu_info rtu ON rtu.rtu_code = r.rtu_code
+        LEFT JOIN  blade_user u ON u.id = r.create_user
+        WHERE
+        r.is_deleted = 0
+        and r.plan_id = #{reportDTO.planId}
+        <if test="reportDTO.orgId!=null">
+            and rtu.org_id = #{reportDTO.orgId}
+        </if>
+        <if test="reportDTO.createTime!=null ">
+            and r.create_time >= #{reportDTO.createTime}
+        </if>
+        order by  r.create_time desc
+    </select>
 </mapper>

+ 6 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/report/service/IEquipmentInspectionReportService.java

@@ -8,10 +8,14 @@ package org.springblade.modules.business.equipment.inspection.report.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.business.check.process.dto.OrderProcessInfoDTO;
+import org.springblade.modules.business.check.process.vo.OrderProcessInfoVO;
 import org.springblade.modules.business.equipment.inspection.report.dto.EquipmentInspectionReportDTO;
 import org.springblade.modules.business.equipment.inspection.report.entity.EquipmentInspectionReportEntity;
 import org.springblade.modules.business.equipment.inspection.report.vo.EquipmentInspectionReportVO;
 
+import java.util.List;
+
 
 /***
  * Date:2022/8/23
@@ -31,4 +35,6 @@ public interface IEquipmentInspectionReportService extends BaseService<Equipment
 	IPage<EquipmentInspectionReportVO> selectPage(IPage<EquipmentInspectionReportVO> page, EquipmentInspectionReportDTO reportDTO);
 
     Long yearPlanEquipmentInspectionReportCount(Long planId,Long orgId);
+
+	List<EquipmentInspectionReportVO> selectTodayReportList(EquipmentInspectionReportDTO reportDTO);
 }

+ 7 - 0
src/main/java/org/springblade/modules/business/equipment/inspection/report/service/impl/EquipmentInspectionReportServiceImpl.java

@@ -16,6 +16,8 @@ import org.springblade.modules.business.equipment.inspection.report.service.IEqu
 import org.springblade.modules.business.equipment.inspection.report.vo.EquipmentInspectionReportVO;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /***
  * Date:2022/8/23
  * Title:文件所属模块(必须填写)
@@ -36,4 +38,9 @@ public class EquipmentInspectionReportServiceImpl extends BaseServiceImpl<Equipm
 
 		return baseMapper.yearPlanEquipmentInspectionReportCount(planId,orgId);
 	}
+
+	@Override
+	public List<EquipmentInspectionReportVO> selectTodayReportList(EquipmentInspectionReportDTO reportDTO) {
+		return baseMapper.selectTodayReportList(reportDTO);
+	}
 }

+ 28 - 10
src/main/java/org/springblade/modules/business/project/servicePerson/controller/ProjectServicePersonController.java

@@ -29,6 +29,7 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.business.project.base.entity.ProjectInfoEntity;
 import org.springblade.modules.business.project.servicePerson.entity.ServicePersonEntity;
 import org.springblade.modules.business.project.servicePerson.service.IProjectServicePersonService;
+import org.springblade.modules.business.project.servicePerson.vo.OrgPersonContactVO;
 import org.springblade.modules.business.project.servicePerson.vo.ServicePersonVO;
 import org.springblade.modules.business.project.servicePerson.wrapper.ProjectServicePersonWrapper;
 import org.springblade.modules.system.entity.Dept;
@@ -39,6 +40,7 @@ import org.springframework.util.DigestUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.ArrayList;
+import java.util.LinkedList;
 import java.util.List;
 
 /***
@@ -69,7 +71,7 @@ public class ProjectServicePersonController extends BladeController {
 		}
 		wrapper.eq(ServicePersonEntity::getIsDeleted, 0);
 
-		IPage<ServicePersonEntity> pages = servicePersonService.page(Condition.getPage(query),wrapper);
+		IPage<ServicePersonEntity> pages = servicePersonService.page(Condition.getPage(query), wrapper);
 		return R.data(ProjectServicePersonWrapper.build().pageVO(pages));
 	}
 
@@ -113,6 +115,7 @@ public class ProjectServicePersonController extends BladeController {
 		}
 		User u = new User();
 		u.setAccount(servicePersonEntity.getUserAccount());
+		u.setPhone(servicePersonEntity.getContactPhone());
 		u.setName(servicePersonEntity.getPersonName());
 		u.setRealName(servicePersonEntity.getPersonName());
 		u.setPassword(DigestUtil.encrypt(servicePersonEntity.getUserAccount() + "@2022"));
@@ -122,6 +125,8 @@ public class ProjectServicePersonController extends BladeController {
 		u.setUserType(1);
 		userService.save(u);
 
+		servicePersonEntity.setUserId(u.getId());
+
 		return R.status(servicePersonService.save(servicePersonEntity));
 	}
 
@@ -157,28 +162,41 @@ public class ProjectServicePersonController extends BladeController {
 		return R.status(temp);
 	}
 
-
+	/**
+	 * 机构树
+	 *
+	 * @return
+	 */
 	@GetMapping("/org/dict")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情")
 	public R<List<Dept>> orgTree() {
-
 		BladeUser user = AuthUtil.getUser();
-
 		List<Dept> list = new ArrayList<>();
-
 		if (BusinessConstant.ROLE_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_SUPER_ADMIN.equals(user.getRoleName())) {
-
 			List<Dept> root = this.deptService.getDeptChild(0L);
 			list = this.deptService.getDeptChild(root.get(0).getId());
-
-
 		} else if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_ORG_SERVICE_PERSON.equals(user.getRoleName())) {
-
 			Dept root = this.deptService.getById(Func.toLong(user.getDeptId()));
-
 			list.add(root);
+		}
+		return R.data(list);
+	}
 
+	@GetMapping("/contact")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "通讯录")
+	public R<List<OrgPersonContactVO>> contact() {
+		BladeUser user = AuthUtil.getUser();
+		List<Dept> root = this.deptService.getDeptChild(Func.toLong(user.getDeptId()));
+		List<OrgPersonContactVO> list = new LinkedList<>();
+		for (Dept dept : root) {
+			OrgPersonContactVO contactVO = new OrgPersonContactVO();
+			contactVO.setId(dept.getId());
+			contactVO.setOrgName(dept.getDeptName());
+			List<ServicePersonVO> personVOList = this.servicePersonService.servicePersonList(contactVO.getId());
+			contactVO.setServicePersonVOList(personVOList);
+			list.add(contactVO);
 		}
 		return R.data(list);
 	}

+ 6 - 0
src/main/java/org/springblade/modules/business/project/servicePerson/entity/ServicePersonEntity.java

@@ -68,4 +68,10 @@ public class ServicePersonEntity extends BaseEntity {
 	@ApiModelProperty(value = "帐号")
 	private String userAccount;
 
+	/**
+	 * 系统用户ID
+	 */
+	@ApiModelProperty(value = "系统用户ID")
+	private Long userId;
+
 }

+ 5 - 0
src/main/java/org/springblade/modules/business/project/servicePerson/mapper/ProjectServicePersonMapper.java

@@ -7,7 +7,11 @@
 package org.springblade.modules.business.project.servicePerson.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 import org.springblade.modules.business.project.servicePerson.entity.ServicePersonEntity;
+import org.springblade.modules.business.project.servicePerson.vo.ServicePersonVO;
+
+import java.util.List;
 
 /***
  * Date:2022/8/22
@@ -18,4 +22,5 @@ import org.springblade.modules.business.project.servicePerson.entity.ServicePers
  * Remark:认为有必要的其他信息
  */
 public interface ProjectServicePersonMapper extends BaseMapper<ServicePersonEntity> {
+	List<ServicePersonVO> servicePersonList(@Param("orgId") Long orgId);
 }

+ 34 - 0
src/main/java/org/springblade/modules/business/project/servicePerson/mapper/ProjectServicePersonMapper.xml

@@ -17,7 +17,41 @@
         <result column="mail" property="mail"/>
         <result column="remark" property="remark"/>
         <result column="user_account" property="userAccount"/>
+    </resultMap>
 
+    <resultMap id="personListResultMap" type="org.springblade.modules.business.project.servicePerson.vo.ServicePersonVO">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="real_name" property="personName"/>
+        <result column="dept_id" property="orgId"/>
+        <result column="phone" property="contactPhone"/>
+        <result column="mail" property="mail"/>
+        <result column="remark" property="remark"/>
+        <result column="account" property="userAccount"/>
+        <result column="role_name" property="roleName"/>
     </resultMap>
 
+    <select id="servicePersonList" resultMap="personListResultMap">
+
+        SELECT
+        u.*,
+        r.role_name,p.mail,p.remark
+        FROM
+        blade_user u
+        LEFT JOIN project_service_person p ON u.id = p.user_id
+        LEFT JOIN blade_role r ON r.id = u.role_id
+        WHERE
+        u.is_deleted = 0
+        <if test="orgId!=null">
+            and u.dept_id =#{orgId}
+        </if>
+        ORDER BY
+        p.person_name
+    </select>
+
 </mapper>

+ 4 - 0
src/main/java/org/springblade/modules/business/project/servicePerson/service/IProjectServicePersonService.java

@@ -8,6 +8,9 @@ package org.springblade.modules.business.project.servicePerson.service;
 
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.modules.business.project.servicePerson.entity.ServicePersonEntity;
+import org.springblade.modules.business.project.servicePerson.vo.ServicePersonVO;
+
+import java.util.List;
 
 /***
  * Date:2022/8/22
@@ -18,4 +21,5 @@ import org.springblade.modules.business.project.servicePerson.entity.ServicePers
  * Remark:认为有必要的其他信息
  */
 public interface IProjectServicePersonService extends BaseService<ServicePersonEntity> {
+	List<ServicePersonVO> servicePersonList(Long orgId);
 }

+ 7 - 0
src/main/java/org/springblade/modules/business/project/servicePerson/service/impl/ProjectServicePersonServiceImpl.java

@@ -10,8 +10,11 @@ import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.modules.business.project.servicePerson.entity.ServicePersonEntity;
 import org.springblade.modules.business.project.servicePerson.mapper.ProjectServicePersonMapper;
 import org.springblade.modules.business.project.servicePerson.service.IProjectServicePersonService;
+import org.springblade.modules.business.project.servicePerson.vo.ServicePersonVO;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /***
  * Date:2022/8/22
  * Title:文件所属模块(必须填写)
@@ -23,4 +26,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class ProjectServicePersonServiceImpl  extends BaseServiceImpl<ProjectServicePersonMapper,ServicePersonEntity> implements IProjectServicePersonService {
 
+	@Override
+	public List<ServicePersonVO> servicePersonList(Long orgId) {
+		return baseMapper.servicePersonList(orgId);
+	}
 }

+ 39 - 0
src/main/java/org/springblade/modules/business/project/servicePerson/vo/OrgPersonContactVO.java

@@ -0,0 +1,39 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/8/22
+ */
+package org.springblade.modules.business.project.servicePerson.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springblade.modules.business.project.servicePerson.entity.ServicePersonEntity;
+
+import java.util.List;
+
+/***
+ * Date:2022/8/22
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class OrgPersonContactVO extends BaseEntity {
+
+	/**
+	 * 机构名称
+	 */
+	@ApiModelProperty(value = "机构名称")
+	private String orgName;
+
+	/**
+	 * 运维人员列表
+	 */
+	private List<ServicePersonVO> servicePersonVOList;
+}

+ 6 - 0
src/main/java/org/springblade/modules/business/project/servicePerson/vo/ServicePersonVO.java

@@ -6,6 +6,7 @@
  */
 package org.springblade.modules.business.project.servicePerson.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.business.project.servicePerson.entity.ServicePersonEntity;
@@ -21,4 +22,9 @@ import org.springblade.modules.business.project.servicePerson.entity.ServicePers
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class ServicePersonVO extends ServicePersonEntity {
+	/**
+	 * 角色名称
+	 */
+	@ApiModelProperty(value = "角色名称")
+	private String roleName;
 }

+ 44 - 1
src/main/java/org/springblade/modules/business/rtu/base/controller/RtuBaseInfoController.java

@@ -24,15 +24,23 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.business.equipment.inspection.report.dto.EquipmentInspectionReportDTO;
 import org.springblade.modules.business.project.servicePerson.entity.ServicePersonEntity;
+import org.springblade.modules.business.project.servicePerson.vo.OrgPersonContactVO;
+import org.springblade.modules.business.project.servicePerson.vo.ServicePersonVO;
 import org.springblade.modules.business.rtu.base.dto.RtuInfoDTO;
 import org.springblade.modules.business.rtu.base.entity.RtuInfoEntity;
 import org.springblade.modules.business.rtu.base.service.IRtuBaseInfoService;
 import org.springblade.modules.business.rtu.base.vo.RtuInfoVO;
+import org.springblade.modules.business.rtu.base.vo.RtuStatisticsInfoVO;
 import org.springblade.modules.business.rtu.base.wrapper.RtuInfoWrapper;
+import org.springblade.modules.business.warning.dto.RtuWarningInfoDTO;
+import org.springblade.modules.business.warning.service.IRtuWarningService;
+import org.springblade.modules.system.entity.Dept;
 import org.springblade.modules.system.entity.DictBiz;
+import org.springblade.modules.system.service.IDeptService;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
+import java.util.LinkedList;
 import java.util.List;
 
 
@@ -50,7 +58,8 @@ import java.util.List;
 @Api(value = "测站设备基础管理", tags = "测站设备基础管理")
 public class RtuBaseInfoController extends BladeController {
 	private final IRtuBaseInfoService rtuBaseInfoService;
-
+	private final IDeptService deptService;
+	private final IRtuWarningService rtuWarningService;
 
 	/**
 	 * 分页
@@ -164,4 +173,38 @@ public class RtuBaseInfoController extends BladeController {
 		return R.data(dicts);
 	}
 
+
+	/**
+	 * 按机构统计测站信息
+	 * @return
+	 */
+	@GetMapping("/statistics")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页")
+	public R<List<RtuStatisticsInfoVO>> rtuStatistics() {
+		List<RtuStatisticsInfoVO> list = new LinkedList<>();
+		BladeUser user = AuthUtil.getUser();
+		List<Dept> root = this.deptService.getDeptChild(Func.toLong(user.getDeptId()));
+
+		for (Dept dept : root) {
+			RtuStatisticsInfoVO rtuStatisticsInfoVO = new RtuStatisticsInfoVO();
+			rtuStatisticsInfoVO.setId(dept.getId());
+			rtuStatisticsInfoVO.setOrgName(dept.getDeptName());
+			LambdaQueryWrapper<RtuInfoEntity> wrapper = Wrappers.<RtuInfoEntity>query().lambda();
+			wrapper.eq(RtuInfoEntity::getOrgId,dept.getId());
+			wrapper.eq(RtuInfoEntity::getIsDeleted,0);
+			Long rtus =rtuBaseInfoService.count(wrapper);
+			rtuStatisticsInfoVO.setRtuCount(rtus);
+
+			RtuWarningInfoDTO rtuWarningInfoDTO=new RtuWarningInfoDTO();
+			rtuWarningInfoDTO.setOrgId(dept.getId());
+			Long warningRtus = rtuWarningService.warningRtuCount(rtuWarningInfoDTO);
+			rtuStatisticsInfoVO.setWarningRtuCount(warningRtus);
+
+			list.add(rtuStatisticsInfoVO);
+		}
+
+		return R.data(list);
+	}
+
 }

+ 0 - 1
src/main/java/org/springblade/modules/business/rtu/base/vo/RtuInfoVO.java

@@ -68,5 +68,4 @@ public class RtuInfoVO extends RtuInfoEntity {
 	private Integer reportStatus;
 
 
-
 }

+ 50 - 0
src/main/java/org/springblade/modules/business/rtu/base/vo/RtuStatisticsInfoVO.java

@@ -0,0 +1,50 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2022/9/24
+ */
+package org.springblade.modules.business.rtu.base.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springblade.modules.business.rtu.base.entity.RtuInfoEntity;
+
+/***
+ * Date:2022/9/24
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RtuStatisticsInfoVO extends BaseEntity {
+
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty(value = "机构ID")
+	private Long orgId;
+
+	/**
+	 * 机构名称
+	 */
+	@ApiModelProperty(value = "机构名称")
+	private String orgName;
+
+	/**
+	 * 测站数量
+	 */
+	@ApiModelProperty(value = "测站数量")
+	private Long rtuCount;
+
+	/**
+	 * 预警测站数量
+	 */
+	@ApiModelProperty(value = "预警测站数量")
+	private Long warningRtuCount;
+}

+ 6 - 0
src/main/java/org/springblade/modules/business/rtu/data/entity/RtuDataRainEntity.java

@@ -61,4 +61,10 @@ public class RtuDataRainEntity extends BaseEntity {
 	 */
 	@ApiModelProperty("降水量")
 	private Double drp;
+
+	/**
+	 * 时段长
+	 */
+	@ApiModelProperty("时段长")
+	private Double intv;
 }

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

@@ -80,15 +80,15 @@ public class RtuWarningController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页")
 	public R<IPage<RtuWarningInfoVO>> page(@ApiIgnore RtuWarningInfoDTO rtuWarningInfoDTO, Query query) {
-		LambdaQueryWrapper<RtuWarningInfoEntity> wrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
-		if (null != rtuWarningInfoDTO && null != rtuWarningInfoDTO.getRtuCode()) {
-			wrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuWarningInfoDTO.getRtuCode());
-		}
-		wrapper.orderByAsc(RtuWarningInfoEntity::getWarningRecoveryTime);
-		wrapper.orderByDesc(RtuWarningInfoEntity::getCreateTime);
-
-		IPage<RtuWarningInfoEntity> pages = rtuWarningService.page(Condition.getPage(query),wrapper);
-		return R.data(RtuWarningWrapper.build().pageVO(pages));
+//		LambdaQueryWrapper<RtuWarningInfoEntity> wrapper = Wrappers.<RtuWarningInfoEntity>query().lambda();
+//		if (null != rtuWarningInfoDTO && null != rtuWarningInfoDTO.getRtuCode()) {
+//			wrapper.eq(RtuWarningInfoEntity::getRtuCode, rtuWarningInfoDTO.getRtuCode());
+//		}
+//		wrapper.orderByAsc(RtuWarningInfoEntity::getWarningRecoveryTime);
+//		wrapper.orderByDesc(RtuWarningInfoEntity::getCreateTime);
+
+		IPage<RtuWarningInfoVO> pages = rtuWarningService.selectPage(Condition.getPage(query),rtuWarningInfoDTO);
+		return R.data(pages);
 	}
 
 

+ 6 - 0
src/main/java/org/springblade/modules/business/warning/dto/RtuWarningInfoDTO.java

@@ -6,6 +6,7 @@
  */
 package org.springblade.modules.business.warning.dto;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
@@ -21,4 +22,9 @@ import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class RtuWarningInfoDTO extends RtuWarningInfoEntity {
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty("机构ID")
+	private Long orgId;
 }

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

@@ -7,7 +7,11 @@
 package org.springblade.modules.business.warning.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.warning.dto.RtuWarningInfoDTO;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
+import org.springblade.modules.business.warning.vo.RtuWarningInfoVO;
 
 /***
  * Date:2022/8/24
@@ -18,4 +22,7 @@ import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
  * Remark:认为有必要的其他信息
  */
 public interface RtuWarningMapper extends BaseMapper<RtuWarningInfoEntity> {
+	IPage<RtuWarningInfoVO> selectPage(IPage page, @Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRtuCount(@Param("rtuWarningInfoDTO") RtuWarningInfoDTO rtuWarningInfoDTO);
 }

+ 31 - 22
src/main/java/org/springblade/modules/business/warning/mapper/RtuWarningMapper.xml

@@ -3,7 +3,8 @@
 <mapper namespace="org.springblade.modules.business.warning.mapper.RtuWarningMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="rtuWarningInfoEntityResultMap" type="org.springblade.modules.business.warning.entity.RtuWarningInfoEntity">
+    <resultMap id="rtuWarningInfoEntityResultMap"
+               type="org.springblade.modules.business.warning.entity.RtuWarningInfoEntity">
         <result column="id" property="id"/>
         <result column="create_user" property="createUser"/>
         <result column="create_time" property="createTime"/>
@@ -14,10 +15,8 @@
         <result column="rtu_code" property="rtuCode"/>
         <result column="warning_kind" property="warningKind"/>
         <result column="warning_desc" property="warningDesc"/>
-
         <result column="warning_happen_time" property="warningHappenTime"/>
         <result column="warning_recovery_time" property="warningRecoveryTime"/>
-
         <result column="warning_status" property="warningStatus"/>
         <result column="data_from_id" property="dataFromId"/>
     </resultMap>
@@ -38,26 +37,36 @@
         <result column="warning_recovery_time" property="warningRecoveryTime"/>
         <result column="warning_status" property="warningStatus"/>
         <result column="data_from_id" property="dataFromId"/>
-
+        <result column="rtu_name" property="rtuName"/>
     </resultMap>
 
 
-    <!--<select id="selectPage" resultMap="checkOrderInfoVOResultMap">-->
-        <!--SELECT-->
-         <!--o.*,u.real_name,i.rtu_name,p.project_name,d2.dept_name AS org_name-->
-        <!--FROM-->
-        <!--rtu_failure_check_order o-->
-        <!--LEFT JOIN rtu_info i ON i.rtu_code = o.rtu_code-->
-        <!--LEFT JOIN blade_user u ON u.id = o.update_user-->
-        <!--LEFT JOIN  project_info p ON i.project_id = p.id-->
-        <!--LEFT JOIN  blade_dept d2 ON i.org_id = d2.id-->
-        <!--WHERE-->
-        <!--o.is_deleted = 0-->
-        <!--<if test="checkOrderInfoDTO.rtuCode!=null">-->
-            <!--and o.rtu_code like concat(concat('%', #{checkOrderInfoDTO.rtuCode}), '%')-->
-        <!--</if>-->
-        <!--<if test="checkOrderInfoDTO.rtuName!=null">-->
-            <!--and i.rtu_name like concat(concat('%', #{checkOrderInfoDTO.rtuName}), '%')-->
-        <!--</if>-->
-    <!--</select>-->
+    <select id="selectPage" resultMap="rtuWarningInfoVOResultMap">
+        SELECT
+        w.*, rtu.rtu_name
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info rtu ON rtu.rtu_code = w.rtu_code
+        WHERE
+        w.is_deleted = 0
+        <if test="rtuWarningInfoDTO.rtuCode!=null">
+            and rtu.rtu_code = #{rtuWarningInfoDTO.rtuCode}
+        </if>
+        order by w.warning_happen_time desc
+    </select>
+
+    <select id="warningRtuCount" resultType="java.lang.Long">
+        SELECT
+        count(*)
+        FROM
+        rtu_warning w
+        LEFT JOIN rtu_info rtu ON rtu.rtu_code = w.rtu_code
+        WHERE
+        w.is_deleted = 0
+        <if test="rtuWarningInfoDTO.orgId!=null">
+            and rtu.org_id = #{rtuWarningInfoDTO.orgId}
+        </if>
+        and w.warning_status = 1
+
+    </select>
 </mapper>

+ 8 - 0
src/main/java/org/springblade/modules/business/warning/service/IRtuWarningService.java

@@ -6,8 +6,13 @@
  */
 package org.springblade.modules.business.warning.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.business.equipment.inspection.report.dto.EquipmentInspectionReportDTO;
+import org.springblade.modules.business.equipment.inspection.report.vo.EquipmentInspectionReportVO;
+import org.springblade.modules.business.warning.dto.RtuWarningInfoDTO;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
+import org.springblade.modules.business.warning.vo.RtuWarningInfoVO;
 
 /***
  * Date:2022/8/24
@@ -19,4 +24,7 @@ import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
  */
 public interface IRtuWarningService extends BaseService<RtuWarningInfoEntity> {
 	RtuWarningInfoEntity getWarningInfoByRtuCode(String rtuCode);
+	IPage<RtuWarningInfoVO> selectPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);
+
+	Long warningRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);
 }

+ 13 - 0
src/main/java/org/springblade/modules/business/warning/service/impl/RtuWarningServiceImpl.java

@@ -7,12 +7,15 @@
 package org.springblade.modules.business.warning.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.modules.business.equipment.inspection.report.entity.EquipmentInspectionReportEntity;
+import org.springblade.modules.business.warning.dto.RtuWarningInfoDTO;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
 import org.springblade.modules.business.warning.mapper.RtuWarningMapper;
 import org.springblade.modules.business.warning.service.IRtuWarningService;
+import org.springblade.modules.business.warning.vo.RtuWarningInfoVO;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -40,4 +43,14 @@ public class RtuWarningServiceImpl extends BaseServiceImpl<RtuWarningMapper, Rtu
 		}
 		return null;
 	}
+
+	@Override
+	public IPage<RtuWarningInfoVO> selectPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return baseMapper.selectPage(page, rtuWarningInfoDTO);
+	}
+
+	@Override
+	public Long warningRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO) {
+		return baseMapper.warningRtuCount(rtuWarningInfoDTO);
+	}
 }

+ 6 - 0
src/main/java/org/springblade/modules/business/warning/vo/RtuWarningInfoVO.java

@@ -6,6 +6,7 @@
  */
 package org.springblade.modules.business.warning.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
@@ -21,4 +22,9 @@ import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class RtuWarningInfoVO extends RtuWarningInfoEntity {
+	/**
+	 * 测站名称
+	 */
+	@ApiModelProperty("测站名称")
+	private String rtuName;
 }

+ 2 - 0
src/main/java/org/springblade/realData/VO/RealDataHomeInfoVO.java

@@ -30,6 +30,8 @@ public class RealDataHomeInfoVO extends RealDataHomeInfoEntity {
 	private Long myOrderCount;
 	private Long myInspectionCount;
 
+	private Long unconfirmOrderCount;
+
 	private String equipmentInspectionPercent;
 
 	private Boolean hasNewNotice;

+ 84 - 38
src/main/java/org/springblade/realData/controller/RealDataController.java

@@ -21,6 +21,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.enums.OrderCloseEnum;
 import org.springblade.enums.OrderConfirmEnum;
+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.service.IRtuCheckOrderService;
 import org.springblade.modules.business.check.process.entity.OrderProcessInfoEntity;
@@ -30,9 +31,16 @@ import org.springblade.modules.business.desk.entity.NoticeViewEntity;
 import org.springblade.modules.business.desk.service.INoticeService;
 import org.springblade.modules.business.desk.service.INoticeViewService;
 import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
+import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionRtuEntity;
 import org.springblade.modules.business.equipment.inspection.plan.service.IEquipmentInspectionPlanRtuService;
 import org.springblade.modules.business.equipment.inspection.plan.service.IEquipmentInspectionPlanService;
 import org.springblade.modules.business.equipment.inspection.report.service.IEquipmentInspectionReportService;
+import org.springblade.modules.business.rtu.base.entity.RtuInfoEntity;
+import org.springblade.modules.business.rtu.base.service.IRtuBaseInfoService;
+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.realData.VO.RealDataHomeInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.HashOperations;
@@ -63,72 +71,110 @@ public class RealDataController {
 	private final IEquipmentInspectionReportService reportService;
 	private final INoticeService noticeService;
 	private final INoticeViewService noticeViewService;
+	private final IRtuBaseInfoService rtuBaseInfoService;
+	private final IRtuWarningService rtuWarningService;
 
 	@GetMapping("/home/info")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情")
 	public R<RealDataHomeInfoVO> detail() {
 		HashOperations<String, String, String> opsHash = redisTemplate.opsForHash();
-		RealDataHomeInfoVO infoVO=new RealDataHomeInfoVO();
-		if (opsHash.hasKey("real_data_info","rtus")){
-			infoVO.setRtus(Integer.parseInt(opsHash.get("real_data_info","rtus")));
-		}else{
-			infoVO.setRtus(0);
-		}
-		if (opsHash.hasKey("real_data_info","warningRtus")){
-			infoVO.setWarningRtus(Integer.parseInt(opsHash.get("real_data_info","warningRtus")));
-		}else{
-			infoVO.setWarningRtus(0);
-		}
-		if (opsHash.hasKey("real_data_info","delayOrders")){
-			infoVO.setDelayOrders(Integer.parseInt(opsHash.get("real_data_info","delayOrders")));
-		}else{
-			infoVO.setDelayOrders(0);
-		}
+		RealDataHomeInfoVO infoVO = new RealDataHomeInfoVO();
+//		if (opsHash.hasKey("real_data_info","rtus")){
+//			infoVO.setRtus(Integer.parseInt(opsHash.get("real_data_info","rtus")));
+//		}else{
+//			infoVO.setRtus(0);
+//		}
+//		if (opsHash.hasKey("real_data_info","warningRtus")){
+//			infoVO.setWarningRtus(Integer.parseInt(opsHash.get("real_data_info","warningRtus")));
+//		}else{
+//			infoVO.setWarningRtus(0);
+//		}
+//		if (opsHash.hasKey("real_data_info","delayOrders")){
+//			infoVO.setDelayOrders(Integer.parseInt(opsHash.get("real_data_info","delayOrders")));
+//		}else{
+//			infoVO.setDelayOrders(0);
+//		}
 //		if (opsHash.hasKey("real_data_info","equipmentInspectionCount")){
 //			infoVO.setEquipmentInspectionCount(Integer.parseInt(opsHash.get("real_data_info","equipmentInspectionCount")));
 //		}else{
 //			infoVO.setEquipmentInspectionCount(0);
 //		}
 
+
 		BladeUser user = AuthUtil.getUser();
 		if (BusinessConstant.ROLE_ORG_ADMIN.equals(user.getRoleName()) || BusinessConstant.ROLE_ORG_SERVICE_PERSON.equals(user.getRoleName())) {
+			LambdaQueryWrapper<RtuInfoEntity> rtuwrapper = Wrappers.<RtuInfoEntity>query().lambda();
+			rtuwrapper.eq(RtuInfoEntity::getOrgId, user.getDeptId());
+			rtuwrapper.eq(RtuInfoEntity::getIsDeleted,0);
+			long rtuCount = rtuBaseInfoService.count(rtuwrapper);
+			infoVO.setRtus((int) rtuCount);
+
+			RtuWarningInfoDTO rtuWarningInfoDTO = new RtuWarningInfoDTO();
+			rtuWarningInfoDTO.setOrgId(Func.toLong(user.getDeptId()));
+			long warningRtuCount = rtuWarningService.warningRtuCount(rtuWarningInfoDTO);
+			infoVO.setWarningRtus((int)warningRtuCount);
+
 			LambdaQueryWrapper<CheckOrderInfoEntity> wrapper = Wrappers.<CheckOrderInfoEntity>query().lambda();
-			wrapper.eq(CheckOrderInfoEntity::getOrderConfirmUser,user.getUserId());
-			wrapper.eq(CheckOrderInfoEntity::getOrderConfirm,OrderConfirmEnum.ACTIVE_CONFIRM);
-			wrapper.eq(CheckOrderInfoEntity::getOrderClose,OrderCloseEnum.ACTIVE_OPEN);
-			wrapper.eq(CheckOrderInfoEntity::getIsDeleted,0);
-			long count =checkOrderService.count(wrapper);
+
+			wrapper.eq(CheckOrderInfoEntity::getOrderConfirmUser, user.getUserId());
+			wrapper.eq(CheckOrderInfoEntity::getOrderConfirm, OrderConfirmEnum.ACTIVE_CONFIRM.getCode());
+			wrapper.eq(CheckOrderInfoEntity::getOrderClose, OrderCloseEnum.ACTIVE_OPEN.getCode());
+			wrapper.eq(CheckOrderInfoEntity::getIsDeleted, 0);
+			long count = checkOrderService.count(wrapper);
 			infoVO.setMyOrderCount(count);
 
-			EquipmentInspectionPlanEntity planEntity=planService.yearPlan();
-			Long planInspectionRtus=planRtuService.yearPlanEquipmentInspectionCount(Func.toLong(user.getDeptId()));
-		    Long reportRtus=reportService.yearPlanEquipmentInspectionReportCount(planEntity.getId(),Func.toLong(user.getDeptId()));
-		    infoVO.setEquipmentInspectionCount(planInspectionRtus);
+			CheckOrderInfoDTO orderInfoDTO = new CheckOrderInfoDTO();
+			orderInfoDTO.setOrgId(Func.toLong(user.getDeptId()));
+			orderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CREATE.getCode());
+			long unconfirmOrderCount = checkOrderService.unconfirmOrderCount(orderInfoDTO);
+			infoVO.setUnconfirmOrderCount(unconfirmOrderCount);
+
+			EquipmentInspectionPlanEntity planEntity = planService.yearPlan();
+			Long planInspectionRtus = planRtuService.yearPlanEquipmentInspectionCount(Func.toLong(user.getDeptId()));
+			Long reportRtus = reportService.yearPlanEquipmentInspectionReportCount(planEntity.getId(), Func.toLong(user.getDeptId()));
+			infoVO.setEquipmentInspectionCount(planInspectionRtus);
 			infoVO.setMyInspectionCount(reportRtus);
 
-			String equipmentInspectionPercent = String.format("%.02f",(double)reportRtus/(double)planInspectionRtus*(double)100);
+			String equipmentInspectionPercent = String.format("%.02f", (double) reportRtus / (double) planInspectionRtus * (double) 100);
+			infoVO.setEquipmentInspectionPercent(equipmentInspectionPercent);
+		} else {
+			LambdaQueryWrapper<RtuInfoEntity> rtuwrapper = Wrappers.<RtuInfoEntity>query().lambda();
+			rtuwrapper.eq(RtuInfoEntity::getIsDeleted,0);
+			long rtuCount = rtuBaseInfoService.count(rtuwrapper);
+			infoVO.setRtus((int) rtuCount);
+
+			RtuWarningInfoDTO rtuWarningInfoDTO = new RtuWarningInfoDTO();
+			long warningRtuCount = rtuWarningService.warningRtuCount(rtuWarningInfoDTO);
+			infoVO.setWarningRtus((int)warningRtuCount);
+
+			CheckOrderInfoDTO orderInfoDTO = new CheckOrderInfoDTO();
+			orderInfoDTO.setOrderConfirm(OrderConfirmEnum.ACTIVE_CREATE.getCode());
+			long unconfirmOrderCount = checkOrderService.unconfirmOrderCount(orderInfoDTO);
+			infoVO.setUnconfirmOrderCount(unconfirmOrderCount);
+			EquipmentInspectionPlanEntity planEntity = planService.yearPlan();
+			Long planInspectionRtus = planRtuService.yearPlanEquipmentInspectionCount(null);
+			Long reportRtus = reportService.yearPlanEquipmentInspectionReportCount(planEntity.getId(), null);
+			infoVO.setEquipmentInspectionCount(planInspectionRtus);
+
+			String equipmentInspectionPercent = String.format("%.02f", (double) reportRtus / (double) planInspectionRtus * (double) 100);
 			infoVO.setEquipmentInspectionPercent(equipmentInspectionPercent);
-		}else{
-			infoVO.setMyOrderCount(0L);
-			infoVO.setMyInspectionCount(0L);
-			infoVO.setEquipmentInspectionPercent("0");
 		}
 
 		LambdaQueryWrapper<NoticeViewEntity> noticewrapper = Wrappers.<NoticeViewEntity>query().lambda();
-		noticewrapper.eq(NoticeViewEntity::getCreateUser,user.getUserId());
-		noticewrapper.eq(NoticeViewEntity::getIsDeleted,0);
-		NoticeViewEntity entity=noticeViewService.getOne(noticewrapper);
-		if (null != entity){
-		  Long count=	noticeService.unviewNoticeCount(entity.getViewTime());
-			if (count>0){
+		noticewrapper.eq(NoticeViewEntity::getCreateUser, user.getUserId());
+		noticewrapper.eq(NoticeViewEntity::getIsDeleted, 0);
+		NoticeViewEntity entity = noticeViewService.getOne(noticewrapper);
+		if (null != entity) {
+			Long count = noticeService.unviewNoticeCount(entity.getViewTime());
+			if (count > 0) {
 				infoVO.setHasNewNotice(true);
 				infoVO.setNewNoticeCount(count);
-			}else{
+			} else {
 				infoVO.setHasNewNotice(false);
 				infoVO.setNewNoticeCount(0L);
 			}
-		}else{
+		} else {
 			infoVO.setHasNewNotice(true);
 			infoVO.setNewNoticeCount(0L);
 		}

+ 8 - 8
src/main/resources/application-dev.yml

@@ -2,9 +2,9 @@
 spring:
   redis:
     ##redis 单机环境配置
-    host: 111.204.228.227
-    port: 16379
-    password:  123456
+    host: 172.9.0.12
+    port: 6379
+    password:  Dh8282
     database: 1
     ssl: false
     ##redis 集群环境配置
@@ -13,11 +13,11 @@ spring:
     #  commandTimeout: 5000
   datasource:
     # MySql
-    url: jdbc:mysql://111.204.228.227:13306/shzhjcyjptywxt?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+    url: jdbc:mysql://172.9.0.12:3306/shzhjcyjptywxt?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
 #    username: root
 #    password: root
     username: root
-    password: 3edc#4rfv$
+    password: Dh@2022
 
     # PostgreSQL
     #url: jdbc:postgresql://127.0.0.1:5432/bladex_boot
@@ -37,7 +37,7 @@ spring:
 #    password: ZGXXXT2022
 
   kafka:
-    bootstrap-servers: 111.204.228.227:19092
+    bootstrap-servers: 172.9.0.12:9092
     producer:
       retries: 0
       batch-size: 16384
@@ -71,8 +71,8 @@ blade:
     ##是否启用分布式锁
     enabled: false
     ##redis服务地址
-    address: redis://111.204.228.227:16379
-    password:  123456
+    address: redis://172.9.0.12:6379
+    password:  Dh8282
   #本地文件上传
   file:
     remote-mode: true