Ver Fonte

内蒙运维系统-数据抽取服务

dylan há 2 anos atrás
pai
commit
d61c1bc253
52 ficheiros alterados com 1227 adições e 928 exclusões
  1. 3 0
      .gitignore
  2. 0 72
      pom.xml
  3. 0 11
      src/main/java/org/springblade/etl/EtlGroundDataTask.java
  4. 22 23
      src/main/java/org/springblade/etl/EtlTaskManager.java
  5. 93 57
      src/main/java/org/springblade/etl/EtlWarnDataTask.java
  6. 9 8
      src/main/java/org/springblade/etl/mapper/EtlWarningInfoMapper.xml
  7. 2 0
      src/main/java/org/springblade/etl/service/impl/EtlWarningServiceImpl.java
  8. 0 180
      src/main/java/org/springblade/modules/business/desk/controller/NoticeController.java
  9. 0 28
      src/main/java/org/springblade/modules/business/desk/dto/NoticeDTO.java
  10. 0 62
      src/main/java/org/springblade/modules/business/desk/entity/NoticeEntity.java
  11. 0 42
      src/main/java/org/springblade/modules/business/desk/entity/NoticeViewEntity.java
  12. 0 48
      src/main/java/org/springblade/modules/business/desk/mapper/NoticeMapper.java
  13. 0 65
      src/main/java/org/springblade/modules/business/desk/mapper/NoticeMapper.xml
  14. 0 30
      src/main/java/org/springblade/modules/business/desk/mapper/NoticeViewMapper.java
  15. 0 18
      src/main/java/org/springblade/modules/business/desk/mapper/NoticeViewMapper.xml
  16. 0 36
      src/main/java/org/springblade/modules/business/desk/service/INoticeService.java
  17. 0 27
      src/main/java/org/springblade/modules/business/desk/service/INoticeViewService.java
  18. 0 44
      src/main/java/org/springblade/modules/business/desk/service/impl/NoticeServiceImpl.java
  19. 0 35
      src/main/java/org/springblade/modules/business/desk/service/impl/NoticeViewServiceImpl.java
  20. 0 33
      src/main/java/org/springblade/modules/business/desk/vo/NoticeVO.java
  21. 0 58
      src/main/java/org/springblade/modules/business/desk/wrapper/NoticeWrapper.java
  22. 4 1
      src/main/java/org/springblade/modules/data/mapper/WarnDataCacheMapper.java
  23. 18 1
      src/main/java/org/springblade/modules/data/mapper/WarnDataCacheMapper.xml
  24. 3 1
      src/main/java/org/springblade/modules/data/service/IWarnDataCacheService.java
  25. 6 0
      src/main/java/org/springblade/modules/data/service/impl/WarnDataCacheServiceImpl.java
  26. 123 0
      src/main/java/org/springblade/modules/warn/controller/WarnInfoController.java
  27. 95 0
      src/main/java/org/springblade/modules/warn/entity/InsideWarnInfoEntity.java
  28. 50 0
      src/main/java/org/springblade/modules/warn/entity/OutsideWarnInfoEntity.java
  29. 48 0
      src/main/java/org/springblade/modules/warn/entity/OutsideWarnTimeEntity.java
  30. 128 0
      src/main/java/org/springblade/modules/warn/entity/WarnResponseInfoEntity.java
  31. 26 0
      src/main/java/org/springblade/modules/warn/mapper/InsideWarnInfoMapper.java
  32. 39 0
      src/main/java/org/springblade/modules/warn/mapper/InsideWarnInfoMapper.xml
  33. 27 0
      src/main/java/org/springblade/modules/warn/mapper/OutsideWarnInfoMapper.java
  34. 33 0
      src/main/java/org/springblade/modules/warn/mapper/OutsideWarnInfoMapper.xml
  35. 27 0
      src/main/java/org/springblade/modules/warn/mapper/OutsideWarnTimeMapper.java
  36. 22 0
      src/main/java/org/springblade/modules/warn/mapper/OutsideWarnTimeMapper.xml
  37. 27 0
      src/main/java/org/springblade/modules/warn/mapper/WarnResponseInfoMapper.java
  38. 45 0
      src/main/java/org/springblade/modules/warn/mapper/WarnResponseInfoMapper.xml
  39. 10 0
      src/main/java/org/springblade/modules/warn/service/IInsideWarnInfoService.java
  40. 10 0
      src/main/java/org/springblade/modules/warn/service/IOutsideWarnInfoService.java
  41. 10 0
      src/main/java/org/springblade/modules/warn/service/IOutsideWarnTimeService.java
  42. 10 0
      src/main/java/org/springblade/modules/warn/service/IWarnResponseInfoService.java
  43. 33 0
      src/main/java/org/springblade/modules/warn/service/impl/InsideWarnInfoServiceImpl.java
  44. 33 0
      src/main/java/org/springblade/modules/warn/service/impl/OutsideWarnInfoServiceImpl.java
  45. 33 0
      src/main/java/org/springblade/modules/warn/service/impl/OutsideWarnTimeServiceImpl.java
  46. 33 0
      src/main/java/org/springblade/modules/warn/service/impl/WarnResponseInfoServiceImpl.java
  47. 107 0
      src/main/java/org/springblade/modules/warn/vo/WarnDetailInfoVO.java
  48. 11 0
      src/main/main.iml
  49. 8 6
      src/main/resources/application-dev.yml
  50. 76 41
      src/main/resources/application-test.yml
  51. 1 1
      src/main/resources/application.yml
  52. 2 0
      src/main/resources/log/logback-prod.xml

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+.idea
+target
+/src/main/java/org/springblade/utils/*.gitkeep

+ 0 - 72
pom.xml

@@ -10,7 +10,6 @@
     <packaging>jar</packaging>
     <version>1.0</version>
     <description>运维系统ETL数据集合服务</description>
-    <url></url>
 
     <properties>
         <bladex.project.id>blade-api</bladex.project.id>
@@ -51,11 +50,8 @@
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
-
         </dependencies>
     </dependencyManagement>
-
-
     <dependencies>
         <!-- lombok -->
         <dependency>
@@ -63,7 +59,6 @@
             <artifactId>lombok</artifactId>
             <scope>provided</scope>
         </dependency>
-
         <dependency>
             <groupId>org.springblade</groupId>
             <artifactId>BladeX-Boot-Common</artifactId>
@@ -74,7 +69,6 @@
             <artifactId>BladeX-Boot-Base</artifactId>
             <version>${bladex.project.version}</version>
         </dependency>
-
         <dependency>
             <groupId>org.springframework.kafka</groupId>
             <artifactId>spring-kafka</artifactId>
@@ -100,66 +94,10 @@
             <artifactId>jersey-common</artifactId>
             <version>2.28</version>
         </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>easyexcel</artifactId>
-            <version>${revision}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>easyexcel-core</artifactId>
-            <version>${revision}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>easyexcel-support</artifactId>
-            <version>${revision}</version>
-        </dependency>
-
-        <!--<dependency>-->
-            <!--<groupId>org.apache.poi</groupId>-->
-            <!--<artifactId>poi</artifactId>-->
-            <!--<version>4.1.2</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.apache.poi</groupId>-->
-            <!--<artifactId>poi-ooxml</artifactId>-->
-            <!--<version>4.1.2</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.apache.poi</groupId>-->
-            <!--<artifactId>poi-ooxml-schemas</artifactId>-->
-            <!--<version>4.1.2</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.apache.poi</groupId>-->
-            <!--<artifactId>ooxml-schemas</artifactId>-->
-            <!--<version>1.4</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>com.alibaba</groupId>-->
-            <!--<artifactId>druid-spring-boot-starter</artifactId>-->
-        <!--</dependency>-->
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
         </dependency>
-        <!--<dependency>-->
-            <!--<groupId>com.oracle.database.jdbc</groupId>-->
-            <!--<artifactId>ojdbc8</artifactId>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.mybatis.spring.boot</groupId>-->
-            <!--<artifactId>mybatis-spring-boot-starter</artifactId>-->
-            <!--<version>2.2.0</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>com.baomidou</groupId>-->
-            <!--<artifactId>mybatis-plus-boot-starter</artifactId>-->
-        <!--</dependency>-->
-        <!--  websocket  -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-websocket</artifactId>
@@ -175,16 +113,6 @@
             <artifactId>blade-core-auto</artifactId>
             <version>2.9.1.RELEASE</version>
         </dependency>
-        <!--<dependency>-->
-            <!--<groupId>com.oracle</groupId>-->
-            <!--<artifactId>orai18n</artifactId>-->
-            <!--<version>11.2.0.4.0</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>oracle.jdbc</groupId>-->
-            <!--<artifactId>classes12-jdbc</artifactId>-->
-            <!--<version>1.2.0</version>-->
-        <!--</dependency>-->
     </dependencies>
 
     <build>

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

@@ -13,7 +13,6 @@ import org.springblade.core.tool.utils.ConcurrentDateFormat;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.enums.EtlModeEnum;
 import org.springblade.etl.entity.EtlGroundDataEntity;
-import org.springblade.etl.entity.EtlMvAttStBaseEntity;
 import org.springblade.etl.service.IEtlGroundDataService;
 import org.springblade.etl.service.IEtlMvAttStBaseService;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -92,11 +91,6 @@ public class EtlGroundDataTask implements Callable<Integer> {
                             Date lastDataTime = groundDataEntityList.get(groundDataEntityList.size() - 1).getTm();
                             ops.set(key, Func.formatDateTime(lastDataTime));
                             findCound += 1;
-                        } else {
-                            //没有新数据
-                            if (dto.getTm() == null) {
-                                //没有任何一条数据
-                            }
                         }
                     } else {
                         List<EtlGroundDataEntity> groundDataEntityList = etlGroundDataService.selectLastList(dto);
@@ -108,11 +102,6 @@ public class EtlGroundDataTask implements Callable<Integer> {
                             //更新时间
                             ops.set(key, Func.formatDateTime(lastGroundDataEntity.getFromDate()));
                             findCound += 1;
-                        } else {
-                            //没有新数据
-                            if (dto.getTm() == null) {
-                                //没有任何一条数据
-                            }
                         }
                     }
                 }

+ 22 - 23
src/main/java/org/springblade/etl/EtlTaskManager.java

@@ -13,7 +13,6 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.enums.EtlModeEnum;
 import org.springblade.etl.service.*;
 import org.springblade.modules.data.service.IWarnDataCacheService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.kafka.core.KafkaTemplate;
@@ -45,10 +44,10 @@ public class EtlTaskManager {
             0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), publicThreadFactory, new ThreadPoolExecutor.AbortPolicy());
 
 
-    @Autowired
+    @Resource
     private KafkaTemplate<String, String> kafkaTemplate;
 
-    @Autowired
+    @Resource
     private RedisTemplate redisTemplate;
 
     @Resource
@@ -87,32 +86,32 @@ public class EtlTaskManager {
     @Value("${spring.mq-topic.topic-etl-warn}")
     private String topicWarn;
 
-    public void submitRainDataEtlTask(int etlMode,String taskId) {
-        EtlRainDataTask rainDataTask = new EtlRainDataTask(etlMvAttStBaseService, etlRainDataService, redisTemplate, kafkaTemplate, topicRain, etlMode,taskId);
+    public void submitRainDataEtlTask(int etlMode, String taskId) {
+        EtlRainDataTask rainDataTask = new EtlRainDataTask(etlMvAttStBaseService, etlRainDataService, redisTemplate, kafkaTemplate, topicRain, etlMode, taskId);
         FutureTask<Integer> futureTask = new FutureTask<>(rainDataTask);
         publicThreadPool.execute(futureTask);
     }
 
-    public void submitRiverDataEtlTask(int etlMode,String taskId) {
-        EtlRiverDataTask riverDataTask = new EtlRiverDataTask(etlMvAttStBaseService, etlRiverDataService, redisTemplate, kafkaTemplate, topicRiver, etlMode,taskId);
+    public void submitRiverDataEtlTask(int etlMode, String taskId) {
+        EtlRiverDataTask riverDataTask = new EtlRiverDataTask(etlMvAttStBaseService, etlRiverDataService, redisTemplate, kafkaTemplate, topicRiver, etlMode, taskId);
         FutureTask<Integer> futureTask = new FutureTask<>(riverDataTask);
         publicThreadPool.execute(futureTask);
     }
 
-    public void submitRsvrDataEtlTask(int etlMode,String taskId) {
-        EtlRsvrDataTask rsvrDataTask = new EtlRsvrDataTask(etlMvAttStBaseService, etlRsvrDataService, redisTemplate, kafkaTemplate, topicRsvr, etlMode,taskId);
+    public void submitRsvrDataEtlTask(int etlMode, String taskId) {
+        EtlRsvrDataTask rsvrDataTask = new EtlRsvrDataTask(etlMvAttStBaseService, etlRsvrDataService, redisTemplate, kafkaTemplate, topicRsvr, etlMode, taskId);
         FutureTask<Integer> futureTask = new FutureTask<>(rsvrDataTask);
         publicThreadPool.execute(futureTask);
     }
 
-    public void submitWarnDataEtlTask(int etlMode,String taskId) {
-        EtlWarnDataTask warnDataTask = new EtlWarnDataTask(etlMvAttStBaseService, etlWarningService,warnDataService,redisTemplate, kafkaTemplate, topicWarn, etlMode,taskId);
+    public void submitWarnDataEtlTask(int etlMode, String taskId) {
+        EtlWarnDataTask warnDataTask = new EtlWarnDataTask(etlMvAttStBaseService, etlWarningService, warnDataService, redisTemplate, kafkaTemplate, topicWarn, etlMode, taskId);
         FutureTask<Integer> futureTask = new FutureTask<>(warnDataTask);
         publicThreadPool.execute(futureTask);
     }
 
-    public void submitGroundDataEtlTask(int etlMode,String taskId) {
-        EtlGroundDataTask groundDataTask = new EtlGroundDataTask(etlMvAttStBaseService, etlGroundDataService, redisTemplate, kafkaTemplate, topicGround, etlMode,taskId);
+    public void submitGroundDataEtlTask(int etlMode, String taskId) {
+        EtlGroundDataTask groundDataTask = new EtlGroundDataTask(etlMvAttStBaseService, etlGroundDataService, redisTemplate, kafkaTemplate, topicGround, etlMode, taskId);
         FutureTask<Integer> futureTask = new FutureTask<>(groundDataTask);
         publicThreadPool.execute(futureTask);
     }
@@ -125,8 +124,8 @@ public class EtlTaskManager {
     public void etlRainDataTask() {
         try {
             String id = Func.random(100);
-            log.info("ETL-雨情实时数据同步任务开始执行,{}",id);
-            this.submitRainDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(),id);
+            log.info("ETL-雨情实时数据同步任务开始执行,{}", id);
+            this.submitRainDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(), id);
         } catch (Exception e) {
             log.error("{}", e.getMessage());
         }
@@ -136,8 +135,8 @@ public class EtlTaskManager {
     public void etlRiverDataTask() {
         try {
             String id = Func.random(100);
-            log.info("ETL-河道水情实时数据同步任务开始执行,{}",id);
-            this.submitRiverDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(),id);
+            log.info("ETL-河道水情实时数据同步任务开始执行,{}", id);
+            this.submitRiverDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(), id);
         } catch (Exception e) {
             log.error("{}", e.getMessage());
         }
@@ -147,8 +146,8 @@ public class EtlTaskManager {
     public void etlRsvrDataTask() {
         try {
             String id = Func.random(100);
-            log.info("ETL-水库水情实时数据同步任务开始执行,{}",id);
-            this.submitRsvrDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(),id);
+            log.info("ETL-水库水情实时数据同步任务开始执行,{}", id);
+            this.submitRsvrDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(), id);
         } catch (Exception e) {
             log.error("{}", e.getMessage());
         }
@@ -158,8 +157,8 @@ public class EtlTaskManager {
     public void etlWarnDataTask() {
         try {
             String id = Func.random(100);
-            log.info("ETL-预警实时数据同步任务开始执行,{}",id);
-            this.submitWarnDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(),id);
+            log.info("ETL-预警实时数据同步任务开始执行,{}", id);
+            this.submitWarnDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(), id);
         } catch (Exception e) {
             log.error("{}", e.getMessage());
         }
@@ -169,8 +168,8 @@ public class EtlTaskManager {
     public void etlGroundDataTask() {
         try {
             String id = Func.random(100);
-            log.info("ETL-墒情实时数据同步任务开始执行,{}",id);
-            this.submitGroundDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(),id);
+            log.info("ETL-墒情实时数据同步任务开始执行,{}", id);
+            this.submitGroundDataEtlTask(EtlModeEnum.ETL_ONCE.getCode(), id);
         } catch (Exception e) {
             log.error("{}", e.getMessage());
         }

+ 93 - 57
src/main/java/org/springblade/etl/EtlWarnDataTask.java

@@ -67,91 +67,127 @@ public class EtlWarnDataTask implements Callable<Integer> {
             taskInfo.put("taskType", "rsvr");
             taskInfo.put("remark", "预警数据同步任务");
             taskInfo.put("taskExecuteTime", st);
-            //更新已抽取的数据
-            LambdaQueryWrapper<OriginalWarningInfoEntity> wrapper = Wrappers.<OriginalWarningInfoEntity>query().lambda();
-            wrapper.ne(OriginalWarningInfoEntity::getReviewStatus, "1");
-            wrapper.eq(OriginalWarningInfoEntity::getType, "4");
-            List<OriginalWarningInfoEntity> originalWarningInfoEntities = warnDataCacheService.list(wrapper);
-            if (Func.notNull(originalWarningInfoEntities)) {
+            //因为预警数据会动态更新,所以需要更新已抽取的数据,只更新未关闭的预警数据
+            OriginalWarningInfoEntity dto = new OriginalWarningInfoEntity();
+            dto.setType("4");
+            dto.setReviewStatus("1");
+            List<OriginalWarningInfoEntity> originalWarningInfoEntities = warnDataCacheService.selectWarningList(dto);
+            if (Func.notNull(originalWarningInfoEntities) && originalWarningInfoEntities.size() > 0) {
                 for (OriginalWarningInfoEntity entity : originalWarningInfoEntities) {
+                    //读取源数据库的预警信息
                     EtlWarningInfoDTO warningInfoDTO = new EtlWarningInfoDTO();
                     warningInfoDTO.setWarnId(entity.getWarnId());
                     EtlWarningInfoEntity etlWarningInfoEntity = etlWarningService.getByWarnId(warningInfoDTO);
                     if (Func.notNull(etlWarningInfoEntity)) {
+                        entity.setWarnTime(etlWarningInfoEntity.getWarnTime());
                         entity.setWarnInfo(etlWarningInfoEntity.getWarnInfo());
                         entity.setWarnStatus(etlWarningInfoEntity.getWarnStatus());
                         entity.setReviewStatus(etlWarningInfoEntity.getReviewStatus());
-                        entity.setUpdateTime(etlWarningInfoEntity.getOriginalUpdateTime());
                         warnDataCacheService.updateById(entity);
                     }
                 }
+                log.info("更新已抽取的未关闭预警数据共{}条", originalWarningInfoEntities.size());
             }
-            //抽取最新数据
+            //抽取源数据库最新数据,默认同步所有的数据
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTimeInMillis(st);
             EtlWarningInfoDTO etlWarningInfoDTO = new EtlWarningInfoDTO();
+            Date etlUpdateTime = calendar.getTime();
             ValueOperations<String, String> ops = redisTemplate.opsForValue();
-            String key = "etl.warn.updatetime";
+            String key = "etl.warn.etl.updatetime";
             if (redisTemplate.hasKey(key)) {
                 String lastUpdateTime = ops.get(key);
-                Date ut = Func.parse(lastUpdateTime, ConcurrentDateFormat.of("yyyy-MM-dd HH:mm:ss"));
-                etlWarningInfoDTO.setLastTime(ut);
-            } else {
-                //没有数据,同步最近24小时
-                Calendar calendar = Calendar.getInstance();
-                calendar.set(Calendar.DAY_OF_MONTH, -1);
-                etlWarningInfoDTO.setLastTime(calendar.getTime());
+                if (Func.notNull(lastUpdateTime)) {
+                    etlUpdateTime = Func.parse(lastUpdateTime, ConcurrentDateFormat.of("yyyy-MM-dd HH:mm:ss"));
+                    etlWarningInfoDTO.setLastTime(etlUpdateTime);
+                }
             }
             etlWarningInfoDTO.setReviewStatus("1");
             etlWarningInfoDTO.setType("4");
+            //只抽取新创建的数据,更新的数据不在此部分处理
             List<EtlWarningInfoEntity> updateList = etlWarningService.selectNewList(etlWarningInfoDTO);
-            if (Func.notNull(updateList)) {
+            if (Func.notNull(updateList) && updateList.size() > 0) {
                 for (EtlWarningInfoEntity entity : updateList) {
-                    OriginalWarningInfoEntity warnInfo = new OriginalWarningInfoEntity();
-                    warnInfo.setWarnId(entity.getWarnId());
-                    warnInfo.setStcd(entity.getStcd());
-                    warnInfo.setWarnName(entity.getWarnName());
-                    warnInfo.setWarnTime(entity.getWarnTime());
-                    warnInfo.setWarnLevelCode(entity.getWarnLevelCode());
-                    warnInfo.setWarnInfo(entity.getWarnInfo());
-                    warnInfo.setWarnStatus(entity.getWarnStatus());
-                    warnInfo.setReviewStatus(entity.getReviewStatus());
-                    warnInfo.setType(entity.getType());
-                    warnInfo.setRainWarnRate(entity.getRainWarnRate());
-                    warnInfo.setWarnSort(entity.getWarnSort());
-                    warnInfo.setWarnLocation(entity.getWarnLocation());
-                    warnInfo.setWarnAdcd(entity.getWarnAdcd());
-                    warnInfo.setUserAdcd(entity.getUserAdcd());
-                    warnInfo.setWarnLgtd(entity.getWarnLgtd());
-                    warnInfo.setWarnLttd(entity.getWarnLttd());
-                    warnInfo.setIntv(entity.getIntv());
-                    warnInfo.setDrp(entity.getDrp());
-                    warnInfo.setZ(entity.getZ());
-                    warnInfo.setQ(entity.getQ());
-                    warnInfo.setWptn(entity.getWptn());
-                    warnInfo.setRz(entity.getRz());
-                    warnInfo.setRwptn(entity.getRwptn());
-                    warnInfo.setInq(entity.getInq());
-                    warnInfo.setRelWarnId(entity.getRelWarnId());
-                    warnInfo.setCreateTime(entity.getOriginalCreateTime());
-                    warnInfo.setUpdateTime(entity.getOriginalUpdateTime());
-                    warnDataCacheService.save(warnInfo);
+                    LambdaQueryWrapper<OriginalWarningInfoEntity> wrapper = Wrappers.<OriginalWarningInfoEntity>query().lambda();
+                    wrapper.eq(OriginalWarningInfoEntity::getWarnId, entity.getWarnId());
+                    wrapper.last("limit 1");
+                    OriginalWarningInfoEntity detail = warnDataCacheService.getOne(wrapper);
+                    if (Func.isNull(detail)) {
+                        OriginalWarningInfoEntity warnInfo = new OriginalWarningInfoEntity();
+                        warnInfo.setWarnId(entity.getWarnId());
+                        warnInfo.setStcd(entity.getStcd());
+                        warnInfo.setWarnName(entity.getWarnName());
+                        warnInfo.setWarnTime(entity.getWarnTime());
+                        warnInfo.setWarnLevelCode(entity.getWarnLevelCode());
+                        warnInfo.setWarnInfo(entity.getWarnInfo());
+                        warnInfo.setWarnStatus(entity.getWarnStatus());
+                        warnInfo.setReviewStatus(entity.getReviewStatus());
+                        warnInfo.setType(entity.getType());
+                        warnInfo.setRainWarnRate(entity.getRainWarnRate());
+                        warnInfo.setWarnSort(entity.getWarnSort());
+                        warnInfo.setWarnLocation(entity.getWarnLocation());
+                        warnInfo.setWarnAdcd(entity.getWarnAdcd());
+                        warnInfo.setUserAdcd(entity.getUserAdcd());
+                        warnInfo.setWarnLgtd(entity.getWarnLgtd());
+                        warnInfo.setWarnLttd(entity.getWarnLttd());
+                        warnInfo.setIntv(entity.getIntv());
+                        warnInfo.setDrp(entity.getDrp());
+                        warnInfo.setZ(entity.getZ());
+                        warnInfo.setQ(entity.getQ());
+                        warnInfo.setWptn(entity.getWptn());
+                        warnInfo.setRz(entity.getRz());
+                        warnInfo.setRwptn(entity.getRwptn());
+                        warnInfo.setInq(entity.getInq());
+                        warnInfo.setRelWarnId(entity.getRelWarnId());
+                        warnDataCacheService.save(warnInfo);
+                    } else {
+                        detail.setWarnTime(entity.getWarnTime());
+                        detail.setWarnInfo(entity.getWarnInfo());
+                        detail.setWarnStatus(entity.getWarnStatus());
+                        if(Func.isNull(entity.getReviewStatus())){
+                            detail.setReviewStatus("0");
+                        }else {
+                            detail.setReviewStatus(entity.getReviewStatus());
+                        }
+                        warnDataCacheService.updateById(detail);
+                    }
+                    Date warnTime = entity.getWarnTime();
+                    if (warnTime.after(etlUpdateTime)) {
+                        etlUpdateTime = warnTime;
+                    }
+                }
+                //更新抽取同步时间
+                ops.set(key, Func.formatDateTime(etlUpdateTime));
+                log.info("抽取预警数据共{}条", updateList.size());
+            }
+            //推送到业务系统,任何有修改过的数据都需要进行同步
+            dto = new OriginalWarningInfoEntity();
+            Date ywxtUpdateTime = calendar.getTime();
+            key = "etl.warn.ywxt.updatetime";
+            if (redisTemplate.hasKey(key)) {
+                //同步最新有变化的数据
+                String lastUpdateTime = ops.get(key);
+                if (Func.notNull(lastUpdateTime)) {
+                    ywxtUpdateTime = Func.parse(lastUpdateTime, ConcurrentDateFormat.of("yyyy-MM-dd HH:mm:ss"));
+                    dto.setUpdateTime(ywxtUpdateTime);
                 }
             }
-            //推送到业务系统
-            wrapper = Wrappers.<OriginalWarningInfoEntity>query().lambda();
-            wrapper.eq(OriginalWarningInfoEntity::getIsDeleted, 0);
-            wrapper.ne(OriginalWarningInfoEntity::getReviewStatus, "1");
-            wrapper.eq(OriginalWarningInfoEntity::getType, "4");
-            originalWarningInfoEntities = warnDataCacheService.list(wrapper);
-            if (Func.notNull(originalWarningInfoEntities)) {
+            originalWarningInfoEntities = warnDataCacheService.selectWarningList(dto);
+            if (Func.notNull(originalWarningInfoEntities) && originalWarningInfoEntities.size() > 0) {
                 for (OriginalWarningInfoEntity entity : originalWarningInfoEntities) {
                     //通过KAFKA发送最新一条数据
                     String jsonText = JSONObject.toJSONString(entity);
-                    log.info("warn info {}", jsonText);
-                    // kafkaTemplate.send(topic, jsonText);
+                    //log.info("warn info {}", jsonText);
+                    kafkaTemplate.send(topic, jsonText);
+                    Date updateTime = entity.getUpdateTime();
+                    if (updateTime.after(ywxtUpdateTime)) {
+                        ywxtUpdateTime = updateTime;
+                    }
                 }
+                //更新运维系统同步时间
+                ops.set(key, Func.formatDateTime(ywxtUpdateTime));
+                log.info("推送预警数据共{}条", originalWarningInfoEntities.size());
             }
-            //更新缓存时间
-            ops.set(key, Func.formatDateTime(etlWarningInfoDTO.getLastTime()));
             //提交任务运行状态
             long et = System.currentTimeMillis();
             taskInfo.put("taskExecuteLong", et - st);

+ 9 - 8
src/main/java/org/springblade/etl/mapper/EtlWarningInfoMapper.xml

@@ -34,35 +34,36 @@
         <result column="UPDATE_TIME" property="originalUpdateTime"/>
     </resultMap>
 
-
+    <!--SELECT_ZHSL_USER-->
     <select id="selectNewList" resultMap="etlWarningInfoEntityResultMap">
         SELECT
         d.*
         FROM
-        SL_ZHSL_NM_EXTRA.ST_WARN_INFO d
+        ST_WARN_INFO d
         WHERE 1=1
         <if test="dto.reviewStatus!=null">
-            and d.REVIEW_STATUS != #{dto.reviewStatus}
+            and (d.REVIEW_STATUS is null or d.REVIEW_STATUS != #{dto.reviewStatus})
         </if>
         <if test="dto.type!=null">
             and d.TYPE = #{dto.type}
         </if>
         <if test="dto.lastTime!=null">
-            and d.CREATE_TIME > #{dto.lastTime}
+            and d.WARN_TIME > #{dto.lastTime}
         </if>
-        order by d.CREATE_TIME
+        order by d.WARN_TIME
     </select>
 
     <select id="getByWarnId" resultMap="etlWarningInfoEntityResultMap">
-        SELECT
+        SELECT * FROM
+        (SELECT
         d.*
         FROM
-        SL_ZHSL_NM_EXTRA.ST_WARN_INFO d
+        ST_WARN_INFO d
         WHERE 1=1
         <if test="dto.warnId!=null">
             and d.ID = #{dto.warnId}
         </if>
-        order by d.CREATE_TIME
+        order by d.CREATE_TIME)
         WHERE ROWNUM &lt;= 1
     </select>
 

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

@@ -6,6 +6,7 @@
  */
 package org.springblade.etl.service.impl;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.etl.dto.EtlWarningInfoDTO;
 import org.springblade.etl.entity.EtlWarningInfoEntity;
