From 7e996b635a79c655a10730ab8bfd6dabe3c5d977 Mon Sep 17 00:00:00 2001 From: pengda Date: Fri, 5 Nov 2021 13:59:26 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-62016=20BI=E6=8F=92=E4=BB=B6=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/versioncheck/VersionCheckUtils.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java index e5624c453..d2794cd6e 100644 --- a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java +++ b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java @@ -64,6 +64,11 @@ public class VersionCheckUtils { private static final String ID = "id"; private static final String VERSION = "version"; private static final String NAME = "name"; + private static final String RUNNING = "running"; + private static final String SYNC = "sync"; + private static final String GROUP = "group"; + private static final String BI = "bi"; + private static final String BIPREFIX = "com.finebi"; private static final Set pluginsNeedIgnore = new HashSet<>(); static { pluginsNeedIgnore.addAll(Arrays.asList( @@ -263,13 +268,10 @@ public class VersionCheckUtils { Map pluginsNameMap = ReportHelper.getPluginNameMap(); for (int i = 0; i < remotePlugins.size(); i++) { remotePlugin = remotePlugins.getJSONObject(i); - if (ComparatorUtils.equals(remotePlugin.getString("running"), "false") || (remotePlugin.containsKey("sync") && !remotePlugin.getBoolean("sync"))) { + if (isPluginNeedIgnore(remotePlugin)) { continue; } String remotePluginID = remotePlugin.getString(ID); - if (pluginsNeedIgnore.contains(remotePluginID)) { - continue; - } if (localPluginsMap.containsKey(remotePluginID)) { if (ComparatorUtils.equals(localPluginsMap.get(remotePluginID).getVersion(), remotePlugin.getString(VERSION))) { continue; @@ -290,6 +292,12 @@ public class VersionCheckUtils { return differentPlugins; } + private static boolean isPluginNeedIgnore(JSONObject remotePlugin) { + return ComparatorUtils.equals(remotePlugin.getString(RUNNING), "false") || (remotePlugin.containsKey(SYNC) && !remotePlugin.getBoolean(SYNC)) + || (remotePlugin.containsKey(GROUP) && ComparatorUtils.equals(remotePlugin.containsKey(GROUP), BI) || remotePlugin.getString(ID).startsWith(BIPREFIX) + || pluginsNeedIgnore.contains(remotePlugin.getString(ID))); + } + public static JSONArray syncPlugins(JSONArray differentPlugins) { Set uninstallFailed = uninstallPlugins(differentPlugins); List plugins = getSyncPlugins(differentPlugins, uninstallFailed);