Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
fangxinjiang
yifu-mvp
Commits
7e88f405
Commit
7e88f405
authored
Jul 05, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
清理字典缓存-缓存更新
parent
c9e3d48c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
SysDictItemServiceImpl.java
...us.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
+17
-3
No files found.
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
View file @
7e88f405
...
...
@@ -143,7 +143,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
List
<
SysDictItem
>
allList
=
baseMapper
.
selectList
(
Wrappers
.<
SysDictItem
>
query
().
lambda
()
.
in
(
SysDictItem:
:
getType
,
type
)
.
eq
(
SysDictItem:
:
getDelFlag
,
CommonConstants
.
ZERO_STRING
));
extracted
(
allList
,
resultMap
);
extracted
Cache
(
allList
,
resultMap
);
}
/**
...
...
@@ -245,7 +245,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
}
log
.
info
(
"字典数据加入缓存初始化结束..."
);
}
private
void
extracted
(
List
<
SysDictItem
>
allList
,
Map
<
String
,
Object
>
resultMap
)
{
private
void
extracted
Cache
(
List
<
SysDictItem
>
allList
,
Map
<
String
,
Object
>
resultMap
)
{
if
(
Common
.
isNotNull
(
allList
)){
if
(
Common
.
isEmpty
(
resultMap
)){
resultMap
=
new
HashMap
<>();
...
...
@@ -255,7 +255,21 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
}
}
}
private
void
extracted
(
List
<
SysDictItem
>
allList
,
Map
<
String
,
Object
>
resultMap
)
{
if
(
Common
.
isNotNull
(
allList
)){
for
(
SysDictItem
item
:
allList
)
{
String
dictCode
=
item
.
getType
();
if
(
resultMap
.
get
(
dictCode
)
==
null
)
{
Map
<
String
,
Object
>
dictMap
=
new
HashMap
<
String
,
Object
>();
dictMap
.
put
(
item
.
getValue
(),
item
.
getLabel
());
resultMap
.
put
(
dictCode
,
dictMap
);
}
else
{
Map
dictMap
=
(
Map
)
resultMap
.
get
(
dictCode
);
dictMap
.
put
(
item
.
getValue
(),
item
.
getLabel
());
}
}
}
}
@Override
public
R
<
Map
<
String
,
Map
<
String
,
String
>>>
getDictToLable
()
{
Map
<
String
,
Map
<
String
,
String
>>
resultMap
=
this
.
getStringMapMap
(
false
);
...
...
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