Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
54d8d59c
提交
54d8d59c
authored
6月 02, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复不能创建关联数据集问题
上级
e4aa5cee
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
10 行删除
+15
-10
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+15
-10
没有找到文件。
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
54d8d59c
package
io
.
dataease
.
service
.
dataset
;
package
io
.
dataease
.
service
.
dataset
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
import
com.google.gson.JsonParser
;
import
io.dataease.auth.annotation.DeCleaner
;
import
io.dataease.auth.annotation.DeCleaner
;
...
@@ -585,9 +586,9 @@ public class DataSetTableService {
...
@@ -585,9 +586,9 @@ public class DataSetTableService {
}
else
{
}
else
{
// check doris table
// check doris table
if
(!
checkEngineTableIsExists
(
dataSetTableRequest
.
getId
()))
{
if
(!
checkEngineTableIsExists
(
dataSetTableRequest
.
getId
()))
{
if
(
dataSetTableRequest
.
isPreviewForTask
())
{
if
(
dataSetTableRequest
.
isPreviewForTask
())
{
return
map
;
return
map
;
}
else
{
}
else
{
throw
new
RuntimeException
(
Translator
.
get
(
"i18n_data_not_sync"
));
throw
new
RuntimeException
(
Translator
.
get
(
"i18n_data_not_sync"
));
}
}
}
}
...
@@ -1346,7 +1347,11 @@ public class DataSetTableService {
...
@@ -1346,7 +1347,11 @@ public class DataSetTableService {
String
configuration
=
ds
.
getConfiguration
();
String
configuration
=
ds
.
getConfiguration
();
JsonObject
jsonObject
=
JsonParser
.
parseString
(
configuration
).
getAsJsonObject
();
JsonObject
jsonObject
=
JsonParser
.
parseString
(
configuration
).
getAsJsonObject
();
String
schema
=
jsonObject
.
get
(
"schema"
).
getAsString
();
JsonElement
schemaJson
=
jsonObject
.
get
(
"schema"
);
String
schema
=
null
;
if
(
schemaJson
!=
null
)
{
schema
=
schemaJson
.
getAsString
();
}
String
joinPrefix
=
""
;
String
joinPrefix
=
""
;
if
(
StringUtils
.
isNotEmpty
(
schema
)
&&
(
StringUtils
.
equalsIgnoreCase
(
ds
.
getType
(),
DatasourceTypes
.
db2
.
getType
())
||
if
(
StringUtils
.
isNotEmpty
(
schema
)
&&
(
StringUtils
.
equalsIgnoreCase
(
ds
.
getType
(),
DatasourceTypes
.
db2
.
getType
())
||
StringUtils
.
equalsIgnoreCase
(
ds
.
getType
(),
DatasourceTypes
.
sqlServer
.
getType
())
||
StringUtils
.
equalsIgnoreCase
(
ds
.
getType
(),
DatasourceTypes
.
sqlServer
.
getType
())
||
...
@@ -1907,7 +1912,7 @@ public class DataSetTableService {
...
@@ -1907,7 +1912,7 @@ public class DataSetTableService {
List
<
String
>
oldFields
=
datasetTableFields
.
stream
().
map
(
DatasetTableField:
:
getOriginName
).
collect
(
Collectors
.
toList
());
List
<
String
>
oldFields
=
datasetTableFields
.
stream
().
map
(
DatasetTableField:
:
getOriginName
).
collect
(
Collectors
.
toList
());
if
(
editType
==
1
)
{
if
(
editType
==
1
)
{
for
(
ExcelSheetData
excelSheetData
:
excelSheetDataList
)
{
for
(
ExcelSheetData
excelSheetData
:
excelSheetDataList
)
{
List
<
TableField
>
tableFields
=
excelSheetData
.
getFields
();
List
<
TableField
>
tableFields
=
excelSheetData
.
getFields
();
List
<
String
>
newFields
=
tableFields
.
stream
().
map
(
TableField:
:
getRemarks
).
collect
(
Collectors
.
toList
());
List
<
String
>
newFields
=
tableFields
.
stream
().
map
(
TableField:
:
getRemarks
).
collect
(
Collectors
.
toList
());
...
@@ -1918,7 +1923,7 @@ public class DataSetTableService {
...
@@ -1918,7 +1923,7 @@ public class DataSetTableService {
if
(
retrunSheetDataList
.
size
()
==
0
)
{
if
(
retrunSheetDataList
.
size
()
==
0
)
{
DataEaseException
.
throwException
(
Translator
.
get
(
"i18n_excel_column_change"
));
DataEaseException
.
throwException
(
Translator
.
get
(
"i18n_excel_column_change"
));
}
}
}
else
{
}
else
{
List
<
DatasetTableField
>
extFields
=
fields
.
stream
().
filter
(
datasetTableField
->
datasetTableField
.
getExtField
()
>
0
).
collect
(
Collectors
.
toList
());
List
<
DatasetTableField
>
extFields
=
fields
.
stream
().
filter
(
datasetTableField
->
datasetTableField
.
getExtField
()
>
0
).
collect
(
Collectors
.
toList
());
List
<
String
>
extFieldsRefIds
=
new
ArrayList
<>();
List
<
String
>
extFieldsRefIds
=
new
ArrayList
<>();
for
(
DatasetTableField
extField
:
extFields
)
{
for
(
DatasetTableField
extField
:
extFields
)
{
...
@@ -1928,7 +1933,7 @@ public class DataSetTableService {
...
@@ -1928,7 +1933,7 @@ public class DataSetTableService {
Matcher
matcher
=
pattern
.
matcher
(
originField
);
Matcher
matcher
=
pattern
.
matcher
(
originField
);
while
(
matcher
.
find
())
{
while
(
matcher
.
find
())
{
String
id
=
matcher
.
group
(
1
);
String
id
=
matcher
.
group
(
1
);
if
(!
extFieldsRefIds
.
contains
(
id
))
{
if
(!
extFieldsRefIds
.
contains
(
id
))
{
extFieldsRefIds
.
add
(
id
);
extFieldsRefIds
.
add
(
id
);
}
}
}
}
...
@@ -1939,12 +1944,12 @@ public class DataSetTableService {
...
@@ -1939,12 +1944,12 @@ public class DataSetTableService {
List
<
String
>
newFields
=
tableFields
.
stream
().
map
(
TableField:
:
getRemarks
).
collect
(
Collectors
.
toList
());
List
<
String
>
newFields
=
tableFields
.
stream
().
map
(
TableField:
:
getRemarks
).
collect
(
Collectors
.
toList
());
if
(
oldFields
.
equals
(
newFields
))
{
if
(
oldFields
.
equals
(
newFields
))
{
excelSheetData
.
setChangeFiled
(
false
);
excelSheetData
.
setChangeFiled
(
false
);
}
else
{
}
else
{
excelSheetData
.
setChangeFiled
(
true
);
excelSheetData
.
setChangeFiled
(
true
);
}
}
boolean
effectExtField
=
false
;
boolean
effectExtField
=
false
;
for
(
String
extFieldsRefName
:
extFieldsRefNames
)
{
for
(
String
extFieldsRefName
:
extFieldsRefNames
)
{
if
(!
newFields
.
contains
(
extFieldsRefName
))
{
if
(!
newFields
.
contains
(
extFieldsRefName
))
{
effectExtField
=
true
;
effectExtField
=
true
;
}
}
}
}
...
@@ -1956,7 +1961,7 @@ public class DataSetTableService {
...
@@ -1956,7 +1961,7 @@ public class DataSetTableService {
DataEaseException
.
throwException
(
Translator
.
get
(
"i18n_excel_column_change"
));
DataEaseException
.
throwException
(
Translator
.
get
(
"i18n_excel_column_change"
));
}
}
}
}
}
else
{
}
else
{
retrunSheetDataList
=
excelSheetDataList
;
retrunSheetDataList
=
excelSheetDataList
;
}
}
retrunSheetDataList
=
retrunSheetDataList
.
stream
()
retrunSheetDataList
=
retrunSheetDataList
.
stream
()
...
@@ -2374,7 +2379,7 @@ public class DataSetTableService {
...
@@ -2374,7 +2379,7 @@ public class DataSetTableService {
return
datasetTable
;
return
datasetTable
;
}
}
public
int
updateByExampleSelective
(
DatasetTable
record
,
DatasetTableExample
example
)
{
public
int
updateByExampleSelective
(
DatasetTable
record
,
DatasetTableExample
example
)
{
return
datasetTableMapper
.
updateByExampleSelective
(
record
,
example
);
return
datasetTableMapper
.
updateByExampleSelective
(
record
,
example
);
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论