forked from github/dataease
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
ed23659d1c
@ -110,6 +110,8 @@ public interface ParamConstants {
|
||||
enum BASIC implements ParamConstants {
|
||||
FRONT_TIME_OUT("basic.frontTimeOut"),
|
||||
MSG_TIME_OUT("basic.msgTimeOut"),
|
||||
|
||||
LOG_TIME_OUT("basic.logTimeOut"),
|
||||
DS_CHECK_INTERVAL("basic.dsCheckInterval"),
|
||||
DS_CHECK_INTERVAL_TYPE("basic.dsCheckIntervalType"),
|
||||
DEFAULT_LOGIN_TYPE("basic.loginType"),
|
||||
|
@ -13,6 +13,8 @@ public class BasicInfo extends LoginLimitInfo implements Serializable {
|
||||
private String frontTimeOut;
|
||||
@ApiModelProperty("消息保留时间")
|
||||
private String msgTimeOut;
|
||||
@ApiModelProperty("日志保留时间")
|
||||
private String logTimeOut;
|
||||
@ApiModelProperty("显示首页")
|
||||
private String openHomePage;
|
||||
@ApiModelProperty("默认登录方式")
|
||||
|
@ -2865,4 +2865,8 @@ public class DataSetTableService {
|
||||
// custom 创建doris视图
|
||||
createDorisView(TableUtils.tableName(tableId), sql);
|
||||
}
|
||||
|
||||
public void updateDatasetInfo(DatasetTable datasetTable) {
|
||||
datasetTableMapper.updateByPrimaryKeySelective(datasetTable);
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class PanelAppTemplateService {
|
||||
private StaticResourceService staticResourceService;
|
||||
|
||||
public List<PanelAppTemplateWithBLOBs> list(PanelAppTemplateRequest request) {
|
||||
return extPanelAppTemplateMapper.queryBaseInfo(request.getNodeType(),request.getPid());
|
||||
return extPanelAppTemplateMapper.queryBaseInfo(request.getNodeType(), request.getPid());
|
||||
}
|
||||
|
||||
public void save(PanelAppTemplateRequest request) {
|
||||
@ -81,7 +81,7 @@ public class PanelAppTemplateService {
|
||||
if (StringUtils.isEmpty(requestTemplate.getNodeType())) {
|
||||
requestTemplate.setNodeType("template");
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getSnapshot())){
|
||||
if (StringUtils.isNotEmpty(request.getSnapshot())) {
|
||||
//Store static resource into the server
|
||||
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
||||
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
||||
@ -98,7 +98,7 @@ public class PanelAppTemplateService {
|
||||
PanelAppTemplateWithBLOBs requestTemplate = new PanelAppTemplateWithBLOBs();
|
||||
BeanUtils.copyBean(requestTemplate, request);
|
||||
//Store static resource into the server
|
||||
if(StringUtils.isNotEmpty(request.getSnapshot())){
|
||||
if (StringUtils.isNotEmpty(request.getSnapshot())) {
|
||||
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
||||
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
||||
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
|
||||
@ -159,7 +159,7 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String applyPanel(PanelGroupRequest panelInfo, Map<String, String> chartViewsRealMap, String newPanelId, String panelName, String pid) {
|
||||
public String applyPanel(PanelGroupRequest panelInfo, Map<String, String> chartViewsRealMap, Map<String, String> datasetsRealMap, Map<String, String> datasetFieldsRealMap, String newPanelId, String panelName, String pid) {
|
||||
panelInfo.setId(newPanelId);
|
||||
panelInfo.setPid(pid);
|
||||
panelInfo.setName(panelName);
|
||||
@ -167,6 +167,12 @@ public class PanelAppTemplateService {
|
||||
panelInfo.setPanelType("self");
|
||||
panelInfo.setCreateBy(AuthUtils.getUser().getUsername());
|
||||
panelInfo.setCreateTime(System.currentTimeMillis());
|
||||
datasetsRealMap.forEach((k, v) -> {
|
||||
panelInfo.setPanelData(panelInfo.getPanelData().replaceAll(k, v));
|
||||
});
|
||||
datasetFieldsRealMap.forEach((k, v) -> {
|
||||
panelInfo.setPanelData(panelInfo.getPanelData().replaceAll(k, v));
|
||||
});
|
||||
panelGroupService.newPanelFromApp(panelInfo, chartViewsRealMap);
|
||||
return newPanelId;
|
||||
}
|
||||
@ -184,6 +190,7 @@ public class PanelAppTemplateService {
|
||||
datasetRequest.setOptFrom("appApply");
|
||||
datasetRequest.setSyncType("sync_now");
|
||||
DatasetTable newDataset = dataSetTableService.save(datasetRequest);
|
||||
datasetTable.setId(newDataset.getId());
|
||||
datasetsRealMap.put(oldId, newDataset.getId());
|
||||
}
|
||||
return datasetsRealMap;
|
||||
@ -193,7 +200,7 @@ public class PanelAppTemplateService {
|
||||
public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRealMap) {
|
||||
Map<String, String> datasetFieldsRealMap = new HashMap<>();
|
||||
for (DatasetTableField datasetTableField : datasetTableFieldsInfo) {
|
||||
if(datasetTableField.getExtField()!=2){
|
||||
if (datasetTableField.getExtField() != 2) {
|
||||
String oldId = datasetTableField.getId();
|
||||
datasetTableField.setTableId(datasetsRealMap.get(datasetTableField.getTableId()));
|
||||
datasetTableField.setId(null);
|
||||
@ -203,7 +210,7 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
//数据集计算字段替换
|
||||
for (DatasetTableField datasetTableField : datasetTableFieldsInfo) {
|
||||
if(datasetTableField.getExtField()==2){
|
||||
if (datasetTableField.getExtField() == 2) {
|
||||
String oldId = datasetTableField.getId();
|
||||
datasetTableField.setTableId(datasetsRealMap.get(datasetTableField.getTableId()));
|
||||
datasetTableField.setId(null);
|
||||
@ -233,6 +240,8 @@ public class PanelAppTemplateService {
|
||||
} else if (DatasetType.UNION.name().equalsIgnoreCase(datasetTable.getType())) {
|
||||
dataSetTableService.createAppUnionDorisView(datasetTable.getInfo(), datasetTable.getId());
|
||||
}
|
||||
} else {
|
||||
dataSetTableService.updateDatasetInfo(datasetTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ import io.dataease.listener.util.CacheUtils;
|
||||
import io.dataease.plugins.common.base.domain.*;
|
||||
import io.dataease.plugins.common.base.mapper.*;
|
||||
import io.dataease.plugins.common.constants.DeTypeConstants;
|
||||
import io.dataease.service.chart.ChartGroupService;
|
||||
import io.dataease.service.chart.ChartViewService;
|
||||
import io.dataease.service.dataset.DataSetGroupService;
|
||||
import io.dataease.service.dataset.DataSetTableService;
|
||||
@ -38,7 +37,8 @@ import io.dataease.service.sys.SysAuthService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.pentaho.di.core.util.UUIDUtil;
|
||||
@ -233,7 +233,7 @@ public class PanelGroupService {
|
||||
return panelId;
|
||||
}
|
||||
|
||||
public void move(PanelGroupRequest request){
|
||||
public void move(PanelGroupRequest request) {
|
||||
PanelGroupWithBLOBs panelInfo = panelGroupMapper.selectByPrimaryKey(request.getId());
|
||||
if (panelInfo.getPid().equalsIgnoreCase(request.getPid())) {
|
||||
DataEaseException.throwException(Translator.get("i18n_select_diff_folder"));
|
||||
@ -420,14 +420,15 @@ public class PanelGroupService {
|
||||
panelGroupMapper.insertSelective(newPanel);
|
||||
return newPanelId;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String newPanelFromApp(PanelGroupRequest request,Map<String,String> chartViewsRealMap){
|
||||
public String newPanelFromApp(PanelGroupRequest request, Map<String, String> chartViewsRealMap) {
|
||||
String newPanelId = request.getId();
|
||||
String templateData = request.getPanelData();
|
||||
String staticResource = request.getStaticResource();
|
||||
Boolean mobileLayout = panelViewService.haveMobileLayout(templateData);
|
||||
for(Map.Entry<String,String> entry:chartViewsRealMap.entrySet()){
|
||||
templateData = templateData.replaceAll(entry.getKey(),entry.getValue());
|
||||
for (Map.Entry<String, String> entry : chartViewsRealMap.entrySet()) {
|
||||
templateData = templateData.replaceAll(entry.getKey(), entry.getValue());
|
||||
}
|
||||
request.setMobileLayout(mobileLayout);
|
||||
request.setPanelData(templateData);
|
||||
@ -825,13 +826,13 @@ public class PanelGroupService {
|
||||
} else if (datasourceDTOS.size() > 1) {
|
||||
return new PanelExport2App(Translator.get("I18N_APP_ONE_DATASOURCE_TIPS"));
|
||||
}
|
||||
return new PanelExport2App(chartViewsInfo, chartViewFieldsInfo, datasetTablesInfo, datasetTableFieldsInfo, dataSetTasksInfo, datasourceDTOS,panelViews);
|
||||
return new PanelExport2App(chartViewsInfo, chartViewFieldsInfo, datasetTablesInfo, datasetTableFieldsInfo, dataSetTasksInfo, datasourceDTOS, panelViews);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String appApply(PanelAppTemplateApplyRequest request) throws Exception{
|
||||
public String appApply(PanelAppTemplateApplyRequest request) throws Exception {
|
||||
//仪表板名称校验,数据集分组名称校验,数据源名称校验
|
||||
panelAppTemplateService.nameCheck(request,"add");
|
||||
panelAppTemplateService.nameCheck(request, "add");
|
||||
|
||||
String newPanelId = UUIDUtil.getUUIDAsString();
|
||||
// 新建数据集分组
|
||||
@ -845,39 +846,46 @@ public class PanelGroupService {
|
||||
//查询应用信息
|
||||
PanelAppTemplateWithBLOBs appInfo = panelAppTemplateMapper.selectByPrimaryKey(request.getAppTemplateId());
|
||||
//1.获取所有视图信息
|
||||
List<ChartViewWithBLOBs> chartViewsInfo = gson.fromJson(appInfo.getChartViewsInfo(), new TypeToken<List<ChartViewWithBLOBs>>(){}.getType());
|
||||
List<ChartViewWithBLOBs> chartViewsInfo = gson.fromJson(appInfo.getChartViewsInfo(), new TypeToken<List<ChartViewWithBLOBs>>() {
|
||||
}.getType());
|
||||
//2.获取视图扩展字段信息
|
||||
List<ChartViewField> chartViewFieldsInfo = gson.fromJson(appInfo.getChartViewFieldsInfo(), new TypeToken<List<ChartViewField>>(){}.getType());
|
||||
List<ChartViewField> chartViewFieldsInfo = gson.fromJson(appInfo.getChartViewFieldsInfo(), new TypeToken<List<ChartViewField>>() {
|
||||
}.getType());
|
||||
//3.获取所有数据集信息
|
||||
List<DatasetTable> datasetTablesInfo = gson.fromJson(appInfo.getDatasetTablesInfo(), new TypeToken<List<DatasetTable>>(){}.getType());
|
||||
List<DatasetTable> datasetTablesInfo = gson.fromJson(appInfo.getDatasetTablesInfo(), new TypeToken<List<DatasetTable>>() {
|
||||
}.getType());
|
||||
//4.获取所有数据集字段信息
|
||||
List<DatasetTableField> datasetTableFieldsInfo = gson.fromJson(appInfo.getDatasetTableFieldsInfo(), new TypeToken<List<DatasetTableField>>(){}.getType());
|
||||
List<DatasetTableField> datasetTableFieldsInfo = gson.fromJson(appInfo.getDatasetTableFieldsInfo(), new TypeToken<List<DatasetTableField>>() {
|
||||
}.getType());
|
||||
//5.获取所有任务信息
|
||||
List<DataSetTaskDTO> dataSetTasksInfo = gson.fromJson(appInfo.getDatasetTasksInfo(), new TypeToken<List<DataSetTaskDTO>>(){}.getType());
|
||||
List<DataSetTaskDTO> dataSetTasksInfo = gson.fromJson(appInfo.getDatasetTasksInfo(), new TypeToken<List<DataSetTaskDTO>>() {
|
||||
}.getType());
|
||||
//6.获取所有数据源信息
|
||||
List<Datasource> oldDatasourceInfo = gson.fromJson(appInfo.getDatasourceInfo(), new TypeToken<List<Datasource>>(){}.getType());
|
||||
List<Datasource> oldDatasourceInfo = gson.fromJson(appInfo.getDatasourceInfo(), new TypeToken<List<Datasource>>() {
|
||||
}.getType());
|
||||
//获取仪表板信息
|
||||
PanelGroupRequest panelInfo = gson.fromJson(appInfo.getPanelInfo(),PanelGroupRequest.class);
|
||||
PanelGroupRequest panelInfo = gson.fromJson(appInfo.getPanelInfo(), PanelGroupRequest.class);
|
||||
//获取仪表板视图信息
|
||||
List<PanelView> panelViewsInfo = gson.fromJson(appInfo.getPanelViewsInfo(), new TypeToken<List<PanelView>>(){}.getType());
|
||||
List<PanelView> panelViewsInfo = gson.fromJson(appInfo.getPanelViewsInfo(), new TypeToken<List<PanelView>>() {
|
||||
}.getType());
|
||||
|
||||
Map<String,String> datasourceRealMap = panelAppTemplateService.applyDatasource(oldDatasourceInfo,request.getDatasourceList());
|
||||
Map<String, String> datasourceRealMap = panelAppTemplateService.applyDatasource(oldDatasourceInfo, request.getDatasourceList());
|
||||
|
||||
Map<String,String> datasetsRealMap = panelAppTemplateService.applyDataset(datasetTablesInfo,datasourceRealMap,asideDatasetGroupId);
|
||||
Map<String, String> datasetsRealMap = panelAppTemplateService.applyDataset(datasetTablesInfo, datasourceRealMap, asideDatasetGroupId);
|
||||
|
||||
Map<String,String> datasetFieldsRealMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo,datasetsRealMap);
|
||||
Map<String, String> datasetFieldsRealMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo, datasetsRealMap);
|
||||
|
||||
panelAppTemplateService.resetCustomAndUnionDataset(datasetTablesInfo,datasetsRealMap,datasetFieldsRealMap);
|
||||
panelAppTemplateService.resetCustomAndUnionDataset(datasetTablesInfo, datasetsRealMap, datasetFieldsRealMap);
|
||||
|
||||
Map<String,String> chartViewsRealMap = panelAppTemplateService.applyViews(chartViewsInfo,datasetsRealMap,datasetFieldsRealMap,newPanelId);
|
||||
Map<String, String> chartViewsRealMap = panelAppTemplateService.applyViews(chartViewsInfo, datasetsRealMap, datasetFieldsRealMap, newPanelId);
|
||||
|
||||
panelAppTemplateService.applyViewsField(chartViewFieldsInfo,chartViewsRealMap,datasetsRealMap,datasetFieldsRealMap);
|
||||
panelAppTemplateService.applyViewsField(chartViewFieldsInfo, chartViewsRealMap, datasetsRealMap, datasetFieldsRealMap);
|
||||
|
||||
panelAppTemplateService.applyPanel(panelInfo,chartViewsRealMap,newPanelId, request.getPanelName(), request.getPanelGroupPid());
|
||||
panelAppTemplateService.applyPanel(panelInfo, chartViewsRealMap, datasetsRealMap, datasetFieldsRealMap, newPanelId, request.getPanelName(), request.getPanelGroupPid());
|
||||
|
||||
panelAppTemplateService.applyPanelView(panelViewsInfo,chartViewsRealMap,newPanelId);
|
||||
panelAppTemplateService.applyPanelView(panelViewsInfo, chartViewsRealMap, newPanelId);
|
||||
|
||||
String newDatasourceId =datasourceRealMap.entrySet().stream().findFirst().get().getValue();
|
||||
String newDatasourceId = datasourceRealMap.entrySet().stream().findFirst().get().getValue();
|
||||
|
||||
String newDatasourceName = request.getDatasourceList().get(0).getName();
|
||||
|
||||
@ -895,18 +903,18 @@ public class PanelGroupService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void appEdit(PanelAppTemplateApplyRequest request) throws Exception{
|
||||
public void appEdit(PanelAppTemplateApplyRequest request) throws Exception {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
String userName = AuthUtils.getUser().getUsername();
|
||||
//名称校验,数据集分组名称校验,数据源名称校验
|
||||
panelAppTemplateService.nameCheck(request,"update");
|
||||
panelAppTemplateService.nameCheck(request, "update");
|
||||
//仪表板移动更新名称
|
||||
PanelGroup panelHistoryInfo = panelGroupMapper.selectByPrimaryKey(request.getPanelId());
|
||||
String panelHistoryPid = panelHistoryInfo.getPid();
|
||||
if(panelHistoryPid.equals(request.getPanelGroupPid())){
|
||||
if (panelHistoryPid.equals(request.getPanelGroupPid())) {
|
||||
// 未移动
|
||||
checkPanelName(request.getPanelName(), request.getPanelGroupPid(), PanelConstants.OPT_TYPE_UPDATE, request.getPanelId(), "panel");
|
||||
}else{
|
||||
} else {
|
||||
checkPanelName(request.getPanelName(), request.getPanelGroupPid(), PanelConstants.OPT_TYPE_INSERT, null, "panel");
|
||||
}
|
||||
panelHistoryInfo.setName(request.getPanelName());
|
||||
@ -920,7 +928,7 @@ public class PanelGroupService {
|
||||
DatasetGroup datasetGroup = new DatasetGroup();
|
||||
datasetGroup.setName(request.getDatasetGroupName());
|
||||
datasetGroup.setId(request.getDatasetGroupId());
|
||||
if(datasetGroupHistoryInfo.getPid().equals(request.getDatasetGroupPid())){
|
||||
if (datasetGroupHistoryInfo.getPid().equals(request.getDatasetGroupPid())) {
|
||||
datasetGroup.setPid(request.getDatasetGroupPid());
|
||||
}
|
||||
dataSetGroupService.checkName(datasetGroup);
|
||||
|
@ -75,6 +75,9 @@ public class SystemParameterService {
|
||||
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.MSG_TIME_OUT.getValue())) {
|
||||
result.setMsgTimeOut(param.getParamValue());
|
||||
}
|
||||
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.LOG_TIME_OUT.getValue())) {
|
||||
result.setLogTimeOut(param.getParamValue());
|
||||
}
|
||||
if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.DEFAULT_LOGIN_TYPE.getValue())) {
|
||||
String paramValue = param.getParamValue();
|
||||
result.setLoginType(StringUtils.isNotBlank(paramValue) ? Integer.parseInt(paramValue) : 0);
|
||||
|
@ -866,6 +866,7 @@ export default {
|
||||
no_more_than: 'Size no more than',
|
||||
request_timeout: 'Request timeout',
|
||||
message_retention_time: 'Message retention time',
|
||||
log_retention_time: 'Log retention time',
|
||||
ds_check_time: 'Data source detection interval',
|
||||
test_mail_recipient: 'Used only as a test mail recipient',
|
||||
to_enable_tsl: 'If the SMTP port is 587, you usually need to enable TSL',
|
||||
|
@ -866,6 +866,7 @@ export default {
|
||||
no_more_than: '大小不超過',
|
||||
request_timeout: '請求超時時間',
|
||||
message_retention_time: '消息保留時間',
|
||||
log_retention_time: '日誌保留時間',
|
||||
ds_check_time: '數據源檢測時間間隔',
|
||||
test_mail_recipient: '僅用來作為測試郵件收件人',
|
||||
to_enable_tsl: '如果SMTP埠是587,通常需要啟用TSL',
|
||||
|
@ -865,6 +865,7 @@ export default {
|
||||
no_more_than: '大小不超过',
|
||||
request_timeout: '请求超时时间',
|
||||
message_retention_time: '消息保留时间',
|
||||
log_retention_time: '日志保留时间',
|
||||
ds_check_time: '数据源检测时间间隔',
|
||||
test_mail_recipient: '仅用来作为测试邮件收件人',
|
||||
to_enable_tsl: '如果SMTP端口是587,通常需要启用TSL',
|
||||
|
@ -69,6 +69,18 @@
|
||||
>{{ $t('components.day') }}</template></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
:label="$t('system_parameter_setting.log_retention_time')"
|
||||
prop="logTimeOut"
|
||||
>
|
||||
<el-input
|
||||
v-model="formInline.logTimeOut"
|
||||
:placeholder="$t('system_parameter_setting.empty_msg')"
|
||||
><template
|
||||
slot="append"
|
||||
>{{ $t('components.day') }}</template></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('system_parameter_setting.ds_check_time')">
|
||||
<el-form
|
||||
:inline="true"
|
||||
@ -230,6 +242,13 @@ export default {
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
logTimeOut: [
|
||||
{
|
||||
pattern: '^([1-9]|[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$',
|
||||
message: this.$t('system_parameter_setting.msg_error'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
limitTimes: [
|
||||
|
||||
{ validator: this.validateNumber, trigger: 'blur' }
|
||||
@ -313,6 +332,12 @@ export default {
|
||||
type: 'text',
|
||||
sort: 2
|
||||
},
|
||||
{
|
||||
paramKey: 'basic.logTimeOut',
|
||||
paramValue: this.formInline.logTimeOut,
|
||||
type: 'text',
|
||||
sort: 2
|
||||
},
|
||||
{
|
||||
paramKey: 'basic.loginType',
|
||||
paramValue: this.formInline.loginType,
|
||||
|
Loading…
Reference in New Issue
Block a user