diff --git a/.gitignore b/.gitignore index a9c6c2320..5cc51f5ed 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,6 @@ designer_base/bin designer_chart/bin designer_form/bin *.iml +designer_base/src/com/fr/design/locale/.idea diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java b/designer/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java similarity index 98% rename from designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java rename to designer/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java index 44522b856..bf5d835d2 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java +++ b/designer/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.templateinfo; -import com.fr.base.io.IOFile; import com.fr.base.parameter.ParameterUI; import com.fr.main.impl.WorkBook; import com.fr.report.cellcase.CellCase; diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 23285ba1d..d74f09b9d 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -541,21 +541,21 @@ FR-Designer_No=\u3044\u3044\u3048 FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0 FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9 FR-Designer_Parameter-Formula=\u6570\u5F0F -FR-Designer_Background_Null= -FR-Designer_Background_Color= -FR-Designer_Background_Texture= -FR-Designer_Background_Pattern= -FR-Designer_Background_Gradient_Color= -FR-Designer_Background_Image= -FR-Designer_Background_Clear= -FR-Designer_Background_Image_Select= -FR-Designer_Initial_Background_Tips= -FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= -FR-Designer-Move_Tab_First= -FR-Designer-Move_Tab_End= -FR-Designer-Move_Tab_Next= -FR-Designer-Move_Tab_Prev= +FR-Designer_Background_Null=\u80CC\u666F\u306A\u3057 +FR-Designer_Background_Color=\u8272 +FR-Designer_Background_Texture=\u67C4 +FR-Designer_Background_Pattern=\u6A21\u69D8 +FR-Designer_Background_Gradient_Color=\u30B0\u30E9\u30C7\u30FC\u30B7\u30E7\u30F3\u8272 +FR-Designer_Background_Image=\u5199\u771F +FR-Designer_Background_Clear=\u30AF\u30EA\u30A2 +FR-Designer_Background_Image_Select=\u5199\u771F\u3092\u9078\u629E +FR-Designer_Initial_Background_Tips=\u30DC\u30BF\u30F3\u306E\u521D\u671F\u80CC\u666F +FR-Designer_Mouse_Move_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u306E\u80CC\u666F +FR-Designer_Mouse_Click_Tips=\u30DE\u30A6\u30B9\u304C\u30DC\u30BF\u30F3\u306B\u79FB\u3059\u6642\u306E\u80CC\u666F +FR-Designer-Move_Tab_First=\u30C8\u30C3\u30D7\u306B\u79FB\u3059 +FR-Designer-Move_Tab_End=\u6700\u5F8C\u306B\u79FB\u3059 +FR-Designer-Move_Tab_Next=\u5F8C\u308D\u306B\u79FB\u3059 +FR-Designer-Move_Tab_Prev=\u524D\u306B\u79FB\u3059 FR-Designer_AxisReversed=\u8EF8\u9006\u914D\u5217 FR-Designer_Logarithmic=\u5BFE\u6570\u76EE\u76DB\u308A FR-Designer_Chart_Log_Base=\u5E95\u6570 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index aeb941114..4a91ce970 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -563,17 +563,17 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u63D2\u4EF6\u7248\u67 FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002 -FR-Designer_Background_Null= -FR-Designer_Background_Color= -FR-Designer_Background_Texture= -FR-Designer_Background_Pattern= -FR-Designer_Background_Gradient_Color= -FR-Designer_Background_Image= -FR-Designer_Background_Clear= -FR-Designer_Background_Image_Select= -FR-Designer_Initial_Background_Tips= -FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= +FR-Designer_Background_Null=\u6C92\u6709\u80CC\u666F +FR-Designer_Background_Color=\u984F\u8272 +FR-Designer_Background_Texture=\u7D0B\u7406 +FR-Designer_Background_Pattern=\u5716\u6848 +FR-Designer_Background_Gradient_Color=\u6F38\u8B8A\u8272 +FR-Designer_Background_Image=\u5716\u7247 +FR-Designer_Background_Clear=\u6E05\u9664 +FR-Designer_Background_Image_Select=\u9078\u64C7\u5716\u7247 +FR-Designer_Initial_Background_Tips=\u6309\u9215\u7684\u521D\u59CB\u80CC\u666F +FR-Designer_Mouse_Move_Tips=\u6ED1\u9F20\u79FB\u52D5\u5230\u6309\u9215\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u7121\u5247\u4E0D\u6539\u8B8A\u80CC\u666F +FR-Designer_Mouse_Click_Tips=\u6ED1\u9F20\u9EDE\u64CA\u6309\u9215\u6642\u80CC\u666F\uFF0C\u82E5\u7121\u5247\u4E0D\u6539\u8B8A\u80CC\u666F FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5 diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index b0b9f7b5a..37769cdbe 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -111,9 +111,7 @@ public abstract class JTemplate> ex // 为收集模版信息作准备 private void initForCollect() { - if (template.getTemplateID() == null) { - template.initTemplateID(); // 为新模板设置 templateID 属性 - } + template.initTemplateID(); // 为新模板设置 templateID 属性 if (openTime == 0) { openTime = System.currentTimeMillis(); } @@ -533,7 +531,7 @@ public abstract class JTemplate> ex boolean result = this.saveFile(); if (result) { DesignerFrameFileDealerPane.getInstance().refresh(); - initForCollect(); // 如果是旧模板另存为新模板,则添加 templateID + initForCollect(); // 如果另存为新模板,则添加 templateID collectInfo(); } //更换最近打开 diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 4f7069205..3cbc557f8 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -15,9 +15,7 @@ import org.json.JSONObject; import java.io.*; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.HashMap; +import java.util.*; /** * 做模板的过程和耗时收集,辅助类 @@ -27,6 +25,7 @@ public class TemplateInfoCollector implements Serializable { private static final String FILE_NAME = "tplInfo.ser"; private static TemplateInfoCollector instance; private HashMap> templateInfoList; + private Set removedTemplates; // 已经从 templateInfoList 中删除过的 id 列表,防止重复收集数据 private String designerOpenDate; //设计器最近一次打开日期 private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数 private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 @@ -36,6 +35,7 @@ public class TemplateInfoCollector implements Serializable { @SuppressWarnings("unchecked") private TemplateInfoCollector() { templateInfoList = new HashMap<>(); + removedTemplates = new ListSet<>(); setDesignerOpenDate(); } @@ -77,12 +77,15 @@ public class TemplateInfoCollector implements Serializable { return instance; } - private static boolean shouldCollectInfo() { + private boolean shouldCollectInfo(T t) { + if (t.getTemplateID() == null || instance.removedTemplates.contains(t.getTemplateID())) { // 旧模板 + return false; + } return DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); } - public static void appendProcess(String log) { - if (!shouldCollectInfo()) { + public void appendProcess(T t, String log) { + if (!shouldCollectInfo(t)) { return; } // 获取当前编辑的模板 @@ -113,7 +116,14 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); - FRLogger.getLogger().info("writing: " + instance.templateInfoList); + String log = ""; + int count = 1; + for (String key : templateInfoList.keySet()) { + String createTime = ((HashMap)templateInfoList.get(key).get("consumingMap")).get("create_time").toString(); + log += (count + ". id: " + key + " " + createTime + "\n" + templateInfoList.get(key).toString() + "\n"); + count ++; + } + FRLogger.getLogger().info("writing tplInfo: \n" + log); os.writeObject(instance); os.close(); } catch (Exception ex) { @@ -141,7 +151,7 @@ public class TemplateInfoCollector implements Serializable { */ @SuppressWarnings("unchecked") public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { - if (!shouldCollectInfo()) { + if (!shouldCollectInfo(t)) { return; } @@ -225,7 +235,7 @@ public class TemplateInfoCollector implements Serializable { if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { // 清空记录 FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID")); - templateInfoList.remove(templateInfo.get("templateID")); + removeFromTemplateInfoList(templateInfo.get("templateID")); } } saveInfo(); @@ -277,12 +287,18 @@ public class TemplateInfoCollector implements Serializable { } // 删除测试模板 for (String key : testTemplateKeys) { - templateInfoList.remove(key); -// System.out.println(key + " is removed..."); + removeFromTemplateInfoList(key); } return completeTemplatesInfo; } + private void removeFromTemplateInfoList(String key) { + templateInfoList.remove(key); + removedTemplates.add(key); + FRLogger.getLogger().info(key + " is removed..."); + FRLogger.getLogger().info("removedTemplates: " + removedTemplates); + } + @SuppressWarnings("unchecked") private boolean isTestTemplate(HashMap templateInfo) { HashMap processMap = (HashMap) templateInfo.get("processMap"); diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java b/designer_form/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java similarity index 100% rename from designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java rename to designer_form/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java