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
2e23c0a5
Commit
2e23c0a5
authored
Feb 10, 2022
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_ccs' of 172.16.10.76:moa/amos-boot-biz into develop_ccs
parents
77c46594
6a70aff4
Hide whitespace changes
Inline
Side-by-side
Showing
49 changed files
with
1251 additions
and
664 deletions
+1251
-664
PermissionInterceptor.java
...s/boot/biz/common/interceptors/PermissionInterceptor.java
+15
-24
MyBatisPlusConfig.java
...a/com/yeejoin/amos/boot/biz/config/MyBatisPlusConfig.java
+1
-1
FireStationDto.java
...ejoin/amos/boot/module/common/api/dto/FireStationDto.java
+7
-3
KeySiteDto.java
...m/yeejoin/amos/boot/module/common/api/dto/KeySiteDto.java
+3
-0
KeySiteExcleDto.java
...join/amos/boot/module/common/api/dto/KeySiteExcleDto.java
+1
-1
FireStation.java
...ejoin/amos/boot/module/common/api/entity/FireStation.java
+3
-0
KeySite.java
...m/yeejoin/amos/boot/module/common/api/entity/KeySite.java
+7
-1
EquipFeignClient.java
...n/amos/boot/module/common/api/feign/EquipFeignClient.java
+8
-1
FireStationMapper.java
...amos/boot/module/common/api/mapper/FireStationMapper.java
+6
-2
KeySiteMapper.java
...oin/amos/boot/module/common/api/mapper/KeySiteMapper.java
+11
-4
OrgUsrMapper.java
...join/amos/boot/module/common/api/mapper/OrgUsrMapper.java
+2
-0
IKeySiteService.java
.../amos/boot/module/common/api/service/IKeySiteService.java
+9
-2
FireStationMapper.xml
...ommon-api/src/main/resources/mapper/FireStationMapper.xml
+66
-46
KeySiteMapper.xml
...le-common-api/src/main/resources/mapper/KeySiteMapper.xml
+120
-87
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+12
-1
VideoSource.java
...va/com/yeejoin/equipmanage/common/entity/VideoSource.java
+3
-0
BuildingTreeVo.java
...ava/com/yeejoin/equipmanage/common/vo/BuildingTreeVo.java
+0
-6
FireStationController.java
...t/module/common/biz/controller/FireStationController.java
+9
-0
FireTeamController.java
...boot/module/common/biz/controller/FireTeamController.java
+22
-0
KeySiteController.java
.../boot/module/common/biz/controller/KeySiteController.java
+224
-178
OrgPersonController.java
...oot/module/common/biz/controller/OrgPersonController.java
+0
-5
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+20
-1
FireStationServiceImpl.java
...odule/common/biz/service/impl/FireStationServiceImpl.java
+121
-2
FireTeamServiceImpl.java
...t/module/common/biz/service/impl/FireTeamServiceImpl.java
+5
-0
KeySiteServiceImpl.java
...ot/module/common/biz/service/impl/KeySiteServiceImpl.java
+227
-58
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+14
-0
BuildingController.java
...om/yeejoin/equipmanage/controller/BuildingController.java
+15
-1
BuildingVideoController.java
...ejoin/equipmanage/controller/BuildingVideoController.java
+2
-2
JcsFeign.java
...src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
+2
-2
VideoMapper.java
...main/java/com/yeejoin/equipmanage/mapper/VideoMapper.java
+2
-0
IBuilldService.java
.../java/com/yeejoin/equipmanage/service/IBuilldService.java
+8
-0
AreaServiceImpl.java
...com/yeejoin/equipmanage/service/impl/AreaServiceImpl.java
+1
-1
BuildingServiceImpl.java
...yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
+104
-152
CarServiceImpl.java
.../com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
+1
-3
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+4
-4
VideoServiceImpl.java
...om/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
+10
-4
WarehouseStructureServiceImpl.java
...uipmanage/service/impl/WarehouseStructureServiceImpl.java
+1
-1
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+17
-1
JCSFeignClient.java
...ejoin/amos/supervision/business/feign/JCSFeignClient.java
+9
-0
PlanTaskServiceImpl.java
...upervision/business/service/impl/PlanTaskServiceImpl.java
+47
-4
PointServiceImpl.java
...s/supervision/business/service/impl/PointServiceImpl.java
+3
-3
RulePlanService.java
...os/supervision/business/service/impl/RulePlanService.java
+11
-33
wl-3.0.1.xml
...ot-system-equip/src/main/resources/changelog/wl-3.0.1.xml
+43
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+10
-10
FormInstanceMapper.xml
...em-equip/src/main/resources/mapper/FormInstanceMapper.xml
+1
-1
VideoMapper.xml
...ot-system-equip/src/main/resources/mapper/VideoMapper.xml
+6
-2
jcs-1.0.0.0.xml
...ystem-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
+23
-3
application-dev.properties
...supervision/src/main/resources/application-dev.properties
+10
-9
dbTemplate_check.xml
...rvision/src/main/resources/db/mapper/dbTemplate_check.xml
+5
-5
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/interceptors/PermissionInterceptor.java
View file @
2e23c0a5
...
...
@@ -79,26 +79,13 @@ public class PermissionInterceptor implements Interceptor {
if
(!
ValidationUtil
.
isEmpty
(
dataAuth
)){
dataAuthRule
=
!
ValidationUtil
.
isEmpty
(
dataAuthRule
)
?
dataAuthRule
:
dataAuth
.
interfacePath
();
}
// 数据权限地址为空返回空数据
if
(
ValidationUtil
.
isEmpty
(
dataAuthRule
)){
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext
.
clean
();
return
method
.
getReturnType
().
isPrimitive
()
?
invocation
.
proceed
()
:
null
;
}
ReginParams
reginParam
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
()
,
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ValidationUtil
.
isEmpty
(
reginParam
)
||
ValidationUtil
.
isEmpty
(
reginParam
.
getUserModel
()))
{
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext
.
clean
();
return
method
.
getReturnType
().
isPrimitive
()
?
invocation
.
proceed
()
:
null
;
}
// 用户数据权限配置信息
Map
<
String
,
List
<
PermissionDataruleModel
>>
dataAuthorization
=
Privilege
.
permissionDataruleClient
.
queryByUser
(
reginParam
.
getUserModel
().
getUserId
(),
dataAuthRule
).
getResult
();
// 没有数据权限直接返回空数据
if
(
ValidationUtil
.
isEmpty
(
dataAuthorization
))
{
PermissionInterceptorContext
.
clean
();
return
method
.
getReturnType
().
isPrimitive
()
?
invocation
.
proceed
()
:
null
;
Map
<
String
,
List
<
PermissionDataruleModel
>>
dataAuthorization
=
null
;
if
(!
ValidationUtil
.
isEmpty
(
reginParam
)
&&
!
ValidationUtil
.
isEmpty
(
reginParam
.
getUserModel
()))
{
dataAuthorization
=
Privilege
.
permissionDataruleClient
.
queryByUser
(
reginParam
.
getUserModel
().
getUserId
(),
dataAuthRule
).
getResult
();
}
BoundSql
boundSql
=
(
BoundSql
)
metaObject
.
getValue
(
"delegate.boundSql"
);
...
...
@@ -194,15 +181,19 @@ public class PermissionInterceptor implements Interceptor {
mainTable
:
selectBody
.
getFromItem
().
getAlias
().
getName
();
String
authSql
;
// 过滤没有配置数据权限的用户组
Map
<
String
,
List
<
PermissionDataruleModel
>>
nonEmptyDataAuthorization
=
dataAuthorization
.
entrySet
().
stream
().
filter
(
map
->
!
ValidationUtil
.
isEmpty
(
map
.
getValue
())).
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
));
// 没有配置数据权限直接返回 false 条件
if
(
ValidationUtil
.
isEmpty
(
nonEmptyDataAuthorization
))
{
if
(
ValidationUtil
.
isEmpty
(
dataAuthorization
))
{
authSql
=
falseCondition
;
}
else
{
// 解析数据权限sql
authSql
=
parseDataAuthorization
(
nonEmptyDataAuthorization
,
reginParams
,
mainTableAlias
,
boundSql
);
// 过滤没有配置数据权限的用户组
Map
<
String
,
List
<
PermissionDataruleModel
>>
nonEmptyDataAuthorization
=
dataAuthorization
.
entrySet
().
stream
().
filter
(
map
->
!
ValidationUtil
.
isEmpty
(
map
.
getValue
())).
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
));
// 没有配置数据权限直接返回 false 条件
if
(
ValidationUtil
.
isEmpty
(
nonEmptyDataAuthorization
))
{
authSql
=
falseCondition
;
}
else
{
// 解析数据权限sql
authSql
=
parseDataAuthorization
(
nonEmptyDataAuthorization
,
reginParams
,
mainTableAlias
,
boundSql
);
}
}
// 替换数据权限
if
(!
ValidationUtil
.
isEmpty
(
authSql
))
{
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/config/MyBatisPlusConfig.java
View file @
2e23c0a5
...
...
@@ -58,7 +58,7 @@ public class MyBatisPlusConfig {
};
}
@ConditionalOnProperty
(
name
=
"mybatis.interceptor.enabled"
,
havingValue
=
"true"
)
@ConditionalOnProperty
(
name
=
"mybatis.interceptor.enabled"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
@Bean
public
PermissionInterceptor
permissionInterceptor
()
{
return
new
PermissionInterceptor
();
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/FireStationDto.java
View file @
2e23c0a5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
java.util.Date
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint
;
import
com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 微型消防站
*
...
...
@@ -38,6 +39,9 @@ public class FireStationDto extends BaseDto {
@ExcelProperty
(
value
=
"所在建筑"
,
index
=
1
)
@ApiModelProperty
(
value
=
"所在建筑物名称"
)
private
String
whereBuilding
;
@ExcelIgnore
private
String
parentBuildingId
;
@ExcelProperty
(
value
=
"地址"
,
index
=
2
)
@ApiModelProperty
(
value
=
"地址"
)
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/KeySiteDto.java
View file @
2e23c0a5
...
...
@@ -37,6 +37,9 @@ public class KeySiteDto extends BaseDto implements Serializable{
@ApiModelProperty
(
value
=
"所属建筑id"
)
private
Long
buildingId
;
@ApiModelProperty
(
"当前所在建筑物id的所有父节点id"
)
private
String
parentBuildingId
;
@ApiModelProperty
(
value
=
"所属建筑名称"
)
private
String
buildingName
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/KeySiteExcleDto.java
View file @
2e23c0a5
...
...
@@ -29,7 +29,7 @@ public class KeySiteExcleDto implements Serializable {
private
String
name
;
@ExcelProperty
(
value
=
"所属单位/部门id"
,
index
=
1
)
@ExplicitConstraint
(
indexNum
=
1
,
sourceClass
=
CommonExplicitConstraint
.
class
,
method
=
"get
k
eySiteCompanyDetailTree"
)
//固定下拉内容
@ExplicitConstraint
(
indexNum
=
1
,
sourceClass
=
CommonExplicitConstraint
.
class
,
method
=
"get
K
eySiteCompanyDetailTree"
)
//固定下拉内容
@ApiModelProperty
(
value
=
"所属单位/部门id"
)
private
String
belongName
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FireStation.java
View file @
2e23c0a5
...
...
@@ -37,6 +37,9 @@ public class FireStation extends BaseEntity {
@ApiModelProperty
(
value
=
"所在建筑物名称"
)
private
String
whereBuilding
;
@ApiModelProperty
(
"当前所在建筑物id的所有父节点id"
)
private
String
parentBuildingId
;
@ApiModelProperty
(
value
=
"装备简要情况"
)
private
String
equipmentBrief
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/KeySite.java
View file @
2e23c0a5
...
...
@@ -33,7 +33,7 @@ public class KeySite extends BaseEntity {
*/
@TableField
(
"belong_id"
)
private
Long
belongId
;
/**
* 所属单位/部门名称
...
...
@@ -46,6 +46,12 @@ public class KeySite extends BaseEntity {
@TableField
(
"building_id"
)
private
Long
buildingId
;
/**
* 所属父节点的建筑id集合
*/
@TableField
(
"parent_building_id"
)
private
String
parentBuildingId
;
@TableField
(
"building_name"
)
private
String
buildingName
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/feign/EquipFeignClient.java
View file @
2e23c0a5
...
...
@@ -4,8 +4,8 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.PerfQuotaIotDTO
;
...
...
@@ -367,4 +368,10 @@ public interface EquipFeignClient {
//获取消防装备权限
@RequestMapping
(
value
=
"/equipment-detail/permissions/export"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
ReginParams
>
getPermissions
()
;
@RequestMapping
(
value
=
"/building/getBuildingList"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getBuildingTreeList
();
@RequestMapping
(
value
=
"/building/companyBuildingTree"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
<
Object
>
getCompanyBuildingTree
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/FireStationMapper.java
View file @
2e23c0a5
...
...
@@ -29,9 +29,10 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+
"<if test='par.bizCompanyCode!=null'> and a.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+
"<if test='par.address!=null'> and a.address like CONCAT('',#{par.address},'%') </if>"
+
"<if test='par.bizOrgCode != null'> and a.biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>"
+
"<if test='nodeIds != null' > AND where_building_id in <foreach collection='nodeIds' item='buildingId' open='(' close=')' separator=','> #{buildingId} </foreach></if>"
+
" order by a.rec_date desc limit #{pageNum},#{pageSize}"
+
"</script>"
)
List
<
FireStationDto
>
getFireStation
(
@Param
(
"pageNum"
)
int
pageNum
,
@Param
(
"pageSize"
)
int
pageSize
,
@Param
(
"par"
)
FireStationDto
par
);
List
<
FireStationDto
>
getFireStation
(
@Param
(
"pageNum"
)
int
pageNum
,
@Param
(
"pageSize"
)
int
pageSize
,
@Param
(
"par"
)
FireStationDto
par
,
List
<
String
>
nodeIds
);
@Select
(
"<script>"
+
"select COUNT(cb_fire_station.sequence_nbr) num from cb_fire_station where cb_fire_station.is_delete=0 "
+
"<if test='par.name!=null'> and cb_fire_station.name like CONCAT('%',#{par.name},'%') </if>"
...
...
@@ -39,8 +40,9 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+
"<if test='par.bizCompanyCode!=null'> and cb_fire_station.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+
"<if test='par.address!=null'> and cb_fire_station.address like CONCAT('',#{par.address},'%') </if>"
+
"<if test='par.bizOrgCode != null'> and biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>"
+
"<if test='nodeIds != null' > AND where_building_id in <foreach collection='nodeIds' item='buildingId' open='(' close=')' separator=','> #{buildingId} </foreach></if>"
+
"</script>"
)
Map
<
String
,
Long
>
getFireStationCount
(
@Param
(
"par"
)
FireStationDto
par
);
Map
<
String
,
Long
>
getFireStationCount
(
@Param
(
"par"
)
FireStationDto
par
,
List
<
String
>
nodeIds
);
...
...
@@ -58,4 +60,6 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
Integer
getStationListCount
(
@Param
(
"par"
)
RequestData
par
);
FireStationDto
getFireStationDetails
(
Long
id
);
List
<
Map
<
String
,
Object
>>
getfireStatioCount
(
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/KeySiteMapper.java
View file @
2e23c0a5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -7,9 +10,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.KeySite
;
import
java.util.List
;
import
java.util.Map
;
/**
* 重点部位 Mapper 接口
*
...
...
@@ -21,7 +21,7 @@ public interface KeySiteMapper extends BaseMapper<KeySite> {
* 分页查询
*/
public
IPage
<
KeySiteDto
>
getPageList
(
Page
<
KeySiteDto
>
page
,
String
name
,
L
ong
buildingId
,
String
fireEnduranceRate
,
public
IPage
<
KeySiteDto
>
getPageList
(
Page
<
KeySiteDto
>
page
,
String
name
,
L
ist
<
Long
>
buildingIds
,
String
fireEnduranceRate
,
String
useNature
,
String
fireFacilitiesInfo
,
String
bizOrgCode
);
/**
* 获取所有的重点部位数据
...
...
@@ -40,4 +40,11 @@ public KeySiteDto getSequenceNbr(Long sequenceNbr);
public
List
<
KeySiteDateDto
>
getKeySiteDate
(
Long
id
);
public
List
<
String
>
getAddress
();
/**
* 查询该单位下对应建筑的重点部位数量
* @param belong_id
* @return
*/
public
List
<
Map
<
String
,
Object
>>
getKeySiteCount
(
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/OrgUsrMapper.java
View file @
2e23c0a5
...
...
@@ -114,4 +114,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List
<
OrgUsr
>
listByOrgTypes
(
@Param
(
"orgTypeList"
)
List
<
String
>
orgTypeList
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
String
getParentList
(
@Param
(
"id"
)
String
id
);
List
<
OrgUsr
>
selectPersonListByCompanyIdList
(
@Param
(
"companyIdList"
)
List
<
String
>
companyIdList
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IKeySiteService.java
View file @
2e23c0a5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto
;
...
...
@@ -8,8 +11,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import
com.yeejoin.amos.boot.module.common.api.entity.KeySite
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
java.util.List
;
/**
* 重点部位接口类
*
...
...
@@ -75,4 +76,10 @@ public List<KeySiteDateDto> getKeySiteDate(Long id);
public
List
<
KeySite
>
getKeySiteDateByNameLike
(
Long
companyId
);
public
List
<
Map
<
String
,
Object
>>
keySiteCountAndBuildingTree
(
String
bizOrgCode
);
public
Map
<
String
,
String
>
getNodeAllParentIds
(
List
<
String
>
ids
)
;
public
List
<
Long
>
getNodeAllnodeIds
(
Long
id
)
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/FireStationMapper.xml
View file @
2e23c0a5
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.common.api.mapper.FireStationMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.common.api.mapper.FireStationMapper"
>
<select
id=
"getStationList"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto"
>
<select
id=
"getStationList"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto"
>
SELECT
a.sequence_nbr sequenceNbr,
a.person_charge_name personChargeName,
a.longitude,
a.name,
a.latitude,
a.person_charge_telephone personChargeTelephone,
(SELECT count(i.instance_id)
from
cb_dynamic_form_instance i
where
i.field_value = a.sequence_nbr ) As userNum,
(SELECT COUNT(*)FROM jc_firestation_jacket WHERE firefighters_id = a.sequence_nbr and is_delete =0) AS eqNum,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance
FROM cb_fire_station a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if
test=
'par.distance!=null'
>
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
= #{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
SELECT
a.sequence_nbr sequenceNbr,
a.person_charge_name personChargeName,
a.longitude,
a.name,
a.latitude,
a.person_charge_telephone personChargeTelephone,
(SELECT count(i.instance_id)
from
cb_dynamic_form_instance i
where
i.field_value = a.sequence_nbr ) As userNum,
(SELECT COUNT(*)FROM jc_firestation_jacket WHERE firefighters_id =
a.sequence_nbr and is_delete =0) AS eqNum,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
AS distance
FROM cb_fire_station a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if
test=
'par.distance!=null'
>
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
= #{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
<select
id=
"getStationListCount"
resultType=
"Integer"
>
SELECT
COUNT(a.sequence_nbr) num
FROM cb_fire_station a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if
test=
'par.distance!=null'
>
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
= #{par.distance}
</if>
</select>
<select
id=
"getStationListCount"
resultType=
"Integer"
>
SELECT
COUNT(a.sequence_nbr) num
FROM cb_fire_station a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if
test=
'par.distance!=null'
>
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
= #{par.distance}
</if>
</select>
<select
id=
"getFireStationDetails"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.FireStationDto"
>
SELECT
a.*,
(SELECT
count(i.instance_id)
from
cb_dynamic_form_instance i
where
i.field_value = #{id}) As userNum
FROM cb_fire_station a
where
a.sequence_nbr = #{id}
</select>
<select
id=
"getFireStationDetails"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.FireStationDto"
>
SELECT
a.*,
(SELECT
count(i.instance_id)
from
cb_dynamic_form_instance i
where
i.field_value = #{id}) As userNum
FROM cb_fire_station a
where
a.sequence_nbr = #{id}
</select>
<select
id=
"getfireStatioCount"
resultType=
"map"
>
SELECT
parent_building_id,
count(1) as count
FROM
cb_fire_station
WHERE is_delete= false
and parent_building_id is not null
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
where_building_id
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/KeySiteMapper.xml
View file @
2e23c0a5
...
...
@@ -3,22 +3,27 @@
<mapper
namespace=
"com.yeejoin.amos.boot.module.common.api.mapper.KeySiteMapper"
>
<select
id=
"getPageList"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"
>
<select
id=
"getPageList"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"
>
SELECT
c.`name` as name,
c.belong_id as belongId,
c.biz_org_name as belongName,
c.biz_org_name as
belongName,
c.building_id as buildingId,
c.building_name as buildingName,
c.building_name as
buildingName,
c.address_desc as addressDesc,
c.building_area as buildingArea,
c.building_area as
buildingArea,
c.building_height as buildingHeight,
c.fire_endurance_rate as fireEnduranceRate,
c.use_nature as useNature,
c.charge_person AS chargePerson,
c.sequence_nbr AS sequenceNbr,
c.charge_person_id AS chargePersonId,
c.key_prevention_reason AS keyPreventionReason,
c.key_prevention_reason AS
keyPreventionReason,
c.fire_facilities_info AS fireFacilitiesInfo,
c.fire_prevention_flag AS firePreventionFlag,
c.hazard AS hazard,
...
...
@@ -27,9 +32,11 @@
c.remark AS remark,
c.is_delete AS isDelete,
c.rec_user_id AS recUserId,
c.rec_user_name AS recUserName,
c.rec_user_name AS
recUserName,
c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName,
c.fire_endurance_rate_name as
fireEnduranceRateName,
c.use_nature_name as useNatureName
FROM
cb_key_site c
...
...
@@ -37,8 +44,11 @@
<if
test=
"name != null and name != ''"
>
AND c.`name` like concat('%',#{name}, '%')
</if>
<if
test=
"buildingId != null and buildingId != -1"
>
AND c.`building_id`= #{buildingId}
<if
test=
"buildingIds != null"
>
AND c.`building_id` in
<foreach
collection=
"buildingIds"
item=
"buildingId"
open=
"("
close=
")"
separator=
","
>
#{buildingId}
</foreach>
</if>
<if
test=
"fireEnduranceRate != null and fireEnduranceRate != ''"
>
AND c.`fire_endurance_rate`= #{fireEnduranceRate}
...
...
@@ -54,69 +64,72 @@
</if>
order by c.rec_date desc
</select>
<select
id=
"getSequenceNbr"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"
>
SELECT c.`name` as name,
c.belong_id as belongId,
cou.biz_org_name as belongName,
c.building_id as buildingId,
c.building_name as buildingName,
c.address_desc as addressDesc,
c.building_area as buildingArea,
c.building_height as buildingHeight,
c.fire_endurance_rate as fireEnduranceRate,
c.use_nature as useNature,
c.charge_person AS chargePerson,
c.sequence_nbr AS sequenceNbr,
c.charge_person_id AS chargePersonId,
c.key_prevention_reason AS keyPreventionReason,
c.fire_facilities_info AS fireFacilitiesInfo,
c.fire_prevention_flag AS firePreventionFlag,
c.hazard AS hazard,
c.safety_management_measures AS safetyManagementMeasures,
c.preventive_measures AS preventiveMeasures,
c.remark AS remark,
c.is_delete AS isDelete,
c.rec_user_id AS recUserId,
c.rec_user_name AS recUserName,
c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName,
c.biz_org_name as bizOrgName,
c.biz_org_code as bizOrgCode
<select
id=
"getSequenceNbr"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"
>
SELECT c.`name` as name,
c.belong_id as belongId,
cou.biz_org_name as belongName,
c.building_id as buildingId,
c.building_name as buildingName,
c.address_desc as addressDesc,
c.building_area as buildingArea,
c.building_height as buildingHeight,
c.fire_endurance_rate as fireEnduranceRate,
c.use_nature as useNature,
c.charge_person AS chargePerson,
c.sequence_nbr AS sequenceNbr,
c.charge_person_id AS chargePersonId,
c.key_prevention_reason AS keyPreventionReason,
c.fire_facilities_info AS fireFacilitiesInfo,
c.fire_prevention_flag AS firePreventionFlag,
c.hazard AS hazard,
c.safety_management_measures AS safetyManagementMeasures,
c.preventive_measures AS preventiveMeasures,
c.remark AS remark,
c.is_delete AS isDelete,
c.rec_user_id AS recUserId,
c.rec_user_name AS recUserName,
c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName,
c.biz_org_name as bizOrgName,
c.biz_org_code as bizOrgCode
FROM cb_key_site c
left join cb_org_usr cou on c.belong_id = cou.sequence_nbr
where c.sequence_nbr = #{sequenceNbr}
and c.is_delete = FALSE;
left join cb_org_usr cou on c.belong_id = cou.sequence_nbr
where
c.sequence_nbr = #{sequenceNbr}
and c.is_delete = FALSE;
</select>
<select
id=
"getKeySiteList"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"
>
SELECT c.`name` as name,
c.belong_id as belongId,
c.biz_org_name as belongName,
c.building_id as buildingId,
c.building_name as buildingName,
c.address_desc as addressDesc,
c.building_area as buildingArea,
c.building_height as buildingHeight,
c.fire_endurance_rate as fireEnduranceRate,
c.use_nature as useNature,
c.charge_person AS chargePerson,
c.sequence_nbr AS sequenceNbr,
c.charge_person_id AS chargePersonId,
c.key_prevention_reason AS keyPreventionReason,
c.fire_facilities_info AS fireFacilitiesInfo,
c.fire_prevention_flag AS firePreventionFlag,
c.hazard AS hazard,
c.safety_management_measures AS safetyManagementMeasures,
c.preventive_measures AS preventiveMeasures,
c.remark AS remark,
c.is_delete AS isDelete,
c.rec_user_id AS recUserId,
c.rec_user_name AS recUserName,
c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName
<select
id=
"getKeySiteList"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"
>
SELECT c.`name` as name,
c.belong_id as belongId,
c.biz_org_name as belongName,
c.building_id as buildingId,
c.building_name as buildingName,
c.address_desc as addressDesc,
c.building_area as buildingArea,
c.building_height as buildingHeight,
c.fire_endurance_rate as fireEnduranceRate,
c.use_nature as useNature,
c.charge_person AS chargePerson,
c.sequence_nbr AS sequenceNbr,
c.charge_person_id AS chargePersonId,
c.key_prevention_reason AS keyPreventionReason,
c.fire_facilities_info AS fireFacilitiesInfo,
c.fire_prevention_flag AS firePreventionFlag,
c.hazard AS hazard,
c.safety_management_measures AS safetyManagementMeasures,
c.preventive_measures AS preventiveMeasures,
c.remark AS remark,
c.is_delete AS isDelete,
c.rec_user_id AS recUserId,
c.rec_user_name AS recUserName,
c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName
FROM cb_key_site c
where c.is_delete = FALSE
<if
test=
"name != null and name != ''"
>
...
...
@@ -139,18 +152,22 @@
</if>
</select>
<select
id=
"getKeySiteDate"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto"
>
<select
id=
"getKeySiteDate"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto"
>
SELECT
c.sequence_nbr AS `key`,
c.sequence_nbr AS `value`,
c.`name` as label,
c.address_desc as fireLocation,
c.longitude as floorLongitude,
c.latitude AS floorLatitude,
cou.biz_org_name as belongName,
c.belong_id as belongId
FROM cb_key_site c LEFT JOIN cb_org_usr cou on cou.sequence_nbr = c.belong_id
where c.is_delete=FALSE
c.sequence_nbr AS `key`,
c.sequence_nbr AS `value`,
c.`name` as
label,
c.address_desc as fireLocation,
c.longitude as floorLongitude,
c.latitude AS floorLatitude,
cou.biz_org_name as belongName,
c.belong_id as belongId
FROM cb_key_site c LEFT JOIN
cb_org_usr cou on cou.sequence_nbr = c.belong_id
where
c.is_delete=FALSE
<if
test=
"id != null and id != -1"
>
AND c.`belong_id`= #{id}
</if>
...
...
@@ -158,14 +175,30 @@
<select
id=
"getAddress"
resultType=
"string"
>
SELECT
cb_key_site.address_desc
cb_key_site.address_desc
FROM
cb_key_site
WHERE
cb_key_site.is_delete = FALSE AND
cb_key_site.address_desc IS NOT NULL AND
cb_key_site.address_desc != ''
GROUP BY
cb_key_site.address_desc
</select>
<select
id=
"getKeySiteCount"
resultType=
"map"
>
SELECT
parent_building_id,
count(1) as count
FROM
cb_key_site
cb_key_site
WHERE
cb_key_site.is_delete = FALSE AND
cb_key_site.address_desc IS NOT NULL AND
cb_key_site.address_desc != ''
is_delete=false
and parent_building_id is not null
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
and biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
cb_key_site.address_desc
building_id
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
2e23c0a5
...
...
@@ -824,7 +824,18 @@ LEFT JOIN (
<select
id=
"getParentList"
resultType=
"java.lang.String"
>
select getParentList(#{id}) as id;
</select>
<select
id=
"selectPersonListByCompanyIdList"
resultType=
"com.yeejoin.amos.boot.module.common.api.entity.OrgUsr"
>
select *
from cb_org_usr
where biz_org_type = 'PERSON'
and is_delete = 0
and biz_org_code regexp
(select GROUP_CONCAT(biz_org_code SEPARATOR '|') from cb_org_usr where sequence_nbr in
<foreach
collection=
"companyIdList"
item=
"companyId"
open=
"("
close=
")"
separator=
","
>
#{companyId}
</foreach>
);
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/VideoSource.java
View file @
2e23c0a5
...
...
@@ -34,4 +34,7 @@ public class VideoSource {
@TableField
(
exist
=
false
)
private
Date
createDate
;
@ApiModelProperty
(
value
=
"本级及父级建筑ids,冗余树形搜索"
)
private
String
parentSourceIds
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/BuildingTreeVo.java
View file @
2e23c0a5
...
...
@@ -5,12 +5,6 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.net.Inet4Address
;
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
import
java.net.SocketException
;
import
java.util.Enumeration
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FireStationController.java
View file @
2e23c0a5
...
...
@@ -32,6 +32,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -190,4 +191,12 @@ public class FireStationController extends BaseController {
PermissionInterceptorContext
.
setDataAuthRule
(
authKey
);
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
OrgPersonEnum
.
公司
.
getKey
()));
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/fireStationCountAndBuildingTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登录人角色获取当前单位下的所在建筑的微型消防站统计值"
,
notes
=
"根据登录人角色获取当前单位下的所在建筑的微型消防站统计值"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
fireStationCountAndBuildingTree
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
return
ResponseHelper
.
buildResponse
(
fireStationServiceImpl
.
fireStationCountAndBuildingTree
(
bizOrgCode
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FireTeamController.java
View file @
2e23c0a5
...
...
@@ -197,7 +197,29 @@ public class FireTeamController extends BaseController {
return
ResponseHelper
.
buildResponse
(
menus
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{companyId}/listTreetypeLikeCode"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询所属单位下消防队伍树"
,
notes
=
"查询所属单位下消防队伍树"
)
public
ResponseModel
<
List
<
Menu
>>
getlistTreeByCompanyIdLike
(
@PathVariable
(
value
=
"companyId"
)
String
companyId
)
throws
Exception
{
QueryWrapper
<
FireTeam
>
fireTeamQueryWrapper
=
new
QueryWrapper
<>();
fireTeamQueryWrapper
.
eq
(
"is_delete"
,
0
);
OrgUsr
our
=
iOrgUsrService
.
getById
(
companyId
);
//车辆装备需要判断
if
(
our
.
getParentId
()!=
null
){
//判断是不是部门
if
(
our
.
getBizOrgType
().
equals
(
"COMPANY"
)){
fireTeamQueryWrapper
.
likeRight
(
"biz_org_code"
,
our
.
getBizOrgCode
());
}
else
{
String
id
=
orgUsrMapper
.
getParentList
(
companyId
);
OrgUsr
ourf
=
iOrgUsrService
.
getById
(
id
);
fireTeamQueryWrapper
.
likeRight
(
"biz_org_code"
,
ourf
.
getBizOrgCode
());
}
}
List
<
Menu
>
menus
=
iFireTeamService
.
getTeamTreeLikeCode
(
fireTeamQueryWrapper
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{companyId}/getBizCode"
,
method
=
RequestMethod
.
GET
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/KeySiteController.java
View file @
2e23c0a5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
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.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -19,21 +43,9 @@ import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl
;
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.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
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
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
* 重点部位
...
...
@@ -46,122 +58,204 @@ import java.util.Map;
@RequestMapping
(
value
=
"/common/key-site"
)
public
class
KeySiteController
extends
BaseController
{
@Autowired
KeySiteServiceImpl
keySiteServiceImpl
;
@Autowired
IKeySiteService
keySiteService
;
@Autowired
KeySiteServiceImpl
keySiteServiceImpl
;
@Autowired
IKeySiteService
keySiteService
;
@Autowired
IOrgUsrService
iOrgUsrService
;
@Autowired
IOrgUsrService
iOrgUsrService
;
@Autowired
SourceFileServiceImpl
sourceFileService
;
@Autowired
SourceFileServiceImpl
sourceFileService
;
@Autowired
EquipFeignClient
equipFeignClient
;
@Autowired
EquipFeignClient
equipFeignClient
;
@Value
(
"${auth-key-key-site:key_site_info}"
)
private
String
authKey
;
@Value
(
"${auth-key-key-site:key_site_info}"
)
private
String
authKey
;
/**
* 新增重点部位
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增重点部位"
,
notes
=
"新增重点部位"
)
public
ResponseModel
<
KeySiteDto
>
save
(
@RequestBody
KeySiteDto
model
)
{
JSONObject
json
=
getBulid
(
model
.
getBuildingId
());
if
(
json
!=
null
&&
StringUtils
.
isNotBlank
(
json
.
getString
(
"latitude"
))
&&
StringUtils
.
isNotBlank
(
json
.
getString
(
"longitude"
)))
{
model
.
setLatitude
(
Double
.
parseDouble
(
json
.
getString
(
"latitude"
)));
model
.
setLongitude
(
Double
.
parseDouble
(
json
.
getString
(
"longitude"
)));
}
model
.
setIsDelete
(
false
);
KeySiteDto
entity
=
keySiteService
.
save
(
model
);
return
ResponseHelper
.
buildResponse
(
entity
);
}
/**
* 新增重点部位
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增重点部位"
,
notes
=
"新增重点部位"
)
public
ResponseModel
<
KeySiteDto
>
save
(
@RequestBody
KeySiteDto
model
)
{
JSONObject
json
=
getBulid
(
model
.
getBuildingId
());
if
(
json
!=
null
&&
StringUtils
.
isNotBlank
(
json
.
getString
(
"latitude"
))
&&
StringUtils
.
isNotBlank
(
json
.
getString
(
"longitude"
)))
{
model
.
setLatitude
(
Double
.
parseDouble
(
json
.
getString
(
"latitude"
)));
model
.
setLongitude
(
Double
.
parseDouble
(
json
.
getString
(
"longitude"
)));
}
model
.
setIsDelete
(
false
);
List
<
String
>
ids
=
new
ArrayList
<
String
>();
ids
.
add
(
model
.
getBuildingId
().
toString
());
Map
<
String
,
String
>
map3
=
keySiteService
.
getNodeAllParentIds
(
ids
);
model
.
setParentBuildingId
(
map3
.
get
(
model
.
getBuildingId
().
toString
()));
KeySiteDto
entity
=
keySiteService
.
save
(
model
);
return
ResponseHelper
.
buildResponse
(
entity
);
}
public
JSONObject
getBulid
(
Long
id
)
{
ResponseModel
<
Object
>
equipObj
=
equipFeignClient
.
getOne
(
id
);
JSONObject
equipjSONObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
equipObj
.
getResult
()));
if
(!
equipjSONObject
.
containsKey
(
"parentId"
))
{
return
null
;
}
if
(!
"0"
.
equals
(
equipjSONObject
.
getString
(
"parentId"
)))
{
String
parentId
=
equipjSONObject
.
getString
(
"parentId"
);
if
(
StringUtils
.
isNotBlank
(
parentId
))
{
return
getBulid
(
Long
.
parseLong
(
parentId
));
}
}
return
equipjSONObject
;
}
public
JSONObject
getBulid
(
Long
id
)
{
ResponseModel
<
Object
>
equipObj
=
equipFeignClient
.
getOne
(
id
);
JSONObject
equipjSONObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
equipObj
.
getResult
()));
if
(!
equipjSONObject
.
containsKey
(
"parentId"
))
{
return
null
;
}
if
(!
"0"
.
equals
(
equipjSONObject
.
getString
(
"parentId"
)))
{
String
parentId
=
equipjSONObject
.
getString
(
"parentId"
);
if
(
StringUtils
.
isNotBlank
(
parentId
))
{
return
getBulid
(
Long
.
parseLong
(
parentId
));
}
}
return
equipjSONObject
;
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"update/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新重点部位"
,
notes
=
"根据sequenceNbr更新重点部位"
)
public
ResponseModel
<
Boolean
>
updateBySequenceNbrKeySite
(
@RequestBody
KeySiteDto
model
)
{
JSONObject
json
=
getBulid
(
model
.
getBuildingId
());
if
(
json
!=
null
)
{
model
.
setLatitude
(
Double
.
parseDouble
(
json
.
getString
(
"latitude"
)));
model
.
setLongitude
(
Double
.
parseDouble
(
json
.
getString
(
"longitude"
)));
}
return
ResponseHelper
.
buildResponse
(
keySiteService
.
update
(
model
,
getUserInfo
()));
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"update/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新重点部位"
,
notes
=
"根据sequenceNbr更新重点部位"
)
public
ResponseModel
<
Boolean
>
updateBySequenceNbrKeySite
(
@RequestBody
KeySiteDto
model
)
{
JSONObject
json
=
getBulid
(
model
.
getBuildingId
());
if
(
json
!=
null
)
{
model
.
setLatitude
(
Double
.
parseDouble
(
json
.
getString
(
"latitude"
)));
model
.
setLongitude
(
Double
.
parseDouble
(
json
.
getString
(
"longitude"
)));
}
return
ResponseHelper
.
buildResponse
(
keySiteService
.
update
(
model
,
getUserInfo
()));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"delete"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除重点部位"
,
notes
=
"根据sequenceNbr删除重点部位"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"ids"
)
String
ids
)
{
List
<
Long
>
sequenceNbrList
=
new
ArrayList
<>();
/* BUG 2670 litw start */
String
[]
idsArr
=
ids
.
split
(
","
);
for
(
String
str
:
idsArr
)
{
sequenceNbrList
.
add
(
Long
.
valueOf
(
str
));
}
/* BUG 2670 end */
return
ResponseHelper
.
buildResponse
(
keySiteService
.
deleteById
(
sequenceNbrList
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"delete"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除重点部位"
,
notes
=
"根据sequenceNbr删除重点部位"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@RequestParam
(
value
=
"ids"
)
String
ids
)
{
List
<
Long
>
sequenceNbrList
=
new
ArrayList
<>();
/* BUG 2670 litw start */
String
[]
idsArr
=
ids
.
split
(
","
);
for
(
String
str
:
idsArr
)
{
sequenceNbrList
.
add
(
Long
.
valueOf
(
str
));
}
/* BUG 2670 end */
return
ResponseHelper
.
buildResponse
(
keySiteService
.
deleteById
(
sequenceNbrList
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"find/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个重点部位"
,
notes
=
"根据sequenceNbr查询单个重点部位"
)
public
ResponseModel
<
KeySiteDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
Map
<
String
,
List
<
AttachmentDto
>>
files
=
sourceFileService
.
getAttachments
(
sequenceNbr
);
KeySiteDto
dto
=
keySiteService
.
getSequenceNbr
(
sequenceNbr
);
if
(
files
!=
null
&&
dto
!=
null
)
{
dto
.
setAttachments
(
files
);
JSONArray
array
=
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
files
.
get
(
"keySitePhoto"
)));
if
(
array
!=
null
&&
array
.
size
()
>
0
)
{
for
(
Object
i
:
array
)
{
JSONObject
object
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
list
.
add
(
object
.
getString
(
"url"
));
}
}
}
dto
.
setAttachmentsList
(
list
);
return
ResponseHelper
.
buildResponse
(
dto
);
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @GetMapping(value = "/page")
// @ApiOperation(httpMethod = "GET", value = "重点部位分页查询", notes = "重点部位分页查询")
// public ResponseModel<IPage<KeySiteDto>> queryForPage(@RequestParam(value = "current") int current,
// @RequestParam(value = "size") int size, @RequestParam(required = false) String name,
// @RequestParam(required = false) Long buildingId, @RequestParam(required = false) String fireEnduranceRate,
// @RequestParam(required = false) String useNature, @RequestParam(required = false) String fireFacilitiesInfo,
// @RequestParam(required = false) String bizOrgCode) {
// Page<KeySiteDto> page = new Page<KeySiteDto>();
// page.setCurrent(current);
// page.setSize(size);
// return ResponseHelper.buildResponse(keySiteServiceImpl.getPageList(page, name, buildingId, fireEnduranceRate,
// useNature, fireFacilitiesInfo, bizOrgCode));
// }
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"机场单位部门部位统计树"
,
notes
=
"机场单位部门部位统计树"
)
@GetMapping
(
value
=
"/getOrguserTree"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getOrgUserTree
()
{
// 获取登陆人角色
ReginParams
reginParams
=
getSelectedOrgInfo
();
// 权限赋值
PermissionInterceptorContext
.
setDataAuthRule
(
authKey
);
List
<
OrgMenuDto
>
list
=
keySiteService
.
getOrgUserTree
(
reginParams
);
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"建筑部位树"
,
notes
=
"建筑部位树"
)
@GetMapping
(
value
=
"/getBuildTree/{buildingId}"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getBuildTree
(
@PathVariable
Long
buildingId
)
{
return
ResponseHelper
.
buildResponse
(
keySiteService
.
getBuildAndKeyTree
(
buildingId
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"部位"
,
notes
=
"部位"
)
@GetMapping
(
value
=
"/getKeySiteDate"
)
public
ResponseModel
<
List
<
KeySiteDateDto
>>
getKeySiteDate
(
@RequestParam
(
required
=
false
)
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
keySiteService
.
getKeySiteDate
(
id
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过名称模糊查询重点部位的信息"
,
notes
=
"通过名称模糊查询重点部位的信息"
)
@GetMapping
(
value
=
"/getKeySiteDateByNameLike"
)
public
ResponseModel
<
List
<
KeySite
>>
getKeySiteDateByNameLike
(
@RequestParam
(
required
=
false
)
Long
companyId
)
{
return
ResponseHelper
.
buildResponse
(
keySiteService
.
getKeySiteDateByNameLike
(
companyId
));
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTreeByUserAndType"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登录人及类型获取公司树"
,
notes
=
"根据登录人及类型获取公司树"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
companyTreeByUserAndType
(
String
type
)
{
// 获取登陆人角色
ReginParams
reginParams
=
getSelectedOrgInfo
();
// 权限赋值
PermissionInterceptorContext
.
setDataAuthRule
(
authKey
);
if
(
"all"
.
equals
(
type
))
{
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
null
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
else
{
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
OrgPersonEnum
.
公司
.
getKey
());
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"find/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个重点部位"
,
notes
=
"根据sequenceNbr查询单个重点部位"
)
public
ResponseModel
<
KeySiteDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
Map
<
String
,
List
<
AttachmentDto
>>
files
=
sourceFileService
.
getAttachments
(
sequenceNbr
);
KeySiteDto
dto
=
keySiteService
.
getSequenceNbr
(
sequenceNbr
);
if
(
files
!=
null
&&
dto
!=
null
)
{
dto
.
setAttachments
(
files
);
JSONArray
array
=
JSONArray
.
parseArray
(
JSONArray
.
toJSONString
(
files
.
get
(
"keySitePhoto"
)));
if
(
array
!=
null
&&
array
.
size
()
>
0
)
{
for
(
Object
i
:
array
)
{
JSONObject
object
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
list
.
add
(
object
.
getString
(
"url"
));
}
}
}
dto
.
setAttachmentsList
(
list
);
return
ResponseHelper
.
buildResponse
(
dto
);
}
/**
* 列表分页查询
...
...
@@ -170,6 +264,7 @@ public class KeySiteController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"重点部位分页查询"
,
notes
=
"重点部位分页查询"
)
...
...
@@ -186,66 +281,17 @@ public class KeySiteController extends BaseController {
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
// 获取登陆人角色
ReginParams
reginParams
=
getSelectedOrgInfo
();
// 权限赋值
PermissionInterceptorContext
.
setDataAuthRule
(
authKey
);
return
ResponseHelper
.
buildResponse
(
keySiteServiceImpl
.
getPageList
(
page
,
name
,
buildingId
,
fireEnduranceRate
,
useNature
,
fireFacilitiesInfo
,
reginParams
.
getPersonIdentity
().
getBizOrgCode
()));
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"机场单位部门部位统计树"
,
notes
=
"机场单位部门部位统计树"
)
@GetMapping
(
value
=
"/getOrguserTree"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getOrgUserTree
()
{
// 获取登陆人角色
ReginParams
reginParams
=
getSelectedOrgInfo
();
// 权限赋值
PermissionInterceptorContext
.
setDataAuthRule
(
authKey
);
List
<
OrgMenuDto
>
list
=
keySiteService
.
getOrgUserTree
(
reginParams
);
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"建筑部位树"
,
notes
=
"建筑部位树"
)
@GetMapping
(
value
=
"/getBuildTree/{buildingId}"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getBuildTree
(
@PathVariable
Long
buildingId
)
{
return
ResponseHelper
.
buildResponse
(
keySiteService
.
getBuildAndKeyTree
(
buildingId
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"部位"
,
notes
=
"部位"
)
@GetMapping
(
value
=
"/getKeySiteDate"
)
public
ResponseModel
<
List
<
KeySiteDateDto
>>
getKeySiteDate
(
@RequestParam
(
required
=
false
)
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
keySiteService
.
getKeySiteDate
(
id
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过名称模糊查询重点部位的信息"
,
notes
=
"通过名称模糊查询重点部位的信息"
)
@GetMapping
(
value
=
"/getKeySiteDateByNameLike"
)
public
ResponseModel
<
List
<
KeySite
>>
getKeySiteDateByNameLike
(
@RequestParam
(
required
=
false
)
Long
companyId
)
{
return
ResponseHelper
.
buildResponse
(
keySiteService
.
getKeySiteDateByNameLike
(
companyId
));
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTreeByUserAndType"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登录人及类型获取公司树"
,
notes
=
"根据登录人及类型获取公司树"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
companyTreeByUserAndType
(
String
type
)
{
// 获取登陆人角色
ReginParams
reginParams
=
getSelectedOrgInfo
();
// 权限赋值
PermissionInterceptorContext
.
setDataAuthRule
(
authKey
);
if
(
"all"
.
equals
(
type
))
{
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
null
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
else
{
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
companyTreeByUserAndType
(
reginParams
,
OrgPersonEnum
.
公司
.
getKey
());
return
ResponseHelper
.
buildResponse
(
menus
);
}
useNature
,
fireFacilitiesInfo
,
bizOrgCode
));
}
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/keySiteCountAndBuildingTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登录人角色获取当前单位下的所在建筑的重点部位统计值"
,
notes
=
"根据登录人角色获取当前单位下的所在建筑的重点部位统计值"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
keySiteCountAndBuildingTree
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
return
ResponseHelper
.
buildResponse
(
keySiteService
.
keySiteCountAndBuildingTree
(
bizOrgCode
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgPersonController.java
View file @
2e23c0a5
...
...
@@ -178,15 +178,10 @@ public class OrgPersonController {
*
* @return
*/
@PersonIdentify
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
ResponseModel
<
Object
>
listPage
(
@RequestParam
Map
<
String
,
Object
>
requestBody
)
{
// 权限处理
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
PermissionInterceptorContext
.
setDataAuthRule
(
authKey
);
requestBody
.
put
(
"bizOrgCode"
,
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
pagePerson
(
requestBody
.
containsKey
(
"pageNum"
)
?
requestBody
.
get
(
"pageNum"
).
toString
()
:
null
,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
2e23c0a5
...
...
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
...
...
@@ -31,6 +32,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -706,5 +708,21 @@ public class OrgUsrController extends BaseController {
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
* 查询多个组织机构下面的所有人员列表信息
*
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询多个组织机构下面的所有人员列表信息"
,
notes
=
"查询多个组织机构下面的所有人员列表信息"
)
@GetMapping
(
value
=
"/company/person/list"
)
public
ResponseModel
<
List
<
OrgUsr
>>
getPersonListByCompanyIdList
(
@RequestParam
String
companyIds
)
{
List
<
OrgUsr
>
orgUserList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
companyIds
))
{
List
<
String
>
companyIdList
=
Lists
.
newArrayList
(
companyIds
.
split
(
","
));
orgUserList
=
iOrgUsrService
.
getPersonListByCompanyIdList
(
companyIdList
);
}
return
ResponseHelper
.
buildResponse
(
orgUserList
);
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FireStationServiceImpl.java
View file @
2e23c0a5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.constants.BizConstant
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
...
...
@@ -12,6 +16,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
...
...
@@ -24,6 +29,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto;
import
com.yeejoin.amos.boot.module.common.api.dto.RequestData
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireStation
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.mapper.FireStationMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IFireStationService
;
...
...
@@ -43,8 +49,14 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
FireStationMapper
fireStationMapper
;
@Autowired
OrgUsrMapper
orgUsrMapper
;
@Autowired
OrgUsrServiceImpl
orgUsrService
;
@Autowired
EquipFeignClient
equipFeignClient
;
/**
* 分页查询
*/
...
...
@@ -69,8 +81,12 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
@Override
public
Page
<
FireStationDto
>
getFirefighters
(
int
pageNum
,
int
pageSize
,
FireStationDto
par
)
{
List
<
FireStationDto
>
list
=
fireStationMapper
.
getFireStation
((
pageNum
-
1
)
*
pageSize
,
pageSize
,
par
);
Map
<
String
,
Long
>
num
=
fireStationMapper
.
getFireStationCount
(
par
);
List
<
String
>
ids
=
null
;
if
(!
"-1"
.
equals
(
par
.
getWhereBuildingId
()))
{
ids
=
getNodeAllnodeIds
(
par
.
getWhereBuildingId
());
}
List
<
FireStationDto
>
list
=
fireStationMapper
.
getFireStation
((
pageNum
-
1
)
*
pageSize
,
pageSize
,
par
,
ids
);
Map
<
String
,
Long
>
num
=
fireStationMapper
.
getFireStationCount
(
par
,
ids
);
Page
<
FireStationDto
>
pageBean
=
new
Page
<>(
pageNum
,
pageSize
,
num
.
get
(
"num"
));
return
pageBean
.
setRecords
(
list
);
}
...
...
@@ -200,4 +216,107 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
root
.
setChildren
(
menuList
);
return
Lists
.
newArrayList
(
root
);
}
@SuppressWarnings
(
"unchecked"
)
public
List
<
Map
<
String
,
Object
>>
fireStationCountAndBuildingTree
(
String
bizOrgCode
)
{
Map
<
String
,
Integer
>
FireStationCountMap
=
parseFireStationCount
(
bizOrgCode
);
ResponseModel
<
Object
>
response
=
equipFeignClient
.
getBuildingTree
();
List
<
Map
<
String
,
Object
>>
buildingMapList
=
(
List
<
Map
<
String
,
Object
>>)
response
.
getResult
();
if
(
buildingMapList
==
null
||
buildingMapList
.
size
()<
1
)
{
return
null
;
}
return
parseTree
((
List
<
Map
<
String
,
Object
>>)
buildingMapList
.
get
(
0
).
get
(
"children"
),
FireStationCountMap
);
}
@SuppressWarnings
(
"unchecked"
)
private
List
<
Map
<
String
,
Object
>>
parseTree
(
List
<
Map
<
String
,
Object
>>
children
,
Map
<
String
,
Integer
>
keySiteCountMap
)
{
if
(!
ValidationUtil
.
isEmpty
(
children
))
{
for
(
Map
<
String
,
Object
>
child
:
children
)
{
if
(
child
.
get
(
"id"
)
!=
null
)
{
if
(
keySiteCountMap
.
containsKey
(
child
.
get
(
"id"
).
toString
()))
{
child
.
put
(
"count"
,
keySiteCountMap
.
get
(
child
.
get
(
"id"
).
toString
()));
}
else
{
child
.
put
(
"count"
,
0
);
}
}
else
{
child
.
put
(
"count"
,
0
);
}
if
(!
ValidationUtil
.
isEmpty
(
child
.
get
(
"children"
)))
{
parseTree
((
List
<
Map
<
String
,
Object
>>)
child
.
get
(
"children"
),
keySiteCountMap
);
}
}
}
return
children
;
}
private
Map
<
String
,
Integer
>
parseFireStationCount
(
String
bizOrgCode
)
{
Map
<
String
,
Integer
>
map
=
new
HashMap
<
String
,
Integer
>();
List
<
Map
<
String
,
Object
>>
list
=
fireStationMapper
.
getfireStatioCount
(
bizOrgCode
);
for
(
Map
<
String
,
Object
>
map2
:
list
)
{
Object
parentBuilingIdString
=
map2
.
get
(
"parent_building_id"
);
if
(
ObjectUtils
.
isEmpty
(
parentBuilingIdString
))
{
continue
;
}
String
[]
parentBuilingIdArray
=
parentBuilingIdString
.
toString
().
split
(
","
);
for
(
int
i
=
0
;
i
<
parentBuilingIdArray
.
length
;
i
++)
{
if
(
map
.
containsKey
(
parentBuilingIdArray
[
i
]))
{
int
num
=
map
.
get
(
parentBuilingIdArray
[
i
]).
intValue
();
num
=
num
+
Integer
.
parseInt
(
map2
.
get
(
"count"
).
toString
());
map
.
put
(
parentBuilingIdArray
[
i
],
num
);
}
else
{
map
.
put
(
parentBuilingIdArray
[
i
],
Integer
.
parseInt
(
map2
.
get
(
"count"
).
toString
()));
}
}
}
return
map
;
}
public
Map
<
String
,
String
>
getNodeAllParentIds
(
List
<
String
>
ids
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
response
=
equipFeignClient
.
getBuildingTreeList
();
List
<
Map
<
String
,
Object
>>
responseList
=
response
.
getResult
();
if
(
response
.
getStatus
()!=
200
&&
response
.
getResult
().
size
()<
1
)
{
return
null
;
}
ids
.
stream
().
forEach
(
i
->{
String
tegartString
=
getNodeAllParentIds
(
responseList
,
i
,
i
);
map
.
put
(
i
,
tegartString
);
});
return
map
;
}
private
String
getNodeAllParentIds
(
List
<
Map
<
String
,
Object
>>
list
,
String
id
,
String
tegartString
){
for
(
Map
<
String
,
Object
>
map
:
list
)
{
if
(
map
.
get
(
"id"
).
toString
().
equals
(
id
)
&&
map
.
get
(
"parentId"
)!=
null
)
{
tegartString
=
tegartString
+
","
+
map
.
get
(
"parentId"
).
toString
();
getNodeAllParentIds
(
list
,
map
.
get
(
"parentId"
).
toString
(),
tegartString
);
}
}
return
tegartString
;
}
public
List
<
String
>
getNodeAllnodeIds
(
String
id
)
{
List
<
String
>
resultList
=
new
ArrayList
<
String
>();
resultList
.
add
(
id
);
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
response
=
equipFeignClient
.
getBuildingTreeList
();
List
<
Map
<
String
,
Object
>>
responseList
=
response
.
getResult
();
if
(
response
.
getResult
()==
null
&&
response
.
getResult
().
size
()<
1
)
{
return
null
;
}
return
getNodeAllnodeIds
(
resultList
,
responseList
,
id
.
toString
());
}
private
List
<
String
>
getNodeAllnodeIds
(
List
<
String
>
resultList
,
List
<
Map
<
String
,
Object
>>
list
,
String
id
){
for
(
Map
<
String
,
Object
>
map
:
list
)
{
if
(
map
.
get
(
"parentId"
).
toString
().
equals
(
id
)
&&
map
.
get
(
"parentId"
)!=
null
)
{
resultList
.
add
(
map
.
get
(
"id"
).
toString
());
getNodeAllnodeIds
(
resultList
,
list
,
map
.
get
(
"id"
).
toString
());
}
}
return
resultList
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FireTeamServiceImpl.java
View file @
2e23c0a5
...
...
@@ -183,6 +183,11 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
null
);
}
public
List
<
Menu
>
getTeamTreeLikeCode
(
QueryWrapper
<
FireTeam
>
columnMap
)
throws
Exception
{
Collection
<
FireTeam
>
list
=
this
.
list
(
columnMap
);
return
TreeParser
.
getTree
(
null
,
list
,
FireTeam
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getName"
,
"getParent"
,
null
);
}
/**
* 获取机场单位-队伍树
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/KeySiteServiceImpl.java
View file @
2e23c0a5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -10,10 +31,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.KeySite
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
...
...
@@ -24,21 +48,6 @@ import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import
com.yeejoin.amos.boot.module.common.api.service.IKeySiteService
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* 重点部位服务实现类
...
...
@@ -72,12 +81,17 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Autowired
private
RedisUtils
redisUtils
;
/**
* 分页查询
*/
public
IPage
<
KeySiteDto
>
getPageList
(
Page
<
KeySiteDto
>
page
,
String
name
,
Long
buildingId
,
String
fireEnduranceRate
,
String
useNature
,
String
fireFacilitiesInfo
,
String
bizOrgCode
){
return
keySiteMapper
.
getPageList
(
page
,
name
,
buildingId
,
fireEnduranceRate
,
useNature
,
fireFacilitiesInfo
,
bizOrgCode
);
String
useNature
,
String
fireFacilitiesInfo
,
String
bizOrgCode
)
{
List
<
Long
>
ids
=
null
;
if
(
buildingId
!=
null
&&
buildingId
.
intValue
()
!=
0
)
{
ids
=
getNodeAllnodeIds
(
buildingId
);
}
return
keySiteMapper
.
getPageList
(
page
,
name
,
ids
,
fireEnduranceRate
,
useNature
,
fireFacilitiesInfo
,
bizOrgCode
);
}
@Override
...
...
@@ -93,21 +107,25 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
* 列表查询 示例
*/
@Override
public
List
<
KeySiteDto
>
queryForKeySiteList
(
String
name
,
Long
buildingId
,
String
fireEnduranceRate
,
String
useNature
,
String
fireFacilitiesInfo
,
String
bizOrgCode
)
{
return
keySiteMapper
.
getKeySiteList
(
name
,
buildingId
,
fireEnduranceRate
,
useNature
,
fireFacilitiesInfo
,
bizOrgCode
);
public
List
<
KeySiteDto
>
queryForKeySiteList
(
String
name
,
Long
buildingId
,
String
fireEnduranceRate
,
String
useNature
,
String
fireFacilitiesInfo
,
String
bizOrgCode
)
{
return
keySiteMapper
.
getKeySiteList
(
name
,
buildingId
,
fireEnduranceRate
,
useNature
,
fireFacilitiesInfo
,
bizOrgCode
);
}
@Override
public
List
<
KeySiteExcleDto
>
exportToExcel
(
String
name
,
Long
buildingId
,
String
fireEnduranceRate
,
String
useNature
,
String
fireFacilitiesInfo
,
String
bizOrgCode
)
{
public
List
<
KeySiteExcleDto
>
exportToExcel
(
String
name
,
Long
buildingId
,
String
fireEnduranceRate
,
String
useNature
,
String
fireFacilitiesInfo
,
String
bizOrgCode
)
{
// 导出模板增加权限
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
);
// 权限处理
String
bizOrgCodeNew
=
reginParams
.
getPersonIdentity
().
getBizOrgCode
();
List
<
KeySiteDto
>
list
=
this
.
queryForKeySiteList
(
name
,
buildingId
,
fireEnduranceRate
,
useNature
,
fireFacilitiesInfo
,
bizOrgCodeNew
);
List
<
KeySiteDto
>
list
=
this
.
queryForKeySiteList
(
name
,
buildingId
,
fireEnduranceRate
,
useNature
,
fireFacilitiesInfo
,
bizOrgCodeNew
);
List
<
KeySiteExcleDto
>
excleList
=
new
ArrayList
<>();
list
.
forEach
(
i
->
{
KeySiteExcleDto
keySiteExcleDto
=
new
KeySiteExcleDto
();
...
...
@@ -127,15 +145,15 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Override
public
boolean
deleteById
(
List
<
Long
>
sequenceNbrList
)
{
if
(
ObjectUtils
.
isEmpty
(
sequenceNbrList
))
{
if
(
ObjectUtils
.
isEmpty
(
sequenceNbrList
))
{
return
false
;
}
try
{
sequenceNbrList
.
stream
().
forEach
(
i
->
{
sequenceNbrList
.
stream
().
forEach
(
i
->
{
KeySite
keySite
=
keySiteMapper
.
selectById
(
i
);
if
(
keySite
!=
null
)
{
keySite
.
setIsDelete
(
true
);
keySiteMapper
.
updateById
(
keySite
);
keySiteMapper
.
updateById
(
keySite
);
}
});
}
catch
(
Exception
e
)
{
...
...
@@ -193,6 +211,10 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
entity
.
setRecDate
(
new
Date
());
entity
.
setRecUserId
(
userInfo
.
getUserId
());
entity
.
setRecUserName
(
userInfo
.
getRealName
());
List
<
String
>
ids
=
new
ArrayList
<
String
>();
ids
.
add
(
entity
.
getBuildingId
().
toString
());
Map
<
String
,
String
>
map3
=
getNodeAllParentIds
(
ids
);
entity
.
setParentBuildingId
(
map3
.
get
(
entity
.
getBuildingId
().
toString
()));
int
num
=
keySiteMapper
.
updateById
(
entity
);
Map
<
String
,
List
<
AttachmentDto
>>
map
=
keySite
.
getAttachments
();
if
(
ObjectUtils
.
isNotEmpty
(
map
))
{
...
...
@@ -206,11 +228,20 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Override
public
List
<
OrgMenuDto
>
getOrgUserTree
(
ReginParams
reginParams
)
{
List
<
OrgUsr
>
comDeptList
=
iOrgUsrService
.
getListByBizOrgTypeCode
(
OrgPersonEnum
.
公司
.
getKey
()
+
","
+
OrgPersonEnum
.
部门
.
getKey
(),
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
List
<
KeySite
>
keySiteList
=
this
.
list
(
new
LambdaQueryWrapper
<
KeySite
>().
eq
(
BaseEntity:
:
getIsDelete
,
false
));
comDeptList
=
comDeptList
.
stream
().
map
(
c
->
c
.
setTotal
(
keySiteList
.
stream
().
filter
(
k
->
StringUtils
.
isNotBlank
(
k
.
getBizOrgCode
())
&&
k
.
getBizOrgCode
().
contains
(
c
.
getBizOrgCode
())).
count
())).
collect
(
Collectors
.
toList
());
List
<
OrgUsr
>
comDeptList
=
iOrgUsrService
.
getListByBizOrgTypeCode
(
OrgPersonEnum
.
公司
.
getKey
()
+
","
+
OrgPersonEnum
.
部门
.
getKey
(),
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
List
<
KeySite
>
keySiteList
=
this
.
list
(
new
LambdaQueryWrapper
<
KeySite
>().
eq
(
BaseEntity:
:
getIsDelete
,
false
));
comDeptList
=
comDeptList
.
stream
().
map
(
c
->
c
.
setTotal
(
keySiteList
.
stream
()
.
filter
(
k
->
StringUtils
.
isNotBlank
(
k
.
getBizOrgCode
())
&&
k
.
getBizOrgCode
().
contains
(
c
.
getBizOrgCode
()))
.
count
())).
collect
(
Collectors
.
toList
());
List
<
OrgMenuDto
>
menuList
=
comDeptList
.
stream
().
map
(
o
->
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
o
.
getSequenceNbr
(),
o
.
getBizOrgName
()+
" ("
+
o
.
getTotal
()
+
")"
,
/*
* OrgMenuDto menu = new OrgMenuDto(o.getSequenceNbr(), o.getBizOrgName() + " ("
* + o.getTotal() + ")", ObjectUtils.isEmpty(o.getParentId()) ? 0L :
* Long.valueOf(o.getParentId()), o.getBizOrgType(), false, o.getBizOrgCode());
*/
OrgMenuDto
menu
=
new
OrgMenuDto
(
o
.
getSequenceNbr
(),
o
.
getBizOrgName
(),
ObjectUtils
.
isEmpty
(
o
.
getParentId
())
?
0L
:
Long
.
valueOf
(
o
.
getParentId
()),
o
.
getBizOrgType
(),
false
,
o
.
getBizOrgCode
());
return
menu
;
...
...
@@ -250,9 +281,11 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Override
public
boolean
saveExcel
(
List
<
KeySiteExcleDto
>
excelDtoList
)
{
Map
<
String
,
String
>
maps
=
getAllBuildingIdForParentBuilingIds
(
excelDtoList
);
List
<
KeySite
>
excelList
=
new
ArrayList
<
KeySite
>();
List
<
OrgUsr
>
comDeptList
=
orgUsrMapper
.
companyTreeByUserAndType
(
null
);
Map
<
Long
,
OrgUsr
>
comDeptMap
=
comDeptList
.
stream
().
collect
(
Collectors
.
toMap
(
BaseEntity:
:
getSequenceNbr
,
Function
.
identity
()));
Map
<
Long
,
OrgUsr
>
comDeptMap
=
comDeptList
.
stream
()
.
collect
(
Collectors
.
toMap
(
BaseEntity:
:
getSequenceNbr
,
Function
.
identity
()));
for
(
KeySiteExcleDto
keySiteExcleDto
:
excelDtoList
)
{
KeySite
keySiteDto
=
new
KeySite
();
Bean
.
copyExistPropertis
(
keySiteExcleDto
,
keySiteDto
);
...
...
@@ -260,14 +293,20 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
if
(
StringUtils
.
isNotBlank
(
keySiteExcleDto
.
getBelongName
())
&&
keySiteExcleDto
.
getBelongName
().
contains
(
"@"
))
{
keySiteDto
.
setBelongId
(
Long
.
parseLong
(
keySiteExcleDto
.
getBelongName
().
split
(
"@"
)[
1
]));
keySiteDto
.
setBizOrgCode
(
comDeptMap
.
getOrDefault
(
keySiteDto
.
getBelongId
(),
new
OrgUsr
()).
getBizOrgCode
());
keySiteDto
.
setBizOrgName
(
comDeptMap
.
getOrDefault
(
keySiteDto
.
getBelongId
(),
new
OrgUsr
()).
getBizOrgName
());
keySiteDto
.
setBizOrgCode
(
comDeptMap
.
getOrDefault
(
keySiteDto
.
getBelongId
(),
new
OrgUsr
()).
getBizOrgCode
());
keySiteDto
.
setBizOrgName
(
comDeptMap
.
getOrDefault
(
keySiteDto
.
getBelongId
(),
new
OrgUsr
()).
getBizOrgName
());
}
if
(
StringUtils
.
isNotBlank
(
keySiteExcleDto
.
getBuildingName
())
&&
keySiteExcleDto
.
getBuildingName
().
contains
(
"@"
))
{
String
[]
fireEnduranceRateArray
=
keySiteExcleDto
.
getBuildingName
().
split
(
"@"
);
keySiteDto
.
setBuildingId
(
Long
.
parseLong
(
fireEnduranceRateArray
[
1
]));
keySiteDto
.
setBuildingName
(
fireEnduranceRateArray
[
0
]);
if
(
maps
.
containsKey
(
fireEnduranceRateArray
[
1
]))
{
keySiteDto
.
setParentBuildingId
(
maps
.
get
(
fireEnduranceRateArray
[
1
]));
}
}
if
(
StringUtils
.
isNotBlank
(
keySiteExcleDto
.
getFireEnduranceRate
())
&&
keySiteExcleDto
.
getFireEnduranceRate
().
contains
(
"@"
))
{
...
...
@@ -290,41 +329,55 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
}
else
{
keySiteDto
.
setFirePreventionFlag
(
false
);
}
keySiteDto
=
Bean
.
toPo
(
getCurrentInfo
(),
keySiteDto
);
keySiteDto
=
Bean
.
toPo
(
getCurrentInfo
(),
keySiteDto
);
excelList
.
add
(
keySiteDto
);
}
return
this
.
saveBatch
(
excelList
);
}
public
Map
<
String
,
String
>
getAllBuildingIdForParentBuilingIds
(
List
<
KeySiteExcleDto
>
excelDtoList
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
for
(
KeySiteExcleDto
keySiteExcleDto
:
excelDtoList
)
{
if
(
StringUtils
.
isNotBlank
(
keySiteExcleDto
.
getBuildingName
())
&&
keySiteExcleDto
.
getBuildingName
().
contains
(
"@"
))
{
String
[]
fireEnduranceRateArray
=
keySiteExcleDto
.
getBuildingName
().
split
(
"@"
);
list
.
add
(
fireEnduranceRateArray
[
1
]);
}
}
return
getNodeAllParentIds
(
list
);
}
public
BaseEntity
getCurrentInfo
()
{
BaseEntity
userModel
=
new
BaseEntity
();
/* String keyString= RequestContext.getExeUserId();
String token=RequestContext.getToken();
ReginParams params = JSONObject.parseObject(redisUtils
.get(RedisKey.buildReginKey(keyString, token)).toString(),
ReginParams.class);*/
userModel
.
setRecUserId
(
"3141675"
);
BaseEntity
userModel
=
new
BaseEntity
();
/*
* String keyString= RequestContext.getExeUserId(); String
* token=RequestContext.getToken(); ReginParams params =
* JSONObject.parseObject(redisUtils .get(RedisKey.buildReginKey(keyString,
* token)).toString(), ReginParams.class);
*/
userModel
.
setRecUserId
(
"3141675"
);
userModel
.
setRecUserName
(
"admin_jcs"
);
userModel
.
setRecDate
(
new
Date
());
userModel
.
setRecDate
(
new
Date
());
return
userModel
;
}
@Override
public
List
<
OrgMenuDto
>
getBuildAndKeyTree
(
Long
sequenceNbr
)
{
LambdaQueryWrapper
<
KeySite
>
mapper
=
new
LambdaQueryWrapper
<
KeySite
>();
LambdaQueryWrapper
<
KeySite
>
mapper
=
new
LambdaQueryWrapper
<
KeySite
>();
mapper
.
eq
(
KeySite:
:
getBuildingId
,
sequenceNbr
);
mapper
.
eq
(
KeySite:
:
getIsDelete
,
false
);
List
<
KeySite
>
list
=
this
.
baseMapper
.
selectList
(
mapper
);
if
(
list
==
null
||
list
.
size
()==
0
)
{
List
<
KeySite
>
list
=
this
.
baseMapper
.
selectList
(
mapper
);
if
(
list
==
null
||
list
.
size
()
==
0
)
{
return
null
;
}
String
buildNameString
=
list
.
get
(
0
).
getBuildingName
();
String
buildNameString
=
list
.
get
(
0
).
getBuildingName
();
List
<
OrgMenuDto
>
menuList
=
list
.
stream
().
map
(
o
->
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
o
.
getSequenceNbr
(),
o
.
getName
(),
ObjectUtils
.
isEmpty
(
o
.
getBelongId
())
?
0L
:
Long
.
valueOf
(
o
.
getBelongId
()),
null
,
false
,
null
);
ObjectUtils
.
isEmpty
(
o
.
getBelongId
())
?
0L
:
Long
.
valueOf
(
o
.
getBelongId
()),
null
,
false
,
null
);
return
menu
;
}).
collect
(
Collectors
.
toList
());
List
<
OrgMenuDto
>
list1
=
new
ArrayList
<
OrgMenuDto
>();
OrgMenuDto
orgMenuDto
=
new
OrgMenuDto
();
OrgMenuDto
orgMenuDto
=
new
OrgMenuDto
();
orgMenuDto
.
setKey
(
sequenceNbr
);
orgMenuDto
.
setValue
(
sequenceNbr
);
orgMenuDto
.
setChildren
(
buildTreeParallel
(
menuList
));
...
...
@@ -339,19 +392,135 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
return
keySiteMapper
.
getKeySiteDate
(
id
);
}
public
List
<
String
>
getAddress
(){
return
keySiteMapper
.
getAddress
();
public
List
<
String
>
getAddress
()
{
return
keySiteMapper
.
getAddress
();
}
@Override
public
List
<
KeySite
>
getKeySiteDateByNameLike
(
Long
companyId
)
{
LambdaQueryWrapper
<
KeySite
>
mapper
=
new
LambdaQueryWrapper
<
KeySite
>();
LambdaQueryWrapper
<
KeySite
>
mapper
=
new
LambdaQueryWrapper
<
KeySite
>();
mapper
.
eq
(
KeySite:
:
getIsDelete
,
false
);
if
(
companyId
!=
null
&&
companyId
.
longValue
()!=
0
)
{
if
(
companyId
!=
null
&&
companyId
.
longValue
()
!=
0
)
{
mapper
.
eq
(
KeySite:
:
getBelongId
,
companyId
);
}
return
this
.
baseMapper
.
selectList
(
mapper
);
}
@SuppressWarnings
(
"unchecked"
)
@Override
public
List
<
Map
<
String
,
Object
>>
keySiteCountAndBuildingTree
(
String
bizOrgCode
)
{
int
allCount
=
0
;
Map
<
String
,
Integer
>
keySiteCountMap
=
parseKeySiteCount
(
bizOrgCode
);
ResponseModel
<
Object
>
response
=
equipFeignClient
.
getBuildingTree
();
List
<
Map
<
String
,
Object
>>
buildingMapList
=
(
List
<
Map
<
String
,
Object
>>)
response
.
getResult
();
if
(
buildingMapList
==
null
||
buildingMapList
.
size
()
<
1
)
{
return
null
;
}
Map
<
String
,
Object
>
reMap
=
parseTree
((
List
<
Map
<
String
,
Object
>>)
buildingMapList
.
get
(
0
).
get
(
"children"
),
keySiteCountMap
,
allCount
);
Map
<
String
,
Object
>
fristMap
=
buildingMapList
.
get
(
0
);
fristMap
.
put
(
"id"
,
0
);
fristMap
.
put
(
"name"
,
fristMap
.
get
(
"instanceName"
)
+
" ("
+
reMap
.
get
(
"allCount"
)
+
")"
);
fristMap
.
put
(
"children"
,
fristMap
.
get
(
"children"
));
buildingMapList
.
clear
();
buildingMapList
.
add
(
fristMap
);
return
buildingMapList
;
}
@SuppressWarnings
(
"unchecked"
)
private
Map
<
String
,
Object
>
parseTree
(
List
<
Map
<
String
,
Object
>>
children
,
Map
<
String
,
Integer
>
keySiteCountMap
,
int
allCount
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<
String
,
Object
>();
if
(!
ValidationUtil
.
isEmpty
(
children
))
{
for
(
Map
<
String
,
Object
>
child
:
children
)
{
if
(
child
.
get
(
"id"
)
!=
null
)
{
if
(
keySiteCountMap
.
containsKey
(
child
.
get
(
"id"
).
toString
()))
{
allCount
=
allCount
+
keySiteCountMap
.
get
(
child
.
get
(
"id"
).
toString
()).
intValue
();
child
.
put
(
"name"
,
child
.
get
(
"name"
)
+
" ("
+
keySiteCountMap
.
get
(
child
.
get
(
"id"
).
toString
())
+
")"
);
}
else
{
child
.
put
(
"name"
,
child
.
get
(
"name"
)
+
" ("
+
0
+
")"
);
}
}
else
{
child
.
put
(
"name"
,
child
.
get
(
"name"
)
+
" ("
+
0
+
")"
);
}
if
(!
ValidationUtil
.
isEmpty
(
child
.
get
(
"children"
)))
{
parseTree
((
List
<
Map
<
String
,
Object
>>)
child
.
get
(
"children"
),
keySiteCountMap
,
allCount
);
}
}
}
resultMap
.
put
(
"children"
,
children
);
resultMap
.
put
(
"allCount"
,
allCount
);
return
resultMap
;
}
private
Map
<
String
,
Integer
>
parseKeySiteCount
(
String
bizOrgCode
)
{
Map
<
String
,
Integer
>
map
=
new
HashMap
<
String
,
Integer
>();
List
<
Map
<
String
,
Object
>>
list
=
keySiteMapper
.
getKeySiteCount
(
bizOrgCode
);
for
(
Map
<
String
,
Object
>
map2
:
list
)
{
Object
parentBuilingIdString
=
map2
.
get
(
"parent_building_id"
);
if
(
ObjectUtils
.
isEmpty
(
parentBuilingIdString
))
{
continue
;
}
String
[]
parentBuilingIdArray
=
parentBuilingIdString
.
toString
().
split
(
","
);
for
(
int
i
=
0
;
i
<
parentBuilingIdArray
.
length
;
i
++)
{
if
(
map
.
containsKey
(
parentBuilingIdArray
[
i
]))
{
int
num
=
map
.
get
(
parentBuilingIdArray
[
i
]).
intValue
();
num
=
num
+
Integer
.
parseInt
(
map2
.
get
(
"count"
).
toString
());
map
.
put
(
parentBuilingIdArray
[
i
],
num
);
}
else
{
map
.
put
(
parentBuilingIdArray
[
i
],
Integer
.
parseInt
(
map2
.
get
(
"count"
).
toString
()));
}
}
}
return
map
;
}
public
Map
<
String
,
String
>
getNodeAllParentIds
(
List
<
String
>
ids
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
response
=
equipFeignClient
.
getBuildingTreeList
();
List
<
Map
<
String
,
Object
>>
responseList
=
response
.
getResult
();
if
(
response
.
getResult
()
==
null
&&
response
.
getResult
().
size
()
<
1
)
{
return
null
;
}
ids
.
stream
().
forEach
(
i
->
{
String
tegartString
=
getNodeAllParentIds
(
responseList
,
i
,
i
);
map
.
put
(
i
,
tegartString
);
});
return
map
;
}
private
String
getNodeAllParentIds
(
List
<
Map
<
String
,
Object
>>
list
,
String
id
,
String
tegartString
)
{
for
(
Map
<
String
,
Object
>
map
:
list
)
{
if
(
map
.
get
(
"id"
).
toString
().
equals
(
id
)
&&
map
.
get
(
"parentId"
)
!=
null
)
{
tegartString
=
tegartString
+
","
+
map
.
get
(
"parentId"
).
toString
();
getNodeAllParentIds
(
list
,
map
.
get
(
"parentId"
).
toString
(),
tegartString
);
}
}
return
tegartString
;
}
public
List
<
Long
>
getNodeAllnodeIds
(
Long
id
)
{
List
<
Long
>
resultList
=
new
ArrayList
<
Long
>();
resultList
.
add
(
id
);
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
response
=
equipFeignClient
.
getBuildingTreeList
();
List
<
Map
<
String
,
Object
>>
responseList
=
response
.
getResult
();
if
(
response
.
getResult
()
==
null
&&
response
.
getResult
().
size
()
<
1
)
{
return
null
;
}
return
getNodeAllnodeIds
(
resultList
,
responseList
,
id
.
toString
());
}
private
List
<
Long
>
getNodeAllnodeIds
(
List
<
Long
>
resultList
,
List
<
Map
<
String
,
Object
>>
list
,
String
id
)
{
for
(
Map
<
String
,
Object
>
map
:
list
)
{
if
(
map
.
get
(
"parentId"
).
toString
().
equals
(
id
)
&&
map
.
get
(
"parentId"
)
!=
null
)
{
resultList
.
add
(
Long
.
parseLong
(
map
.
get
(
"id"
).
toString
()));
getNodeAllnodeIds
(
resultList
,
list
,
map
.
get
(
"id"
).
toString
());
}
}
return
resultList
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
2e23c0a5
...
...
@@ -2174,4 +2174,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
})).
start
();
}
/**
* 查询多个组织机构下面的所有人员列表信息
*
* @param companyIdList
* @return
*/
public
List
<
OrgUsr
>
getPersonListByCompanyIdList
(
List
<
String
>
companyIdList
)
{
if
(
ValidationUtil
.
isEmpty
(
companyIdList
))
{
return
Lists
.
newArrayList
();
}
return
this
.
baseMapper
.
selectPersonListByCompanyIdList
(
companyIdList
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/BuildingController.java
View file @
2e23c0a5
...
...
@@ -4,6 +4,7 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.Map
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
...
...
@@ -105,7 +106,12 @@ public class BuildingController extends AbstractBaseController {
public
List
<
BuildingTreeVo
>
getBuildingTree
()
{
return
buildService
.
getBuildingTree
();
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"消防建筑树列表信息"
)
@GetMapping
(
value
=
"/getBuildingList"
)
public
List
<
Map
<
String
,
Object
>>
getBuildingTreeList
()
{
return
buildService
.
getBuildingDetaiList
();
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"消防建筑层级树"
)
@GetMapping
(
value
=
"/tierTree"
)
...
...
@@ -297,4 +303,12 @@ public class BuildingController extends AbstractBaseController {
return
buildService
.
getCompanyBuildingTree
(
null
);
}
@ApiOperation
(
value
=
"查询指定单位的建筑树"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{bizOrgCode}/tree"
)
public
List
<
BuildingTreeVo
>
buildingTree
(
@ApiParam
(
value
=
"单位编码"
)
@PathVariable
String
bizOrgCode
){
return
buildService
.
getBuildingTreeInOrgCode
(
bizOrgCode
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/BuildingVideoController.java
View file @
2e23c0a5
...
...
@@ -35,14 +35,14 @@ public class BuildingVideoController extends AbstractBaseController {
IBuilldService
buildService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"消防建筑视
屏
监控树"
)
@ApiOperation
(
"消防建筑视
频
监控树"
)
@GetMapping
(
value
=
"/tree"
)
public
List
<
BuildingTreeVo
>
getBuildingTree
()
{
return
buildService
.
getBuildingVideoTree
();
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"
消防建筑视屏监控树
"
)
@ApiOperation
(
"
物联监控->单位建筑树(视频节点数量)
"
)
@GetMapping
(
value
=
"/getBuildingVideoTree"
)
public
List
<
BuildingTreeVo
>
getBuildingVideoTree
()
{
return
buildService
.
getBuildingVideoTreeNew
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
View file @
2e23c0a5
...
...
@@ -36,8 +36,8 @@ public interface JcsFeign {
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"
current"
)
int
current
,
@RequestParam
(
value
=
"
size"
)
int
s
ize
,
@RequestParam
(
value
=
"
pageNum"
)
int
pageNum
,
@RequestParam
(
value
=
"
pageSize"
)
int
pageS
ize
,
@RequestParam
(
value
=
"name"
)
String
name
,
@RequestParam
(
value
=
"belongBuildingId"
)
List
<
Long
>
belongBuildingId
,
@RequestParam
(
value
=
"belongFightingSystemId"
)
Long
belongFightingSystemId
,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/VideoMapper.java
View file @
2e23c0a5
...
...
@@ -87,4 +87,6 @@ public interface VideoMapper extends BaseMapper<Video> {
List
<
Video
>
listByCode
(
@Param
(
"code"
)
String
code
);
List
<
Video
>
selectListBySourceId
(
Long
floorId
);
String
getParentSourceIds
(
String
childrenId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IBuilldService.java
View file @
2e23c0a5
...
...
@@ -302,10 +302,18 @@ public interface IBuilldService extends IService<Building> {
List
<
BuildingTreeVo
>
getBuildingVideoTreeNew
();
List
<
Map
<
String
,
Object
>>
getBuildingDetaiList
();
/**
* 查询指定楼层下装备、摄像头
* @param floorId 楼层id
* @return List<EquiplistSpecificBySystemVO>
*/
List
<
EquiplistSpecificBySystemVO
>
getPointInFloor
(
Long
floorId
);
/**
* 建筑树
* @param bizOrgCode 所在公司
* @return List<BuildingTreeVo>
*/
List
<
BuildingTreeVo
>
getBuildingTreeInOrgCode
(
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/AreaServiceImpl.java
View file @
2e23c0a5
...
...
@@ -279,7 +279,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
}
private
List
<
UnitAreaTreeVo
>
getChildrenFromData
(
Long
parentId
,
List
<
UnitAreaTreeVo
>
areaTreeList
)
{
return
areaTreeList
.
stream
().
filter
(
a
->
a
.
getParentId
().
equals
(
parentId
)).
peek
(
e
->
e
.
setChildren
(
getChildrenFromData
(
e
.
getId
(),
areaTreeList
))).
collect
(
Collectors
.
toList
());
return
areaTreeList
.
stream
().
filter
(
a
->
parentId
.
equals
(
a
.
getParentId
()
)).
peek
(
e
->
e
.
setChildren
(
getChildrenFromData
(
e
.
getId
(),
areaTreeList
))).
collect
(
Collectors
.
toList
());
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
View file @
2e23c0a5
...
...
@@ -50,9 +50,9 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
/**
* @author ZeHua Li
* @date 2020/11/12 15:48
...
...
@@ -124,7 +124,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Value
(
"${auth-key-fire-building:fire_building_info}"
)
private
String
authKey
;
@Value
(
"$
auth-key-fire-build-video:auth-key-fire-build-vide
o}"
)
@Value
(
"$
{auth-key-fire-build-video:fire_build_video_inf
o}"
)
private
String
buildVideoAuthKey
;
@Autowired
...
...
@@ -157,6 +157,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Value
(
"${firefightingsystem.equip.alarms.url}"
)
private
String
ffsEquipAlarmsUrl
;
final
String
ALL_BUILDING
=
"allBuilding"
;
/**
* @param groupCode
* @Description 根据groupCode查询allowOperation对应的操作菜单
...
...
@@ -288,7 +290,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
return
list
;
}
@Override
public
Object
saveForm
(
String
groupCode
,
String
companyCode
,
Map
<
String
,
Object
>
map
)
{
final
String
instanceId
=
"instanceId"
;
...
...
@@ -379,7 +381,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public
List
<
BuildingTreeVo
>
getBuildingTree
()
{
List
<
BuildingTreeVo
>
allListVo
=
getBuildingTreeVos
();
List
<
BuildingTreeVo
>
allListVo
=
getBuildingTreeVos
(
true
);
return
allListVo
.
stream
().
filter
(
s
->
"-1"
.
equals
(
s
.
getParentId
())).
map
(
s
->
{
BuildingTreeVo
t
=
new
BuildingTreeVo
();
Bean
.
copyExistPropertis
(
s
,
t
);
...
...
@@ -390,10 +392,15 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}).
collect
(
Collectors
.
toList
());
}
private
List
<
BuildingTreeVo
>
getBuildingTreeVos
()
{
@Override
public
List
<
Map
<
String
,
Object
>>
getBuildingDetaiList
()
{
return
iFormInstanceService
.
getSpecialChildrenList
(
null
);
}
private
List
<
BuildingTreeVo
>
getBuildingTreeVos
(
Boolean
isContainRootNode
)
{
FormGroup
formGroup
=
iFormGroupService
.
getByUniqueKey
(
GroupCodeEnum
.
ALL_BUILDING
.
getGroupCode
());
List
<
Map
<
String
,
Object
>>
allList
=
iFormInstanceService
.
getSpecialChildrenList
(
null
);
List
<
BuildingTreeVo
>
allListVo
=
buildBuildingData
(
formGroup
,
allList
);
List
<
BuildingTreeVo
>
allListVo
=
buildBuildingData
(
formGroup
,
allList
,
isContainRootNode
);
Map
<
Long
,
String
>
absolutePositionMap
=
getBuildingAbsolutePosition
(
allListVo
);
allListVo
.
forEach
(
s
->
s
.
setAbsolutePosition
(
absolutePositionMap
.
get
(
s
.
getId
())));
return
allListVo
;
...
...
@@ -402,7 +409,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public
List
<
BuildingTreeVo
>
getBuildingTierTree
(
Integer
tier
)
{
if
(
tier
!=
null
)
{
List
<
BuildingTreeVo
>
list
=
getBuildingTreeVos
();
List
<
BuildingTreeVo
>
list
=
getBuildingTreeVos
(
true
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(
tier
==
1
)
{
List
<
BuildingTreeVo
>
collect
=
list
.
stream
().
filter
(
x
->
"-1"
.
equals
(
x
.
getParentId
())
||
"building"
.
equalsIgnoreCase
(
x
.
getGroupType
())).
collect
(
Collectors
.
toList
());
...
...
@@ -436,17 +443,21 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
}
private
List
<
BuildingTreeVo
>
buildBuildingData
(
FormGroup
formGroup
,
List
<
Map
<
String
,
Object
>>
allList
)
{
private
List
<
BuildingTreeVo
>
buildBuildingData
(
FormGroup
formGroup
,
List
<
Map
<
String
,
Object
>>
allList
,
Boolean
isContainRootNode
)
{
List
<
BuildingTreeVo
>
allListVo
=
Bean
.
listMap2ListBean
(
allList
,
BuildingTreeVo
.
class
);
BuildingTreeVo
treeNode
=
new
BuildingTreeVo
();
treeNode
.
setDetailPaneApi
(
address
);
treeNode
.
setApiUrl
(
apiUrl
);
treeNode
.
setInstanceId
(
formGroup
.
getId
());
treeNode
.
setInstanceName
(
formGroup
.
getGroupName
());
treeNode
.
setParentId
(
"-1"
);
treeNode
.
setGroupType
(
formGroup
.
getGroupType
());
treeNode
.
setGroupCode
(
formGroup
.
getGroupCode
());
allListVo
.
add
(
treeNode
);
if
(
isContainRootNode
)
{
BuildingTreeVo
treeNode
=
new
BuildingTreeVo
();
treeNode
.
setDetailPaneApi
(
address
);
treeNode
.
setApiUrl
(
apiUrl
);
treeNode
.
setName
(
formGroup
.
getGroupName
());
treeNode
.
setInstanceId
(
formGroup
.
getId
());
treeNode
.
setInstanceName
(
formGroup
.
getGroupName
());
treeNode
.
setParentId
(
"-1"
);
treeNode
.
setGroupType
(
formGroup
.
getGroupType
());
treeNode
.
setGroupCode
(
formGroup
.
getGroupCode
());
allListVo
.
add
(
treeNode
);
}
return
allListVo
;
}
...
...
@@ -760,19 +771,17 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public
Page
<
BuildingVideoVO
>
buildingVideoList
(
Page
page
,
BuildingVideoListVO
dto
)
{
Page
<
BuildingVideoVO
>
pages
=
videoService
.
pageBuildingVideo
(
page
,
dto
);
if
(
0
<
pages
.
getRecords
().
size
())
{
pages
.
getRecords
().
forEach
(
x
->
{
if
(
StringUtil
.
isNotEmpty
(
x
.
getLocation
())
&&
StringUtil
.
isNotEmpty
(
x
.
getAddress
()))
{
x
.
setLocation
(
x
.
getLocation
()
+
'-'
+
x
.
getAddress
());
}
else
{
if
(!
StringUtil
.
isNotEmpty
(
x
.
getLocation
()))
{
x
.
setLocation
(
x
.
getAddress
());
}
pages
.
getRecords
().
forEach
(
x
->
{
if
(
StringUtil
.
isNotEmpty
(
x
.
getLocation
())
&&
StringUtil
.
isNotEmpty
(
x
.
getAddress
()))
{
x
.
setLocation
(
x
.
getLocation
()
+
'-'
+
x
.
getAddress
());
}
else
{
if
(!
StringUtil
.
isNotEmpty
(
x
.
getLocation
()))
{
x
.
setLocation
(
x
.
getAddress
());
}
x
.
setVedioFormat
(
vedioFormat
);
x
.
setUrl
(
videoService
.
getVideoUrl
(
x
.
getName
(),
x
.
getPresetPosition
(),
x
.
getUrl
(),
x
.
getCode
())
);
}
);
}
}
x
.
setVedioFormat
(
vedioFormat
);
x
.
setUrl
(
videoService
.
getVideoUrl
(
x
.
getName
(),
x
.
getPresetPosition
(),
x
.
getUrl
(),
x
.
getCode
())
);
}
);
return
pages
;
}
...
...
@@ -1009,7 +1018,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
public
Map
<
Long
,
String
>
getBuildingAbsolutePosition
()
{
FormGroup
formGroup
=
iFormGroupService
.
getByUniqueKey
(
GroupCodeEnum
.
ALL_BUILDING
.
getGroupCode
());
List
<
Map
<
String
,
Object
>>
allList
=
iFormInstanceService
.
getSpecialChildrenList
(
null
);
List
<
BuildingTreeVo
>
allListVo
=
buildBuildingData
(
formGroup
,
allList
);
List
<
BuildingTreeVo
>
allListVo
=
buildBuildingData
(
formGroup
,
allList
,
true
);
return
getBuildingAbsolutePosition
(
allListVo
);
}
...
...
@@ -1106,14 +1115,21 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public
List
<
BuildingTreeVo
>
getCompanyBuildingTree
(
String
authKey
)
{
//1.组装数据
List
<
BuildingTreeVo
>
companyBuildingList
=
buildBuildingAndCompanyListVos
(
authKey
);
//2.list to tree
return
companyBuildingList
.
stream
().
filter
(
a
->
companyBuildingList
.
stream
().
noneMatch
(
c
->
c
.
getId
().
toString
().
equals
(
a
.
getParentId
()))).
peek
(
b
->
b
.
setChildren
(
getCompanyBuildingChildrenTree
(
b
.
getId
().
toString
(),
companyBuildingList
))).
collect
(
Collectors
.
toList
());
}
private
List
<
BuildingTreeVo
>
buildBuildingAndCompanyListVos
(
String
authKey
)
{
if
(
StringUtils
.
isEmpty
(
authKey
))
{
authKey
=
this
.
authKey
;
}
List
<
BuildingTreeVo
>
allListVo
=
getBuildingTreeVos
(
);
//
获取公司部门
list
List
<
BuildingTreeVo
>
buildingTreeVos
=
getBuildingTreeVos
(
false
);
//
1.获取公司
list
List
<
OrgUsrDto
>
orgUsrLists
=
jcsRemoteService
.
getCompanyDeptListWithAuth
(
authKey
,
"COMPANY"
);
AtomicReference
<
Boolean
>
flag
=
new
AtomicReference
<>(
false
);
List
<
BuildingTreeVo
>
co
llec
t
=
orgUsrLists
.
stream
().
map
(
orgUsrDto
->
{
// 2.数据结构转换
List
<
BuildingTreeVo
>
co
mpanyLis
t
=
orgUsrLists
.
stream
().
map
(
orgUsrDto
->
{
BuildingTreeVo
vo
=
new
BuildingTreeVo
();
vo
.
setGroupType
(
"allBuilding"
);
vo
.
setGroupCode
(
"allBuilding"
);
...
...
@@ -1124,59 +1140,53 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
vo
.
setName
(
orgUsrDto
.
getBizOrgName
());
vo
.
setId
(
orgUsrDto
.
getSequenceNbr
());
vo
.
setBizOrgName
(
orgUsrDto
.
getBizOrgName
());
vo
.
setTotal
(
allListVo
.
stream
().
filter
(
b
->
b
.
getBizOrgCode
()
!=
null
&&
b
.
getBizOrgCode
().
contains
(
vo
.
getBizOrgCode
())
&&
"building"
.
equals
(
b
.
getGroupType
())).
count
());
if
(
""
.
equals
(
orgUsrDto
.
getParentId
())
||
"-1"
.
equals
(
orgUsrDto
.
getParentId
())
||
null
==
orgUsrDto
.
getParentId
())
{
flag
.
set
(
true
);
}
vo
.
setTotal
(
buildingTreeVos
.
stream
().
filter
(
b
->
b
.
getBizOrgCode
()
!=
null
&&
b
.
getBizOrgCode
().
contains
(
vo
.
getBizOrgCode
())
&&
"building"
.
equals
(
b
.
getGroupType
())).
count
());
return
vo
;
}).
collect
(
Collectors
.
toList
());
allListVo
.
addAll
(
collect
);
return
allListVo
.
stream
().
filter
(
s
->
flag
.
get
()
?
"allBuilding"
.
equals
(
s
.
getGroupType
())
&&
s
.
getBizOrgCode
()
!=
null
&&
(
""
.
equals
(
s
.
getParentId
())
||
"-1"
.
equals
(
s
.
getParentId
())
||
null
==
s
.
getParentId
())
:
"allBuilding"
.
equals
(
s
.
getGroupType
())
&&
s
.
getBizOrgCode
()
!=
null
)
.
peek
(
m
->
m
.
setChildren
(
this
.
getCompanyBuildingChildrenTree
(
m
,
allListVo
)))
.
collect
(
Collectors
.
toList
());
// 3.将建筑的bizOrgCode转换为parentId连接树 ,拼接数据准备
Map
<
String
,
Long
>
comMap
=
companyList
.
stream
().
collect
(
Collectors
.
toMap
(
BuildingTreeVo:
:
getBizOrgCode
,
BuildingTreeVo:
:
getId
));
buildingTreeVos
.
forEach
(
b
->
{
b
.
setParentId
(
"0"
.
equals
(
b
.
getParentId
())
?
String
.
valueOf
(
comMap
.
get
(
b
.
getBizOrgCode
()))
:
b
.
getParentId
());
b
.
setDetailPaneApi
(
address
);
b
.
setApiUrl
(
apiUrl
);
});
// 4.组装树
companyList
.
addAll
(
buildingTreeVos
);
return
companyList
;
}
@Override
public
List
<
BuildingTreeVo
>
getBuildingVideoTreeNew
()
{
List
<
BuildingTreeVo
>
allListVo
=
getBuildingTreeVos
();
// 获取公司部门list
List
<
OrgUsrDto
>
orgUsrLists
=
jcsRemoteService
.
getCompanyDeptListWithAuth
(
buildVideoAuthKey
,
"COMPANY"
);
//1.组装数据
List
<
BuildingTreeVo
>
companyBuildingList
=
buildBuildingAndCompanyListVos
(
buildVideoAuthKey
);
List
<
Map
<
String
,
Long
>>
countList
=
iFormInstanceService
.
getBuildVideoCount
();
Map
<
Long
,
Long
>
map
=
countList
.
stream
().
collect
(
Collectors
.
toMap
(
p
->
p
.
get
(
"buildId"
),
p
->
p
.
get
(
"total"
)));
AtomicReference
<
Boolean
>
flag
=
new
AtomicReference
<>(
false
);
List
<
BuildingTreeVo
>
collect
=
orgUsrLists
.
stream
().
map
(
orgUsrDto
->
{
BuildingTreeVo
vo
=
new
BuildingTreeVo
();
vo
.
setGroupType
(
"allBuilding"
);
vo
.
setGroupCode
(
"allBuilding"
);
vo
.
setInstanceName
(
orgUsrDto
.
getBizOrgName
());
vo
.
setBizOrgCode
(
orgUsrDto
.
getBizOrgCode
());
vo
.
setInstanceId
(
orgUsrDto
.
getSequenceNbr
());
vo
.
setParentId
(
orgUsrDto
.
getParentId
());
vo
.
setName
(
orgUsrDto
.
getBizOrgName
());
vo
.
setId
(
orgUsrDto
.
getSequenceNbr
());
vo
.
setBizOrgName
(
orgUsrDto
.
getBizOrgName
());
if
(
""
.
equals
(
orgUsrDto
.
getParentId
())
||
"-1"
.
equals
(
orgUsrDto
.
getParentId
())
||
null
==
orgUsrDto
.
getParentId
())
{
flag
.
set
(
true
);
Map
<
Long
,
Long
>
countMap
=
countList
.
stream
().
collect
(
Collectors
.
toMap
(
p
->
p
.
get
(
"buildId"
),
p
->
p
.
get
(
"total"
)));
companyBuildingList
.
forEach
(
c
->
{
// 建筑类型数据,填充本级及子级包含的摄像头数量
if
(!
ALL_BUILDING
.
equals
(
c
.
getGroupType
()))
{
c
.
setTotal
(
countMap
.
get
(
c
.
getInstanceId
())
==
null
?
0L
:
countMap
.
get
(
c
.
getInstanceId
()));
}
else
{
// 方法 复用,覆盖掉不需要的数据
c
.
setTotal
(
0L
);
}
return
vo
;
}).
collect
(
Collectors
.
toList
());
});
//2.list to tree
return
companyBuildingList
.
stream
()
.
filter
(
a
->
companyBuildingList
.
stream
().
noneMatch
(
c
->
c
.
getId
().
toString
().
equals
(
a
.
getParentId
())))
.
peek
(
b
->
{
b
.
setChildren
(
getCompanyBuildingChildrenWithCount
(
b
.
getId
().
toString
(),
companyBuildingList
));
b
.
setTotal
(
b
.
getChildren
().
stream
().
filter
(
c
->
c
.
getTotal
()
!=
null
).
mapToLong
(
BuildingTreeVo:
:
getTotal
).
sum
());
}).
collect
(
Collectors
.
toList
());
}
allListVo
.
addAll
(
collect
);
return
allListVo
.
stream
().
filter
(
s
->
flag
.
get
()
?
"allBuilding"
.
equals
(
s
.
getGroupType
())
&&
s
.
getBizOrgCode
()
!=
null
&&
(
""
.
equals
(
s
.
getParentId
())
||
"-1"
.
equals
(
s
.
getParentId
())
||
null
==
s
.
getParentId
())
:
"allBuilding"
.
equals
(
s
.
getGroupType
())
&&
s
.
getBizOrgCode
()
!=
null
)
.
peek
(
m
->
{
List
<
BuildingTreeVo
>
treeVos
=
this
.
getCompanyBuildingChildrenTreeNew
(
m
,
allListVo
,
map
);
m
.
setChildren
(
treeVos
);
Long
total
=
0L
;
for
(
BuildingTreeVo
vo
:
treeVos
)
{
Long
aLong
=
vo
.
getTotal
();
total
+=
aLong
==
null
?
0
:
aLong
;
}
m
.
setTotal
(
total
);
})
.
collect
(
Collectors
.
toList
());
private
List
<
BuildingTreeVo
>
getCompanyBuildingChildrenWithCount
(
String
parentId
,
List
<
BuildingTreeVo
>
companyBuildingList
)
{
return
companyBuildingList
.
stream
().
filter
(
a
->
parentId
.
equals
(
a
.
getParentId
())).
peek
(
a
->
{
a
.
setChildren
(
getCompanyBuildingChildrenWithCount
(
a
.
getId
().
toString
(),
companyBuildingList
));
//单位类型节点才需要设置摄像头总数,建筑的下摄像头总数已经在sql计算出来
if
(
ALL_BUILDING
.
equals
(
a
.
getGroupType
()))
{
a
.
setTotal
(
a
.
getChildren
().
stream
().
filter
(
c
->
c
.
getTotal
()
!=
null
).
mapToLong
(
BuildingTreeVo:
:
getTotal
).
sum
());
}
}).
collect
(
Collectors
.
toList
());
}
@Override
...
...
@@ -1190,7 +1200,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
String
videoPointInScene
=
sourceScene
.
getVideoInScene
()
!=
null
?
sourceScene
.
getVideoInScene
()
:
""
;
//1.查询楼层下的所有装备list
List
<
EquiplistSpecificBySystemVO
>
equipmentSpecifics
=
equipmentSpecificMapper
.
getListByWarehouseStructureId
(
floorId
);
equipmentSpecifics
.
forEach
(
e
->{
equipmentSpecifics
.
forEach
(
e
->
{
//已经标记则为已绑定
e
.
setIsBound
(
equipPointInScene
.
contains
(
e
.
getId
().
toString
()));
e
.
setType
(
"装备点"
);
});
...
...
@@ -1198,92 +1209,33 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
//2.查询楼层下的所有视频list
List
<
Video
>
videos
=
videoMapper
.
selectListBySourceId
(
floorId
);
//3.数据加工
videos
.
forEach
(
v
->
{
videos
.
forEach
(
v
->
{
EquiplistSpecificBySystemVO
vo
=
new
EquiplistSpecificBySystemVO
();
vo
.
setId
(
v
.
getId
());
vo
.
setCode
(
v
.
getCode
());
vo
.
setCategoryName
(
v
.
getType
());
vo
.
setEquipmentName
(
v
.
getName
());
vo
.
setType
(
"视频点"
);
//已经标记则为已绑定
vo
.
setIsBound
(
videoPointInScene
.
contains
(
v
.
getId
().
toString
()));
bySystemVOS
.
add
(
vo
);
});
return
bySystemVOS
;
}
// @Override
// public List<BuildingTreeVo> getBuildingVideoTreeNew() {
// List<BuildingTreeVo> list = getCompanyBuildingTree(buildVideoAuthKey);
// if (!CollectionUtils.isEmpty(list)) {
// List<Map<String, Long>> countList = iFormInstanceService.getBuildVideoCount();
// if (!CollectionUtils.isEmpty(countList)) {
// Map<Long, Long> map = countList.stream().collect(Collectors.toMap(p->p.get("buildId"), p->p.get("total")));
// for (BuildingTreeVo treeVo : list) {
// List<BuildingTreeVo> children = treeVo.getChildren();
// if (!CollectionUtils.isEmpty(children)) {
// List<BuildingTreeVo> treeVoList = getBuildingVideoTotal(children, map);
// treeVo.setChildren(treeVoList);
// }
// treeVo.setTotal(map.get(treeVo.getInstanceId()));
// }
// }
// return list;
// }
// return Lists.newArrayList();
// }
//
// public List<BuildingTreeVo> getBuildingVideoTotal(List<BuildingTreeVo> children, Map<Long, Long> map) {
// for (BuildingTreeVo treeVo : children) {
// List<BuildingTreeVo> childrenList = treeVo.getChildren();
// if (!CollectionUtils.isEmpty(childrenList)) {
// getBuildingVideoTotal (childrenList, map);
// }
// treeVo.setTotal(map.get(treeVo.getInstanceId()));
// }
// return children;
// }
private
List
<
BuildingTreeVo
>
getCompanyBuildingChildrenTree
(
BuildingTreeVo
root
,
List
<
BuildingTreeVo
>
all
)
{
return
all
.
stream
().
filter
(
b
->
(
root
.
getId
()
!=
null
&&
StringUtil
.
isNotEmpty
(
b
.
getParentId
())
&&
b
.
getParentId
().
equals
(
root
.
getId
().
toString
()))
||
(
"allBuilding"
.
equals
(
root
.
getGroupType
())
&&
"building"
.
equals
(
b
.
getGroupType
())
&&
StringUtil
.
isNotEmpty
(
root
.
getBizOrgCode
())
&&
root
.
getBizOrgCode
().
equals
(
b
.
getBizOrgCode
())
&&
!
b
.
getId
().
equals
(
root
.
getId
())))
.
peek
(
m
->
{
m
.
setChildren
(
getCompanyBuildingChildrenTree
(
m
,
all
));
m
.
setDetailPaneApi
(
address
);
m
.
setApiUrl
(
apiUrl
);
})
.
collect
(
Collectors
.
toList
());
@Override
public
List
<
BuildingTreeVo
>
getBuildingTreeInOrgCode
(
String
bizOrgCode
)
{
List
<
BuildingTreeVo
>
buildingTreeVos
=
this
.
getBuildingTreeVos
(
true
);
List
<
BuildingTreeVo
>
orgBuildingTreeVos
=
buildingTreeVos
.
stream
().
filter
(
b
->
b
.
getBizOrgCode
()
!=
null
&&
b
.
getBizOrgCode
().
contains
(
bizOrgCode
)).
collect
(
Collectors
.
toList
());
return
buildingTreeVos
.
stream
().
filter
(
b
->
"-1"
.
equals
(
b
.
getParentId
())).
peek
(
b
->
{
b
.
setId
(
0L
);
b
.
setChildren
(
this
.
getCompanyBuildingChildrenTree
(
b
.
getId
().
toString
(),
orgBuildingTreeVos
));
}).
collect
(
Collectors
.
toList
());
}
private
List
<
BuildingTreeVo
>
getCompanyBuildingChildrenTreeNew
(
BuildingTreeVo
root
,
List
<
BuildingTreeVo
>
all
,
Map
<
Long
,
Long
>
map
)
{
return
all
.
stream
().
filter
(
b
->
(
root
.
getId
()
!=
null
&&
StringUtil
.
isNotEmpty
(
b
.
getParentId
())
&&
b
.
getParentId
().
equals
(
root
.
getId
().
toString
()))
||
(
"allBuilding"
.
equals
(
root
.
getGroupType
())
&&
"building"
.
equals
(
b
.
getGroupType
())
&&
StringUtil
.
isNotEmpty
(
root
.
getBizOrgCode
())
&&
root
.
getBizOrgCode
().
equals
(
b
.
getBizOrgCode
())
&&
!
b
.
getId
().
equals
(
root
.
getId
())))
.
peek
(
m
->
{
List
<
BuildingTreeVo
>
treeVos
=
getCompanyBuildingChildrenTreeNew
(
m
,
all
,
map
);
m
.
setChildren
(
treeVos
);
Long
aLong1
=
map
.
get
(
m
.
getInstanceId
());
if
(
aLong1
==
null
)
{
Long
total
=
0L
;
for
(
BuildingTreeVo
vo
:
treeVos
)
{
Long
aLong
=
vo
.
getTotal
();
total
+=
aLong
==
null
?
0
:
aLong
;
}
m
.
setTotal
(
total
);
}
else
{
m
.
setTotal
(
map
.
get
(
m
.
getInstanceId
()));
}
m
.
setDetailPaneApi
(
address
);
m
.
setApiUrl
(
apiUrl
);
})
.
collect
(
Collectors
.
toList
());
private
List
<
BuildingTreeVo
>
getCompanyBuildingChildrenTree
(
String
parentId
,
List
<
BuildingTreeVo
>
all
)
{
return
all
.
stream
().
filter
(
a
->
parentId
.
equals
(
a
.
getParentId
())).
peek
(
a
->
{
a
.
setChildren
(
getCompanyBuildingChildrenTree
(
a
.
getId
().
toString
(),
all
));
}).
collect
(
Collectors
.
toList
());
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
View file @
2e23c0a5
...
...
@@ -1162,9 +1162,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
carInfoVo
.
setEquipmentName
(
equipment
!=
null
?
equipment
.
getName
()
:
""
);
carInfoVo
.
setCategoryId
(
equipment
!=
null
?
equipment
.
getCategoryId
()
:
null
);
carInfoVo
.
setCategoryName
(
categoryMap
.
get
(
carInfoVo
.
getCategoryId
()));
carInfoVo
.
setName
(
car
.
getName
()+
"("
+
car
.
getCarNum
()+
")"
);
carInfoVo
.
setName
(
car
.
getName
());
if
(
car
.
getImg
()
!=
null
){
List
<
String
>
img
=
new
ArrayList
<>();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
2e23c0a5
...
...
@@ -191,11 +191,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
});
String
userId
=
remoteSecurityService
.
getAgencyUser
().
getUserId
();
vo
.
setRecUserId
(
userId
);
// 冗余名称,数据同步使用
this
.
setChargePersonName
(
vo
);
String
s
=
String
.
valueOf
(
System
.
currentTimeMillis
());
vo
.
setId
(
s
);
vo
.
setRecUserId
(
userId
);
vo
.
setSort
(
s
);
DynamicFormGroup
dynamicFormGroup
=
iEqDynamicFormGroupService
.
getById
(
vo
.
getFormGroupId
());
vo
.
setSystemType
(
dynamicFormGroup
.
getRelationId
()
!=
null
?
dynamicFormGroup
.
getRelationId
().
toString
()
:
""
);
...
...
@@ -273,8 +273,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
private
void
setChargePersonName
(
FireFightingSystemVo
vo
)
{
if
(
StringUtil
.
isNotEmpty
(
vo
.
get
ChargePerson
()))
{
FeignClientResult
<
AgencyUserModel
>
result
=
Privilege
.
agencyUserClient
.
queryByUserId
(
vo
.
get
ChargePerson
());
if
(
StringUtil
.
isNotEmpty
(
vo
.
get
RecUserId
()))
{
FeignClientResult
<
AgencyUserModel
>
result
=
Privilege
.
agencyUserClient
.
queryByUserId
(
vo
.
get
RecUserId
());
AgencyUserModel
userModel
=
result
==
null
?
new
AgencyUserModel
()
:
result
.
getResult
();
vo
.
setChargePersonName
(
userModel
.
getRealName
());
}
...
...
@@ -1040,7 +1040,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List
<
EquipmentCategory
>
equipmentTypeList
=
responseList
.
stream
()
.
filter
(
i
->
!
i
.
getCode
().
startsWith
(
"2"
)
&&
"2"
.
equals
(
i
.
getIndustryCode
()))
.
collect
(
Collectors
.
toList
());
List
<
EquipmentCategory
>
list
=
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
EQUIPMEN
T
);
List
<
EquipmentCategory
>
list
=
typeListTree
(
equipmentTypeList
,
bizOrgCode
,
SourceTypeEnum
.
IO
T
);
redisUtils
.
set
(
"iotTypeAndCount"
+
bizOrgCode
,
list
,
86400
);
return
list
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
View file @
2e23c0a5
...
...
@@ -100,15 +100,16 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
List
<
VideoSource
>
videoSources
=
new
ArrayList
<>();
if
(
videoSave
.
getIds
()
!=
null
&&
videoSave
.
getIds
().
size
()
>
0
)
{
videoSave
.
getIds
().
forEach
(
x
->
{
if
(
x
!=
null
&&
x
.
indexOf
(
"equip"
)
!=
-
1
)
{
if
(
x
!=
null
&&
x
.
contains
(
"equip"
)
)
{
VideoEquipmentSpecific
videoEquipmentSpecific
=
new
VideoEquipmentSpecific
();
videoEquipmentSpecific
.
setEquipmentSpecificId
(
Long
.
valueOf
(
x
.
substring
(
5
)));
videoEquipmentSpecific
.
setVideoId
(
videoSave
.
getVideo
().
getId
());
videoEquipmentSpecifics
.
add
(
videoEquipmentSpecific
);
}
else
if
(
x
!=
null
&&
x
.
indexOf
(
"region"
)
!=
-
1
)
{
}
else
if
(
x
!=
null
&&
x
.
contains
(
"region"
)
)
{
VideoSource
videoSource
=
new
VideoSource
();
videoSource
.
setVideoId
(
videoSave
.
getVideo
().
getId
());
videoSource
.
setSourceId
(
Long
.
valueOf
(
x
.
substring
(
6
)));
videoSource
.
setParentSourceIds
(
getParentSourceIds
(
videoSource
.
getSourceId
().
toString
()));
videoSources
.
add
(
videoSource
);
}
});
...
...
@@ -130,6 +131,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
return
videoSave
.
getVideo
();
}
private
String
getParentSourceIds
(
String
childrenId
){
return
this
.
videoMapper
.
getParentSourceIds
(
childrenId
);
}
@Transactional
@Override
public
Boolean
delVideo
(
List
<
Long
>
ids
)
{
...
...
@@ -173,15 +178,16 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
List
<
VideoSource
>
videoSources
=
new
ArrayList
<>();
if
(
videoSave
.
getIds
()
!=
null
&&
videoSave
.
getIds
().
size
()
>
0
)
{
videoSave
.
getIds
().
forEach
(
x
->
{
if
(
x
!=
null
&&
x
.
indexOf
(
"equip"
)
!=
-
1
)
{
if
(
x
!=
null
&&
x
.
contains
(
"equip"
)
)
{
VideoEquipmentSpecific
videoEquipmentSpecific
=
new
VideoEquipmentSpecific
();
videoEquipmentSpecific
.
setEquipmentSpecificId
(
Long
.
valueOf
(
x
.
substring
(
5
)));
videoEquipmentSpecific
.
setVideoId
(
videoSave
.
getVideo
().
getId
());
videoEquipmentSpecifics
.
add
(
videoEquipmentSpecific
);
}
else
if
(
x
!=
null
&&
x
.
indexOf
(
"region"
)
!=
-
1
)
{
}
else
if
(
x
!=
null
&&
x
.
contains
(
"region"
)
)
{
VideoSource
videoSource
=
new
VideoSource
();
videoSource
.
setVideoId
(
videoSave
.
getVideo
().
getId
());
videoSource
.
setSourceId
(
Long
.
valueOf
(
x
.
substring
(
6
)));
videoSource
.
setParentSourceIds
(
getParentSourceIds
(
videoSource
.
getSourceId
().
toString
()));
videoSources
.
add
(
videoSource
);
}
});
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/WarehouseStructureServiceImpl.java
View file @
2e23c0a5
...
...
@@ -122,7 +122,7 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur
for
(
WarehouseStructure
it
:
treeNodes
)
{
if
(
treeNode
.
getId
().
equals
(
it
.
getParentId
()))
{
if
(
treeNode
.
getChildren
()
==
null
)
{
treeNode
.
setChildren
(
new
ArrayList
<
WarehouseStructure
>());
treeNode
.
setChildren
(
new
ArrayList
<>());
}
treeNode
.
getChildren
().
add
(
findChildren
(
it
,
treeNodes
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
View file @
2e23c0a5
...
...
@@ -83,6 +83,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersWorkexperience
;
import
com.yeejoin.amos.boot.module.common.api.entity.KeySite
;
import
com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment
;
...
...
@@ -786,7 +787,9 @@ public class ExcelServiceImpl {
}
private
void
excelImportFireStation
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireStationDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireStationDto
.
class
,
1
);
Map
<
String
,
String
>
maps
=
getAllBuildingIdForParentBuilingIds
(
excelDtoList
);
List
<
FireStation
>
excelEntityList
=
new
ArrayList
<>();
excelDtoList
.
forEach
(
item
->
{
FireStation
fireStation
=
new
FireStation
();
...
...
@@ -796,6 +799,9 @@ public class ExcelServiceImpl {
String
[]
whereBuilding
=
fireStation
.
getWhereBuilding
().
split
(
"@"
);
fireStation
.
setWhereBuilding
(
whereBuilding
[
0
]);
fireStation
.
setWhereBuildingId
(
whereBuilding
[
1
]);
if
(
maps
.
containsKey
(
whereBuilding
[
1
])){
fireStation
.
setParentBuildingId
(
maps
.
get
(
whereBuilding
[
1
]));
}
}
if
(
fireStation
.
getBizCompany
()
!=
null
)
{
String
[]
bizCompany
=
fireStation
.
getBizCompany
().
split
(
"@"
);
...
...
@@ -817,7 +823,17 @@ public class ExcelServiceImpl {
});
fireStationService
.
saveBatch
(
excelEntityList
);
}
public
Map
<
String
,
String
>
getAllBuildingIdForParentBuilingIds
(
List
<
FireStationDto
>
excelDtoList
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
for
(
FireStationDto
fireStation
:
excelDtoList
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
fireStation
.
getWhereBuilding
()))
{
String
[]
whereBuilding
=
fireStation
.
getWhereBuilding
().
split
(
"@"
);
fireStation
.
setWhereBuildingId
(
whereBuilding
[
1
]);
list
.
add
(
whereBuilding
[
1
]);
}
}
return
keySiteService
.
getNodeAllParentIds
(
list
);
}
private
void
excelImportFireTeam
(
MultipartFile
multipartFile
)
throws
Exception
{
List
<
FireTeamDto
>
excelDtoList
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
FireTeamDto
.
class
,
1
);
List
<
FireTeam
>
excelEntityList
=
new
ArrayList
<>();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/feign/JCSFeignClient.java
View file @
2e23c0a5
...
...
@@ -75,4 +75,13 @@ public interface JCSFeignClient {
**/
@RequestMapping
(
value
=
"jcs/org-usr/amos/{orgUserId}"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
AgencyUserModel
>
getAmosIdByUserId
(
@PathVariable
String
orgUserId
);
/**
* 根据机场单位id获取单位人员列表
*
* @param companyIds 机场单位ids
* @return
*/
@RequestMapping
(
value
=
"jcs/org-usr/company/person/list"
,
method
=
RequestMethod
.
GET
)
FeignClientResult
<
List
<
OrgUsrFormDto
>>
getPersonListByCompanyIdList
(
@RequestParam
(
"companyIds"
)
String
companyIds
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/PlanTaskServiceImpl.java
View file @
2e23c0a5
...
...
@@ -8,18 +8,23 @@ import com.google.common.base.Joiner;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.supervision.business.constants.XJConstant
;
import
com.yeejoin.amos.supervision.business.dao.mapper.PlanMapper
;
import
com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper
;
import
com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskMapper
;
import
com.yeejoin.amos.supervision.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.supervision.business.dao.mapper.RoutePointItemMapper
;
import
com.yeejoin.amos.supervision.business.dao.repository.*
;
import
com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto
;
import
com.yeejoin.amos.supervision.business.entity.mybatis.CheckChkExListBo
;
import
com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo
;
import
com.yeejoin.amos.supervision.business.feign.Business
;
import
com.yeejoin.amos.supervision.business.feign.EquipFeign
;
import
com.yeejoin.amos.supervision.business.feign.JCSFeignClient
;
import
com.yeejoin.amos.supervision.business.param.CheckPtListPageParam
;
import
com.yeejoin.amos.supervision.business.param.PlanTaskPageParam
;
import
com.yeejoin.amos.supervision.business.service.intfc.ICheckService
;
...
...
@@ -43,15 +48,16 @@ import com.yeejoin.amos.supervision.dao.entity.Check;
import
com.yeejoin.amos.supervision.dao.entity.Plan
;
import
com.yeejoin.amos.supervision.dao.entity.PlanTask
;
import
com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail
;
import
com.yeejoin.amos.supervision.dao.entity.Point
;
import
com.yeejoin.amos.supervision.exception.YeeException
;
import
com.yeejoin.amos.supervision.feign.RemoteSecurityService
;
import
com.yeejoin.amos.supervision.quartz.IJobService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.ibatis.annotations.Param
;
import
org.assertj.core.util.Lists
;
import
com.google.common.collect.Lists
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
...
...
@@ -113,6 +119,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired
RedisUtils
redisUtils
;
@Autowired
PointMapper
pointMapper
;
@Autowired
private
JCSFeignClient
jcsFeignClient
;
// 防火监督检查负责人角色名称
@Value
(
"${supervision.person.charger.role:Person_charge_unit_fire_protection_supervision_inspection}"
)
private
String
supervisionPersonChargerRole
;
@Override
public
Page
<
HashMap
<
String
,
Object
>>
getPlanTaskInfo
(
PlanTaskPageParam
params
)
{
long
total
=
planTaskMapper
.
countPlanTask
(
params
);
...
...
@@ -537,9 +553,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表
planTaskDetail
.
saveAndFlush
(
planTaskDetailInstance
);
// 规则推送消息
rulePlanService
.
addPlanRule
(
plan
,
null
,
RuleTypeEnum
.
计划生成
,
pointId
.
longValue
());
}
sendMessage
(
plan
);
// 定时任务监控
jobService
.
planTaskAddJob
(
planTask
);
}
...
...
@@ -570,6 +585,34 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}
public
void
sendMessage
(
Plan
plan
)
throws
Exception
{
// 查询检查对象对应防火监督负责人id
List
<
String
>
extraUserIds
=
Lists
.
newArrayList
();
List
<
Point
>
pointList
=
pointMapper
.
getPointByPlanId
(
String
.
valueOf
(
plan
.
getId
()));
if
(!
ValidationUtil
.
isEmpty
(
pointList
))
{
List
<
String
>
originalIdList
=
Lists
.
transform
(
pointList
,
Point:
:
getOriginalId
);
List
<
OrgUsrFormDto
>
personList
=
jcsFeignClient
.
getPersonListByCompanyIdList
(
Joiner
.
on
(
","
).
join
(
originalIdList
)).
getResult
();
List
<
String
>
personIdList
=
Lists
.
transform
(
personList
,
OrgUsrFormDto:
:
getAmosOrgId
);
List
<
RoleModel
>
roleList
=
Privilege
.
roleClient
.
queryRoleList
(
supervisionPersonChargerRole
,
null
).
getResult
();
if
(!
ValidationUtil
.
isEmpty
(
roleList
))
{
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
String
.
valueOf
(
roleList
.
get
(
0
).
getSequenceNbr
()),
null
).
getResult
();
if
(!
ValidationUtil
.
isEmpty
(
agencyUserModelList
))
{
agencyUserModelList
.
forEach
(
userModel
->
{
if
(
personIdList
.
contains
(
userModel
.
getUserId
()))
{
extraUserIds
.
add
(
userModel
.
getUserId
());
}
});
}
}
}
log
.
info
(
String
.
format
(
"计划对象:%s"
,
JSON
.
toJSON
(
plan
)));
// 规则推送消息
rulePlanService
.
addPlanRule
(
plan
,
null
,
RuleTypeEnum
.
计划生成
,
extraUserIds
);
}
@Override
public
List
<
PlanTask
>
getPlanTaskByRouteId
(
Long
routeId
)
{
List
<
PlanTask
>
planTaskList
=
planTaskMapper
.
getPlanTaskByRouteId
(
routeId
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/PointServiceImpl.java
View file @
2e23c0a5
...
...
@@ -1211,10 +1211,10 @@ public class PointServiceImpl implements IPointService {
if
(!
ObjectUtils
.
isEmpty
(
hiddenDangerList
))
{
String
ids
=
Joiner
.
on
(
","
).
join
(
hiddenDangerList
.
stream
().
map
(
HiddenDanger:
:
getLatentDangerId
).
collect
(
Collectors
.
toList
()));
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"
i
ds"
,
ids
);
map
.
put
(
"
dangerI
ds"
,
ids
);
FeignClientResult
<
List
<
DangerDto
>>
listFeignClientResult
=
dangerFeignClient
.
listAll
(
map
);
if
(
ObjectUtils
.
isEmpty
(
listFeignClientResult
.
getResult
())
||
listFeignClientResult
.
getStatus
()
!=
HTTP_OK_STATUS
)
{
throw
new
RuntimeException
(
listFeignClientResult
.
getDevMessage
()
);
if
(
listFeignClientResult
.
getStatus
()
!=
HTTP_OK_STATUS
)
{
throw
new
RuntimeException
(
"服务调用异常"
);
}
List
<
DangerDto
>
dangerDtoList
=
listFeignClientResult
.
getResult
();
if
(!
ObjectUtils
.
isEmpty
(
dangerDtoList
))
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/RulePlanService.java
View file @
2e23c0a5
...
...
@@ -43,23 +43,14 @@ public class RulePlanService {
private
final
String
packageId
=
"消息/addPlanRule"
;
private
final
String
msgType
=
"supervision"
;
@Value
(
"${supervision.person.charger.role:Person_charge_unit_fire_protection_supervision_inspection}"
)
private
String
supervisionPersonChargerRole
;
@Autowired
private
RuleTrigger
ruleTrigger
;
@Autowired
private
JCSFeignClient
jcsFeignClient
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
@Autowired
private
PointServiceImpl
pointService
;
public
Boolean
addPlanRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
Long
pointId
)
throws
Exception
{
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
,
pointId
);
public
Boolean
addPlanRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
List
<
String
>
extraUserIds
)
throws
Exception
{
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
,
extraUserIds
);
//触发规则
ruleTrigger
.
publish
(
planRo
,
packageId
,
new
String
[
0
]);
return
true
;
...
...
@@ -73,7 +64,7 @@ public class RulePlanService {
return
true
;
}
private
PlanRo
buildPlanRo
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
L
ong
pointId
)
{
private
PlanRo
buildPlanRo
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
L
ist
<
String
>
extraUserIds
)
{
// 设置token
// if (ValidationUtil.isEmpty(RequestContext.getToken())) {
// Toke tokenObj = remoteSecurityService.getServerToken();
...
...
@@ -112,28 +103,15 @@ public class RulePlanService {
leadPeopleIds
+=
","
+
plan
.
getUserId
();
}
userIds
=
(
List
<
String
>)
jcsFeignClient
.
getAmosIdListByUserIds
(
leadPeopleIds
).
getResult
();
// pointId是被检查单位id
if
(!
ValidationUtil
.
isEmpty
(
pointId
))
{
Point
point
=
pointService
.
queryPointById
(
pointId
);
List
<
OrgUsrFormDto
>
personList
=
jcsFeignClient
.
getPersonListByCompanyId
(
point
.
getOriginalId
()).
getResult
();
List
<
String
>
personIdList
=
Lists
.
transform
(
personList
,
OrgUsrFormDto:
:
getAmosOrgId
);
List
<
RoleModel
>
roleList
=
Privilege
.
roleClient
.
queryRoleList
(
supervisionPersonChargerRole
,
null
).
getResult
();
if
(!
ValidationUtil
.
isEmpty
(
roleList
))
{
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
String
.
valueOf
(
roleList
.
get
(
0
).
getSequenceNbr
()),
null
).
getResult
();
if
(!
ValidationUtil
.
isEmpty
(
agencyUserModelList
))
{
List
<
String
>
finalUserIds
=
userIds
;
agencyUserModelList
.
forEach
(
userModel
->
{
if
(
personIdList
.
contains
(
userModel
.
getUserId
())
&&
!
finalUserIds
.
contains
(
userModel
.
getUserId
()))
{
finalUserIds
.
add
(
userModel
.
getUserId
());
}
});
userIds
=
finalUserIds
;
}
}
if
(!
ValidationUtil
.
isEmpty
(
extraUserIds
))
{
List
<
String
>
finalUserIds
=
userIds
;
extraUserIds
.
forEach
(
id
->
{
if
(!
finalUserIds
.
contains
(
id
))
{
finalUserIds
.
add
(
id
);
}
}
});
userIds
=
finalUserIds
;
}
planRo
.
setSendTime
(
DateUtil
.
date2LongStr
(
new
Date
()));
planRo
.
setRecivers
(
userIds
);
...
...
amos-boot-system-equip/src/main/resources/changelog/wl-3.0.1.xml
View file @
2e23c0a5
...
...
@@ -2385,4 +2385,46 @@
alter table `wl_equipment_specific` modify column `team_id` varchar(32) DEFAULT NULL COMMENT '所属队伍id(来源于平台)';
</sql>
</changeSet>
<changeSet
author=
"shg"
id=
"1644459872903-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"wl_video_source"
columnName=
"parent_source_ids"
/>
</not>
</preConditions>
<comment>
wl_video_source add column parent_source_ids 本级及父级建筑ids,冗余树形搜索
</comment>
<sql>
alter table `wl_video_source` add column `parent_source_ids` text COMMENT '本级及父级建筑ids,冗余树形搜索';
</sql>
</changeSet>
<changeSet
author=
"shg"
id=
"1644459872903-1"
runAlways=
"true"
>
<comment>
`getBuildingParentIds` 存在前后顺序依赖关系所以放在这里
</comment>
<sql
endDelimiter=
"#"
>
DROP FUNCTION IF EXISTS `getBuildingParentIds`#
CREATE DEFINER=`root`@`%` FUNCTION `getBuildingParentIds`(`childrenId` VARCHAR(32)) RETURNS varchar(1000) CHARSET utf8
BEGIN
DECLARE ptemp VARCHAR(1000);
DECLARE ctemp VARCHAR(1000);
DECLARE ctempName VARCHAR(1000);
SET ptemp ='';
SET ctemp = childrenId;
WHILE ctemp != '0' DO
SET ptemp = concat(ptemp,',',ctemp);
SELECT IFNULL((SELECT parentId
FROM get_building_tree
WHERE instanceId = ctemp),'0') INTO ctemp;
END WHILE;
SET ptemp = SUBSTR(ptemp,2);
RETURN ptemp;
END#
</sql>
</changeSet>
<changeSet
author=
"shg"
id=
"1644459872903-3"
>
<preConditions
onFail=
"MARK_RAN"
>
<columnExists
tableName=
"wl_video_source"
columnName=
"parent_source_ids"
/>
</preConditions>
<comment>
wl_video_source 存量数据修改parent_source_ids
</comment>
<sql>
update wl_video_source s set s.parent_source_ids = (SELECT getBuildingParentIds(s.source_id)) ;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
2e23c0a5
...
...
@@ -663,13 +663,13 @@
<if
test=
"equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''"
>
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if>
)s1
)s1
WHERE 1=1
<if
test=
"equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''"
>
where
s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
AND
s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if>
<if
test=
"equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''"
>
where
s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
AND
s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if>
...
...
@@ -745,7 +745,7 @@
</if>
)s2
<if
test=
"equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''"
>
where
s2.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
AND
s2.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if>
<if
test=
"equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''"
>
where s2.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
...
...
@@ -1844,13 +1844,13 @@ FROM
<if
test=
"equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''"
>
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if>
)s1
)s1
WHERE 1=1
<if
test=
"equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''"
>
where
s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
AND
s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if>
<if
test=
"equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''"
>
where
s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
AND
s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if>
order by createDate DESC
</select>
...
...
@@ -1960,13 +1960,13 @@ FROM
<if
test=
"equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''"
>
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if>
)s1
)s1
WHERE 1=1
<if
test=
"equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''"
>
where
s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
and
s1.full_name LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if>
<if
test=
"equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''"
>
where
s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
and
s1.bizOrgCode LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if>
...
...
amos-boot-system-equip/src/main/resources/mapper/FormInstanceMapper.xml
View file @
2e23c0a5
...
...
@@ -502,7 +502,7 @@ WHERE
COUNT( vs.video_id ) AS total
FROM
get_building_tree b
LEFT JOIN wl_video_source vs ON FIND_IN_SET(
vs.source_id, getBuildChildIdsByRootId ( b.instanceId )
)
LEFT JOIN wl_video_source vs ON FIND_IN_SET(
b.instanceId, vs.parent_source_ids
)
GROUP BY
b.instanceId
</select>
...
...
amos-boot-system-equip/src/main/resources/mapper/VideoMapper.xml
View file @
2e23c0a5
...
...
@@ -61,14 +61,15 @@
v.token AS token,
v.url AS url,
v.code AS code,
getBuildingNames(vc.source_id)
as location,
ws.full_name
as location,
v.address,
v.preset_position as presetPosition
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
left join wl_warehouse_structure ws on ws.id = vc.source_id
<where>
<if
test=
"dto.buildingId!=null and dto.buildingId!=''"
>
FIND_IN_SET(
vc.source_id, getBuildChildIdsByRootId(#{dto.buildingId})
)
FIND_IN_SET(
#{dto.buildingId}, vc.parent_source_ids
)
</if>
<if
test=
"dto.bizOrgCode!=null and dto.bizOrgCode!=''"
>
and v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%')
...
...
@@ -377,4 +378,7 @@
where vs.source_id = #{floorId}
and vs.video_id = v.id
</select>
<select
id=
"getParentSourceIds"
resultType=
"java.lang.String"
>
select getBuildingParentIds(#{childrenId})
</select>
</mapper>
amos-boot-system-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
View file @
2e23c0a5
...
...
@@ -2723,7 +2723,29 @@
</sql>
</changeSet>
<changeSet
id=
"chenhao-2022-02-08-1"
author=
"chenhao"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"cb_key_site"
columnName=
"parent_building_id"
/>
</not>
</preConditions>
<comment>
cb_key_site add column parent_building_id 所属建筑节点的所有父节点id集合
</comment>
<sql>
ALTER TABLE cb_key_site ADD parent_building_id varchar(500) NULL COMMENT '所属建筑节点的所有父节点id集合';
</sql>
</changeSet>
<changeSet
id=
"chenhao-2022-02-09-1"
author=
"chenhao"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"cb_fire_station"
columnName=
"parent_building_id"
/>
</not>
</preConditions>
<comment>
cb_fire_station add column parent_building_id 所属建筑节点的所有父节点id集合
</comment>
<sql>
ALTER TABLE cb_fire_station ADD parent_building_id varchar(1000) NULL COMMENT '所属建筑节点的所有父节点id集合';
</sql>
</changeSet>
<changeSet
author=
"tw"
id=
"20220207-1"
runAlways=
"true"
>
<comment>
`getParentList`
</comment>
<sql
endDelimiter=
"#"
>
...
...
@@ -2748,7 +2770,5 @@
END#
</sql>
</changeSet>
</databaseChangeLog>
amos-boot-system-supervision/src/main/resources/application-dev.properties
View file @
2e23c0a5
...
...
@@ -4,7 +4,7 @@ spring.datasource.url = jdbc:mysql://172.16.6.60:3306/amos_supervision_v1\
spring.datasource.username
=
root
spring.datasource.password
=
root_123
## eureka properties:
eureka.client.serviceUrl.defaultZone
=
http://172.16.
10.72
:10001/eureka/
eureka.client.serviceUrl.defaultZone
=
http://172.16.
3.135
:10001/eureka/
security.password
=
a1234560
security.loginId
=
jc_wjk006
...
...
@@ -13,10 +13,10 @@ security.productApp=STUDIO_APP_MOBILE
security.appKey
=
studio_normalapp_3168830
#redis 配置
spring.redis.database
=
0
spring.redis.host
=
172.16.
10.85
spring.redis.database
=
1
spring.redis.host
=
172.16.
6.60
spring.redis.port
=
6379
spring.redis.password
=
amos2019Redis
spring.redis.password
=
yeejoin@2020
spring.redis.jedis.pool.max-active
=
200
spring.redis.jedis.pool.max-wait
=
-1
spring.redis.jedis.pool.max-idle
=
10
...
...
@@ -29,7 +29,7 @@ params.isPush = false
params.work.flow.normalProcessDefinitionKey
=
normalHazardManagement
params.work.flow.processDefinitionKey
=
hazardManagement
params.work.flow.address
=
http://172.16.1
0.8
0:30040
params.work.flow.address
=
http://172.16.1
1.3
0:30040
params.spc.address
=
http://172.16.3.89:9001
#websocket
...
...
@@ -46,10 +46,11 @@ linux.img.path = /
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}-1
emqx.broker
=
tcp://
172.16.10.85
:1883
emqx.broker
=
tcp://
39.98.45.134
:1883
emqx.user-name
=
super
emqx.password
=
a123456
emqx.max-inflight
=
1000
rule.definition.localIp
=
172.16.3.121
file.url
=
http://39.98.45.134:9000/
\ No newline at end of file
rule.definition.localIp
=
172.16.3.89
file.url
=
http://39.98.45.134:9000/
supervision.person.charger.role
=
Person_charge_unit_fire_protection_supervision_inspection
\ No newline at end of file
amos-boot-system-supervision/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
2e23c0a5
...
...
@@ -2041,12 +2041,12 @@
<!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}-->
<!-- </if>-->
ORDER BY c.check_time DESC
<choose>
<when
test=
"pageSize==-1"
></when>
<when
test=
"pageSize!=-1"
>
limit #{offset},#{pageSize}
</when>
</choose>
</where>
ORDER BY c.check_time DESC
<choose>
<when
test=
"pageSize==-1"
></when>
<when
test=
"pageSize!=-1"
>
limit #{offset},#{pageSize}
</when>
</choose>
</select>
<select
id=
"getCheckListByTaskId"
resultType=
"com.yeejoin.amos.supervision.dao.entity.Check"
>
...
...
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