459242451@qq.com 3 years ago
parent
commit
45c762103b

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

@@ -59,13 +59,16 @@ public class BlackGasController extends BaseController {
         Map<String, Object> params = shipRecognition.getParams();
         Map<String, Object> equalsCondition = new HashMap<>();
         // 组装查询条件
-        equalsCondition.put("mmsi", ObjectUtil.isEmpty(shipRecognition.getMmsi()) ? null : StrUtil.concat(true, "*", Convert.toStr(shipRecognition.getMmsi()), "*"));
+        equalsCondition.put("mmsi", StrUtil.isBlank(shipRecognition.getMmsi()) ? null : StrUtil.concat(true, "*", shipRecognition.getMmsi(), "*"));
         equalsCondition.put("shipName", StrUtil.isBlank(shipRecognition.getShipName()) ? null : StrUtil.concat(true, "*", shipRecognition.getShipName(), "*"));
         equalsCondition.put("monitorPointName", StrUtil.isBlank(shipRecognition.getMonitorPointName()) ? null : StrUtil.concat(true, "*", shipRecognition.getMonitorPointName(), "*"));
         equalsCondition.put("shipRegionType", shipRecognition.getShipRegionType());
         equalsCondition.put("rcgSoot", shipRecognition.getRcgSoot());
         equalsCondition.put("illegalStatus", shipRecognition.getIllegalStatus());
         equalsCondition.put("orgName", shipRecognition.getOrgName());
+        if (StrUtil.isNotBlank(shipRecognition.getFilterMmsi()) && StrUtil.isBlank(shipRecognition.getMmsi())) {
+            equalsCondition.put("mmsi", shipRecognition.getFilterMmsi());
+        }
         // 组装范围查询条件
         Map<String, Object> rangeCondition = new HashMap<>();
         if (ObjectUtil.isNotEmpty(params.get("beginTime"))) {
@@ -97,12 +100,16 @@ public class BlackGasController extends BaseController {
         Map<String, Object> params = shipRecognition.getParams();
         Map<String, Object> equalsCondition = new HashMap<>();
         // 组装查询条件
-        equalsCondition.put("aisMmsi", ObjectUtil.isEmpty(shipRecognition.getAisMmsi()) ? null : StrUtil.concat(true, "*", Convert.toStr(shipRecognition.getAisMmsi()), "*"));
-        equalsCondition.put("aisShipName", StrUtil.isBlank(shipRecognition.getAisShipName()) ? null : StrUtil.concat(true, "*", shipRecognition.getAisShipName(), "*"));
-        equalsCondition.put("snapPos", StrUtil.isBlank(shipRecognition.getSnapPos()) ? null : StrUtil.concat(true, "*", shipRecognition.getSnapPos(), "*"));
-        equalsCondition.put("aisDst", StrUtil.isBlank(shipRecognition.getAisDst()) ? null : StrUtil.concat(true, "*", shipRecognition.getAisDst(), "*"));
-        equalsCondition.put("aisShipType", StrUtil.isBlank(shipRecognition.getAisShipType()) ? null : StrUtil.concat(true, "*", shipRecognition.getAisShipType(), "*"));
+        equalsCondition.put("mmsi", StrUtil.isBlank(shipRecognition.getMmsi()) ? null : StrUtil.concat(true, "*", shipRecognition.getMmsi(), "*"));
+        equalsCondition.put("shipName", StrUtil.isBlank(shipRecognition.getShipName()) ? null : StrUtil.concat(true, "*", shipRecognition.getShipName(), "*"));
+        equalsCondition.put("monitorPointName", StrUtil.isBlank(shipRecognition.getMonitorPointName()) ? null : StrUtil.concat(true, "*", shipRecognition.getMonitorPointName(), "*"));
+        equalsCondition.put("shipRegionType", shipRecognition.getShipRegionType());
         equalsCondition.put("rcgSoot", shipRecognition.getRcgSoot());
+        equalsCondition.put("illegalStatus", shipRecognition.getIllegalStatus());
+        equalsCondition.put("orgName", shipRecognition.getOrgName());
+        if (StrUtil.isNotBlank(shipRecognition.getFilterMmsi()) && StrUtil.isBlank(shipRecognition.getMmsi())) {
+            equalsCondition.put("mmsi", shipRecognition.getFilterMmsi());
+        }
         // 组装范围查询条件
         Map<String, Object> rangeCondition = new HashMap<>();
         if (ObjectUtil.isNotEmpty(params.get("beginTime"))) {
@@ -111,10 +118,11 @@ public class BlackGasController extends BaseController {
         if (ObjectUtil.isNotEmpty(params.get("endTime"))) {
             params.put("endTime", params.get("endTime") + " 23:59:59");
         }
-        rangeCondition.put("snapTimeFmt", StrUtil.concat(true, "[", Convert.toStr(params.get("beginTime")), ",", Convert.toStr(params.get("endTime")), "]"));
+        rangeCondition.put("createTime", 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(equalsCondition, rangeCondition, orderBy, 0, 10000, ElasticConstants.HEIYAN_SHIP_RECOGNITION);
+        orderBy.add("-createTime");
+        PageDomain pageDomain = TableSupport.buildPageRequest();
+        Map<String, Object> maps = client.searchDocument(equalsCondition, rangeCondition, orderBy, pageDomain.getPageNum(), pageDomain.getPageSize(), ElasticConstants.HEIYAN_SHIP_RECOGNITION);
         ExcelUtil<ShipRecognition> util = new ExcelUtil<>(ShipRecognition.class);
         util.exportExcelByEasyPoi("黑烟违规数据_" + DateUtil.today(),
                 "黑烟违规数据",

+ 40 - 42
ruoyi-admin/src/main/java/com/ruoyi/web/controller/gas/GasCommonController.java

@@ -292,9 +292,9 @@ public class GasCommonController {
                     illegalInfo.setLat(aisShip.getLat());
                     illegalInfo.setLng(aisShip.getLng());
                     illegalInfo.setReceive(aisShip.getReceive());
-                    illegalInfo.setHead(aisShip.getHead());
-                    illegalInfo.setSpeed(aisShip.getSpeed());
-                    illegalInfo.setCourse(aisShip.getCourse());
+                    illegalInfo.setHead(ObjectUtil.isEmpty(aisShip.getHead()) ? "-" : aisShip.getHead() + "");
+                    illegalInfo.setSpeed(ObjectUtil.isEmpty(aisShip.getSpeed()) ? "-" : aisShip.getSpeed() + "节");
+                    illegalInfo.setCourse(ObjectUtil.isEmpty(aisShip.getCourse()) ? "-" : aisShip.getCourse() + "");
                 }
             }
         }
@@ -347,10 +347,10 @@ public class GasCommonController {
         put("苏通大桥", "常熟海事局");
     }};
     public final static Map<String, String> heiyanDeviceMap = new HashMap<String, String>() {{
-        put("南京三桥", "65");
-        put("润扬大桥", "66");
-        put("江阴大桥", "67");
-        put("苏通大桥", "68");
+        put("南京三桥", "1106");
+        put("润扬大桥", "2104");
+        put("江阴大桥", "6106");
+        put("苏通大桥", "9108");
     }};
 
     @GetMapping("/queryData")
@@ -407,22 +407,18 @@ public class GasCommonController {
             // 嗅探系统-违规船舶
             if ("prod".equals(env)) {
                 // 查询检测点和船舶信息、船舶进出港记录
-                if (ObjectUtil.isNotEmpty(afterDataMap.get("shipMmsi"))) {
-                    AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("shipMmsi")), "", "");
-                    if (shipInfo != null) {
-                        afterDataMap.put("shipName", shipInfo.getShipName());
-                        afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
-                    }
+                AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                if (shipInfo != null) {
+                    afterDataMap.put("shipName", shipInfo.getShipName());
+                    afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
                 }
             }
             if (ObjectUtil.isNotEmpty(afterDataMap.get("sPercent")) && NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(afterDataMap.get("sPercent")), Convert.toBigDecimal(so2ThresholdVal))) {
                 // 查询检测点和船舶信息、船舶进出港记录
-                if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi"))) {
-                    ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.lastWeek()), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
-                    if (eepReportRecInfo != null) {
-                        afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
-                        afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
-                    }
+                ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.offsetDay(new Date(), -20)), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                if (eepReportRecInfo != null) {
+                    afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
+                    afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
                 }
                 afterDataMap.put("deviceId", afterDataMap.get("semId"));
                 // 查询站点信息
@@ -456,29 +452,19 @@ public class GasCommonController {
 
             // 船舶记录
             if ("prod".equals(env)) {
-                if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi"))) {
-                    AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
-                    if (shipInfo != null) {
-                        afterDataMap.put("shipName", shipInfo.getShipName());
-                        afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
-                    }
+                AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                if (shipInfo != null) {
+                    afterDataMap.put("shipName", shipInfo.getShipName());
+                    afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
                 }
             }
             // 判断是否大于阈值
             if (ObjectUtil.isNotEmpty(afterDataMap.get("so2Percent")) && NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(afterDataMap.get("so2Percent")), Convert.toBigDecimal(so2ThresholdVal))) {
                 // 查询检测点和船舶信息、船舶进出港记录
-                if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi"))) {
-                    ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.lastWeek()), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
-                    if (eepReportRecInfo != null) {
-                        afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
-                        afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
-                    }
-                }
-                Map<String, Object> monitor = client.getDocById(ElasticConstants.SO2_MONITOR_POINT, Convert.toStr(afterDataMap.get("monitorPointId")), "name");
-                if (monitor != null && ObjectUtil.equal(monitor.get("code"), 200)) {
-                    Map<String, String> data = Convert.toMap(String.class, String.class, monitor.get("data"));
-                    afterDataMap.put("monitorPointName", data.get("name"));
-                    afterDataMap.put("orgName", orgMap.get(data.get("name")));
+                ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.offsetDay(new Date(), -20)), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                if (eepReportRecInfo != null) {
+                    afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
+                    afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
                 }
 
                 // 嫌疑船舶
@@ -490,6 +476,12 @@ public class GasCommonController {
                 afterDataMap.put("uploadFlag", 0);
                 afterDataMap.put("illegalStatus", 1);
             }
+            Map<String, Object> monitor = client.getDocById(ElasticConstants.SO2_MONITOR_POINT, Convert.toStr(afterDataMap.get("monitorPointId")), "name");
+            if (monitor != null && ObjectUtil.equal(monitor.get("code"), 200)) {
+                Map<String, String> data = Convert.toMap(String.class, String.class, monitor.get("data"));
+                afterDataMap.put("monitorPointName", data.get("name"));
+                afterDataMap.put("orgName", orgMap.get(data.get("name")));
+            }
             if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi"))) {
                 aisInfoService.getDynamicShipInfo(Convert.toStr(afterDataMap.get("mmsi")));
             }
