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
c9e3d48c
Commit
c9e3d48c
authored
Jul 05, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
清理字典缓存-缓存更新
parent
ca290086
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
SysDictItemServiceImpl.java
...us.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
+11
-1
No files found.
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
View file @
c9e3d48c
...
@@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem
;
import
com.yifu.cloud.plus.v1.yifu.admin.init.DictItemRedisInit
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictItemMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictItemMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService
;
...
@@ -39,6 +40,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
...
@@ -39,6 +40,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -57,6 +59,7 @@ import java.util.stream.Collectors;
...
@@ -57,6 +59,7 @@ import java.util.stream.Collectors;
* @author lengleng
* @author lengleng
* @date 2019/03/19
* @date 2019/03/19
*/
*/
@Log4j2
@Service
@Service
@RequiredArgsConstructor
@RequiredArgsConstructor
public
class
SysDictItemServiceImpl
extends
ServiceImpl
<
SysDictItemMapper
,
SysDictItem
>
implements
SysDictItemService
{
public
class
SysDictItemServiceImpl
extends
ServiceImpl
<
SysDictItemMapper
,
SysDictItem
>
implements
SysDictItemService
{
...
@@ -233,7 +236,14 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
...
@@ -233,7 +236,14 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
@CacheEvict
(
value
=
CacheConstants
.
DICT_ITEM_DETAILS
,
allEntries
=
true
)
@CacheEvict
(
value
=
CacheConstants
.
DICT_ITEM_DETAILS
,
allEntries
=
true
)
@Override
@Override
public
void
clearDictItemCache
()
{
public
void
clearDictItemCache
()
{
log
.
info
(
"字典数据加入缓存初始化开始..."
);
Map
<
String
,
Object
>
dictItem
=
this
.
getAllDictItemSub
();
if
(
Common
.
isNotNull
(
dictItem
)){
for
(
Map
.
Entry
<
String
,
Object
>
entry:
dictItem
.
entrySet
()){
redisUtil
.
set
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
log
.
info
(
"字典数据加入缓存初始化结束..."
);
}
}
private
void
extracted
(
List
<
SysDictItem
>
allList
,
Map
<
String
,
Object
>
resultMap
)
{
private
void
extracted
(
List
<
SysDictItem
>
allList
,
Map
<
String
,
Object
>
resultMap
)
{
if
(
Common
.
isNotNull
(
allList
)){
if
(
Common
.
isNotNull
(
allList
)){
...
...
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