From 8a10b3f7ceaac99d3907c39ed50e9f8d968aa2ce Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Mon, 26 Jun 2017 15:45:41 +0800 Subject: [PATCH] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/extra/PluginOperateUtils.java | 6 ++++-- designer_base/src/com/fr/design/extra/PluginUtils.java | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java index 5e73b45b2f..9b661543b1 100644 --- a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java +++ b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java @@ -63,8 +63,10 @@ public class PluginOperateUtils { JSONObject latestPluginInfo = PluginUtils.getLatestPluginInfo(pluginMarker.getPluginID()); String latestPluginVersion = (String) latestPluginInfo.get("version"); PluginMarker toPluginMarker = PluginMarker.create(pluginMarker.getPluginID(), latestPluginVersion); - PluginTask pluginTask = PluginTask.updateTask(pluginMarker, toPluginMarker); - PluginControllerHelper.updateOnline(pluginMarker, toPluginMarker, new UpdateOnlineCallback(pluginTask, jsCallback)); + //当前已经安装的相同ID插件marker + PluginMarker currentMarker = PluginUtils.getInstalledPluginMarkerByID(pluginMarker.getPluginID()); + PluginTask pluginTask = PluginTask.updateTask(currentMarker, toPluginMarker); + PluginControllerHelper.updateOnline(currentMarker, toPluginMarker, new UpdateOnlineCallback(pluginTask, jsCallback)); } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); } diff --git a/designer_base/src/com/fr/design/extra/PluginUtils.java b/designer_base/src/com/fr/design/extra/PluginUtils.java index 9f2c79c096..0e6ae15a15 100644 --- a/designer_base/src/com/fr/design/extra/PluginUtils.java +++ b/designer_base/src/com/fr/design/extra/PluginUtils.java @@ -11,6 +11,7 @@ import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.error.PluginErrorCode; +import com.fr.plugin.manage.PluginManager; import com.fr.plugin.view.PluginView; import com.fr.stable.EncodeConstants; import com.fr.stable.StableUtils; @@ -173,4 +174,13 @@ public class PluginUtils { return ERROR_CODE_I18N_PREFIX + errorCode.getDescription(); } + + public static PluginMarker getInstalledPluginMarkerByID(String pluginID) { + + PluginContext context = PluginManager.getContext(pluginID); + if (context != null) { + return context.getMarker(); + } + return null; + } }