@@ -501,7 +493,7 @@ public class GasCommonController {
         } else if (ElasticConstants.HEIYAN_SHIP_RECOGNITION.equals(index)) {
             Map<String, Object> afterDataMap = heiYanService.queryById(id);
 
-            if (ObjectUtil.isEmpty(afterDataMap.get("aisMmsi")) /*|| Convert.toStr(afterDataMap.get("aisMmsi")).length() != 9*/) {
+            if (ObjectUtil.isEmpty(afterDataMap.get("mmsi"))) {
                 return;
             }
             // 判断数据状态
@@ -526,6 +518,12 @@ public class GasCommonController {
                         afterDataMap.put("allImgUrl", newImgList);
                     }
                 }
+                // 查询检测点和船舶信息、船舶进出港记录
+                ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.offsetDay(new Date(), -20)), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                if (eepReportRecInfo != null) {
+                    afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
+                    afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
+                }
                 // 超过阈值后直接判定为违规船舶
                 afterDataMap.put("illegalStatus", 3);
                 afterDataMap.put("uploadFlag", 0);
@@ -535,13 +533,13 @@ public class GasCommonController {
                 afterDataMap.put("uploadFlag", 0);
                 afterDataMap.put("illegalStatus", 1);
             }
-            if (ObjectUtil.isNotEmpty(afterDataMap.get("aisMmsi")) && Convert.toStr(afterDataMap.get("aisMmsi")).length() == 9) {
-                aisInfoService.getDynamicShipInfo(Convert.toStr(afterDataMap.get("aisMmsi")));
+            if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi")) && Convert.toStr(afterDataMap.get("mmsi")).length() == 9) {
+                aisInfoService.getDynamicShipInfo(Convert.toStr(afterDataMap.get("mmsi")));
             }
             afterDataMap.put("illegalType", "heiyan");
             // 查询检测点和船舶信息
