Browse Source

根据讨论的调整

459242451@qq.com 3 years ago
parent
commit
2a20ffcac3

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gas/BlackGasController.java

@@ -77,7 +77,7 @@ public class BlackGasController extends BaseController {
         List<String> orderBy = new ArrayList<>();
         orderBy.add("-snapTime");
         PageDomain pageDomain = TableSupport.buildPageRequest();
-        Map<String, Object> maps = client.searchDocument(ElasticConstants.HEIYAN_SHIP_RECOGNITION, equalsCondition, rangeCondition, orderBy, pageDomain.getPageNum(), pageDomain.getPageSize());
+        Map<String, Object> maps = client.searchDocument(equalsCondition, rangeCondition, orderBy, pageDomain.getPageNum(), pageDomain.getPageSize(), ElasticConstants.HEIYAN_SHIP_RECOGNITION);
 
         TableDataInfo rspData = new TableDataInfo();
         rspData.setCode(HttpStatus.SUCCESS);
@@ -113,7 +113,7 @@ public class BlackGasController extends BaseController {
         rangeCondition.put("snapTimeFmt", StrUtil.concat(true, "[", Convert.toStr(params.get("beginTime")), ",", Convert.toStr(params.get("endTime")), "]"));
         List<String> orderBy = new ArrayList<>();
         orderBy.add("-snapTime");
-        Map<String, Object> maps = client.searchDocument(ElasticConstants.HEIYAN_SHIP_RECOGNITION, equalsCondition, rangeCondition, orderBy, 0, 10000);
+        Map<String, Object> maps = client.searchDocument(equalsCondition, rangeCondition, orderBy, 0, 10000, ElasticConstants.HEIYAN_SHIP_RECOGNITION);
         ExcelUtil<ShipRecognition> util = new ExcelUtil<>(ShipRecognition.class);
         util.exportExcelByEasyPoi("黑烟违规数据_" + DateUtil.today(),
                 "黑烟违规数据",

+ 4 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gas/So2Controller.java

@@ -19,7 +19,6 @@ import com.ruoyi.common.enums.AggsType;
 import com.ruoyi.framework.config.ElasticSearchClient;
 import com.ruoyi.system.domain.GuapAlert;
 import com.ruoyi.system.domain.GuapMonitorPoint;
-import com.ruoyi.system.domain.ShipRecognition;
 import com.ruoyi.system.domain.XiuTanIllegalShip;
 import com.ruoyi.system.domain.XiuTanSemInstrument;
 import com.ruoyi.system.service.IAisDatabase;
@@ -87,7 +86,7 @@ public class So2Controller extends BaseController {
         List<String> orderBy = new ArrayList<>();
         orderBy.add("-createTime");
         PageDomain pageDomain = TableSupport.buildPageRequest();
-        Map<String, Object> maps = client.searchDocument(ElasticConstants.SO2_ALERT, equalsCondition, rangeCondition, orderBy, pageDomain.getPageNum(), pageDomain.getPageSize());
+        Map<String, Object> maps = client.searchDocument(equalsCondition, rangeCondition, orderBy, pageDomain.getPageNum(), pageDomain.getPageSize(), ElasticConstants.SO2_ALERT);
 
         TableDataInfo rspData = new TableDataInfo();
         rspData.setCode(HttpStatus.SUCCESS);
@@ -119,7 +118,7 @@ public class So2Controller extends BaseController {
         List<String> orderBy = new ArrayList<>();
         orderBy.add("-peakTime");
         PageDomain pageDomain = TableSupport.buildPageRequest();
-        Map<String, Object> maps = client.searchDocument(ElasticConstants.AIS_ILLEGAL_SHIP, equalsCondition, rangeCondition, orderBy, pageDomain.getPageNum(), pageDomain.getPageSize());
+        Map<String, Object> maps = client.searchDocument(equalsCondition, rangeCondition, orderBy, pageDomain.getPageNum(), pageDomain.getPageSize(), ElasticConstants.AIS_ILLEGAL_SHIP);
 
         TableDataInfo rspData = new TableDataInfo();
         rspData.setCode(HttpStatus.SUCCESS);
@@ -136,7 +135,7 @@ public class So2Controller extends BaseController {
         Map<String, Object> equalsCondition = new HashMap<>();
         // 组装查询条件
         equalsCondition.put("name", StrUtil.isBlank(monitorPoint.getName()) ? null : StrUtil.concat(true, "*", monitorPoint.getName(), "*"));
-        Map<String, Object> maps = client.searchDocument(ElasticConstants.SO2_MONITOR_POINT, equalsCondition, null, null, 1, 10000);
+        Map<String, Object> maps = client.searchDocument(equalsCondition, null, null, 1, 10000, ElasticConstants.SO2_MONITOR_POINT);
         return AjaxResult.success(Convert.toList(GuapMonitorPoint.class, maps.get("pageList")));
     }
 
@@ -147,7 +146,7 @@ public class So2Controller extends BaseController {
         Map<String, Object> equalsCondition = new HashMap<>();
         // 组装查询条件
         equalsCondition.put("name", StrUtil.isBlank(semInstrument.getName()) ? null : StrUtil.concat(true, "*", semInstrument.getName(), "*"));
-        Map<String, Object> maps = client.searchDocument(ElasticConstants.AIS_SEM_INSTRUMENT, equalsCondition, null, null, 1, 10000);
+        Map<String, Object> maps = client.searchDocument(equalsCondition, null, null, 1, 10000, ElasticConstants.AIS_SEM_INSTRUMENT);
         return AjaxResult.success(Convert.toList(XiuTanSemInstrument.class, maps.get("pageList")));
     }
 

+ 29 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/job/CanalScheduling.java

@@ -21,6 +21,7 @@ import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -49,8 +50,10 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
     private RedisCache redisCache;
     @Autowired
     private ISysConfigService configService;
-//    @Resource
+    //    @Resource
 //    private CanalConnector canalConnector;
+    @Value("${black.snapImgUrl}")
+    private String blackImgUrl;
 
     @Autowired
     private CanalConfig canalConfig;
@@ -169,8 +172,33 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
             case INSERT:
                 // 黑烟船舶数据入库
                 if (StrUtil.equalsIgnoreCase(database, "heiyan") && StrUtil.equalsIgnoreCase(table, "ship_recognition")) {
+                    // 判断数据状态
+                    if (ObjectUtil.isNotEmpty(afterDataMap.get("rcgSoot")) && NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(afterDataMap.get("rcgSoot")), Convert.toBigDecimal(blackThresholdVal))) {
+                        // 嫌疑船舶
+                        afterDataMap.put("illegalStatus", 2);
+                        // 查询黑烟图片
+                        /*String imgUrl = HttpUtil.get(blackImgUrl + Convert.toStr(afterDataMap.get("id")));
+                        JSONObject response = JSON.parseObject(imgUrl);
+                        if (200 == response.getInteger("code")) {
+                            List<String> newImgList = new ArrayList<>();
+                            JSONArray imgUrlList = response.getJSONObject("data").getJSONArray("imgUrlList");
+                            for (Object o : imgUrlList) {
+                                // 只保存细节、全貌开头的图片
+                                String s = Convert.toStr(o);
+                                if (StrUtil.containsAny(s, "全貌", "细节")) {
+                                    newImgList.add(s);
+                                }
+                            }
+                            afterDataMap.put("allImgUrl", newImgList);
+                        }*/
+                        // TODO 上报行政检查系统
+
+                    } else {
+                        afterDataMap.put("illegalStatus", 1);
+                    }
                     client.createDocument(ElasticConstants.HEIYAN_SHIP_RECOGNITION, Convert.toStr(afterDataMap.get("id")), afterDataMap);
                 } else if (StrUtil.equalsIgnoreCase(database, "heiyan") && StrUtil.equalsIgnoreCase(table, "ship_snap_address")) {
+                    // 删除设备和类型的统计缓存
                     redisCache.deleteObject(CollUtil.set(false,
                             CacheConstants.DEVICE_STATIC,
                             CacheConstants.DEVICE_TYPE_STATIC));

+ 12 - 11
ruoyi-admin/src/main/java/com/ruoyi/web/service/Impl/GasCommonServiceImpl.java

@@ -1,11 +1,8 @@
 package com.ruoyi.web.service.Impl;
 
 import cn.hutool.core.convert.Convert;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.ruoyi.common.constant.ElasticConstants;
-import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.framework.config.ElasticSearchClient;
 import com.ruoyi.system.domain.SyncPost;
 import com.ruoyi.system.mapper.GasCommonMapper;
@@ -48,41 +45,45 @@ public class GasCommonServiceImpl implements IGasCommonService {
         }
         if (StrUtil.equalsIgnoreCase(schema, "ais_database") && (StrUtil.equalsIgnoreCase(table, "sem_instrument_test") || StrUtil.equalsIgnoreCase(table, "sem_instrument"))) {
             // 嗅探站点信息
-            List<Map<String,Object>> map = gasCommonMapper.querySemInstrument(table);
+            List<Map<String, Object>> map = gasCommonMapper.querySemInstrument(table);
             for (Map<String, Object> stringObjectMap : map) {
                 saveOrUpdate(ElasticConstants.AIS_SEM_INSTRUMENT, Convert.toStr(stringObjectMap.get("id")), stringObjectMap);
             }
         } else if (StrUtil.equalsIgnoreCase(schema, "ais_database") && StrUtil.equalsIgnoreCase(table, "illegal_ship")) {
             // 嗅探违规船舶信息
-            List<Map<String,Object>> map = gasCommonMapper.queryIllegalShip(syncPost);
+            List<Map<String, Object>> map = gasCommonMapper.queryIllegalShip(syncPost);
             for (Map<String, Object> stringObjectMap : map) {
                 saveOrUpdate(ElasticConstants.AIS_ILLEGAL_SHIP, Convert.toStr(stringObjectMap.get("id")), stringObjectMap);
             }
         } else if (StrUtil.equalsIgnoreCase(schema, "heiyan") && StrUtil.equalsIgnoreCase(table, "ship_recognition")) {
             // 黑烟嫌疑船舶
-            List<Map<String,Object>> map = gasCommonMapper.queryShipRecognition(syncPost);
+            List<Map<String, Object>> map = gasCommonMapper.queryShipRecognition(syncPost);
             for (Map<String, Object> stringObjectMap : map) {
+                stringObjectMap.put("illegalStatus", 1);
+                stringObjectMap.put("uploadFlag", 0);
                 saveOrUpdate(ElasticConstants.HEIYAN_SHIP_RECOGNITION, Convert.toStr(stringObjectMap.get("id")), stringObjectMap);
             }
         } else if (StrUtil.equalsIgnoreCase(schema, "so2") && StrUtil.equalsIgnoreCase(table, "alert")) {
             // 光谱嫌疑船舶
-            List<Map<String,Object>> map = gasCommonMapper.queryAlert(syncPost);
+            List<Map<String, Object>> map = gasCommonMapper.queryAlert(syncPost);
             for (Map<String, Object> stringObjectMap : map) {
+                stringObjectMap.put("illegalStatus", 1);
+                stringObjectMap.put("uploadFlag", 0);
                 saveOrUpdate(ElasticConstants.SO2_ALERT, Convert.toStr(stringObjectMap.get("id")), stringObjectMap);
             }
         } else if (StrUtil.equalsIgnoreCase(schema, "so2") && StrUtil.equalsIgnoreCase(table, "monitor_point")) {
             // 光谱监测点
-            List<Map<String,Object>> map = gasCommonMapper.queryMonitorPoint(syncPost);
+            List<Map<String, Object>> map = gasCommonMapper.queryMonitorPoint(syncPost);
             for (Map<String, Object> stringObjectMap : map) {
                 saveOrUpdate(ElasticConstants.SO2_MONITOR_POINT, Convert.toStr(stringObjectMap.get("id")), stringObjectMap);
             }
-        } else if (StrUtil.equalsIgnoreCase(schema, "so2") && StrUtil.equalsIgnoreCase(table, "ship_static_info")) {
+        }/* else if (StrUtil.equalsIgnoreCase(schema, "so2") && StrUtil.equalsIgnoreCase(table, "ship_static_info")) {
             // 光谱船舶信息
-            List<Map<String,Object>> map = gasCommonMapper.queryShipStaticInfo(syncPost);
+            List<Map<String, Object>> map = gasCommonMapper.queryShipStaticInfo(syncPost);
             for (Map<String, Object> stringObjectMap : map) {
                 saveOrUpdate(ElasticConstants.SO2_SHIP_STATIC_INFO, Convert.toStr(stringObjectMap.get("id")), stringObjectMap);
             }
-        }
+        }*/
     }
 
     @SneakyThrows

+ 114 - 110
ruoyi-admin/src/main/resources/application-prod.yml

@@ -1,120 +1,124 @@
 # 数据源配置
 spring:
-    datasource:
-        type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: com.mysql.cj.jdbc.Driver
-        druid:
-            # 主库数据源
-            master:
-                url: jdbc:mysql://200.200.19.126:3306/cbwqpf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: root
-                password: root
-            # 从库数据源(嗅探)
-            slaveais:
-                # 从数据源开关/默认关闭
-                enabled: true
-                url: jdbc:mysql://47.92.161.189:3306/ais_database?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: js_test
-                password: js123456
-            # 从库数据源(二氧化硫)
-            slaveso2:
-                # 从数据源开关/默认关闭
-                enabled: true
-                url: jdbc:mysql://200.200.19.126:3306/so2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: root
-                password: root
-            # 从库数据源(黑烟)
-            slaveblack:
-                # 从数据源开关/默认关闭
-                enabled: true
-                url: jdbc:mysql://200.200.19.126:3306/heiyan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: root
-                password: root
-            # 初始连接数
-            initialSize: 5
-            # 最小连接池数量
-            minIdle: 10
-            # 最大连接池数量
-            maxActive: 20
-            # 配置获取连接等待超时的时间
-            maxWait: 60000
-            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-            timeBetweenEvictionRunsMillis: 60000
-            # 配置一个连接在池中最小生存的时间,单位是毫秒
-            minEvictableIdleTimeMillis: 300000
-            # 配置一个连接在池中最大生存的时间,单位是毫秒
-            maxEvictableIdleTimeMillis: 900000
-            # 配置检测连接是否有效
-            validationQuery: SELECT 1 FROM DUAL
-            testWhileIdle: true
-            testOnBorrow: false
-            testOnReturn: false
-            webStatFilter: 
-                enabled: true
-            statViewServlet:
-                enabled: true
-                # 设置白名单,不填则允许所有访问
-                allow:
-                url-pattern: /druid/*
-                # 控制台管理用户名和密码
-                login-username: ruoyi
-                login-password: 123456
-            filter:
-                stat:
-                    enabled: true
-                    # 慢SQL记录
-                    log-slow-sql: true
-                    slow-sql-millis: 1000
-                    merge-sql: true
-                wall:
-                    config:
-                        multi-statement-allow: true
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 主库数据源
+      master:
+        url: jdbc:mysql://200.200.19.126:3306/cbwqpf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: root
+      # 从库数据源(嗅探)
+      slaveais:
+        # 从数据源开关/默认关闭
+        enabled: true
+        url: jdbc:mysql://47.92.161.189:3306/ais_database?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: js_test
+        password: js123456
+      # 从库数据源(二氧化硫)
+      slaveso2:
+        # 从数据源开关/默认关闭
+        enabled: true
+        url: jdbc:mysql://200.200.19.126:3306/so2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: root
+      # 从库数据源(黑烟)
+      slaveblack:
+        # 从数据源开关/默认关闭
+        enabled: true
+        url: jdbc:mysql://200.200.19.126:3306/heiyan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: root
+      # 初始连接数
+      initialSize: 5
+      # 最小连接池数量
+      minIdle: 10
+      # 最大连接池数量
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      # 配置一个连接在池中最大生存的时间,单位是毫秒
+      maxEvictableIdleTimeMillis: 900000
+      # 配置检测连接是否有效
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 设置白名单,不填则允许所有访问
+        allow:
+        url-pattern: /druid/*
+        # 控制台管理用户名和密码
+        login-username: ruoyi
+        login-password: 123456
+      filter:
+        stat:
+          enabled: true
+          # 慢SQL记录
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
 
-    # redis 配置
-    redis:
-        # 地址
-        host: localhost
-        # 端口,默认为6379
-        port: 6379
-        # 数据库索引
-        database: 0
-        # 密码
-        password: xintong@cbwq
-        # 连接超时时间
-        timeout: 10s
-        lettuce:
-            pool:
-                # 连接池中的最小空闲连接
-                min-idle: 0
-                # 连接池中的最大空闲连接
-                max-idle: 8
-                # 连接池的最大数据库连接数
-                max-active: 8
-                # #连接池最大阻塞等待时间(使用负值表示没有限制)
-                max-wait: -1ms
+  # redis 配置
+  redis:
+    # 地址
+    host: localhost
+    # 端口,默认为6379
+    port: 6379
+    # 数据库索引
+    database: 0
+    # 密码
+    password: xintong@cbwq
+    # 连接超时时间
+    timeout: 10s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 8
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1ms
 
 elasticsearch:
-    port: 9200
-    ip: 212.129.138.23
-    type: http  #访问方式
-    numberOfReplicas: 2  #副本数
-    numberOfShards: 5  #分片数
-    defaultIndex: materials  #默认加载索引
-    searchTimeOut: 10    #搜索超时时长,单位:秒
-    masterShardTimeOut: 1 #主分片执行更新的超时时长 ,单位:秒
+  port: 9200
+  ip: 212.129.138.23
+  type: http  #访问方式
+  numberOfReplicas: 2  #副本数
+  numberOfShards: 5  #分片数
+  defaultIndex: materials  #默认加载索引
+  searchTimeOut: 10    #搜索超时时长,单位:秒
+  masterShardTimeOut: 1 #主分片执行更新的超时时长 ,单位:秒
 
 canal:
-    configs:
-        - hostname: 127.0.0.1
-          port: 11111
-          destination: heiyan
-        - hostname: 127.0.0.1
-          port: 11111
-          destination: so2
+  configs:
+    - hostname: 127.0.0.1
+      port: 11111
+      destination: heiyan
+    - hostname: 127.0.0.1
+      port: 11111
+      destination: so2
 
 # Swagger配置
 swagger:
-    # 是否开启swagger
-    enabled: false
-    # 请求前缀
-    pathMapping: /prod-api
+  # 是否开启swagger
+  enabled: false
+  # 请求前缀
+  pathMapping: /prod-api
+
+# 子平台
+balck:
+  snapImgUrl: http://127.0.0.1:8090/api/shipface/snap/imgUrl?id=

+ 114 - 110
ruoyi-admin/src/main/resources/application-test.yml

@@ -1,119 +1,123 @@
 # 数据源配置
 spring:
-    datasource:
-        type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: com.mysql.cj.jdbc.Driver
-        druid:
-            # 主库数据源
-            master:
-                url: jdbc:mysql://200.200.19.126:3306/cbwqpf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: root
-                password: root
-            # 从库数据源(嗅探)
-            slaveais:
-                # 从数据源开关/默认关闭
-                enabled: true
-                url: jdbc:mysql://47.92.161.189:3306/ais_database?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: js_test
-                password: js123456
-            # 从库数据源(二氧化硫)
-            slaveso2:
-                # 从数据源开关/默认关闭
-                enabled: true
-                url: jdbc:mysql://200.200.19.126:3306/so2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: root
-                password: root
-            # 从库数据源(黑烟)
-            slaveblack:
-                # 从数据源开关/默认关闭
-                enabled: true
-                url: jdbc:mysql://200.200.19.126:3306/heiyan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: root
-                password: root
-            # 初始连接数
-            initialSize: 5
-            # 最小连接池数量
-            minIdle: 10
-            # 最大连接池数量
-            maxActive: 20
-            # 配置获取连接等待超时的时间
-            maxWait: 60000
-            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-            timeBetweenEvictionRunsMillis: 60000
-            # 配置一个连接在池中最小生存的时间,单位是毫秒
-            minEvictableIdleTimeMillis: 300000
-            # 配置一个连接在池中最大生存的时间,单位是毫秒
-            maxEvictableIdleTimeMillis: 900000
-            # 配置检测连接是否有效
-            validationQuery: SELECT 1 FROM DUAL
-            testWhileIdle: true
-            testOnBorrow: false
-            testOnReturn: false
-            webStatFilter:
-                enabled: true
-            statViewServlet:
-                enabled: true
-                # 设置白名单,不填则允许所有访问
-                allow:
-                url-pattern: /druid/*
-                # 控制台管理用户名和密码
-                login-username: ruoyi
-                login-password: 123456
-            filter:
-                stat:
-                    enabled: true
-                    # 慢SQL记录
-                    log-slow-sql: true
-                    slow-sql-millis: 1000
-                    merge-sql: true
-                wall:
-                    config:
-                        multi-statement-allow: true
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 主库数据源
+      master:
+        url: jdbc:mysql://200.200.19.126:3306/cbwqpf?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: root
+      # 从库数据源(嗅探)
+      slaveais:
+        # 从数据源开关/默认关闭
+        enabled: true
+        url: jdbc:mysql://47.92.161.189:3306/ais_database?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: js_test
+        password: js123456
+      # 从库数据源(二氧化硫)
+      slaveso2:
+        # 从数据源开关/默认关闭
+        enabled: true
+        url: jdbc:mysql://200.200.19.126:3306/so2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: root
+      # 从库数据源(黑烟)
+      slaveblack:
+        # 从数据源开关/默认关闭
+        enabled: true
+        url: jdbc:mysql://200.200.19.126:3306/heiyan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: root
+      # 初始连接数
+      initialSize: 5
+      # 最小连接池数量
+      minIdle: 10
+      # 最大连接池数量
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      # 配置一个连接在池中最大生存的时间,单位是毫秒
+      maxEvictableIdleTimeMillis: 900000
+      # 配置检测连接是否有效
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 设置白名单,不填则允许所有访问
+        allow:
+        url-pattern: /druid/*
+        # 控制台管理用户名和密码
+        login-username: ruoyi
+        login-password: 123456
+      filter:
+        stat:
+          enabled: true
+          # 慢SQL记录
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
 
-    # redis 配置
-    redis:
-        # 地址
-        host: localhost
-        # 端口,默认为6379
-        port: 6379
-        # 数据库索引
-        database: 0
-        # 密码
-        password:
-        # 连接超时时间
-        timeout: 10s
-        lettuce:
-            pool:
-                # 连接池中的最小空闲连接
-                min-idle: 0
-                # 连接池中的最大空闲连接
-                max-idle: 8
-                # 连接池的最大数据库连接数
-                max-active: 8
-                # #连接池最大阻塞等待时间(使用负值表示没有限制)
-                max-wait: -1ms
+  # redis 配置
+  redis:
+    # 地址
+    host: localhost
+    # 端口,默认为6379
+    port: 6379
+    # 数据库索引
+    database: 0
+    # 密码
+    password:
+    # 连接超时时间
+    timeout: 10s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 8
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1ms
 elasticsearch:
-    port: 9200
-    ip: 200.200.19.122
-    type: http  #访问方式
-    numberOfReplicas: 2  #副本数
-    numberOfShards: 5  #分片数
-    defaultIndex: materials  #默认加载索引
-    searchTimeOut: 10    #搜索超时时长,单位:秒
-    masterShardTimeOut: 1 #主分片执行更新的超时时长 ,单位:秒
+  port: 9200
+  ip: 200.200.19.122
+  type: http  #访问方式
+  numberOfReplicas: 2  #副本数
+  numberOfShards: 5  #分片数
+  defaultIndex: materials  #默认加载索引
+  searchTimeOut: 10    #搜索超时时长,单位:秒
+  masterShardTimeOut: 1 #主分片执行更新的超时时长 ,单位:秒
 
 canal:
-    configs:
-        - hostname: 127.0.0.1
-          port: 11111
-          destination: heiyan
-        - hostname: 127.0.0.1
-          port: 11111
-          destination: so2
+  configs:
+    - hostname: 127.0.0.1
+      port: 11111
+      destination: heiyan
+    - hostname: 127.0.0.1
+      port: 11111
+      destination: so2
 
 # Swagger配置
 swagger:
-    # 是否开启swagger
-    enabled: true
-    # 请求前缀
-    pathMapping: /dev-api
+  # 是否开启swagger
+  enabled: true
+  # 请求前缀
+  pathMapping: /dev-api
+
+# 子平台
+balck:
+  snapImgUrl: http://127.0.0.1:8090/api/shipface/snap/imgUrl?id=

+ 4 - 3
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ElasticSearchClient.java

@@ -378,12 +378,12 @@ public class ElasticSearchClient {
      * @return
      * @Description ElasticSearch条件查询
      */
-    public Map<String, Object> searchDocument(String indexName,
-                                              Map<String, Object> equalsCondition,
+    public Map<String, Object> searchDocument(Map<String, Object> equalsCondition,
                                               Map<String, Object> rangeCondition,
                                               List<String> orderBy,
                                               Integer pageNum,
-                                              Integer pageSize) {
+                                              Integer pageSize,
+                                              String... indexName) {
         Map<String, Object> resultMap = new HashMap<>(8);
         List<Map<String, Object>> queryResult = new ArrayList<>();
         long totalNum = 0;
@@ -620,6 +620,7 @@ public class ElasticSearchClient {
 
     /**
      * 查询数量(跨索引)
+     *
      * @param equalsCondition
      * @param rangeCondition
      * @param indexName

+ 134 - 43
ruoyi-system/src/main/java/com/ruoyi/system/domain/ShipRecognition.java

@@ -9,172 +9,263 @@ import java.math.BigDecimal;
 
 /**
  * 船舶信息对象 ship_recognition
- * 
+ *
  * @author ruoyi
  * @date 2021-08-24
  */
 @EqualsAndHashCode(callSuper = true)
 @Data
-public class ShipRecognition extends BaseEntity
-{
+public class ShipRecognition extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 主键 */
+    /**
+     * 主键
+     */
     private Long id;
 
-    /** AIS船舶距离, 单位:m */
+    /**
+     * AIS船舶距离, 单位:m
+     */
     @Excel(name = "船舶距离, 单位:m")
     private BigDecimal aisDist;
 
-    /** AIS吃水, 单位:m */
+    /**
+     * AIS吃水, 单位:m
+     */
     @Excel(name = "吃水, 单位:m")
     private BigDecimal aisDrt;
 
-    /** AIS目的地 */
+    /**
+     * AIS目的地
+     */
     @Excel(name = "目的地")
     private String aisDst;
 
-    /** 9位码。例如412119710, 0或null表示AIS未开启 */
+    /**
+     * 9位码。例如412119710, 0或null表示AIS未开启
+     */
     @Excel(name = "MMSI")
     private Long aisMmsi;
 
-    /** AIS船长, 单位:m */
+    /**
+     * AIS船长, 单位:m
+     */
     @Excel(name = "船长, 单位:m")
     private Long aisShipLen;
 
-    /** 可能是中文,AIS船名,为拼音。例如SU SU HUO 009 */
+    /**
+     * 可能是中文,AIS船名,为拼音。例如SU SU HUO 009
+     */
     @Excel(name = "船名")
     private String aisShipName;
 
-    /** AIS船速, 单位:m/s */
+    /**
+     * AIS船速, 单位:m/s
+     */
     @Excel(name = "船速, 单位:m/s")
     private BigDecimal aisShipSpd;
 
-    /** AIS船舶类型 */
+    /**
+     * AIS船舶类型
+     */
     @Excel(name = "船舶类型")
     private String aisShipType;
 
-    /** AIS船宽, 单位:m */
+    /**
+     * AIS船宽, 单位:m
+     */
     @Excel(name = "船宽, 单位:m")
     private Long aisShipWidth;
 
-    /** 尺寸异常 */
+    /**
+     * 尺寸异常
+     */
     @Excel(name = "尺寸异常")
     private Long isAbnormalSize;
 
-    /** AIS纬度,单位:度 */
+    /**
+     * AIS纬度,单位:度
+     */
     @Excel(name = "纬度,单位:度")
     private BigDecimal latitude;
 
-    /** 黑烟:度数 */
+    /**
+     * 黑烟:度数
+     */
     @Excel(name = "黑烟:度数")
     private Long rcgSoot;
 
-    /** 船舶过闸闸次 */
+    /**
+     * 船舶过闸闸次
+     */
     @Excel(name = "船舶过闸闸次")
     private Long lockSeq;
 
-    /** AIS经度,单位:度 */
+    /**
+     * AIS经度,单位:度
+     */
     @Excel(name = "经度,单位:度")
     private BigDecimal longitude;
 
-    /** 图像识别得到的载货类型。例如:钢筋,砂石。 */
+    /**
+     * 图像识别得到的载货类型。例如:钢筋,砂石。
+     */
     @Excel(name = "图像识别载货类型")
     private String rcgCargoType;
 
-    /** 图像识别得到的船舶载重吨位, 单位:t */
+    /**
+     * 图像识别得到的船舶载重吨位, 单位:t
+     */
     @Excel(name = "图像识别船舶载重吨位, 单位:t")
     private BigDecimal rcgDeadweightTon;
 
-    /** 图像识别得到的,船舶距离相机直线距离。单位:m */
+    /**
+     * 图像识别得到的,船舶距离相机直线距离。单位:m
+     */
     @Excel(name = "图像识别船舶距离相机直线距离。单位:m")
     private BigDecimal rcgDist;
 
-    /** 图像识别得到的船舶吃水, 单位:m */
+    /**
+     * 图像识别得到的船舶吃水, 单位:m
+     */
     @Excel(name = "图像识别船舶吃水, 单位:m")
     private BigDecimal rcgDrt;
 
-    /** 是否为船队。0 否,即单机船; 1 是,即为船队 */
+    /**
+     * 是否为船队。0 否,即单机船; 1 是,即为船队
+     */
     @Excel(name = "是否为船队。0 否,即单机船; 1 是,即为船队")
     private Long rcgIsFleet;
 
-    /** UNKNOWN 未知, EMPTY_LOAD 空载, HEAVY_LOAD 重载, OVER_LOAD 超载 */
+    /**
+     * UNKNOWN 未知, EMPTY_LOAD 空载, HEAVY_LOAD 重载, OVER_LOAD 超载
+     */
     @Excel(name = "UNKNOWN 未知, EMPTY_LOAD 空载, HEAVY_LOAD 重载, OVER_LOAD 超载")
     private String rcgLoadSts;
 
-    /** 图像识别得到的船舶水面上高度,单位:m */
+    /**
+     * 图像识别得到的船舶水面上高度,单位:m
+     */
     @Excel(name = "图像识别船舶水面上高度,单位:m")
     private BigDecimal rcgShipHeightAboveWater;
 
-    /** 图像识别得到的船长,单位:m */
+    /**
+     * 图像识别得到的船长,单位:m
+     */
     @Excel(name = "图像识别船长,单位:m")
     private BigDecimal rcgShipLen;
 
-    /** 图像识别得到的船名, 中文, 如: 苏宿货009 */
+    /**
+     * 图像识别得到的船名, 中文, 如: 苏宿货009
+     */
     @Excel(name = "图像识别船名")
     private String rcgShipName;
 
-    /** 图像识别得到的速度,带符号,单位m/s */
+    /**
+     * 图像识别得到的速度,带符号,单位m/s
+     */
     @Excel(name = "图像识别速度,单位m/s")
     private BigDecimal rcgShipSpd;
 
-    /** 图像识别得到的船舶类型。例如: 货船,集装箱船,危化品船 */
+    /**
+     * 图像识别得到的船舶类型。例如: 货船,集装箱船,危化品船
+     */
     @Excel(name = "图像识别船舶类型")
     private String rcgShipType;
 
-    /** 图像识别得到的船宽,单位:m */
+    /**
+     * 图像识别得到的船宽,单位:m
+     */
     @Excel(name = "图像识别船宽,单位:m")
     private BigDecimal rcgShipWidth;
 
-    /** 船籍港 */
+    /**
+     * 船籍港
+     */
     @Excel(name = "船籍港")
     private String regportName;
 
-    /** 抓拍图片路径 */
+    /**
+     * 抓拍图片路径
+     */
     @Excel(name = "抓拍图片路径")
     private String snapImPath;
 
-    /** 抓拍地点 */
+    /**
+     * 抓拍地点
+     */
     @Excel(name = "抓拍地点")
     private String snapPos;
 
-    /** 抓拍时间 */
+    /**
+     * 抓拍时间
+     */
     private String snapTime;
 
-    /** 抓拍时间统一格式: 2020-12-12 12:00:11 */
+    /**
+     * 抓拍时间统一格式: 2020-12-12 12:00:11
+     */
     @Excel(name = "抓拍时间")
     private String snapTimeFmt;
 
-    /** 状态 */
+    /**
+     * 状态
+     */
     @Excel(name = "状态")
     private String status;
 
-    /** 船名特征信息 */
+    /**
+     * 船名特征信息
+     */
     @Excel(name = "船名特征信息")
     private String textFeatureLabel;
 
-    /** 船名识别原图url */
+    /**
+     * 船名识别原图url
+     */
     @Excel(name = "船名识别原图url")
     private String textImgUrl;
 
-    /** 图像识别得到的船舶详细类型 */
+    /**
+     * 图像识别得到的船舶详细类型
+     */
     @Excel(name = "图像识别得到的船舶详细类型")
     private String rcgShipTypeDetail;
 
-    /** useWarn: true, 使用外部输入预警信息 */
+    /**
+     * useWarn: true, 使用外部输入预警信息
+     */
     @Excel(name = "使用外部输入预警信息")
     private Long useWarn;
 
-    /** 外部输入报警信息详情 */
+    /**
+     * 外部输入报警信息详情
+     */
     @Excel(name = "外部输入报警信息详情")
     private String warnLabelList;
 
-    /** 二维码识别内容 */
+    /**
+     * 二维码识别内容
+     */
     @Excel(name = "二维码识别内容")
     private String qrcode;
 
-    /** 船名方向 */
+    /**
+     * 船名方向
+     */
     @Excel(name = "船名方向")
     private String shipNameDirection;
 
+    @Excel(name = "正确率更高的船名")
+    private String shipNameValid;
+
+    @Excel(name = "黑烟度数特征信息")
+    private String sootFeatureLabel;
+
+    @Excel(name = "黑烟度数原图url")
+    private String sootImgUrl;
+
+    @Excel(name = "所有图片")
+    private String allImgUrl;
+
 }

+ 4 - 1
ruoyi-system/src/main/resources/mapper/system/GasCommonMapper.xml

@@ -94,7 +94,10 @@
         useWarn,
         warnLabelList,
         qrcode,
-        shipNameDirection
+        shipNameDirection,
+        shipNameValid,
+        sootFeatureLabel,
+        sootImgUrl
         from ship_recognition
         <where>
             <if test="syncPost.startTime != null and syncPost.startTime != ''">