@@ -26,6 +27,7 @@ import java.util.List;
  * Remark:认为有必要的其他信息
  */
 @Service
+@DS("oracle_2")
 public class EtlWarningServiceImpl extends BaseServiceImpl<EtlWarningInfoMapper, EtlWarningInfoEntity> implements IEtlWarningService {
 
     @Override

+ 0 - 180
src/main/java/org/springblade/modules/business/desk/controller/NoticeController.java

@@ -1,180 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import com.github.xiaoymin.knife4j.annotations.ApiSort;
-import io.swagger.annotations.*;
-import lombok.AllArgsConstructor;
-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.tenant.annotation.TenantDS;
-import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-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.desk.vo.NoticeVO;
-import org.springblade.modules.business.desk.wrapper.NoticeWrapper;
-import org.springframework.web.bind.annotation.*;
-import springfox.documentation.annotations.ApiIgnore;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 控制器
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author admin
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-@TenantDS
-@RestController
-@RequestMapping(AppConstant.APPLICATION_DESK_NAME+ "/notice")
-@AllArgsConstructor
-@ApiSort(2)
-@Api(value = "通知公告", tags = "通知公告")
-public class NoticeController extends BladeController {
-
-	private final INoticeService noticeService;
-	private final INoticeViewService noticeViewService;
-
-	/**
-	 * 详情
-	 */
-	@GetMapping("/detail")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入notice")
-	public R<NoticeVO> detail(NoticeEntity noticeEntity) {
-		NoticeEntity detail = noticeService.getOne(Condition.getQueryWrapper(noticeEntity));
-		return R.data(NoticeWrapper.build().entityVO(detail));
-	}
-
-	/**
-	 * 分页
-	 */
-	@GetMapping("/list")
-//	@ApiImplicitParams({
-//		@ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
-//		@ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
-//	})
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页", notes = "传入notice")
-	public R<List<NoticeVO>> list() {
-		LambdaQueryWrapper<NoticeEntity> wrapper = Wrappers.<NoticeEntity>query().lambda();
-		wrapper.orderByDesc(NoticeEntity::getReleaseTime);
-		List<NoticeEntity> pages = noticeService.list(wrapper);
-		return R.data(NoticeWrapper.build().listVO(pages));
-	}
-
-	/**
-	 * 多表联合查询自定义分页
-	 */
-	@GetMapping("/page")
-	@ApiImplicitParams({
-		@ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
-		@ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
-	})
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "分页", notes = "传入notice")
-	public R<IPage<NoticeVO>> page(@ApiIgnore NoticeVO notice, Query query) {
-		IPage<NoticeVO> pages = noticeService.selectNoticePage(Condition.getPage(query), notice);
-		return R.data(pages);
-	}
-
-	/**
-	 * 新增
-	 */
-	@PostMapping("/save")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入notice")
-	public R save(@RequestBody NoticeEntity noticeEntity) {
-		return R.status(noticeService.save(noticeEntity));
-	}
-
-	/**
-	 * 修改
-	 */
-	@PostMapping("/update")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "修改", notes = "传入notice")
-	public R update(@RequestBody NoticeEntity noticeEntity) {
-		return R.status(noticeService.updateById(noticeEntity));
-	}
-
-
-	@PostMapping("/view")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "查阅")
-	public R userView() {
-
-		BladeUser user = AuthUtil.getUser();
-		LambdaQueryWrapper<NoticeViewEntity> wrapper = Wrappers.<NoticeViewEntity>query().lambda();
-		wrapper.eq(NoticeViewEntity::getCreateUser,user.getUserId());
-		wrapper.eq(NoticeViewEntity::getIsDeleted,0);
-		NoticeViewEntity entity=noticeViewService.getOne(wrapper);
-		if (null != entity){
-			entity.setViewTime(new Date());
-		}else{
-			entity= new NoticeViewEntity();
-			entity.setViewTime(new Date());
-
-		}
-		noticeViewService.saveOrUpdate(entity);
-
-		return R.success("OK");
-	}
-
-
-	/**
-	 * 新增或修改
-	 */
-	@PostMapping("/submit")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "新增或修改", notes = "传入notice")
-	public R submit(@RequestBody NoticeEntity noticeEntity) {
-		return R.status(noticeService.saveOrUpdate(noticeEntity));
-	}
-
-	/**
-	 * 删除
-	 */
-	@PostMapping("/remove")
-	@ApiOperationSupport(order = 7)
-	@ApiOperation(value = "逻辑删除", notes = "传入notice")
-	public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
-		boolean temp = noticeService.deleteLogic(Func.toLongList(ids));
-		return R.status(temp);
-	}
-
-	/**
-	 * 查询最新的数据
-	 */
-	@GetMapping("/last/list")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页")
-	public R<List<NoticeVO>> lastList() {
-		LambdaQueryWrapper<NoticeEntity> wrapper = Wrappers.<NoticeEntity>query().lambda();
-		wrapper.orderByDesc(NoticeEntity::getCreateTime);
-		List<NoticeEntity> pages = noticeService.list(wrapper);
-		return R.data(NoticeWrapper.build().listVO(pages));
-	}
-
-}

