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
ec2d306a
Commit
ec2d306a
authored
May 04, 2023
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增接口获取所属场站
parent
f2c9e943
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
PrivilegeController.java
...boot/module/jxiop/biz/controller/PrivilegeController.java
+29
-2
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 @
ec2d306a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.CompanyTreeDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.ListCompanyModel
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.ListCompanyModel
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
@@ -27,6 +29,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
...
@@ -27,6 +29,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* @description:
* @description:
...
@@ -84,7 +87,31 @@ public class PrivilegeController extends BaseController{
...
@@ -84,7 +87,31 @@ public class PrivilegeController extends BaseController{
return
ResponseHelper
.
buildResponse
(
date
);
return
ResponseHelper
.
buildResponse
(
date
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/stationTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询所属场站"
,
notes
=
"查询所属场站"
)
public
ResponseModel
<
List
<
ListCompanyModel
>>
stationTree
()
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
Long
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
List
<
ListCompanyModel
>
data
=
new
ArrayList
();
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
Collection
<
CompanyModel
>
datas
=
de
.
getResult
();
for
(
CompanyModel
companyModel
:
datas
)
{
if
(
"area"
.
equals
(
companyModel
.
getLevel
()))
{
ListCompanyModel
companyModeld
=
new
ListCompanyModel
();
companyModeld
.
setSequenceNbr
(
companyModel
.
getSequenceNbr
());
companyModeld
.
setCompanyName
(
companyModel
.
getCompanyName
());
companyModeld
.
setDisabled
(
true
);
data
.
add
(
companyModeld
);
}
else
{
ListCompanyModel
companyModeld
=
new
ListCompanyModel
();
companyModeld
.
setSequenceNbr
(
companyModel
.
getSequenceNbr
());
companyModeld
.
setCompanyName
(
companyModel
.
getCompanyName
());
companyModeld
.
setChildren
(
companyModel
.
getChildren
());
data
.
add
(
companyModeld
);
}
}
return
ResponseHelper
.
buildResponse
(
data
);
}
}
}
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