diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index e8cdc3ee8d..43714f949b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -326,15 +326,6 @@ public abstract class JTemplate> public abstract JComponent getCurrentReportComponentPane(); - /** - * 为另存的模板创建新的模板id - */ - private void generateNewTemplateIdForSaveAs() { - if (StringUtils.isEmpty(template.getTemplateID()) || this.getEditingFILE().exists()) { - generateTemplateId(); - } - } - /** * 收集图表信息 */ @@ -959,7 +950,9 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - generateNewTemplateIdForSaveAs(); + if (StringUtils.isEmpty(currentId)) { + generateTemplateId(); + } this.editingFILE = editingFILE; boolean result = this.saveToNewFile(oldName); @@ -1834,7 +1827,7 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - generateNewTemplateIdForSaveAs(); + generateTemplateId(); this.editingFILE = editingFILE; boolean result = this.saveToNewRealFile(oldName); if (result) {