Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
ad2e1979
Commit
ad2e1979
authored
Nov 25, 2020
by
maoying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加默认用户存储
parent
9825e3d4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
38 deletions
+37
-38
PermissionAspect.java
...in/java/com/yeejoin/amos/fas/config/PermissionAspect.java
+37
-38
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/config/PermissionAspect.java
View file @
ad2e1979
...
@@ -78,44 +78,43 @@ public class PermissionAspect {
...
@@ -78,44 +78,43 @@ public class PermissionAspect {
if
(
joinPoint
.
getSignature
().
getName
().
equals
(
"saveCurCompany"
))
{
if
(
joinPoint
.
getSignature
().
getName
().
equals
(
"saveCurCompany"
))
{
return
;
return
;
}
}
// FeignClientResult feignClientResult;
FeignClientResult
feignClientResult
;
// AgencyUserModel userModel=null;
AgencyUserModel
userModel
=
null
;
// try {
try
{
// feignClientResult = Privilege.agencyUserClient.getme();
feignClientResult
=
Privilege
.
agencyUserClient
.
getme
();
// userModel = (AgencyUserModel) feignClientResult.getResult();
userModel
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
//
// } catch (InnerInvokException e) {
}
catch
(
InnerInvokException
e
)
{
// e.printStackTrace();
e
.
printStackTrace
();
// }
}
// String userId = null;
String
userId
=
null
;
// ReginParams regionParam = new ReginParams();
ReginParams
regionParam
=
new
ReginParams
();
// if(userModel != null){
if
(
userModel
!=
null
){
// userId = userModel.getUserId();
userId
=
userModel
.
getUserId
();
// Map<Long, List<RoleModel>> orgRoles = userModel.getOrgRoles();
ReginParams
reginParams
=
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
userModel
.
getUserId
(),
token
)),
ReginParams
.
class
);
// List<RoleModel> roleModels = null;
if
(
reginParams
==
null
&&
userModel
.
getCompanys
().
size
()
>
0
){
// if(!ObjectUtils.isEmpty(orgRoles)) {
CompanyModel
companyModel
=
userModel
.
getCompanys
().
get
(
0
);
// for (Map.Entry<Long, List<RoleModel>> entry : orgRoles.entrySet()) {
List
<
DepartmentModel
>
deptList
=
remoteSecurityService
.
getDepartmentTreeByCompanyId
(
token
,
product
,
appKey
,
companyModel
.
getSequenceNbr
().
toString
());
// roleModels = entry.getValue();
if
(
deptList
.
size
()
>
0
){
// break;
CompanyBo
companyBo
=
convertCompanyModelToBo
(
companyModel
);
// }
DepartmentBo
departmentBo
=
convertDepartmentModelToBo
(
deptList
.
get
(
0
));
// }
regionParam
.
setCompany
(
companyBo
);
// ReginParams reginParams = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(userModel.getUserId(), token)), ReginParams.class);
regionParam
.
setDepartment
(
departmentBo
);
// if(reginParams == null && userModel.getCompanys().size() > 0){
}
// CompanyModel companyModel = userModel.getCompanys().get(0);
Map
<
Long
,
List
<
RoleModel
>>
orgRoles
=
userModel
.
getOrgRoles
();
//
List
<
RoleModel
>
roleModels
=
null
;
// List<DepartmentModel> deptList = remoteSecurityService.getDepartmentTreeByCompanyId(token, product, appKey, companyModel.getSequenceNbr().toString());
if
(!
ObjectUtils
.
isEmpty
(
orgRoles
))
{
// if(deptList.size() > 0){
for
(
Map
.
Entry
<
Long
,
List
<
RoleModel
>>
entry
:
orgRoles
.
entrySet
())
{
// CompanyBo companyBo = convertCompanyModelToBo(companyModel);
roleModels
=
entry
.
getValue
();
// DepartmentBo departmentBo = convertDepartmentModelToBo(deptList.get(0));
break
;
// regionParam.setCompany(companyBo);
}
// regionParam.setDepartment(departmentBo);
}
// }
if
(!
ObjectUtils
.
isEmpty
(
roleModels
)){
// if(!ObjectUtils.isEmpty(roleModels)){
regionParam
.
setRole
(
convertRoleModelToBo
(
roleModels
.
get
(
0
)));
// regionParam.setRole(convertRoleModelToBo(roleModels.get(0)));
}
// }
redisTemplate
.
opsForValue
().
set
(
buildKey
(
userId
,
token
),
JSONObject
.
toJSONString
(
regionParam
));
// redisTemplate.opsForValue().set(buildKey(userId, token), JSONObject.toJSONString(regionParam));
}
// }
}
// }
}
}
private
DepartmentBo
convertDepartmentModelToBo
(
DepartmentModel
departmentModel
){
private
DepartmentBo
convertDepartmentModelToBo
(
DepartmentModel
departmentModel
){
...
...
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