Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
205dd4ef
Commit
205dd4ef
authored
May 08, 2024
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整更新单位类型缓存
parent
969e8eea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
6 deletions
+22
-6
CommonController.java
.../amos/boot/module/jg/biz/controller/CommonController.java
+3
-3
ICommonService.java
...ejoin/amos/boot/module/jg/biz/service/ICommonService.java
+1
-1
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+18
-2
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/CommonController.java
View file @
205dd4ef
...
@@ -541,9 +541,9 @@ public class CommonController extends BaseController {
...
@@ -541,9 +541,9 @@ public class CommonController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/unitType/selected"
)
@PutMapping
(
value
=
"/unitType/selected"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新缓存中
单位类型"
,
notes
=
"更新缓存中单位类型
"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新缓存中
信息"
,
notes
=
"更新缓存中信息
"
)
public
ResponseModel
<
String
>
updateUnitTypeCache
(
@ApiParam
(
"单位类型"
)
@RequestParam
String
unitType
){
public
ResponseModel
<
String
>
updateUnitTypeCache
(
@ApiParam
(
"单位类型"
)
@RequestParam
String
unitType
,
@ApiParam
(
"选择角色"
)
@RequestParam
String
selectedRoleSeqs
){
commonService
.
updateUnitTypeCache
(
getSelectedOrgInfo
(),
unitType
);
commonService
.
updateUnitTypeCache
(
getSelectedOrgInfo
(),
unitType
,
selectedRoleSeqs
);
return
ResponseHelper
.
buildResponse
(
"success"
);
return
ResponseHelper
.
buildResponse
(
"success"
);
}
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/ICommonService.java
View file @
205dd4ef
...
@@ -193,5 +193,5 @@ public interface ICommonService {
...
@@ -193,5 +193,5 @@ public interface ICommonService {
*
*
* @param unitType 单位类型
* @param unitType 单位类型
*/
*/
void
updateUnitTypeCache
(
ReginParams
reginParams
,
String
unitType
);
void
updateUnitTypeCache
(
ReginParams
reginParams
,
String
unitType
,
String
selectedRoleSeqs
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
205dd4ef
...
@@ -166,6 +166,9 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -166,6 +166,9 @@ public class CommonServiceImpl implements ICommonService {
// 业务通用发起——更名变更表单key
// 业务通用发起——更名变更表单key
private
static
final
String
GMBG_PAGE_ID
=
"jgRegistrationInfo"
;
private
static
final
String
GMBG_PAGE_ID
=
"jgRegistrationInfo"
;
private
static
final
String
SELECTED_ROLE_SEQS
=
"selectRoleSeqs"
;
@Value
(
"${redis.cache.failure.time}"
)
@Value
(
"${redis.cache.failure.time}"
)
private
Long
redisRegionTimeSecond
;
private
Long
redisRegionTimeSecond
;
...
@@ -427,12 +430,23 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -427,12 +430,23 @@ public class CommonServiceImpl implements ICommonService {
@Override
@Override
public
Map
<
String
,
Object
>
getPermissionTreeWithCompany
(
String
menuAgent
,
String
permissionType
,
String
path
,
CompanyBo
company
)
{
public
Map
<
String
,
Object
>
getPermissionTreeWithCompany
(
String
menuAgent
,
String
permissionType
,
String
path
,
CompanyBo
company
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Collection
<
PermissionModel
>
permissionModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
permissionClient
.
currentPermissionTree
(
menuAgent
,
permissionType
,
null
,
path
));
Object
roleSeqs
=
redisUtils
.
get
(
getSelectedRoleRedisKey
());
Collection
<
PermissionModel
>
permissionModels
;
// 监管单位
if
(!
"company"
.
equals
(
company
.
getLevel
())
||
null
==
roleSeqs
){
permissionModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
permissionClient
.
currentPermissionTree
(
menuAgent
,
permissionType
,
null
,
path
));
}
else
{
permissionModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
permissionClient
.
treeByRoles
(
roleSeqs
.
toString
(),
menuAgent
,
permissionType
,
path
,
RequestContext
.
getAppKey
()));
}
result
.
put
(
"permission"
,
permissionModels
);
result
.
put
(
"permission"
,
permissionModels
);
result
.
put
(
"company"
,
company
);
result
.
put
(
"company"
,
company
);
return
result
;
return
result
;
}
}
private
static
String
getSelectedRoleRedisKey
()
{
return
RequestContext
.
getToken
()
+
"_"
+
SELECTED_ROLE_SEQS
;
}
@Override
@Override
public
void
useFlagGenerate
(
UseFlagParamDto
useFlagParamDto
,
HttpServletResponse
response
)
{
public
void
useFlagGenerate
(
UseFlagParamDto
useFlagParamDto
,
HttpServletResponse
response
)
{
Objects
.
requireNonNull
(
useFlagParamDto
,
"参数不能为空"
);
Objects
.
requireNonNull
(
useFlagParamDto
,
"参数不能为空"
);
...
@@ -1826,8 +1840,9 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -1826,8 +1840,9 @@ public class CommonServiceImpl implements ICommonService {
}
}
@Override
@Override
public
void
updateUnitTypeCache
(
ReginParams
reginParams
,
String
unitType
)
{
public
void
updateUnitTypeCache
(
ReginParams
reginParams
,
String
unitType
,
String
selectedRoleSeqs
)
{
reginParams
.
getCompany
().
setCompanyType
(
unitType
);
reginParams
.
getCompany
().
setCompanyType
(
unitType
);
redisUtils
.
set
(
getSelectedRoleRedisKey
(),
selectedRoleSeqs
,
redisRegionTimeSecond
);
redisUtils
.
set
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()),
JSONObject
.
toJSONString
(
reginParams
),
redisRegionTimeSecond
);
redisUtils
.
set
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()),
JSONObject
.
toJSONString
(
reginParams
),
redisRegionTimeSecond
);
}
}
}
}
\ No newline at end of file
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