Browse Source

Merge pull request #10652 in DESIGN/design from final/11.0 to release/11.0

* commit '5604fdc848f2d8e868ff0ce53f01cc4639b61922':
  REPORT-80695 模板查找替换二期 增加数据列与数据设置替换校验
  REPORT-84331 【冒烟】本地目录启动,还提示我插件版本不一致 处理代码质量问题
  REPORT-84331 【冒烟】本地目录启动,还提示我插件版本不一致 【问题原因】jar包和插件的版本检查,均会在设计器启动后运行一次,但是jar包检查判断了是否为本地目录,插件检查未判断,因此进行了插件检查,同时又因为测试同学本地存在同ID的多个版本插件,导致了检查结果为"XXX插件版本不一致",并给出弹窗提醒 【改动思路】将"判断是否为本地目录"的逻辑提前,先判断,再去做jar和插件检查, 【review建议】
newui
superman 2 years ago
parent
commit
4fce1e7dbe
  1. 47
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  2. 24
      designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java
  3. 16
      designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java

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

@ -70,6 +70,7 @@ public class VersionCheckUtils {
private static final String GROUP = "group";
private static final String BI = "bi";
private static final String BIPREFIX = "com.finebi";
private static final String DEVELOP_BRANCH_MARK = "#";
private static final Set<String> pluginsNeedIgnore = new HashSet<>();
static {
pluginsNeedIgnore.addAll(Arrays.asList(
@ -88,7 +89,23 @@ public class VersionCheckUtils {
public static boolean versionCheck(String envName) {
return checkLocalAndRemoteJartime(envName) && checkLocalAndRemotePlugin().size() == 0;
if (needCheckConsistency(envName)) {
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) {
@ -139,21 +156,17 @@ public class VersionCheckUtils {
}
public static boolean checkLocalAndRemoteJartime(DesignerWorkspaceInfo selectedEnv) {
//是否需要做服务校验
if (needCheckBranch(selectedEnv)) {
String localBranch;
String remoteBranch = getRemoteBranch(selectedEnv);
localBranch = GeneralUtils.readFullBuildNO();
//通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本)
if (localBranch.contains("#") && ComparatorUtils.equals(localBranch, remoteBranch)) {
//说明版本一致,仅做日志记录
FineLoggerFactory.getLogger().info("Remote Designer version consistency");
return true;
} else {
return false;
}
String localBranch;
String remoteBranch = getRemoteBranch(selectedEnv);
localBranch = GeneralUtils.readFullBuildNO();
// 通过是否包含"#"来避免当前版本为非安装版本(主要是内部开发版本)
if (localBranch.contains(DEVELOP_BRANCH_MARK) && ComparatorUtils.equals(localBranch, remoteBranch)) {
//说明版本一致,仅做日志记录
FineLoggerFactory.getLogger().info("Remote Designer version consistency");
return true;
} else {
return false;
}
return true;
}
public static List<String> getNoExistServiceDescription(String envName) {
@ -267,10 +280,6 @@ public class VersionCheckUtils {
return df.format(jarDate);
}
private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) {
return selectedEnv.getType() == DesignerWorkspaceType.Remote;
}
public static JSONArray checkLocalAndRemotePlugin() {
JSONArray differentPlugins = new JSONArray();
JSONArray remotePlugins = FRContext.getCommonOperator().getPluginStatus();

24
designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java

@ -246,4 +246,28 @@ public enum CellGroupType {
DSColumn column = (DSColumn) cellElement.getValue();
column.setGrouper(grouper);
}
/**
* 是否修改过
*
* @param info 存储信息的数据结构
* @param inputStr 用户输入的第一级下拉框内容
* @param extraStr 用户输入的第二级下拉框内容
* @return 修改过返回true
*/
public boolean isEverChanged(Info info, String inputStr, String extraStr) {
return !isNeed(getCellElementFromInfo(info), inputStr, extraStr);
}
/**
* 从Info中获取CellElement
* 能到这一步肯定是单元格数据列类型
*
* @param info 存储查找替换信息的数据结构
* @return CellElement
*/
public CellElement getCellElementFromInfo(Info info) {
CellElement cellElement = (CellElement) info.getContent().getReplaceObject();
return cellElement;
}
}

16
designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java

@ -156,6 +156,15 @@ public enum SettingController implements ShowValue {
type.replace(info, firstStr, secondStr);
}
}
@Override
public boolean isEverChanged(Info info, String inputStr, String extraStr) {
CellGroupType type = CellGroupType.match(inputStr);
if (type != null) {
return type.isEverChanged(info, inputStr, extraStr);
}
return false;
}
},
/**
* 单元格-数据列
@ -224,6 +233,13 @@ public enum SettingController implements ShowValue {
dsColumn.setColumn(TableDataColumn.createColumn(secondStr));
}
@Override
public boolean isEverChanged(Info info, String inputStr, String extraStr) {
CellElement cellElement = (CellElement) info.getContent().getReplaceObject();
DSColumn dsColumn = (DSColumn) cellElement.getValue();
return !isNeed(dsColumn, inputStr, extraStr);
}
},
/**
* 数据源-数据连接

Loading…
Cancel
Save