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
0f342294
Commit
0f342294
authored
Jul 07, 2021
by
taabe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加根据所属单位查询其下消防队伍树接口
parent
601734d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
FireTeamController.java
...os/boot/module/jcs/biz/controller/FireTeamController.java
+19
-4
FireTeamServiceImpl.java
...boot/module/jcs/biz/service/impl/FireTeamServiceImpl.java
+16
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/FireTeamController.java
View file @
0f342294
...
...
@@ -119,7 +119,7 @@ public class FireTeamController extends BaseController {
/**
*
列表分页
查询
*
消防队伍树
查询
*
* @return
* @throws Exception
...
...
@@ -130,9 +130,24 @@ public class FireTeamController extends BaseController {
public
ResponseModel
<
List
<
Menu
>>
listTree
()
throws
Exception
{
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
columnMap
.
put
(
"is_delete"
,
0
);
Collection
<
FireTeam
>
list
=
iFireTeamService
.
listByMap
(
columnMap
);
List
<
Menu
>
menus
=
TreeParser
.
getTree
(
null
,
list
,
FireTeam
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
);
List
<
Menu
>
menus
=
iFireTeamService
.
getTeamTree
(
columnMap
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
* 查询所属单位下消防队伍树
*
* @return
* @throws Exception
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{companyId}/listTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"队伍树"
,
notes
=
"队伍树"
)
public
ResponseModel
<
List
<
Menu
>>
listTreeByCompanyId
(
@PathVariable
(
value
=
"companyId"
)
String
companyId
)
throws
Exception
{
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
columnMap
.
put
(
"is_delete"
,
0
);
columnMap
.
put
(
"company"
,
companyId
);
List
<
Menu
>
menus
=
iFireTeamService
.
getTeamTree
(
columnMap
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/FireTeamServiceImpl.java
View file @
0f342294
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.utils.Menu
;
import
com.yeejoin.amos.boot.biz.common.utils.TreeParser
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireTeamCardDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto
;
...
...
@@ -18,6 +20,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -80,4 +83,17 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
public
List
<
FireTeamDto
>
queryFireTeamForList
(
Boolean
isDelete
)
{
return
fireTeamMapper
.
listFireTeamDto
(
isDelete
);
}
/**
* 根据列表构造队伍树
*
* @param columnMap 查询列表条件
* @return 队伍树
* @throws Exception
*/
public
List
<
Menu
>
getTeamTree
(
Map
<
String
,
Object
>
columnMap
)
throws
Exception
{
Collection
<
FireTeam
>
list
=
this
.
listByMap
(
columnMap
);
return
TreeParser
.
getTree
(
null
,
list
,
FireTeam
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
);
}
}
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