+ 0 - 28
src/main/java/org/springblade/modules/business/desk/dto/NoticeDTO.java

@@ -1,28 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.dto;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 模型DTO
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author admin
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class NoticeDTO extends NoticeEntity {
-
-	private static final long serialVersionUID = 1L;
-
-}

+ 0 - 62
src/main/java/org/springblade/modules/business/desk/entity/NoticeEntity.java

@@ -1,62 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.springblade.core.mp.base.BaseEntity;
-import org.springblade.core.tenant.mp.TenantEntity;
-
-import java.util.Date;
-
-/**
- * 实体类
- *
- * @author Chill
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("blade_notice")
-public class NoticeEntity extends BaseEntity {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 租户ID
-	 */
-	@ApiModelProperty("租户ID")
-	private String tenantId;
-
-
-	/**
-	 * 标题
-	 */
-	@ApiModelProperty(value = "标题")
-	private String title;
-
-	/**
-	 * 通知类型
-	 */
-	@ApiModelProperty(value = "通知类型")
-	private Integer category;
-
-	/**
-	 * 发布日期
-	 */
-	@ApiModelProperty(value = "发布日期")
-	private Date releaseTime;
-
-	/**
-	 * 内容
-	 */
-	@ApiModelProperty(value = "内容")
-	private String content;
-
-
-}

