forked from github/dataease
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e10579cb57
@ -185,7 +185,7 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
// 处理横轴过滤
|
||||
xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// 处理横轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
||||
xOrders.add(SQLObj.builder()
|
||||
@ -283,7 +283,7 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
// 处理横轴过滤
|
||||
xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// 处理横轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
||||
xOrders.add(SQLObj.builder()
|
||||
|
@ -175,7 +175,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
// 处理横轴过滤
|
||||
xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// 处理横轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
||||
xOrders.add(SQLObj.builder()
|
||||
@ -274,7 +274,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
// 处理横轴过滤
|
||||
xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// 处理横轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
||||
xOrders.add(SQLObj.builder()
|
||||
|
@ -210,7 +210,7 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
// 处理横轴过滤
|
||||
xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// 处理横轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
||||
xOrders.add(SQLObj.builder()
|
||||
@ -308,7 +308,7 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
// 处理横轴过滤
|
||||
xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// xWheres.addAll(getXWheres(x, originField, fieldAlias));
|
||||
// 处理横轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && !StringUtils.equalsIgnoreCase(x.getSort(), "none")) {
|
||||
xOrders.add(SQLObj.builder()
|
||||
|
@ -267,6 +267,9 @@ public class ExtractDataService {
|
||||
});
|
||||
String dorisTablColumnSql = createDorisTablColumnSql(datasetTableFields);
|
||||
|
||||
boolean msg = false;
|
||||
JobStatus jobStatus = JobStatus.Completed;
|
||||
Long execTime = null;
|
||||
switch (updateType) {
|
||||
case all_scope: // 全量更新
|
||||
try {
|
||||
@ -281,29 +284,22 @@ public class ExtractDataService {
|
||||
} else {
|
||||
generateJobFile("all_scope", datasetTable, String.join(",", datasetTableFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList())));
|
||||
}
|
||||
Long execTime = System.currentTimeMillis();
|
||||
execTime = System.currentTimeMillis();
|
||||
extractData(datasetTable, "all_scope");
|
||||
replaceTable(DorisTableUtils.dorisName(datasetTableId));
|
||||
saveSucessLog(datasetTableTaskLog);
|
||||
|
||||
sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog, true);
|
||||
|
||||
deleteFile("all_scope", datasetTableId);
|
||||
|
||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
||||
|
||||
dataSetTableTaskService.updateTaskStatus(datasetTableTask, JobStatus.Completed);
|
||||
|
||||
msg = true;
|
||||
jobStatus = JobStatus.Completed;
|
||||
} catch (Exception e) {
|
||||
saveErrorLog(datasetTableId, taskId, e);
|
||||
|
||||
dataSetTableTaskService.updateTaskStatus(datasetTableTask, JobStatus.Error);
|
||||
|
||||
sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog,false);
|
||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
||||
dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId)));
|
||||
deleteFile("all_scope", datasetTableId);
|
||||
msg = false;
|
||||
jobStatus = JobStatus.Error;
|
||||
} finally {
|
||||
try { deleteFile("all_scope", datasetTableId); }catch (Exception ignore){}
|
||||
try { sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog, msg); }catch (Exception ignore){}
|
||||
try { dataSetTableTaskService.updateTaskStatus(datasetTableTask, jobStatus); }catch (Exception ignore){}
|
||||
try { updateTableStatus(datasetTableId, datasetTable, jobStatus, execTime); }catch (Exception ignore){}
|
||||
try { dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId))); }catch (Exception ignore){}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -323,7 +319,7 @@ public class ExtractDataService {
|
||||
if (datasetTableTask == null ) {
|
||||
datasetTableTaskLog = writeDatasetTableTaskLog(datasetTableId, taskId);
|
||||
}
|
||||
Long execTime = System.currentTimeMillis();
|
||||
execTime = System.currentTimeMillis();
|
||||
if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd()) && StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd().replace(" ", ""))) {// 增量添加
|
||||
String sql = datasetTableIncrementalConfig.getIncrementalAdd().replace(lastUpdateTime, datasetTable.getLastUpdateTime().toString())
|
||||
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
|
||||
@ -341,28 +337,17 @@ public class ExtractDataService {
|
||||
}
|
||||
saveSucessLog(datasetTableTaskLog);
|
||||
|
||||
sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog,true);
|
||||
|
||||
deleteFile("incremental_add", datasetTableId);
|
||||
deleteFile("incremental_delete", datasetTableId);
|
||||
|
||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
||||
|
||||
dataSetTableTaskService.updateTaskStatus(datasetTableTask, JobStatus.Completed);
|
||||
msg = true;
|
||||
jobStatus = JobStatus.Completed;
|
||||
} catch (Exception e) {
|
||||
saveErrorLog(datasetTableId, taskId, e);
|
||||
sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog,false);
|
||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
||||
|
||||
dataSetTableTaskService.updateTaskStatus(datasetTableTask, JobStatus.Error);
|
||||
|
||||
deleteFile("incremental_add", datasetTableId);
|
||||
deleteFile("incremental_delete", datasetTableId);
|
||||
msg = false;
|
||||
jobStatus = JobStatus.Error;
|
||||
} finally {
|
||||
if (datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())) {
|
||||
datasetTableTask.setStatus(TaskStatus.Stopped.name());
|
||||
dataSetTableTaskService.update(datasetTableTask);
|
||||
}
|
||||
try { deleteFile("incremental_add", datasetTableId); deleteFile("incremental_delete", datasetTableId); }catch (Exception ignore){}
|
||||
try { sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog, msg); }catch (Exception ignore){}
|
||||
try { dataSetTableTaskService.updateTaskStatus(datasetTableTask, jobStatus); }catch (Exception ignore){}
|
||||
try { updateTableStatus(datasetTableId, datasetTable, jobStatus, execTime); }catch (Exception ignore){}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -0,0 +1 @@
|
||||
UPDATE `chart_view` SET `custom_filter` = '[]';
|
@ -1,4 +1,3 @@
|
||||
ALTER TABLE `chart_view` ADD COLUMN `ext_stack` LONGTEXT COMMENT '堆叠项' AFTER `y_axis`;
|
||||
|
||||
UPDATE `chart_view` SET `ext_stack` = '[]';
|
||||
UPDATE `chart_view` SET `custom_filter` = '[]';
|
@ -507,14 +507,20 @@
|
||||
|
||||
<!--编辑视图使用的数据集的字段-->
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:visible="editDsField"
|
||||
:show-close="false"
|
||||
class="dialog-css"
|
||||
:destroy-on-close="true"
|
||||
:fullscreen="true"
|
||||
>
|
||||
<field-edit :param="table" @switchComponent="closeEditDsField" />
|
||||
<field-edit :param="table" />
|
||||
<div slot="title" class="dialog-footer">
|
||||
<span style="font-size: 14px;">
|
||||
{{ $t('dataset.field_manage') }}
|
||||
<span v-if="table">[{{ table.name }}]</span>
|
||||
</span>
|
||||
<el-button size="mini" style="float: right;" @click="closeEditDsField">{{ $t('chart.close') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</template>
|
||||
|
@ -270,7 +270,7 @@ export default {
|
||||
type: 'excel',
|
||||
mode: parseInt(this.mode),
|
||||
// info: '{"data":"' + this.path + '"}',
|
||||
info: JSON.stringify({ data: this.path }),
|
||||
info: JSON.stringify({ data: this.path, sheets: [this.sheets[0]] }),
|
||||
editType: this.param.editType ? this.param.editType : 0
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
<el-form-item class="form-item">
|
||||
<el-button v-if="hasDataPermission('manage',param.privileges)" size="mini" @click="addCalcField">{{ $t('dataset.add_calc_field') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item class="form-item" style="float: right;">
|
||||
<el-form-item class="form-item" style="float: right;margin-right: 0;">
|
||||
<el-input
|
||||
v-model="searchField"
|
||||
size="mini"
|
||||
@ -241,6 +241,7 @@
|
||||
class="dialog-css"
|
||||
:destroy-on-close="true"
|
||||
:title="$t('dataset.add_calc_field')"
|
||||
append-to-body
|
||||
>
|
||||
<calc-field-edit :param="param" :table-fields="tableFields" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -324,10 +325,6 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
closeEdit() {
|
||||
this.$emit('switchComponent', { name: 'ViewTable', param: this.param })
|
||||
},
|
||||
|
||||
dqTrans(item, val) {
|
||||
if (val === 'd') {
|
||||
item.groupType = 'q'
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-col>
|
||||
<el-row>
|
||||
<el-button v-if="hasDataPermission('manage',param.privileges) || table.type !== 'excel'" icon="el-icon-setting" size="mini" @click="showConfig">
|
||||
<el-button v-if="hasDataPermission('manage',param.privileges) && table.type !== 'excel'" icon="el-icon-setting" size="mini" @click="showConfig">
|
||||
{{ $t('dataset.update_setting') }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="refreshLog">
|
||||
@ -96,7 +96,7 @@
|
||||
append-to-body
|
||||
>
|
||||
<el-col>
|
||||
<el-form ref="taskForm" :form="taskForm" :model="taskForm" label-width="100px" size="mini" :rules="taskFormRules">
|
||||
<el-form :form="taskForm" :model="taskForm" label-width="100px" size="mini" ref="taskForm" :rules="taskFormRules">
|
||||
<el-form-item :label="$t('dataset.task_name')" prop="name">
|
||||
<el-input
|
||||
v-model="taskForm.name"
|
||||
@ -143,15 +143,15 @@
|
||||
|
||||
<el-form-item v-if="taskForm.rate === 'SIMPLE_CRON'" label="">
|
||||
<el-form :inline="true">
|
||||
<el-form-item :label="$t('cron.every')">
|
||||
<el-form-item :label="$t('cron.every')" >
|
||||
<el-input v-model="taskForm.extraData.simple_cron_value" size="mini" type="number" min="1" @change="onSimpleCronChange()" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item class="form-item">
|
||||
<el-select v-model="taskForm.extraData.simple_cron_type" filterable size="mini" @change="onSimpleCronChange()">
|
||||
<el-option :label="$t('cron.minute')" value="minute" />
|
||||
<el-option :label="$t('cron.hour')" value="hour" />
|
||||
<el-option :label="$t('cron.day')" value="day" />
|
||||
<el-select v-model="taskForm.extraData.simple_cron_type" filterable size="mini" @change="onSimpleCronChange()" >
|
||||
<el-option :label="$t('cron.minute_default')" value="minute" />
|
||||
<el-option :label="$t('cron.hour_default')" value="hour" />
|
||||
<el-option :label="$t('cron.day_default')" value="day" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item class="form-item" :label="$t('cron.every_exec')" />
|
||||
@ -534,7 +534,7 @@ export default {
|
||||
}
|
||||
this.incrementalConfig.tableId = this.table.id
|
||||
let startTime = new Date(task.startTime).getTime()
|
||||
if (startTime < new Date().getTime()) {
|
||||
if(startTime < new Date().getTime()){
|
||||
startTime = new Date().getTime()
|
||||
}
|
||||
task.startTime = startTime
|
||||
@ -558,9 +558,10 @@ export default {
|
||||
this.listTask()
|
||||
this.listTaskLog()
|
||||
})
|
||||
} else {
|
||||
}else {
|
||||
return false
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
deleteTask(task) {
|
||||
@ -588,27 +589,27 @@ export default {
|
||||
},
|
||||
onSimpleCronChange() {
|
||||
if (this.taskForm.extraData.simple_cron_type === 'minute') {
|
||||
if (this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 59) {
|
||||
this.$message({ message: this.$t('cron.minute_limit'), type: 'warning', showClose: true })
|
||||
if(this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 59){
|
||||
this.$message({message: this.$t('cron.minute_limit'), type: 'warning', showClose: true})
|
||||
this.taskForm.extraData.simple_cron_value = 59
|
||||
}
|
||||
this.taskForm.cron = '0 0/' + this.taskForm.extraData.simple_cron_value + ' * * * ? *'
|
||||
this.taskForm.cron = '0 0/'+ this.taskForm.extraData.simple_cron_value + ' * * * ? *'
|
||||
return
|
||||
}
|
||||
if (this.taskForm.extraData.simple_cron_type === 'hour') {
|
||||
if (this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 23) {
|
||||
this.$message({ message: this.$t('cron.hour_limit'), type: 'warning', showClose: true })
|
||||
if(this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 23){
|
||||
this.$message({message: this.$t('cron.hour_limit'), type: 'warning', showClose: true})
|
||||
this.taskForm.extraData.simple_cron_value = 23
|
||||
}
|
||||
this.taskForm.cron = '0 0 0/' + this.taskForm.extraData.simple_cron_value + ' * * ? *'
|
||||
this.taskForm.cron = '0 0 0/'+ this.taskForm.extraData.simple_cron_value + ' * * ? *'
|
||||
return
|
||||
}
|
||||
if (this.taskForm.extraData.simple_cron_type === 'day') {
|
||||
if (this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 31) {
|
||||
this.$message({ message: this.$t('cron.day_limit'), type: 'warning', showClose: true })
|
||||
if(this.taskForm.extraData.simple_cron_value < 1 || this.taskForm.extraData.simple_cron_value > 31){
|
||||
this.$message({message: this.$t('cron.day_limit'), type: 'warning', showClose: true})
|
||||
this.taskForm.extraData.simple_cron_value = 31
|
||||
}
|
||||
this.taskForm.cron = '0 0 0 1/' + this.taskForm.extraData.simple_cron_value + ' * ? *'
|
||||
this.taskForm.cron = '0 0 0 1/'+ this.taskForm.extraData.simple_cron_value + ' * ? *'
|
||||
return
|
||||
}
|
||||
},
|
||||
@ -618,15 +619,15 @@ export default {
|
||||
this.taskForm.endTime = ''
|
||||
this.taskForm.cron = ''
|
||||
}
|
||||
if (this.taskForm.rate === 'SIMPLE_CRON') {
|
||||
if (this.taskForm.rate === 'SIMPLE_CRON'){
|
||||
this.taskForm.cron = '0 0 0/1 * * ? *'
|
||||
}
|
||||
if (this.taskForm.rate === 'CRON') {
|
||||
if (this.taskForm.rate === 'CRON'){
|
||||
this.taskForm.cron = '00 00 * ? * * *'
|
||||
}
|
||||
},
|
||||
listTaskLog(loading = true) {
|
||||
const params = { 'conditions': [{ 'field': 'dataset_table_task_log.table_id', 'operator': 'eq', 'value': this.table.id }], 'orders': [] }
|
||||
const params = {"conditions":[{"field":"dataset_table_task_log.table_id","operator":"eq","value": this.table.id}],"orders":[]}
|
||||
post('/dataset/taskLog/list/' + this.table.type + '/' + this.page.currentPage + '/' + this.page.pageSize, params, loading).then(response => {
|
||||
this.taskLogData = response.data.listObject
|
||||
this.page.total = response.data.itemCount
|
||||
|
@ -93,7 +93,7 @@ export default {
|
||||
rule: {
|
||||
username: [
|
||||
{ required: true, message: this.$t('user.input_id'), trigger: 'blur' },
|
||||
{ min: 1, max: 50, message: this.$t('commons.input_limit', [1, 50]), trigger: 'blur' },
|
||||
{ min: 2, max: 10, message: this.$t('commons.input_limit', [2, 10]), trigger: 'blur' },
|
||||
{
|
||||
required: true,
|
||||
pattern: '^[^\u4e00-\u9fa5]+$',
|
||||
@ -103,7 +103,7 @@ export default {
|
||||
],
|
||||
nickName: [
|
||||
{ required: true, message: this.$t('user.input_name'), trigger: 'blur' },
|
||||
{ min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur' },
|
||||
{ min: 2, max: 10, message: this.$t('commons.input_limit', [2, 10]), trigger: 'blur' },
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('user.special_characters_are_not_supported'),
|
||||
|
Loading…
Reference in New Issue
Block a user