Browse Source

Pull request #14876: REPORT-132833 【fr-fbp回归】【数据集】服务器数据集开启缓存,保存后再次打开还是未开启状态

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

* commit 'f3ff5d9654290b8b23e3ad9fb8cd63c0006ee441':
  REPORT-132833 【fr-fbp回归】【数据集】服务器数据集开启缓存,保存后再次打开还是未开启状态
fbp/release
Destiny.Lin-林锦龙 2 months ago
parent
commit
05763c4268
  1. 40
      designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java

40
designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java

@ -16,8 +16,10 @@ import com.fr.decision.webservice.bean.dataset.ParameterExternal;
import com.fr.decision.webservice.bean.dataset.SQLDataSetBean;
import com.fr.decision.webservice.bean.dataset.ServerDataSetBean;
import com.fr.decision.webservice.bean.dataset.StoreProcedureBean;
import com.fr.decision.webservice.bean.dataset.StrategyConfigBean;
import com.fr.decision.webservice.v10.datasource.dataset.processor.impl.SQLDataSetProcessor;
import com.fr.decision.webservice.v10.datasource.dataset.processor.impl.StoreProcedureProcessor;
import com.fr.esd.core.strategy.config.StrategyConfig;
import com.fr.general.GeneralUtils;
import com.fr.general.sql.SqlUtils;
import com.fr.json.JSONObject;
@ -29,6 +31,7 @@ import com.fr.stable.StringUtils;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.tabledata.DataEncryptionHelper;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
@ -163,6 +166,22 @@ public class TableDataBeanHelper {
parameterBeans.add(new ParameterBean(parameter.getValue().getClass().getSimpleName(), parameter.getName(), GeneralUtils.objectToString(parameter.getValue())));
}
bean.setParameters(parameterBeans);
StrategyConfig config = dataSet.getStrategyConfig();
if (config != null) {
StrategyConfigBean strategyConfigBean = new StrategyConfigBean();
strategyConfigBean.setUseGlobal(config.isUseGlobal());
strategyConfigBean.setShouldMonitor(config.shouldMonitor());
strategyConfigBean.setShouldEvolve(config.shouldEvolve());
strategyConfigBean.setScheduleBySchema(config.isScheduleBySchema());
strategyConfigBean.setTimeToLive(config.getTimeToLive());
strategyConfigBean.setTimeToIdle(config.getTimeToIdle());
strategyConfigBean.setUpdateInterval(config.getUpdateInterval());
strategyConfigBean.setTerminalTime(config.getTerminalTime());
strategyConfigBean.setUpdateSchema(config.getUpdateSchema());
strategyConfigBean.setActiveInitiation(config.isActiveInitiation());
strategyConfigBean.setShare(config.enabled());
bean.setStrategyConfig(strategyConfigBean);
}
return JSONObject.mapFrom(bean);
}
@ -190,6 +209,27 @@ public class TableDataBeanHelper {
tableData.setShare(oldDataSet.isShare());
tableData.setDataQueryProcessor(oldDataSet.getDataQueryProcessor());
}
StrategyConfig config = getStrategyConfig(bean.getStrategyConfig());
tableData.setStrategyConfig(config);
return tableData;
}
private static StrategyConfig getStrategyConfig(StrategyConfigBean bean) {
if (bean == null) {
return new StrategyConfig();
}
StrategyConfig config = new StrategyConfig();
config.setEnable(bean.isShare());
config.setUseGlobal(bean.isUseGlobal());
config.setShouldMonitor(bean.isShouldMonitor());
config.setShouldEvolve(bean.isShouldEvolve());
config.setScheduleBySchema(bean.isScheduleBySchema());
config.setTimeToLive(bean.getTimeToLive());
config.setTimeToIdle(bean.getTimeToIdle());
config.setUpdateInterval(bean.getUpdateInterval());
config.setTerminalTime(bean.getTerminalTime());
config.setUpdateSchema(bean.getUpdateSchema());
config.setActiveInitiation(bean.isActiveInitiation());
return config;
}
}

Loading…
Cancel
Save