提交 064b0fe8 authored 作者: taojinlong's avatar taojinlong

Merge branch 'main' of github.com:dataease/dataease into main

差异被折叠。
...@@ -136,7 +136,7 @@ public class GridExample { ...@@ -136,7 +136,7 @@ public class GridExample {
addCriterion(field+" like ", "%"+value+"%", field); addCriterion(field+" like ", "%"+value+"%", field);
break; break;
case "not like": case "not like":
addCriterion(field+" not like ", value, field); addCriterion(field+" not like ", "%"+value+"%", field);
break; break;
case "in": case "in":
List<Object> invalues = (List<Object>)value; List<Object> invalues = (List<Object>)value;
......
...@@ -2,13 +2,13 @@ package io.dataease.job.sechedule; ...@@ -2,13 +2,13 @@ package io.dataease.job.sechedule;
import io.dataease.commons.utils.LogUtil; import io.dataease.commons.utils.LogUtil;
import org.quartz.*; import org.quartz.*;
import org.quartz.impl.triggers.CronTriggerImpl;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.util.Date;
import java.util.Calendar; import java.util.HashMap;
import java.util.*; import java.util.List;
import java.util.Map;
@Component @Component
public class ScheduleManager { public class ScheduleManager {
...@@ -84,6 +84,8 @@ public class ScheduleManager { ...@@ -84,6 +84,8 @@ public class ScheduleManager {
} else { } else {
triggerBuilder.endAt(endTime); triggerBuilder.endAt(endTime);
} }
} else {
triggerBuilder.endAt(null);
} }
triggerBuilder.withSchedule(CronScheduleBuilder.cronSchedule(cron)); triggerBuilder.withSchedule(CronScheduleBuilder.cronSchedule(cron));
...@@ -167,6 +169,8 @@ public class ScheduleManager { ...@@ -167,6 +169,8 @@ public class ScheduleManager {
} else { } else {
triggerBuilder.endAt(endTime); triggerBuilder.endAt(endTime);
} }
} else {
triggerBuilder.endAt(null);
} }
triggerBuilder.withSchedule(CronScheduleBuilder.cronSchedule(cron));// 触发器时间设定 triggerBuilder.withSchedule(CronScheduleBuilder.cronSchedule(cron));// 触发器时间设定
......
...@@ -26,7 +26,13 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve ...@@ -26,7 +26,13 @@ public class AppStartListener implements ApplicationListener<ApplicationReadyEve
List<DatasetTableTask> list = dataSetTableTaskService.list(new DatasetTableTask()); List<DatasetTableTask> list = dataSetTableTaskService.list(new DatasetTableTask());
for (DatasetTableTask task : list) { for (DatasetTableTask task : list) {
try { try {
scheduleService.addSchedule(task); if (task.getEndTime() != null && task.getEndTime() > 0) {
if (task.getEndTime() > System.currentTimeMillis()) {
scheduleService.addSchedule(task);
}
} else {
scheduleService.addSchedule(task);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -37,6 +37,10 @@ public class ScheduleService { ...@@ -37,6 +37,10 @@ public class ScheduleService {
// if (endTime.before(new Date())) { // if (endTime.before(new Date())) {
// return; // return;
// } // }
if (endTime.before(new Date())) {
deleteSchedule(datasetTableTask);
return;
}
} }
scheduleManager.addOrUpdateCronJob(new JobKey(datasetTableTask.getId(), datasetTableTask.getTableId()), scheduleManager.addOrUpdateCronJob(new JobKey(datasetTableTask.getId(), datasetTableTask.getTableId()),
......
...@@ -274,9 +274,8 @@ public class DataSetTableService { ...@@ -274,9 +274,8 @@ public class DataSetTableService {
e.printStackTrace(); e.printStackTrace();
} }
try { try {
// datasourceRequest.setQuery(qp.createQueryCountSQL(table)); datasourceRequest.setQuery(qp.createQuerySQL(table, fields) + " LIMIT 0," + dataSetTableRequest.getRow());
// dataSetPreviewPage.setTotal(Integer.valueOf(datasourceProvider.getData(datasourceRequest).get(0)[0])); dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size());
dataSetPreviewPage.setTotal(Integer.parseInt(dataSetTableRequest.getRow()));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -298,9 +297,8 @@ public class DataSetTableService { ...@@ -298,9 +297,8 @@ public class DataSetTableService {
e.printStackTrace(); e.printStackTrace();
} }
try { try {
// datasourceRequest.setQuery(qp.createQueryCountSQLAsTmp(sql)); datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, fields) + " LIMIT 0," + dataSetTableRequest.getRow());
// dataSetPreviewPage.setTotal(Integer.valueOf(datasourceProvider.getData(datasourceRequest).get(0)[0])); dataSetPreviewPage.setTotal(datasourceProvider.getData(datasourceRequest).size());
dataSetPreviewPage.setTotal(Integer.parseInt(dataSetTableRequest.getRow()));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -483,7 +481,14 @@ public class DataSetTableService { ...@@ -483,7 +481,14 @@ public class DataSetTableService {
Map<String, String[]> customInfo = new TreeMap<>(); Map<String, String[]> customInfo = new TreeMap<>();
dataTableInfoDTO.getList().forEach(ele -> { dataTableInfoDTO.getList().forEach(ele -> {
String table = DorisTableUtils.dorisName(ele.getTableId()); String table = DorisTableUtils.dorisName(ele.getTableId());
DatasetTable datasetTable = datasetTableMapper.selectByPrimaryKey(ele.getTableId());
if (ObjectUtils.isEmpty(datasetTable)) {
throw new RuntimeException(Translator.get("i18n_custom_ds_delete"));
}
List<DatasetTableField> fields = dataSetTableFieldsService.getListByIdsEach(ele.getCheckedFields()); List<DatasetTableField> fields = dataSetTableFieldsService.getListByIdsEach(ele.getCheckedFields());
if (CollectionUtils.isEmpty(fields)) {
throw new RuntimeException(Translator.get("i18n_cst_ds_tb_or_field_deleted"));
}
String[] array = fields.stream().map(f -> table + "." + f.getDataeaseName() + " AS " + DorisTableUtils.dorisFieldName(ele.getTableId() + "_" + f.getDataeaseName())).toArray(String[]::new); String[] array = fields.stream().map(f -> table + "." + f.getDataeaseName() + " AS " + DorisTableUtils.dorisFieldName(ele.getTableId() + "_" + f.getDataeaseName())).toArray(String[]::new);
customInfo.put(table, array); customInfo.put(table, array);
}); });
...@@ -567,7 +572,7 @@ public class DataSetTableService { ...@@ -567,7 +572,7 @@ public class DataSetTableService {
List<DataTableInfoCustomUnion> list = dataTableInfoDTO.getList(); List<DataTableInfoCustomUnion> list = dataTableInfoDTO.getList();
List<DatasetTableField> fieldList = new ArrayList<>(); List<DatasetTableField> fieldList = new ArrayList<>();
list.forEach(ele -> { list.forEach(ele -> {
List<DatasetTableField> listByIds = dataSetTableFieldsService.getListByIds(ele.getCheckedFields()); List<DatasetTableField> listByIds = dataSetTableFieldsService.getListByIdsEach(ele.getCheckedFields());
listByIds.forEach(f -> { listByIds.forEach(f -> {
f.setDataeaseName(DorisTableUtils.dorisFieldName(ele.getTableId() + "_" + f.getDataeaseName())); f.setDataeaseName(DorisTableUtils.dorisFieldName(ele.getTableId() + "_" + f.getDataeaseName()));
}); });
...@@ -665,7 +670,7 @@ public class DataSetTableService { ...@@ -665,7 +670,7 @@ public class DataSetTableService {
} }
public void saveIncrementalConfig(DatasetTableIncrementalConfig datasetTableIncrementalConfig) throws Exception{ public void saveIncrementalConfig(DatasetTableIncrementalConfig datasetTableIncrementalConfig) throws Exception {
if (datasetTableIncrementalConfig == null || StringUtils.isEmpty(datasetTableIncrementalConfig.getTableId())) { if (datasetTableIncrementalConfig == null || StringUtils.isEmpty(datasetTableIncrementalConfig.getTableId())) {
return; return;
} }
...@@ -700,11 +705,11 @@ public class DataSetTableService { ...@@ -700,11 +705,11 @@ public class DataSetTableService {
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()); .replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
datasourceRequest.setQuery(sql); datasourceRequest.setQuery(sql);
List<String> sqlFileds = new ArrayList<>(); List<String> sqlFileds = new ArrayList<>();
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed ->{ datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> {
sqlFileds.add(filed); sqlFileds.add(filed);
}); });
sort(sqlFileds); sort(sqlFileds);
if(!originNameFileds.equals(sqlFileds)){ if (!originNameFileds.equals(sqlFileds)) {
throw new Exception(Translator.get("i18n_sql_add_not_matching") + sqlFileds.toString()); throw new Exception(Translator.get("i18n_sql_add_not_matching") + sqlFileds.toString());
} }
} }
...@@ -713,17 +718,17 @@ public class DataSetTableService { ...@@ -713,17 +718,17 @@ public class DataSetTableService {
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()); .replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
datasourceRequest.setQuery(sql); datasourceRequest.setQuery(sql);
List<String> sqlFileds = new ArrayList<>(); List<String> sqlFileds = new ArrayList<>();
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed ->{ datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> {
sqlFileds.add(filed); sqlFileds.add(filed);
}); });
sort(sqlFileds); sort(sqlFileds);
if(!originNameFileds.equals(sqlFileds)){ if (!originNameFileds.equals(sqlFileds)) {
throw new Exception(Translator.get("i18n_sql_delete_not_matching") + sqlFileds.toString()); throw new Exception(Translator.get("i18n_sql_delete_not_matching") + sqlFileds.toString());
} }
} }
} }
private void sort(List<String> sqlFileds){ private void sort(List<String> sqlFileds) {
sqlFileds.sort((o1, o2) -> { sqlFileds.sort((o1, o2) -> {
if (o1 == null) { if (o1 == null) {
return -1; return -1;
...@@ -734,6 +739,7 @@ public class DataSetTableService { ...@@ -734,6 +739,7 @@ public class DataSetTableService {
return o1.compareTo(o2); return o1.compareTo(o2);
}); });
} }
private void checkName(DatasetTable datasetTable) { private void checkName(DatasetTable datasetTable) {
// if (StringUtils.isEmpty(datasetTable.getId()) && StringUtils.equalsIgnoreCase("db", datasetTable.getType())) { // if (StringUtils.isEmpty(datasetTable.getId()) && StringUtils.equalsIgnoreCase("db", datasetTable.getType())) {
// return; // return;
......
...@@ -400,7 +400,7 @@ SELECT ...@@ -400,7 +400,7 @@ SELECT
GROUP BY GROUP BY
sys_auth.auth_source_type, sys_auth.auth_source_type,
sys_auth.auth_source sys_auth.auth_source
having (sum( sys_auth_detail.privilege_value )> 0 or 1 = ( SELECT is_admin FROM sys_user WHERE user_id = 1 ))) temp; having (sum( sys_auth_detail.privilege_value )> 0 or 1 = ( SELECT is_admin FROM sys_user WHERE user_id = userId ))) temp;
select GROUP_CONCAT(id) into oTempAllIds from (select GET_V_AUTH_MODEL_WITH_PARENT ( oTempLeafIds ,modelType) cids) t, v_auth_model where v_auth_model.model_type=modelType and FIND_IN_SET(v_auth_model.id,cids); select GROUP_CONCAT(id) into oTempAllIds from (select GET_V_AUTH_MODEL_WITH_PARENT ( oTempLeafIds ,modelType) cids) t, v_auth_model where v_auth_model.model_type=modelType and FIND_IN_SET(v_auth_model.id,cids);
......
...@@ -256,4 +256,5 @@ i18n_not_exec_add_sync=There is no completed synchronization task. Incremental s ...@@ -256,4 +256,5 @@ i18n_not_exec_add_sync=There is no completed synchronization task. Incremental s
i18n_excel_header_empty=Excel first row can not empty i18n_excel_header_empty=Excel first row can not empty
i18n_custom_ds_delete=Custom dataset union data is deleted,can not display i18n_custom_ds_delete=Custom dataset union data is deleted,can not display
i18n_sql_add_not_matching=The data column of incremental SQL does not match the dataset, i18n_sql_add_not_matching=The data column of incremental SQL does not match the dataset,
i18n_sql_delete_not_matching=The data column of incremental delete SQL does not match the dataset, i18n_sql_delete_not_matching=The data column of incremental delete SQL does not match the dataset,
\ No newline at end of file i18n_cst_ds_tb_or_field_deleted=Custom dataset union data is deleted or field changed,can not display
\ No newline at end of file
...@@ -197,7 +197,7 @@ authsource_configuration_is_null=认证源配置不能为空 ...@@ -197,7 +197,7 @@ authsource_configuration_is_null=认证源配置不能为空
删除菜单=删除菜单 删除菜单=删除菜单
删除角色=删除角色 删除角色=删除角色
删除连接=删除连接 删除连接=删除连接
参数管理=参数管理 显示设置=显示设置
数据源=数据源 数据源=数据源
数据源表单=数据源表单 数据源表单=数据源表单
数据集=数据集 数据集=数据集
...@@ -257,4 +257,5 @@ i18n_excel_header_empty=Excel第一行为空 ...@@ -257,4 +257,5 @@ i18n_excel_header_empty=Excel第一行为空
i18n_custom_ds_delete=自定义数据集所关联数据被删除,无法正常显示 i18n_custom_ds_delete=自定义数据集所关联数据被删除,无法正常显示
i18n_sql_add_not_matching=增量添加 sql 的数据列与数据集不匹配, i18n_sql_add_not_matching=增量添加 sql 的数据列与数据集不匹配,
i18n_sql_delete_not_matching=增量删除 sql 的数据列与数据集不匹配, i18n_sql_delete_not_matching=增量删除 sql 的数据列与数据集不匹配,
i18n_cst_ds_tb_or_field_deleted=自定义数据集所关联数据被删除或字段发生变化,无法正常显示
...@@ -258,4 +258,5 @@ i18n_not_exec_add_sync=沒有已經完成的同步任務,無法進行增量同 ...@@ -258,4 +258,5 @@ i18n_not_exec_add_sync=沒有已經完成的同步任務,無法進行增量同
i18n_excel_header_empty=Excel第一行為空 i18n_excel_header_empty=Excel第一行為空
i18n_custom_ds_delete=自定義數據集所關聯數據被刪除,無法正常顯示 i18n_custom_ds_delete=自定義數據集所關聯數據被刪除,無法正常顯示
i18n_sql_add_not_matching=增量添加 sql 的數據列與數據集不匹配, i18n_sql_add_not_matching=增量添加 sql 的數據列與數據集不匹配,
i18n_sql_delete_not_matching=增量刪除 sql 的數據列與數據集不匹配, i18n_sql_delete_not_matching=增量刪除 sql 的數據列與數據集不匹配,
\ No newline at end of file i18n_cst_ds_tb_or_field_deleted=自定義數據集所關聯數據被刪除或字段發生變化,無法正常顯示
\ No newline at end of file
<template> <template>
<div @click="handleClick"> <div
:style="getOutStyleDefault(config.style)"
:class="{'gap_class':canvasStyleData.panel.gap==='yes'}"
class="component"
@click="handleClick"
>
<component <component
:is="config.component" :is="config.component"
v-if="config.type==='custom'" v-if="config.type==='custom'"
:id="'component' + config.id" :id="'component' + config.id"
class="component" :style="getComponentStyleDefault(config.style)"
:style="getStyle(config.style)"
:out-style="config.style" :out-style="config.style"
:element="config" :element="config"
:class="{'gap_class':canvasStyleData.panel.gap==='yes'}"
/> />
<component <component
:is="config.component" :is="config.component"
v-else v-else
class="component"
:out-style="config.style" :out-style="config.style"
:style="getStyle(config.style)" :style="getComponentStyleDefault(config.style)"
:prop-value="config.propValue" :prop-value="config.propValue"
:element="config" :element="config"
:class="{'gap_class':canvasStyleData.panel.gap==='yes'}"
/> />
</div> </div>
</template> </template>
...@@ -54,6 +55,26 @@ export default { ...@@ -54,6 +55,26 @@ export default {
methods: { methods: {
getStyle, getStyle,
getOutStyleDefault(style) {
const result = {};
['width', 'left'].forEach(attr => {
result[attr] = style[attr] + 'px'
});
['height', 'top'].forEach(attr => {
result[attr] = style[attr] + 'px'
})
result['rotate'] = style['rotate']
result['opacity'] = style['opacity']
return result
// return style
},
getComponentStyleDefault(style) {
return getStyle(style, ['top', 'left', 'width', 'height', 'rotate'])
// return style
},
handleClick() { handleClick() {
const events = this.config.events const events = this.config.events
Object.keys(events).forEach(event => { Object.keys(events).forEach(event => {
...@@ -68,4 +89,8 @@ export default { ...@@ -68,4 +89,8 @@ export default {
.component { .component {
position: absolute; position: absolute;
} }
.gap_class{
padding:3px;
}
</style> </style>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
class-name-active="de-drag-active" class-name-active="de-drag-active"
:class="{'gap_class':canvasStyleData.panel.gap==='yes'}" :class="{'gap_class':canvasStyleData.panel.gap==='yes'}"
:snap="true" :snap="true"
:snap-tolerance="5" :snap-tolerance="1"
@refLineParams="getRefLineParams" @refLineParams="getRefLineParams"
> >
<component <component
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
:active-text-color="variables.topMenuActiveText" :active-text-color="variables.topMenuActiveText"
:default-active="activeMenu" :default-active="activeMenu"
mode="horizontal" mode="horizontal"
:style="{'background-color': '#f1f3f8'}" :style="{'background-color': '#f1f3f8', 'margin-left': '260px', 'position': 'absolute'}"
@select="handleSelect" @select="handleSelect"
> >
<div v-for="item in permission_routes" :key="item.path" class="nav-item"> <div v-for="item in permission_routes" :key="item.path" class="nav-item">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<topbar /> <topbar />
<de-container style="padding-top: 56px;"> <de-container style="padding-top: 56px;">
<de-aside-container v-if="!sidebar.hide"> <de-aside-container v-if="!sidebar.hide" class="le-aside-container">
<sidebar class="sidebar-container" /> <sidebar class="sidebar-container" />
</de-aside-container> </de-aside-container>
...@@ -116,4 +116,10 @@ export default { ...@@ -116,4 +116,10 @@ export default {
.la-main-container { .la-main-container {
padding: 0px !important; padding: 0px !important;
} }
.le-aside-container {
.sidebar-container {
width: 100% !important;
position: initial !important;
}
}
</style> </style>
...@@ -32,12 +32,12 @@ ...@@ -32,12 +32,12 @@
.nav-item { .nav-item {
display: inline-block; display: inline-block;
.el-menu-item { .el-menu-item:not(.is-active) {
// color: rgb(191, 203, 217); // color: rgb(191, 203, 217);
color: $menuText; color: $menuText;
&:hover { &:hover {
background-color: $subMenuHover !important; background-color: $menuHover !important;
color: $subMenuActiveText !important; // color: $subMenuActiveText !important;
} }
&:focus { &:focus {
background-color: $subMenuHover !important; background-color: $subMenuHover !important;
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
</div> </div>
</el-dialog> </el-dialog>
<fullscreen style="height: 100%;background: none" :fullscreen.sync="previewVisible"> <fullscreen style="height: 100%;background: #f7f8fa" :fullscreen.sync="previewVisible">
<Preview v-if="previewVisible" :show-type="canvasStyleData.selfAdaption?'full':'width'" /> <Preview v-if="previewVisible" :show-type="canvasStyleData.selfAdaption?'full':'width'" />
</fullscreen> </fullscreen>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<!-- 仪表板预览区域--> <!-- 仪表板预览区域-->
<el-row class="panel-design-preview"> <el-row class="panel-design-preview">
<div ref="imageWrapper" style="width: 100%;height: 100%"> <div ref="imageWrapper" style="width: 100%;height: 100%">
<fullscreen style="height: 100%;background: none" :fullscreen.sync="fullscreen"> <fullscreen style="height: 100%;background: #f7f8fa" :fullscreen.sync="fullscreen">
<Preview v-if="showMain" :show-type="canvasStyleData.selfAdaption?'full':'width'" /> <Preview v-if="showMain" :show-type="canvasStyleData.selfAdaption?'full':'width'" />
</fullscreen> </fullscreen>
</div> </div>
......
...@@ -197,7 +197,7 @@ export default { ...@@ -197,7 +197,7 @@ export default {
searchConfig: { searchConfig: {
useQuickSearch: true, useQuickSearch: true,
useComplexSearch: true, useComplexSearch: true,
quickPlaceholder: '按名称搜索', quickPlaceholder: '按姓名搜索',
components: [ components: [
{ field: 'nick_name', label: '姓名', component: 'FuComplexInput' }, { field: 'nick_name', label: '姓名', component: 'FuComplexInput' },
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论