diff --git a/designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java b/designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java index e2a75fc11b..a03ccc99dc 100644 --- a/designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java +++ b/designer-base/src/main/java/com/fr/design/data/StrategyConfigAttrUtils.java @@ -11,11 +11,11 @@ import com.fr.esd.event.DSMapping; import com.fr.esd.event.DsNameTarget; import com.fr.esd.event.StrategyEventsNotifier; import com.fr.esd.event.xml.XMLSavedHook; -import com.fr.file.FILE; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; +import java.nio.file.Paths; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -46,7 +46,9 @@ public class StrategyConfigAttrUtils { } //新建模版此时不存在,不需要注册钩子 - if (attr.getXmlSavedHook() == null && WorkContext.getWorkResource().exist(jTemplate.getPath())) { + //不处理外部路径,保存到设计器才处理 + String path = jTemplate.getPath(); + if (attr.getXmlSavedHook() == null && !Paths.get(path).isAbsolute() && WorkContext.getWorkResource().exist(path)) { attr.setXmlSavedHook(new StrategyConfigsAttrSavedHook(jTemplate.getPath(), attr)); } return attr; diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index d4737f084a..be1005574e 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -58,7 +58,7 @@ import com.fr.stable.EncodeConstants; import com.fr.stable.EssentialUtils; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; -import com.fr.stable.script.CRAddress; +import com.fr.parser.CRAddress; import com.fr.stable.script.ColumnRowRange; import com.fr.stable.script.Expression; import com.fr.stable.script.Node; 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 55dfe60cf1..a6a2d7896a 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 @@ -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 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 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(); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java index 27aebee07d..161aca91f4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/CellGroupType.java +++ b/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; + } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java index 0b481a1272..676bfba9cb 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java +++ b/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); + } }, /** * 数据源-数据连接 diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index 7ae22a51fa..60fb2c30ad 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -51,7 +51,7 @@ import com.fr.stable.AssistUtils; import com.fr.stable.ColumnRow; import com.fr.stable.Constants; import com.fr.stable.GraphDrawHelper; -import com.fr.stable.script.CalculatorUtils; +import com.fr.script.CalculatorUtils; import com.fr.stable.unit.FU; import com.fr.stable.unit.UNIT; import com.fr.third.antlr.ANTLRException;