Browse Source

Merge pull request #13227 in DESIGN/design from bugfix/11.0 to feature/x

* commit 'b8c30facf1b713e4339c644f059070ba20a7f76c':
  REPORT-109834 F0052,起始页触发报错,starting拿到的是false
  REPORT-109834 F0052,起始页触发报错,starting拿到的是false
  REPORT-109843 F0051,部分保存场景没有埋点
feature/x
superman 11 months ago
parent
commit
db1fa6554c
  1. 7
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 15
      designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java
  3. 1
      designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java
  4. 2
      designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java

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

@ -878,7 +878,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
return saveAsTemplate(isShowLoc);
}
collectInfo();
return this.saveFile();
TemplateSaveInfoContext.getInstance().startCollect(template);
boolean result = this.saveFile();
TemplateSaveInfoContext.getInstance().stopCollect(result);
return result;
}
private boolean isCancelOperation(int operation) {
@ -967,7 +970,9 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
generateNewTemplateIdForSaveAs();
this.editingFILE = editingFILE;
TemplateSaveInfoContext.getInstance().startCollect(template);
boolean result = this.saveToNewFile(oldName);
TemplateSaveInfoContext.getInstance().stopCollect(result);
if (result) {
DesignerFrameFileDealerPane.getInstance().refresh();
collectInfoWhenSaveAs(originID);

15
designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java

@ -25,6 +25,7 @@ public class StartErrorMessageCollector {
private String uuid;
private String activeKey;
private boolean extraJudgeStart = false;
public static StartErrorMessageCollector getInstance() {
return INSTANCE;
@ -42,7 +43,7 @@ public class StartErrorMessageCollector {
errorInfo.setLogid(id);
errorInfo.setLog(msg);
errorInfo.setStackTrace(detail);
errorInfo.setStarting(DesignerStartupContext.getInstance().isOnStartup());
errorInfo.setStarting(DesignerStartupContext.getInstance().isOnStartup() || extraJudgeStart);
errorInfo.setRemote(!WorkContext.getCurrent().isLocal());
errorInfo.saveAsJSON();
}
@ -51,10 +52,20 @@ public class StartErrorMessageCollector {
* 异步记录
*/
public void asyncRecord(String id, String msg, String detail) {
executorService.submit(() -> record(id, msg, detail));
executorService.submit(() -> {
record(id, msg, detail);
StartErrorMessageCollector.getInstance().setExtraJudgeStart(false);
});
}
public void record(String id, String msg) {
record(id, msg, StringUtils.EMPTY);
}
public void setExtraJudgeStart(boolean extraJudgeStart) {
this.extraJudgeStart = extraJudgeStart;
}
}

1
designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java

@ -258,6 +258,7 @@ public class StartupPageWindow extends JFrame {
try {
Void result = get();
setVisible(false);
StartErrorMessageCollector.getInstance().setExtraJudgeStart(false);
} catch (Exception e) {
// 处理错误
UIUtil.invokeLaterIfNeeded(() -> {

2
designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java

@ -2,6 +2,7 @@ package com.fr.start.module.optimized;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector;
import com.fr.design.ui.util.UIUtil;
import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator;
@ -164,6 +165,7 @@ public class DesignerStartupPageActivator extends Activator {
UIUtil.invokeLaterIfNeeded(() -> {
// 换到 awt 线程中关闭,不然异步会出现问题。
DesignerStartupContext.getInstance().setOnStartup(false);
StartErrorMessageCollector.getInstance().setExtraJudgeStart(true);
recordStartupEnd(stopWatch);
});
markComplete();

Loading…
Cancel
Save