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
1779533d
Commit
1779533d
authored
Jun 22, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字典项缓存调整
parent
fa7e232a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
5 deletions
+30
-5
CacheConstants.java
...oud.plus.v1/yifu/common/core/constant/CacheConstants.java
+5
-0
DictController.java
...u.cloud.plus.v1/yifu/admin/controller/DictController.java
+4
-2
SysDictItemService.java
....cloud.plus.v1/yifu/admin/service/SysDictItemService.java
+2
-1
SysDictItemServiceImpl.java
...us.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
+19
-2
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CacheConstants.java
View file @
1779533d
...
...
@@ -54,6 +54,11 @@ public interface CacheConstants {
*/
String
DICT_DETAILS
=
"dict_details"
;
/**
* 字典项信息缓存
*/
String
DICT_ITEM_DETAILS
=
"dict_item_details"
;
/**
* oauth 客户端信息
*/
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/DictController.java
View file @
1779533d
...
...
@@ -178,8 +178,8 @@ public class DictController {
* @return
*/
@GetMapping
(
"/item/getAllDictItem"
)
public
R
<
Map
<
String
,
Object
>>
get
SysDictItemPage
()
{
return
sysDictItemService
.
get
SysDictItemPage
();
public
R
<
Map
<
String
,
Object
>>
get
AllDictItem
()
{
return
sysDictItemService
.
get
AllDictItem
();
}
/**
...
...
@@ -286,6 +286,8 @@ public class DictController {
@PreAuthorize
(
"@pms.hasPermission('sys_dict_del')"
)
public
R
clearDictCache
()
{
sysDictService
.
clearDictCache
();
// 同步清理字典项缓存
sysDictItemService
.
clearDictItemCache
();
return
R
.
ok
();
}
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysDictItemService.java
View file @
1779533d
...
...
@@ -61,6 +61,7 @@ public interface SysDictItemService extends IService<SysDictItem> {
R
<
Map
<
String
,
Object
>>
getParentDictItemByTypes
(
String
itemTypes
);
R
<
Map
<
String
,
Object
>>
get
SysDictItemPage
();
R
<
Map
<
String
,
Object
>>
get
AllDictItem
();
void
clearDictItemCache
();
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysDictItemServiceImpl.java
View file @
1779533d
...
...
@@ -158,15 +158,32 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
extracted
(
allList
,
resultMap
);
return
R
.
ok
(
resultMap
);
}
/**
* @Author fxj
* @Description 获取所有字典项数据
* @Date 17:31 2022/6/22
* @Param
* @return
**/
@CacheEvict
(
value
=
CacheConstants
.
DICT_ITEM_DETAILS
,
key
=
CacheConstants
.
DICT_ITEM_DETAILS
)
@Override
public
R
<
Map
<
String
,
Object
>>
get
SysDictItemPage
()
{
public
R
<
Map
<
String
,
Object
>>
get
AllDictItem
()
{
List
<
SysDictItem
>
allList
=
baseMapper
.
selectList
(
Wrappers
.<
SysDictItem
>
query
().
lambda
()
.
eq
(
SysDictItem:
:
getDelFlag
,
CommonConstants
.
ZERO_STRING
));
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
extracted
(
allList
,
resultMap
);
return
R
.
ok
(
resultMap
);
}
/**
* @Author fxj
* @Description 清理字典项数据
* @Date 17:39 2022/6/22
**/
@CacheEvict
(
value
=
CacheConstants
.
DICT_ITEM_DETAILS
,
allEntries
=
true
)
@Override
public
void
clearDictItemCache
()
{
}
private
void
extracted
(
List
<
SysDictItem
>
allList
,
Map
<
String
,
Object
>
resultMap
)
{
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