Browse Source

Merge pull request #5693 in DESIGN/design from release/10.0 to release/11.0

* commit 'c2bbfc2127209b285b9cb0fb821ab25da9eefdff':
  REPORT-58573 打开11.0制作的模板不向上兼容提示- 提示内容中应建议升级至11
persist/11.0
superman 3 years ago
parent
commit
078a530827
  1. 3
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 13
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  3. 7
      designer-base/src/test/java/com/fr/design/utils/DesignUtilsTest.java

3
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -54,6 +54,7 @@ import com.fr.design.menu.NameSeparator;
import com.fr.design.menu.ShortCut;
import com.fr.design.preview.PagePreview;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.design.worker.save.EmptyCallBackSaveWorker;
import com.fr.design.write.submit.DBManipulationInWidgetEventPane;
@ -1145,7 +1146,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public boolean isOldDesigner() {
String xmlDesignerVersion = getTarget().getXMLDesignerVersion();
if (isHigherThanCurrent(xmlDesignerVersion)) {
String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", StringUtils.parseVersion(xmlDesignerVersion));
String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", DesignUtils.parseVersion(xmlDesignerVersion));
String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info");
new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show();
return true;

13
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -425,4 +425,17 @@ public class DesignUtils {
return true;
}
/**
* FR25.0版本出来需要进行适配下
*
* @param xmlDesignerVersion
* @return
*/
public static String parseVersion(String xmlDesignerVersion) {
if (StringUtils.isNotEmpty(xmlDesignerVersion)) {
return String.valueOf(xmlDesignerVersion.charAt(0) - 'A');
}
return xmlDesignerVersion;
}
}

7
designer-base/src/test/java/com/fr/design/utils/DesignUtilsTest.java

@ -3,6 +3,7 @@ package com.fr.design.utils;
import com.fr.general.ComparatorUtils;
import junit.framework.TestCase;
import org.junit.Assert;
import org.junit.Test;
import java.net.ServerSocket;
@ -29,4 +30,10 @@ public class DesignUtilsTest extends TestCase {
assertTrue(DesignUtils.isPortOccupied());
}
@Test
public void testParseVersion() {
Assert.assertEquals("10", DesignUtils.parseVersion("KAA"));
Assert.assertEquals("11", DesignUtils.parseVersion("LAA"));
}
}
Loading…
Cancel
Save