Browse Source

Pull request #9509: 无jira 解决冲突

Merge in DESIGN/design from ~JOHN.YING/design:feature/x to feature/x

* commit '6e9f7d67c3ad7e81a0eff3219845d5ab1c78ecd8':
  REPORT-75072 fix:SocketIO启动失败,端口被占用
  KERNEL-11853 设置的分钟数可以支持小数,但不能小于1分钟
feature/x
John.Ying 2 years ago
parent
commit
518e43bb38
  1. 15
      designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java
  2. 19
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

15
designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java

@ -133,7 +133,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
ob = StrategyConfigHelper.createStrategyConfig(true, false, true); ob = StrategyConfigHelper.createStrategyConfig(true, false, true);
} }
this.strategyConfig = ob; this.strategyConfig = ob;
this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.format("%.0f", ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE)); this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.valueOf(ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE));
this.schemaTime.setText(StringUtils.join(",", ob.getUpdateSchema().toArray(new String[0]))); this.schemaTime.setText(StringUtils.join(",", ob.getUpdateSchema().toArray(new String[0])));
this.shouldEvolve.setSelected(ob.shouldEvolve()); this.shouldEvolve.setSelected(ob.shouldEvolve());
this.selectBySchema.setSelected(ob.isScheduleBySchema()); this.selectBySchema.setSelected(ob.isScheduleBySchema());
@ -185,7 +185,6 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
this.schemaTimeCheckTips.setVisible(true); this.schemaTimeCheckTips.setVisible(true);
throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); throw new IllegalArgumentException("[ESD]Update schema time interval is to short.");
} }
} else { } else {
Collections.addAll(schemaTimes, text.split(",")); Collections.addAll(schemaTimes, text.split(","));
} }
@ -200,8 +199,15 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
String interval = this.updateInterval.getText(); String interval = this.updateInterval.getText();
if (checkUpdateInterval(interval)) { if (checkUpdateInterval(interval)) {
long intervalMillis = StringUtils.isEmpty(interval) ? 0 : (long) (Double.parseDouble(interval) * CacheConstants.MILLIS_OF_MINUTE); long intervalMillis = StringUtils.isEmpty(interval) ? 0 : (long) (Double.parseDouble(interval) * CacheConstants.MILLIS_OF_MINUTE);
config.setUpdateInterval(intervalMillis); if (intervalMillis >= CacheConstants.MILLIS_OF_MINUTE) {
config.setUpdateInterval(intervalMillis);
} else {
this.updateIntervalCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short"));
this.updateIntervalCheckTips.setVisible(true);
throw new IllegalArgumentException("[ESD]Update schema time interval is to short.");
}
} else { } else {
this.updateIntervalCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format"));
this.updateIntervalCheckTips.setVisible(true); this.updateIntervalCheckTips.setVisible(true);
throw new IllegalArgumentException("[ESD]Error update interval format."); throw new IllegalArgumentException("[ESD]Error update interval format.");
} }
@ -220,7 +226,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
private boolean checkUpdateInterval(String intervalValue) { private boolean checkUpdateInterval(String intervalValue) {
try { try {
return !StringUtils.isEmpty(intervalValue) && !(Integer.parseInt(intervalValue) <= 0); return !StringUtils.isEmpty(intervalValue) && !(Double.parseDouble(intervalValue) <= 0);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
@ -228,6 +234,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
return false; return false;
} }
private boolean checkCornTimeInterval (String cronText) { private boolean checkCornTimeInterval (String cronText) {
// 判断后两次更新时间间隔,如果小于1分钟就返回false // 判断后两次更新时间间隔,如果小于1分钟就返回false
try { try {

19
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -168,27 +168,27 @@ public class DesignerActivator extends Activator implements Prepare {
DesignerMessageHelper.getInstance().prepareShowMessage(); DesignerMessageHelper.getInstance().prepareShowMessage();
} }
}); });
private boolean hasUpdated = false; private boolean hasUpdated = false;
@Override @Override
public void start() { public void start() {
List<LocaleMarker> markers = findMutable(InterMutableKey.Path); List<LocaleMarker> markers = findMutable(InterMutableKey.Path);
for (LocaleMarker marker : markers) { for (LocaleMarker marker : markers) {
if (marker.match(LocaleScope.DESIGN)) { if (marker.match(LocaleScope.DESIGN)) {
DesignI18nImpl.getInstance().addResource(marker.getPath()); DesignI18nImpl.getInstance().addResource(marker.getPath());
} }
} }
CompletableFuture<Void> themeConfigPrepare = CompletableFuture.runAsync(() -> { CompletableFuture<Void> themeConfigPrepare = CompletableFuture.runAsync(() -> {
FormThemeConfigMigrator.getInstance().upgrade(); FormThemeConfigMigrator.getInstance().upgrade();
ReportThemeConfigMigrator.getInstance().upgrade(); ReportThemeConfigMigrator.getInstance().upgrade();
}, DesignerStartupPool.common()); }, DesignerStartupPool.common());
CompletableFuture<Void> mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common()); CompletableFuture<Void> mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common());
CompletableFuture<Void> otherFeaturesPrepare = CompletableFuture.runAsync(() -> { CompletableFuture<Void> otherFeaturesPrepare = CompletableFuture.runAsync(() -> {
startBBSLoginAuthServer(); startBBSLoginAuthServer();
migrateBBSInfoFromFineDB(); migrateBBSInfoFromFineDB();
@ -205,13 +205,13 @@ public class DesignerActivator extends Activator implements Prepare {
AlphaFineHelper.switchConfig4Locale(); AlphaFineHelper.switchConfig4Locale();
RecoverManager.register(new RecoverForDesigner()); RecoverManager.register(new RecoverForDesigner());
}); });
CompletableFuture<Void> resourcePrepare = CompletableFuture.runAsync(() -> { CompletableFuture<Void> resourcePrepare = CompletableFuture.runAsync(() -> {
pushUpdateTask.run(); pushUpdateTask.run();
PluginResourceLoader.INSTANCE.checkOldShopFile(); PluginResourceLoader.INSTANCE.checkOldShopFile();
UpmResourceLoader.INSTANCE.checkOldShopFile(); UpmResourceLoader.INSTANCE.checkOldShopFile();
}, DesignerStartupPool.common()); }, DesignerStartupPool.common());
CompletableFuture CompletableFuture
.allOf(mainDesignerPrepare, themeConfigPrepare, otherFeaturesPrepare, resourcePrepare) .allOf(mainDesignerPrepare, themeConfigPrepare, otherFeaturesPrepare, resourcePrepare)
.join(); .join();
@ -219,9 +219,9 @@ public class DesignerActivator extends Activator implements Prepare {
@Override @Override
public void afterAllStart() { public void afterAllStart() {
DesignerStartupExecutor.getInstance().execute(() -> DesignerLaunchStatus.setStatus(DesignerLaunchStatus.DESIGNER_INIT_COMPLETE)); DesignerStartupExecutor.getInstance().execute(() -> DesignerLaunchStatus.setStatus(DesignerLaunchStatus.DESIGNER_INIT_COMPLETE));
//生成BasicChartQuickEditor对象,需要用到ChartDesignerActivator的注册信息(DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);) //生成BasicChartQuickEditor对象,需要用到ChartDesignerActivator的注册信息(DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);)
//所以不能在registerCellEditor函数中进行注册 //所以不能在registerCellEditor函数中进行注册
ActionFactory.registerCellEditor(ChartCollection.class, new BasicChartQuickEditor()); ActionFactory.registerCellEditor(ChartCollection.class, new BasicChartQuickEditor());
@ -521,7 +521,6 @@ public class DesignerActivator extends Activator implements Prepare {
@Override @Override
public void prepare() { public void prepare() {
if (!OptimizeUtil.isOpen()) { if (!OptimizeUtil.isOpen()) {
LoginAuthServer.getInstance().compatibleStart(); LoginAuthServer.getInstance().compatibleStart();
} }

Loading…
Cancel
Save