Browse Source

Merge pull request #13226 in DESIGN/design from release/11.0 to bugfix/11.0

* commit '96cd2ed69e20f3b62d7d59dfd8a0add68756264d':
  REPORT-109834 F0052,起始页触发报错,starting拿到的是false
  REPORT-109834 F0052,起始页触发报错,starting拿到的是false
  REPORT-109843 F0051,部分保存场景没有埋点
bugfix/11.0
superman 1 year ago
parent
commit
b8c30facf1
  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); return saveAsTemplate(isShowLoc);
} }
collectInfo(); collectInfo();
return this.saveFile(); TemplateSaveInfoContext.getInstance().startCollect(template);
boolean result = this.saveFile();
TemplateSaveInfoContext.getInstance().stopCollect(result);
return result;
} }
private boolean isCancelOperation(int operation) { private boolean isCancelOperation(int operation) {
@ -967,7 +970,9 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
generateNewTemplateIdForSaveAs(); generateNewTemplateIdForSaveAs();
this.editingFILE = editingFILE; this.editingFILE = editingFILE;
TemplateSaveInfoContext.getInstance().startCollect(template);
boolean result = this.saveToNewFile(oldName); boolean result = this.saveToNewFile(oldName);
TemplateSaveInfoContext.getInstance().stopCollect(result);
if (result) { if (result) {
DesignerFrameFileDealerPane.getInstance().refresh(); DesignerFrameFileDealerPane.getInstance().refresh();
collectInfoWhenSaveAs(originID); 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 uuid;
private String activeKey; private String activeKey;
private boolean extraJudgeStart = false;
public static StartErrorMessageCollector getInstance() { public static StartErrorMessageCollector getInstance() {
return INSTANCE; return INSTANCE;
@ -42,7 +43,7 @@ public class StartErrorMessageCollector {
errorInfo.setLogid(id); errorInfo.setLogid(id);
errorInfo.setLog(msg); errorInfo.setLog(msg);
errorInfo.setStackTrace(detail); errorInfo.setStackTrace(detail);
errorInfo.setStarting(DesignerStartupContext.getInstance().isOnStartup()); errorInfo.setStarting(DesignerStartupContext.getInstance().isOnStartup() || extraJudgeStart);
errorInfo.setRemote(!WorkContext.getCurrent().isLocal()); errorInfo.setRemote(!WorkContext.getCurrent().isLocal());
errorInfo.saveAsJSON(); errorInfo.saveAsJSON();
} }
@ -51,10 +52,20 @@ public class StartErrorMessageCollector {
* 异步记录 * 异步记录
*/ */
public void asyncRecord(String id, String msg, String detail) { 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) { public void record(String id, String msg) {
record(id, msg, StringUtils.EMPTY); 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 { try {
Void result = get(); Void result = get();
setVisible(false); setVisible(false);
StartErrorMessageCollector.getInstance().setExtraJudgeStart(false);
} catch (Exception e) { } catch (Exception e) {
// 处理错误 // 处理错误
UIUtil.invokeLaterIfNeeded(() -> { 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.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator; import com.fr.module.Activator;
@ -164,6 +165,7 @@ public class DesignerStartupPageActivator extends Activator {
UIUtil.invokeLaterIfNeeded(() -> { UIUtil.invokeLaterIfNeeded(() -> {
// 换到 awt 线程中关闭,不然异步会出现问题。 // 换到 awt 线程中关闭,不然异步会出现问题。
DesignerStartupContext.getInstance().setOnStartup(false); DesignerStartupContext.getInstance().setOnStartup(false);
StartErrorMessageCollector.getInstance().setExtraJudgeStart(true);
recordStartupEnd(stopWatch); recordStartupEnd(stopWatch);
}); });
markComplete(); markComplete();

Loading…
Cancel
Save