-            if (ObjectUtil.isNotEmpty(afterDataMap.get("aisMmsi")) && !"0".equals(Convert.toStr(afterDataMap.get("aisMmsi")))) {
-                AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("aisMmsi")), "", "");
+            if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi")) && !"0".equals(Convert.toStr(afterDataMap.get("mmsi")))) {
+                AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
                 if (shipInfo != null) {
                     afterDataMap.put("shipName", shipInfo.getShipName());
                     afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());

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

@@ -70,7 +70,7 @@ public class So2Controller extends BaseController {
         Map<String, Object> params = illegalShip.getParams();
         Map<String, Object> equalsCondition = new HashMap<>();
         // 组装查询条件
-        equalsCondition.put("mmsi", ObjectUtil.isEmpty(illegalShip.getMmsi()) ? null : StrUtil.concat(true, "*", Convert.toStr(illegalShip.getMmsi()), "*"));
+        equalsCondition.put("mmsi", StrUtil.isBlank(illegalShip.getMmsi()) ? null : StrUtil.concat(true, "*", illegalShip.getMmsi(), "*"));
         equalsCondition.put("shipName", StrUtil.isBlank(illegalShip.getShipName()) ? null : StrUtil.concat(true, "*", illegalShip.getShipName(), "*"));
         equalsCondition.put("shipRegionType", illegalShip.getShipRegionType());
         equalsCondition.put("destination", StrUtil.isBlank(illegalShip.getDestination()) ? null : StrUtil.concat(true, "*", illegalShip.getDestination(), "*"));
@@ -81,6 +81,9 @@ public class So2Controller extends BaseController {
         equalsCondition.put("uploadResult", illegalShip.getUploadResult());
         equalsCondition.put("illegalType", illegalShip.getIllegalType());
         equalsCondition.put("monitorPointName", illegalShip.getMonitorPointName());
+        if (StrUtil.isNotBlank(illegalShip.getFilterMmsi()) && StrUtil.isBlank(illegalShip.getMmsi())) {
+            equalsCondition.put("mmsi", illegalShip.getFilterMmsi());
+        }
         // 组装范围查询条件
         Map<String, Object> rangeCondition = new HashMap<>();
         if (ObjectUtil.isNotEmpty(params.get("beginTime"))) {

+ 59 - 60
ruoyi-admin/src/main/java/com/ruoyi/web/job/CanalScheduling.java

@@ -43,6 +43,7 @@ import org.springframework.util.LinkedCaseInsensitiveMap;
 
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -88,10 +89,10 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
         put("苏通大桥", "常熟海事局");
     }};
     public final static Map<String, String> heiyanDeviceMap = new HashMap<String, String>() {{
-        put("南京三桥", "65");
-        put("润扬大桥", "66");
-        put("江阴大桥", "67");
-        put("苏通大桥", "68");
+        put("南京三桥", "1106");
+        put("润扬大桥", "2104");
+        put("江阴大桥", "6106");
+        put("苏通大桥", "9108");
     }};
 
     @Override
@@ -206,7 +207,11 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
             case INSERT:
                 // 黑烟船舶数据入库
                 if (StrUtil.equalsIgnoreCase(database, "smoke_api") && StrUtil.equalsIgnoreCase(table, "ship_recognition")) {
-                    if (ObjectUtil.isEmpty(afterDataMap.get("aisMmsi")) /*|| Convert.toStr(afterDataMap.get("aisMmsi")).length() != 9*/) {
+                    afterDataMap.put("mmsi", afterDataMap.get("aisMmsi"));
+                    afterDataMap.put("illegalType", "heiyan");
+                    afterDataMap.put("createTime", afterDataMap.get("snapTimeFmt"));
+                    afterDataMap.put("monitorPointName", afterDataMap.get("snapPos"));
+                    if (ObjectUtil.isEmpty(afterDataMap.get("mmsi")) /*|| Convert.toStr(afterDataMap.get("mmsi")).length() != 9*/) {
                         break;
                     }
                     // 判断数据状态
@@ -231,6 +236,12 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
                                 afterDataMap.put("allImgUrl", newImgList);
                             }
                         }
+                        // 查询检测点和船舶信息、船舶进出港记录
+                        ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.offsetDay(new Date(), -20)), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                        if (eepReportRecInfo != null) {
+                            afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
+                            afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
+                        }
                         // 超过阈值后直接判定为违规船舶
                         afterDataMap.put("illegalStatus", 3);
                         afterDataMap.put("uploadFlag", 0);
@@ -240,18 +251,15 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
                         afterDataMap.put("uploadFlag", 0);
                         afterDataMap.put("illegalStatus", 1);
                     }
-                    if (ObjectUtil.isNotEmpty(afterDataMap.get("aisMmsi")) && Convert.toStr(afterDataMap.get("aisMmsi")).length() == 9) {
-                        aisInfoService.getDynamicShipInfo(Convert.toStr(afterDataMap.get("aisMmsi")));
+                    if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi")) && Convert.toStr(afterDataMap.get("mmsi")).length() == 9) {
+                        aisInfoService.getDynamicShipInfo(Convert.toStr(afterDataMap.get("mmsi")));
                     }
-                    afterDataMap.put("mmsi", afterDataMap.get("aisMmsi"));
-                    afterDataMap.put("illegalType", "heiyan");
+
                     // 查询检测点和船舶信息
