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
251780d2
Commit
251780d2
authored
May 06, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
场站管理场站所属片区与左侧树联动
parent
dbc9b31a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
20 deletions
+39
-20
PrivilegeController.java
...boot/module/jxiop/biz/controller/PrivilegeController.java
+39
-20
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PrivilegeController.java
View file @
251780d2
...
@@ -59,30 +59,49 @@ public class PrivilegeController extends BaseController{
...
@@ -59,30 +59,49 @@ public class PrivilegeController extends BaseController{
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/subcompany"
)
@GetMapping
(
value
=
"/subcompany"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单位、子单位"
,
notes
=
"查询单位、子单位"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单位、子单位"
,
notes
=
"查询单位、子单位"
)
public
ResponseModel
<
List
<
ListCompanyModel
>>
subcompany
()
{
public
ResponseModel
<
Collection
<
CompanyModel
>>
subcompany
(
String
orgCode
)
{
//获取当前登录人单位
Long
companyId
=
null
;
if
(
orgCode
!=
null
){
LinkedHashMap
<
Object
,
Object
>
l
=
(
LinkedHashMap
<
Object
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
orgCode
).
getResult
();
for
(
Map
.
Entry
<
Object
,
Object
>
it
:
l
.
entrySet
())
{
CompanyModel
companyModel
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
it
.
getValue
()),
CompanyModel
.
class
);
if
(
companyModel
!=
null
)
{
companyId
=
companyModel
.
getSequenceNbr
();
}
break
;
}
}
else
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
Long
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
List
<
ListCompanyModel
>
date
=
new
ArrayList
();
}
if
(
"area"
.
equals
(
reginParams
.
getCompany
().
getLevel
())){
//获取当前登录人单位
ListCompanyModel
companyModel
=
new
ListCompanyModel
();
List
<
ListCompanyModel
>
data
=
new
ArrayList
();
companyModel
.
setSequenceNbr
(
companyId
);
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
companyModel
.
setCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
FeignClientResult
<
CompanyModel
>
dat
=
Privilege
.
companyClient
.
seleteOne
(
companyId
);
date
.
add
(
companyModel
);
CompanyModel
companyModel
=
dat
.
getResult
();
}
else
if
(
"headquarter"
.
equals
(
reginParams
.
getCompany
().
getLevel
())){
List
<
CompanyModel
>
list
=
new
ArrayList
<>();
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
//如果是公司则获取所有片区
Collection
<
CompanyModel
>
dated
=
de
.
getResult
();
if
(
companyModel
.
getLevel
().
equals
(
"headquarter"
)){
Collection
<
CompanyModel
>
companyModelList
=
de
.
getResult
();
for
(
CompanyModel
companyModel
:
dated
)
{
companyModelList
.
parallelStream
().
forEach
((
companyModel1
)->{
companyModel1
.
setChildren
(
new
ArrayList
());});
if
(
"area"
.
equals
(
companyModel
.
getLevel
())){
return
ResponseHelper
.
buildResponse
(
companyModelList
);
ListCompanyModel
companyModeld
=
new
ListCompanyModel
();
companyModeld
.
setSequenceNbr
(
companyModel
.
getSequenceNbr
());
companyModeld
.
setCompanyName
(
companyModel
.
getCompanyName
());
date
.
add
(
companyModeld
);
}
}
//如果是片区则获取片区
if
(
companyModel
.
getLevel
().
equals
(
"area"
)){
list
.
add
(
companyModel
);
return
ResponseHelper
.
buildResponse
(
list
);
}
}
//如果是场站获取片区
if
(
companyModel
.
getLevel
().
equals
(
"station"
)){
FeignClientResult
<
CompanyModel
>
areaInfo
=
Privilege
.
companyClient
.
seleteOne
(
companyModel
.
getParentId
());
list
.
add
(
areaInfo
.
getResult
());
}
}
return
ResponseHelper
.
buildResponse
(
date
);
return
ResponseHelper
.
buildResponse
(
list
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
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