Browse Source

REPORT-84331 【冒烟】本地目录启动,还提示我插件版本不一致

【问题原因】jar包和插件的版本检查,均会在设计器启动后运行一次,但是jar包检查判断了是否为本地目录,插件检查未判断,因此进行了插件检查,同时又因为测试同学本地存在同ID的多个版本插件,导致了检查结果为"XXX插件版本不一致",并给出弹窗提醒
【改动思路】将"判断是否为本地目录"的逻辑提前,先判断,再去做jar和插件检查,
【review建议】
new-design
Yvan-欧阳帆 2 years ago
parent
commit
734668c3b1
  1. 24
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

24
designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -88,8 +88,24 @@ public class VersionCheckUtils {
public static boolean versionCheck(String envName) { public static boolean versionCheck(String envName) {
if (needCheckConsistency(envName)) {
return checkLocalAndRemoteJartime(envName) && checkLocalAndRemotePlugin().size() == 0; return checkLocalAndRemoteJartime(envName) && checkLocalAndRemotePlugin().size() == 0;
} }
return true;
}
/**
* 判断是否需要检查Jartime和插件的一致性
*
* @param selectedEnvName 当前工作目录名称
* @return
*/
private static boolean needCheckConsistency(String selectedEnvName) {
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(selectedEnvName);
// 当前工作目录为远程工作目录时,需要检查
return selectedEnv.getType() == DesignerWorkspaceType.Remote;
}
public static boolean versionCheck(DesignerWorkspaceInfo selectedEnv) { public static boolean versionCheck(DesignerWorkspaceInfo selectedEnv) {
return checkLocalAndRemoteJartime(selectedEnv) && checkLocalAndRemotePlugin().size() == 0; return checkLocalAndRemoteJartime(selectedEnv) && checkLocalAndRemotePlugin().size() == 0;
@ -139,8 +155,6 @@ public class VersionCheckUtils {
} }
public static boolean checkLocalAndRemoteJartime(DesignerWorkspaceInfo selectedEnv) { public static boolean checkLocalAndRemoteJartime(DesignerWorkspaceInfo selectedEnv) {
//是否需要做服务校验
if (needCheckBranch(selectedEnv)) {
String localBranch; String localBranch;
String remoteBranch = getRemoteBranch(selectedEnv); String remoteBranch = getRemoteBranch(selectedEnv);
localBranch = GeneralUtils.readFullBuildNO(); localBranch = GeneralUtils.readFullBuildNO();
@ -153,8 +167,6 @@ public class VersionCheckUtils {
return false; return false;
} }
} }
return true;
}
public static List<String> getNoExistServiceDescription(String envName) { public static List<String> getNoExistServiceDescription(String envName) {
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
@ -267,10 +279,6 @@ public class VersionCheckUtils {
return df.format(jarDate); return df.format(jarDate);
} }
private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) {
return selectedEnv.getType() == DesignerWorkspaceType.Remote;
}
public static JSONArray checkLocalAndRemotePlugin() { public static JSONArray checkLocalAndRemotePlugin() {
JSONArray differentPlugins = new JSONArray(); JSONArray differentPlugins = new JSONArray();
JSONArray remotePlugins = FRContext.getCommonOperator().getPluginStatus(); JSONArray remotePlugins = FRContext.getCommonOperator().getPluginStatus();

Loading…
Cancel
Save