-                    if (ObjectUtil.isNotEmpty(afterDataMap.get("aisMmsi")) && !"0".equals(Convert.toStr(afterDataMap.get("aisMmsi")))) {
-                        AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("aisMmsi")), "", "");
-                        if (shipInfo != null) {
-                            afterDataMap.put("shipName", shipInfo.getShipName());
-                            afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
-                        }
+                    AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                    if (shipInfo != null) {
+                        afterDataMap.put("shipName", shipInfo.getShipName());
+                        afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
                     }
                     // 对于没有从ais系统拿到船名的情况下,直接取rcgShipName
                     if (ObjectUtil.isEmpty(afterDataMap.get("shipName"))) {
@@ -262,8 +270,7 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
                         afterDataMap.put("orgName", orgMap.get(Convert.toStr(afterDataMap.get("snapPos"))));
                         afterDataMap.put("deviceId", heiyanDeviceMap.get(Convert.toStr(afterDataMap.get("snapPos"))));
                     }
-                    afterDataMap.put("createTime", afterDataMap.get("snapTimeFmt"));
-                    afterDataMap.put("monitorPointName", afterDataMap.get("snapPos"));
+
                     // 保存数据
                     saveIllegalData(afterDataMap, ElasticConstants.HEIYAN_SHIP_RECOGNITION);
                     client.createDocument(ElasticConstants.HEIYAN_SHIP_RECOGNITION, Convert.toStr(afterDataMap.get("id")), afterDataMap);
@@ -286,29 +293,19 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
                 } else if (StrUtil.equalsIgnoreCase(database, "ship") && StrUtil.equalsIgnoreCase(table, "alert")) {
                     // 船舶记录
                     if ("prod".equals(env)) {
-                        if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi"))) {
-                            AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
-                            if (shipInfo != null) {
-                                afterDataMap.put("shipName", shipInfo.getShipName());
-                                afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
-                            }
+                        AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                        if (shipInfo != null) {
+                            afterDataMap.put("shipName", shipInfo.getShipName());
+                            afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
                         }
                     }
                     // 判断是否大于阈值
                     if (ObjectUtil.isNotEmpty(afterDataMap.get("so2Percent")) && NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(afterDataMap.get("so2Percent")), Convert.toBigDecimal(so2ThresholdVal))) {
                         // 查询检测点和船舶信息、船舶进出港记录
-                        if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi"))) {
-                            ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.lastWeek()), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
-                            if (eepReportRecInfo != null) {
-                                afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
-                                afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
-                            }
-                        }
-                        Map<String, Object> monitor = client.getDocById(ElasticConstants.SO2_MONITOR_POINT, Convert.toStr(afterDataMap.get("monitorPointId")), "name");
-                        if (monitor != null && ObjectUtil.equal(monitor.get("code"), 200)) {
-                            Map<String, String> data = Convert.toMap(String.class, String.class, monitor.get("data"));
-                            afterDataMap.put("monitorPointName", data.get("name"));
-                            afterDataMap.put("orgName", orgMap.get(data.get("name")));
+                        ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.offsetDay(new Date(), -20)), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                        if (eepReportRecInfo != null) {
+                            afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
+                            afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
                         }
 
                         // 嫌疑船舶
@@ -320,6 +317,12 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
                         afterDataMap.put("uploadFlag", 0);
                         afterDataMap.put("illegalStatus", 1);
                     }
+                    Map<String, Object> monitor = client.getDocById(ElasticConstants.SO2_MONITOR_POINT, Convert.toStr(afterDataMap.get("monitorPointId")), "name");
+                    if (monitor != null && ObjectUtil.equal(monitor.get("code"), 200)) {
+                        Map<String, String> data = Convert.toMap(String.class, String.class, monitor.get("data"));
+                        afterDataMap.put("monitorPointName", data.get("name"));
+                        afterDataMap.put("orgName", orgMap.get(data.get("name")));
+                    }
                     if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi")) && Convert.toStr(afterDataMap.get("mmsi")).length() == 9) {
                         aisInfoService.getDynamicShipInfo(Convert.toStr(afterDataMap.get("mmsi")));
                     }
@@ -336,38 +339,25 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
                             CacheConstants.DEVICE_LIST_STATIC));
                 } else if (StrUtil.equalsIgnoreCase(database, "ais_database") && StrUtil.equalsIgnoreCase(table, "illegal_ship")) {
                     // 嗅探系统-违规船舶
+                    afterDataMap.put("mmsi", afterDataMap.get("shipMmsi"));
+                    afterDataMap.put("createTime", afterDataMap.get("peakTime"));
+                    afterDataMap.put("so2Percent", afterDataMap.get("sPercent"));
                     if ("prod".equals(env)) {
                         // 查询检测点和船舶信息、船舶进出港记录
-                        if (ObjectUtil.isNotEmpty(afterDataMap.get("shipMmsi"))) {
-                            AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("shipMmsi")), "", "");
-                            if (shipInfo != null) {
-                                afterDataMap.put("shipName", shipInfo.getShipName());
-                                afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
-                            }
+                        AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                        if (shipInfo != null) {
+                            afterDataMap.put("shipName", shipInfo.getShipName());
+                            afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
                         }
                     }
