Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-user
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
xingmin
yd-user
Commits
3bc7cd75
Commit
3bc7cd75
authored
Oct 10, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
30eeccad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
yd-user-feign/src/main/java/com/yd/user/feign/response/sysdict/GetDictItemListByDictTypeResponse.java
+25
-0
No files found.
yd-user-feign/src/main/java/com/yd/user/feign/response/sysdict/GetDictItemListByDictTypeResponse.java
View file @
3bc7cd75
package
com
.
yd
.
user
.
feign
.
response
.
sysdict
;
package
com
.
yd
.
user
.
feign
.
response
.
sysdict
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* 根据字典类型获取字典数据项列表出参
* 根据字典类型获取字典数据项列表出参
...
@@ -52,4 +55,26 @@ public class GetDictItemListByDictTypeResponse {
...
@@ -52,4 +55,26 @@ public class GetDictItemListByDictTypeResponse {
* 状态(0:停用 1:启用)
* 状态(0:停用 1:启用)
*/
*/
private
Integer
status
;
private
Integer
status
;
/**
* 根据字典类型和字典值获取名称
* @param list
* @param dictType
* @param itemValue
* @return
*/
public
static
String
getItemLabel
(
List
<
GetDictItemListByDictTypeResponse
>
list
,
String
dictType
,
String
itemValue
)
{
String
itemLabel
=
""
;
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
List
<
GetDictItemListByDictTypeResponse
>
singeList
=
list
.
stream
()
.
filter
(
item
->
item
.
getDictType
().
equals
(
dictType
)
&&
item
.
getItemValue
().
equals
(
itemValue
))
.
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
singeList
))
{
GetDictItemListByDictTypeResponse
typeResponse
=
singeList
.
get
(
0
);
itemLabel
=
typeResponse
.
getItemLabel
();
}
}
return
itemLabel
;
}
}
}
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