Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
c330ff95
提交
c330ff95
authored
3月 11, 2021
作者:
junjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(数据集): 数据集调整
上级
09bbf1f5
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
29 行增加
和
9 行删除
+29
-9
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+8
-4
DataSetTableTaskService.java
.../io/dataease/service/dataset/DataSetTableTaskService.java
+16
-0
ViewTable.vue
frontend/src/views/dataset/data/ViewTable.vue
+1
-1
Group.vue
frontend/src/views/dataset/group/Group.vue
+4
-4
没有找到文件。
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
c330ff95
...
...
@@ -37,6 +37,8 @@ public class DataSetTableService {
private
DatasourceMapper
datasourceMapper
;
@Resource
private
DataSetTableFieldsService
dataSetTableFieldsService
;
@Resource
private
DataSetTableTaskService
dataSetTableTaskService
;
public
void
batchInsert
(
List
<
DatasetTable
>
datasetTable
)
throws
Exception
{
for
(
DatasetTable
table
:
datasetTable
)
{
...
...
@@ -67,11 +69,13 @@ public class DataSetTableService {
public
void
delete
(
String
id
)
{
datasetTableMapper
.
deleteByPrimaryKey
(
id
);
dataSetTableFieldsService
.
deleteByTableId
(
id
);
// 删除同步任务
dataSetTableTaskService
.
deleteByTableId
(
id
);
}
public
List
<
DatasetTable
>
list
(
DataSetTableRequest
dataSetTableRequest
)
{
DatasetTableExample
datasetTableExample
=
new
DatasetTableExample
();
if
(
StringUtils
.
isNotEmpty
(
dataSetTableRequest
.
getSceneId
()))
{
if
(
StringUtils
.
isNotEmpty
(
dataSetTableRequest
.
getSceneId
()))
{
datasetTableExample
.
createCriteria
().
andSceneIdEqualTo
(
dataSetTableRequest
.
getSceneId
());
}
if
(
StringUtils
.
isNotEmpty
(
dataSetTableRequest
.
getSort
()))
{
...
...
@@ -173,7 +177,7 @@ public class DataSetTableService {
return
map
;
}
public
List
<
String
[]>
getDataSetData
(
String
datasourceId
,
String
table
,
List
<
DatasetTableField
>
fields
){
public
List
<
String
[]>
getDataSetData
(
String
datasourceId
,
String
table
,
List
<
DatasetTableField
>
fields
)
{
List
<
String
[]>
data
=
new
ArrayList
<>();
Datasource
ds
=
datasourceMapper
.
selectByPrimaryKey
(
datasourceId
);
DatasourceProvider
datasourceProvider
=
ProviderFactory
.
getProvider
(
ds
.
getType
());
...
...
@@ -188,7 +192,7 @@ public class DataSetTableService {
return
data
;
}
public
Long
getDataSetTotalData
(
String
datasourceId
,
String
table
){
public
Long
getDataSetTotalData
(
String
datasourceId
,
String
table
)
{
List
<
String
[]>
data
=
new
ArrayList
<>();
Datasource
ds
=
datasourceMapper
.
selectByPrimaryKey
(
datasourceId
);
DatasourceProvider
datasourceProvider
=
ProviderFactory
.
getProvider
(
ds
.
getType
());
...
...
@@ -203,7 +207,7 @@ public class DataSetTableService {
return
0
l
;
}
public
List
<
String
[]>
getDataSetPageData
(
String
datasourceId
,
String
table
,
List
<
DatasetTableField
>
fields
,
Long
startPage
,
Long
pageSize
){
public
List
<
String
[]>
getDataSetPageData
(
String
datasourceId
,
String
table
,
List
<
DatasetTableField
>
fields
,
Long
startPage
,
Long
pageSize
)
{
List
<
String
[]>
data
=
new
ArrayList
<>();
Datasource
ds
=
datasourceMapper
.
selectByPrimaryKey
(
datasourceId
);
DatasourceProvider
datasourceProvider
=
ProviderFactory
.
getProvider
(
ds
.
getType
());
...
...
backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java
浏览文件 @
c330ff95
...
...
@@ -7,6 +7,7 @@ import io.dataease.service.ScheduleService;
import
org.apache.commons.lang3.StringUtils
;
import
org.quartz.CronExpression
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.List
;
...
...
@@ -17,6 +18,7 @@ import java.util.UUID;
* @Date 2021/3/4 1:26 下午
*/
@Service
@Transactional
public
class
DataSetTableTaskService
{
@Resource
private
DatasetTableTaskMapper
datasetTableTaskMapper
;
...
...
@@ -50,6 +52,20 @@ public class DataSetTableTaskService {
dataSetTableTaskLogService
.
deleteByTaskId
(
id
);
}
public
void
delete
(
DatasetTableTask
task
)
{
datasetTableTaskMapper
.
deleteByPrimaryKey
(
task
.
getId
());
scheduleService
.
deleteSchedule
(
task
);
dataSetTableTaskLogService
.
deleteByTaskId
(
task
.
getId
());
}
public
void
deleteByTableId
(
String
id
)
{
DatasetTableTaskExample
datasetTableTaskExample
=
new
DatasetTableTaskExample
();
DatasetTableTaskExample
.
Criteria
criteria
=
datasetTableTaskExample
.
createCriteria
();
criteria
.
andTableIdEqualTo
(
id
);
List
<
DatasetTableTask
>
datasetTableTasks
=
datasetTableTaskMapper
.
selectByExample
(
datasetTableTaskExample
);
datasetTableTasks
.
forEach
(
this
::
delete
);
}
public
DatasetTableTask
get
(
String
id
)
{
return
datasetTableTaskMapper
.
selectByPrimaryKey
(
id
);
}
...
...
frontend/src/views/dataset/data/ViewTable.vue
浏览文件 @
c330ff95
...
...
@@ -24,7 +24,7 @@
<el-tab-pane
:label=
"$t('dataset.join_view')"
name=
"joinView"
>
关联视图 TODO
</el-tab-pane>
<el-tab-pane
:label=
"$t('dataset.update_info')"
name=
"updateInfo"
>
<el-tab-pane
v-if=
"table.mode === 1"
:label=
"$t('dataset.update_info')"
name=
"updateInfo"
>
<update-info
:table=
"table"
/>
</el-tab-pane>
</el-tabs>
...
...
frontend/src/views/dataset/group/Group.vue
浏览文件 @
c330ff95
...
...
@@ -215,10 +215,10 @@
<el-form-item
:label=
"$t('commons.name')"
prop=
"name"
>
<el-input
v-model=
"tableForm.name"
/>
</el-form-item>
<el-form-item
:label=
"$t('dataset.mode')"
prop=
"mode"
>
<el-radio
v-model=
"tableForm.mode"
label=
"0"
>
{{
$t
(
'dataset.direct_connect'
)
}}
</el-radio
>
<el-radio
v-model=
"tableForm.mode"
label=
"1"
>
{{
$t
(
'dataset.sync_data'
)
}}
</el-radio
>
</el-form-item
>
<!--
<el-form-item
:label=
"$t('dataset.mode')"
prop=
"mode"
>
--
>
<!--
<el-radio
v-model=
"tableForm.mode"
label=
"0"
>
{{
$t
(
'dataset.direct_connect'
)
}}
</el-radio>
--
>
<!--
<el-radio
v-model=
"tableForm.mode"
label=
"1"
>
{{
$t
(
'dataset.sync_data'
)
}}
</el-radio>
--
>
<!--
</el-form-item>
--
>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"closeTable()"
>
{{
$t
(
'dataset.cancel'
)
}}
</el-button>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论