+ 0 - 42
src/main/java/org/springblade/modules/business/desk/entity/NoticeViewEntity.java

@@ -1,42 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.springblade.core.mp.base.BaseEntity;
-
-import java.util.Date;
-
-/**
- * 实体类
- *
- * @author Chill
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("blade_notice_view")
-public class NoticeViewEntity extends BaseEntity {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 租户ID
-	 */
-	@ApiModelProperty("租户ID")
-	private String tenantId;
-
-
-	/**
-	 * 查阅日期
-	 */
-	@ApiModelProperty(value = "查阅日期")
-	private Date viewTime;
-
-}

+ 0 - 48
src/main/java/org/springblade/modules/business/desk/mapper/NoticeMapper.java

@@ -1,48 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.lettuce.core.dynamic.annotation.Param;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-import org.springblade.modules.business.desk.vo.NoticeVO;
-
-import java.util.Date;
-import java.util.List;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 Mapper 接口
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author admin
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-public interface NoticeMapper extends BaseMapper<NoticeEntity> {
-
-	/**
-	 * 前N条数据
-	 *
-	 * @param number 数量
-	 * @return List<Notice>
-	 */
-	List<NoticeEntity> topList(Integer number);
-
-	/**
-	 * 自定义分页
-	 *
-	 * @param page   分页
-	 * @param notice 实体
-	 * @return List<NoticeVO>
-	 */
-	List<NoticeVO> selectNoticePage(IPage page, NoticeVO notice);
-
-
-	 Long unviewNoticeCount(@Param("viewDate") Date viewDate);
-}

+ 0 - 65
src/main/java/org/springblade/modules/business/desk/mapper/NoticeMapper.xml

