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
6e63c620
Commit
6e63c620
authored
Jun 24, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
excel导入导出组件
parent
4de7b702
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
SysAreaService.java
...yifu.cloud.plus.v1/yifu/admin/service/SysAreaService.java
+3
-0
SysAreaServiceImpl.java
...d.plus.v1/yifu/admin/service/impl/SysAreaServiceImpl.java
+5
-0
DictItemRedisInit.java
...yifu/cloud/plus/v1/yifu/admin/init/DictItemRedisInit.java
+18
-0
No files found.
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysAreaService.java
View file @
6e63c620
...
@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -46,4 +47,6 @@ public interface SysAreaService extends IService<SysArea> {
...
@@ -46,4 +47,6 @@ public interface SysAreaService extends IService<SysArea> {
**/
**/
R
<
Map
<
String
,
String
>>
getAreaToName
();
R
<
Map
<
String
,
String
>>
getAreaToName
();
List
<
SysArea
>
getAllArea
();
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysAreaServiceImpl.java
View file @
6e63c620
...
@@ -50,6 +50,11 @@ public class SysAreaServiceImpl extends ServiceImpl<SysAreaMapper, SysArea> impl
...
@@ -50,6 +50,11 @@ public class SysAreaServiceImpl extends ServiceImpl<SysAreaMapper, SysArea> impl
return
R
.
ok
(
resultMap
);
return
R
.
ok
(
resultMap
);
}
}
@Override
public
List
<
SysArea
>
getAllArea
()
{
return
baseMapper
.
selectList
(
Wrappers
.<
SysArea
>
query
().
lambda
());
}
private
Map
<
String
,
String
>
getStringMapMap
(
boolean
type
)
{
private
Map
<
String
,
String
>
getStringMapMap
(
boolean
type
)
{
List
<
SysArea
>
allList
=
baseMapper
.
selectList
(
Wrappers
.<
SysArea
>
query
().
lambda
()
List
<
SysArea
>
allList
=
baseMapper
.
selectList
(
Wrappers
.<
SysArea
>
query
().
lambda
()
.
eq
(
SysArea:
:
getStatus
,
CommonConstants
.
ZERO_INT
));
.
eq
(
SysArea:
:
getStatus
,
CommonConstants
.
ZERO_INT
));
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/init/DictItemRedisInit.java
View file @
6e63c620
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
init
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
init
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysAreaService
;
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.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
...
@@ -8,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -8,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -22,6 +26,9 @@ public class DictItemRedisInit {
...
@@ -22,6 +26,9 @@ public class DictItemRedisInit {
@Autowired
@Autowired
private
SysDictItemService
dictItemService
;
private
SysDictItemService
dictItemService
;
@Autowired
private
SysAreaService
sysAreaService
;
@Autowired
@Autowired
private
RedisUtil
redisUtil
;
private
RedisUtil
redisUtil
;
...
@@ -35,5 +42,16 @@ public class DictItemRedisInit {
...
@@ -35,5 +42,16 @@ public class DictItemRedisInit {
}
}
}
}
log
.
info
(
"字典数据加入缓存初始化结束..."
);
log
.
info
(
"字典数据加入缓存初始化结束..."
);
log
.
info
(
"区域数据加入缓存初始化开始..."
);
List
<
SysArea
>
allAreas
=
sysAreaService
.
getAllArea
();
if
(
Common
.
isNotNull
(
allAreas
)){
for
(
SysArea
area:
allAreas
){
redisUtil
.
set
(
area
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+(
Common
.
isEmpty
(
area
.
getParentId
())?
"0"
:
area
.
getParentId
()),
area
.
getId
());
}
}
log
.
info
(
"区域数据加入缓存初始化结束..."
);
}
}
}
}
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