Browse Source

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

* commit 'c09fcb8e5650af657e8fcbb301df99ff0139a53c':
  REPORT-109711 F0051新建的模版触发保存没有数据
  REPORT-109660 F0052拿不到数据
  REPORT-109660 F0052拿不到数据
feature/x
superman 1 year ago
parent
commit
42857c2f89
  1. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 12
      designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java
  3. 8
      designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java

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

@ -1783,6 +1783,8 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
CallbackSaveWorker worker = new CallbackSaveWorker(new Callable<Boolean>() { CallbackSaveWorker worker = new CallbackSaveWorker(new Callable<Boolean>() {
@Override @Override
public Boolean call() throws Exception { public Boolean call() throws Exception {
TemplateSaveInfoContext.getInstance().startRecord();
TemplateSaveInfoContext.getInstance().collectInfo(template.suffix());
return saveAs(finalEditingFILE, sourceFile, oldName); return saveAs(finalEditingFILE, sourceFile, oldName);
} }
}, this); }, this);

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

@ -1,5 +1,6 @@
package com.fr.design.mainframe.messagecollect; package com.fr.design.mainframe.messagecollect;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.errorinfo.ErrorInfo; import com.fr.design.mainframe.errorinfo.ErrorInfo;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -7,6 +8,9 @@ import com.fr.stable.StringUtils;
import com.fr.start.common.DesignerStartupContext; import com.fr.start.common.DesignerStartupContext;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** /**
* *
* @author hades * @author hades
@ -17,6 +21,7 @@ public class StartErrorMessageCollector {
private static final StartErrorMessageCollector INSTANCE = new StartErrorMessageCollector(); private static final StartErrorMessageCollector INSTANCE = new StartErrorMessageCollector();
private ExecutorService executorService = Executors.newSingleThreadExecutor(new NamedThreadFactory(StartErrorMessageCollector.this.getClass()));
private String uuid; private String uuid;
private String activeKey; private String activeKey;
@ -42,6 +47,13 @@ public class StartErrorMessageCollector {
errorInfo.saveAsJSON(); errorInfo.saveAsJSON();
} }
/**
* 异步记录
*/
public void asyncRecord(String id, String msg, String detail) {
executorService.submit(() -> record(id, msg, detail));
}
public void record(String id, String msg) { public void record(String id, String msg) {
record(id, msg, StringUtils.EMPTY); record(id, msg, StringUtils.EMPTY);
} }

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

@ -1,6 +1,7 @@
package com.fr.startup.ui; package com.fr.startup.ui;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.UIExpandDialog; import com.fr.design.dialog.UIExpandDialog;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
@ -8,6 +9,8 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector;
import com.fr.design.mainframe.messagecollect.entity.DesignerErrorMessage;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.ColorUtils; import com.fr.design.utils.ColorUtils;
import com.fr.design.utils.ThemeUtils; import com.fr.design.utils.ThemeUtils;
@ -49,6 +52,8 @@ import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** /**
* 启动页 * 启动页
@ -269,6 +274,9 @@ public class StartupPageWindow extends JFrame {
setEnabled(true); setEnabled(true);
}); });
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
StartErrorMessageCollector.getInstance().asyncRecord(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(),
DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(),
e.getMessage());
} finally { } finally {
loadingPanel.hide(); loadingPanel.hide();
} }

Loading…
Cancel
Save