@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.springblade.modules.business.desk.mapper.NoticeMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="noticeResultMap" type="org.springblade.modules.business.desk.entity.NoticeEntity">
-        <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="release_time" property="releaseTime"/>
-        <result column="title" property="title"/>
-        <result column="content" property="content"/>
-    </resultMap>
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="noticeVOResultMap" type="org.springblade.modules.business.desk.vo.NoticeVO">
-        <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="release_time" property="releaseTime"/>
-        <result column="title" property="title"/>
-        <result column="content" property="content"/>
-    </resultMap>
-
-    <select id="topList" resultMap="noticeResultMap">
-        select * from blade_notice limit #{number}
-    </select>
-
-    <select id="selectNoticePage" resultMap="noticeVOResultMap">
-        SELECT
-        n.*,
-        d.dict_value AS categoryName
-        FROM
-        blade_notice n
-        LEFT JOIN ( SELECT * FROM blade_dict WHERE CODE = 'noticeEntity' ) d ON n.category = d.dict_key
-        WHERE
-        n.is_deleted = 0 and n.tenant_id = #{noticeEntity.tenantId}
-        <if test="noticeEntity.title!=null">
-            and n.title like concat(concat('%', #{noticeEntity.title}), '%')
-        </if>
-        <if test="noticeEntity.category!=null">
-            and n.category = #{noticeEntity.category}
-        </if>
-    </select>
-
-    <select id="unviewNoticeCount" resultType="java.lang.Long">
-        SELECT
-        count(*)
-        FROM
-        blade_notice n
-        WHERE
-        n.is_deleted = 0
-        <if test="viewDate!=null">
-            and n.release_time > #{viewDate}
-        </if>
-    </select>
-</mapper>

+ 0 - 30
src/main/java/org/springblade/modules/business/desk/mapper/NoticeViewMapper.java

@@ -1,30 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-import org.springblade.modules.business.desk.entity.NoticeViewEntity;
-import org.springblade.modules.business.desk.vo.NoticeVO;
-
-import java.util.List;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 Mapper 接口
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author admin
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-public interface NoticeViewMapper extends BaseMapper<NoticeViewEntity> {
-
-
-
-}

+ 0 - 18
src/main/java/org/springblade/modules/business/desk/mapper/NoticeViewMapper.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.springblade.modules.business.desk.mapper.NoticeViewMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="noticeResultMap" type="org.springblade.modules.business.desk.entity.NoticeViewEntity">
-        <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="view_time" property="viewTime"/>
-
-    </resultMap>
-
-</mapper>

+ 0 - 36
src/main/java/org/springblade/modules/business/desk/service/INoticeService.java

@@ -1,36 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.core.mp.base.BaseService;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-import org.springblade.modules.business.desk.vo.NoticeVO;
-
-import java.util.Date;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 服务类
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author liu-nan
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-public interface INoticeService extends BaseService<NoticeEntity> {
-
-	/**
-	 * 自定义分页
-	 * @param page
-	 * @param notice
-	 * @return
-	 */
-	IPage<NoticeVO> selectNoticePage(IPage<NoticeVO> page, NoticeVO notice);
-
-	Long unviewNoticeCount(Date viewDate);
-}

+ 0 - 27
src/main/java/org/springblade/modules/business/desk/service/INoticeViewService.java

@@ -1,27 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.core.mp.base.BaseService;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-import org.springblade.modules.business.desk.entity.NoticeViewEntity;
-import org.springblade.modules.business.desk.vo.NoticeVO;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 服务类
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author liu-nan
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-public interface INoticeViewService extends BaseService<NoticeViewEntity> {
-
-
-}

+ 0 - 44
src/main/java/org/springblade/modules/business/desk/service/impl/NoticeServiceImpl.java

@@ -1,44 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.core.mp.base.BaseServiceImpl;
-import org.springblade.core.secure.utils.AuthUtil;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-import org.springblade.modules.business.desk.mapper.NoticeMapper;
-import org.springblade.modules.business.desk.service.INoticeService;
-import org.springblade.modules.business.desk.vo.NoticeVO;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 服务实现类
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author liu-nan
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-@Service
-public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, NoticeEntity> implements INoticeService {
-
-	@Override
-	public IPage<NoticeVO> selectNoticePage(IPage<NoticeVO> page, NoticeVO notice) {
-		// 若不使用mybatis-plus自带的分页方法,则不会自动带入tenantId,所以我们需要自行注入
-		notice.setTenantId(AuthUtil.getTenantId());
-		return page.setRecords(baseMapper.selectNoticePage(page, notice));
-	}
-
-	@Override
-	public Long unviewNoticeCount(Date viewDate) {
-		return baseMapper.unviewNoticeCount(viewDate);
-	}
-
-}

+ 0 - 35
src/main/java/org/springblade/modules/business/desk/service/impl/NoticeViewServiceImpl.java

@@ -1,35 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.core.mp.base.BaseServiceImpl;
-import org.springblade.core.secure.utils.AuthUtil;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-import org.springblade.modules.business.desk.entity.NoticeViewEntity;
-import org.springblade.modules.business.desk.mapper.NoticeMapper;
-import org.springblade.modules.business.desk.mapper.NoticeViewMapper;
-import org.springblade.modules.business.desk.service.INoticeService;
-import org.springblade.modules.business.desk.service.INoticeViewService;
-import org.springblade.modules.business.desk.vo.NoticeVO;
-import org.springframework.stereotype.Service;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 服务实现类
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author liu-nan
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-@Service
-public class NoticeViewServiceImpl extends BaseServiceImpl<NoticeViewMapper, NoticeViewEntity> implements INoticeViewService {
-
-
-
-}

+ 0 - 33
src/main/java/org/springblade/modules/business/desk/vo/NoticeVO.java

@@ -1,33 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.vo;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 模型VO
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author admin
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class NoticeVO extends NoticeEntity {
-
-	@ApiModelProperty(value = "通知类型名")
-	private String categoryName;
-
-	@ApiModelProperty(value = "租户编号")
-	private String tenantId;
-
-}

+ 0 - 58
src/main/java/org/springblade/modules/business/desk/wrapper/NoticeWrapper.java

@@ -1,58 +0,0 @@
-/**
- * Copyright
- * All right reserved.
- * 项目名称:
- * 创建日期:2022/3/9
- */
-package org.springblade.modules.business.desk.wrapper;
-
-import org.springblade.common.cache.DictCache;
-import org.springblade.common.enums.DictEnum;
-import org.springblade.core.mp.support.BaseEntityWrapper;
-import org.springblade.core.tool.utils.BeanUtil;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.modules.business.desk.entity.NoticeEntity;
-import org.springblade.modules.business.desk.vo.NoticeVO;
-
-import java.util.Map;
-import java.util.Objects;
-
-/***
- * Date:2022-03-08
- * Title:通知公告 包装类,返回视图层所需的字段
- * Description:对本文件的详细描述,原则上不能少于30字
- * @author admin
- * @mender:(文件的修改者,文件创建者之外的人)
- * @version 1.0
- * Remark:认为有必要的其他信息
- */
-public class NoticeWrapper extends BaseEntityWrapper<NoticeEntity, NoticeVO> {
-
-	public static NoticeWrapper build() {
-		return new NoticeWrapper();
-	}
-
-	@Override
-	public NoticeVO entityVO(NoticeEntity noticeEntity) {
-		NoticeVO noticeVO = Objects.requireNonNull(BeanUtil.copy(noticeEntity, NoticeVO.class));
-		String dictValue = DictCache.getValue(DictEnum.NOTICE, noticeVO.getCategory());
-		noticeVO.setCategoryName(dictValue);
-		return noticeVO;
-	}
-
-	/**
-	 * 查询条件处理
-	 */
-	public void noticeQuery(Map<String, Object> notice) {
-		// 此场景仅在 pg数据库 map类型传参的情况下需要处理,entity传参已经包含数据类型,则无需关心
-		// 针对 pg数据库 int类型字段查询需要强转的处理示例
-		String searchKey = "category";
-		if (Func.isNotEmpty(notice.get(searchKey))) {
-			// 数据库字段为int类型,设置"="查询,具体查询参数请见 @org.springblade.core.mp.support.SqlKeyword
-			notice.put(searchKey.concat("_equal"), Func.toInt(notice.get(searchKey)));
-			// 默认"like"查询,pg数据库 场景会报错,所以将其删除
-			notice.remove(searchKey);
-		}
-	}
-
-}

+ 4 - 1
src/main/java/org/springblade/modules/data/mapper/WarnDataCacheMapper.java

@@ -7,8 +7,11 @@
 package org.springblade.modules.data.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 import org.springblade.modules.data.entity.OriginalWarningInfoEntity;
 
+import java.util.List;
+
 
 /***
  * Date:2022/8/24
@@ -19,5 +22,5 @@ import org.springblade.modules.data.entity.OriginalWarningInfoEntity;
  * Remark:认为有必要的其他信息
  */
 public interface WarnDataCacheMapper extends BaseMapper<OriginalWarningInfoEntity> {
-
+    List<OriginalWarningInfoEntity> selectWarningList(@Param("dto") OriginalWarningInfoEntity dto);
 }

+ 18 - 1
src/main/java/org/springblade/modules/data/mapper/WarnDataCacheMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="org.springblade.modules.data.mapper.WarnDataCacheMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="etlWarningInfoEntityResultMap" type="org.springblade.modules.data.entity.OriginalWarningInfoEntity">
+    <resultMap id="warningInfoEntityResultMap" type="org.springblade.modules.data.entity.OriginalWarningInfoEntity">
         <result column="warn_id" property="warnId"/>
         <result column="stcd" property="stcd"/>
         <result column="warn_name" property="warnName"/>
@@ -32,4 +32,21 @@
         <result column="rel_warn_id" property="relWarnId"/>
     </resultMap>
 
+    <select id="selectWarningList" resultMap="warningInfoEntityResultMap">
+        SELECT
+        n.*
+        FROM
+        etl_st_warning_info n
+        WHERE 1=1
+        <if test="dto.reviewStatus!=null">
+            and (n.review_status is null or n.review_status != #{dto.reviewStatus})
+        </if>
+        <if test="dto.type!=null">
+            and n.type = #{dto.type}
+        </if>
+        <if test="dto.updateTime!=null">
+            and n.update_time > #{dto.updateTime}
+        </if>
+        order by n.update_time
+    </select>
 </mapper>

+ 3 - 1
src/main/java/org/springblade/modules/data/service/IWarnDataCacheService.java

@@ -6,9 +6,11 @@
  */
 package org.springblade.modules.data.service;
 
+
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.modules.data.entity.OriginalWarningInfoEntity;
 
+import java.util.List;
 
 
 /***
@@ -20,5 +22,5 @@ import org.springblade.modules.data.entity.OriginalWarningInfoEntity;
  * Remark:认为有必要的其他信息
  */
 public interface IWarnDataCacheService extends BaseService<OriginalWarningInfoEntity> {
-
+    List<OriginalWarningInfoEntity> selectWarningList(OriginalWarningInfoEntity dto);
 }

+ 6 - 0
src/main/java/org/springblade/modules/data/service/impl/WarnDataCacheServiceImpl.java

@@ -12,6 +12,8 @@ import org.springblade.modules.data.mapper.WarnDataCacheMapper;
 import org.springblade.modules.data.service.IWarnDataCacheService;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 
 /***
  * Date:2022/9/8
@@ -24,4 +26,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class WarnDataCacheServiceImpl extends BaseServiceImpl<WarnDataCacheMapper, OriginalWarningInfoEntity> implements IWarnDataCacheService {
 
+    @Override
+    public List<OriginalWarningInfoEntity> selectWarningList(OriginalWarningInfoEntity dto) {
+        return baseMapper.selectWarningList(dto);
+    }
 }

+ 123 - 0
src/main/java/org/springblade/modules/warn/controller/WarnInfoController.java

@@ -0,0 +1,123 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2023/4/26
+ */
+package org.springblade.modules.warn.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.etl.dto.EtlWarningInfoDTO;
+import org.springblade.etl.entity.EtlWarningInfoEntity;
+import org.springblade.etl.service.IEtlWarningService;
+import org.springblade.modules.warn.entity.InsideWarnInfoEntity;
+import org.springblade.modules.warn.entity.OutsideWarnInfoEntity;
+import org.springblade.modules.warn.entity.OutsideWarnTimeEntity;
+import org.springblade.modules.warn.entity.WarnResponseInfoEntity;
+import org.springblade.modules.warn.service.IInsideWarnInfoService;
+import org.springblade.modules.warn.service.IOutsideWarnInfoService;
+import org.springblade.modules.warn.service.IOutsideWarnTimeService;
+import org.springblade.modules.warn.service.IWarnResponseInfoService;
+import org.springblade.modules.warn.vo.WarnDetailInfoVO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+/***
+ * Date:2023/4/26
+ * Title:ETL接口
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@RestController
+@RequestMapping("galaxy-business/warn")
+@AllArgsConstructor
+@Api(value = "宏图预警信息查询接口", tags = "直接从宏图数据库查询")
+@Slf4j
+public class WarnInfoController extends BladeController {
+    @Resource
+    private IEtlWarningService etlWarningService;
+
+    @Resource
+    private IInsideWarnInfoService insideWarnInfoService;
+
+    @Resource
+    private IOutsideWarnTimeService outsideWarnTimeService;
+
+    @Resource
+    private IOutsideWarnInfoService outsideWarnInfoService;
+
+    @Resource
+    private IWarnResponseInfoService warnResponseInfoService;
+
+    @GetMapping("/detail/{warnId}")
+    @ApiOperationSupport(order = 1)
+    public R<WarnDetailInfoVO> getWarnDetail(@PathVariable(name = "warnId") String warnId) {
+        if (Func.isNull(warnId)) {
+            return R.fail("参数错误");
+        }
+        WarnDetailInfoVO vo = new WarnDetailInfoVO();
+        vo.setWarnId(warnId);
+        EtlWarningInfoDTO etlWarningInfoDTO = new EtlWarningInfoDTO();
+        etlWarningInfoDTO.setWarnId(warnId);
+        EtlWarningInfoEntity etlWarningInfoEntity = etlWarningService.getByWarnId(etlWarningInfoDTO);
+        if (Func.isNull(etlWarningInfoEntity)) {
+            return R.fail("查询失败");
+        }
+        vo.setWarnName(etlWarningInfoEntity.getWarnName());
+        vo.setWarnTime(etlWarningInfoEntity.getWarnTime());
+        vo.setWarnInfo(etlWarningInfoEntity.getWarnInfo());
+
+        InsideWarnInfoEntity insideWarnInfoDTO = new InsideWarnInfoEntity();
+        insideWarnInfoDTO.setWarnId(warnId);
+        List<InsideWarnInfoEntity> insideWarnInfoEntityList = insideWarnInfoService.selectList(insideWarnInfoDTO);
+        if (Func.notNull(insideWarnInfoEntityList)) {
+            vo.setInsideWarnInfoList(insideWarnInfoEntityList);
+        } else {
+            vo.setInsideWarnInfoList(new ArrayList<>(0));
+        }
+
+        OutsideWarnTimeEntity outsideWarnTimeDTO = new OutsideWarnTimeEntity();
+        outsideWarnTimeDTO.setWarnId(warnId);
+        List<OutsideWarnTimeEntity> outsideWarnTimeEntityList = outsideWarnTimeService.selectList(outsideWarnTimeDTO);
+        if (Func.notNull(outsideWarnTimeEntityList) && outsideWarnTimeEntityList.size() > 0) {
+            vo.setOusideWarnStatus(1);
+            vo.setExtTime(outsideWarnTimeEntityList.get(0).getExtTime());
+        } else {
+            vo.setOusideWarnStatus(0);
+        }
+        if (vo.getOusideWarnStatus() == 1) {
+            OutsideWarnInfoEntity outsideWarnInfoDTO = new OutsideWarnInfoEntity();
+            outsideWarnInfoDTO.setWarnId(warnId);
+            List<OutsideWarnInfoEntity> outsideWarnInfoEntityList = outsideWarnInfoService.selectList(outsideWarnInfoDTO);
+            if (Func.notNull(outsideWarnInfoEntityList)) {
+                vo.setOutsideWarnInfoList(outsideWarnInfoEntityList);
+            } else {
+                vo.setOutsideWarnInfoList(new ArrayList<>(0));
+            }
+        }
+
+        WarnResponseInfoEntity warnResponseInfoDTO = new WarnResponseInfoEntity();
+        warnResponseInfoDTO.setWarnId(warnId);
+        List<WarnResponseInfoEntity> warnResponseInfoEntityList = warnResponseInfoService.selectList(warnResponseInfoDTO);
+        if (Func.notNull(warnResponseInfoEntityList) && warnResponseInfoEntityList.size() > 0) {
+            vo.setReplyTm(warnResponseInfoEntityList.get(0).getReplyTm());
+            vo.setWarnResponseInfoList(warnResponseInfoEntityList);
+            vo.setWarnResponseStatus(1);
+        } else {
+            vo.setWarnResponseStatus(0);
+            vo.setWarnResponseInfoList(new ArrayList<>(0));
+        }
+        return R.data(vo);
+    }
+}

+ 95 - 0
src/main/java/org/springblade/modules/warn/entity/InsideWarnInfoEntity.java

@@ -0,0 +1,95 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2024/1/19
+ */
+package org.springblade.modules.warn.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:2024/1/19
+ * Title:预警信息-内部预警详情
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("st_message_send")
+public class InsideWarnInfoEntity  extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("预警编码")
+    private String warnId;
+
+    /**
+     * 类别
+     */
+    @ApiModelProperty("类别")
+    private String sendObjectName;
+
+    /**
+     * 接收人
+     */
+    @ApiModelProperty("接收人")
+    private String userName;
+
+    /**
+     * 电话
+     */
+    @ApiModelProperty("电话")
+    private String userTel;
+
+    /**
+     * 发送信息
+     */
+    @ApiModelProperty("发送信息")
+    private String messageInfo;
+
+    /**
+     * 职务
+     */
+    @ApiModelProperty("职务")
+    private String posiTion;
+
+    /**
+     * 发送时间
+     */
+    @ApiModelProperty("发送时间")
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+    )
+    private Date sendTime;
+
+    /**
+     * 发送状态,0失败  1成功
+     */
+    @ApiModelProperty("发送状态")
+    private String sendStatus;
+
+    /***
+     * 发送人
+     */
+    @ApiModelProperty("发送人")
+    private String senderName;
+
+    /**
+     * 发送单位
+     */
+    @ApiModelProperty("发送单位")
+    private String deptName;
+}

+ 50 - 0
src/main/java/org/springblade/modules/warn/entity/OutsideWarnInfoEntity.java

@@ -0,0 +1,50 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2024/1/19
+ */
+package org.springblade.modules.warn.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/***
+ * Date:2024/1/19
+ * Title:预警信息-外部预警
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("st_message_send")
+public class OutsideWarnInfoEntity  extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("预警编码")
+    private String warnId;
+
+    /**
+     * 发送单位
+     */
+    @ApiModelProperty("发送单位")
+    private String deptName;
+
+    /**
+     * 发送人
+     */
+    @ApiModelProperty("发送人")
+    private String senderName;
+
+    /**
+     * 发送信息
+     */
+    @ApiModelProperty("发送信息")
+    private String messageInfo;
+
+}

