459242451@qq.com 1 年之前
父節點
當前提交
65a0f1b9ff
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      ruoyi-admin/src/main/java/com/ruoyi/web/job/CanalScheduling.java

+ 6 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/job/CanalScheduling.java

@@ -224,6 +224,9 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
             case INSERT:
                 // 黑烟船舶数据入库
                 if (StrUtil.equalsIgnoreCase(database, "smoke_api") && StrUtil.equalsIgnoreCase(table, "ship_recognition")) {
+                    if (DateUtil.compare(DateUtil.parseDateTime(afterDataMap.get("snapTimeFmt").toString()), DateUtil.lastWeek()) < 0) {
+                        break;
+                    }
                     afterDataMap.put("mmsi", afterDataMap.get("aisMmsi"));
                     afterDataMap.put("illegalType", "heiyan");
                     afterDataMap.put("createTime", afterDataMap.get("snapTimeFmt"));
@@ -315,6 +318,9 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
                             CacheConstants.DEVICE_TYPE_STATIC,
                             CacheConstants.DEVICE_LIST_STATIC));
                 } else if (StrUtil.equalsIgnoreCase(database, "ais_database") && StrUtil.equalsIgnoreCase(table, "illegal_ship")) {
+                    if (DateUtil.compare(DateUtil.parseDateTime(afterDataMap.get("peakTime").toString()), DateUtil.lastWeek()) < 0) {
+                        break;
+                    }
                     // 嗅探系统-违规船舶
                     afterDataMap.put("mmsi", afterDataMap.get("shipMmsi"));
                     afterDataMap.put("createTime", afterDataMap.get("peakTime"));