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
49a7af83
Commit
49a7af83
authored
Jul 07, 2021
by
taabe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
机场单位-消防队伍树接口添加
parent
ded7f8a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
10 deletions
+70
-10
FireTeamController.java
...os/boot/module/jcs/biz/controller/FireTeamController.java
+27
-10
FireTeamServiceImpl.java
...boot/module/jcs/biz/service/impl/FireTeamServiceImpl.java
+43
-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 @
49a7af83
...
...
@@ -6,30 +6,32 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.Menu
;
import
com.yeejoin.amos.boot.biz.common.utils.MenuFrom
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.TreeParser
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireTeamCardDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 消防队伍
...
...
@@ -142,7 +144,7 @@ public class FireTeamController extends BaseController {
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{companyId}/listTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
队伍树"
,
notes
=
"
队伍树"
)
@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
);
...
...
@@ -198,4 +200,18 @@ public class FireTeamController extends BaseController {
page
=
iFireTeamService
.
page
(
pageBean
,
fireTeamQueryWrapper
);
return
page
;
}
/**
* 查询机场单位-消防队伍树
*
* @return
* @throws Exception
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/company/listTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询机场单位-消防队伍树"
,
notes
=
"查询机场单位-消防队伍树"
)
public
ResponseModel
<
List
<
MenuFrom
>>
listCompanyTree
()
throws
Exception
{
List
<
MenuFrom
>
menus
=
iFireTeamService
.
getCompanyTeamTree
();
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
\ No newline at end of file
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 @
49a7af83
...
...
@@ -2,16 +2,21 @@ 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.Lists
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.utils.Menu
;
import
com.yeejoin.amos.boot.biz.common.utils.MenuFrom
;
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
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IFireTeamService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.feign.EquipFeignClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -24,6 +29,7 @@ import java.util.Collection;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* 消防队伍 服务实现类
...
...
@@ -40,6 +46,9 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
@Autowired
EquipFeignClient
equipFeignClient
;
@Autowired
OrgUsrServiceImpl
orgUsrService
;
/**
* 获取监控大队列表
*
...
...
@@ -96,4 +105,38 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
return
TreeParser
.
getTree
(
null
,
list
,
FireTeam
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
);
}
/**
* 获取机场单位-队伍树
*
* @return
*/
public
List
<
MenuFrom
>
getCompanyTeamTree
()
throws
Exception
{
MenuFrom
root
=
new
MenuFrom
(
"-1"
,
"消防队伍"
,
null
);
// 机场单位
List
<
OrgUsr
>
companyDeptList
=
orgUsrService
.
selectCompanyDepartmentMsg
();
List
<
MenuFrom
>
companyDeptMenuList
=
Lists
.
newArrayList
();
companyDeptList
.
forEach
(
o
->
{
if
(
ValidationUtil
.
isEmpty
(
o
.
getParentId
()))
{
o
.
setParentId
(
"-1"
);
}
companyDeptMenuList
.
add
(
new
MenuFrom
(
o
.
getSequenceNbr
().
toString
(),
o
.
getBizOrgName
(),
o
.
getParentId
()));
});
// 消防队伍
List
<
MenuFrom
>
teamMenuList
=
Lists
.
newArrayList
();
List
<
FireTeamDto
>
teamList
=
this
.
queryFireTeamForList
(
false
);
teamList
.
forEach
(
team
->
{
if
(
ValidationUtil
.
isEmpty
(
team
.
getParent
()))
{
// 将单位下没有上级队伍的队伍直接挂在单位下(方便组成树结构)
team
.
setParent
(
team
.
getCompany
());
}
teamMenuList
.
add
(
new
MenuFrom
(
team
.
getSequenceNbr
().
toString
(),
team
.
getName
(),
team
.
getParent
().
toString
()));
});
companyDeptMenuList
.
addAll
(
teamMenuList
);
List
<
MenuFrom
>
menuList
=
TreeParser
.
getTreexin
(
"-1"
,
companyDeptMenuList
,
MenuFrom
.
class
.
getName
(),
"getKey"
,
1
,
"getName"
,
"getParentId"
);
root
.
setChildren
(
menuList
);
return
Lists
.
newArrayList
(
root
);
}
}
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