+ 48 - 0
src/main/java/org/springblade/modules/warn/entity/OutsideWarnTimeEntity.java

@@ -0,0 +1,48 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2024/1/19
+ */
+package org.springblade.modules.warn.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:2024/1/19
+ * Title:预警信息-外部预警时间
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("st_message_send")
+public class OutsideWarnTimeEntity extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("预警编码")
+    private String warnId;
+
+    /**
+     * 外部预警时间
+     */
+    @ApiModelProperty("外部预警时间")
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+    )
+    private Date extTime;
+
+}

+ 128 - 0
src/main/java/org/springblade/modules/warn/entity/WarnResponseInfoEntity.java

@@ -0,0 +1,128 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2024/1/19
+ */
+package org.springblade.modules.warn.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:2024/1/19
+ * Title:预警信息-预警响应
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("ST_WARN_CFNR_R")
+public class WarnResponseInfoEntity extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 预警ID
+     */
+    @ApiModelProperty("预警ID")
+    private String warnId;
+
+    /**
+     * 叫应时间
+     */
+    @ApiModelProperty("响应时间")
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+    )
+    private Date reacTm;
+
+    /**
+     * 反馈时间
+     */
+    @ApiModelProperty("反馈时间")
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+    )
+    private Date replyTm;
+
+    /**
+     * 危险区负责人ID
+     */
+    @ApiModelProperty("危险区负责人ID")
+    private String pcaId;
+
+    /**
+     * 叫应次数
+     */
+    @ApiModelProperty("叫应次数")
+    private Integer reacTimes;
+
+    /**
+     * -1 未叫应 0 未反馈 1已反馈
+     */
+    @ApiModelProperty("状态")
+    private String repltStatus;
+
+    /**
+     * 响应时间
+     */
+    @ApiModelProperty("响应时间")
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+    )
+    private Date responTm;
+
+    /**
+     * 是否收到预警信息 0 是 1否
+     */
+    @ApiModelProperty("是否收到预警信息")
+    private String isReceive;
+
+    /**
+     * 是否发生山洪灾害 0 是 1 否
+     */
+    @ApiModelProperty("是否发生山洪灾害")
+    private String isFloodBoot;
+
+    /**
+     * 是否降雨持续 0 是 1 否
+     */
+    @ApiModelProperty("是否降雨持续")
+    private String isRainContu;
+
+    /**
+     * 是否发生人员转移 0 是 1 否
+     */
+    @ApiModelProperty("是否发生人员转移")
+    private String isTrans;
+
+    /**
+     * 是否有人员伤亡 0 是 1无
+     */
+    @ApiModelProperty("是否有人员伤亡")
+    private String isDeady;
+
+    /**
+     * 山洪是否已出沟 0 是 1 否
+     */
+    @ApiModelProperty("山洪是否已出沟")
+    private String isFloodOut;
+}