-                    afterDataMap.put("mmsi", afterDataMap.get("shipMmsi"));
-                    afterDataMap.put("createTime", afterDataMap.get("peakTime"));
-                    afterDataMap.put("so2Percent", afterDataMap.get("sPercent"));
                     if (ObjectUtil.isNotEmpty(afterDataMap.get("sPercent")) && NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(afterDataMap.get("sPercent")), Convert.toBigDecimal(so2ThresholdVal))) {
                         // 查询检测点和船舶信息、船舶进出港记录
-                        if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi"))) {
-                            ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.lastWeek()), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
-                            if (eepReportRecInfo != null) {
-                                afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
-                                afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
-                            }
-                        }
-                        afterDataMap.put("deviceId", afterDataMap.get("semId"));
-                        // 查询站点信息
-                        Map<String, Object> sem = client.getDocById(ElasticConstants.AIS_SEM_INSTRUMENT, Convert.toStr(afterDataMap.get("semId")), "name,category");
-                        if (sem != null && ObjectUtil.equal(sem.get("code"), 200)) {
-                            Map<String, String> data = Convert.toMap(String.class, String.class, sem.get("data"));
-                            afterDataMap.put("semName", data.get("name"));
-                            afterDataMap.put("monitorPointName", data.get("category"));
-                            afterDataMap.put("orgName", orgMap.get(data.get("category")));
+                        ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.offsetDay(new Date(), -20)), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "",
+                                "");
+                        if (eepReportRecInfo != null) {
+                            afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
+                            afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
                         }
-
                         // 嫌疑船舶
                         afterDataMap.put("illegalStatus", 2);
                         afterDataMap.put("uploadFlag", 0);
@@ -377,6 +367,15 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
                         afterDataMap.put("uploadFlag", 0);
                         afterDataMap.put("illegalStatus", 1);
                     }
+                    afterDataMap.put("deviceId", afterDataMap.get("semId"));
+                    // 查询站点信息
+                    Map<String, Object> sem = client.getDocById(ElasticConstants.AIS_SEM_INSTRUMENT, Convert.toStr(afterDataMap.get("semId")), "name,category");
+                    if (sem != null && ObjectUtil.equal(sem.get("code"), 200)) {
+                        Map<String, String> data = Convert.toMap(String.class, String.class, sem.get("data"));
+                        afterDataMap.put("semName", data.get("name"));
+                        afterDataMap.put("monitorPointName", data.get("category"));
+                        afterDataMap.put("orgName", orgMap.get(data.get("category")));
+                    }
                     if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi")) && Convert.toStr(afterDataMap.get("mmsi")).length() == 9) {
                         aisInfoService.getDynamicShipInfo(Convert.toStr(afterDataMap.get("mmsi")));
                     }

+ 12 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/job/GetDynamicShip.java

@@ -8,6 +8,7 @@ import com.ruoyi.common.constant.ElasticConstants;
 import com.ruoyi.framework.config.ElasticSearchClient;
 import com.ruoyi.system.domain.IllegalInfo;
 import com.ruoyi.system.service.IAisInfoService;
+import com.ruoyi.system.service.IAisShipService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -33,6 +34,8 @@ public class GetDynamicShip {
     @Autowired
     private IAisInfoService aisInfoService;
     @Autowired
+    private IAisShipService aisShipService;
+    @Autowired
     private ElasticSearchClient client;
     private static final int SIZE = 50;
 
@@ -111,4 +114,13 @@ public class GetDynamicShip {
         log.info("获取船舶实时位置任务结束!");
     }
 
+    /**
+     * 删除历史某些数据
+     *
+     * @param day 删除多少天前的数据
+     */
+    public void delete(int day) {
+        aisShipService.deleteByDay(day);
+    }
+
 }

+ 61 - 20
ruoyi-admin/src/main/java/com/ruoyi/web/service/Impl/GasCommonServiceImpl.java

@@ -4,17 +4,25 @@ import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.ruoyi.common.constant.ElasticConstants;
 import com.ruoyi.framework.config.ElasticSearchClient;
 import com.ruoyi.system.domain.SyncPost;
+import com.ruoyi.system.domain.vo.AisShipInfo;
 import com.ruoyi.system.mapper.GasCommonMapper;
