From 3702339dfce6ec87c559dffe52118faac43977fb Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 21 Jun 2022 15:52:10 +0800 Subject: [PATCH 01/11] =?UTF-8?q?REPORT-71824=20frm=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E5=88=87=E6=8D=A2=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80=E5=BD=93=E5=89=8Dfrm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 切换工作空间后,应该刷新整个设计。 10.0和11.0的刷新都有问题,需要退出当前选中控件的编辑模式。 【改动思路】 同上 --- .../com/fr/design/mainframe/JTemplate.java | 20 +++++++++------- .../java/com/fr/design/mainframe/JForm.java | 23 +++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index a76d92913c..eaf4b84bfa 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -499,19 +499,23 @@ public abstract class JTemplate> UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - // 先移除旧的。 - removeCenterPane(); - // 加入新的 - addCenterPane(); - - refreshToolArea(); - - TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); + refreshDesignerFromResource(); } }); } + protected void refreshDesignerFromResource() { + // 先移除旧的。 + removeCenterPane(); + // 加入新的 + addCenterPane(); + + refreshToolArea(); + + TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); + } + /** * 刷新 模板资源 和 EditingFILE * 仅在切换工作目录,reload模板时使用 diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 831d245d1a..b58932c8a7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -70,6 +70,7 @@ import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.preview.FormPreview; import com.fr.design.preview.MobilePreview; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; +import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.LayoutUtils; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; @@ -380,6 +381,28 @@ public class JForm extends JTemplate implements BaseJForm Date: Fri, 24 Jun 2022 17:11:50 +0800 Subject: [PATCH 02/11] =?UTF-8?q?REPORT-73491=20=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=9D=A2=E6=9D=BF=EF=BC=8C=E5=9C=A8=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=87=8D=E5=90=AF=E5=90=8E=E8=AF=A5=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=AD=A3=E7=A1=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/poly/creator/ECBlockEditor.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/poly/creator/ECBlockEditor.java b/designer-realize/src/main/java/com/fr/poly/creator/ECBlockEditor.java index a387e0f3a9..1d69726df7 100644 --- a/designer-realize/src/main/java/com/fr/poly/creator/ECBlockEditor.java +++ b/designer-realize/src/main/java/com/fr/poly/creator/ECBlockEditor.java @@ -3,7 +3,6 @@ */ package com.fr.poly.creator; -import com.fr.base.BaseUtils; import com.fr.base.ScreenResolution; import com.fr.base.vcs.DesignerMode; import com.fr.design.constants.UIConstants; @@ -11,7 +10,15 @@ import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.frpane.HyperlinkGroupPane; -import com.fr.design.mainframe.*; +import com.fr.design.mainframe.CellElementPropertyPane; +import com.fr.design.mainframe.CellWidgetPropertyPane; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.JWorkBook; +import com.fr.design.mainframe.ReportFloatPane; import com.fr.design.mainframe.cell.QuickEditorRegion; import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.grid.GridUtils; @@ -26,8 +33,9 @@ import com.fr.report.poly.PolyECBlock; import com.fr.stable.unit.UNITConstants; import com.fr.stable.unit.UnitRectangle; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; /** * @author richer @@ -166,6 +174,7 @@ public class ECBlockEditor extends BlockEditor { // 条件属性 ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance(); conditionAttributesGroupPane.populate(editComponent); + EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane); EastRegionContainerPane.getInstance().updateCellElementState(isSelectedOneCell()); if (chooseBlock) { From b8f17c6c08d558622a1262f94f6d6846a7ba5cc4 Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 29 Jun 2022 10:19:54 +0800 Subject: [PATCH 03/11] =?UTF-8?q?REPORT-74664=20=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=96=B0=E6=A8=A1=E5=BC=8F=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E8=80=81=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 NewFormAttrMark没有保存到实际的form对象中 【改动思路】 同上 --- designer-form/src/main/java/com/fr/design/fit/NewJForm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/fit/NewJForm.java b/designer-form/src/main/java/com/fr/design/fit/NewJForm.java index 660a5c483e..314097bcf1 100644 --- a/designer-form/src/main/java/com/fr/design/fit/NewJForm.java +++ b/designer-form/src/main/java/com/fr/design/fit/NewJForm.java @@ -55,7 +55,7 @@ public class NewJForm extends JForm { public NewJForm(Form form) { super(form); //新建的模板都要加上新表单标志attr - form.addAttrMark(NewFormMarkAttr.createNewFormAttr()); + getTarget().addAttrMark(NewFormMarkAttr.createNewFormAttr()); init(); } From bd045355629f7a907c7ec7cf0244f1dc5fac71dd Mon Sep 17 00:00:00 2001 From: rinoux Date: Wed, 29 Jun 2022 18:36:55 +0800 Subject: [PATCH 04/11] =?UTF-8?q?REPORT-74603=20=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=BC=8F=E6=95=B0=E6=8D=AE=E5=BA=93=E7=9A=84=E9=99=90=E5=88=B6?= =?UTF-8?q?=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/connect/ConnectionListPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index e4deae04ba..93f2938556 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.connect; +import com.fr.base.TemplateUtils; import com.fr.config.RemoteConfigEvent; import com.fr.data.core.db.JDBCSecurityChecker; import com.fr.data.impl.Connection; @@ -201,7 +202,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh Connection connection = connectionBean.getConnection(); if (connection instanceof JDBCDatabaseConnection) { try { - JDBCSecurityChecker.checkURL(((JDBCDatabaseConnection) connection).getURL()); + JDBCSecurityChecker.checkURL(TemplateUtils.render(((JDBCDatabaseConnection) connection).getURL())); JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery()); } catch (SQLException e) { throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause()); From cdaa29cd4339bb0b33615a803425c5c84197f6fe Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 5 Jul 2022 17:19:07 +0800 Subject: [PATCH 05/11] =?UTF-8?q?REPORT-75174=20FR11=E6=96=B0=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94-PC=E7=AB=AF=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=8A=A5=E8=A1=A8=E5=9D=97=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=EF=BC=8C=E6=8A=A5=E8=A1=A8=E5=9D=97?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7Pc=E6=B5=8F=E8=A7=88=E5=99=A8=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E8=AE=BE=E7=BD=AE=E9=A1=B9=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=8F=8C=E5=90=91=E8=87=AA=E9=80=82=E5=BA=94=EF=BC=8C=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E6=96=B0=E6=A8=A1=E5=BC=8F=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=E5=8F=98=E4=B8=BA=E4=B8=8D=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XCreatorUtils.java | 24 ++++++++++++++++--- .../design/designer/creator/XElementCase.java | 10 +------- .../design/fit/common/AdaptiveSwitchUtil.java | 23 ++++++++++++++++++ 3 files changed, 45 insertions(+), 12 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 395521a7fa..eb1f3497a3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -4,9 +4,6 @@ package com.fr.design.designer.creator; import com.fr.base.chart.BaseChartCollection; -import com.fr.base.theme.FineColorFlushUtils; -import com.fr.base.theme.FineColorGather; -import com.fr.base.theme.FineColorManager; import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateTheme; @@ -82,6 +79,9 @@ import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; +import com.fr.report.fit.FitProvider; +import com.fr.report.fit.ReportFitAttr; +import com.fr.report.fit.ReportFitConfig; import com.fr.stable.StringUtils; import com.fr.third.javax.annotation.Nonnull; import java.util.Set; @@ -486,4 +486,22 @@ public class XCreatorUtils { } } + + public static ReportFitAttr getElementCaseEditorReportFitAttr(ElementCaseEditor editor, FitProvider wbTpl) { + //这边获取到的全局要考虑到服务器的配置 + ReportFitAttr fitAttr = wbTpl.getReportFitAttr() == null ? ReportFitConfig.getInstance().getFrmFitAttr() : wbTpl.getReportFitAttr(); + return getElementCaseEditorReportFitAttr(editor, fitAttr); + } + + public static ReportFitAttr getElementCaseEditorReportFitAttr(ElementCaseEditor editor, ReportFitAttr fitAttr) { + //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) + if (editor.getFitStateInPC() == 0) { + editor.setReportFitAttr(null); + } + ReportFitAttr reportFit = editor.getReportFitAttr(); + if (fitAttr != null) { + reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; + } + return editor.getReportFitAttr() == null ? fitAttr : reportFit; + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index 2f4a699379..6b452bd08d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -131,15 +131,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme //这边获取到的全局要考虑到服务器的配置 ReportFitAttr fitAttr = wbTpl.getReportFitAttr() == null ? ReportFitConfig.getInstance().getFrmFitAttr() : wbTpl.getReportFitAttr(); ElementCaseEditor editor = this.toData(); - //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) - if (editor.getFitStateInPC() == 0) { - editor.setReportFitAttr(null); - } - ReportFitAttr reportFit = editor.getReportFitAttr(); - if (fitAttr != null) { - reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; - } - ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; + ReportFitAttr reportFitAttr = XCreatorUtils.getElementCaseEditorReportFitAttr(editor, fitAttr); BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); if (editor.getReportFitAttr() == null) { diff --git a/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java b/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java index 031d698498..062ffa1504 100644 --- a/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java +++ b/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java @@ -1,6 +1,7 @@ package com.fr.design.fit.common; import com.fr.design.data.DesignTableDataManager; +import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.fit.NewJForm; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -11,6 +12,7 @@ import com.fr.file.MemFILE; import com.fr.form.fit.NewFormMarkAttr; import com.fr.form.main.Form; import com.fr.form.main.WidgetGather; +import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; @@ -94,15 +96,36 @@ public class AdaptiveSwitchUtil { } //如果是从旧的设计模板转化为新的设计模式,并且不是全局配置的模板。则更新新模板的Pc端自适应属性 if (newJForm.getTarget().getReportFitAttr() != null && newJForm.isNewJFrom()) { + //兼容处理老模式下报表块自适应属性设置为跟随报表整体自适应 + compatibleProcessECReportFitAttr(newJForm.getTarget()); //修改自适应属性 newJForm.getTarget().setReportFitAttr(shiftReportFitAttr(oldForm, newJForm.getTarget().getReportFitAttr().isFitFont())); //修改绝对布局中的缩放属性 processAbsoluteLayoutCompatible(newJForm.getTarget()); + } TemplateTool.saveForm(newJForm); return newJForm; } + private static void compatibleProcessECReportFitAttr(Form form) { + Form.traversalWidget(form.getContainer(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + ElementCaseEditor editor = (ElementCaseEditor) widget; + ReportFitAttr reportFitAttr = XCreatorUtils.getElementCaseEditorReportFitAttr(editor, form); + if (reportFitAttr.fitStateInPC() != 0) { + editor.setReportFitAttr(reportFitAttr); + } + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }, ElementCaseEditor.class); + } + private static void processAbsoluteLayoutCompatible(Form form) { Form.traversalWidget(form.getContainer(), new WidgetGather() { From 2d4110e77f948a681fec09ee4c51e0f05cfce5a3 Mon Sep 17 00:00:00 2001 From: Num73 <2788852163@qq.com> Date: Thu, 7 Jul 2022 16:24:18 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E6=8A=BD=E6=95=B0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4=E9=9A=94=E9=99=90?= =?UTF-8?q?=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C=E4=B8=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/ESDStrategyConfigPane.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index 1fd840ac78..091e18231e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -15,6 +15,7 @@ import com.fr.esd.util.ESDUtils; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import com.fr.third.org.quartz.CronExpression; import javax.swing.AbstractAction; import javax.swing.JPanel; @@ -25,9 +26,11 @@ import java.awt.Desktop; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URI; +import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Date; /** * @author rinoux @@ -36,7 +39,6 @@ import java.util.List; */ public class ESDStrategyConfigPane extends BasicBeanPane { private static final String CRON_HELP_URL = "http://help.fanruan.com/finereport/doc-view-693.html"; - private UIRadioButton selectAutoUpdate; private UIRadioButton selectBySchema; private UICheckBox shouldEvolve; @@ -131,8 +133,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane { ob = StrategyConfigHelper.createStrategyConfig(true, false, true); } this.strategyConfig = ob; - - this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.valueOf(ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE)); + this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.format("%.0f", 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()); @@ -177,11 +178,22 @@ public class ESDStrategyConfigPane extends BasicBeanPane { if (ESDUtils.checkUpdateTimeSchema(text)) { if (ESDUtils.isCronExpression(text)) { + // 判断后两次更新时间间隔,如果小于1分钟就显示错误 + CronExpression cron = new CronExpression(text); + Date next1 = cron.getNextValidTimeAfter(new Date()); + Date next2 = cron.getNextValidTimeAfter(next1); + if (next2.getTime() - next1.getTime() < CacheConstants.MILLIS_OF_MINUTE) { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short")); + this.schemaTimeCheckTips.setVisible(true); + throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); + } + schemaTimes.add(text); } else { Collections.addAll(schemaTimes, text.split(",")); } } else { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format")); this.schemaTimeCheckTips.setVisible(true); throw new IllegalArgumentException("[ESD]Update schema time format error."); } @@ -202,6 +214,8 @@ public class ESDStrategyConfigPane extends BasicBeanPane { } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + } catch (ParseException e) { + throw new RuntimeException(e); } } @@ -211,7 +225,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane { private boolean checkUpdateInterval(String intervalValue) { try { - return !StringUtils.isEmpty(intervalValue) && !(Double.parseDouble(intervalValue) <= 0); + return !StringUtils.isEmpty(intervalValue) && !(Integer.parseInt(intervalValue) <= 0); } catch (NumberFormatException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } From 247e752bc81e643e64f4a699c224fd3651a82f29 Mon Sep 17 00:00:00 2001 From: Num73 <2788852163@qq.com> Date: Thu, 7 Jul 2022 16:54:50 +0800 Subject: [PATCH 07/11] =?UTF-8?q?KERNEL-11853=20=E6=8A=BD=E6=95=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E9=99=90=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/ESDStrategyConfigPane.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index 1fd840ac78..091e18231e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -15,6 +15,7 @@ import com.fr.esd.util.ESDUtils; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import com.fr.third.org.quartz.CronExpression; import javax.swing.AbstractAction; import javax.swing.JPanel; @@ -25,9 +26,11 @@ import java.awt.Desktop; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URI; +import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Date; /** * @author rinoux @@ -36,7 +39,6 @@ import java.util.List; */ public class ESDStrategyConfigPane extends BasicBeanPane { private static final String CRON_HELP_URL = "http://help.fanruan.com/finereport/doc-view-693.html"; - private UIRadioButton selectAutoUpdate; private UIRadioButton selectBySchema; private UICheckBox shouldEvolve; @@ -131,8 +133,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane { ob = StrategyConfigHelper.createStrategyConfig(true, false, true); } this.strategyConfig = ob; - - this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.valueOf(ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE)); + this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.format("%.0f", 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()); @@ -177,11 +178,22 @@ public class ESDStrategyConfigPane extends BasicBeanPane { if (ESDUtils.checkUpdateTimeSchema(text)) { if (ESDUtils.isCronExpression(text)) { + // 判断后两次更新时间间隔,如果小于1分钟就显示错误 + CronExpression cron = new CronExpression(text); + Date next1 = cron.getNextValidTimeAfter(new Date()); + Date next2 = cron.getNextValidTimeAfter(next1); + if (next2.getTime() - next1.getTime() < CacheConstants.MILLIS_OF_MINUTE) { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short")); + this.schemaTimeCheckTips.setVisible(true); + throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); + } + schemaTimes.add(text); } else { Collections.addAll(schemaTimes, text.split(",")); } } else { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format")); this.schemaTimeCheckTips.setVisible(true); throw new IllegalArgumentException("[ESD]Update schema time format error."); } @@ -202,6 +214,8 @@ public class ESDStrategyConfigPane extends BasicBeanPane { } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + } catch (ParseException e) { + throw new RuntimeException(e); } } @@ -211,7 +225,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane { private boolean checkUpdateInterval(String intervalValue) { try { - return !StringUtils.isEmpty(intervalValue) && !(Double.parseDouble(intervalValue) <= 0); + return !StringUtils.isEmpty(intervalValue) && !(Integer.parseInt(intervalValue) <= 0); } catch (NumberFormatException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } From 833b53133d697b5d4f9138bae5fa163810617981 Mon Sep 17 00:00:00 2001 From: Maximus <2788852163@qq.com> Date: Thu, 7 Jul 2022 19:44:07 +0800 Subject: [PATCH 08/11] =?UTF-8?q?KERNEL-11853=20=E6=8A=BD=E6=95=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E9=99=90=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/ESDStrategyConfigPane.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index 091e18231e..a94db304b3 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -188,7 +188,14 @@ public class ESDStrategyConfigPane extends BasicBeanPane { throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); } - schemaTimes.add(text); + if (checkCornTimeInterval(text)) { + schemaTimes.add(text); + } else { + this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short")); + this.schemaTimeCheckTips.setVisible(true); + throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); + } + } else { Collections.addAll(schemaTimes, text.split(",")); } @@ -233,6 +240,17 @@ public class ESDStrategyConfigPane extends BasicBeanPane { return false; } + private boolean checkCornTimeInterval (String cronText) { + // 判断后两次更新时间间隔,如果小于1分钟就返回false + try { + CronExpression cron = new CronExpression(cronText); + Date next1 = cron.getNextValidTimeAfter(new Date()); + Date next2 = cron.getNextValidTimeAfter(next1); + return next2.getTime() - next1.getTime() >= CacheConstants.MILLIS_OF_MINUTE; + } catch (ParseException e) { + throw new RuntimeException(e); + } + } protected String title4PopupWindow() { return InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Strategy_Config_Title"); From b012cbac5796b5f6e6040e04977a9776783dfb5e Mon Sep 17 00:00:00 2001 From: Maximus <2788852163@qq.com> Date: Thu, 7 Jul 2022 19:55:25 +0800 Subject: [PATCH 09/11] =?UTF-8?q?KERNEL-11853=20=E6=8A=BD=E6=95=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E9=99=90=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/ESDStrategyConfigPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index a94db304b3..e4fd53cec7 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -247,9 +247,10 @@ public class ESDStrategyConfigPane extends BasicBeanPane { Date next1 = cron.getNextValidTimeAfter(new Date()); Date next2 = cron.getNextValidTimeAfter(next1); return next2.getTime() - next1.getTime() >= CacheConstants.MILLIS_OF_MINUTE; - } catch (ParseException e) { - throw new RuntimeException(e); + } catch (ParseException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } + return false; } protected String title4PopupWindow() { From 4aec6e5b8d2187dd7b24026c77fa050feb69df3a Mon Sep 17 00:00:00 2001 From: Maximus <2788852163@qq.com> Date: Fri, 8 Jul 2022 09:51:35 +0800 Subject: [PATCH 10/11] =?UTF-8?q?KERNEL-11853=20=E6=8A=BD=E6=95=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9C=80=E5=B0=8F=E6=9B=B4=E6=96=B0=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E9=99=90=E5=88=B61=E5=88=86=E9=92=9F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/ESDStrategyConfigPane.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java index e4fd53cec7..39b4ecb00f 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java @@ -178,16 +178,6 @@ public class ESDStrategyConfigPane extends BasicBeanPane { if (ESDUtils.checkUpdateTimeSchema(text)) { if (ESDUtils.isCronExpression(text)) { - // 判断后两次更新时间间隔,如果小于1分钟就显示错误 - CronExpression cron = new CronExpression(text); - Date next1 = cron.getNextValidTimeAfter(new Date()); - Date next2 = cron.getNextValidTimeAfter(next1); - if (next2.getTime() - next1.getTime() < CacheConstants.MILLIS_OF_MINUTE) { - this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short")); - this.schemaTimeCheckTips.setVisible(true); - throw new IllegalArgumentException("[ESD]Update schema time interval is to short."); - } - if (checkCornTimeInterval(text)) { schemaTimes.add(text); } else { @@ -221,8 +211,6 @@ public class ESDStrategyConfigPane extends BasicBeanPane { } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - } catch (ParseException e) { - throw new RuntimeException(e); } } From 8d441237c0a33e291fba097752e0a7e3cab9285e Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Fri, 8 Jul 2022 10:10:17 +0800 Subject: [PATCH 11/11] =?UTF-8?q?REPORT-74118=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E6=95=B0=E6=8D=AE=E6=BA=90=E8=80=81=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=B0=E6=95=B0=E6=8D=AE=E9=9B=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=B9=B6=E6=B7=BB=E5=8A=A0=E5=A4=9A=E5=88=86=E7=B1=BB?= =?UTF-8?q?=EF=BC=8C=E5=A4=9A=E5=88=86=E7=B1=BB=E4=B8=8D=E5=8F=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/data/VanChartMoreCateTableDataContentPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java index dcf160aec1..4d9f0aa61f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java @@ -22,13 +22,14 @@ public class VanChartMoreCateTableDataContentPane extends CategoryPlotMoreCateTa @Override public void populateBean(ChartCollection collection) { super.populateBean(collection); - VanChartRectanglePlot plot = (VanChartRectanglePlot) collection.getSelectedChart().getPlot(); + VanChartRectanglePlot plot = collection.getSelectedChart().getPlot(); isSupportMultiCategory = plot.isSupportMultiCategory(); checkBoxList(isSupportMultiCategory); } protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) { super.updateMoreCate(normal, plot); + isSupportMultiCategory = ((VanChartRectanglePlot) plot).isSupportMultiCategory(); ((VanChartPlot) plot).setCategoryNum(getBoxList().size() + 1); if (!getBoxList().isEmpty()) { plot.getDataSheet().setVisible(false);