+ 26 - 0
src/main/java/org/springblade/modules/warn/mapper/InsideWarnInfoMapper.java

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

+ 39 - 0
src/main/java/org/springblade/modules/warn/mapper/InsideWarnInfoMapper.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.warn.mapper.InsideWarnInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.modules.warn.entity.InsideWarnInfoEntity">
+        <result column="business_id" property="warnId"/>
+        <result column="send_object_name" property="sendObjectName"/>
+        <result column="NAME" property="userName"/>
+        <result column="USER_TEL" property="userTel"/>
+        <result column="MESSAGE_INFO" property="messageInfo"/>
+        <result column="posi_tion" property="posiTion"/>
+        <result column="SEND_TIME" property="sendTime"/>
+        <result column="SEND_STATUS" property="sendStatus"/>
+        <result column="sender_name" property="senderName"/>
+        <result column="dept_name" property="deptName"/>
+    </resultMap>
+
+    <!--SELECT_ZHSL_USER-->
+    <select id="selectList" resultMap="entityResultMap">
+            select
+            message.*,
+            com.name,
+            com.posi_tion,
+            CASE message.send_object WHEN '2' THEN
+            '社会公众' ELSE '责任人' END send_object_name,
+            case when message.send_type='0' then info.USER_NAME else
+            message.send_user_name end sender_name,
+            dept.dept_name
+            from
+            SELECT_ZHSL_USER.st_message_send message
+            LEFT JOIN SELECT_ZHSL_USER.st_communication com ON message.user_name_id = com.id
+            left join SELECT_ZHSL_USER.ST_INFORMATION info on info.warn_id=message.business_id
+            left join SELECT_ZHSL_USER.st_dept_new dept on dept.dept_code=com.DEPT_CODE
+            where message.business_id = #{dto.warnId}
+            and message.send_type='0'
+    </select>
+
+</mapper>

+ 27 - 0
src/main/java/org/springblade/modules/warn/mapper/OutsideWarnInfoMapper.java

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

+ 33 - 0
src/main/java/org/springblade/modules/warn/mapper/OutsideWarnInfoMapper.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.modules.warn.mapper.OutsideWarnInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.modules.warn.entity.OutsideWarnInfoEntity">
+        <result column="business_id" property="warnId"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="sender_name" property="senderName"/>
+        <result column="MESSAGE_INFO" property="messageInfo"/>
+    </resultMap>
+
+    <!--SELECT_ZHSL_USER-->
+    <select id="selectList" resultMap="entityResultMap">
+            select
+            message.*,
+            com.name,
+            com.posi_tion,
+            CASE message.send_object WHEN '2' THEN
+            '社会公众' ELSE '责任人' END sendObjectName,
+            case when message.send_type='0' then info.USER_NAME else
+            message.send_user_name end sender_name,
+            dept.dept_name
+            from
+            SELECT_ZHSL_USER.st_message_send message
+            LEFT JOIN SELECT_ZHSL_USER.st_communication com ON message.user_name_id = com.id
+            left join SELECT_ZHSL_USER.ST_INFORMATION info on info.warn_id=message.business_id
+            left join SELECT_ZHSL_USER.st_dept_new dept on dept.dept_code=com.DEPT_CODE
+            where message.business_id = #{dto.warnId}
+            and message.send_type='1'
+    </select>
+
+</mapper>

+ 27 - 0
src/main/java/org/springblade/modules/warn/mapper/OutsideWarnTimeMapper.java

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

+ 22 - 0
src/main/java/org/springblade/modules/warn/mapper/OutsideWarnTimeMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.warn.mapper.OutsideWarnTimeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.modules.warn.entity.OutsideWarnTimeEntity">
+        <result column="business_id" property="warnId"/>
+        <result column="ext_time" property="extTime"/>
+    </resultMap>
+
+    <!--SELECT_ZHSL_USER-->
+    <select id="selectList" resultMap="entityResultMap">
+            SELECT
+            min( CASE WHEN SEND_TYPE = '1' THEN send_time END ) ext_time,
+            business_id
+            FROM
+            SELECT_ZHSL_USER.st_message_send where BUSINESS_ID=#{dto.warnId}
+            GROUP BY
+            business_id
+    </select>
+
+</mapper>

+ 27 - 0
src/main/java/org/springblade/modules/warn/mapper/WarnResponseInfoMapper.java

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

+ 45 - 0
src/main/java/org/springblade/modules/warn/mapper/WarnResponseInfoMapper.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.warn.mapper.WarnResponseInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="entityResultMap" type="org.springblade.modules.warn.entity.WarnResponseInfoEntity">
+        <result column="WARN_ID" property="warnId"/>
+        <result column="REAC_TM" property="reacTm"/>
+        <result column="REPLY_TM" property="replyTm"/>
+        <result column="PCA_ID" property="pcaId"/>
+        <result column="REAC_TIMES" property="reacTimes"/>
+        <result column="REPLT_STATUS" property="repltStatus"/>
+        <result column="RESPON_TM" property="responTm"/>
+        <result column="IS_RECEIVE" property="isReceive"/>
+        <result column="IS_FLOOD_BOOT" property="isFloodBoot"/>
+        <result column="IS_RAIN_CONTU" property="isRainContu"/>
+        <result column="IS_TRANS" property="isTrans"/>
+        <result column="IS_DEADY" property="isDeady"/>
+        <result column="IS_FLOOD_OUT" property="isFloodOut"/>
+    </resultMap>
+
+    <!--SELECT_ZHSL_USER-->
+    <select id="selectList" resultMap="entityResultMap">
+            SELECT R.WARN_ID,
+            to_char(R.REAC_TM, 'yyyy-mm-dd hh24:mi:ss') REAC_TM,
+            to_char(R.REPLY_TM, 'yyyy-mm-dd hh24:mi:ss') REPLY_TM,
+            PCA_ID,N.NAME PCA_NAME,REAC_TIMES,
+            (SELECT DICT_NAME FROM SELECT_ZHSL_USER.ST_DICT WHERE DICT_TYPE='repltStatus' AND
+            DICT_VALUE=R.REPLT_STATUS) REPLT_STATUS,
+            (SELECT DICT_NAME FROM SELECT_ZHSL_USER.ST_DICT WHERE DICT_TYPE='commtype' AND
+            DICT_VALUE=N.COMMTYPE) COMMTYPE,
+            to_char(R.RESPON_TM, 'yyyy-mm-dd hh24:mi:ss') RESPON_TM,
+            (case when IS_RECEIVE='0' then '是' else '否' end) IS_RECEIVE,
+            (case when IS_FLOOD_BOOT='0' then '是' else '否' end) IS_FLOOD_BOOT,
+            (case when IS_RAIN_CONTU='0' then '是' else '否' end) IS_RAIN_CONTU,
+            (case when IS_TRANS='0' then '是' else '否' end) IS_TRANS,
+            (case when IS_DEADY='0' then '是' else '否' end) IS_DEADY,
+            (case when IS_FLOOD_OUT='0' then '是' else '否' end) IS_FLOOD_OUT
+            from SELECT_ZHSL_USER.ST_WARN_CFNR_R R
+            LEFT JOIN SELECT_ZHSL_USER.ST_COMMUNICATION N ON R.PCA_ID=N.ID
+            where R.WARN_ID=#{dto.warnId}
+            order by REPLY_TM desc,RESPON_TM desc,REAC_TM desc
+    </select>
+
+</mapper>

+ 10 - 0
src/main/java/org/springblade/modules/warn/service/IInsideWarnInfoService.java

@@ -0,0 +1,10 @@
+package org.springblade.modules.warn.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.warn.entity.InsideWarnInfoEntity;
+
+import java.util.List;
+
+public interface IInsideWarnInfoService extends BaseService<InsideWarnInfoEntity> {
+    List<InsideWarnInfoEntity> selectList(InsideWarnInfoEntity dto);
+}

+ 10 - 0
src/main/java/org/springblade/modules/warn/service/IOutsideWarnInfoService.java

@@ -0,0 +1,10 @@
+package org.springblade.modules.warn.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.warn.entity.OutsideWarnInfoEntity;
+
+import java.util.List;
+
+public interface IOutsideWarnInfoService extends BaseService<OutsideWarnInfoEntity> {
+    List<OutsideWarnInfoEntity> selectList(OutsideWarnInfoEntity dto);
+}

+ 10 - 0
src/main/java/org/springblade/modules/warn/service/IOutsideWarnTimeService.java

@@ -0,0 +1,10 @@
+package org.springblade.modules.warn.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.warn.entity.OutsideWarnTimeEntity;
+
+import java.util.List;
+
+public interface IOutsideWarnTimeService extends BaseService<OutsideWarnTimeEntity> {
+    List<OutsideWarnTimeEntity> selectList(OutsideWarnTimeEntity dto);
+}

+ 10 - 0
src/main/java/org/springblade/modules/warn/service/IWarnResponseInfoService.java

@@ -0,0 +1,10 @@
+package org.springblade.modules.warn.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.warn.entity.WarnResponseInfoEntity;
+
+import java.util.List;
+
+public interface IWarnResponseInfoService extends BaseService<WarnResponseInfoEntity> {
+    List<WarnResponseInfoEntity> selectList(WarnResponseInfoEntity dto);
+}

