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
511e15ba
Commit
511e15ba
authored
Feb 09, 2022
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交微型消防站和重点部位的优化项代码
parent
9e1cf2b1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
829 additions
and
431 deletions
+829
-431
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
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
+2
-0
KeySiteMapper.java
...oin/amos/boot/module/common/api/mapper/KeySiteMapper.java
+10
-3
IKeySiteService.java
.../amos/boot/module/common/api/service/IKeySiteService.java
+8
-0
FireStationMapper.xml
...ommon-api/src/main/resources/mapper/FireStationMapper.xml
+65
-46
KeySiteMapper.xml
...le-common-api/src/main/resources/mapper/KeySiteMapper.xml
+114
-85
FireStationController.java
...t/module/common/biz/controller/FireStationController.java
+9
-0
KeySiteController.java
.../boot/module/common/biz/controller/KeySiteController.java
+229
-208
FireStationServiceImpl.java
...odule/common/biz/service/impl/FireStationServiceImpl.java
+91
-0
KeySiteServiceImpl.java
...ot/module/common/biz/service/impl/KeySiteServiceImpl.java
+189
-59
BuildingController.java
...om/yeejoin/equipmanage/controller/BuildingController.java
+6
-1
JcsFeign.java
...src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
+2
-2
IBuilldService.java
.../java/com/yeejoin/equipmanage/service/IBuilldService.java
+2
-0
BuildingServiceImpl.java
...yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
+57
-21
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+17
-1
No files found.
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 @
511e15ba
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 @
511e15ba
...
...
@@ -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/entity/FireStation.java
View file @
511e15ba
...
...
@@ -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 @
511e15ba
...
...
@@ -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 @
511e15ba
...
...
@@ -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 @
511e15ba
...
...
@@ -58,4 +58,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 @
511e15ba
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 接口
*
...
...
@@ -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/service/IKeySiteService.java
View file @
511e15ba
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.MenuFrom
;
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
;
...
...
@@ -9,6 +12,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
java.util.List
;
import
java.util.Map
;
/**
* 重点部位接口类
...
...
@@ -75,4 +79,8 @@ 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
)
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/FireStationMapper.xml
View file @
511e15ba
<?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
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND biz_org_code = #{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 @
511e15ba
...
...
@@ -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
...
...
@@ -54,69 +61,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 +149,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 +172,29 @@
<select
id=
"getAddress"
resultType=
"string"
>
SELECT
cb_key_site.address_desc
cb_key_site.address_desc
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 != ''
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
WHERE
is_delete=false
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
and biz_org_code = #{bizOrgCode}
</if>
GROUP BY
cb_key_site.address_desc
building_id
</select>
</mapper>
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 @
511e15ba
...
...
@@ -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/KeySiteController.java
View file @
511e15ba
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,200 +58,209 @@ import java.util.Map;
@RequestMapping
(
value
=
"/common/key-site"
)
public
class
KeySiteController
extends
BaseController
{
@Autowired
KeySiteServiceImpl
keySiteServiceImpl
;
@Autowired
IKeySiteService
keySiteService
;
@Autowired
IOrgUsrService
iOrgUsrService
;
@Autowired
SourceFileServiceImpl
sourceFileService
;
@Autowired
EquipFeignClient
equipFeignClient
;
@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
);
}
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
)
@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
);
}
}
@Autowired
KeySiteServiceImpl
keySiteServiceImpl
;
@Autowired
IKeySiteService
keySiteService
;
@Autowired
IOrgUsrService
iOrgUsrService
;
@Autowired
SourceFileServiceImpl
sourceFileService
;
@Autowired
EquipFeignClient
equipFeignClient
;
@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
);
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
;
}
/**
* 根据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
)
@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
);
}
}
@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/service/impl/FireStationServiceImpl.java
View file @
511e15ba
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
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 +15,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 +28,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 +48,12 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
FireStationMapper
fireStationMapper
;
@Autowired
OrgUsrMapper
orgUsrMapper
;
@Autowired
OrgUsrServiceImpl
orgUsrService
;
@Autowired
EquipFeignClient
equipFeignClient
;
/**
* 分页查询
*/
...
...
@@ -200,4 +209,86 @@ 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
();
return
getNodeAllParentIds
(
list
,
map
.
get
(
"parentId"
).
toString
(),
tegartString
);
}
}
return
tegartString
;
}
}
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 @
511e15ba
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
static
org
.
hamcrest
.
CoreMatchers
.
nullValue
;
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
;
...
...
@@ -8,12 +31,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
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 +51,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 +84,14 @@ 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
)
{
return
keySiteMapper
.
getPageList
(
page
,
name
,
buildingId
,
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,15 @@ 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
());
return
menu
;
...
...
@@ -247,12 +273,14 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
public
KeySiteDto
getSequenceNbr
(
Long
sequenceNbr
)
{
return
keySiteMapper
.
getSequenceNbr
(
sequenceNbr
);
}
@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 +288,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 +324,54 @@ 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 +386,102 @@ 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
)
{
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
;
}
return
parseTree
((
List
<
Map
<
String
,
Object
>>)
buildingMapList
.
get
(
0
).
get
(
"children"
),
keySiteCountMap
);
}
@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
>
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
.
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
();
return
getNodeAllParentIds
(
list
,
map
.
get
(
"parentId"
).
toString
(),
tegartString
);
}
}
return
tegartString
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/BuildingController.java
View file @
511e15ba
...
...
@@ -103,7 +103,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"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
View file @
511e15ba
...
...
@@ -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/service/IBuilldService.java
View file @
511e15ba
...
...
@@ -309,4 +309,6 @@ public interface IBuilldService extends IService<Building> {
List
<
BuildingTreeVo
>
getCompanyBuildingTree
(
String
authKey
);
List
<
BuildingTreeVo
>
getBuildingVideoTreeNew
();
List
<
Map
<
String
,
Object
>>
getBuildingDetaiList
();
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/BuildingServiceImpl.java
View file @
511e15ba
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Stack
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -13,10 +37,21 @@ import com.yeejoin.amos.feign.morphic.model.ResourceDTO;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.equipmanage.common.dto.OrgUsrDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.Building
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificRelation
;
import
com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity
;
import
com.yeejoin.equipmanage.common.entity.FormGroup
;
import
com.yeejoin.equipmanage.common.entity.FormInstance
;
import
com.yeejoin.equipmanage.common.entity.SourceFile
;
import
com.yeejoin.equipmanage.common.entity.SourceScene
;
import
com.yeejoin.equipmanage.common.entity.StockDetail
;
import
com.yeejoin.equipmanage.common.entity.dto.BuildIsRiskDTO
;
import
com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO
;
import
com.yeejoin.equipmanage.common.entity.vo.*
;
import
com.yeejoin.equipmanage.common.entity.vo.BuildingListVO
;
import
com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO
;
import
com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO
;
import
com.yeejoin.equipmanage.common.entity.vo.PointTreeVo
;
import
com.yeejoin.equipmanage.common.enums.GroupCodeEnum
;
import
com.yeejoin.equipmanage.common.enums.GroupTypeEnum
;
import
com.yeejoin.equipmanage.common.enums.IndustryEnum
;
...
...
@@ -28,30 +63,29 @@ import com.yeejoin.equipmanage.common.vo.BuildingTreeAndEquipVO;
import
com.yeejoin.equipmanage.common.vo.BuildingTreeVo
;
import
com.yeejoin.equipmanage.context.SpringContextHolder
;
import
com.yeejoin.equipmanage.event.SyncRiskEvent
;
import
com.yeejoin.equipmanage.mapper.*
;
import
com.yeejoin.equipmanage.mapper.BuildingMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentSpecificRelationMapper
;
import
com.yeejoin.equipmanage.mapper.FireFightingSystemMapper
;
import
com.yeejoin.equipmanage.mapper.FormInstanceMapper
;
import
com.yeejoin.equipmanage.mapper.SourceSceneMapper
;
import
com.yeejoin.equipmanage.mapper.StockDetailMapper
;
import
com.yeejoin.equipmanage.mapper.VideoMapper
;
import
com.yeejoin.equipmanage.operation.GroupTypeOperator
;
import
com.yeejoin.equipmanage.operation.PageOperation
;
import
com.yeejoin.equipmanage.operation.SyncRiskOperator
;
import
com.yeejoin.equipmanage.operation.factory.PageOperatorFactory
;
import
com.yeejoin.equipmanage.remote.RemoteSecurityService
;
import
com.yeejoin.equipmanage.service.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
com.yeejoin.equipmanage.service.IBuilldService
;
import
com.yeejoin.equipmanage.service.IEqSourceFileService
;
import
com.yeejoin.equipmanage.service.IFormGroupService
;
import
com.yeejoin.equipmanage.service.IFormInstanceService
;
import
com.yeejoin.equipmanage.service.ISourceSceneService
;
import
com.yeejoin.equipmanage.service.ISyncDataService
;
import
com.yeejoin.equipmanage.service.ISystemDicService
;
import
com.yeejoin.equipmanage.service.IVideoService
;
import
com.yeejoin.equipmanage.service.IWarehouseStructureService
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
/**
* @author ZeHua Li
...
...
@@ -402,7 +436,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return
t
;
}).
collect
(
Collectors
.
toList
());
}
public
List
<
Map
<
String
,
Object
>>
getBuildingDetaiList
()
{
return
iFormInstanceService
.
getSpecialChildrenList
(
null
);
}
private
List
<
BuildingTreeVo
>
getBuildingTreeVos
()
{
FormGroup
formGroup
=
iFormGroupService
.
getByUniqueKey
(
GroupCodeEnum
.
ALL_BUILDING
.
getGroupCode
());
List
<
Map
<
String
,
Object
>>
allList
=
iFormInstanceService
.
getSpecialChildrenList
(
null
);
...
...
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 @
511e15ba
...
...
@@ -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
<>();
...
...
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