Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
43e34a4b
Commit
43e34a4b
authored
Aug 03, 2021
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签场景查询根据 DisplayOrder降序排序
parent
6b94438c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
yd-api/src/main/java/com/yd/api/metadata/service/impl/MetadataServiceImpl.java
+31
-0
No files found.
yd-api/src/main/java/com/yd/api/metadata/service/impl/MetadataServiceImpl.java
View file @
43e34a4b
package
com
.
yd
.
api
.
metadata
.
service
.
impl
;
package
com
.
yd
.
api
.
metadata
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -316,12 +317,42 @@ public class MetadataServiceImpl implements MetadataService {
...
@@ -316,12 +317,42 @@ public class MetadataServiceImpl implements MetadataService {
tagViewQueryInfos
.
add
(
tagViewQueryInfo
);
tagViewQueryInfos
.
add
(
tagViewQueryInfo
);
}
}
}
}
//降序排序
tagViewQueryOrderByDisplay
(
tagViewQueryInfos
);
responseVO
.
setTagViewQueryInfos
(
tagViewQueryInfos
);
responseVO
.
setTagViewQueryInfos
(
tagViewQueryInfos
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
return
responseVO
;
return
responseVO
;
}
}
/**
* 返回的标签根据 DisplayOrder降序排序
* @param tagViewQueryInfos
*/
private
void
tagViewQueryOrderByDisplay
(
List
<
TagViewQueryInfo
>
tagViewQueryInfos
){
if
(
tagViewQueryInfos
!=
null
&&
tagViewQueryInfos
.
size
()
>
0
){
tagViewQueryInfos
.
sort
(
new
Comparator
<
TagViewQueryInfo
>()
{
@Override
public
int
compare
(
TagViewQueryInfo
o1
,
TagViewQueryInfo
o2
)
{
if
(
o2
.
getDisplayOrder
()
==
null
){
o2
.
setDisplayOrder
(-
1
);
}
if
(
o1
.
getDisplayOrder
()
==
null
){
o1
.
setDisplayOrder
(-
1
);
}
//按照value值,用compareTo()方法默认是从小到大排序
return
o2
.
getDisplayOrder
().
compareTo
(
o1
.
getDisplayOrder
());
}
});
for
(
TagViewQueryInfo
tagViewQueryInfo
:
tagViewQueryInfos
)
{
if
(
tagViewQueryInfo
!=
null
&&
tagViewQueryInfo
.
getTagViewQueryInfos
()
!=
null
&&
tagViewQueryInfo
.
getTagViewQueryInfos
().
size
()
>
0
){
tagViewQueryOrderByDisplay
(
tagViewQueryInfo
.
getTagViewQueryInfos
());
}
}
}
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
private
void
classificationBuildUpMdTagView
(
List
<
MdTagView
>
mdTagViewList
,
private
void
classificationBuildUpMdTagView
(
List
<
MdTagView
>
mdTagViewList
,
List
<
MdTagView
>
mdTagViewAddList
,
List
<
MdTagView
>
mdTagViewAddList
,
...
...
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