+ 33 - 0
src/main/java/org/springblade/modules/warn/service/impl/InsideWarnInfoServiceImpl.java

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

+ 33 - 0
src/main/java/org/springblade/modules/warn/service/impl/OutsideWarnInfoServiceImpl.java

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

+ 33 - 0
src/main/java/org/springblade/modules/warn/service/impl/OutsideWarnTimeServiceImpl.java

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

+ 33 - 0
src/main/java/org/springblade/modules/warn/service/impl/WarnResponseInfoServiceImpl.java

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

+ 107 - 0
src/main/java/org/springblade/modules/warn/vo/WarnDetailInfoVO.java

@@ -0,0 +1,107 @@
+/**
+ * Copyright 2019 DH
+ * All right reserved.
+ * 项目名称: 大恒泰山系统
+ * 创建日期:2024/1/19
+ */
+package org.springblade.modules.warn.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.models.auth.In;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springblade.modules.warn.entity.InsideWarnInfoEntity;
+import org.springblade.modules.warn.entity.OutsideWarnInfoEntity;
+import org.springblade.modules.warn.entity.WarnResponseInfoEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/***
+ * Date:2024/1/19
+ * Title:文件所属模块(必须填写)
+ * Description:对本文件的详细描述,原则上不能少于30字
+ * @author dylan
+ * @version 1.0
+ * Remark:认为有必要的其他信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class WarnDetailInfoVO extends BaseEntity {
+
+    @ApiModelProperty("预警编码")
+    private String warnId;
+
+    @ApiModelProperty("预警发生时间")
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+    )
+    private Date warnTime;
+
+    @ApiModelProperty("预警名称")
+    private String warnName;
+
+    @ApiModelProperty("预警信息")
+    private String warnInfo;
+
+    /**
+     * 内部预警信息
+     */
+    @ApiModelProperty("内部预警信息")
+    private List<InsideWarnInfoEntity> insideWarnInfoList;
+
+    /**
+     * 0 没有,1 有
+     */
+    @ApiModelProperty("是否有外部预警")
+    private Integer ousideWarnStatus;
+
+    /**
+     * 外部预警时间
+     */
+    @ApiModelProperty("外部预警时间")
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+    )
+    private Date extTime;
+
+    /**
+     * 外部预警信息
+     */
+    @ApiModelProperty("外部预警信息")
+    private List<OutsideWarnInfoEntity> outsideWarnInfoList;
+
+
+    /**
+     * 0 没有,1 有
+     */
+    @ApiModelProperty("是否有预警响应")
+    private Integer warnResponseStatus;
+
+    /**
+     * 预警响应时间
+     */
+    @ApiModelProperty("预警响应时间")
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8"
+    )
+    private Date replyTm;
+
+    /**
+     * 预警响应信息
+     */
+    @ApiModelProperty("预警响应信息")
+    private List<WarnResponseInfoEntity> warnResponseInfoList;
+}

+ 11 - 0
src/main/main.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

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

@@ -2,10 +2,10 @@
 spring:
   redis:
     ##redis 单机环境配置
-    host: 172.9.0.165
+    host: 172.31.1.154
     port: 6379
-    password:  123456
-    database: 1
+    password:  Dh@82828800
+    database: 5
     ssl: false
     ##redis 集群环境配置
     #cluster:
@@ -42,9 +42,9 @@ spring:
       strict: false
       datasource:
         master:
-          url: jdbc:mysql://172.31.1.233:3306/shzhjcyjptywxt?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+          url: jdbc:mysql://172.31.1.154:3306/shzhjcyjptywxt?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true
           username: root
-          password: Dh@82828800
+          password: 1QAZ!2wsx@
           driver-class-name: com.mysql.cj.jdbc.Driver
           druid:
             # MySql、PostgreSQL、SqlServer、DaMeng校验
@@ -54,6 +54,7 @@ spring:
 #          username: sa
 #          password: Dh82828800
 #          driver-class-name:  com.microsoft.sqlserver.jdbc.SQLServerDriver
+        #东华
         oracle_1:
           url: jdbc:oracle:thin:@10.0.0.86:1521:orcl
           username: DSH
@@ -62,6 +63,7 @@ spring:
           druid:
             # Oracle校验
             validation-query: select 1 from dual
+        #宏图
         oracle_2:
           url: jdbc:oracle:thin:@10.0.0.86:1521:orcl
           username: DSH
@@ -72,7 +74,7 @@ spring:
             validation-query: select 1 from dual
 
   kafka:
-    bootstrap-servers: 172.31.1.228:9092
+    bootstrap-servers: 172.31.1.154:9092
     producer:
       retries: 0
       batch-size: 16384

+ 76 - 41
src/main/resources/application-test.yml

@@ -2,43 +2,79 @@
 spring:
   redis:
     ##redis 单机环境配置
-    host: 172.9.0.12
+    host: 172.31.1.154
     port: 6379
-    password:  Dh8282
-    database: 1
+    password:  Dh@82828800
+    database: 5
     ssl: false
     ##redis 集群环境配置
     #cluster:
     #  nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
     #  commandTimeout: 5000
   datasource:
-    # MySql
-    #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: Dh@2022
-
-
-    # PostgreSQL
-    #url: jdbc:postgresql://127.0.0.1:5432/bladex_boot
-    #username: postgres
-    #password: 123456
-    # Oracle
-    url: jdbc:oracle:thin:@10.0.0.86:1521:orcl
-    username: DSH
-    password: Dh82828800
-    # SqlServer
-    #url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=bladex_boot
-    #username: bladex_boot
-    #password: bladex_boot
-    # DaMeng
-  #    url: jdbc:dm://172.1.0.215:5236/ZGXXXT?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
-  #    username: ZGXXXT
-  #    password: ZGXXXT2022
+    dynamic:
+      druid:
+        # MySql、PostgreSQL、SqlServer、DaMeng校验
+        validation-query: select 1
+        # Oracle校验
+        #validation-query: select 1 from dual
+        validation-query-timeout: 2000
+        initial-size: 5
+        max-active: 20
+        min-idle: 5
+        max-wait: 60000
+        test-on-borrow: false
+        test-on-return: false
+        test-while-idle: true
+        time-between-eviction-runs-millis: 60000
+        min-evictable-idle-time-millis: 300000
+        stat-view-servlet:
+          enabled: true
+          login-username: blade
+          login-password: 1qaz@WSX
+        web-stat-filter:
+          enabled: true
+          url-pattern: /*
+          exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+          session-stat-enable: true
+          session-stat-max-count: 10
+      primary: master
+      strict: false
+      datasource:
+        master:
+          url: jdbc:mysql://172.31.1.154:3306/shzhjcyjptywxt?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true
+          username: root
+          password: 1QAZ!2wsx@
+          driver-class-name: com.mysql.cj.jdbc.Driver
+          druid:
+            # MySql、PostgreSQL、SqlServer、DaMeng校验
+            validation-query: select 1
+        #        sqlserver_1:
+        #          url: jdbc:sqlserver://10.0.0.86:1433;DatabaseName=xam
+        #          username: sa
+        #          password: Dh82828800
+        #          driver-class-name:  com.microsoft.sqlserver.jdbc.SQLServerDriver
+        #东华
+        oracle_1:
+          url: jdbc:oracle:thin:@10.0.0.86:1521:orcl
+          username: DSH
+          password: Dh82828800
+          driver-class-name: oracle.jdbc.OracleDriver
+          druid:
+            # Oracle校验
+            validation-query: select 1 from dual
+        #宏图
+        oracle_2:
+          url: jdbc:oracle:thin:@10.0.0.86:1521:orcl
+          username: DSH
+          password: Dh82828800
+          driver-class-name: oracle.jdbc.OracleDriver
+          druid:
+            # Oracle校验
+            validation-query: select 1 from dual
 
   kafka:
-    bootstrap-servers: 172.9.0.120:9092,172.9.0.121:9092,172.9.0.202:9092
+    bootstrap-servers: 172.31.1.154:9092
     producer:
       retries: 0
       batch-size: 16384
@@ -46,7 +82,7 @@ spring:
       key-serializer: org.apache.kafka.common.serialization.StringSerializer
       value-serializer: org.apache.kafka.common.serialization.StringSerializer
     consumer:
-      group-id: ywxt-kafka
+      group-id: kafka-ywxt-etl
       # 手动提交
       enable-auto-commit: false
       auto-offset-reset: latest
@@ -59,15 +95,14 @@ spring:
       concurrency: 5
       # 手动提交
       ack-mode: manual_immediate
-  apk:
-    url: http://111.204.228.227:20002/app/apk
-    #save-path: /home/apk
-    save-path: D:\\tmp
-
-#第三方登陆
-social:
-  enabled: true
-  domain: http://127.0.0.1:1888
+  mq-topic:
+    topic-etl-task-run-info: topic-etl-task-run-info
+    topic-etl-rain: topic-etl-rain-data
+    topic-etl-river: topic-etl-river-data
+    topic-etl-rsvr: topic-etl-rsvr-data
+    topic-etl-ground: topic-etl-ground-data
+    topic-etl-warn: topic-etl-warn-data
+    topic-etl-promptly-collect:  topic-etl-promptly-collect
 
 #blade配置
 blade:
@@ -76,10 +111,10 @@ blade:
     ##是否启用分布式锁
     enabled: false
     ##redis服务地址
-    address: redis://172.9.0.12:6379
-    password:  Dh8282
+    address: redis://10.52.1.174:6379
+    password:  123456
   #本地文件上传
   file:
     remote-mode: true
     upload-domain: http://localhost:8999
-    remote-path: /usr/share/nginx/html
+    remote-path: /usr/share/nginx/html

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

@@ -129,7 +129,7 @@ blade:
     #接口放行
     skip-url:
       - /galaxy-test/**
-      - /galaxy-business/etl/**
+      - /galaxy-business/warn/**
 #      - /galaxy-business/data/manage/**
 #      - /galaxy-business/count/**
     #授权认证配置

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

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