Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tagManager
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanmw
tagManager
Commits
bf1fa4c7
Commit
bf1fa4c7
authored
Mar 16, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改标签元数据导入导出逻辑
parent
8546e81f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
TagFileService.java
...java/com/keymobile/tagmanager/service/TagFileService.java
+15
-5
No files found.
src/main/java/com/keymobile/tagmanager/service/TagFileService.java
View file @
bf1fa4c7
...
...
@@ -34,6 +34,7 @@ import com.keymobile.tagmanager.model.Tag;
import
com.keymobile.tagmanager.model.TagAnalysis
;
import
com.keymobile.tagmanager.model.TagMetadata
;
import
com.keymobile.tagmanager.persistence.TagRepository
;
import
com.keymobile.tagmanager.remote.AuthServiceClient
;
import
com.keymobile.tagmanager.remote.RepoServiceClient
;
import
com.keymobile.tagmanager.util.Constants
;
import
com.keymobile.tagmanager.util.DateUtils
;
...
...
@@ -157,10 +158,15 @@ public class TagFileService {
List
<
TagMetadata
>
toExportTagMeta
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
map
:
privilegeContent
)
{
TagMetadata
tagMeta
=
new
TagMetadata
();
tagMeta
.
setMetaModel
(
map
.
get
(
"type"
).
toString
());
//author:zhangkb time:2020-3-16 desc:获取元数据元模型
String
metaId
=
map
.
get
(
"_id"
).
toString
();
String
[]
metaIds
=
metaId
.
split
(
"="
);
tagMeta
.
setMetaModel
(
metaIds
[
0
]);
tagMeta
.
setName
(
map
.
get
(
"name"
).
toString
());
tagMeta
.
setMetaName
(
map
.
get
(
"namePath"
).
toString
());
//author:zhangkb time:2020-3-16 desc:去掉元数据最前面的catalog
tagMeta
.
setMetaName
(
map
.
get
(
"namePath"
).
toString
().
substring
(
map
.
get
(
"namePath"
).
toString
().
indexOf
(
','
)+
1
,
map
.
get
(
"namePath"
).
toString
().
length
()));
String
tagStr
=
null
;
//如果是维度标签或者系统标签
if
((
"1"
.
equals
(
dimensionType
)
&&
"1"
.
equals
(
tagType
))
||
"0"
.
equals
(
tagType
))
{
...
...
@@ -342,6 +348,11 @@ public class TagFileService {
importExcelMore
(
inputStream
,
TagMetadata
.
class
,
params
);
List
<
String
>
successIds
=
new
ArrayList
<>();
List
<
TagMetadata
>
tagMetadatas
=
excelImportResult
.
getList
();
//author:zhangkb time:2020-3-16 desc:元数据路径加上领域
for
(
TagMetadata
tagMd:
tagMetadatas
)
{
String
metaPath
=
"0,"
+
tagMd
.
getMetaName
();
tagMd
.
setMetaName
(
metaPath
);
}
for
(
TagMetadata
tagMetadata
:
tagMetadatas
)
{
//判断元数据名称是否在repo存在
String
claz
=
null
;
...
...
@@ -401,7 +412,7 @@ public class TagFileService {
if
(
"HANAVIEW"
.
equals
(
obj
.
getMetaModel
().
toUpperCase
()))
{
claz
=
"Catalog,Database,Schema,HanaView"
;
}
Map
<
String
,
Object
>
meta
=
repoService
.
getMetaByNamePathAndClass
(
claz
,
obj
.
getMetaName
());
Map
<
String
,
Object
>
meta
=
repoService
.
getMetaByNamePathAndClass
(
claz
,
"0,"
+
obj
.
getMetaName
());
if
(
meta
.
isEmpty
())
{
result
.
setSuccess
(
false
);
result
.
setMsg
(
String
.
format
(
"元数据不存在namePath为[%s]的[%s]数据"
,
...
...
@@ -563,5 +574,4 @@ public class TagFileService {
public
void
undoImportExcel
(
String
importlogId
)
{
mongoOperations
.
remove
(
Query
.
query
(
Criteria
.
where
(
"importId"
).
is
(
importlogId
)),
Tag
.
class
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment