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
9c3b5a5d
Commit
9c3b5a5d
authored
Apr 10, 2024
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全景监控设备动作信号修改添加动作类信号筛选,自动登陆失效问题
parent
a8e8630a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
409 additions
and
425 deletions
+409
-425
LoginController.java
...yeejoin/amos/fas/business/controller/LoginController.java
+37
-45
RemoteSecurityService.java
...eejoin/amos/fas/business/feign/RemoteSecurityService.java
+372
-380
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/LoginController.java
View file @
9c3b5a5d
...
...
@@ -3,8 +3,8 @@ package com.yeejoin.amos.fas.business.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.feign.config.TokenOperation
;
import
com.yeejoin.amos.fas.business.feign.PrivilegeFeign
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.feign.PrivilegeFeign
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.vo.CompanyBo
;
import
com.yeejoin.amos.fas.business.vo.DepartmentBo
;
...
...
@@ -17,9 +17,8 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.util.
A
esUtil
;
import
com.yeejoin.amos.feign.privilege.util.
D
esUtil
;
import
com.yeejoin.amos.feign.privilege.util.PwdUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
...
...
@@ -31,8 +30,6 @@ import org.springframework.util.ObjectUtils;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.component.cache.enumeration.CacheType
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -82,39 +79,34 @@ public class LoginController {
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
String
token
=
"szhlz"
;
//ObjectUtils.isEmpty(request.getHeader("token"))?"szhlz":request.getHeader("token").toString() ;
//ObjectUtils.isEmpty(request.getHeader("token"))?"szhlz":request.getHeader("token").toString() ;
ReginParams
reginParams
;
reginParams
=
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
userId
,
token
)),
ReginParams
.
class
);
if
(
reginParams
==
null
){
reginParams
=
getLogin
(
userId
,
token
);
reginParams
=
getLogin
(
userId
,
token
);
}
else
{
RequestContext
.
setProduct
(
product
);
String
cacheKey
=
Redis
.
genKey
(
new
String
[]{
CacheType
.
ERASABLE
.
name
(),
"SESSION_TOKEN"
,
RequestContext
.
getProduct
(),
reginParams
.
getToken
()});
boolean
hasKey
=
Redis
.
getRedisTemplate
().
hasKey
(
cacheKey
);
if
(
hasKey
)
{
return
reginParams
;
}
else
{
logger
.
info
(
"Auto自动登陆=====:{}"
,
JSON
.
toJSONString
(
reginParams
));
RequestContext
.
setProduct
(
product
);
if
(!
TokenOperation
.
refresh
(
reginParams
.
getToken
()))
{
reginParams
=
getLogin
(
userId
,
token
);
}
}
return
reginParams
;
}
private
ReginParams
getLogin
(
String
userId
,
String
token
)
throws
Exception
{
ReginParams
reginParams
=
new
ReginParams
();
IdPasswordAuthModel
dPasswordAuthModel
=
new
IdPasswordAuthModel
();
dPasswordAuthModel
.
setLoginId
(
userId
);
dPasswordAuthModel
.
setPassword
(
PwdUtil
.
encode
(
password
));
RequestContext
.
setProduct
(
product
);
private
ReginParams
getLogin
(
String
userId
,
String
token
)
throws
Exception
{
ReginParams
reginParams
=
new
ReginParams
();
IdPasswordAuthModel
dPasswordAuthModel
=
new
IdPasswordAuthModel
();
dPasswordAuthModel
.
setLoginId
(
userId
);
dPasswordAuthModel
.
setPassword
(
DesUtil
.
encode
(
password
,
"qaz"
));
RequestContext
.
setProduct
(
product
);
FeignClientResult
feignClientResult
=
Privilege
.
authClient
.
idpassword
(
dPasswordAuthModel
);
if
(
ObjectUtils
.
isEmpty
(
feignClientResult
.
getResult
())){
throw
new
Exception
(
"缺失登录信息"
);
}
// 调用平台授权接口
Map
<
String
,
String
>
re
=
(
Map
<
String
,
String
>)
feignClientResult
.
getResult
();
String
amosToken
=
re
.
get
(
"token"
);
if
(
ObjectUtils
.
isEmpty
(
feignClientResult
.
getResult
())){
throw
new
Exception
(
"缺失登录信息"
);
}
// 调用平台授权接口
Map
<
String
,
String
>
re
=
(
Map
<
String
,
String
>)
feignClientResult
.
getResult
();
String
amosToken
=
re
.
get
(
"token"
);
logger
.
info
(
"应用授权开始======================================"
+
amosToken
);
RequestContext
.
setToken
(
amosToken
);
...
...
@@ -126,23 +118,23 @@ public class LoginController {
logger
.
info
(
"应用授权结束======================================"
+
JSON
.
toJSONString
(
fd
)+
amosToken
);
AgencyUserModel
userModel
=
(
AgencyUserModel
)
Privilege
.
agencyUserClient
.
getme
().
getResult
();
CompanyModel
companyModel
=
userModel
.
getCompanys
().
get
(
0
);
List
<
DepartmentModel
>
deptList
=
remoteSecurityService
.
getDepartmentTreeByCompanyId
(
amosToken
,
product
,
appKey
,
companyModel
.
getSequenceNbr
().
toString
());
if
(
deptList
.
size
()
>
0
){
CompanyBo
companyBo
=
convertCompanyModelToBo
(
companyModel
);
DepartmentBo
departmentBo
=
convertDepartmentModelToBo
(
deptList
.
get
(
0
));
reginParams
.
setDepartment
(
departmentBo
);
reginParams
.
setCompany
(
companyBo
);
}
reginParams
.
setToken
(
amosToken
);
reginParams
.
setUserModel
(
userModel
);
redisTemplate
.
opsForValue
().
set
(
buildKey
(
userId
,
token
),
JSONObject
.
toJSONString
(
reginParams
),
28
,
TimeUnit
.
DAYS
);
// redisTemplate.opsForValue().set(buildKey(userId, amosToken), JSONObject.toJSONString(reginParams),28, TimeUnit.DAYS);
return
reginParams
;
}
AgencyUserModel
userModel
=
(
AgencyUserModel
)
Privilege
.
agencyUserClient
.
getme
().
getResult
();
CompanyModel
companyModel
=
userModel
.
getCompanys
().
get
(
0
);
List
<
DepartmentModel
>
deptList
=
remoteSecurityService
.
getDepartmentTreeByCompanyId
(
amosToken
,
product
,
appKey
,
companyModel
.
getSequenceNbr
().
toString
());
if
(
deptList
.
size
()
>
0
){
CompanyBo
companyBo
=
convertCompanyModelToBo
(
companyModel
);
DepartmentBo
departmentBo
=
convertDepartmentModelToBo
(
deptList
.
get
(
0
));
reginParams
.
setDepartment
(
departmentBo
);
reginParams
.
setCompany
(
companyBo
);
}
reginParams
.
setToken
(
amosToken
);
reginParams
.
setUserModel
(
userModel
);
redisTemplate
.
opsForValue
().
set
(
buildKey
(
userId
,
token
),
JSONObject
.
toJSONString
(
reginParams
),
28
,
TimeUnit
.
DAYS
);
// redisTemplate.opsForValue().set(buildKey(userId, amosToken), JSONObject.toJSONString(reginParams),28, TimeUnit.DAYS);
return
reginParams
;
}
private
DepartmentBo
convertDepartmentModelToBo
(
DepartmentModel
departmentModel
){
DepartmentBo
departmentBo
=
new
DepartmentBo
();
if
(
departmentModel
!=
null
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteSecurityService.java
View file @
9c3b5a5d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
feign
;
import
java.io.IOException
;
import
java.security.GeneralSecurityException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -13,7 +11,6 @@ import java.util.stream.Collectors;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.feign.privilege.util.PwdUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
...
@@ -37,6 +34,7 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.model.PermissionModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
...
...
@@ -45,39 +43,39 @@ public class RemoteSecurityService {
@Autowired
AmosRequestContext
amosRequestContext
;
@Value
(
"${amos.system.user.password}"
)
private
String
password
;
@Autowired
@Value
(
"${amos.system.user.password}"
)
private
String
password
;
@Autowired
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
//根据公司名称获取公司人
public
List
<
CompanyModel
>
listCompanyTree
(
String
toke
,
String
product
,
String
appKey
,
String
companyName
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
CompanyModel
>
userModel
=
null
;
FeignClientResult
feignClientResult
;
//根据公司名称获取公司人
public
List
<
CompanyModel
>
listCompanyTree
(
String
toke
,
String
product
,
String
appKey
,
String
companyName
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
CompanyModel
>
userModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
queryAgencyTree
(
companyName
);
userModel
=
(
List
<
CompanyModel
>)
feignClientResult
.
getResult
();
userModel
=
(
List
<
CompanyModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
userModel
;
}
//部门id获取部门信息
public
DepartmentModel
getDepartmentByDeptId
(
String
toke
,
String
product
,
String
appKey
,
String
deparmentId
)
{
if
(
deparmentId
==
null
||
deparmentId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
DepartmentModel
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
return
userModel
;
}
//部门id获取部门信息
public
DepartmentModel
getDepartmentByDeptId
(
String
toke
,
String
product
,
String
appKey
,
String
deparmentId
)
{
if
(
deparmentId
==
null
||
deparmentId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
DepartmentModel
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
departmentClient
.
seleteOne
(
Long
.
valueOf
(
deparmentId
));
departmentModel
=
(
DepartmentModel
)
feignClientResult
.
getResult
();
...
...
@@ -85,18 +83,18 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
departmentModel
;
}
//查询指定部门数
public
List
<
DepartmentModel
>
listDepartmentsByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
DepartmentModel
>
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
return
departmentModel
;
}
//查询指定部门数
public
List
<
DepartmentModel
>
listDepartmentsByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
DepartmentModel
>
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
departmentClient
.
queryDeptTree
(
null
,
Long
.
valueOf
(
companyId
));
departmentModel
=
(
List
<
DepartmentModel
>)
feignClientResult
.
getResult
();
...
...
@@ -104,19 +102,19 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
departmentModel
;
}
// * 根据公司id查询机构用户
public
List
<
AgencyUserModel
>
listUserByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
AgencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
return
departmentModel
;
}
// * 根据公司id查询机构用户
public
List
<
AgencyUserModel
>
listUserByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
AgencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByCompanyId
(
Long
.
valueOf
(
companyId
),
null
,
null
,
true
);
AgencyUserModel
=
(
List
<
AgencyUserModel
>)
feignClientResult
.
getResult
();
...
...
@@ -124,60 +122,54 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
AgencyUserModel
;
//CommonResponse commonResponse = iAmosSecurityServer.listUserByCompanyId(companyId);
//return handleArray(commonResponse, UserModel.class);
}
// * 根据公司RoleIds
public
List
<
AgencyUserModel
>
getUserByRoleIds
(
String
toke
,
String
product
,
String
appKey
,
String
RoleIds
)
{
if
(
RoleIds
==
null
||
RoleIds
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
RoleIds
,
null
,
null
);
agencyUserModel
=
(
List
<
AgencyUserModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
}
public
Toke
getServerToken
()
{
IdPasswordAuthModel
dPasswordAuthModel
=
new
IdPasswordAuthModel
();
dPasswordAuthModel
.
setLoginId
(
amosRequestContext
.
getUserName
());
return
AgencyUserModel
;
//CommonResponse commonResponse = iAmosSecurityServer.listUserByCompanyId(companyId);
//return handleArray(commonResponse, UserModel.class);
}
// * 根据公司RoleIds
public
List
<
AgencyUserModel
>
getUserByRoleIds
(
String
toke
,
String
product
,
String
appKey
,
String
RoleIds
)
{
if
(
RoleIds
==
null
||
RoleIds
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
dPasswordAuthModel
.
setPassword
(
PwdUtil
.
encode
(
password
)
);
}
catch
(
GeneralSecurityException
e
)
{
e
.
printStackTrace
();
}
catch
(
I
O
Exception
e
)
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
RoleIds
,
null
);
agencyUserModel
=
(
List
<
AgencyUserModel
>)
feignClientResult
.
getResult
();
}
catch
(
I
nnerInvok
Exception
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
}
public
Toke
getServerToken
()
{
IdPasswordAuthModel
dPasswordAuthModel
=
new
IdPasswordAuthModel
();
dPasswordAuthModel
.
setLoginId
(
amosRequestContext
.
getUserName
());
dPasswordAuthModel
.
setPassword
(
DesUtil
.
encode
(
password
,
"qaz"
));
Toke
toke
=
null
;
try
{
toke
=
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
amosRequestContext
.
getUserName
())),
Toke
.
class
);
if
(
ObjectUtils
.
isEmpty
(
toke
)){
toke
=
JSON
.
parseObject
(
redisTemplate
.
opsForValue
().
get
(
buildKey
(
amosRequestContext
.
getUserName
())),
Toke
.
class
);
if
(
ObjectUtils
.
isEmpty
(
toke
)){
toke
=
getLogin
(
dPasswordAuthModel
);
}
else
{
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
if
(!
TokenOperation
.
refresh
(
toke
.
getToke
()))
{
toke
=
getLogin
(
dPasswordAuthModel
);
}
}
}
else
{
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
if
(!
TokenOperation
.
refresh
(
toke
.
getToke
()))
{
toke
=
getLogin
(
dPasswordAuthModel
);
}
}
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
toke
;
}
return
toke
;
}
private
Toke
getLogin
(
IdPasswordAuthModel
dPasswordAuthModel
){
Toke
toke
=
new
Toke
();
RequestContext
.
setProduct
(
amosRequestContext
.
getProduct
());
...
...
@@ -187,8 +179,8 @@ public class RemoteSecurityService {
redisTemplate
.
opsForValue
().
set
(
buildKey
(
dPasswordAuthModel
.
getLoginId
()),
JSONObject
.
toJSONString
(
toke
),
28
,
TimeUnit
.
DAYS
);
return
toke
;
}
//redi缓存系统用户token信息
private
String
buildKey
(
String
username
)
{
return
"system_"
+
username
;
...
...
@@ -203,12 +195,12 @@ public class RemoteSecurityService {
* @param userIds
* @return
*/
public
List
<
AgencyUserModel
>
listUserByUserIds
(
String
toke
,
String
product
,
String
appKey
,
String
userIds
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
public
List
<
AgencyUserModel
>
listUserByUserIds
(
String
toke
,
String
product
,
String
appKey
,
String
userIds
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByIds
(
userIds
,
true
);
agencyUserModel
=
(
List
<
AgencyUserModel
>
)
feignClientResult
.
getResult
();
...
...
@@ -216,75 +208,75 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
}
/**
* 根据用户ids获取用户实体列表
* @param toke
* @param product
* @param appKey
* @param userIds
* @return
*/
public
Map
<
String
,
AgencyUserModel
>
getUsersMap
(
String
toke
,
String
product
,
String
appKey
,
Set
<
Object
>
userIds
){
List
<
AgencyUserModel
>
users
=
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
Map
<
String
,
AgencyUserModel
>
userMap
=
new
HashMap
<>();
if
(
users
!=
null
){
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
v
->
v
,
(
v1
,
v2
)
->
v1
));
}
return
userMap
;
}
/**
* 根据用户ids获取用户名称列表
* @param toke
* @param product
* @param appKey
* @param userIds
* @return
*/
public
Map
<
String
,
String
>
getUserRealName
(
String
toke
,
String
product
,
String
appKey
,
Set
<
Object
>
userIds
){
List
<
AgencyUserModel
>
users
=
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
Map
<
String
,
String
>
userMap
=
new
HashMap
<>();
if
(
users
!=
null
){
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
));
}
return
userMap
;
}
/**
* 根据部门ids获取部门名称
* @param toke
* @param product
* @param appKey
* @param depIds
* @return
*/
public
Map
<
Long
,
String
>
getDepName
(
String
toke
,
String
product
,
String
appKey
,
Set
<
Object
>
depIds
){
List
<
DepartmentModel
>
depts
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
depIds
)){
depts
=
this
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
depIds
));
}
Map
<
Long
,
String
>
deptMap
=
new
HashMap
<>();
if
(
depts
!=
null
){
deptMap
=
depts
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentModel:
:
getSequenceNbr
,
DepartmentModel:
:
getDepartmentName
));
}
return
agencyUserModel
;
}
/**
* 根据用户ids获取用户实体列表
* @param toke
* @param product
* @param appKey
* @param userIds
* @return
*/
public
Map
<
String
,
AgencyUserModel
>
getUsersMap
(
String
toke
,
String
product
,
String
appKey
,
Set
<
Object
>
userIds
){
List
<
AgencyUserModel
>
users
=
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
Map
<
String
,
AgencyUserModel
>
userMap
=
new
HashMap
<>();
if
(
users
!=
null
){
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
v
->
v
,
(
v1
,
v2
)
->
v1
));
}
return
userMap
;
}
/**
* 根据用户ids获取用户名称列表
* @param toke
* @param product
* @param appKey
* @param userIds
* @return
*/
public
Map
<
String
,
String
>
getUserRealName
(
String
toke
,
String
product
,
String
appKey
,
Set
<
Object
>
userIds
){
List
<
AgencyUserModel
>
users
=
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
Map
<
String
,
String
>
userMap
=
new
HashMap
<>();
if
(
users
!=
null
){
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
));
}
return
userMap
;
}
/**
* 根据部门ids获取部门名称
* @param toke
* @param product
* @param appKey
* @param depIds
* @return
*/
public
Map
<
Long
,
String
>
getDepName
(
String
toke
,
String
product
,
String
appKey
,
Set
<
Object
>
depIds
){
List
<
DepartmentModel
>
depts
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
depIds
)){
depts
=
this
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
depIds
));
}
Map
<
Long
,
String
>
deptMap
=
new
HashMap
<>();
if
(
depts
!=
null
){
deptMap
=
depts
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentModel:
:
getSequenceNbr
,
DepartmentModel:
:
getDepartmentName
));
}
return
deptMap
;
}
//用户id获取用户信息
public
AgencyUserModel
getUserById
(
String
toke
,
String
product
,
String
appKey
,
String
userId
)
{
if
(
userId
==
null
||
userId
.
equals
(
""
))
{
return
null
;
}
// CommonResponse commonResponse = iAmosSecurityServer.getUserById(userId);
// return handleObj(commonResponse, UserModel.class);
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
AgencyUserModel
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
}
//用户id获取用户信息
public
AgencyUserModel
getUserById
(
String
toke
,
String
product
,
String
appKey
,
String
userId
)
{
if
(
userId
==
null
||
userId
.
equals
(
""
))
{
return
null
;
}
// CommonResponse commonResponse = iAmosSecurityServer.getUserById(userId);
// return handleObj(commonResponse, UserModel.class);
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
AgencyUserModel
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByUserId
(
userId
);
agencyUserModel
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
...
...
@@ -292,8 +284,8 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
}
return
agencyUserModel
;
}
/**
* 根据orgCode查询机构用户
...
...
@@ -303,22 +295,22 @@ public class RemoteSecurityService {
* @param orgCode orgCode
* @return List<AgencyUserModel>
*/
public
List
<
AgencyUserModel
>
listUserByOrgCode
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
)
{
if
(
orgCode
==
null
||
orgCode
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
=
new
FeignClientResult
();
public
List
<
AgencyUserModel
>
listUserByOrgCode
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
)
{
if
(
orgCode
==
null
||
orgCode
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
=
new
FeignClientResult
();
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByOrgCode
(
orgCode
,
null
);
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
handleArray
(
feignClientResult
,
AgencyUserModel
.
class
);
}
return
handleArray
(
feignClientResult
,
AgencyUserModel
.
class
);
}
/**
* 根据orgCode查询机构
...
...
@@ -328,15 +320,15 @@ public class RemoteSecurityService {
* @param orgCode orgCode
* @return Map<String, Object>
*/
public
Map
<
String
,
Object
>
listByOrgCode
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
)
{
if
(
orgCode
==
null
||
orgCode
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
Map
<
String
,
Object
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
public
Map
<
String
,
Object
>
listByOrgCode
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
)
{
if
(
orgCode
==
null
||
orgCode
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
Map
<
String
,
Object
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
queryByOrgcode
(
orgCode
);
agencyUserModel
=
(
Map
<
String
,
Object
>)
feignClientResult
.
getResult
();
...
...
@@ -344,31 +336,31 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
}
// 根据部门id查询机构用户
public
List
<
AgencyUserModel
>
listUserByDepartmentId
(
String
toke
,
String
product
,
String
appKey
,
String
departmentId
)
{
if
(
departmentId
==
null
||
departmentId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
return
agencyUserModel
;
}
// 根据部门id查询机构用户
public
List
<
AgencyUserModel
>
listUserByDepartmentId
(
String
toke
,
String
product
,
String
appKey
,
String
departmentId
)
{
if
(
departmentId
==
null
||
departmentId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByDepartmentId
(
Long
.
valueOf
(
departmentId
),
null
,
null
,
true
);
agencyUserModel
=
(
List
<
AgencyUserModel
>)
feignClientResult
.
getResult
();
...
...
@@ -376,26 +368,26 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
}
/**
* 获取子公司信息树结构
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/
public
List
<
CompanyModel
>
getCompanyTreeByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
CompanyModel
>
companyModel
=
null
;
FeignClientResult
feignClientResult
;
return
agencyUserModel
;
}
/**
* 获取子公司信息树结构
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/
public
List
<
CompanyModel
>
getCompanyTreeByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
CompanyModel
>
companyModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
querySubAgencyTree
(
Long
.
valueOf
(
companyId
));
companyModel
=
(
List
<
CompanyModel
>)
feignClientResult
.
getResult
();
...
...
@@ -403,26 +395,26 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
companyModel
;
}
/**
* 查询指定公司的部门树
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/
public
List
<
DepartmentModel
>
getDepartmentTreeByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
DepartmentModel
>
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
return
companyModel
;
}
/**
* 查询指定公司的部门树
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/
public
List
<
DepartmentModel
>
getDepartmentTreeByCompanyId
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
DepartmentModel
>
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
departmentClient
.
queryDeptTree
(
null
,
Long
.
valueOf
(
companyId
));
departmentModel
=
(
List
<
DepartmentModel
>)
feignClientResult
.
getResult
();
...
...
@@ -430,10 +422,10 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
departmentModel
;
// CommonResponse commonResponse = iAmosSecurityServer.getDepartmentTreeByCompanyId(companyId);
// return handleArray(commonResponse, DepartmentBo.class);
}
return
departmentModel
;
// CommonResponse commonResponse = iAmosSecurityServer.getDepartmentTreeByCompanyId(companyId);
// return handleArray(commonResponse, DepartmentBo.class);
}
/**
* 根据id批量获取部门信息
...
...
@@ -443,44 +435,44 @@ public class RemoteSecurityService {
* @param "200".equals(feignClientResult.getStatus())departmentIds 部门ids
* @return List<DepartmentModel>
*/
public
List
<
DepartmentModel
>
listDepartmentByDeptIds
(
String
toke
,
String
product
,
String
appKey
,
String
departmentIds
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
FeignClientResult
feignClientResult
=
new
FeignClientResult
();
public
List
<
DepartmentModel
>
listDepartmentByDeptIds
(
String
toke
,
String
product
,
String
appKey
,
String
departmentIds
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
FeignClientResult
feignClientResult
=
new
FeignClientResult
();
try
{
feignClientResult
=
Privilege
.
departmentClient
.
queryDeptByIds
(
departmentIds
);
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
handleArray
(
feignClientResult
,
DepartmentModel
.
class
);
}
return
handleArray
(
feignClientResult
,
DepartmentModel
.
class
);
}
private
<
T
>
List
<
T
>
handleArray
(
FeignClientResult
feignClientResult
,
Class
<
T
>
t
)
{
List
<
T
>
list
=
new
ArrayList
<>();
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getStatus
()
==
200
)
{
String
jsonStr
=
JSON
.
toJSONString
(
feignClientResult
.
getResult
());
private
<
T
>
List
<
T
>
handleArray
(
FeignClientResult
feignClientResult
,
Class
<
T
>
t
)
{
List
<
T
>
list
=
new
ArrayList
<>();
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getStatus
()
==
200
)
{
String
jsonStr
=
JSON
.
toJSONString
(
feignClientResult
.
getResult
());
list
=
JSONArray
.
parseArray
(
jsonStr
,
t
);
}
return
list
;
}
private
<
T
>
T
handleObj
(
CommonResponse
commonResponse
,
Class
<
T
>
t
)
{
if
(
commonResponse
!=
null
&&
commonResponse
.
isSuccess
())
{
String
jsonStr
=
JSON
.
toJSONString
(
commonResponse
.
getDataList
());
return
JSONObject
.
parseObject
(
jsonStr
,
t
);
}
return
null
;
}
/**
* 基础平台全部菜单权限树,用于平台登录前端初始化路由
*/
public
CommonResponse
searchPermissionTree
(
String
toke
,
String
product
,
String
appKey
,
String
appType
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
PermissionModel
>
dictionarieModel
=
null
;
FeignClientResult
feignClientResult
;
}
return
list
;
}
private
<
T
>
T
handleObj
(
CommonResponse
commonResponse
,
Class
<
T
>
t
)
{
if
(
commonResponse
!=
null
&&
commonResponse
.
isSuccess
())
{
String
jsonStr
=
JSON
.
toJSONString
(
commonResponse
.
getDataList
());
return
JSONObject
.
parseObject
(
jsonStr
,
t
);
}
return
null
;
}
/**
* 基础平台全部菜单权限树,用于平台登录前端初始化路由
*/
public
CommonResponse
searchPermissionTree
(
String
toke
,
String
product
,
String
appKey
,
String
appType
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
PermissionModel
>
dictionarieModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
permissionClient
.
queryPermissionTree
(
appType
,
null
,
null
,
null
,
appKey
);
dictionarieModel
=
(
List
<
PermissionModel
>)
feignClientResult
.
getResult
();
...
...
@@ -488,23 +480,23 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
CommonResponse
commonResponse
=
new
CommonResponse
(
"SUCCESS"
,
dictionarieModel
);
return
commonResponse
;
}
/**
* 根据Code查询指定的字典信息.
* @param toke
* @param product
* @param appKey
* @param dictCode
* @return
*/
public
JSONArray
listDictionaryByDictCode
(
String
toke
,
String
product
,
String
appKey
,
String
dictCode
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
DictionarieValueModel
>
dictionarieModel
=
null
;
FeignClientResult
feignClientResult
;
CommonResponse
commonResponse
=
new
CommonResponse
(
"SUCCESS"
,
dictionarieModel
);
return
commonResponse
;
}
/**
* 根据Code查询指定的字典信息.
* @param toke
* @param product
* @param appKey
* @param dictCode
* @return
*/
public
JSONArray
listDictionaryByDictCode
(
String
toke
,
String
product
,
String
appKey
,
String
dictCode
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
DictionarieValueModel
>
dictionarieModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Systemctl
.
dictionarieClient
.
dictValues
(
dictCode
);
dictionarieModel
=
(
List
<
DictionarieValueModel
>)
feignClientResult
.
getResult
();
...
...
@@ -513,29 +505,29 @@ public class RemoteSecurityService {
e
.
printStackTrace
();
}
if
(
dictionarieModel
!=
null
)
{
String
jsonStr
=
JSON
.
toJSONString
(
dictionarieModel
);
return
JSONArray
.
parseArray
(
jsonStr
);
}
return
null
;
}
/**
* 查询指定公司信息与其部门用户树
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/
public
CompanyModel
listUserByCompanyId1
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
String
jsonStr
=
JSON
.
toJSONString
(
dictionarieModel
);
return
JSONArray
.
parseArray
(
jsonStr
);
}
return
null
;
}
/**
* 查询指定公司信息与其部门用户树
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/
public
CompanyModel
listUserByCompanyId1
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
if
(
companyId
==
null
||
companyId
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
CompanyModel
companyModel
=
null
;
FeignClientResult
feignClientResult
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
withDeptAndUsers
(
Long
.
valueOf
(
companyId
));
companyModel
=
(
CompanyModel
)
feignClientResult
.
getResult
();
...
...
@@ -543,34 +535,34 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
companyModel
;
}
return
companyModel
;
}
public
boolean
loginOutFromApp
(
String
toke
,
String
product
,
String
appKey
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
boolean
flag
=
false
;
FeignClientResult
feignClientResult
;
public
boolean
loginOutFromApp
(
String
toke
,
String
product
,
String
appKey
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
boolean
flag
=
false
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
authClient
.
removeToken
();
flag
=
true
;
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
public
JSONArray
listDepartmentUserTree
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
CompanyModel
companyModel
=
null
;
FeignClientResult
feignClientResult
;
return
flag
;
}
public
JSONArray
listDepartmentUserTree
(
String
toke
,
String
product
,
String
appKey
,
String
companyId
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
CompanyModel
companyModel
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
companyClient
.
withDeptAndUsers
(
Long
.
valueOf
(
companyId
));
companyModel
=
(
CompanyModel
)
feignClientResult
.
getResult
();
...
...
@@ -578,29 +570,29 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
if
(
companyModel
!=
null
)
{
String
jsonStr
=
null
;
jsonStr
=
JSON
.
toJSONString
(
companyModel
.
getChildren
());
return
JSONArray
.
parseArray
(
jsonStr
);
}
return
null
;
}
public
boolean
editPassword
(
String
toke
,
String
product
,
String
appKey
,
String
userId
,
String
oldPassword
,
String
newPassword
)
{
boolean
flag
=
false
;
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
agencyUserModel
.
setPassword
(
oldPassword
);
agencyUserModel
.
setRePassword
(
newPassword
);
agencyUserModel
.
setOriginalPassword
(
newPassword
);
AgencyUserModel
agencyUserModel2
=
null
;
FeignClientResult
feignClientResult
;
jsonStr
=
JSON
.
toJSONString
(
companyModel
.
getChildren
());
return
JSONArray
.
parseArray
(
jsonStr
);
}
return
null
;
}
public
boolean
editPassword
(
String
toke
,
String
product
,
String
appKey
,
String
userId
,
String
oldPassword
,
String
newPassword
)
{
boolean
flag
=
false
;
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
agencyUserModel
.
setPassword
(
oldPassword
);
agencyUserModel
.
setRePassword
(
newPassword
);
agencyUserModel
.
setOriginalPassword
(
newPassword
);
AgencyUserModel
agencyUserModel2
=
null
;
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
modifyPassword
(
userId
,
agencyUserModel
);
...
...
@@ -609,11 +601,11 @@ public class RemoteSecurityService {
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
if
(
agencyUserModel2
!=
null
){
flag
=
true
;
}
return
false
;
}
if
(
agencyUserModel2
!=
null
){
flag
=
true
;
}
return
false
;
}
}
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