Browse Source

Merge remote-tracking branch 'origin/feature/x' into feature/x

feature/x
Yvan 2 years ago
parent
commit
940973e6e9
  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);
}
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.shouldEvolve.setSelected(ob.shouldEvolve());
this.selectBySchema.setSelected(ob.isScheduleBySchema());
@ -185,7 +185,6 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
this.schemaTimeCheckTips.setVisible(true);
throw new IllegalArgumentException("[ESD]Update schema time interval is to short.");
}
} else {
Collections.addAll(schemaTimes, text.split(","));
}
@ -200,8 +199,15 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
String interval = this.updateInterval.getText();
if (checkUpdateInterval(interval)) {
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 {
this.updateIntervalCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format"));
this.updateIntervalCheckTips.setVisible(true);
throw new IllegalArgumentException("[ESD]Error update interval format.");
}
@ -220,7 +226,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
private boolean checkUpdateInterval(String intervalValue) {
try {
return !StringUtils.isEmpty(intervalValue) && !(Integer.parseInt(intervalValue) <= 0);
return !StringUtils.isEmpty(intervalValue) && !(Double.parseDouble(intervalValue) <= 0);
} catch (NumberFormatException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
@ -228,6 +234,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
return false;
}
private boolean checkCornTimeInterval (String cronText) {
// 判断后两次更新时间间隔,如果小于1分钟就返回false
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();
}
});
private boolean hasUpdated = false;
@Override
public void start() {
List<LocaleMarker> markers = findMutable(InterMutableKey.Path);
for (LocaleMarker marker : markers) {
if (marker.match(LocaleScope.DESIGN)) {
DesignI18nImpl.getInstance().addResource(marker.getPath());
}
}
CompletableFuture<Void> themeConfigPrepare = CompletableFuture.runAsync(() -> {
FormThemeConfigMigrator.getInstance().upgrade();
ReportThemeConfigMigrator.getInstance().upgrade();
}, DesignerStartupPool.common());
CompletableFuture<Void> mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common());
CompletableFuture<Void> otherFeaturesPrepare = CompletableFuture.runAsync(() -> {
startBBSLoginAuthServer();
migrateBBSInfoFromFineDB();
@ -205,13 +205,13 @@ public class DesignerActivator extends Activator implements Prepare {
AlphaFineHelper.switchConfig4Locale();
RecoverManager.register(new RecoverForDesigner());
});
CompletableFuture<Void> resourcePrepare = CompletableFuture.runAsync(() -> {
pushUpdateTask.run();
PluginResourceLoader.INSTANCE.checkOldShopFile();
UpmResourceLoader.INSTANCE.checkOldShopFile();
}, DesignerStartupPool.common());
CompletableFuture
.allOf(mainDesignerPrepare, themeConfigPrepare, otherFeaturesPrepare, resourcePrepare)
.join();
@ -219,9 +219,9 @@ public class DesignerActivator extends Activator implements Prepare {
@Override
public void afterAllStart() {
DesignerStartupExecutor.getInstance().execute(() -> DesignerLaunchStatus.setStatus(DesignerLaunchStatus.DESIGNER_INIT_COMPLETE));
//生成BasicChartQuickEditor对象,需要用到ChartDesignerActivator的注册信息(DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);)
//所以不能在registerCellEditor函数中进行注册
ActionFactory.registerCellEditor(ChartCollection.class, new BasicChartQuickEditor());
@ -521,7 +521,6 @@ public class DesignerActivator extends Activator implements Prepare {
@Override
public void prepare() {
if (!OptimizeUtil.isOpen()) {
LoginAuthServer.getInstance().compatibleStart();
}

Loading…
Cancel
Save