459242451@qq.com 3 anos atrás
pai
commit
0f60967eac

+ 10 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/job/CanalScheduling.java

@@ -344,11 +344,16 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
                 break;
             case UPDATE:
                 if (StrUtil.equalsIgnoreCase(database, "smoke_api") && StrUtil.equalsIgnoreCase(table, "ship_snap_address")) {
-                    log.info("删除redis设备缓存");
-                    redisCache.deleteObject(CollUtil.set(false,
-                            CacheConstants.DEVICE_STATIC,
-                            CacheConstants.DEVICE_TYPE_STATIC,
-                            CacheConstants.DEVICE_LIST_STATIC));
+                    if (ObjectUtil.notEqual(beforeDataMap.get("deviceImgUrl"), afterDataMap.get("deviceImgUrl"))
+                            || ObjectUtil.notEqual(beforeDataMap.get("latitude"), afterDataMap.get("latitude"))
+                            || ObjectUtil.notEqual(beforeDataMap.get("longitude"), afterDataMap.get("longitude"))
+                            || ObjectUtil.notEqual(beforeDataMap.get("status"), afterDataMap.get("status"))) {
+                        log.info("删除redis设备缓存");
+                        redisCache.deleteObject(CollUtil.set(false,
+                                CacheConstants.DEVICE_STATIC,
+                                CacheConstants.DEVICE_TYPE_STATIC,
+                                CacheConstants.DEVICE_LIST_STATIC));
+                    }
                 } else if (StrUtil.equalsIgnoreCase(database, "ship") && StrUtil.equalsIgnoreCase(table, "common_record")) {
                     // 船舶记录
                     if ("prod".equals(env)) {