Merge branch 'main' of github.com:dataease/dataease into main
This commit is contained in:
commit
c262914b60
@ -184,8 +184,9 @@ public class ExtractDataService {
|
||||
public synchronized boolean updateSyncStatus(DatasetTable datasetTable ){
|
||||
datasetTable.setSyncStatus(JobStatus.Underway.name());
|
||||
DatasetTableExample example = new DatasetTableExample();
|
||||
example.createCriteria().andIdEqualTo(datasetTable.getId()).andSyncStatusEqualTo(JobStatus.Completed.name());
|
||||
example.createCriteria().andIdEqualTo(datasetTable.getId()).andSyncStatusIsNull();
|
||||
example.createCriteria().andIdEqualTo(datasetTable.getId());
|
||||
datasetTableMapper.selectByExample(example);
|
||||
example.createCriteria().andIdEqualTo(datasetTable.getId()).andSyncStatusNotEqualTo(JobStatus.Underway.name());
|
||||
return datasetTableMapper.updateByExampleSelective(datasetTable, example) == 0;
|
||||
}
|
||||
|
||||
@ -225,7 +226,7 @@ public class ExtractDataService {
|
||||
switch (updateType) {
|
||||
// 全量更新
|
||||
case all_scope:
|
||||
writeDatasetTableTaskLog(datasetTableTaskLog, datasetTableId, taskId);
|
||||
datasetTableTaskLog = writeDatasetTableTaskLog(datasetTableTaskLog, datasetTableId, taskId);
|
||||
// TODO before: check doris table column type
|
||||
createDorisTable(DorisTableUtils.dorisName(datasetTableId), dorisTablColumnSql);
|
||||
createDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId)), dorisTablColumnSql);
|
||||
@ -251,7 +252,7 @@ public class ExtractDataService {
|
||||
if (CollectionUtils.isEmpty(dataSetTaskLogDTOS)) {
|
||||
return;
|
||||
}
|
||||
writeDatasetTableTaskLog(datasetTableTaskLog, datasetTableId, taskId);
|
||||
datasetTableTaskLog = writeDatasetTableTaskLog(datasetTableTaskLog, datasetTableId, taskId);
|
||||
|
||||
// 增量添加
|
||||
if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd().replace(" ", ""))) {
|
||||
@ -275,6 +276,10 @@ public class ExtractDataService {
|
||||
dataSetTableTaskLogService.save(datasetTableTaskLog);
|
||||
break;
|
||||
}
|
||||
datasetTable.setSyncStatus(JobStatus.Completed.name());
|
||||
DatasetTableExample example = new DatasetTableExample();
|
||||
example.createCriteria().andIdEqualTo(datasetTableId);
|
||||
datasetTableMapper.updateByExampleSelective(datasetTable, example);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.error("Extract data error: " + datasetTableId, e);
|
||||
@ -282,25 +287,29 @@ public class ExtractDataService {
|
||||
datasetTableTaskLog.setInfo(ExceptionUtils.getStackTrace(e));
|
||||
datasetTableTaskLog.setEndTime(System.currentTimeMillis());
|
||||
dataSetTableTaskLogService.save(datasetTableTaskLog);
|
||||
datasetTable.setSyncStatus(JobStatus.Error.name());
|
||||
DatasetTableExample example = new DatasetTableExample();
|
||||
example.createCriteria().andIdEqualTo(datasetTableId);
|
||||
datasetTableMapper.updateByExampleSelective(datasetTable, example);
|
||||
} finally {
|
||||
if (datasetTableTask != null && datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.toString())) {
|
||||
datasetTableTask.setRate(ScheduleType.SIMPLE_COMPLETE.toString());
|
||||
dataSetTableTaskService.update(datasetTableTask);
|
||||
}
|
||||
datasetTable.setSyncStatus(JobStatus.Completed.name());
|
||||
DatasetTableExample example = new DatasetTableExample();
|
||||
example.createCriteria().andIdEqualTo(datasetTableId);
|
||||
datasetTableMapper.updateByExampleSelective(datasetTable, example);
|
||||
}
|
||||
}
|
||||
|
||||
private void writeDatasetTableTaskLog(DatasetTableTaskLog datasetTableTaskLog, String datasetTableId, String taskId) {
|
||||
private DatasetTableTaskLog writeDatasetTableTaskLog(DatasetTableTaskLog datasetTableTaskLog, String datasetTableId, String taskId) {
|
||||
datasetTableTaskLog.setTableId(datasetTableId);
|
||||
datasetTableTaskLog.setTaskId(taskId);
|
||||
datasetTableTaskLog.setStatus(JobStatus.Underway.name());
|
||||
if(CollectionUtils.isEmpty(dataSetTableTaskLogService.select(datasetTableTaskLog))){
|
||||
List<DatasetTableTaskLog> datasetTableTaskLogs = dataSetTableTaskLogService.select(datasetTableTaskLog);
|
||||
if(CollectionUtils.isEmpty(datasetTableTaskLogs)){
|
||||
datasetTableTaskLog.setStartTime(System.currentTimeMillis());
|
||||
dataSetTableTaskLogService.save(datasetTableTaskLog);
|
||||
return datasetTableTaskLog;
|
||||
}else {
|
||||
return datasetTableTaskLogs.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -677,7 +677,8 @@ export default {
|
||||
quota_show: 'Quota Show',
|
||||
title_limit: 'Title cannot be greater than 50 characters',
|
||||
filter_condition: 'Filter Condition',
|
||||
filter_field_can_null: 'Filter field must choose'
|
||||
filter_field_can_null: 'Filter field must choose',
|
||||
preview_100_data: 'Preview 100 rows'
|
||||
},
|
||||
dataset: {
|
||||
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
|
||||
|
||||
@ -677,7 +677,8 @@ export default {
|
||||
quota_show: '指標顯示',
|
||||
title_limit: '標題不能大於50個字符',
|
||||
filter_condition: '過濾條件',
|
||||
filter_field_can_null: '過濾字段必填'
|
||||
filter_field_can_null: '過濾字段必填',
|
||||
preview_100_data: '預覽前100條記錄'
|
||||
},
|
||||
dataset: {
|
||||
sheet_warn: '有多個sheet頁面,默認抽取第一個',
|
||||
|
||||
@ -677,7 +677,8 @@ export default {
|
||||
quota_show: '指标显示',
|
||||
title_limit: '标题不能大于50个字符',
|
||||
filter_condition: '过滤条件',
|
||||
filter_field_can_null: '过滤字段必填'
|
||||
filter_field_can_null: '过滤字段必填',
|
||||
preview_100_data: '预览前100条记录'
|
||||
},
|
||||
dataset: {
|
||||
sheet_warn: '有多个Sheet页,默认抽取第一个',
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
|
||||
/* theme color */
|
||||
$--color-primary: #0a7be0;
|
||||
$--color-success: #13ce66;
|
||||
$--color-warning: #ffba00;
|
||||
$--color-danger: #ff4949;
|
||||
$--color-success: #67C23A;
|
||||
$--color-warning: #E6A23C;
|
||||
$--color-danger: #F56C6C;
|
||||
// $--color-info: #1E1E1E;
|
||||
|
||||
$--button-font-weight: 400;
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
<el-radio-group
|
||||
v-model="view.type"
|
||||
style="width: 100%"
|
||||
@change="save(true)"
|
||||
@change="save(true,'chart')"
|
||||
>
|
||||
<div style="width: 100%;display: flex;display: -webkit-flex;justify-content: space-between;flex-direction: row;flex-wrap: wrap;">
|
||||
<el-radio value="table-normal" label="table-normal"><svg-icon icon-class="table-normal" class="chart-icon" /></el-radio>
|
||||
@ -430,7 +430,7 @@ export default {
|
||||
return true
|
||||
})
|
||||
},
|
||||
save(getData) {
|
||||
save(getData, trigger) {
|
||||
const view = JSON.parse(JSON.stringify(this.view))
|
||||
view.id = this.view.id
|
||||
view.sceneId = this.view.sceneId
|
||||
@ -471,6 +471,12 @@ export default {
|
||||
view.yaxis.splice(1, view.yaxis.length)
|
||||
}
|
||||
}
|
||||
if (view.type === 'line' && trigger === 'chart') {
|
||||
view.customAttr.size.lineArea = false
|
||||
}
|
||||
if (view.type === 'line-stack' && trigger === 'chart') {
|
||||
view.customAttr.size.lineArea = true
|
||||
}
|
||||
view.xaxis = JSON.stringify(view.xaxis)
|
||||
view.yaxis = JSON.stringify(view.yaxis)
|
||||
view.customAttr = JSON.stringify(view.customAttr)
|
||||
|
||||
@ -14,10 +14,17 @@
|
||||
:key="field.dataeaseName"
|
||||
min-width="200px"
|
||||
:field="field.dataeaseName"
|
||||
:title="field.name"
|
||||
:resizable="true"
|
||||
/>
|
||||
>
|
||||
<template slot="header">
|
||||
<svg-icon v-if="field.deType === 0" icon-class="field_text" class="field-icon-text" />
|
||||
<svg-icon v-if="field.deType === 1" icon-class="field_time" class="field-icon-time" />
|
||||
<svg-icon v-if="field.deType === 2 || field.deType === 3" icon-class="field_value" class="field-icon-value" />
|
||||
<span>{{ field.name }}</span>
|
||||
</template>
|
||||
</ux-table-column>
|
||||
</ux-grid>
|
||||
<span v-if="table.name" style="font-size: 12px;">{{ $t('chart.preview_100_data') }}</span>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
@ -57,8 +64,8 @@ export default {
|
||||
initData() {
|
||||
this.resetData()
|
||||
if (this.table.id) {
|
||||
this.table.row = 10
|
||||
post('/dataset/table/getPreviewData/1/10', this.table).then(response => {
|
||||
this.table.row = 100
|
||||
post('/dataset/table/getPreviewData/1/100', this.table).then(response => {
|
||||
this.fields = response.data.fields
|
||||
this.data = response.data.data
|
||||
const datas = this.data
|
||||
|
||||
@ -251,13 +251,13 @@ export default {
|
||||
this.$refs.menu.setCheckedKeys(this.menuIds)
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm(this.$t('commons.confirm_delete') + ': ' + row.name + '?', this.$t('role.tips'), {
|
||||
this.$confirm(this.$t('role.confirm_delete') + ': ' + row.name + '?', this.$t('role.tips'), {
|
||||
confirmButtonText: this.$t('commons.confirm'),
|
||||
cancelButtonText: this.$t('commons.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delRole(row.roleId).then(res => {
|
||||
this.$success(this.$t('commons.modify_success'))
|
||||
this.$success(this.$t('commons.delete_success'))
|
||||
this.search()
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user