+import com.ruoyi.system.service.IAisInfoService;
 import com.ruoyi.web.service.IGasCommonService;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -33,6 +41,12 @@ public class GasCommonServiceImpl implements IGasCommonService {
     private GasCommonMapper gasCommonMapper;
     @Autowired
     private ElasticSearchClient client;
+    @Value("${spring.profiles.active}")
+    private String env;
+    @Value("${black.snapImgUrl}")
+    private String blackImgUrl;
+    @Autowired
+    private IAisInfoService aisInfoService;
 
     public final static Map<String, String> orgMap = new HashMap<String, String>() {{
         put("南京三桥", "南京海事局");
@@ -43,10 +57,10 @@ public class GasCommonServiceImpl implements IGasCommonService {
         put("苏通大桥", "常熟海事局");
     }};
     public final static Map<String, String> heiyanDeviceMap = new HashMap<String, String>() {{
-        put("南京三桥", "65");
-        put("润扬大桥", "66");
-        put("江阴大桥", "67");
-        put("苏通大桥", "68");
+        put("南京三桥", "1106");
+        put("润扬大桥", "2104");
+        put("江阴大桥", "6106");
+        put("苏通大桥", "9108");
     }};
 
     @SneakyThrows
@@ -95,26 +109,53 @@ public class GasCommonServiceImpl implements IGasCommonService {
         } else if (StrUtil.equalsIgnoreCase(schema, "smoke_api") && StrUtil.equalsIgnoreCase(table, "ship_recognition")) {
             // 黑烟嫌疑船舶
             List<Map<String, Object>> map = gasCommonMapper.queryShipRecognition(syncPost);
-            for (Map<String, Object> stringObjectMap : map) {
-                if (NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(stringObjectMap.get("rcgSoot")), Convert.toBigDecimal("1"))) {
-                    stringObjectMap.put("illegalStatus", 3);
+            for (Map<String, Object> afterDataMap : map) {
+                if (ObjectUtil.isNotEmpty(afterDataMap.get("rcgSoot")) && NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(afterDataMap.get("rcgSoot")), Convert.toBigDecimal("1"))) {
+                    afterDataMap.put("illegalStatus", 3);
                 } else {
-                    stringObjectMap.put("illegalStatus", 1);
+                    afterDataMap.put("illegalStatus", 1);
+                }
+                afterDataMap.put("mmsi", afterDataMap.get("aisMmsi"));
+                // 查询检测点和船舶信息
+                AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
+                if (shipInfo != null) {
+                    afterDataMap.put("shipName", shipInfo.getShipName());
+                    afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
                 }
-                stringObjectMap.put("shipName", stringObjectMap.get("aisShipName"));
                 // 对于没有从ais系统拿到船名的情况下,直接取rcgShipName
-                if (ObjectUtil.isEmpty(stringObjectMap.get("shipName"))) {
-                    stringObjectMap.put("shipName", stringObjectMap.get("rcgShipName"));
+                if (ObjectUtil.isEmpty(afterDataMap.get("shipName"))) {
+                    afterDataMap.put("shipName", afterDataMap.get("rcgShipName"));
                 }
-                stringObjectMap.put("monitorPointName", stringObjectMap.get("snapPos"));
-                stringObjectMap.put("uploadFlag", 0);
-                stringObjectMap.put("illegalType", "heiyan");
-                stringObjectMap.put("shipRegionType", 0);
-                stringObjectMap.put("createTime", stringObjectMap.get("snapTimeFmt"));
-                stringObjectMap.put("mmsi", stringObjectMap.get("aisMmsi"));
-                stringObjectMap.put("orgName", orgMap.get(Convert.toStr(stringObjectMap.get("snapPos"))));
-                stringObjectMap.put("deviceId", heiyanDeviceMap.get(Convert.toStr(stringObjectMap.get("snapPos"))));
-                saveOrUpdate(ElasticConstants.HEIYAN_SHIP_RECOGNITION, Convert.toStr(stringObjectMap.get("id")), stringObjectMap);
+                afterDataMap.put("monitorPointName", afterDataMap.get("snapPos"));
+                afterDataMap.put("uploadFlag", 0);
+                afterDataMap.put("illegalType", "heiyan");
+                afterDataMap.put("createTime", afterDataMap.get("snapTimeFmt"));
+                afterDataMap.put("orgName", orgMap.get(Convert.toStr(afterDataMap.get("snapPos"))));
+                afterDataMap.put("deviceId", heiyanDeviceMap.get(Convert.toStr(afterDataMap.get("snapPos"))));
+                if ("prod".equals(env)) {
+                    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");
+                        String sootImgUrl = response.getJSONObject("data").getString("sootImgUrl");
+                        if (imgUrlList != null) {
+                            for (Object o : imgUrlList) {
+                                // 只保存细节、全貌开头的图片
+                                String s = Convert.toStr(o);
+                                if (StrUtil.containsAny(s, "全貌", "细节")) {
+                                    newImgList.add("http://" + s);
+                                }
+                            }
+                        }
+                        afterDataMap.put("sootImgUrl", StrUtil.isNotBlank(sootImgUrl) ? "http://" + sootImgUrl : "");
+                        afterDataMap.put("allImgUrl", newImgList);
+                    }
+                    if (ObjectUtil.isNotEmpty(afterDataMap.get("mmsi")) && Convert.toStr(afterDataMap.get("mmsi")).length() == 9) {
+                        aisInfoService.getDynamicShipInfo(Convert.toStr(afterDataMap.get("mmsi")));
+                    }
+                }
+                saveOrUpdate(ElasticConstants.HEIYAN_SHIP_RECOGNITION, Convert.toStr(afterDataMap.get("id")), afterDataMap);
             }
         } else if (StrUtil.equalsIgnoreCase(schema, "ship") && StrUtil.equalsIgnoreCase(table, "alert")) {
             // 光谱嫌疑船舶

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

@@ -671,6 +671,9 @@ public class ElasticSearchClient {
                 } else if (strValue.startsWith("*") || strValue.endsWith("*")) {
                     MatchQueryBuilder matchQueryBuilder = QueryBuilders.matchQuery(key, strValue.replace("*", ""));
                     boolQueryBuilder.must(matchQueryBuilder);
+                } else if (strValue.startsWith("!")) {
+                    termQueryBuilder = QueryBuilders.termQuery(key, strValue.replace("!", ""));
+                    boolQueryBuilder.mustNot(termQueryBuilder);
                 } else {
                     termQueryBuilder = QueryBuilders.termQuery(key, strValue);
                     boolQueryBuilder.must(termQueryBuilder);

+ 3 - 3
ruoyi-system/src/main/java/com/ruoyi/system/domain/IllegalInfo.java

@@ -48,11 +48,11 @@ public class IllegalInfo {
     private Date receive;
 
     // 实际航向
-    private BigDecimal head;
+    private String head;
     // 地面航速
-    private BigDecimal speed;
+    private String speed;
     // 地面航线
-    private BigDecimal course;
+    private String course;
 
     private Integer illegalStatus;
 }

+ 3 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/IllegalShip.java

@@ -43,9 +43,11 @@ public class IllegalShip extends BaseEntity {
     private String berthName;
 
     private BigDecimal sPercent;
-    
+
     private BigDecimal so2Percent;
 
     private BigDecimal so2Concentration;
 
+    private String filterMmsi;
+
 }

+ 44 - 42
ruoyi-system/src/main/java/com/ruoyi/system/domain/ShipRecognition.java

@@ -26,14 +26,14 @@ public class ShipRecognition extends BaseEntity {
     /**
      * AIS船舶距离, 单位:m
      */
-    @Excel(name = "船舶距离, 单位:m")
-    private BigDecimal aisDist;
+//    @Excel(name = "船舶距离, 单位:m")
+//    private BigDecimal aisDist;
 
     /**
      * AIS吃水, 单位:m
      */
-    @Excel(name = "吃水, 单位:m")
-    private BigDecimal aisDrt;
+//    @Excel(name = "吃水, 单位:m")
+//    private BigDecimal aisDrt;
 
     /**
      * AIS目的地
@@ -50,8 +50,8 @@ public class ShipRecognition extends BaseEntity {
     /**
      * AIS船长, 单位:m
      */
-    @Excel(name = "船长, 单位:m")
-    private Long aisShipLen;
+//    @Excel(name = "船长, 单位:m")
+//    private Long aisShipLen;
 
     /**
      * 可能是中文,AIS船名,为拼音。例如SU SU HUO 009
@@ -83,8 +83,8 @@ public class ShipRecognition extends BaseEntity {
     /**
      * 尺寸异常
      */
-    @Excel(name = "尺寸异常")
-    private Long isAbnormalSize;
+//    @Excel(name = "尺寸异常")
+//    private Long isAbnormalSize;
 
     /**
      * AIS纬度,单位:度
@@ -101,8 +101,8 @@ public class ShipRecognition extends BaseEntity {
     /**
      * 船舶过闸闸次
      */
-    @Excel(name = "船舶过闸闸次")
-    private Long lockSeq;
+//    @Excel(name = "船舶过闸闸次")
+//    private Long lockSeq;
 
     /**
      * AIS经度,单位:度
@@ -119,32 +119,32 @@ public class ShipRecognition extends BaseEntity {
     /**
      * 图像识别得到的船舶载重吨位, 单位:t
      */
-    @Excel(name = "图像识别船舶载重吨位, 单位:t")
-    private BigDecimal rcgDeadweightTon;
+//    @Excel(name = "图像识别船舶载重吨位, 单位:t")
+//    private BigDecimal rcgDeadweightTon;
 
     /**
      * 图像识别得到的,船舶距离相机直线距离。单位:m
      */
-    @Excel(name = "图像识别船舶距离相机直线距离。单位:m")
-    private BigDecimal rcgDist;
+//    @Excel(name = "图像识别船舶距离相机直线距离。单位:m")
+//    private BigDecimal rcgDist;
 
     /**
      * 图像识别得到的船舶吃水, 单位:m
      */
-    @Excel(name = "图像识别船舶吃水, 单位:m")
-    private BigDecimal rcgDrt;
+//    @Excel(name = "图像识别船舶吃水, 单位:m")
+//    private BigDecimal rcgDrt;
 
     /**
      * 是否为船队。0 否,即单机船; 1 是,即为船队
      */
-    @Excel(name = "是否为船队。0 否,即单机船; 1 是,即为船队")
-    private Long rcgIsFleet;
+//    @Excel(name = "是否为船队。0 否,即单机船; 1 是,即为船队")
+//    private Long rcgIsFleet;
 
     /**
      * UNKNOWN 未知, EMPTY_LOAD 空载, HEAVY_LOAD 重载, OVER_LOAD 超载
      */
-    @Excel(name = "UNKNOWN 未知, EMPTY_LOAD 空载, HEAVY_LOAD 重载, OVER_LOAD 超载")
-    private String rcgLoadSts;
+//    @Excel(name = "UNKNOWN 未知, EMPTY_LOAD 空载, HEAVY_LOAD 重载, OVER_LOAD 超载")
+//    private String rcgLoadSts;
 
     /**
      * 图像识别得到的船舶水面上高度,单位:m
@@ -173,26 +173,26 @@ public class ShipRecognition extends BaseEntity {
     /**
      * 图像识别得到的船舶类型。例如: 货船,集装箱船,危化品船
      */
-    @Excel(name = "图像识别船舶类型")
-    private String rcgShipType;
+//    @Excel(name = "图像识别船舶类型")
+//    private String rcgShipType;
 
     /**
      * 图像识别得到的船宽,单位:m
      */
-    @Excel(name = "图像识别船宽,单位:m")
-    private BigDecimal rcgShipWidth;
+//    @Excel(name = "图像识别船宽,单位:m")
+//    private BigDecimal rcgShipWidth;
 
     /**
      * 船籍港
      */
-    @Excel(name = "船籍港")
-    private String regportName;
+//    @Excel(name = "船籍港")
+//    private String regportName;
 
     /**
      * 抓拍图片路径
      */
-    @Excel(name = "抓拍图片路径")
-    private String snapImPath;
+//    @Excel(name = "抓拍图片路径")
+//    private String snapImPath;
 
     /**
      * 抓拍地点
@@ -220,44 +220,44 @@ public class ShipRecognition extends BaseEntity {
     /**
      * 船名特征信息
      */
-    @Excel(name = "船名特征信息")
-    private String textFeatureLabel;
+//    @Excel(name = "船名特征信息")
+//    private String textFeatureLabel;
 
     /**
      * 船名识别原图url
      */
-    @Excel(name = "船名识别原图url")
-    private String textImgUrl;
+//    @Excel(name = "船名识别原图url")
+//    private String textImgUrl;
 
     /**
      * 图像识别得到的船舶详细类型
      */
-    @Excel(name = "图像识别得到的船舶详细类型")
-    private String rcgShipTypeDetail;
+//    @Excel(name = "图像识别得到的船舶详细类型")
+//    private String rcgShipTypeDetail;
 
     /**
      * useWarn: true, 使用外部输入预警信息
      */
-    @Excel(name = "使用外部输入预警信息")
-    private Long useWarn;
+//    @Excel(name = "使用外部输入预警信息")
+//    private Long useWarn;
 
     /**
      * 外部输入报警信息详情
      */
-    @Excel(name = "外部输入报警信息详情")
-    private String warnLabelList;
+//    @Excel(name = "外部输入报警信息详情")
+//    private String warnLabelList;
 
     /**
      * 二维码识别内容
      */
-    @Excel(name = "二维码识别内容")
-    private String qrcode;
+//    @Excel(name = "二维码识别内容")
+//    private String qrcode;
 
     /**
      * 船名方向
      */
-    @Excel(name = "船名方向")
-    private String shipNameDirection;
+//    @Excel(name = "船名方向")
+//    private String shipNameDirection;
 
     @Excel(name = "正确率更高的船名")
     private String shipNameValid;
@@ -279,4 +279,6 @@ public class ShipRecognition extends BaseEntity {
     private String monitorPointName;
 
     private String mmsi;
+
+    private String filterMmsi;
 }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/AisShipMapper.java

@@ -16,4 +16,6 @@ public interface AisShipMapper {
 
     @MapKey("mmsi")
     Map<String, AisShip> queryDynamicShip(@Param("day") int i);
+
+    void deleteByDay(@Param("day") int day);
 }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IAisInfoService.java

@@ -16,4 +16,5 @@ public interface IAisInfoService {
     AisShipInfo getShipInfo(String shipnameCn, String mmsi, String shipId, String shipNo);
 
     void getDynamicShipInfo(String mmsis);
+
 }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IAisShipService.java

@@ -12,4 +12,6 @@ import java.util.Map;
  */
 public interface IAisShipService {
     Map<String, AisShip> queryDynamicShip(int i);
+
+    void deleteByDay(int day);
 }

+ 4 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AisInfoServiceImpl.java

@@ -47,7 +47,7 @@ public class AisInfoServiceImpl implements IAisInfoService {
      */
     @Override
     public ShipEepReportRecInfo getShipEepReportRecInfo(String startTime, String endTime, String mmsi, String shipId, String shipNameCn) {
-        if ("prod".equals(profile)) {
+        if ("prod".equals(profile) && StrUtil.isNotBlank(mmsi) && mmsi.length() == 9) {
             Map<String, Object> params = new HashMap<>();
             params.put("startTime", startTime);
             params.put("endTime", endTime);
@@ -63,7 +63,7 @@ public class AisInfoServiceImpl implements IAisInfoService {
                     JSONArray result = jsonObject.getJSONArray("result");
                     if (result != null && !result.isEmpty()) {
                         Map<String, String> stringStringMap = Convert.toMap(String.class, String.class, result.get(0));
-                        return ShipEepReportRecInfo.builder().berthName(stringStringMap.get("BERTH_NAME")).nextPortName(stringStringMap.get("NEXT_PORT_NAME")).build();
+                        return ShipEepReportRecInfo.builder().berthName(stringStringMap.get("berth_name")).nextPortName(stringStringMap.get("next_port_name")).build();
                     }
                 }
             } catch (Exception e) {
@@ -77,7 +77,7 @@ public class AisInfoServiceImpl implements IAisInfoService {
     @Override
     public AisShipInfo getShipInfo(String shipnameCn, String mmsi, String shipId, String shipNo) {
         log.info("当前环境:{}", profile);
-        if ("prod".equals(profile)) {
+        if ("prod".equals(profile) && StrUtil.isNotBlank(mmsi) && mmsi.length() == 9) {
             Map<String, Object> params = new HashMap<>();
 //            params.put("shipnameCn", shipnameCn);
             params.put("mmsi", mmsi);
@@ -120,4 +120,5 @@ public class AisInfoServiceImpl implements IAisInfoService {
             }
         }
     }
+
 }

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AisShipServiceImpl.java

@@ -24,4 +24,9 @@ public class AisShipServiceImpl implements IAisShipService {
     public Map<String, AisShip> queryDynamicShip(int i) {
         return aisShipMapper.queryDynamicShip(i);
     }
+
+    @Override
+    public void deleteByDay(int day) {
+        aisShipMapper.deleteByDay(day);
+    }
 }

+ 11 - 0
ruoyi-system/src/main/resources/mapper/system/AisShipMapper.xml

@@ -4,16 +4,27 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.AisShipMapper">
 
+    <delete id="deleteByDay">
+        delete
+        from ais_ship
+        where DATE_SUB(CURDATE(), INTERVAL #{day} DAY) > receive
+    </delete>
 
     <select id="queryDynamicShip" resultType="com.ruoyi.system.domain.AisShip">
         SELECT mmsi,
                lng,
                lat,
+               head,
+               speed,
+               course,
                date_format(receive, '%Y-%m-%d %H:%i:%s') as receive
         FROM (
                  SELECT mmsi,
                         lng,
                         lat,
+                        head,
+                        speed,
+                        course,
                         receive
                  FROM ais_ship
                  WHERE DATE_SUB(CURDATE(), INTERVAL #{day} DAY) &lt;= date (receive)

+ 21 - 14
ruoyi-ui/src/views/components/table/liuTable.vue

@@ -143,20 +143,20 @@
             </el-option>
           </el-select>
         </el-col>
-        <el-col :span="2">
-          <el-form-item label="快检结果" prop="fastResult" style="float:right">
-          </el-form-item>
-        </el-col>
-        <el-col :span="3">
-          <el-select v-model="queryParams.fastResult" clearable placeholder="请选择快检结果">
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value">
-            </el-option>
-          </el-select>
-        </el-col>
+        <!--        <el-col :span="2">
+                  <el-form-item label="快检结果" prop="fastResult" style="float:right">
+                  </el-form-item>
+                </el-col>
+                <el-col :span="3">
+                  <el-select v-model="queryParams.fastResult" clearable placeholder="请选择快检结果">
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-col>-->
 
         <el-col :span="2">
           <el-form-item label="送检结果" prop="uploadResult" style="float:right">
@@ -172,6 +172,12 @@
             </el-option>
           </el-select>
         </el-col>
+        <el-col :span="1">
+        </el-col>
+        <el-radio-group v-model="queryParams.filterMmsi">
+          <el-radio label="" border>全部</el-radio>
+          <el-radio label="!0" border>MMSI不为空</el-radio>
+        </el-radio-group>
       </el-row>
 
 
@@ -336,6 +342,7 @@ export default {
         startTime: '',
         endTime: '',
         monitorPointName: '',
+        filterMmsi: '!0'
       },
       jianceOptions: [],
       orgOptions: [],

+ 7 - 0
ruoyi-ui/src/views/components/table/xtTable.vue

@@ -98,6 +98,12 @@
             </el-option>
           </el-select>
         </el-col>
+        <el-col :span="1">
+        </el-col>
+        <el-radio-group v-model="queryParams.filterMmsi">
+          <el-radio label="" border>全部</el-radio>
+          <el-radio label="!0" border>MMSI不为空</el-radio>
+        </el-radio-group>
       </el-row>
 
       <el-form-item style="margin-left:1rem">
@@ -253,6 +259,7 @@ export default {
         endTime: undefined,
         shipRegionType: undefined,
         illegalStatus: 3,
+        filterMmsi: '!0'
       },
       typeOptions: [
         {