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
7b74fc33
Commit
7b74fc33
authored
Nov 22, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限配置页面
parent
29ff02f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
15 deletions
+77
-15
TSettleDomainServiceImpl.java
.../yifu/archives/service/impl/TSettleDomainServiceImpl.java
+6
-6
CacheConstants.java
...oud/plus/v1/yifu/common/core/constant/CacheConstants.java
+10
-0
AreaMap.java
...ava/com/yifu.cloud.plus.v1/yifu/admin/api/vo/AreaMap.java
+20
-0
AreaController.java
...u/cloud/plus/v1/yifu/admin/controller/AreaController.java
+41
-9
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TSettleDomainServiceImpl.java
View file @
7b74fc33
...
...
@@ -142,13 +142,13 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
if
(
Common
.
isNotNull
(
list
))
{
R
<
AreaVo
>
areaListR
;
TSettleDomain
tSettleDomainInfo
;
AreaVo
areaList
;
areaListR
=
upmsDaprUtils
.
getAreaListR
();
if
(
null
==
areaListR
||
areaListR
.
getCode
()
!=
CommonConstants
.
SUCCESS
)
{
return
R
.
failed
(
"获取区域数据失败!"
);
}
AreaVo
areaList
=
areaListR
.
getData
();
for
(
TSettleDomain
tSettleDomain:
list
)
{
areaListR
=
upmsDaprUtils
.
getAreaListR
();
if
(
null
==
areaListR
||
areaListR
.
getCode
()
!=
CommonConstants
.
SUCCESS
)
{
return
R
.
failed
(
"获取区域数据失败!"
);
}
areaList
=
areaListR
.
getData
();
if
(
null
!=
areaList
&&
!
areaList
.
getSysAreaList
().
isEmpty
())
{
for
(
SysArea
area
:
areaList
.
getSysAreaList
())
{
if
(
Common
.
isNotNull
(
tSettleDomain
.
getEProvince
())
&&
area
.
getAreaName
().
equals
(
tSettleDomain
.
getEProvince
()))
{
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CacheConstants.java
View file @
7b74fc33
...
...
@@ -113,6 +113,16 @@ public interface CacheConstants {
* 区域数据--值
*/
String
AREA_VALUE
=
"area_value:"
;
/**
* 区域数据--标签
*/
String
AREA_LABEL_GROUP
=
"area_label"
;
/**
* 区域数据--值
*/
String
AREA_VALUE_GROUP
=
"area_value"
;
/**
* 用户登录的项目vo缓存
*/
...
...
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/AreaMap.java
0 → 100644
View file @
7b74fc33
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea
;
import
lombok.Data
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @Author fxj
* @Date 2022/11/22
* @Description
* @Version 1.0
*/
@Data
public
class
AreaMap
{
private
Map
<
String
,
SysArea
>
idLabelMap
;
private
Map
<
String
,
SysArea
>
labelIdMap
;
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/AreaController.java
View file @
7b74fc33
...
...
@@ -21,12 +21,15 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaMap
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysAreaService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
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.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -104,24 +107,53 @@ public class AreaController {
vo
.
setSysAreaList
(
aList
);
return
vo
;
}
@Autowired
private
RedisUtil
redisUtil
;
/**
* @param
* @Description: 获取所有区域list
* @Author: hyc
* @Date: 2022-7-21 19:45:24
**/
@Inner
@PostMapping
(
"/
inner/
getAreaMap"
)
//
@Inner
@PostMapping
(
"/getAreaMap"
)
public
AreaMap
getAreaMap
()
{
List
<
SysArea
>
aList
=
sysAreaService
.
list
(
Wrappers
.<
SysArea
>
query
().
lambda
()
.
eq
(
SysArea:
:
getStatus
,
CommonConstants
.
ZERO_INT
).
orderByAsc
(
SysArea:
:
getParentId
));
AreaMap
map
=
new
AreaMap
();
Map
<
String
,
String
>
m
=
null
;
if
(
Common
.
isNotNull
(
aList
)){
aList
.
stream
().
collect
(
Collectors
.
toMap
(
SysArea:
:
get
));
Map
<
String
,
SysArea
>
idLabelMap
=
(
Map
<
String
,
SysArea
>)
redisUtil
.
get
(
CacheConstants
.
AREA_LABEL_GROUP
);
Map
<
String
,
SysArea
>
labelIdMap
=
(
Map
<
String
,
SysArea
>)
redisUtil
.
get
(
CacheConstants
.
AREA_VALUE_GROUP
);
if
(
Common
.
isEmpty
(
idLabelMap
)
||
Common
.
isEmpty
(
labelIdMap
)){
initAreaRedis
();
}
map
.
setAreaMap
(
m
);
AreaMap
map
=
new
AreaMap
();
idLabelMap
=
(
Map
<
String
,
SysArea
>)
redisUtil
.
get
(
CacheConstants
.
AREA_LABEL_GROUP
);
labelIdMap
=
(
Map
<
String
,
SysArea
>)
redisUtil
.
get
(
CacheConstants
.
AREA_VALUE_GROUP
);
map
.
setIdLabelMap
(
idLabelMap
);
map
.
setLabelIdMap
(
labelIdMap
);
return
map
;
}
private
void
initAreaRedis
()
{
List
<
SysArea
>
allAreas
=
sysAreaService
.
getAllArea
();
if
(
Common
.
isNotNull
(
allAreas
))
{
Map
<
String
,
SysArea
>
areaMap
=
new
HashMap
<>();
for
(
SysArea
area
:
allAreas
)
{
redisUtil
.
set
(
CacheConstants
.
AREA_LABEL
+
area
.
getId
(),
area
.
getAreaName
());
areaMap
.
put
(
area
.
getId
().
toString
(),
area
);
}
SysArea
temp
;
for
(
SysArea
area
:
allAreas
)
{
if
(
Common
.
isNotNull
(
area
.
getParentId
())
&&
area
.
getParentId
().
intValue
()
>
0
)
{
temp
=
areaMap
.
get
(
area
.
getParentId
().
toString
());
redisUtil
.
set
(
CacheConstants
.
AREA_VALUE
+
area
.
getAreaName
()
+
CommonConstants
.
DOWN_LINE_STRING
+
(
Common
.
isNotNull
(
temp
)
?
temp
.
getAreaName
()
:
""
),
area
.
getId
());
}
else
{
redisUtil
.
set
(
CacheConstants
.
AREA_VALUE
+
area
.
getAreaName
(),
area
.
getId
());
}
}
}
}
}
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