Browse Source

REPORT-1916 做模板的过程和耗时收集=》若未加入产品改良计划,则不收集本地数据

master
plough 8 years ago
parent
commit
8943228883
  1. 14
      designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java

14
designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.templateinfo; package com.fr.design.mainframe.templateinfo;
import com.fr.base.FRContext;
import com.fr.base.io.IOFile; import com.fr.base.io.IOFile;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -71,7 +72,14 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
return instance; return instance;
} }
private static boolean shouldCollectInfo() {
return DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv();
}
public static void appendProcess(String log) { public static void appendProcess(String log) {
if (!shouldCollectInfo()) {
return;
}
// 获取当前编辑的模板 // 获取当前编辑的模板
JTemplate jt = DesignerContext.getDesignerFrame().getSelectedJTemplate(); JTemplate jt = DesignerContext.getDesignerFrame().getSelectedJTemplate();
// 追加过程记录 // 追加过程记录
@ -100,7 +108,7 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
private void saveInfo() { private void saveInfo() {
try { try {
ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile()));
System.out.println("写入:" + instance.templateInfoList); // System.out.println("写入:" + instance.templateInfoList);
os.writeObject(instance); os.writeObject(instance);
os.close(); os.close();
} catch (Exception ex) { } catch (Exception ex) {
@ -128,6 +136,10 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) {
if (!shouldCollectInfo()) {
return;
}
HashMap<String, Object> templateInfo; HashMap<String, Object> templateInfo;
long timeConsume = ((saveTime - openTime) / 1000); // 制作模板耗时(单位:s) long timeConsume = ((saveTime - openTime) / 1000); // 制作模板耗时(单位:s)

Loading…
Cancel
Save