Browse Source

Pull request #13157: REPORT-109660 F0052拿不到数据

Merge in DESIGN/design from ~DESTINY.LIN/design:release/11.0 to release/11.0

* commit 'bea38ab0f332c75975f0eaf3106191fbf81945a3':
  REPORT-109711 F0051新建的模版触发保存没有数据
  REPORT-109660 F0052拿不到数据
  REPORT-109660 F0052拿不到数据
release/11.0
Destiny.Lin-林锦龙 12 months ago
parent
commit
e81d9adcf7
  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>() {
@Override
public Boolean call() throws Exception {
TemplateSaveInfoContext.getInstance().startRecord();
TemplateSaveInfoContext.getInstance().collectInfo(template.suffix());
return saveAs(finalEditingFILE, sourceFile, oldName);
}
}, this);

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

@ -1,5 +1,6 @@
package com.fr.design.mainframe.messagecollect;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.errorinfo.ErrorInfo;
import com.fr.log.FineLoggerFactory;
@ -7,6 +8,9 @@ import com.fr.stable.StringUtils;
import com.fr.start.common.DesignerStartupContext;
import com.fr.workspace.WorkContext;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
*
* @author hades
@ -17,6 +21,7 @@ public class StartErrorMessageCollector {
private static final StartErrorMessageCollector INSTANCE = new StartErrorMessageCollector();
private ExecutorService executorService = Executors.newSingleThreadExecutor(new NamedThreadFactory(StartErrorMessageCollector.this.getClass()));
private String uuid;
private String activeKey;
@ -42,6 +47,13 @@ public class StartErrorMessageCollector {
errorInfo.saveAsJSON();
}
/**
* 异步记录
*/
public void asyncRecord(String id, String msg, String detail) {
executorService.submit(() -> record(id, msg, detail));
}
public void record(String id, String msg) {
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;
import com.fr.base.svg.IconUtils;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.UIExpandDialog;
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.layout.FRGUIPaneFactory;
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.utils.ColorUtils;
import com.fr.design.utils.ThemeUtils;
@ -49,6 +52,8 @@ import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.util.List;
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);
});
FineLoggerFactory.getLogger().error(e.getMessage(), e);
StartErrorMessageCollector.getInstance().asyncRecord(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(),
DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(),
e.getMessage());
} finally {
loadingPanel.hide();
}

Loading…
Cancel
Save