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
a28664c7
Commit
a28664c7
authored
Dec 01, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
2828b1ad
49f3d7e2
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
2596 additions
and
1170 deletions
+2596
-1170
FireRiskSourceMapper.xml
...cs-api/src/main/resources/mapper/FireRiskSourceMapper.xml
+1
-0
AlertCallCommandDto.java
...oin/amos/boot/module/jcs/api/dto/AlertCallCommandDto.java
+19
-0
AlertCalledDto.java
.../yeejoin/amos/boot/module/jcs/api/dto/AlertCalledDto.java
+3
-0
AlertCalledMobDto.java
...ejoin/amos/boot/module/jcs/api/dto/AlertCalledMobDto.java
+59
-0
AlertCalledPowerInfoDto.java
...amos/boot/module/jcs/api/dto/AlertCalledPowerInfoDto.java
+40
-0
AlertCalledZhDto.java
...eejoin/amos/boot/module/jcs/api/dto/AlertCalledZhDto.java
+9
-0
IotSystemAlarmRo.java
...eejoin/amos/boot/module/jcs/api/dto/IotSystemAlarmRo.java
+76
-0
AlertCalled.java
.../yeejoin/amos/boot/module/jcs/api/entity/AlertCalled.java
+2
-1
AlertSubmittedMapper.java
...amos/boot/module/jcs/api/mapper/AlertSubmittedMapper.java
+7
-2
IVoiceRecordFileService.java
.../boot/module/jcs/api/service/IVoiceRecordFileService.java
+2
-2
AlertCalledMapper.xml
...e-jcs-api/src/main/resources/mapper/AlertCalledMapper.xml
+2
-0
AlertSubmittedMapper.xml
...cs-api/src/main/resources/mapper/AlertSubmittedMapper.xml
+34
-0
CheckReportDangerDto.java
...mos/supervision/core/common/dto/CheckReportDangerDto.java
+3
-0
CommandController.java
...boot/module/command/biz/controller/CommandController.java
+1
-6
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+5
-0
pom.xml
...ule/amos-boot-module-biz/amos-boot-module-jcs-biz/pom.xml
+25
-0
AlertSubmittedController.java
...t/module/jcs/biz/controller/AlertSubmittedController.java
+27
-0
VoiceRecordFileController.java
.../module/jcs/biz/controller/VoiceRecordFileController.java
+16
-22
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+834
-855
AlertSubmittedServiceImpl.java
...odule/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
+565
-218
VoiceRecordFileServiceImpl.java
...dule/jcs/biz/service/impl/VoiceRecordFileServiceImpl.java
+43
-14
CheckReportController.java
...upervision/business/controller/CheckReportController.java
+2
-2
CheckReportServiceImpl.java
...rvision/business/service/impl/CheckReportServiceImpl.java
+16
-12
ICheckReportService.java
...pervision/business/service/intfc/ICheckReportService.java
+1
-1
jcs-1.0.0.0.xml
...ystem-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
+12
-0
check-report-template.docx
...s/src/main/resources/templates/check-report-template.docx
+0
-0
dbTemplate_plan_task.xml
...rol/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+1
-0
pointMapper.xml
...ystem-patrol/src/main/resources/db/mapper/pointMapper.xml
+15
-19
pom.xml
amos-boot-utils/amos-boot-utils-speech/pom.xml
+44
-0
SpeechApplication.java
...ech/src/main/java/com/yeejoin/amos/SpeechApplication.java
+13
-0
AppNslClient.java
...h/src/main/java/com/yeejoin/amos/speech/AppNslClient.java
+89
-0
AppOkHttpClient.java
...rc/main/java/com/yeejoin/amos/speech/AppOkHttpClient.java
+46
-0
SpeechConfig.java
...h/src/main/java/com/yeejoin/amos/speech/SpeechConfig.java
+30
-0
SpeechFlashRecognizer.java
...n/java/com/yeejoin/amos/speech/SpeechFlashRecognizer.java
+74
-0
SpeechRecognizer.java
...c/main/java/com/yeejoin/amos/speech/SpeechRecognizer.java
+185
-0
SpeechTranscriber.java
.../main/java/com/yeejoin/amos/speech/SpeechTranscriber.java
+102
-0
application.properties
...ot-utils-speech/src/main/resources/application.properties
+0
-0
SpeechApplicationTests.java
...src/test/java/com/yejoin/amos/SpeechApplicationTests.java
+169
-0
pom.xml
amos-boot-utils/pom.xml
+19
-16
pom.xml
pom.xml
+5
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/resources/mapper/FireRiskSourceMapper.xml
View file @
a28664c7
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
rs.mrid,
rs.mrid,
rs.`name`,
rs.`name`,
rs.parent_mrid,
rs.parent_mrid,
rs.risk_level_mrid,
IFNULL(rs.rpn, 0) rpn,
IFNULL(rs.rpn, 0) rpn,
IFNULL(rs.rpni, 0) rpni
IFNULL(rs.rpni, 0) rpni
FROM `asf_fire_risk_source` rs
FROM `asf_fire_risk_source` rs
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/AlertCallCommandDto.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author litw
* @date 2021-11-26.
*/
@Data
public
class
AlertCallCommandDto
{
@ApiModelProperty
(
value
=
"名称"
)
String
name
;
@ApiModelProperty
(
value
=
"职务"
)
String
duty
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/AlertCalledDto.java
View file @
a28664c7
...
@@ -113,4 +113,7 @@ public class AlertCalledDto extends BaseDto{
...
@@ -113,4 +113,7 @@ public class AlertCalledDto extends BaseDto{
private
String
systemSource
;
private
String
systemSource
;
@ApiModelProperty
(
value
=
"系统来源code"
)
@ApiModelProperty
(
value
=
"系统来源code"
)
private
String
systemSourceCode
;
private
String
systemSourceCode
;
@ApiModelProperty
(
value
=
"处置记录url"
)
private
String
recordUrl
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/AlertCalledMobDto.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author ltw
* @date 2021-11-25.
*/
@Data
public
class
AlertCalledMobDto
{
@ApiModelProperty
(
value
=
"力量调派"
)
List
<
AlertCalledPowerInfoDto
>
alertCalledPowerInfoDtoList
;
@ApiModelProperty
(
value
=
"指挥力量"
)
List
<
AlertCallCommandDto
>
alertCallCommandDtoList
;
@ApiModelProperty
(
value
=
"年度"
)
String
year
;
@ApiModelProperty
(
value
=
"灾害单位"
)
String
unit
;
@ApiModelProperty
(
value
=
"详细地址"
)
String
address
;
@ApiModelProperty
(
value
=
"警情类型"
)
String
alertType
;
@ApiModelProperty
(
value
=
"来源类型"
)
String
sourceType
;
@ApiModelProperty
(
value
=
"报警人姓名"
)
String
reportName
;
@ApiModelProperty
(
value
=
"联系电话"
)
String
conectPhone
;
@ApiModelProperty
(
value
=
"接警时间"
)
String
callTime
;
@ApiModelProperty
(
value
=
"出动时间"
)
String
toTime
;
@ApiModelProperty
(
value
=
"到场时间"
)
String
arriveTime
;
@ApiModelProperty
(
value
=
"控制时间"
)
String
controlTime
;
@ApiModelProperty
(
value
=
"结束时间"
)
String
endTime
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/AlertCalledPowerInfoDto.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author litw
* @date 2021-11-25.
*/
@Data
public
class
AlertCalledPowerInfoDto
{
@ApiModelProperty
(
value
=
"队站"
)
String
station
;
@ApiModelProperty
(
value
=
"到场时间"
)
String
arriveTime
;
@ApiModelProperty
(
value
=
"车辆名称"
)
String
carName
;
@ApiModelProperty
(
value
=
"参战人数"
)
String
personNum
;
@ApiModelProperty
(
value
=
"水"
)
String
water
;
@ApiModelProperty
(
value
=
"泡沫"
)
String
foam
;
@ApiModelProperty
(
value
=
"干粉"
)
String
dryPowder
;
@ApiModelProperty
(
value
=
"其他"
)
String
other
;
@ApiModelProperty
(
value
=
"第一次出动调派车辆数量"
)
String
disatchNum
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/AlertCalledZhDto.java
View file @
a28664c7
...
@@ -64,4 +64,13 @@ public class AlertCalledZhDto {
...
@@ -64,4 +64,13 @@ public class AlertCalledZhDto {
@ApiModelProperty
(
value
=
"警情修改时间"
)
@ApiModelProperty
(
value
=
"警情修改时间"
)
private
Date
updateTime
;
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"处置记录url"
)
private
String
recordUrl
;
/**
* 警情状态
*/
@ApiModelProperty
(
value
=
"警情状态"
)
private
Boolean
alertStatus
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/dto/IotSystemAlarmRo.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
dto
;
import
com.yeejoin.amos.component.rule.Label
;
import
com.yeejoin.amos.component.rule.RuleFact
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Map
;
/**
* @ProjectName: EquipManageRoot
* @Package: com.yeejoin.equipmanage.common.vo
* @ClassName: ConfirmAlamVo
* @Author: Jianqiang Gao
* @Description: ConfirmAlamVo
* @Date: 2021/9/16 11:31
* @Version: 1.0
*/
@Data
@RuleFact
(
value
=
"确警消息"
,
project
=
"消息规则"
)
public
class
IotSystemAlarmRo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8807644006700780121L
;
@Label
(
value
=
"物联警情id"
)
private
Long
id
;
@Label
(
value
=
"联系人"
)
private
String
contactUser
;
@Label
(
value
=
"联系人电话"
)
private
String
contactPhone
;
@Label
(
value
=
"事发单位"
)
private
String
unitInvolvedId
;
@Label
(
value
=
"事发单位名称"
)
private
String
unitInvolvedName
;
@Label
(
value
=
"建筑经度"
)
private
Double
longitude
;
@Label
(
value
=
"建筑纬度"
)
private
Double
latitude
;
@Label
(
value
=
"地址"
)
private
String
address
;
@Label
(
value
=
"火灾地址"
)
private
String
fireLocation
;
@Label
(
value
=
"楼经度"
)
private
Double
floorLongitude
;
@Label
(
value
=
"楼纬度"
)
private
Double
floorLatitude
;
@Label
(
value
=
"发送到web标识"
)
private
Boolean
isSendWeb
;
@Label
(
"关联id"
)
private
String
relationId
;
@Label
(
"消息类型"
)
private
String
msgType
;
@Label
(
value
=
"终端标识"
)
private
String
terminal
;
@Label
(
value
=
"类别"
)
private
Integer
category
;
@Label
(
value
=
"扩展参数"
)
private
Map
<
String
,
String
>
extras
;
}
\ No newline at end of file
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/entity/AlertCalled.java
View file @
a28664c7
...
@@ -104,7 +104,8 @@ public class AlertCalled extends BaseEntity {
...
@@ -104,7 +104,8 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty
(
value
=
"备注信息"
)
@ApiModelProperty
(
value
=
"备注信息"
)
private
String
remark
;
private
String
remark
;
@ApiModelProperty
(
value
=
"处置记录url"
)
private
String
recordUrl
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/mapper/AlertSubmittedMapper.java
View file @
a28664c7
...
@@ -2,10 +2,10 @@ package com.yeejoin.amos.boot.module.jcs.api.mapper;
...
@@ -2,10 +2,10 @@ package com.yeejoin.amos.boot.module.jcs.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedExtDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedExtDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -57,4 +57,9 @@ public interface AlertSubmittedMapper extends BaseMapper<AlertSubmitted> {
...
@@ -57,4 +57,9 @@ public interface AlertSubmittedMapper extends BaseMapper<AlertSubmitted> {
Map
<
String
,
Integer
>
getUseNum
(
@Param
(
"id"
)
Long
id
);
Map
<
String
,
Integer
>
getUseNum
(
@Param
(
"id"
)
Long
id
);
List
<
Map
<
String
,
Object
>>
getFirst
(
@Param
(
"alertId"
)
Long
alertId
);
List
<
Map
<
String
,
Object
>>
getOther
(
@Param
(
"alertId"
)
Long
alertId
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/service/IVoiceRecordFileService.java
View file @
a28664c7
...
@@ -16,8 +16,6 @@ import java.util.List;
...
@@ -16,8 +16,6 @@ import java.util.List;
*/
*/
public
interface
IVoiceRecordFileService
{
public
interface
IVoiceRecordFileService
{
void
publishRecord
(
VoiceRecordFileDto
model
);
Page
<
VoiceRecordFileDto
>
queryRecordListByQueryDto
(
Page
<
VoiceRecordFileDto
>
page
,
String
telEndTimeStr
,
String
telEndTimeStr1
,
String
fileType
,
String
caller
,
String
called
,
String
sortParam
,
String
sortRule
);
Page
<
VoiceRecordFileDto
>
queryRecordListByQueryDto
(
Page
<
VoiceRecordFileDto
>
page
,
String
telEndTimeStr
,
String
telEndTimeStr1
,
String
fileType
,
String
caller
,
String
called
,
String
sortParam
,
String
sortRule
);
VoiceRecordFileDto
getRecordById
(
Long
sequenceNbr
);
VoiceRecordFileDto
getRecordById
(
Long
sequenceNbr
);
...
@@ -27,4 +25,6 @@ public interface IVoiceRecordFileService {
...
@@ -27,4 +25,6 @@ public interface IVoiceRecordFileService {
List
<
FusionDto
>
getCarList
(
Boolean
hasFusion
);
List
<
FusionDto
>
getCarList
(
Boolean
hasFusion
);
List
<
FusionDto
>
getSinglePawnList
(
Boolean
hasFusion
);
List
<
FusionDto
>
getSinglePawnList
(
Boolean
hasFusion
);
List
<
VoiceRecordFileDto
>
listByAlertId
(
Long
alertId
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/AlertCalledMapper.xml
View file @
a28664c7
...
@@ -34,6 +34,8 @@
...
@@ -34,6 +34,8 @@
a.address ,
a.address ,
a.coordinate_x longitude,
a.coordinate_x longitude,
a.coordinate_y latitude,
a.coordinate_y latitude,
a.record_url,
a.alert_status,
CASE a.response_level_code
CASE a.response_level_code
WHEN '1164' THEN '紧急出动'
WHEN '1164' THEN '紧急出动'
WHEN '1165' THEN '紧急集结'
WHEN '1165' THEN '紧急集结'
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/AlertSubmittedMapper.xml
View file @
a28664c7
...
@@ -131,6 +131,40 @@
...
@@ -131,6 +131,40 @@
a.alert_called_id = ${id}
a.alert_called_id = ${id}
</select>
</select>
<select
id=
"getFirst"
resultType=
"Map"
>
SELECT distinct
a.rec_date recDate ,
b.company_name companyName,
c.resources_name carName,
c.resources_num carNum,
c.resources_id id
FROM
jc_power_transfer a
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
where a.sequence_nbr = (select sequence_nbr from jc_power_transfer where alert_called_id
= #{alertId}
order by rec_date asc limit 1)
</select>
<select
id=
"getOther"
resultType=
"Map"
>
SELECT distinct
a.rec_date recDate ,
b.company_name companyName,
c.resources_name carName,
c.resources_num carNum,
c.resources_id id
FROM
jc_power_transfer a
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
where a.sequence_nbr = (select sequence_nbr from jc_power_transfer where alert_called_id
= #{alertId}
order by rec_date asc limit 1,100)
</select>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-supervision-api/src/main/java/com/yeejoin/amos/supervision/core/common/dto/CheckReportDangerDto.java
View file @
a28664c7
...
@@ -16,6 +16,9 @@ public class CheckReportDangerDto implements Serializable {
...
@@ -16,6 +16,9 @@ public class CheckReportDangerDto implements Serializable {
String
companyName
;
String
companyName
;
@ApiModelProperty
(
value
=
"隐患id"
)
@ApiModelProperty
(
value
=
"隐患id"
)
String
id
;
@ApiModelProperty
(
value
=
"隐患id"
)
String
dangerId
;
String
dangerId
;
@ApiModelProperty
(
value
=
"存在问题"
)
@ApiModelProperty
(
value
=
"存在问题"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-command-biz/src/main/java/com/yeejoin/amos/boot/module/command/biz/controller/CommandController.java
View file @
a28664c7
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.command.biz.controller;
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.command.biz.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
...
@@ -19,7 +18,6 @@ import com.yeejoin.amos.boot.module.command.api.dto.CarTaskDto;
...
@@ -19,7 +18,6 @@ import com.yeejoin.amos.boot.module.command.api.dto.CarTaskDto;
import
com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto
;
import
com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto
;
import
com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService
;
import
com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient
;
...
@@ -49,15 +47,13 @@ import com.yeejoin.amos.boot.module.jcs.api.service.*;
...
@@ -49,15 +47,13 @@ import com.yeejoin.amos.boot.module.jcs.api.service.*;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
@@ -74,7 +70,6 @@ import java.util.ArrayList;
...
@@ -74,7 +70,6 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* *指挥资源Api
* *指挥资源Api
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
a28664c7
...
@@ -175,6 +175,7 @@ public class ContingencyPlanController extends AbstractBaseController {
...
@@ -175,6 +175,7 @@ public class ContingencyPlanController extends AbstractBaseController {
}
}
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"启动"
)
@ApiOperation
(
value
=
"启动"
)
@RequestMapping
(
value
=
"/start"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/start"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
start
(
@RequestBody
ContingencyPlanParamVo
vo
)
{
public
ResponseModel
start
(
@RequestBody
ContingencyPlanParamVo
vo
)
{
...
@@ -196,6 +197,7 @@ public class ContingencyPlanController extends AbstractBaseController {
...
@@ -196,6 +197,7 @@ public class ContingencyPlanController extends AbstractBaseController {
return
CommonResponseUtil2
.
success
(
result
);
return
CommonResponseUtil2
.
success
(
result
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"装备确景"
)
@ApiOperation
(
value
=
"装备确景"
)
@RequestMapping
(
value
=
"/scene"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/scene"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
scene
(
@ApiParam
(
value
=
"装备Id"
,
required
=
true
)
String
equipmentId
,
public
ResponseModel
scene
(
@ApiParam
(
value
=
"装备Id"
,
required
=
true
)
String
equipmentId
,
...
@@ -208,6 +210,7 @@ public class ContingencyPlanController extends AbstractBaseController {
...
@@ -208,6 +210,7 @@ public class ContingencyPlanController extends AbstractBaseController {
}
}
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"预案启动记录分页列表"
)
@ApiOperation
(
value
=
"预案启动记录分页列表"
)
@RequestMapping
(
value
=
"/record/page"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/record/page"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
recordList
(
public
ResponseModel
recordList
(
...
@@ -229,6 +232,7 @@ public class ContingencyPlanController extends AbstractBaseController {
...
@@ -229,6 +232,7 @@ public class ContingencyPlanController extends AbstractBaseController {
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
recordListByPage
(
page
,
planId
,
planName
,
classifyId
,
startTimeLeft
,
startTimeRight
,
executionType
,
planPattern
));
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
recordListByPage
(
page
,
planId
,
planName
,
classifyId
,
startTimeLeft
,
startTimeRight
,
executionType
,
planPattern
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"第一次查看预案记录"
)
@ApiOperation
(
value
=
"第一次查看预案记录"
)
@RequestMapping
(
value
=
"/frist/getRecord/{batchNo}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/frist/getRecord/{batchNo}"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
firstGetRecord
(
@PathVariable
(
value
=
"batchNo"
)
String
batchNo
)
{
public
ResponseModel
firstGetRecord
(
@PathVariable
(
value
=
"batchNo"
)
String
batchNo
)
{
...
@@ -236,6 +240,7 @@ public class ContingencyPlanController extends AbstractBaseController {
...
@@ -236,6 +240,7 @@ public class ContingencyPlanController extends AbstractBaseController {
return
CommonResponseUtil2
.
success
(
map
);
return
CommonResponseUtil2
.
success
(
map
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查看预案记录列表"
)
@ApiOperation
(
value
=
"查看预案记录列表"
)
@RequestMapping
(
value
=
"/getRecordList/{batchNo}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getRecordList/{batchNo}"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
getRecordList
(
@PathVariable
(
value
=
"batchNo"
)
String
batchNo
)
{
public
ResponseModel
getRecordList
(
@PathVariable
(
value
=
"batchNo"
)
String
batchNo
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/pom.xml
View file @
a28664c7
...
@@ -20,6 +20,31 @@
...
@@ -20,6 +20,31 @@
<artifactId>
amos-boot-module-common-biz
</artifactId>
<artifactId>
amos-boot-module-common-biz
</artifactId>
<version>
${amos-biz-boot.version}
</version>
<version>
${amos-biz-boot.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.deepoove
</groupId>
<artifactId>
poi-tl
</artifactId>
<version>
1.6.0
</version>
<scope>
compile
</scope>
<exclusions>
<exclusion>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml-schemas
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
e-iceblue
</groupId>
<artifactId>
spire.doc
</artifactId>
<version>
4.9.0
</version>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertSubmittedController.java
View file @
a28664c7
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
...
@@ -39,6 +40,9 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...
@@ -39,6 +40,9 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.UnsupportedEncodingException
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -258,6 +262,29 @@ public class AlertSubmittedController extends BaseController {
...
@@ -258,6 +262,29 @@ public class AlertSubmittedController extends BaseController {
return
ResponseHelper
.
buildResponse
(
schedulingContent
);
return
ResponseHelper
.
buildResponse
(
schedulingContent
);
}
}
/**
* 获取警情续报内容
*
* @return 返回结果
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/alert_submitted/ddd"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取警情续报内容和模板"
,
notes
=
"获取警情续报内容和模板"
)
public
ResponseModel
<
Object
>
getAlertSubmittedContentDD
()
{
try
{
AlertCalledFormDto
alertCalledFormDto
=
(
AlertCalledFormDto
)
alertCalledService
.
selectAlertCalledByIdNoRedis
(
1455815417061728258L
);
alertSubmittedService
.
generateMob
(
alertCalledFormDto
.
getAlertCalled
());
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
return
ResponseHelper
.
buildResponse
(
null
);
}
private
String
getTaskInformation
(
String
content
,
Map
<
String
,
String
>
definitions
)
{
private
String
getTaskInformation
(
String
content
,
Map
<
String
,
String
>
definitions
)
{
int
size
=
definitions
.
size
();
int
size
=
definitions
.
size
();
String
[]
keys
=
definitions
.
keySet
().
toArray
(
new
String
[
size
]);
String
[]
keys
=
definitions
.
keySet
().
toArray
(
new
String
[
size
]);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/VoiceRecordFileController.java
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.VoiceRecordFileDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.VoiceRecordFileDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.VoiceRecordFile
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.VoiceRecordFileServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.VoiceRecordFileServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
@@ -20,7 +17,6 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...
@@ -20,7 +17,6 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -35,7 +31,7 @@ import java.util.List;
...
@@ -35,7 +31,7 @@ import java.util.List;
public
class
VoiceRecordFileController
extends
BaseController
{
public
class
VoiceRecordFileController
extends
BaseController
{
@Autowired
@Autowired
VoiceRecordFileServiceImpl
voiceRecordFileService
Impl
;
VoiceRecordFileServiceImpl
voiceRecordFileService
;
@Autowired
@Autowired
AlertCalledServiceImpl
iAlertCalledService
;
AlertCalledServiceImpl
iAlertCalledService
;
...
@@ -49,18 +45,7 @@ public class VoiceRecordFileController extends BaseController {
...
@@ -49,18 +45,7 @@ public class VoiceRecordFileController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据警情id 查找通话记录信息"
,
notes
=
"根据警情id 查找通话记录信息"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据警情id 查找通话记录信息"
,
notes
=
"根据警情id 查找通话记录信息"
)
@GetMapping
(
value
=
"/list/alert/{alertId}"
)
@GetMapping
(
value
=
"/list/alert/{alertId}"
)
public
ResponseModel
<
List
<
VoiceRecordFileDto
>>
selectForListByAlertId
(
@PathVariable
Long
alertId
)
{
public
ResponseModel
<
List
<
VoiceRecordFileDto
>>
selectForListByAlertId
(
@PathVariable
Long
alertId
)
{
LambdaQueryWrapper
<
VoiceRecordFile
>
queryWrapper
=
new
LambdaQueryWrapper
<
VoiceRecordFile
>();
return
ResponseHelper
.
buildResponse
(
voiceRecordFileService
.
listByAlertId
(
alertId
));
queryWrapper
.
eq
(
VoiceRecordFile:
:
getAlertId
,
alertId
).
orderByDesc
(
VoiceRecordFile:
:
getRecDate
);
List
<
VoiceRecordFile
>
list
=
voiceRecordFileServiceImpl
.
list
(
queryWrapper
);
List
<
VoiceRecordFileDto
>
dtoList
=
new
ArrayList
<
VoiceRecordFileDto
>(
list
.
size
());
list
.
stream
().
forEach
(
voiceRecord
->
{
// 创建新的对象实例
VoiceRecordFileDto
target
=
new
VoiceRecordFileDto
();
// 把原对象数据拷贝到新对象
BeanUtils
.
copyProperties
(
voiceRecord
,
target
);
dtoList
.
add
(
target
);
});
return
ResponseHelper
.
buildResponse
(
dtoList
);
}
}
/**
/**
...
@@ -73,7 +58,7 @@ public class VoiceRecordFileController extends BaseController {
...
@@ -73,7 +58,7 @@ public class VoiceRecordFileController extends BaseController {
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
public
ResponseModel
<
VoiceRecordFileDto
>
getRecordById
(
@PathVariable
Long
sequenceNbr
)
{
public
ResponseModel
<
VoiceRecordFileDto
>
getRecordById
(
@PathVariable
Long
sequenceNbr
)
{
VoiceRecordFileDto
record
=
voiceRecordFileService
Impl
.
getRecordById
(
sequenceNbr
);
VoiceRecordFileDto
record
=
voiceRecordFileService
.
getRecordById
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
record
);
return
ResponseHelper
.
buildResponse
(
record
);
}
}
...
@@ -85,13 +70,22 @@ public class VoiceRecordFileController extends BaseController {
...
@@ -85,13 +70,22 @@ public class VoiceRecordFileController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/saveRecord"
)
@PostMapping
(
value
=
"/saveRecord"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增通话记录附件"
,
notes
=
"新增通话记录附件"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增通话记录附件"
,
notes
=
"新增通话记录附件"
)
public
ResponseModel
<
Boolean
>
saveRecord
(
@RequestBody
VoiceRecordFileDto
model
)
{
public
ResponseModel
<
VoiceRecordFileDto
>
saveRecord
(
@RequestBody
VoiceRecordFileDto
model
)
{
if
(
ValidationUtil
.
isEmpty
(
model
.
getCaller
())
if
(
ValidationUtil
.
isEmpty
(
model
.
getCaller
())
||
ValidationUtil
.
isEmpty
(
model
.
getCalled
())){
||
ValidationUtil
.
isEmpty
(
model
.
getCalled
())){
throw
new
BadRequest
(
"参数校验失败."
);
throw
new
BadRequest
(
"参数校验失败."
);
}
}
voiceRecordFileServiceImpl
.
publishRecord
(
model
);
return
ResponseHelper
.
buildResponse
(
voiceRecordFileService
.
saveRecord
(
model
));
return
ResponseHelper
.
buildResponse
(
true
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{sequenceNbr}"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新通话记录附件"
,
notes
=
"更新通话记录附件"
)
public
ResponseModel
<
VoiceRecordFileDto
>
updateRecord
(
@RequestBody
VoiceRecordFileDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
voiceRecordFileService
.
updateRecord
(
model
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -117,7 +111,7 @@ public class VoiceRecordFileController extends BaseController {
...
@@ -117,7 +111,7 @@ public class VoiceRecordFileController extends BaseController {
sortParam
=
"call_time"
;
sortParam
=
"call_time"
;
sortRule
=
"desc"
;
sortRule
=
"desc"
;
}
}
Page
<
VoiceRecordFileDto
>
pageBean
=
voiceRecordFileService
Impl
.
queryRecordListByQueryDto
(
page
,
Page
<
VoiceRecordFileDto
>
pageBean
=
voiceRecordFileService
.
queryRecordListByQueryDto
(
page
,
model
.
getTelStartTimeStr
(),
model
.
getTelEndTimeStr
(),
model
.
getFileType
(),
model
.
getCaller
(),
model
.
getTelStartTimeStr
(),
model
.
getTelEndTimeStr
(),
model
.
getFileType
(),
model
.
getCaller
(),
model
.
getCalled
(),
sortParam
,
sortRule
);
model
.
getCalled
(),
sortParam
,
sortRule
);
Page
<
VoiceRecordFileDto
>
result
=
new
Page
<
VoiceRecordFileDto
>(
pageNum
,
pageSize
);
Page
<
VoiceRecordFileDto
>
result
=
new
Page
<
VoiceRecordFileDto
>(
pageNum
,
pageSize
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
View file @
a28664c7
...
@@ -9,7 +9,10 @@ import java.util.Set;
...
@@ -9,7 +9,10 @@ import java.util.Set;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.*
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.*
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IVoiceRecordFileService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
...
@@ -45,20 +48,6 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceI
...
@@ -45,20 +48,6 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceI
import
com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.KeySiteServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerData
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum
;
...
@@ -77,96 +66,98 @@ import com.yeejoin.amos.component.rule.config.RuleConfig;
...
@@ -77,96 +66,98 @@ import com.yeejoin.amos.component.rule.config.RuleConfig;
*/
*/
@Service
@Service
public
class
AlertCalledServiceImpl
extends
BaseService
<
AlertCalledDto
,
AlertCalled
,
AlertCalledMapper
>
public
class
AlertCalledServiceImpl
extends
BaseService
<
AlertCalledDto
,
AlertCalled
,
AlertCalledMapper
>
implements
IAlertCalledService
{
implements
IAlertCalledService
{
private
final
Logger
logger
=
LogManager
.
getLogger
(
AlertCalledServiceImpl
.
class
);
private
final
Logger
logger
=
LogManager
.
getLogger
(
AlertCalledServiceImpl
.
class
);
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@Autowired
@Autowired
AlertCalledMapper
alertCalledMapper
;
AlertCalledMapper
alertCalledMapper
;
@Autowired
@Autowired
RuleAlertCalledService
ruleAlertCalledService
;
RuleAlertCalledService
ruleAlertCalledService
;
@Autowired
@Autowired
TemplateMapper
templateMapper
;
TemplateMapper
templateMapper
;
@Autowired
@Autowired
PowerTransferMapper
powerTransferMapper
;
PowerTransferMapper
powerTransferMapper
;
@Autowired
@Autowired
AlertSubmittedMapper
alertSubmittedMapper
;
AlertSubmittedMapper
alertSubmittedMapper
;
@Autowired
@Autowired
private
JcsControlServerClient
jcsControlServerClient
;
private
JcsControlServerClient
jcsControlServerClient
;
@Autowired
@Autowired
private
AlertFormValueServiceImpl
iAlertFormValueService
;
private
AlertFormValueServiceImpl
iAlertFormValueService
;
@Autowired
@Autowired
private
ESAlertCalledService
eSAlertCalledService
;
private
ESAlertCalledService
eSAlertCalledService
;
@Autowired
@Autowired
private
ControllerServiceImpl
controllerService
;
private
ControllerServiceImpl
controllerService
;
@Autowired
@Autowired
private
ControllerEquipServiceImpl
controllerEquipService
;
private
ControllerEquipServiceImpl
controllerEquipService
;
@Autowired
@Autowired
FirefightersServiceImpl
firefightersService
;
FirefightersServiceImpl
firefightersService
;
@Autowired
@Autowired
KeySiteServiceImpl
keySiteService
;
KeySiteServiceImpl
keySiteService
;
@Autowired
@Autowired
AlertSubmittedServiceImpl
alertSubmittedService
;
AlertSubmittedServiceImpl
alertSubmittedService
;
@Autowired
@Autowired
private
AlertLocationLogServiceImpl
alertLocationLogService
;
private
AlertLocationLogServiceImpl
alertLocationLogService
;
@Autowired
@Autowired
private
EmqKeeper
emqKeeper
;
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.command.alert.notice}"
)
@Value
(
"${mqtt.topic.command.alert.notice}"
)
private
String
topic
;
private
String
topic
;
@Value
(
"${redis.cache.failure.time}"
)
@Value
(
"${redis.cache.failure.time}"
)
private
long
time
;
private
long
time
;
@Value
(
"${mqtt.topic.command.power.deployment}"
)
@Value
(
"${mqtt.topic.command.power.deployment}"
)
private
String
topic1
;
private
String
topic1
;
@Autowired
@Autowired
private
OrgUsrServiceImpl
iOrgUsrService
;
private
OrgUsrServiceImpl
iOrgUsrService
;
@Autowired
@Autowired
AircraftServiceImpl
aircraftService
;
AircraftServiceImpl
aircraftService
;
@Autowired
@Autowired
AlertFormValueServiceImpl
alertFormValueService
;
AlertFormValueServiceImpl
alertFormValueService
;
@Autowired
@Autowired
OrgUsrServiceImpl
orgUsrServiceImpl
;
OrgUsrServiceImpl
orgUsrServiceImpl
;
@Autowired
private
static
int
comparingByGroupVal
(
Map
<
String
,
Object
>
map
,
Map
<
String
,
Object
>
map2
,
String
key
)
{
VoiceRecordFileServiceImpl
voiceRecordFileService
;
int
result
=
0
;
if
(
map
.
get
(
key
)
instanceof
DateTime
)
{
private
static
int
comparingByGroupVal
(
Map
<
String
,
Object
>
map
,
Map
<
String
,
Object
>
map2
,
String
key
)
{
long
r1
=
((
Date
)
map
.
get
(
key
)).
getTime
();
int
result
=
0
;
long
r2
=
((
Date
)
map2
.
get
(
key
)).
getTime
();
if
(
map
.
get
(
key
)
instanceof
DateTime
)
{
result
=
Long
.
compare
(
r1
,
r2
);
long
r1
=
((
Date
)
map
.
get
(
key
)).
getTime
();
}
long
r2
=
((
Date
)
map2
.
get
(
key
)).
getTime
();
return
result
;
result
=
Long
.
compare
(
r1
,
r2
);
}
}
return
result
;
/**
}
* 指挥系统 未结束的警情列表
**/
/**
@Override
* 指挥系统 未结束的警情列表
public
List
<
AlertCalledZhDto
>
alertCalledListByAlertStatus
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
par
)
{
**/
@Override
List
<
AlertCalledZhDto
>
list
=
alertCalledMapper
.
alertCalledListByAlertStatus
(
pageNum
,
pageSize
,
par
);
public
List
<
AlertCalledZhDto
>
alertCalledListByAlertStatus
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
par
)
{
return
list
;
List
<
AlertCalledZhDto
>
list
=
alertCalledMapper
.
alertCalledListByAlertStatus
(
pageNum
,
pageSize
,
par
);
}
return
list
;
@Override
}
public
int
alertCalledListByAlertStatusCount
(
RequestData
par
)
{
return
alertCalledMapper
.
alertCalledListByAlertStatusCount
(
par
);
@Override
}
public
int
alertCalledListByAlertStatusCount
(
RequestData
par
)
{
return
alertCalledMapper
.
alertCalledListByAlertStatusCount
(
par
);
/**
}
* 接警记录 列表分页查询
**/
/*
/**
* bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序 陈召
* 接警记录 列表分页查询
* 2021-09-03 开始
**/
/*
*/
* bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序 陈召
* 2021-09-03 开始
*/
// public IPage<AlertCalled> queryForCalledList(Page pageBean, Integer alertStatus,
// public IPage<AlertCalled> queryForCalledList(Page pageBean, Integer alertStatus,
// String alertTypeCode,
// String alertTypeCode,
// String alertSourceCode,
// String alertSourceCode,
...
@@ -183,467 +174,467 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
...
@@ -183,467 +174,467 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
//
//
// List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime, data, lift);
// List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime, data, lift);
// }
// }
public
IPage
<
AlertCalled
>
queryForCalledList
(
Page
pageBean
,
Integer
alertStatus
,
String
alertTypeCode
,
public
IPage
<
AlertCalled
>
queryForCalledList
(
Page
pageBean
,
Integer
alertStatus
,
String
alertTypeCode
,
String
alertSourceCode
,
String
startTime
,
String
endTime
,
String
sort
,
String
isFatherAlert
)
{
String
alertSourceCode
,
String
startTime
,
String
endTime
,
String
sort
,
String
isFatherAlert
)
{
String
[]
split
=
sort
!=
null
?
sort
.
split
(
","
)
:
null
;
String
[]
split
=
sort
!=
null
?
sort
.
split
(
","
)
:
null
;
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 start */
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 start */
if
(
split
!=
null
)
{
if
(
split
!=
null
)
{
if
(
split
[
0
]
!=
null
)
{
if
(
split
[
0
]
!=
null
)
{
if
(
split
[
0
].
equals
(
"alertType"
)
||
split
[
0
].
equals
(
"alertSource"
)
||
split
[
0
].
equals
(
"alarmType"
))
{
if
(
split
[
0
].
equals
(
"alertType"
)
||
split
[
0
].
equals
(
"alertSource"
)
||
split
[
0
].
equals
(
"alarmType"
))
{
split
[
0
]
=
split
[
0
]
+
"Code"
;
split
[
0
]
=
split
[
0
]
+
"Code"
;
}
}
if
(
split
[
0
].
equals
(
"alertStatusStr"
))
{
if
(
split
[
0
].
equals
(
"alertStatusStr"
))
{
split
[
0
]
=
"alertStatus"
;
split
[
0
]
=
"alertStatus"
;
}
}
}
}
if
(
split
[
1
]
!=
null
)
{
if
(
split
[
1
]
!=
null
)
{
if
(
split
[
1
].
equals
(
"ascend"
))
{
if
(
split
[
1
].
equals
(
"ascend"
))
{
split
[
1
]
=
"ASC"
;
split
[
1
]
=
"ASC"
;
}
}
if
(
split
[
1
].
equals
(
"descend"
))
{
if
(
split
[
1
].
equals
(
"descend"
))
{
split
[
1
]
=
"DESC"
;
split
[
1
]
=
"DESC"
;
}
}
}
}
}
}
String
data
=
split
!=
null
?
RedisKey
.
humpToLine
(
split
[
0
])
:
null
;
String
data
=
split
!=
null
?
RedisKey
.
humpToLine
(
split
[
0
])
:
null
;
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 end */
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 end */
String
lift
=
split
!=
null
?
split
[
1
]
:
null
;
String
lift
=
split
!=
null
?
split
[
1
]
:
null
;
List
<
AlertCalled
>
list
=
alertCalledMapper
.
selectAllPage
(
pageBean
.
getCurrent
(),
pageBean
.
getSize
(),
alertStatus
,
List
<
AlertCalled
>
list
=
alertCalledMapper
.
selectAllPage
(
pageBean
.
getCurrent
(),
pageBean
.
getSize
(),
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
data
,
lift
,
isFatherAlert
);
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
data
,
lift
,
isFatherAlert
);
IPage
<
AlertCalled
>
iPage
=
new
Page
<>();
IPage
<
AlertCalled
>
iPage
=
new
Page
<>();
iPage
.
setRecords
(
list
);
iPage
.
setRecords
(
list
);
iPage
.
setTotal
(
iPage
.
setTotal
(
alertCalledMapper
.
selectAllCount
(
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
isFatherAlert
));
alertCalledMapper
.
selectAllCount
(
alertStatus
,
alertTypeCode
,
alertSourceCode
,
startTime
,
endTime
,
isFatherAlert
));
//iPage.setSize(pageBean.getSize());
//iPage.setSize(pageBean.getSize());
return
iPage
;
return
iPage
;
/* bug2407 表头筛选失效 补充条件方法 XML中添加了排序条件判断 data代表排序条件 lift 升降序 陈召 2021-09-03 结束 */
/* bug2407 表头筛选失效 补充条件方法 XML中添加了排序条件判断 data代表排序条件 lift 升降序 陈召 2021-09-03 结束 */
}
}
/**
/**
* 根据灾情id 查询灾情详情
* 根据灾情id 查询灾情详情
**/
**/
@Override
@Override
public
Object
selectAlertCalledById
(
Long
id
)
{
public
Object
selectAlertCalledById
(
Long
id
)
{
if
(
redisUtils
.
hasKey
(
RedisKey
.
ALERTCALLED_ID
+
id
))
{
if
(
redisUtils
.
hasKey
(
RedisKey
.
ALERTCALLED_ID
+
id
))
{
Object
obj
=
redisUtils
.
get
(
RedisKey
.
ALERTCALLED_ID
+
id
);
Object
obj
=
redisUtils
.
get
(
RedisKey
.
ALERTCALLED_ID
+
id
);
return
obj
;
return
obj
;
}
else
{
}
else
{
// 警情基本信息
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
AlertCalled
alertCalled
=
this
.
getById
(
id
);
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
// 警情动态表单数据
// 警情动态表单数据
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
FormValue
>
formValue
=
new
ArrayList
<
FormValue
>();
List
<
FormValue
>
formValue
=
new
ArrayList
<
FormValue
>();
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
AlertFormValue
alertFormValue
:
list
)
{
for
(
AlertFormValue
alertFormValue
:
list
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
formValue
.
add
(
value
);
}
}
}
}
AlertCalledFormDto
alertCalledFormVo
=
new
AlertCalledFormDto
(
alertCalled
,
formValue
);
AlertCalledFormDto
alertCalledFormVo
=
new
AlertCalledFormDto
(
alertCalled
,
formValue
);
redisUtils
.
set
(
RedisKey
.
ALERTCALLED_ID
+
id
,
JSON
.
toJSON
(
alertCalledFormVo
),
time
);
redisUtils
.
set
(
RedisKey
.
ALERTCALLED_ID
+
id
,
JSON
.
toJSON
(
alertCalledFormVo
),
time
);
return
alertCalledFormVo
;
return
alertCalledFormVo
;
}
}
}
}
/**
/**
* 根据灾情id 查询灾情详情
* 根据灾情id 查询灾情详情
**/
**/
@Override
@Override
public
Object
selectAlertCalledByIdNoRedis
(
Long
id
)
{
public
Object
selectAlertCalledByIdNoRedis
(
Long
id
)
{
// 警情基本信息
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
AlertCalled
alertCalled
=
this
.
getById
(
id
);
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
// 警情动态表单数据
// 警情动态表单数据
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
FormValue
>
formValue
=
new
ArrayList
<
FormValue
>();
List
<
FormValue
>
formValue
=
new
ArrayList
<
FormValue
>();
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
AlertFormValue
alertFormValue
:
list
)
{
for
(
AlertFormValue
alertFormValue
:
list
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
"text"
,
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
formValue
.
add
(
value
);
}
}
}
}
AlertCalledFormDto
alertCalledFormVo
=
new
AlertCalledFormDto
(
alertCalled
,
formValue
);
AlertCalledFormDto
alertCalledFormVo
=
new
AlertCalledFormDto
(
alertCalled
,
formValue
);
return
alertCalledFormVo
;
return
alertCalledFormVo
;
}
}
/**
/**
* 根据灾情id 查询灾情详情
* 根据灾情id 查询灾情详情
**/
**/
@Override
@Override
public
Object
selectAlertCalledByIdNoRedisNew
(
Long
id
)
{
public
Object
selectAlertCalledByIdNoRedisNew
(
Long
id
)
{
// 警情基本信息
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
AlertCalled
alertCalled
=
this
.
getById
(
id
);
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
// 警情动态表单数据
// 警情动态表单数据
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
FormValue
>
formValue
=
new
ArrayList
<
FormValue
>();
List
<
FormValue
>
formValue
=
new
ArrayList
<
FormValue
>();
//
//
AlertCalledObjsDto
alertCalledFormVo
=
new
AlertCalledObjsDto
();
AlertCalledObjsDto
alertCalledFormVo
=
new
AlertCalledObjsDto
();
alertCalledFormVo
.
setAlertCalled
(
alertCalled
);
alertCalledFormVo
.
setAlertCalled
(
alertCalled
);
alertCalledFormVo
.
setAlertFormValue
(
list
);
alertCalledFormVo
.
setAlertFormValue
(
list
);
return
alertCalledFormVo
;
return
alertCalledFormVo
;
}
}
/**
/**
* <pre>
* <pre>
* 保存警情信息
* 保存警情信息
* </pre>
* </pre>
*
*
* @param alertCalledObjsDto
* @param alertCalledObjsDto
* @return
* @return
*/
*/
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
AlertCalledObjsDto
createAlertCalled
(
AlertCalledObjsDto
alertCalledObjsDto
)
{
public
AlertCalledObjsDto
createAlertCalled
(
AlertCalledObjsDto
alertCalledObjsDto
)
{
try
{
try
{
// 警情基本信息
// 警情基本信息
AlertCalled
alertCalled
=
alertCalledObjsDto
.
getAlertCalled
();
AlertCalled
alertCalled
=
alertCalledObjsDto
.
getAlertCalled
();
//主表增加备注字段
//主表增加备注字段
if
(
alertCalled
.
getAddress
()
!=
null
)
{
if
(
alertCalled
.
getAddress
()
!=
null
)
{
JSONObject
address
=
WaterResourceServiceImpl
.
getLongLatFromAddress
(
alertCalled
.
getAddress
());
JSONObject
address
=
WaterResourceServiceImpl
.
getLongLatFromAddress
(
alertCalled
.
getAddress
());
alertCalled
.
setAddress
(
address
.
getString
(
BizConstant
.
ADDRESS
));
alertCalled
.
setAddress
(
address
.
getString
(
BizConstant
.
ADDRESS
));
alertCalled
.
setCoordinateX
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LONGITUDE
)));
alertCalled
.
setCoordinateX
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LONGITUDE
)));
alertCalled
.
setCoordinateY
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LATITUDE
)));
alertCalled
.
setCoordinateY
(
Double
.
valueOf
(
address
.
getString
(
BizConstant
.
LATITUDE
)));
}
}
alertCalled
.
setCallTime
(
new
Date
());
alertCalled
.
setCallTime
(
new
Date
());
if
(
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
())
if
(
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
())
||
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
()))
{
||
AlertStageEnums
.
RG
.
getValue
().
equals
(
alertCalled
.
getAlertSourceCode
()))
{
alertCalled
.
setType
(
"0"
);
alertCalled
.
setType
(
"0"
);
}
else
{
}
else
{
alertCalled
.
setType
(
"1"
);
alertCalled
.
setType
(
"1"
);
}
}
// 动态表单
// 动态表单
List
<
AlertFormValue
>
alertFormValuelist
=
alertCalledObjsDto
.
getAlertFormValue
();
List
<
AlertFormValue
>
alertFormValuelist
=
alertCalledObjsDto
.
getAlertFormValue
();
// 判断是否航空器救援 如果为航空器救援则保存冗余字段 response_level_code bug2542 bykongfm
// 判断是否航空器救援 如果为航空器救援则保存冗余字段 response_level_code bug2542 bykongfm
if
(
AlertStageEnums
.
HKJY
.
getCode
().
equals
(
alertCalled
.
getAlertTypeCode
()))
{
if
(
AlertStageEnums
.
HKJY
.
getCode
().
equals
(
alertCalled
.
getAlertTypeCode
()))
{
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"responseLevel"
))
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"responseLevel"
))
{
alertCalled
.
setResponseLevelCode
(
alertFormValue
.
getFieldValueCode
());
alertCalled
.
setResponseLevelCode
(
alertFormValue
.
getFieldValueCode
());
alertCalled
.
setResponseLevel
(
alertFormValue
.
getFieldValue
());
alertCalled
.
setResponseLevel
(
alertFormValue
.
getFieldValue
());
}
}
});
});
}
}
// 判断是否归并警情
// 判断是否归并警情
if
(
alertCalled
.
getFatherAlert
()
!=
null
)
{
if
(
alertCalled
.
getFatherAlert
()
!=
null
)
{
// 警情归并,设置当前警情状态为结束。
// 警情归并,设置当前警情状态为结束。
alertCalled
.
setAlertStatus
(
true
);
alertCalled
.
setAlertStatus
(
true
);
alertCalled
.
setAlertStage
(
AlertStageEnums
.
JQJB
.
getValue
());
alertCalled
.
setAlertStage
(
AlertStageEnums
.
JQJB
.
getValue
());
alertCalled
.
setAlarmType
(
AlertStageEnums
.
JQGB
.
getValue
());
alertCalled
.
setAlarmType
(
AlertStageEnums
.
JQGB
.
getValue
());
alertCalled
.
setAlarmTypeCode
(
AlertStageEnums
.
JQGB
.
getCode
());
alertCalled
.
setAlarmTypeCode
(
AlertStageEnums
.
JQGB
.
getCode
());
alertCalled
.
setUpdateTime
(
new
Date
());
alertCalled
.
setUpdateTime
(
new
Date
());
alertCalled
.
setRemark
(
alertCalledObjsDto
.
getRemark
());
alertCalled
.
setRemark
(
alertCalledObjsDto
.
getRemark
());
this
.
save
(
alertCalled
);
this
.
save
(
alertCalled
);
// 填充警情主键
// 填充警情主键
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
});
});
// 保存动态表单数据
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
emqKeeper
.
getMqttClient
().
publish
(
topic1
,
"1"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
topic1
,
"1"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
}
else
{
}
else
{
// 警情报送
// 警情报送
// ****************************************************待确认开发
// ****************************************************待确认开发
alertCalled
.
setAlertStatus
(
false
);
alertCalled
.
setAlertStatus
(
false
);
alertCalled
.
setIsDelete
(
false
);
alertCalled
.
setIsDelete
(
false
);
alertCalled
.
setAlertStage
(
AlertStageEnums
.
LLDP
.
getValue
());
alertCalled
.
setAlertStage
(
AlertStageEnums
.
LLDP
.
getValue
());
alertCalled
.
setAlarmType
(
AlertStageEnums
.
JQCB
.
getValue
());
alertCalled
.
setAlarmType
(
AlertStageEnums
.
JQCB
.
getValue
());
alertCalled
.
setAlarmTypeCode
(
AlertStageEnums
.
JQCB
.
getCode
());
alertCalled
.
setAlarmTypeCode
(
AlertStageEnums
.
JQCB
.
getCode
());
alertCalled
.
setRemark
(
alertCalledObjsDto
.
getRemark
());
alertCalled
.
setRemark
(
alertCalledObjsDto
.
getRemark
());
this
.
save
(
alertCalled
);
this
.
save
(
alertCalled
);
// 填充警情主键
// 填充警情主键
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValuelist
.
stream
().
forEach
(
alertFormValue
->
{
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertCalledId
(
alertCalled
.
getSequenceNbr
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
alertFormValue
.
setAlertTypeCode
(
alertCalled
.
getAlertTypeCode
());
});
});
// 保存动态表单数据
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
alertCalledObjsDto
.
setAlertCalled
(
alertCalled
);
alertCalledObjsDto
.
setAlertCalled
(
alertCalled
);
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
alertCalledObjsDto
.
setAlertFormValue
(
alertFormValuelist
);
// 警情报送
// 警情报送
// 调用规则 警情初报
// 调用规则 警情初报
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
,
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
null
,
null
,
null
);
ruleAlertCalledService
.
fireAlertCalledRule
(
alertCalledObjsDto
,
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
null
,
null
,
null
);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
/**
/**
* 同步保存ES
* 同步保存ES
*/
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
}
}
return
alertCalledObjsDto
;
return
alertCalledObjsDto
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
}
}
/**
/**
* 根据id 修改警情 type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
* 根据id 修改警情 type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
*/
*/
@Override
@Override
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
boolean
updateAlertCalled
(
Long
id
,
String
code
)
{
public
boolean
updateAlertCalled
(
Long
id
,
String
code
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
try
{
try
{
switch
(
code
)
{
switch
(
code
)
{
case
"314"
:
case
"314"
:
alertCalledMapper
.
update
(
null
,
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"alert_status"
,
1
)
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"alert_status"
,
1
)
.
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
())
.
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
())
.
set
(
"update_time"
,
new
Date
())
.
set
(
"update_time"
,
new
Date
())
.
set
(
"alarm_type"
,
AlertStageEnums
.
FJQ
.
getValue
())
.
set
(
"alarm_type"
,
AlertStageEnums
.
FJQ
.
getValue
())
.
set
(
"alarm_type_code"
,
AlertStageEnums
.
FJQ
.
getCode
()));
.
set
(
"alarm_type_code"
,
AlertStageEnums
.
FJQ
.
getCode
()));
break
;
break
;
case
"315"
:
case
"315"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_status"
,
1
).
set
(
"update_time"
,
new
Date
()).
set
(
"alert_stage"
,
AlertStageEnums
.
CZJS
.
getValue
()));
.
set
(
"alert_status"
,
1
).
set
(
"update_time"
,
new
Date
()).
set
(
"alert_stage"
,
AlertStageEnums
.
CZJS
.
getValue
()));
break
;
break
;
default
:
default
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"update_time"
,
new
Date
()).
set
(
"alert_stage"
,
AlertStageEnums
.
CZGZ
.
getValue
()));
.
set
(
"update_time"
,
new
Date
()).
set
(
"alert_stage"
,
AlertStageEnums
.
CZGZ
.
getValue
()));
break
;
break
;
}
}
AlertCalled
alertCalled
=
this
.
getById
(
id
);
AlertCalled
alertCalled
=
this
.
getById
(
id
);
// 删除缓存
// 删除缓存
redisUtils
.
del
(
RedisKey
.
ALERTCALLED_ID
+
id
);
redisUtils
.
del
(
RedisKey
.
ALERTCALLED_ID
+
id
);
/**
/**
* 同步更新存ES
* 同步更新存ES
*/
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0新警情, 1警情状态变化
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0新警情, 1警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"1"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"1"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
true
);
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常!"
);
throw
new
RuntimeException
(
"系统异常!"
);
}
}
}
}
/**
/**
* 根据时间区间查询警情列表信息
* 根据时间区间查询警情列表信息
*
*
* @param beginDate 开始时间
* @param beginDate 开始时间
* @param endDate 结束时间
* @param endDate 结束时间
*/
*/
public
List
<
Map
<
String
,
Object
>>
listByDateRange
(
String
beginDate
,
String
endDate
)
{
public
List
<
Map
<
String
,
Object
>>
listByDateRange
(
String
beginDate
,
String
endDate
)
{
// 查询指定日期内的警情列表
// 查询指定日期内的警情列表
List
<
AlertCalled
>
alertCalledList
=
this
.
list
(
new
LambdaQueryWrapper
<
AlertCalled
>()
List
<
AlertCalled
>
alertCalledList
=
this
.
list
(
new
LambdaQueryWrapper
<
AlertCalled
>()
.
apply
(!
ValidationUtil
.
isEmpty
(
beginDate
),
"call_time >= '"
+
beginDate
+
"'"
)
.
apply
(!
ValidationUtil
.
isEmpty
(
beginDate
),
"call_time >= '"
+
beginDate
+
"'"
)
.
le
(
true
,
AlertCalled:
:
getCallTime
,
endDate
));
.
le
(
true
,
AlertCalled:
:
getCallTime
,
endDate
));
Map
<
String
,
String
>
queryParams
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
queryParams
=
Maps
.
newHashMap
();
queryParams
.
put
(
"beginDate"
,
beginDate
);
queryParams
.
put
(
"beginDate"
,
beginDate
);
queryParams
.
put
(
"endDate"
,
endDate
);
queryParams
.
put
(
"endDate"
,
endDate
);
List
<
Map
<
String
,
Object
>>
allList
=
Lists
.
newArrayList
();
List
<
Map
<
String
,
Object
>>
allList
=
Lists
.
newArrayList
();
if
(!
ValidationUtil
.
isEmpty
(
alertCalledList
))
{
if
(!
ValidationUtil
.
isEmpty
(
alertCalledList
))
{
Map
<
String
,
List
<
AlertCalled
>>
alertCalledMap
=
alertCalledList
.
stream
()
Map
<
String
,
List
<
AlertCalled
>>
alertCalledMap
=
alertCalledList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
AlertCalled:
:
getAlertTypeCode
));
.
collect
(
Collectors
.
groupingBy
(
AlertCalled:
:
getAlertTypeCode
));
Map
<
Long
,
AlertCalled
>
calledMap
=
alertCalledList
.
stream
()
Map
<
Long
,
AlertCalled
>
calledMap
=
alertCalledList
.
stream
()
.
collect
(
Collectors
.
toMap
(
AlertCalled:
:
getSequenceNbr
,
Function
.
identity
()));
.
collect
(
Collectors
.
toMap
(
AlertCalled:
:
getSequenceNbr
,
Function
.
identity
()));
alertCalledMap
.
forEach
((
alertTypeCode
,
list
)
->
{
alertCalledMap
.
forEach
((
alertTypeCode
,
list
)
->
{
allList
.
addAll
(
iAlertFormValueService
.
listAll
(
alertTypeCode
,
queryParams
));
allList
.
addAll
(
iAlertFormValueService
.
listAll
(
alertTypeCode
,
queryParams
));
});
});
allList
.
forEach
(
i
->
{
allList
.
forEach
(
i
->
{
// 增加非空判断 cz 2021-10-08
// 增加非空判断 cz 2021-10-08
if
(
calledMap
.
get
(
Long
.
parseLong
(
i
.
get
(
"instanceId"
).
toString
()))
!=
null
)
{
if
(
calledMap
.
get
(
Long
.
parseLong
(
i
.
get
(
"instanceId"
).
toString
()))
!=
null
)
{
AlertCalled
alertCalled
=
calledMap
.
get
(
Long
.
parseLong
(
i
.
get
(
"instanceId"
).
toString
()));
AlertCalled
alertCalled
=
calledMap
.
get
(
Long
.
parseLong
(
i
.
get
(
"instanceId"
).
toString
()));
i
.
putAll
(
Bean
.
BeantoMap
(
alertCalled
));
i
.
putAll
(
Bean
.
BeantoMap
(
alertCalled
));
}
}
});
});
}
}
// 按接警时间正序排序
// 按接警时间正序排序
allList
.
sort
((
e
,
o
)
->
comparingByGroupVal
(
e
,
o
,
"recDate"
));
allList
.
sort
((
e
,
o
)
->
comparingByGroupVal
(
e
,
o
,
"recDate"
));
return
allList
;
return
allList
;
}
}
public
Map
<
String
,
Object
>
getAlertInfoList
(
String
beginDate
,
String
endDate
)
{
public
Map
<
String
,
Object
>
getAlertInfoList
(
String
beginDate
,
String
endDate
)
{
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
result
=
Maps
.
newHashMap
();
List
<
Map
<
String
,
Object
>>
list
=
listByDateRange
(
beginDate
,
endDate
);
List
<
Map
<
String
,
Object
>>
list
=
listByDateRange
(
beginDate
,
endDate
);
// 获取接警情况模板
// 获取接警情况模板
List
<
Template
>
templateList
=
templateMapper
.
selectList
(
new
LambdaQueryWrapper
<
Template
>()
List
<
Template
>
templateList
=
templateMapper
.
selectList
(
new
LambdaQueryWrapper
<
Template
>()
.
eq
(
Template:
:
getFormat
,
false
).
like
(
Template:
:
getTypeCode
,
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
));
.
eq
(
Template:
:
getFormat
,
false
).
like
(
Template:
:
getTypeCode
,
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
));
Map
<
String
,
Template
>
templateMap
=
templateList
.
stream
()
Map
<
String
,
Template
>
templateMap
=
templateList
.
stream
()
.
collect
(
Collectors
.
toMap
(
Template:
:
getTypeCode
,
Function
.
identity
()));
.
collect
(
Collectors
.
toMap
(
Template:
:
getTypeCode
,
Function
.
identity
()));
List
<
String
>
contentList
=
Lists
.
newArrayList
();
List
<
String
>
contentList
=
Lists
.
newArrayList
();
// 增加非空判断 cz 2021-10-08
// 增加非空判断 cz 2021-10-08
list
.
forEach
(
i
->
{
list
.
forEach
(
i
->
{
if
(
i
.
get
(
"alertTypeCode"
)
!=
null
)
{
if
(
i
.
get
(
"alertTypeCode"
)
!=
null
)
{
String
tempContent
=
templateMap
.
get
(
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
+
i
.
get
(
"alertTypeCode"
))
String
tempContent
=
templateMap
.
get
(
DutyInfoEnum
.
接警情况
.
getKey
()
+
"-"
+
i
.
get
(
"alertTypeCode"
))
.
getContent
();
.
getContent
();
contentList
.
add
(
replaceTemplate
(
tempContent
,
i
));
contentList
.
add
(
replaceTemplate
(
tempContent
,
i
));
}
}
});
});
Map
<
String
,
Integer
>
statusCountMap
=
alertCalledMapper
.
queryAlertStatusCount
(
beginDate
,
endDate
);
Map
<
String
,
Integer
>
statusCountMap
=
alertCalledMapper
.
queryAlertStatusCount
(
beginDate
,
endDate
);
Integer
unFinishedCount
=
this
Integer
unFinishedCount
=
this
.
count
(
new
LambdaQueryWrapper
<
AlertCalled
>().
eq
(
AlertCalled:
:
getAlertStatus
,
false
));
// bug2532
.
count
(
new
LambdaQueryWrapper
<
AlertCalled
>().
eq
(
AlertCalled:
:
getAlertStatus
,
false
));
// bug2532
// 未结案警情统计错误
// 未结案警情统计错误
// bykongfm
// bykongfm
result
.
put
(
"alertInfoList"
,
contentList
);
result
.
put
(
"alertInfoList"
,
contentList
);
result
.
putAll
(
statusCountMap
);
result
.
putAll
(
statusCountMap
);
result
.
put
(
"unFinishedCount"
,
unFinishedCount
);
result
.
put
(
"unFinishedCount"
,
unFinishedCount
);
return
result
;
return
result
;
}
}
/**
/**
* 替换模板
* 替换模板
*
*
* @param tempContent 模板
* @param tempContent 模板
* @param objMap 对象map
* @param objMap 对象map
* @return
* @return
*/
*/
private
String
replaceTemplate
(
String
tempContent
,
Map
<
String
,
Object
>
objMap
)
{
private
String
replaceTemplate
(
String
tempContent
,
Map
<
String
,
Object
>
objMap
)
{
int
size
=
objMap
.
size
();
int
size
=
objMap
.
size
();
String
[]
keys
=
objMap
.
keySet
().
toArray
(
new
String
[
size
]);
String
[]
keys
=
objMap
.
keySet
().
toArray
(
new
String
[
size
]);
Object
[]
values
=
objMap
.
values
().
toArray
(
new
Object
[
size
]);
Object
[]
values
=
objMap
.
values
().
toArray
(
new
Object
[
size
]);
List
<
String
>
strList
=
Lists
.
newArrayList
();
List
<
String
>
strList
=
Lists
.
newArrayList
();
for
(
Object
obj
:
values
)
{
for
(
Object
obj
:
values
)
{
if
(!
ValidationUtil
.
isEmpty
(
obj
))
{
if
(!
ValidationUtil
.
isEmpty
(
obj
))
{
if
(
obj
instanceof
Date
)
{
if
(
obj
instanceof
Date
)
{
obj
=
DateUtils
.
date2LongStr
((
Date
)
obj
);
obj
=
DateUtils
.
date2LongStr
((
Date
)
obj
);
}
}
strList
.
add
(
obj
.
toString
());
strList
.
add
(
obj
.
toString
());
}
else
{
}
else
{
strList
.
add
(
""
);
strList
.
add
(
""
);
}
}
}
}
return
StringUtils
.
replaceEach
(
tempContent
,
keys
,
strList
.
toArray
(
new
String
[
strList
.
size
()]));
return
StringUtils
.
replaceEach
(
tempContent
,
keys
,
strList
.
toArray
(
new
String
[
strList
.
size
()]));
}
}
@Override
@Override
public
Map
<
String
,
Object
>
selectAlertCalledKeyValueLabelById
(
Long
id
)
{
public
Map
<
String
,
Object
>
selectAlertCalledKeyValueLabelById
(
Long
id
)
{
// 警情基本信息
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
AlertCalled
alertCalled
=
this
.
getById
(
id
);
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"title"
,
"【"
+
alertCalled
.
getAlertType
()
+
"】"
+
alertCalled
.
getAddress
());
map
.
put
(
"title"
,
"【"
+
alertCalled
.
getAlertType
()
+
"】"
+
alertCalled
.
getAddress
());
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
// 警情动态表单数据
// 警情动态表单数据
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
listdate
.
add
(
new
KeyValueLabel
(
"接警时间"
,
"callTime"
,
alertCalled
.
getCallTime
()));
listdate
.
add
(
new
KeyValueLabel
(
"接警时间"
,
"callTime"
,
alertCalled
.
getCallTime
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情地点"
,
"address"
,
alertCalled
.
getAddress
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情地点"
,
"address"
,
alertCalled
.
getAddress
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情类型"
,
"alertType"
,
alertCalled
.
getAlertType
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情类型"
,
"alertType"
,
alertCalled
.
getAlertType
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情阶段"
,
"alertStage"
,
alertCalled
.
getAlertStage
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情阶段"
,
"alertStage"
,
alertCalled
.
getAlertStage
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情等级"
,
"responseLevel"
,
"无"
));
listdate
.
add
(
new
KeyValueLabel
(
"警情等级"
,
"responseLevel"
,
"无"
));
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系人"
,
"contactUser"
,
alertCalled
.
getContactUser
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系人"
,
"contactUser"
,
alertCalled
.
getContactUser
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
// listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
// listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
list
.
stream
().
forEach
(
alertFormValue
->
{
list
.
stream
().
forEach
(
alertFormValue
->
{
/* 2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 开始 */
/* 2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 开始 */
String
valueCode
=
alertFormValue
.
getFieldValue
();
String
valueCode
=
alertFormValue
.
getFieldValue
();
/* 2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 结束 */
/* 2661 灾情详情中字典类数据错误显示为code 改为value值 2021-09-23 陈召 结束 */
/*
/*
* if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); }
* if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); }
*/
*/
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
});
});
map
.
put
(
"data"
,
listdate
);
map
.
put
(
"data"
,
listdate
);
return
map
;
return
map
;
}
}
@Override
@Override
public
List
<
KeyValueLabel
>
selectAlertCalledcount
(
Long
id
)
{
public
List
<
KeyValueLabel
>
selectAlertCalledcount
(
Long
id
)
{
// 警情基本信息
// 警情基本信息
AlertCalled
alertCalled
=
this
.
getById
(
id
);
AlertCalled
alertCalled
=
this
.
getById
(
id
);
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
return
listdate
;
return
listdate
;
}
}
@Override
@Override
public
List
<
KeyValueLabel
>
powercount
(
Long
id
)
{
public
List
<
KeyValueLabel
>
powercount
(
Long
id
)
{
Map
<
String
,
Integer
>
map
=
powerTransferMapper
.
getCarNum
(
id
);
Map
<
String
,
Integer
>
map
=
powerTransferMapper
.
getCarNum
(
id
);
// Map<String,Integer> mapc=powerTransferMapper.getCompanyNum(id);
// Map<String,Integer> mapc=powerTransferMapper.getCompanyNum(id);
// Map<String,Integer> mapu= alertSubmittedMapper.getUseNum(id);
// Map<String,Integer> mapu= alertSubmittedMapper.getUseNum(id);
// 统计参与人员
// 统计参与人员
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"useNum"
,
"0"
,
"人"
));
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"useNum"
,
"0"
,
"人"
));
// 统计参与车辆
// 统计参与车辆
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"carNum"
,
map
.
get
(
"carNum"
),
"辆"
));
listdate
.
add
(
new
KeyValueLabel
(
"调动人力"
,
"carNum"
,
map
.
get
(
"carNum"
),
"辆"
));
// 统计参与队伍
// 统计参与队伍
listdate
.
add
(
new
KeyValueLabel
(
"调动单位"
,
"companyNum"
,
map
.
get
(
"companyNum"
),
"个"
));
listdate
.
add
(
new
KeyValueLabel
(
"调动单位"
,
"companyNum"
,
map
.
get
(
"companyNum"
),
"个"
));
return
listdate
;
return
listdate
;
}
}
@Override
@Override
public
List
<
PowerData
>
getPowerDataList
(
Long
id
)
{
public
List
<
PowerData
>
getPowerDataList
(
Long
id
)
{
List
<
PowerData
>
list
=
powerTransferMapper
.
getPowerDataList
(
id
);
List
<
PowerData
>
list
=
powerTransferMapper
.
getPowerDataList
(
id
);
return
list
;
return
list
;
}
}
@Override
@Override
public
AlertCalled
getAlertCalledById
(
Long
id
)
{
public
AlertCalled
getAlertCalledById
(
Long
id
)
{
return
this
.
getById
(
id
);
return
this
.
getById
(
id
);
}
}
@Override
@Override
public
Integer
AlertCalledcountTime
(
int
type
)
{
public
Integer
AlertCalledcountTime
(
int
type
)
{
return
alertCalledMapper
.
AlertCalledcountTime
(
type
);
return
alertCalledMapper
.
AlertCalledcountTime
(
type
);
}
}
@Override
@Override
public
List
<
AlertCalledTodyDto
>
getTodayAlertCalled
()
{
public
List
<
AlertCalledTodyDto
>
getTodayAlertCalled
()
{
return
alertCalledMapper
.
getTodayAlertCalled
();
return
alertCalledMapper
.
getTodayAlertCalled
();
}
}
public
Boolean
controlEquip
()
{
public
Boolean
controlEquip
()
{
/**
/**
* 获取控制器设备
* 获取控制器设备
*/
*/
List
<
ControllerEquipDto
>
controllerEquipDtoList
=
controllerEquipService
.
queryAllForList
();
List
<
ControllerEquipDto
>
controllerEquipDtoList
=
controllerEquipService
.
queryAllForList
();
Map
<
Long
,
List
<
String
>>
controllerEquipMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
String
>>
controllerEquipMap
=
new
HashMap
<>();
for
(
ControllerEquipDto
controllerEquipDto
:
controllerEquipDtoList
)
{
for
(
ControllerEquipDto
controllerEquipDto
:
controllerEquipDtoList
)
{
List
<
String
>
numList
=
controllerEquipMap
.
get
(
controllerEquipDto
.
getControllerSeq
());
List
<
String
>
numList
=
controllerEquipMap
.
get
(
controllerEquipDto
.
getControllerSeq
());
if
(
ValidationUtil
.
isEmpty
(
numList
))
{
if
(
ValidationUtil
.
isEmpty
(
numList
))
{
numList
=
new
ArrayList
<>();
numList
=
new
ArrayList
<>();
}
}
numList
.
add
(
controllerEquipDto
.
getNum
());
numList
.
add
(
controllerEquipDto
.
getNum
());
controllerEquipMap
.
put
(
controllerEquipDto
.
getControllerSeq
(),
numList
);
controllerEquipMap
.
put
(
controllerEquipDto
.
getControllerSeq
(),
numList
);
}
}
/**
/**
* 获取联动控制器
* 获取联动控制器
*/
*/
List
<
ControllerDto
>
controllerDtoList
=
controllerService
.
queryAllForList
();
List
<
ControllerDto
>
controllerDtoList
=
controllerService
.
queryAllForList
();
StringBuilder
bellNumSb
=
new
StringBuilder
();
StringBuilder
bellNumSb
=
new
StringBuilder
();
// StringBuilder broadcastNumSb = new StringBuilder();
// StringBuilder broadcastNumSb = new StringBuilder();
for
(
ControllerDto
controllerDto
:
controllerDtoList
)
{
for
(
ControllerDto
controllerDto
:
controllerDtoList
)
{
// 消防警铃
// 消防警铃
if
(
controllerDto
.
getType
().
equals
(
ControllerTypeEnum
.
BELL
.
getCode
()))
{
if
(
controllerDto
.
getType
().
equals
(
ControllerTypeEnum
.
BELL
.
getCode
()))
{
List
<
String
>
bellNumList
=
controllerEquipMap
.
get
(
controllerDto
.
getSequenceNbr
());
List
<
String
>
bellNumList
=
controllerEquipMap
.
get
(
controllerDto
.
getSequenceNbr
());
if
(!
ValidationUtil
.
isEmpty
(
bellNumList
))
{
if
(!
ValidationUtil
.
isEmpty
(
bellNumList
))
{
for
(
String
num
:
bellNumList
)
{
for
(
String
num
:
bellNumList
)
{
bellNumSb
.
append
(
num
).
append
(
","
);
bellNumSb
.
append
(
num
).
append
(
","
);
}
}
}
}
}
}
// 广播
// 广播
// if (controllerDto.getType().equals(ControllerTypeEnum.BROADCAST.getCode())) {
// if (controllerDto.getType().equals(ControllerTypeEnum.BROADCAST.getCode())) {
// List<String> broadcastList = controllerEquipMap.get(controllerDto.getSequenceNbr());
// List<String> broadcastList = controllerEquipMap.get(controllerDto.getSequenceNbr());
// if (!ValidationUtil.isEmpty(broadcastList)) {
// if (!ValidationUtil.isEmpty(broadcastList)) {
...
@@ -652,278 +643,266 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
...
@@ -652,278 +643,266 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// }
// }
// }
// }
// }
// }
}
}
/**
/**
* 打开消防警铃
* 打开消防警铃
*/
*/
if
(!
ValidationUtil
.
isEmpty
(
bellNumSb
.
toString
()))
{
if
(!
ValidationUtil
.
isEmpty
(
bellNumSb
.
toString
()))
{
String
bellNum
=
bellNumSb
.
toString
();
String
bellNum
=
bellNumSb
.
toString
();
bellNum
=
bellNum
.
substring
(
0
,
bellNum
.
length
()
-
1
);
bellNum
=
bellNum
.
substring
(
0
,
bellNum
.
length
()
-
1
);
String
[]
bellNums
=
bellNum
.
split
(
","
);
String
[]
bellNums
=
bellNum
.
split
(
","
);
for
(
int
i
=
0
;
i
<
bellNums
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
bellNums
.
length
;
i
++)
{
{
//打开15s后自动关闭
//打开15s后自动关闭
try
{
try
jcsControlServerClient
.
sendBellActionWithTime
(
bellNums
[
i
],
"1"
,
15
);
{
}
catch
(
Exception
e
)
{
jcsControlServerClient
.
sendBellActionWithTime
(
bellNums
[
i
],
"1"
,
15
);
logger
.
info
(
"打开警铃【"
+
bellNums
[
i
]
+
"】异常!"
);
}
}
catch
(
Exception
e
)
}
{
}
logger
.
info
(
"打开警铃【"
+
bellNums
[
i
]+
"】异常!"
);
/**
}
* 播放广播
}
*/
}
/**
* 播放广播
*/
// if (!ValidationUtil.isEmpty(broadcastNumSb.toString())) {
// if (!ValidationUtil.isEmpty(broadcastNumSb.toString())) {
// String broadcastNum = broadcastNumSb.toString();
// String broadcastNum = broadcastNumSb.toString();
// broadcastNum = broadcastNum.substring(0, broadcastNum.length() - 1);
// broadcastNum = broadcastNum.substring(0, broadcastNum.length() - 1);
// jcsControlServerClient.sendFileAction(broadcastNum, "1490075199246.mp3");
// jcsControlServerClient.sendFileAction(broadcastNum, "1490075199246.mp3");
// }
// }
/**
/**
* 打开北站车库门
* 打开北站车库门
*/
*/
List
<
ControllerDto
>
northDoor
=
controllerService
.
queryForList
(
"3"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
List
<
ControllerDto
>
northDoor
=
controllerService
.
queryForList
(
"3"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
if
(!
ValidationUtil
.
isEmpty
(
northDoor
))
{
if
(!
ValidationUtil
.
isEmpty
(
northDoor
))
{
ControllerDto
controllerDto
=
northDoor
.
get
(
0
);
ControllerDto
controllerDto
=
northDoor
.
get
(
0
);
// 打开北站车库门
// 打开北站车库门
try
try
{
{
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1,1,1,1"
);
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1,1,1,1"
);
}
catch
(
Exception
e
)
{
}
logger
.
info
(
"打开北站车库门【"
+
controllerDto
.
getIp
()
+
"】异常!"
);
catch
(
Exception
e
)
}
{
// 打开北站车库门弱电警铃
logger
.
info
(
"打开北站车库门【"
+
controllerDto
.
getIp
()+
"】异常!"
);
try
{
}
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
// 打开北站车库门弱电警铃
}
catch
(
Exception
e
)
{
try
logger
.
info
(
"打开北站弱电警铃【"
+
controllerDto
.
getIp
()
+
"】异常!"
);
{
}
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
}
}
/**
catch
(
Exception
e
)
* 打开南站车库门
{
*/
logger
.
info
(
"打开北站弱电警铃【"
+
controllerDto
.
getIp
()+
"】异常!"
);
List
<
ControllerDto
>
southDoor
=
controllerService
.
queryForList
(
"2"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
}
if
(!
ValidationUtil
.
isEmpty
(
southDoor
))
{
}
ControllerDto
controllerDto
=
southDoor
.
get
(
0
);
/**
// 打开南站车库门
* 打开南站车库门
try
{
*/
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1"
);
List
<
ControllerDto
>
southDoor
=
controllerService
.
queryForList
(
"2"
,
ControllerTypeEnum
.
DOOR
.
getCode
());
}
catch
(
Exception
e
)
{
if
(!
ValidationUtil
.
isEmpty
(
southDoor
))
{
logger
.
info
(
"打开南站车库门【"
+
controllerDto
.
getIp
()
+
"】异常!"
);
ControllerDto
controllerDto
=
southDoor
.
get
(
0
);
}
// 打开南站车库门
// 打开南站车库门弱电警铃
try
try
{
{
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
100
,
"1"
);
}
catch
(
Exception
e
)
{
}
logger
.
info
(
"打开南站弱电警铃【"
+
controllerDto
.
getIp
()
+
"】异常!"
);
catch
(
Exception
e
)
}
{
}
logger
.
info
(
"打开南站车库门【"
+
controllerDto
.
getIp
()+
"】异常!"
);
}
return
true
;
// 打开南站车库门弱电警铃
}
try
{
/**
jcsControlServerClient
.
writeStateAction
(
controllerDto
.
getIp
(),
controllerDto
.
getPort
(),
107
,
"1"
);
* 警情重新定位
}
*
catch
(
Exception
e
)
* @param alertId 警情id
{
* @param longitude 经度
logger
.
info
(
"打开南站弱电警铃【"
+
controllerDto
.
getIp
()+
"】异常!"
);
* @param latitude 纬度
}
* @return
}
*/
public
Boolean
reLocate
(
String
alertId
,
String
longitude
,
String
latitude
)
{
return
true
;
try
{
}
// 更新警情主表
AlertCalled
alertCalled
=
this
.
baseMapper
.
selectById
(
alertId
);
/**
alertCalled
.
setCoordinateX
(
Double
.
valueOf
(
longitude
));
* 警情重新定位
alertCalled
.
setCoordinateY
(
Double
.
valueOf
(
latitude
));
*
this
.
updateById
(
alertCalled
);
* @param alertId 警情id
// 插入定位日志表
* @param longitude 经度
AlertLocationLog
alertLocationLog
=
new
AlertLocationLog
();
* @param latitude 纬度
alertLocationLog
.
setAlertId
(
Long
.
valueOf
(
alertId
));
* @return
alertLocationLog
.
setLongitude
(
longitude
);
*/
alertLocationLog
.
setLatitude
(
latitude
);
public
Boolean
reLocate
(
String
alertId
,
String
longitude
,
String
latitude
)
{
alertLocationLogService
.
save
(
alertLocationLog
);
try
{
// 更新警情主表
return
true
;
AlertCalled
alertCalled
=
this
.
baseMapper
.
selectById
(
alertId
);
}
catch
(
Exception
e
)
{
alertCalled
.
setCoordinateX
(
Double
.
valueOf
(
longitude
));
log
.
error
(
e
.
toString
());
alertCalled
.
setCoordinateY
(
Double
.
valueOf
(
latitude
));
e
.
printStackTrace
();
this
.
updateById
(
alertCalled
);
throw
new
RuntimeException
(
"警情定位失败!"
);
// 插入定位日志表
}
AlertLocationLog
alertLocationLog
=
new
AlertLocationLog
();
}
alertLocationLog
.
setAlertId
(
Long
.
valueOf
(
alertId
));
alertLocationLog
.
setLongitude
(
longitude
);
@Override
alertLocationLog
.
setLatitude
(
latitude
);
public
Map
<
String
,
Object
>
queryAlertCalledById
(
Long
id
)
{
alertLocationLogService
.
save
(
alertLocationLog
);
// 警情基本信息
return
true
;
AlertCalled
alertCalled
=
this
.
getById
(
id
);
}
catch
(
Exception
e
)
{
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
log
.
error
(
e
.
toString
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
e
.
printStackTrace
();
map
.
put
(
"title"
,
"【"
+
alertCalled
.
getAlertType
()
+
"】"
+
alertCalled
.
getAddress
());
throw
new
RuntimeException
(
"警情定位失败!"
);
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
}
}
// 警情动态表单数据
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
@Override
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
public
Map
<
String
,
Object
>
queryAlertCalledById
(
Long
id
)
{
listdate
.
add
(
new
KeyValueLabel
(
"接警时间"
,
"callTime"
,
alertCalled
.
getCallTime
()));
listdate
.
add
(
new
KeyValueLabel
(
"警情地点"
,
"address"
,
alertCalled
.
getAddress
()));
// 警情基本信息
listdate
.
add
(
new
KeyValueLabel
(
"警情类型"
,
"alertType"
,
alertCalled
.
getAlertType
()));
AlertCalled
alertCalled
=
this
.
getById
(
id
);
listdate
.
add
(
new
KeyValueLabel
(
"警情阶段"
,
"alertStage"
,
alertCalled
.
getAlertStage
()));
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
listdate
.
add
(
new
KeyValueLabel
(
"警情等级"
,
"responseLevel"
,
"无"
));
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
map
.
put
(
"title"
,
"【"
+
alertCalled
.
getAlertType
()
+
"】"
+
alertCalled
.
getAddress
());
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
listdate
.
add
(
new
KeyValueLabel
(
"联系人"
,
"contactUser"
,
alertCalled
.
getContactUser
()));
listdate
.
add
(
new
KeyValueLabel
(
"联系电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
// 警情动态表单数据
listdate
.
add
(
new
KeyValueLabel
(
"联系人电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
List
<
KeyValueLabel
>
listdate
=
new
ArrayList
<>();
list
.
stream
().
forEach
(
alertFormValue
->
{
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
String
valueCode
=
alertFormValue
.
getFieldValueCode
();
listdate
.
add
(
new
KeyValueLabel
(
"接警时间"
,
"callTime"
,
alertCalled
.
getCallTime
()));
if
(
null
==
valueCode
)
{
listdate
.
add
(
new
KeyValueLabel
(
"警情地点"
,
"address"
,
alertCalled
.
getAddress
()));
valueCode
=
alertFormValue
.
getFieldValue
();
listdate
.
add
(
new
KeyValueLabel
(
"警情类型"
,
"alertType"
,
alertCalled
.
getAlertType
()));
}
listdate
.
add
(
new
KeyValueLabel
(
"警情阶段"
,
"alertStage"
,
alertCalled
.
getAlertStage
()));
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
listdate
.
add
(
new
KeyValueLabel
(
"警情等级"
,
"responseLevel"
,
"无"
));
if
(
"fireTime"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
listdate
.
add
(
new
KeyValueLabel
(
"被困人数"
,
"trappedNum"
,
alertCalled
.
getTrappedNum
()));
map
.
put
(
"occurrenceTime"
,
alertFormValue
.
getFieldValue
());
listdate
.
add
(
new
KeyValueLabel
(
"伤亡人数"
,
"casualtiesNum"
,
alertCalled
.
getCasualtiesNum
()));
}
listdate
.
add
(
new
KeyValueLabel
(
"联系人"
,
"contactUser"
,
alertCalled
.
getContactUser
()));
});
listdate
.
add
(
new
KeyValueLabel
(
"联系电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
map
.
put
(
"data"
,
listdate
);
listdate
.
add
(
new
KeyValueLabel
(
"联系人电话"
,
"contactPhone"
,
alertCalled
.
getContactPhone
()));
list
.
stream
().
forEach
(
alertFormValue
->
{
// app警情首页使用alarmDetailInfo,alarmContactInfo
String
valueCode
=
alertFormValue
.
getFieldValueCode
();
if
(!
AlertStageEnums
.
YBHZ
.
getCode
().
equals
(
alertCalled
.
getAlertTypeCode
()))
{
if
(
null
==
valueCode
)
{
map
.
put
(
"occurrenceTime"
,
alertCalled
.
getCallTime
());
valueCode
=
alertFormValue
.
getFieldValue
();
}
}
map
.
put
(
"alertType"
,
alertCalled
.
getAlertType
());
listdate
.
add
(
new
KeyValueLabel
(
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldCode
(),
valueCode
));
map
.
put
(
"address"
,
alertCalled
.
getAddress
());
if
(
"fireTime"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
map
.
put
(
"contactUser"
,
alertCalled
.
getContactUser
());
map
.
put
(
"occurrenceTime"
,
alertFormValue
.
getFieldValue
());
map
.
put
(
"contactPhone"
,
alertCalled
.
getContactPhone
());
}
map
.
put
(
"callTime"
,
alertCalled
.
getCallTime
());
});
//获取通话录音文件地址
map
.
put
(
"data"
,
listdate
);
List
<
VoiceRecordFileDto
>
voiceRecordFileDtos
=
voiceRecordFileService
.
listByAlertId
(
alertCalled
.
getSequenceNbr
());
if
(!
voiceRecordFileDtos
.
isEmpty
())
{
// app警情首页使用alarmDetailInfo,alarmContactInfo
map
.
put
(
"voiceRecordFile"
,
voiceRecordFileDtos
.
get
(
0
).
getFilePath
());
if
(!
AlertStageEnums
.
YBHZ
.
getCode
().
equals
(
alertCalled
.
getAlertTypeCode
()))
{
}
map
.
put
(
"occurrenceTime"
,
alertCalled
.
getCallTime
());
return
map
;
}
}
map
.
put
(
"alertType"
,
alertCalled
.
getAlertType
());
map
.
put
(
"address"
,
alertCalled
.
getAddress
());
// 未结案警情统计
@Override
map
.
put
(
"contactUser"
,
alertCalled
.
getContactUser
());
public
Integer
AlertCalledcount
(
int
type
)
{
map
.
put
(
"contactPhone"
,
alertCalled
.
getContactPhone
());
return
alertCalledMapper
.
AlertCalledcount
(
0
);
map
.
put
(
"callTime"
,
alertCalled
.
getCallTime
());
}
return
map
;
}
@Override
public
List
<
AlertCalled
>
AlertCalledStatusPage
(
Integer
current
,
Integer
size
)
{
// 未结案警情统计
return
alertCalledMapper
.
AlertCalledStatusPage
(
current
,
size
);
@Override
}
public
Integer
AlertCalledcount
(
int
type
)
{
return
alertCalledMapper
.
AlertCalledcount
(
0
);
@Override
}
public
List
<
JSONObject
>
queryDisposalObjectList
(
String
alertId
)
{
AlertCalled
alertCalled
=
this
.
getById
(
Long
.
valueOf
(
alertId
));
@Override
String
alertTypeCode
=
alertCalled
.
getAlertTypeCode
();
public
List
<
AlertCalled
>
AlertCalledStatusPage
(
Integer
current
,
Integer
size
)
{
AlertStageEnums
alertStage
=
AlertStageEnums
.
getEnum
(
alertTypeCode
);
return
alertCalledMapper
.
AlertCalledStatusPage
(
current
,
size
);
List
<
JSONObject
>
resultList
=
Lists
.
newArrayList
();
}
if
(
alertStage
!=
null
)
{
switch
(
alertStage
)
{
@Override
case
YBHZ:
public
List
<
JSONObject
>
queryDisposalObjectList
(
String
alertId
)
{
case
TFSJ:
AlertCalled
alertCalled
=
this
.
getById
(
Long
.
valueOf
(
alertId
));
case
QTJQ:
String
alertTypeCode
=
alertCalled
.
getAlertTypeCode
();
resultList
=
queryDisposalObjectUnit
(
alertCalled
);
AlertStageEnums
alertStage
=
AlertStageEnums
.
getEnum
(
alertTypeCode
);
break
;
List
<
JSONObject
>
resultList
=
Lists
.
newArrayList
();
case
HKJY:
if
(
alertStage
!=
null
)
{
case
LYXC:
switch
(
alertStage
)
{
case
ZJBZ:
case
YBHZ:
resultList
=
queryDisposalObjectAircraft
(
alertCalled
);
case
TFSJ:
default
:
case
QTJQ:
break
;
resultList
=
queryDisposalObjectUnit
(
alertCalled
);
}
break
;
}
case
HKJY:
return
resultList
;
case
LYXC:
}
case
ZJBZ:
resultList
=
queryDisposalObjectAircraft
(
alertCalled
);
private
List
<
JSONObject
>
queryDisposalObjectUnit
(
AlertCalled
alertCalled
)
{
default
:
List
<
JSONObject
>
resultList
=
Lists
.
newArrayList
();
break
;
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUnitInvolved
()))
{
}
List
<
OrgUsrzhDto
>
unitInvolvedDto
=
iOrgUsrService
.
getOrgUsrzhDto
(
alertCalled
.
getUnitInvolved
());
}
JSONObject
a1
=
new
JSONObject
();
return
resultList
;
a1
.
put
(
"name"
,
"单位名称"
);
}
a1
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getBizOrgName
()
:
""
);
private
List
<
JSONObject
>
queryDisposalObjectUnit
(
AlertCalled
alertCalled
)
{
JSONObject
a2
=
new
JSONObject
();
List
<
JSONObject
>
resultList
=
Lists
.
newArrayList
();
a2
.
put
(
"name"
,
"单位性质"
);
if
(!
ValidationUtil
.
isEmpty
(
alertCalled
.
getUnitInvolved
()))
{
a2
.
put
(
"value"
,
List
<
OrgUsrzhDto
>
unitInvolvedDto
=
iOrgUsrService
.
getOrgUsrzhDto
(
alertCalled
.
getUnitInvolved
());
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyNature
()
:
""
);
JSONObject
a1
=
new
JSONObject
();
JSONObject
a3
=
new
JSONObject
();
a1
.
put
(
"name"
,
"单位名称"
);
a3
.
put
(
"name"
,
"单位电话"
);
a1
.
put
(
"value"
,
a3
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getBizOrgName
()
:
""
);
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyPhone
()
:
""
);
JSONObject
a2
=
new
JSONObject
();
JSONObject
a4
=
new
JSONObject
();
a2
.
put
(
"name"
,
"单位性质"
);
a4
.
put
(
"name"
,
"单位地址"
);
a2
.
put
(
"value"
,
a4
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyNature
()
:
""
);
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyLocation
()
:
""
);
JSONObject
a3
=
new
JSONObject
();
JSONObject
a5
=
new
JSONObject
();
a3
.
put
(
"name"
,
"单位电话"
);
a5
.
put
(
"name"
,
"重点部位数量"
);
a3
.
put
(
"value"
,
a5
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyPhone
()
:
""
);
?
unitInvolvedDto
.
get
(
0
).
getKeySiteCount
()
!=
null
?
unitInvolvedDto
.
get
(
0
).
getKeySiteCount
()
:
0
JSONObject
a4
=
new
JSONObject
();
:
0
+
"个"
);
a4
.
put
(
"name"
,
"单位地址"
);
resultList
.
add
(
a1
);
a4
.
put
(
"value"
,
resultList
.
add
(
a2
);
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
?
unitInvolvedDto
.
get
(
0
).
getCompanyLocation
()
:
""
);
resultList
.
add
(
a3
);
JSONObject
a5
=
new
JSONObject
();
resultList
.
add
(
a4
);
a5
.
put
(
"name"
,
"重点部位数量"
);
resultList
.
add
(
a5
);
a5
.
put
(
"value"
,
!
ValidationUtil
.
isEmpty
(
unitInvolvedDto
.
get
(
0
))
}
?
unitInvolvedDto
.
get
(
0
).
getKeySiteCount
()
!=
null
?
unitInvolvedDto
.
get
(
0
).
getKeySiteCount
()
:
0
return
resultList
;
:
0
+
"个"
);
}
resultList
.
add
(
a1
);
resultList
.
add
(
a2
);
private
List
<
JSONObject
>
queryDisposalObjectAircraft
(
AlertCalled
alertCalled
)
{
resultList
.
add
(
a3
);
// 警情动态表单数据
resultList
.
add
(
a4
);
List
<
AlertFormValue
>
list
=
alertFormValueService
.
getzqlist
(
alertCalled
.
getSequenceNbr
());
resultList
.
add
(
a5
);
Aircraft
aircraft
=
new
Aircraft
();
}
for
(
AlertFormValue
alertFormValue
:
list
)
{
return
resultList
;
if
(
"aircraftModel"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
}
String
aircraftModel
=
alertFormValue
.
getFieldValue
();
aircraft
=
aircraftService
.
queryAircraftInfoByModel
(
aircraftModel
);
private
List
<
JSONObject
>
queryDisposalObjectAircraft
(
AlertCalled
alertCalled
)
{
break
;
// 警情动态表单数据
}
List
<
AlertFormValue
>
list
=
alertFormValueService
.
getzqlist
(
alertCalled
.
getSequenceNbr
());
}
Aircraft
aircraft
=
new
Aircraft
();
List
<
JSONObject
>
resultList
=
Lists
.
newArrayList
();
for
(
AlertFormValue
alertFormValue
:
list
)
{
if
(!
ValidationUtil
.
isEmpty
(
aircraft
))
{
if
(
"aircraftModel"
.
equals
(
alertFormValue
.
getFieldCode
()))
{
JSONObject
a1
=
new
JSONObject
();
String
aircraftModel
=
alertFormValue
.
getFieldValue
();
a1
.
put
(
"name"
,
"飞机型号"
);
aircraft
=
aircraftService
.
queryAircraftInfoByModel
(
aircraftModel
);
a1
.
put
(
"value"
,
aircraft
.
getAircraftModel
());
break
;
JSONObject
a2
=
new
JSONObject
();
}
a2
.
put
(
"name"
,
"发动机类型"
);
}
a2
.
put
(
"value"
,
aircraft
.
getEngineType
());
List
<
JSONObject
>
resultList
=
Lists
.
newArrayList
();
JSONObject
a3
=
new
JSONObject
();
if
(!
ValidationUtil
.
isEmpty
(
aircraft
))
{
a3
.
put
(
"name"
,
"发动机数量"
);
JSONObject
a1
=
new
JSONObject
();
a3
.
put
(
"value"
,
aircraft
.
getEnginesmNum
());
a1
.
put
(
"name"
,
"飞机型号"
);
JSONObject
a4
=
new
JSONObject
();
a1
.
put
(
"value"
,
aircraft
.
getAircraftModel
());
a4
.
put
(
"name"
,
"燃油类型"
);
JSONObject
a2
=
new
JSONObject
();
a4
.
put
(
"value"
,
aircraft
.
getFuelType
());
a2
.
put
(
"name"
,
"发动机类型"
);
JSONObject
a5
=
new
JSONObject
();
a2
.
put
(
"value"
,
aircraft
.
getEngineType
());
a5
.
put
(
"name"
,
"主要燃烧物质"
);
JSONObject
a3
=
new
JSONObject
();
a5
.
put
(
"value"
,
aircraft
.
getCombustionMaterial
());
a3
.
put
(
"name"
,
"发动机数量"
);
resultList
.
add
(
a1
);
a3
.
put
(
"value"
,
aircraft
.
getEnginesmNum
());
resultList
.
add
(
a2
);
JSONObject
a4
=
new
JSONObject
();
resultList
.
add
(
a3
);
a4
.
put
(
"name"
,
"燃油类型"
);
resultList
.
add
(
a4
);
a4
.
put
(
"value"
,
aircraft
.
getFuelType
());
resultList
.
add
(
a5
);
JSONObject
a5
=
new
JSONObject
();
}
a5
.
put
(
"name"
,
"主要燃烧物质"
);
return
resultList
;
a5
.
put
(
"value"
,
aircraft
.
getCombustionMaterial
());
}
resultList
.
add
(
a1
);
resultList
.
add
(
a2
);
/* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始 */
resultList
.
add
(
a3
);
public
List
<
Map
<
String
,
String
>>
getContactName
()
{
resultList
.
add
(
a4
);
// List<Map<String,String>> firefightersName =
resultList
.
add
(
a5
);
// firefightersService.getFirefightersName();
}
// firefightersName.forEach(r->{
return
resultList
;
}
/* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始 */
public
List
<
Map
<
String
,
String
>>
getContactName
()
{
// List<Map<String,String>> firefightersName =
// firefightersService.getFirefightersName();
// firefightersName.forEach(r->{
// String phone = r.get("phone");
// String phone = r.get("phone");
// phone = QRCodeUtil.generateQRCode()+"@"+phone;
// phone = QRCodeUtil.generateQRCode()+"@"+phone;
// r.put("phone",phone);
// r.put("phone",phone);
...
@@ -937,32 +916,32 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
...
@@ -937,32 +916,32 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// }
// }
// );
// );
// firefightersName.addAll(contactNames);
// firefightersName.addAll(contactNames);
List
<
Map
<
String
,
String
>>
list
=
orgUsrServiceImpl
.
getPersonSimpleDetail
();
List
<
Map
<
String
,
String
>>
list
=
orgUsrServiceImpl
.
getPersonSimpleDetail
();
list
.
stream
().
forEach
(
i
->
{
list
.
stream
().
forEach
(
i
->
{
String
phone
=
""
;
String
phone
=
""
;
if
(
i
.
containsKey
(
"phone"
))
{
if
(
i
.
containsKey
(
"phone"
))
{
phone
=
QRCodeUtil
.
generateQRCode
()+
"@"
+
i
.
get
(
"phone"
).
toString
();
phone
=
QRCodeUtil
.
generateQRCode
()
+
"@"
+
i
.
get
(
"phone"
).
toString
();
i
.
replace
(
"phone"
,
phone
);
i
.
replace
(
"phone"
,
phone
);
}
else
{
}
else
{
phone
=
QRCodeUtil
.
generateQRCode
()+
"@"
+
phone
;
phone
=
QRCodeUtil
.
generateQRCode
()
+
"@"
+
phone
;
i
.
put
(
"phone"
,
phone
);
i
.
put
(
"phone"
,
phone
);
}
}
});
});
return
list
;
return
list
;
}
}
public
List
<
String
>
getCalledAddress
()
{
public
List
<
String
>
getCalledAddress
()
{
List
<
String
>
keyAddress
=
keySiteService
.
getAddress
();
List
<
String
>
keyAddress
=
keySiteService
.
getAddress
();
List
<
String
>
alertAddress
=
alertCalledMapper
.
getAddress
();
List
<
String
>
alertAddress
=
alertCalledMapper
.
getAddress
();
keyAddress
.
addAll
(
alertAddress
);
keyAddress
.
addAll
(
alertAddress
);
return
keyAddress
;
return
keyAddress
;
}
}
/* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束 */
/* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束 */
public
Set
<
Map
<
String
,
Object
>>
getLocationLike
(
String
locationt
)
{
public
Set
<
Map
<
String
,
Object
>>
getLocationLike
(
String
locationt
)
{
Set
<
Map
<
String
,
Object
>>
set
=
alertCalledMapper
.
getLocation
();
Set
<
Map
<
String
,
Object
>>
set
=
alertCalledMapper
.
getLocation
();
set
.
remove
(
null
);
set
.
remove
(
null
);
return
set
;
return
set
;
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
static
org
.
hamcrest
.
CoreMatchers
.
nullValue
;
import
java.lang.reflect.Field
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IFireTeamService
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallePowerTransferRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttPersistenceException
;
import
org.springframework.beans.BeanUtils
;
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.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.deepoove.poi.XWPFTemplate
;
import
com.deepoove.poi.config.Configure
;
import
com.deepoove.poi.config.ELMode
;
import
com.deepoove.poi.data.RowRenderData
;
import
com.deepoove.poi.data.style.Style
;
import
com.deepoove.poi.data.style.TableStyle
;
import
com.deepoove.poi.policy.DynamicTableRenderPolicy
;
import
com.deepoove.poi.policy.MiniTableRenderPolicy
;
import
com.deepoove.poi.util.TableTools
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.spire.doc.Document
;
import
com.spire.doc.FileFormat
;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.boot.biz.common.constants.RuleConstant
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.EnumsUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.EnumsUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.WordConverterUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.common.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireTeam
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFireTeamService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallCommandDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallePowerTransferRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledMobDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledPowerInfoDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedExtDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedExtDto
;
...
@@ -62,7 +48,9 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto;
...
@@ -62,7 +48,9 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.InstructionsZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.InstructionsZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerData
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyZHDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PushMessageWebAndAppRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.PushMessageWebAndAppRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto
;
...
@@ -80,18 +68,58 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
...
@@ -80,18 +68,58 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import
com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService
;
import
com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction
;
import
com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.xwpf.usermodel.XWPFTable
;
import
org.apache.poi.xwpf.usermodel.XWPFTableRow
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttPersistenceException
;
import
org.joda.time.DateTime
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum
;
import
org.springframework.beans.BeanUtils
;
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.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.io.BufferedOutputStream
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.lang.reflect.Field
;
import
java.text.ParseException
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.function.BiConsumer
;
import
java.util.function.Consumer
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
/**
/**
...
@@ -130,6 +158,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -130,6 +158,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Autowired
@Autowired
IDutyPersonService
iDutyPersonService
;
IDutyPersonService
iDutyPersonService
;
@Autowired
PowerTransferMapper
powerTransferMapper
;
@Autowired
@Autowired
private
EmqKeeper
emqKeeper
;
private
EmqKeeper
emqKeeper
;
...
@@ -159,11 +189,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -159,11 +189,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Autowired
@Autowired
DynamicFormInstanceMapper
dynamicFormInstanceMapper
;
DynamicFormInstanceMapper
dynamicFormInstanceMapper
;
@Autowired
@Autowired
private
RuleTrigger
ruleTrigger
;
private
RuleTrigger
ruleTrigger
;
private
final
String
msgType
=
"jcs119"
;
private
final
String
msgType
=
"jcs119"
;
@Override
@Override
...
@@ -213,7 +243,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -213,7 +243,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$callTime"
,
DateUtils
.
dateTimeToDateString
(
alertCalled
.
getCallTime
()));
definitions
.
put
(
"$callTime"
,
DateUtils
.
dateTimeToDateString
(
alertCalled
.
getCallTime
()));
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$address"
,
alertCalled
.
getAddress
());
definitions
.
put
(
"$address"
,
alertCalled
.
getAddress
());
String
content
=
getTaskInformation
(
template
.
getRichContent
(),
definitions
);
String
content
=
getTaskInformation
(
template
.
getRichContent
(),
definitions
);
...
@@ -284,119 +314,119 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -284,119 +314,119 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 警情续报 警情结案,非警情确认选择人员电话号码
// 警情续报 警情结案,非警情确认选择人员电话号码
String
ids
=
calledRo
.
getIds
();
String
ids
=
calledRo
.
getIds
();
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
List
<
String
>
ls
=
Arrays
.
asList
(
ids
.
split
(
","
));
List
<
String
>
ls
=
Arrays
.
asList
(
ids
.
split
(
","
));
ls
.
stream
().
forEach
(
e
->
mobiles
.
add
(
e
));
ls
.
stream
().
forEach
(
e
->
mobiles
.
add
(
e
));
}
}
// 获取报送规则
// 获取报送规则
sendIds
.
stream
().
forEach
(
e
->{
sendIds
.
stream
().
forEach
(
e
->{
// 一般火灾 // 航空器救援
// 一般火灾 // 航空器救援
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
YBHZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
()))
{
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
YBHZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
()))
{
if
(
e
.
containsKey
(
"onDuty"
))
{
if
(
e
.
containsKey
(
"onDuty"
))
{
// 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。
// 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。
String
[]
arr
=
e
.
get
(
"onDuty"
).
toString
().
split
(
","
);
String
[]
arr
=
e
.
get
(
"onDuty"
).
toString
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyId
(
list
);
orgUsers
.
addAll
(
mapList
);
}
if
(
e
.
containsKey
(
"fireBrigade"
))
{
// 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员
List
<
FirefightersDto
>
fireBrigade
=
firefightersService
.
queryById
(
e
.
get
(
"fireBrigade"
).
toString
().
split
(
","
),
e
.
get
(
"name"
).
toString
());
fireBrigade
.
stream
().
forEach
(
f
->{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"telephone"
,
f
.
getMobilePhone
());
map
.
put
(
"sequenceNbr"
,
f
.
getSequenceNbr
());
map
.
put
(
"bizOrgName"
,
f
.
getName
());
map
.
put
(
"amosUserId"
,
f
.
getAmosUserId
());
orgUsers
.
add
(
map
);
});
}
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyId
(
list
);
orgUsers
.
addAll
(
mapList
);
}
if
(
e
.
containsKey
(
"fireBrigade"
))
{
// 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员
List
<
FirefightersDto
>
fireBrigade
=
firefightersService
.
queryById
(
e
.
get
(
"fireBrigade"
).
toString
().
split
(
","
),
e
.
get
(
"name"
).
toString
());
fireBrigade
.
stream
().
forEach
(
f
->{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"telephone"
,
f
.
getMobilePhone
());
map
.
put
(
"sequenceNbr"
,
f
.
getSequenceNbr
());
map
.
put
(
"bizOrgName"
,
f
.
getName
());
map
.
put
(
"amosUserId"
,
f
.
getAmosUserId
());
orgUsers
.
add
(
map
);
});
if
(
e
.
containsKey
(
"name"
))
{
}
// 消防救援保障部
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyIdNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList
);
}
// 安运部
if
(
e
.
containsKey
(
"name"
))
{
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"AY"
))
{
// 消防救援保障部
if
(
e
.
containsKey
(
"name"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyIdNew
(
e
.
get
(
"name"
).
toString
());
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
orgUsers
.
addAll
(
mapList
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
}
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
e
.
get
(
"name"
).
toString
(),
list
);
// 安运部
orgUsers
.
addAll
(
mapList
);
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"AY"
))
{
}
if
(
e
.
containsKey
(
"name"
))
{
}
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
// 事发单位
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
e
.
get
(
"name"
).
toString
(),
list
);
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"SF"
))
{
orgUsers
.
addAll
(
mapList
);
if
(
e
.
containsKey
(
"airportPost"
))
{
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
unitInvolved
,
list
);
orgUsers
.
addAll
(
mapList
);
}
}
}
}
}
// 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他
// 事发单位
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
LYXC
.
getCode
())
if
(
e
.
get
(
"type"
).
toString
().
equals
(
"SF"
))
{
||
alertTypeCode
.
equals
(
AlertStageEnums
.
ZJBZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
QTJQ
.
getCode
()))
{
if
(
e
.
containsKey
(
"airportPost"
))
{
if
(
e
.
containsKey
(
"onDuty"
))
{
String
[]
arr
=
e
.
get
(
"airportPost"
).
toString
().
split
(
","
);
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
Map
<
String
,
Object
>>
mapList
=
iOrgUsrService
.
queryCompanyId
(
unitInvolved
,
list
);
orgUsers
.
addAll
(
mapList
);
orgUsers
.
addAll
(
mapList
);
}
}
}
}
}
// 120急救
// 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
JJJQ
.
getCode
()))
{
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
HKJY
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
LYXC
.
getCode
())
if
(
e
.
containsKey
(
"name"
))
{
||
alertTypeCode
.
equals
(
AlertStageEnums
.
ZJBZ
.
getCode
())
||
alertTypeCode
.
equals
(
AlertStageEnums
.
QTJQ
.
getCode
()))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
if
(
e
.
containsKey
(
"onDuty"
))
{
orgUsers
.
addAll
(
mapList
);
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList
);
}
}
List
<
Map
<
String
,
Object
>>
mapList1
=
iOrgUsrService
.
queryCompanyIdNew
(
e
.
get
(
"name"
).
toString
());
// 120急救
orgUsers
.
addAll
(
mapList1
);
if
(
alertTypeCode
.
equals
(
AlertStageEnums
.
JJJQ
.
getCode
()))
{
}
if
(
e
.
containsKey
(
"name"
))
{
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
queryByCompanyNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList
);
List
<
Map
<
String
,
Object
>>
mapList1
=
iOrgUsrService
.
queryCompanyIdNew
(
e
.
get
(
"name"
).
toString
());
orgUsers
.
addAll
(
mapList1
);
}
}
}
});
});
// 警情初报 续报 结案
// 警情初报 续报 结案
// 1.保存警情记录主表
// 1.保存警情记录主表
AlertSubmitted
alertSubmitted
=
new
AlertSubmitted
();
AlertSubmitted
alertSubmitted
=
new
AlertSubmitted
();
alertSubmitted
.
setAlertCalledId
(
Long
.
valueOf
(
calledRo
.
getSequenceNbr
()));
alertSubmitted
.
setAlertCalledId
(
Long
.
valueOf
(
calledRo
.
getSequenceNbr
()));
// 保存初报细分类型(一般火灾、航空器救援等)
// 保存初报细分类型(一般火灾、航空器救援等)
alertSubmitted
.
setBusinessTypeCode
(
calledRo
.
getAlertTypeCode
());
alertSubmitted
.
setBusinessTypeCode
(
calledRo
.
getAlertTypeCode
());
// 警情初报 --- 续报 结案
// 警情初报 --- 续报 结案
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情初报
.
getName
());
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情初报
.
getName
());
Optional
<
SubmissionMethodEnum
>
submissionMethodEnum
=
Optional
.
of
(
SubmissionMethodEnum
.
SMS
);
Optional
<
SubmissionMethodEnum
>
submissionMethodEnum
=
Optional
.
of
(
SubmissionMethodEnum
.
SMS
);
alertSubmitted
.
setSubmissionMethodCode
(
submissionMethodEnum
.
get
().
getCode
());
alertSubmitted
.
setSubmissionMethodCode
(
submissionMethodEnum
.
get
().
getCode
());
alertSubmitted
.
setSubmissionMethod
(
submissionMethodEnum
.
get
().
getName
());
alertSubmitted
.
setSubmissionMethod
(
submissionMethodEnum
.
get
().
getName
());
Optional
<
AlertSchedulingTypeEnum
>
alertSchedulingTypeEnum
=
Optional
.
of
(
AlertSchedulingTypeEnum
.
融合调度
);
Optional
<
AlertSchedulingTypeEnum
>
alertSchedulingTypeEnum
=
Optional
.
of
(
AlertSchedulingTypeEnum
.
融合调度
);
alertSubmitted
.
setSchedulingTypeCode
(
alertSchedulingTypeEnum
.
get
().
getCode
());
alertSubmitted
.
setSchedulingTypeCode
(
alertSchedulingTypeEnum
.
get
().
getCode
());
alertSubmitted
.
setSchedulingType
(
alertSchedulingTypeEnum
.
get
().
getName
());
alertSubmitted
.
setSchedulingType
(
alertSchedulingTypeEnum
.
get
().
getName
());
alertSubmitted
.
setSubmissionContent
(
JSONObject
.
toJSONString
(
objectToMap
(
calledRo
)));
alertSubmitted
.
setSubmissionContent
(
JSONObject
.
toJSONString
(
objectToMap
(
calledRo
)));
alertSubmitted
.
setUpdateTime
(
new
Date
());
alertSubmitted
.
setUpdateTime
(
new
Date
());
alertSubmitted
.
setSubmissionTime
(
new
Date
());
alertSubmitted
.
setSubmissionTime
(
new
Date
());
this
.
baseMapper
.
insert
(
alertSubmitted
);
this
.
baseMapper
.
insert
(
alertSubmitted
);
alertSubmittedId
=
alertSubmitted
.
getSequenceNbr
().
toString
();
alertSubmittedId
=
alertSubmitted
.
getSequenceNbr
().
toString
();
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情续报
.
getName
());
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情续报
.
getName
());
sCode
=
"SMS_JCS_XB"
;
sCode
=
"SMS_JCS_XB"
;
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
}
else
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情结案
.
getName
());
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
警情结案
.
getName
());
sCode
=
"SMS_JCS_JA"
;
sCode
=
"SMS_JCS_JA"
;
}
else
{
}
else
{
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
非警情确认
.
getName
());
alertSubmitted
.
setBusinessType
(
AlertBusinessTypeEnum
.
非警情确认
.
getName
());
sCode
=
"SMS_JCS_QR"
;
sCode
=
"SMS_JCS_QR"
;
}
}
AlertSubmitted
alertSubmittedNew
=
null
;
AlertSubmitted
alertSubmittedNew
=
null
;
Optional
<
AlertBusinessTypeEnum
>
alertBusinessTypeEnum
=
Optional
<
AlertBusinessTypeEnum
>
alertBusinessTypeEnum
=
...
@@ -426,7 +456,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -426,7 +456,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObject
.
setAlertSubmittedId
(
Long
.
parseLong
(
alertSubmittedId
));
alertSubmittedObject
.
setAlertSubmittedId
(
Long
.
parseLong
(
alertSubmittedId
));
}
}
usIds
.
add
(
orgUser
.
get
(
"amosUserId"
).
toString
());
if
(!
ValidationUtil
.
isEmpty
(
orgUser
.
get
(
"amosUserId"
)))
{
usIds
.
add
(
orgUser
.
get
(
"amosUserId"
).
toString
());
}
alertSubmittedObject
.
setType
(
false
);
alertSubmittedObject
.
setType
(
false
);
...
@@ -462,22 +494,22 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -462,22 +494,22 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 组织短信内容
// 组织短信内容
// 调用短信发送接口
// 调用短信发送接口
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<>();
besidesMap
.
put
(
"alterId"
,
String
.
valueOf
(
alertCalled
.
getSequenceNbr
()));
besidesMap
.
put
(
"alterId"
,
String
.
valueOf
(
alertCalled
.
getSequenceNbr
()));
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
()))
{
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
alertCalledAction
.
sendAlertCalleCmd
(
smsCode
,
mobiles
,
smsParams
);
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
}
else
{
}
else
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
()))
{
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"sendTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
}
}
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
if
(
alertWay
.
equals
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
()))
{
besidesMap
.
put
(
"startTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"startTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"endTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getRecDate
(),
DateUtils
.
DATE_TIME_PATTERN
));
besidesMap
.
put
(
"endTime"
,
DateUtils
.
dateFormat
(
alertCalled
.
getRecDate
(),
DateUtils
.
DATE_TIME_PATTERN
));
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
(),
besidesMap
,
smsParams
,
usIds
);
}
}
...
@@ -606,7 +638,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -606,7 +638,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
alertWay
=
AlertBusinessTypeEnum
.
警情结案
.
getCode
();
alertWay
=
AlertBusinessTypeEnum
.
警情结案
.
getCode
();
// 警情结案生成模板
try
{
AlertCalledFormDto
alertCalledFormDto
=
(
AlertCalledFormDto
)
alertCalledService
.
selectAlertCalledById
(
alertSubmittedDto
.
getAlertCalledId
());
AlertCalled
alertCalled
=
alertCalledFormDto
.
getAlertCalled
();
generateMob
(
alertCalled
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
}
if
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
if
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
alertSubmittedDto
.
getBusinessTypeCode
()))
{
...
@@ -655,6 +700,308 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -655,6 +700,308 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
return
map
;
return
map
;
}
}
public
void
generateMob
(
AlertCalled
alertCalled
)
throws
UnsupportedEncodingException
,
FileNotFoundException
,
ParseException
{
AlertCalledMobDto
report
=
new
AlertCalledMobDto
();
report
.
setYear
(
String
.
valueOf
(
DateUtils
.
getYear
(
new
Date
())));
report
.
setUnit
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getUnitInvolved
())
?
""
:
alertCalled
.
getUnitInvolved
());
report
.
setAddress
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getAddress
())
?
""
:
alertCalled
.
getAddress
());
report
.
setAlertType
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getAlertType
())
?
""
:
alertCalled
.
getAlertType
());
report
.
setSourceType
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getAlertSource
())
?
""
:
alertCalled
.
getAlertSource
());
report
.
setReportName
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactUser
())
?
""
:
alertCalled
.
getContactUser
());
report
.
setConectPhone
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getContactPhone
())
?
""
:
alertCalled
.
getContactPhone
());
report
.
setCallTime
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getCallTime
())
?
""
:
DateUtils
.
convertDateToString
(
alertCalled
.
getCallTime
(),
DateUtils
.
DATE_TIME_PATTERN
));
String
urlString
=
""
;
report
.
setEndTime
(
DateUtils
.
convertDateToString
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
));
// 查询第一次调派
List
<
Map
<
String
,
Object
>>
first
=
alertSubmittedMapper
.
getFirst
(
alertCalled
.
getSequenceNbr
());
// 查询后续调派
List
<
Map
<
String
,
Object
>>
other
=
alertSubmittedMapper
.
getFirst
(
alertCalled
.
getSequenceNbr
());
LinkedList
<
AlertCalledPowerInfoDto
>
list
=
new
LinkedList
<>();
for
(
int
i
=
0
;
i
<
first
.
size
();
i
++)
{
AlertCalledPowerInfoDto
dto
=
new
AlertCalledPowerInfoDto
();
if
(
i
==
0
)
{
dto
.
setDisatchNum
(
String
.
valueOf
(
first
.
size
()));
}
handleFunc
(
dto
,
first
.
get
(
i
));
LocalDateTime
dateTime
=
(
LocalDateTime
)
first
.
get
(
i
).
get
(
"recDate"
);
Date
date
=
Date
.
from
(
dateTime
.
toInstant
(
ZoneOffset
.
of
(
"+8"
)));
report
.
setToTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
report
.
setArriveTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
dto
.
setArriveTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
list
.
add
(
dto
);
}
for
(
int
i
=
0
;
i
<
other
.
size
();
i
++)
{
AlertCalledPowerInfoDto
dto
=
new
AlertCalledPowerInfoDto
();
handleFunc
(
dto
,
first
.
get
(
i
));
LocalDateTime
dateTime
=
(
LocalDateTime
)
first
.
get
(
i
).
get
(
"recDate"
);
Date
date
=
Date
.
from
(
dateTime
.
toInstant
(
ZoneOffset
.
of
(
"+8"
)));
dto
.
setArriveTime
((
DateUtils
.
dateFormat
(
date
,
DateUtils
.
HOUR_PATTERN
)));
list
.
add
(
dto
);
}
// 查询应急指挥辅屏值班人员
List
<
Map
<
String
,
Object
>>
mapList
=
iDutyPersonService
.
listOnDutyPerson
();
List
<
AlertCallCommandDto
>
list1
=
new
ArrayList
<>();
mapList
.
forEach
(
e
->{
AlertCallCommandDto
dto
=
new
AlertCallCommandDto
();
dto
.
setName
(
e
.
get
(
"userName"
).
toString
());
dto
.
setDuty
(
e
.
get
(
"postTypeName"
).
toString
());
list1
.
add
(
dto
);
});
if
(
mapList
.
size
()
==
0
)
{
AlertCallCommandDto
commandDto
=
new
AlertCallCommandDto
();
commandDto
.
setName
(
""
);
commandDto
.
setDuty
(
""
);
list1
.
add
(
commandDto
);
}
report
.
setAlertCallCommandDtoList
(
list1
);
report
.
setAlertCalledPowerInfoDtoList
(
list
);
if
(!
ValidationUtil
.
isEmpty
(
report
))
{
String
checkReportTemplatePath
=
this
.
getClass
().
getClassLoader
().
getResource
(
"templates/check-report-template"
+
".docx"
).
getFile
();
String
filePath
=
this
.
getClass
().
getClassLoader
().
getResource
(
"templates"
).
getPath
();
String
fileName
=
filePath
+
"/"
+
System
.
currentTimeMillis
()
+
".docx"
;
String
newFileName
=
""
;
AlertCalledPowerInfoTablePolicy
calledPowerInfoTablePolicy
=
new
AlertCalledPowerInfoTablePolicy
();
AlertCallCommandTablePolicy
alertCallCommandTablePolicy
=
new
AlertCallCommandTablePolicy
();
Configure
.
ConfigureBuilder
configureBuilder
=
Configure
.
newBuilder
();
configureBuilder
.
setElMode
(
ELMode
.
SPEL_MODE
).
bind
(
"alertCalledPowerInfoDtoList"
,
calledPowerInfoTablePolicy
)
.
bind
(
"alertCallCommandDtoList"
,
alertCallCommandTablePolicy
).
build
();
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
checkReportTemplatePath
,
configureBuilder
.
build
()).
render
(
report
);
FileOutputStream
out
=
new
FileOutputStream
(
fileName
);
BufferedOutputStream
bos
=
null
;
try
{
bos
=
new
BufferedOutputStream
(
out
);
template
.
write
(
bos
);
bos
.
flush
();
out
.
flush
();
// docx 转 doc
Document
document
=
new
Document
();
String
os
=
System
.
getProperty
(
"os.name"
);
//拼接完整连接
String
pa1
=
""
;
if
(
os
.
toLowerCase
().
startsWith
(
"win"
)){
String
pa
=
fileName
.
substring
(
1
);
document
.
loadFromFile
(
pa
);
newFileName
=
filePath
+
"/"
+
System
.
currentTimeMillis
()+
".doc"
;
//保存结果文件
pa1
=
newFileName
.
substring
(
1
);
document
.
saveToFile
(
pa1
,
FileFormat
.
Doc
);
}
else
{
document
.
loadFromFile
(
fileName
);
newFileName
=
filePath
+
System
.
currentTimeMillis
()+
".doc"
;
document
.
saveToFile
(
newFileName
,
FileFormat
.
Doc
);
pa1
=
newFileName
;
}
System
.
out
.
println
(
pa1
);
FeignClientResult
<
Map
<
String
,
String
>>
date
=
Systemctl
.
fileStorageClient
.
updateCommonFile
(
WordConverterUtils
.
fileToMultipartFile
(
new
File
(
pa1
)));
if
(
date
!=
null
)
{
Map
<
String
,
String
>
map
=
date
.
getResult
();
Iterator
<
String
>
it
=
map
.
keySet
().
iterator
();
while
(
it
.
hasNext
())
{
urlString
=
it
.
next
();
}
}
System
.
out
.
println
(
urlString
);
// 更新警情信息
alertCalled
.
setRecordUrl
(
urlString
);
alertCalledService
.
updateById
(
alertCalled
);
}
catch
(
IOException
e
)
{
log
.
error
(
"生成文档失败---------->"
);
e
.
printStackTrace
();
}
finally
{
try
{
bos
.
close
();
out
.
close
();
template
.
close
();
File
file
=
new
File
(
fileName
);
if
(
file
.
exists
())
{
file
.
delete
();
}
File
file1
=
new
File
(
newFileName
);
if
(
file1
.
exists
())
{
file1
.
delete
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
void
handleFunc
(
AlertCalledPowerInfoDto
dto
,
Map
<
String
,
Object
>
map
)
{
dto
.
setCarName
(
map
.
get
(
"carName"
).
toString
());
dto
.
setStation
(
map
.
get
(
"companyName"
).
toString
());
// 随车人员
List
<
PowerData
>
powerDataOne
=
powerTransferMapper
.
getPowerDataOne
(
Long
.
valueOf
(
map
.
get
(
"id"
).
toString
()));
if
(!
ValidationUtil
.
isEmpty
(
powerDataOne
))
{
dto
.
setPersonNum
(
String
.
valueOf
(
powerDataOne
.
size
()));
}
else
{
dto
.
setPersonNum
(
"0"
);
}
}
static
int
dangerListDataStartRow
=
2
;
// 表头占两行
static
int
dangerListDataStartRowNew
=
1
;
// 表头占一行
public
static
<
T
>
Consumer
<
T
>
foreachWithIndex
(
BiConsumer
<
T
,
Integer
>
consumer
)
{
class
Obj
{
int
i
;
}
Obj
obj
=
new
Obj
();
return
t
->
{
int
index
=
obj
.
i
++;
consumer
.
accept
(
t
,
index
);
};
}
public
static
class
AlertCalledPowerInfoTablePolicy
extends
DynamicTableRenderPolicy
{
@Override
public
void
render
(
XWPFTable
table
,
Object
o
)
{
if
(
ValidationUtil
.
isEmpty
(
o
))
{
table
.
removeRow
(
dangerListDataStartRow
);
return
;
}
List
<
AlertCalledPowerInfoDto
>
reportDto
=
(
List
<
AlertCalledPowerInfoDto
>)
o
;
List
<
RowRenderData
>
checkDangerList
=
Lists
.
newArrayList
();
reportDto
.
forEach
(
foreachWithIndex
((
report
,
index
)
->
{
RowRenderData
rowRenderData
=
RowRenderData
.
build
(
String
.
valueOf
(
reportDto
.
size
()
-
index
),
report
.
getStation
(),
report
.
getArriveTime
(),
report
.
getCarName
(),
report
.
getPersonNum
(),
report
.
getDisatchNum
(),
report
.
getDryPowder
(),
report
.
getFoam
(),
report
.
getOther
());
checkDangerList
.
add
(
rowRenderData
);
}));
generateTableData
(
table
,
checkDangerList
);
}
}
public
static
class
AlertCallCommandTablePolicy
extends
DynamicTableRenderPolicy
{
@Override
public
void
render
(
XWPFTable
table
,
Object
o
)
{
if
(
ValidationUtil
.
isEmpty
(
o
))
{
table
.
removeRow
(
dangerListDataStartRow
);
return
;
}
List
<
AlertCallCommandDto
>
reportDto
=
(
List
<
AlertCallCommandDto
>)
o
;
List
<
RowRenderData
>
checkDangerList
=
Lists
.
newArrayList
();
reportDto
.
forEach
(
foreachWithIndex
((
report
,
index
)
->
{
RowRenderData
rowRenderData
=
RowRenderData
.
build
(
String
.
valueOf
(
reportDto
.
size
()
-
index
),
report
.
getName
(),
report
.
getDuty
());
checkDangerList
.
add
(
rowRenderData
);
}));
generateTableDataNew
(
table
,
checkDangerList
);
}
private
void
generateTableDataNew
(
XWPFTable
table
,
List
<
RowRenderData
>
dangerList
)
{
if
(!
ValidationUtil
.
isEmpty
(
dangerList
))
{
// 表格渲染和列表数据下标相反,需要翻转一下列表
List
<
RowRenderData
>
reverseList
=
Lists
.
reverse
(
dangerList
);
table
.
removeRow
(
dangerListDataStartRowNew
);
// 循环插入行
int
listLength
=
dangerList
.
size
();
for
(
int
i
=
0
;
i
<
listLength
;
i
++)
{
reverseList
.
get
(
i
).
getCellDatas
().
forEach
(
cellRenderData
->
{
Style
style
=
new
Style
();
style
.
setFontFamily
(
"仿宋"
);
style
.
setFontSize
(
12
);
cellRenderData
.
getRenderData
().
setStyle
(
style
);
});
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRowNew
);
IntStream
.
range
(
2
,
6
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
MiniTableRenderPolicy
.
Helper
.
renderRow
(
table
,
dangerListDataStartRowNew
,
reverseList
.
get
(
i
));
}
TableTools
.
mergeCellsVertically
(
table
,
0
,
0
,
listLength
);
}
}
}
public
static
void
generateTableData
(
XWPFTable
table
,
List
<
RowRenderData
>
dangerList
)
{
String
firstSize
=
""
;
if
(!
ValidationUtil
.
isEmpty
(
dangerList
))
{
firstSize
=
dangerList
.
get
(
0
).
getCellDatas
().
get
(
5
).
getRenderData
().
getText
();
int
fSizs
=
Integer
.
parseInt
(
firstSize
);
// 表格渲染和列表数据下标相反,需要翻转一下列表
List
<
RowRenderData
>
reverseList
=
Lists
.
reverse
(
dangerList
);
table
.
removeRow
(
dangerListDataStartRow
);
// 循环插入行
int
listLength
=
dangerList
.
size
();
for
(
int
i
=
0
;
i
<
fSizs
;
i
++)
{
if
(
i
==
0
)
{
TableStyle
tableStyle
=
new
TableStyle
();
tableStyle
.
setAlign
(
Enum
.
forInt
(
2
));
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
setCellStyle
(
tableStyle
);
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
getRenderData
().
setText
(
"增\n援\n力\n量"
);
Style
style
=
new
Style
();
style
.
setFontFamily
(
"宋体"
);
style
.
setFontSize
(
12
);
style
.
setBold
(
true
);
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
getRenderData
().
setStyle
(
style
);
}
else
{
reverseList
.
get
(
i
).
getCellDatas
().
forEach
(
cellRenderData
->
{
Style
style
=
new
Style
();
style
.
setFontFamily
(
"仿宋"
);
style
.
setFontSize
(
12
);
cellRenderData
.
getRenderData
().
setStyle
(
style
);
});
}
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRow
);
IntStream
.
range
(
5
,
14
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
MiniTableRenderPolicy
.
Helper
.
renderRow
(
table
,
dangerListDataStartRow
,
reverseList
.
get
(
i
));
}
for
(
int
i
=
fSizs
;
i
<
listLength
;
i
++)
{
reverseList
.
get
(
i
).
getCellDatas
().
forEach
(
cellRenderData
->
{
Style
style
=
new
Style
();
style
.
setFontFamily
(
"仿宋"
);
style
.
setFontSize
(
12
);
cellRenderData
.
getRenderData
().
setStyle
(
style
);
});
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRow
);
IntStream
.
range
(
5
,
14
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
MiniTableRenderPolicy
.
Helper
.
renderRow
(
table
,
dangerListDataStartRow
,
reverseList
.
get
(
i
));
}
TableTools
.
mergeCellsVertically
(
table
,
0
,
0
,
fSizs
+
1
);
if
(
listLength
-
fSizs
>
1
)
{
TableTools
.
mergeCellsVertically
(
table
,
0
,
fSizs
+
2
,
listLength
+
1
);
}
}
}
/**
/**
* 短信报送对象
* 短信报送对象
*
*
...
@@ -698,10 +1045,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -698,10 +1045,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
dataDictionary
.
getCode
()).
eq
(
"format"
,
true
));
dataDictionary
.
getCode
()).
eq
(
"format"
,
true
));
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
Map
<
String
,
String
>
definitions
=
new
HashMap
<>();
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$type"
,
alertCalled
.
getAlertType
());
definitions
.
put
(
"$callTime"
,
DateUtils
.
dateTimeToDateString
(
alertCalled
.
getCallTime
()));
definitions
.
put
(
"$callTime"
,
DateUtils
.
dateTimeToDateString
(
alertCalled
.
getCallTime
()));
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$replaceContent"
,
replaceContent
);
definitions
.
put
(
"$address"
,
alertCalled
.
getAddress
());
definitions
.
put
(
"$address"
,
alertCalled
.
getAddress
());
definitions
.
put
(
"$recDate"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getRecDate
(),
DateUtils
.
DATE_TIME_PATTERN
));
definitions
.
put
(
"$recDate"
,
DateUtils
.
convertDateToString
(
alertCalled
.
getRecDate
(),
DateUtils
.
DATE_TIME_PATTERN
));
String
content
=
getTaskInformation
(
template
.
getContent
(),
definitions
);
String
content
=
getTaskInformation
(
template
.
getContent
(),
definitions
);
template
.
setContent
(
content
);
template
.
setContent
(
content
);
TemplateDto
templateDto
=
new
TemplateDto
();
TemplateDto
templateDto
=
new
TemplateDto
();
...
@@ -870,11 +1217,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -870,11 +1217,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
AlertCallePowerTransferRo
calledRo
=
(
AlertCallePowerTransferRo
)
object
;
AlertCallePowerTransferRo
calledRo
=
(
AlertCallePowerTransferRo
)
object
;
String
alertSubmittedId
=
calledRo
.
getAlertSubmittedId
();
String
alertSubmittedId
=
calledRo
.
getAlertSubmittedId
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
alertCalledId
=
calledRo
.
getSequenceNbr
();
AlertCalled
alertCalled
=
alertCalledService
.
getAlertCalledById
(
Long
.
parseLong
(
alertSubmittedId
));
AlertCalled
alertCalled
=
alertCalledService
.
getAlertCalledById
(
Long
.
parseLong
(
alertSubmittedId
));
//响应级别
//响应级别
String
responseLevelString
=
""
;
String
responseLevelString
=
""
;
if
(
alertCalled
!=
null
&&
alertCalled
.
getResponseLevel
()!=
null
)
{
if
(
alertCalled
!=
null
&&
alertCalled
.
getResponseLevel
()!=
null
)
{
responseLevelString
=
alertCalled
.
getResponseLevel
();
responseLevelString
=
alertCalled
.
getResponseLevel
();
}
}
//先获取消救部领导、消救部值班人员信息
//先获取消救部领导、消救部值班人员信息
sendIds
.
stream
().
forEach
(
e
->
{
sendIds
.
stream
().
forEach
(
e
->
{
...
@@ -896,7 +1243,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -896,7 +1243,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
});
});
List
<
Object
>
companyDetail
=
JSONArray
.
parseArray
(
JSON
.
toJSON
(
calledRo
.
getCompany
()).
toString
(),
Object
.
class
);
List
<
Object
>
companyDetail
=
JSONArray
.
parseArray
(
JSON
.
toJSON
(
calledRo
.
getCompany
()).
toString
(),
Object
.
class
);
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
Long
companyId
=
powerDto
.
getCompanyId
();
Long
companyId
=
powerDto
.
getCompanyId
();
String
companyName
=
powerDto
.
getCompanyName
();
String
companyName
=
powerDto
.
getCompanyName
();
StringBuffer
resourcesNum
=
new
StringBuffer
();
StringBuffer
resourcesNum
=
new
StringBuffer
();
...
@@ -1001,7 +1348,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1001,7 +1348,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
};
};
userList
=
new
ArrayList
<
String
>();
userList
=
new
ArrayList
<
String
>();
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
"amosId"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
map
.
get
(
"amosId"
)))
{
userList
.
add
(
map
.
get
(
"amosId"
).
toString
());
userList
.
add
(
map
.
get
(
"amosId"
).
toString
());
}
}
alertSubmittedObjectSub
.
setUserPhone
(
map
.
get
(
"mobilePhone"
).
toString
());
alertSubmittedObjectSub
.
setUserPhone
(
map
.
get
(
"mobilePhone"
).
toString
());
}
}
...
@@ -1028,7 +1375,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1028,7 +1375,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
}
}
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
});
});
smsParams
.
put
(
"resourcesNum"
,
resourcesNumStr
.
substring
(
resourcesNumStr
.
length
()
-
2
));
smsParams
.
put
(
"resourcesNum"
,
resourcesNumStr
.
substring
(
resourcesNumStr
.
length
()
-
2
));
...
@@ -1045,7 +1392,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1045,7 +1392,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
//响应级别
besidesMap
.
put
(
"responseLevelString"
,
responseLevelString
);
//响应级别
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
...
@@ -1084,7 +1431,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1084,7 +1431,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
}
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
Set
<
Map
<
String
,
Object
>>
sendUserIds
=
new
HashSet
<
Map
<
String
,
Object
>>();
Set
<
Map
<
String
,
Object
>>
sendUserIds
=
new
HashSet
<
Map
<
String
,
Object
>>();
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
Long
companyId
=
powerDto
.
getCompanyId
();
Long
companyId
=
powerDto
.
getCompanyId
();
String
companyName
=
powerDto
.
getCompanyName
();
String
companyName
=
powerDto
.
getCompanyName
();
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
...
@@ -1140,7 +1487,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1140,7 +1487,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
}
}
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
});
});
smsParams
.
put
(
"resourcesNum"
,
companyName
);
smsParams
.
put
(
"resourcesNum"
,
companyName
);
...
@@ -1157,7 +1504,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1157,7 +1504,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
...
@@ -1204,7 +1551,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1204,7 +1551,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
//获取对应急救站的当日值班员信息
//获取对应急救站的当日值班员信息
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
for
(
Object
powerTransferCompanyDto
:
companyDetail
)
{
Set
<
Map
<
String
,
Object
>>
sendUserIds
=
new
HashSet
<
Map
<
String
,
Object
>>();
Set
<
Map
<
String
,
Object
>>
sendUserIds
=
new
HashSet
<
Map
<
String
,
Object
>>();
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
PowerTransferCompanyDto
powerDto
=
JSONObject
.
parseObject
(
JSON
.
toJSON
(
powerTransferCompanyDto
).
toString
(),
PowerTransferCompanyDto
.
class
);
Long
companyId
=
powerDto
.
getCompanyId
();
Long
companyId
=
powerDto
.
getCompanyId
();
String
companyName
=
powerDto
.
getCompanyName
();
String
companyName
=
powerDto
.
getCompanyName
();
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
//这个公司ID实际上是120急救站的id值
FireTeam
fireTeam
=
fireTeamServiceImpl
.
getById
(
companyId
);
//这个公司ID实际上是120急救站的id值
...
@@ -1259,7 +1606,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1259,7 +1606,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
mobiles
.
add
(
i
.
get
(
"mobilePhone"
).
toString
());
}
}
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
if
(
i
.
containsKey
(
"amosId"
)&&
!
ValidationUtil
.
isEmpty
(
i
.
get
(
"amosId"
)))
{
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
userList
.
add
(
i
.
get
(
"amosId"
).
toString
());
}
}
});
});
smsParams
.
put
(
"resourcesNum"
,
companyName
);
smsParams
.
put
(
"resourcesNum"
,
companyName
);
...
@@ -1276,14 +1623,14 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1276,14 +1623,14 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
besidesMap
=
new
HashMap
<
String
,
String
>();
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
besidesMap
.
put
(
"alterId"
,
alertCalledId
);
if
(
userList
.
size
()>
0
)
{
if
(
userList
.
size
()>
0
)
{
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
pushPowerTransferToAppAndWeb
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
(),
besidesMap
,
smsParams
,
userList
);
}
}
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
topic
,
alertCalledId
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
}
}
}
}
/**
/**
* app消息web 消息推送
* app消息web 消息推送
* @param
* @param
...
@@ -1291,72 +1638,72 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -1291,72 +1638,72 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
* @throws MqttException
* @throws MqttException
*/
*/
public
void
pushPowerTransferToAppAndWeb
(
String
type
,
Map
<
String
,
String
>
besidesMap
,
HashMap
<
String
,
String
>
smsParams
,
List
<
String
>
userList
){
public
void
pushPowerTransferToAppAndWeb
(
String
type
,
Map
<
String
,
String
>
besidesMap
,
HashMap
<
String
,
String
>
smsParams
,
List
<
String
>
userList
){
PushMessageWebAndAppRo
pushMessageWebAndAppRo
=
new
PushMessageWebAndAppRo
();
PushMessageWebAndAppRo
pushMessageWebAndAppRo
=
new
PushMessageWebAndAppRo
();
pushMessageWebAndAppRo
.
setRelationId
(
besidesMap
.
get
(
"alterId"
));
pushMessageWebAndAppRo
.
setRelationId
(
besidesMap
.
get
(
"alterId"
));
pushMessageWebAndAppRo
.
setRecivers
(
userList
);
pushMessageWebAndAppRo
.
setRecivers
(
userList
);
pushMessageWebAndAppRo
.
setCategory
(
RuleConstant
.
NOTIFY
);
pushMessageWebAndAppRo
.
setCategory
(
RuleConstant
.
NOTIFY
);
pushMessageWebAndAppRo
.
setIsSendApp
(
true
);
pushMessageWebAndAppRo
.
setIsSendApp
(
true
);
pushMessageWebAndAppRo
.
setIsSendWeb
(
true
);
pushMessageWebAndAppRo
.
setIsSendWeb
(
true
);
pushMessageWebAndAppRo
.
setRuleType
(
type
);
pushMessageWebAndAppRo
.
setRuleType
(
type
);
pushMessageWebAndAppRo
.
setMsgType
(
this
.
msgType
);
pushMessageWebAndAppRo
.
setMsgType
(
this
.
msgType
);
pushMessageWebAndAppRo
.
setTerminal
(
RuleConstant
.
APP_WEB
);
pushMessageWebAndAppRo
.
setTerminal
(
RuleConstant
.
APP_WEB
);
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"url"
,
"disasterPage"
);
map
.
put
(
"url"
,
"disasterPage"
);
map
.
put
(
"sequenceNbr"
,
besidesMap
.
get
(
"alterId"
));
map
.
put
(
"sequenceNbr"
,
besidesMap
.
get
(
"alterId"
));
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
警情结案
.
getCode
().
equals
(
type
))
{
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setStartTime
(
besidesMap
.
get
(
"startTime"
));
pushMessageWebAndAppRo
.
setStartTime
(
besidesMap
.
get
(
"startTime"
));
pushMessageWebAndAppRo
.
setEndTime
(
besidesMap
.
get
(
"endTime"
));
pushMessageWebAndAppRo
.
setEndTime
(
besidesMap
.
get
(
"endTime"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setRuleType
(
"endAlert"
);
pushMessageWebAndAppRo
.
setRuleType
(
"endAlert"
);
}
}
if
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
非警情确认
.
getCode
().
equals
(
type
))
{
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setSendTime
(
smsParams
.
get
(
"callTimeStr"
));
pushMessageWebAndAppRo
.
setSendTime
(
smsParams
.
get
(
"callTimeStr"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setRuleType
(
"notAlert"
);
pushMessageWebAndAppRo
.
setRuleType
(
"notAlert"
);
}
}
if
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
警情续报
.
getCode
().
equals
(
type
))
{
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setName
(
"消息"
);
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"alertType"
));
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"alertType"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setSendTime
(
besidesMap
.
get
(
"sendTime"
));
pushMessageWebAndAppRo
.
setSendTime
(
besidesMap
.
get
(
"sendTime"
));
pushMessageWebAndAppRo
.
setTransferLocation
(
smsParams
.
get
(
"replaceContent"
));
pushMessageWebAndAppRo
.
setTransferLocation
(
smsParams
.
get
(
"replaceContent"
));
pushMessageWebAndAppRo
.
setTrappedNum
(
smsParams
.
get
(
"trappedNum"
));
//被困人数
pushMessageWebAndAppRo
.
setTrappedNum
(
smsParams
.
get
(
"trappedNum"
));
//被困人数
pushMessageWebAndAppRo
.
setCasualtiesNum
(
smsParams
.
get
(
"casualtiesNum"
));
//伤亡人数
pushMessageWebAndAppRo
.
setCasualtiesNum
(
smsParams
.
get
(
"casualtiesNum"
));
//伤亡人数
pushMessageWebAndAppRo
.
setRuleType
(
"followReportAlert"
);
pushMessageWebAndAppRo
.
setRuleType
(
"followReportAlert"
);
}
}
if
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
力量调派
.
getCode
().
equals
(
type
))
{
map
.
put
(
"url"
,
"powerInformationPage"
);
map
.
put
(
"url"
,
"powerInformationPage"
);
pushMessageWebAndAppRo
.
setName
(
AlertBusinessTypeEnum
.
力量调派
.
getName
());
pushMessageWebAndAppRo
.
setName
(
AlertBusinessTypeEnum
.
力量调派
.
getName
());
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"resourcesNum"
));
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"resourcesNum"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setSendTime
(
smsParams
.
get
(
"callTimeStr"
));
pushMessageWebAndAppRo
.
setSendTime
(
smsParams
.
get
(
"callTimeStr"
));
if
(
StringUtils
.
isNotBlank
(
besidesMap
.
get
(
"transferLocation"
)))
{
if
(
StringUtils
.
isNotBlank
(
besidesMap
.
get
(
"transferLocation"
)))
{
pushMessageWebAndAppRo
.
setTransferLocation
(
besidesMap
.
get
(
"responseLevelString"
));
//响应级别
pushMessageWebAndAppRo
.
setTransferLocation
(
besidesMap
.
get
(
"responseLevelString"
));
//响应级别
pushMessageWebAndAppRo
.
setRuleType
(
"fullTime"
);
pushMessageWebAndAppRo
.
setRuleType
(
"fullTime"
);
}
else
{
}
else
{
pushMessageWebAndAppRo
.
setRuleType
(
"monitor"
);
pushMessageWebAndAppRo
.
setRuleType
(
"monitor"
);
}
}
}
}
if
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
().
equals
(
type
))
{
if
(
AlertBusinessTypeEnum
.
警情初报
.
getCode
().
equals
(
type
))
{
pushMessageWebAndAppRo
.
setRuleType
(
"reportAlert"
);
pushMessageWebAndAppRo
.
setRuleType
(
"reportAlert"
);
pushMessageWebAndAppRo
.
setName
(
AlertBusinessTypeEnum
.
警情初报
.
getName
());
pushMessageWebAndAppRo
.
setName
(
AlertBusinessTypeEnum
.
警情初报
.
getName
());
pushMessageWebAndAppRo
.
setSendTime
(
besidesMap
.
get
(
"sendTime"
));
pushMessageWebAndAppRo
.
setSendTime
(
besidesMap
.
get
(
"sendTime"
));
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"companyName"
));
//发送单位
pushMessageWebAndAppRo
.
setCompanyName
(
smsParams
.
get
(
"companyName"
));
//发送单位
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setAddress
(
smsParams
.
get
(
"address"
));
pushMessageWebAndAppRo
.
setFireSituation
(
smsParams
.
get
(
"fireSituation"
));
//火势情况
pushMessageWebAndAppRo
.
setFireSituation
(
smsParams
.
get
(
"fireSituation"
));
//火势情况
pushMessageWebAndAppRo
.
setTrappedNum
(
smsParams
.
get
(
"trappedNum"
));
//被困人数
pushMessageWebAndAppRo
.
setTrappedNum
(
smsParams
.
get
(
"trappedNum"
));
//被困人数
pushMessageWebAndAppRo
.
setCasualtiesNum
(
smsParams
.
get
(
"casualtiesNum"
));
//伤亡人数
pushMessageWebAndAppRo
.
setCasualtiesNum
(
smsParams
.
get
(
"casualtiesNum"
));
//伤亡人数
}
}
pushMessageWebAndAppRo
.
setExtras
(
map
);;
pushMessageWebAndAppRo
.
setExtras
(
map
);;
try
{
try
{
ruleTrigger
.
publish
(
pushMessageWebAndAppRo
,
"消息/addAlterMessageCheck"
,
new
String
[
0
]);
ruleTrigger
.
publish
(
pushMessageWebAndAppRo
,
"消息/addAlterMessageCheck"
,
new
String
[
0
]);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/VoiceRecordFileServiceImpl.java
View file @
a28664c7
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.FusionDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.FusionDto
;
...
@@ -24,6 +25,7 @@ import org.springframework.util.Assert;
...
@@ -24,6 +25,7 @@ import org.springframework.util.Assert;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.DataNotFound
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -77,28 +79,25 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
...
@@ -77,28 +79,25 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
}
@Override
public
VoiceRecordFileDto
saveRecord
(
final
VoiceRecordFileDto
model
)
{
public
void
publishRecord
(
final
VoiceRecordFileDto
model
)
{
Map
<
String
,
String
>
dMap
=
fusionService
.
getCallRecordByNumber
(
model
.
getCaller
(),
model
.
getCalled
());
Map
<
String
,
String
>
dMap
=
fusionService
.
getCallRecordByNumber
(
model
.
getCaller
(),
model
.
getCalled
());
// 保存到日志表中
// 保存到日志表中
VoiceRecordLog
log
=
new
VoiceRecordLog
();
VoiceRecordLog
log
=
new
VoiceRecordLog
();
VoiceRecordFile
voiceRecordFile
=
new
VoiceRecordFile
();
BeanUtils
.
copyProperties
(
model
,
voiceRecordFile
);
log
.
setAlertId
(
model
.
getAlertId
());
log
.
setAlertId
(
model
.
getAlertId
());
String
cid
=
dMap
.
get
(
"cid"
);
String
cid
=
dMap
.
get
(
"cid"
);
Assert
.
notNull
(
cid
,
"CID不能为空"
);
Assert
.
notNull
(
cid
,
"CID不能为空"
);
Map
<
String
,
String
>
callRecord
=
fusionService
.
getCallRecordByCID
(
cid
);
Map
<
String
,
String
>
callRecord
=
fusionService
.
getCallRecordByCID
(
cid
);
voiceRecordFile
.
setConnectId
(
cid
);
model
.
setConnectId
(
cid
);
log
.
setConnectId
(
cid
);
log
.
setConnectId
(
cid
);
log
.
setIsDeal
(
false
);
log
.
setIsDeal
(
false
);
log
.
setDealTimes
(
0
);
log
.
setDealTimes
(
0
);
if
(!
ValidationUtil
.
isEmpty
(
callRecord
)){
if
(!
ValidationUtil
.
isEmpty
(
callRecord
))
{
voiceRecordFile
.
setFilePath
(
String
.
format
(
"/%s/%s"
,
callRecord
.
get
(
"subPath"
),
callRecord
.
get
(
"recordName"
).
replace
(
"wav"
,
"mp3"
)));
model
.
setFilePath
(
String
.
format
(
"/%s/%s"
,
callRecord
.
get
(
"subPath"
),
callRecord
.
get
(
"recordName"
).
replace
(
"wav"
,
"mp3"
)));
logger
.
info
(
String
.
format
(
"音频地址:【%s】"
,
String
.
format
(
"/%s/%s"
,
callRecord
.
get
(
"subPath"
),
callRecord
.
get
(
"recordName"
))));
logger
.
info
(
String
.
format
(
"音频地址:【%s】"
,
String
.
format
(
"/%s/%s"
,
callRecord
.
get
(
"subPath"
),
callRecord
.
get
(
"recordName"
))));
}
else
{
// 无录音地址记录日志
}
else
{
// 无录音地址记录日志
iVoiceRecordLogServiceImpl
.
save
(
log
);
iVoiceRecordLogServiceImpl
.
save
(
log
);
}
}
save
(
voiceRecordFile
);
return
this
.
createWithModel
(
model
);
}
}
@Override
@Override
...
@@ -118,9 +117,7 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
...
@@ -118,9 +117,7 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
@Override
@Override
public
VoiceRecordFileDto
getRecordById
(
Long
sequenceNbr
)
{
public
VoiceRecordFileDto
getRecordById
(
Long
sequenceNbr
)
{
VoiceRecordFileDto
record
=
baseMapper
.
getRecordById
(
sequenceNbr
);
VoiceRecordFileDto
record
=
baseMapper
.
getRecordById
(
sequenceNbr
);
Map
<
String
,
String
>
callRecord
=
fusionService
.
getCallRecordByCID
(
record
.
getConnectId
());
return
buildFilePath
(
record
);
record
.
setFilePath
(
String
.
format
(
"/%s/%s"
,
callRecord
.
get
(
"subPath"
),
callRecord
.
get
(
"recordName"
)));
return
record
;
}
}
@Override
@Override
...
@@ -169,6 +166,31 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
...
@@ -169,6 +166,31 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
return
fusionDtos
;
return
fusionDtos
;
}
}
@Override
public
List
<
VoiceRecordFileDto
>
listByAlertId
(
Long
alertId
)
{
LambdaQueryWrapper
<
VoiceRecordFile
>
queryWrapper
=
new
LambdaQueryWrapper
<
VoiceRecordFile
>();
queryWrapper
.
eq
(
VoiceRecordFile:
:
getAlertId
,
alertId
).
orderByDesc
(
VoiceRecordFile:
:
getRecDate
);
List
<
VoiceRecordFile
>
list
=
voiceRecordFileServiceImpl
.
list
(
queryWrapper
);
List
<
VoiceRecordFileDto
>
dtoList
=
new
ArrayList
<>();
list
.
stream
().
forEach
(
voiceRecord
->
{
// 创建新的对象实例
VoiceRecordFileDto
target
=
new
VoiceRecordFileDto
();
// 把原对象数据拷贝到新对象
BeanUtils
.
copyProperties
(
voiceRecord
,
target
);
buildFilePath
(
target
);
dtoList
.
add
(
target
);
});
return
dtoList
;
}
public
VoiceRecordFileDto
updateRecord
(
VoiceRecordFileDto
model
)
{
VoiceRecordFileDto
oldModel
=
this
.
queryBySeq
(
model
.
getSequenceNbr
());
if
(
ValidationUtil
.
isEmpty
(
oldModel
))
throw
new
DataNotFound
(
"找不到指定的数据."
);
oldModel
.
setAlertId
(
model
.
getAlertId
());
return
this
.
updateWithModel
(
oldModel
);
}
/**
/**
* 获取在线用户的employeeID集合
* 获取在线用户的employeeID集合
*
*
...
@@ -176,7 +198,7 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
...
@@ -176,7 +198,7 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
*/
*/
private
List
<
String
>
getAllOnlineUser
(
Boolean
hasFusion
)
{
private
List
<
String
>
getAllOnlineUser
(
Boolean
hasFusion
)
{
List
<
String
>
employeeIDs
=
new
ArrayList
<>();
List
<
String
>
employeeIDs
=
new
ArrayList
<>();
if
(
hasFusion
){
if
(
hasFusion
)
{
JSONObject
jsonObject
=
fusionService
.
getAllOnlineUser
();
JSONObject
jsonObject
=
fusionService
.
getAllOnlineUser
();
if
(!
ValidationUtil
.
isEmpty
(
jsonObject
))
{
if
(!
ValidationUtil
.
isEmpty
(
jsonObject
))
{
JSONArray
onlines
=
jsonObject
.
getJSONArray
(
"Onlines"
);
JSONArray
onlines
=
jsonObject
.
getJSONArray
(
"Onlines"
);
...
@@ -189,12 +211,12 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
...
@@ -189,12 +211,12 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
return
employeeIDs
;
return
employeeIDs
;
}
}
private
FusionDto
buildFusionDtoAndId
(
FusionDto
fusionDto
,
List
<
String
>
employeeIDs
,
Boolean
hasFusion
,
Map
map
){
private
FusionDto
buildFusionDtoAndId
(
FusionDto
fusionDto
,
List
<
String
>
employeeIDs
,
Boolean
hasFusion
,
Map
map
)
{
List
carPropertyList
=
(
List
)
map
.
get
(
"carPropertyList"
);
List
carPropertyList
=
(
List
)
map
.
get
(
"carPropertyList"
);
carPropertyList
.
forEach
(
carProperty
->
{
carPropertyList
.
forEach
(
carProperty
->
{
Map
carPropertyMap
=
(
Map
)
carProperty
;
Map
carPropertyMap
=
(
Map
)
carProperty
;
Object
nameKey
=
carPropertyMap
.
get
(
"nameKey"
);
Object
nameKey
=
carPropertyMap
.
get
(
"nameKey"
);
if
(
hasFusion
&&
PropertyEnum
.
GIS
.
getValue
().
equals
(
nameKey
)){
if
(
hasFusion
&&
PropertyEnum
.
GIS
.
getValue
().
equals
(
nameKey
))
{
fusionDto
.
setId
(
String
.
valueOf
(
carPropertyMap
.
get
(
"value"
)));
fusionDto
.
setId
(
String
.
valueOf
(
carPropertyMap
.
get
(
"value"
)));
}
else
if
(!
hasFusion
&&
PropertyEnum
.
VIDEO
.
getValue
().
equals
(
nameKey
))
{
}
else
if
(!
hasFusion
&&
PropertyEnum
.
VIDEO
.
getValue
().
equals
(
nameKey
))
{
fusionDto
.
setId
(
String
.
valueOf
(
carPropertyMap
.
get
(
"value"
)));
fusionDto
.
setId
(
String
.
valueOf
(
carPropertyMap
.
get
(
"value"
)));
...
@@ -213,4 +235,10 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
...
@@ -213,4 +235,10 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
}
}
return
fusionDto
;
return
fusionDto
;
}
}
private
VoiceRecordFileDto
buildFilePath
(
VoiceRecordFileDto
record
)
{
Map
<
String
,
String
>
callRecord
=
fusionService
.
getCallRecordByCID
(
record
.
getConnectId
());
record
.
setFilePath
(
String
.
format
(
"/%s/%s"
,
callRecord
.
get
(
"subPath"
),
callRecord
.
get
(
"recordName"
)));
return
record
;
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/controller/CheckReportController.java
View file @
a28664c7
...
@@ -95,7 +95,7 @@ public class CheckReportController extends BaseController {
...
@@ -95,7 +95,7 @@ public class CheckReportController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取检查报告文档"
,
notes
=
"获取检查报告文档"
)
@ApiOperation
(
value
=
"获取检查报告文档"
,
notes
=
"获取检查报告文档"
)
@GetMapping
(
value
=
"/docx/{id}"
)
@GetMapping
(
value
=
"/docx/{id}"
)
public
ResponseModel
getCheckReportDocx
(
HttpServletResponse
response
,
@PathVariable
(
name
=
"id"
)
String
reportId
)
throws
Exception
{
public
void
getCheckReportDocx
(
HttpServletResponse
response
,
@PathVariable
(
name
=
"id"
)
String
reportId
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iCheckReportService
.
getCheckReportDocx
(
response
,
reportId
)
);
iCheckReportService
.
getCheckReportDocx
(
response
,
reportId
);
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/CheckReportServiceImpl.java
View file @
a28664c7
...
@@ -231,8 +231,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
...
@@ -231,8 +231,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
// 复查已整改隐患
// 复查已整改隐患
List
<
CheckReportDangerDto
>
reviewReformedList
=
result
.
get
(
"reviewReformedList"
);
List
<
CheckReportDangerDto
>
reviewReformedList
=
result
.
get
(
"reviewReformedList"
);
Set
<
String
>
reviewDangerIdSet
=
Sets
.
newHashSet
();
Set
<
String
>
reviewDangerIdSet
=
Sets
.
newHashSet
();
reviewDangerIdSet
.
addAll
(
Lists
.
transform
(
reviewDangerList
,
CheckReportDangerDto:
:
get
Danger
Id
));
reviewDangerIdSet
.
addAll
(
Lists
.
transform
(
reviewDangerList
,
CheckReportDangerDto:
:
getId
));
reviewDangerIdSet
.
addAll
(
Lists
.
transform
(
reviewReformedList
,
CheckReportDangerDto:
:
get
Danger
Id
));
reviewDangerIdSet
.
addAll
(
Lists
.
transform
(
reviewReformedList
,
CheckReportDangerDto:
:
getId
));
// 保存本次复查隐患id
// 保存本次复查隐患id
checkReport
.
setReviewDangerIds
(
Joiner
.
on
(
","
).
join
(
reviewDangerIdSet
));
checkReport
.
setReviewDangerIds
(
Joiner
.
on
(
","
).
join
(
reviewDangerIdSet
));
// List<CheckReportDangerDto> reviewReformingList = result.get("reviewReformingList");
// List<CheckReportDangerDto> reviewReformingList = result.get("reviewReformingList");
...
@@ -290,7 +290,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
...
@@ -290,7 +290,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
}
}
@Override
@Override
public
Object
getCheckReportDocx
(
HttpServletResponse
response
,
String
reportId
)
throws
ParseException
,
UnsupportedEncodingException
{
public
void
getCheckReportDocx
(
HttpServletResponse
response
,
String
reportId
)
throws
ParseException
,
UnsupportedEncodingException
{
CheckReportDto
report
=
this
.
getDetailById
(
reportId
);
CheckReportDto
report
=
this
.
getDetailById
(
reportId
);
report
.
setReportDate
(
getCheckReportDateStr
(
report
));
report
.
setReportDate
(
getCheckReportDateStr
(
report
));
report
.
setNowDate
(
DateUtils
.
dateFormat
(
new
Date
(),
DateUtils
.
CHN_DATE_PATTERN
));
report
.
setNowDate
(
DateUtils
.
dateFormat
(
new
Date
(),
DateUtils
.
CHN_DATE_PATTERN
));
...
@@ -305,7 +306,7 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
...
@@ -305,7 +306,7 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
configureBuilder
.
setElMode
(
ELMode
.
SPEL_MODE
).
bind
(
"checkDangerList"
,
checkDangerTablePolicy
).
bind
(
"reviewDangerList"
,
reviewDangerTablePolicy
).
build
();
configureBuilder
.
setElMode
(
ELMode
.
SPEL_MODE
).
bind
(
"checkDangerList"
,
checkDangerTablePolicy
).
bind
(
"reviewDangerList"
,
reviewDangerTablePolicy
).
build
();
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
checkReportTemplatePath
,
configureBuilder
.
build
()).
render
(
report
);
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
checkReportTemplatePath
,
configureBuilder
.
build
()).
render
(
report
);
response
.
setContentType
(
"application/msword"
);
response
.
setContentType
(
"application/msword"
);
response
.
setHeader
(
"Content-
d
isposition"
,
response
.
setHeader
(
"Content-
D
isposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"utf-8"
));
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"utf-8"
));
OutputStream
out
=
null
;
OutputStream
out
=
null
;
BufferedOutputStream
bos
=
null
;
BufferedOutputStream
bos
=
null
;
...
@@ -328,7 +329,6 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
...
@@ -328,7 +329,6 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
}
}
}
}
}
}
return
null
;
}
}
private
String
getCheckReportDateStr
(
CheckReportDto
checkReportDto
)
throws
ParseException
{
private
String
getCheckReportDateStr
(
CheckReportDto
checkReportDto
)
throws
ParseException
{
...
@@ -394,23 +394,24 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
...
@@ -394,23 +394,24 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
report
.
getCompanyName
(),
report
.
getDangerName
(),
report
.
getDangerStateName
(),
report
.
getCompanyId
());
report
.
getCompanyName
(),
report
.
getDangerName
(),
report
.
getDangerStateName
(),
report
.
getCompanyId
());
checkDangerList
.
add
(
rowRenderData
);
checkDangerList
.
add
(
rowRenderData
);
}));
}));
generateTableData
(
table
,
checkDangerList
);
// companyId字段在RowRenderData中下标(0开始,companyName:1,dangerName:2,dangerStateName:3,companyId:4)
generateTableData
(
table
,
checkDangerList
,
4
);
}
}
}
}
public
static
void
generateTableData
(
XWPFTable
table
,
List
<
RowRenderData
>
dangerList
)
{
public
static
void
generateTableData
(
XWPFTable
table
,
List
<
RowRenderData
>
dangerList
,
int
bizIndex
)
{
if
(!
ValidationUtil
.
isEmpty
(
dangerList
))
{
if
(!
ValidationUtil
.
isEmpty
(
dangerList
))
{
// 表格渲染和列表数据下标相反,需要翻转一下列表
// 表格渲染和列表数据下标相反,需要翻转一下列表
List
<
RowRenderData
>
reverseList
=
Lists
.
reverse
(
dangerList
);
List
<
RowRenderData
>
reverseList
=
Lists
.
reverse
(
dangerList
);
table
.
removeRow
(
dangerListDataStartRow
);
table
.
removeRow
(
dangerListDataStartRow
);
int
lastRow
=
dangerListDataStartRow
;
int
lastRow
=
dangerListDataStartRow
;
String
sameCompanyId
=
String
sameCompanyId
=
dangerList
.
get
(
0
).
getCellDatas
().
get
(
4
).
getRenderData
().
getText
();
dangerList
.
get
(
0
).
getCellDatas
().
get
(
bizIndex
).
getRenderData
().
getText
();
List
<
Map
<
String
,
Integer
>>
mergeRowMapList
=
Lists
.
newArrayList
();
List
<
Map
<
String
,
Integer
>>
mergeRowMapList
=
Lists
.
newArrayList
();
// 循环插入行
// 循环插入行
int
listLength
=
dangerList
.
size
();
int
listLength
=
dangerList
.
size
();
for
(
int
i
=
0
;
i
<
listLength
;
i
++)
{
for
(
int
i
=
0
;
i
<
listLength
;
i
++)
{
String
companyId
=
dangerList
.
get
(
i
).
getCellDatas
().
get
(
4
).
getRenderData
().
getText
();
String
companyId
=
dangerList
.
get
(
i
).
getCellDatas
().
get
(
bizIndex
).
getRenderData
().
getText
();
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
getRenderData
().
setText
(
String
.
valueOf
(
listLength
-
i
));
reverseList
.
get
(
i
).
getCellDatas
().
get
(
0
).
getRenderData
().
setText
(
String
.
valueOf
(
listLength
-
i
));
reverseList
.
get
(
i
).
getCellDatas
().
forEach
(
cellRenderData
->
{
reverseList
.
get
(
i
).
getCellDatas
().
forEach
(
cellRenderData
->
{
Style
style
=
new
Style
();
Style
style
=
new
Style
();
...
@@ -419,10 +420,12 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
...
@@ -419,10 +420,12 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
cellRenderData
.
getRenderData
().
setStyle
(
style
);
cellRenderData
.
getRenderData
().
setStyle
(
style
);
});
});
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRow
);
XWPFTableRow
insertNewTableRow
=
table
.
insertNewTableRow
(
dangerListDataStartRow
);
IntStream
.
range
(
0
,
4
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
// 生成表格字段个数 (不包含companyId字段)
int
cellLength
=
reverseList
.
get
(
i
).
getCellDatas
().
size
()
-
1
;
IntStream
.
range
(
0
,
cellLength
).
forEach
(
j
->
insertNewTableRow
.
createCell
());
if
(!
sameCompanyId
.
equals
(
companyId
))
{
if
(!
sameCompanyId
.
equals
(
companyId
))
{
sameCompanyId
=
dangerList
.
get
(
i
).
getCellDatas
().
get
(
4
).
getRenderData
().
getText
();
sameCompanyId
=
dangerList
.
get
(
i
).
getCellDatas
().
get
(
bizIndex
).
getRenderData
().
getText
();
Map
<
String
,
Integer
>
mergeRowMap
=
Maps
.
newHashMap
();
Map
<
String
,
Integer
>
mergeRowMap
=
Maps
.
newHashMap
();
mergeRowMap
.
put
(
"fromRow"
,
lastRow
);
mergeRowMap
.
put
(
"fromRow"
,
lastRow
);
mergeRowMap
.
put
(
"toRow"
,
i
+
dangerListDataStartRow
-
1
);
mergeRowMap
.
put
(
"toRow"
,
i
+
dangerListDataStartRow
-
1
);
...
@@ -464,7 +467,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
...
@@ -464,7 +467,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
report
.
getRemark
(),
report
.
getCompanyId
());
report
.
getRemark
(),
report
.
getCompanyId
());
reviewDangerList
.
add
(
rowRenderData
);
reviewDangerList
.
add
(
rowRenderData
);
}));
}));
generateTableData
(
table
,
reviewDangerList
);
// companyId字段在RowRenderData中下标(0开始,companyName:1,dangerName:2,dangerStateName:3,remark:4,companyId:5)
generateTableData
(
table
,
reviewDangerList
,
5
);
}
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/intfc/ICheckReportService.java
View file @
a28664c7
...
@@ -38,5 +38,5 @@ public interface ICheckReportService {
...
@@ -38,5 +38,5 @@ public interface ICheckReportService {
* @param reportId
* @param reportId
* @return
* @return
*/
*/
Object
getCheckReportDocx
(
HttpServletResponse
response
,
String
reportId
)
throws
Exception
;
void
getCheckReportDocx
(
HttpServletResponse
response
,
String
reportId
)
throws
Exception
;
}
}
amos-boot-system-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
View file @
a28664c7
...
@@ -2298,5 +2298,17 @@
...
@@ -2298,5 +2298,17 @@
</sql>
</sql>
</changeSet> -->
</changeSet> -->
<changeSet
author=
"litw"
id=
"2021-11-29-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"jc_alert_called"
columnName=
"record_url"
/>
</not>
</preConditions>
<comment>
update data jc_alert_called
</comment>
<sql>
ALTER TABLE jc_alert_called ADD record_url varchar(200) null COMMENT '处置记录URL';
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
amos-boot-system-jcs/src/main/resources/templates/check-report-template.docx
0 → 100644
View file @
a28664c7
File added
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
a28664c7
...
@@ -627,6 +627,7 @@
...
@@ -627,6 +627,7 @@
LEFT JOIN p_input_item pii ON pii.id = ppii.input_item_id
LEFT JOIN p_input_item pii ON pii.id = ppii.input_item_id
WHERE prp.point_id = #{pointId}
WHERE prp.point_id = #{pointId}
AND prp.route_id =#{routeId}
AND prp.route_id =#{routeId}
AND NOT FIND_IN_SET(prpi.point_input_item_id,prp.exclude_items)
ORDER BY
ORDER BY
prpi.order_no
prpi.order_no
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/pointMapper.xml
View file @
a28664c7
...
@@ -71,8 +71,10 @@
...
@@ -71,8 +71,10 @@
p_point_inputitem pi
p_point_inputitem pi
LEFT JOIN p_input_item ii ON ii.id = pi.input_item_id
LEFT JOIN p_input_item ii ON ii.id = pi.input_item_id
LEFT JOIN p_point_classify pc ON FIND_IN_SET(pc.id, pi.classify_ids) > 0
LEFT JOIN p_point_classify pc ON FIND_IN_SET(pc.id, pi.classify_ids) > 0
LEFT JOIN p_route_point prp ON prp.point_id = pi.point_id
WHERE
WHERE
pi.point_id = #{pointId}
pi.point_id = #{pointId}
AND NOT FIND_IN_SET(pi.id,prp.exclude_items)
ORDER BY
ORDER BY
pi.order_no
pi.order_no
</select>
</select>
...
@@ -1088,27 +1090,21 @@
...
@@ -1088,27 +1090,21 @@
<select
id=
"queryItemList4RoutePoint"
parameterType=
"long"
resultType=
"map"
>
<select
id=
"queryItemList4RoutePoint"
parameterType=
"long"
resultType=
"map"
>
SELECT
SELECT
p
ii.id itemId
p
pi.id itemId,
, pii.name
pii.name,
, pii.picture_json photo
pii.picture_json photo,
, pii.basis_json basis
pii.basis_json basis,
, pii.check_method method
pii.check_method method,
, pii.item_type type
pii.item_type type,
, pii.level
pii.level,
, pii.risk_desc
pii.risk_desc,
,
pii.input_classify
pii.input_classify
FROM
FROM
p_input_item pii
p_point_inputitem ppi
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
WHERE
WHERE
pii.id IN (
ppi.point_id = #{pointId}
SELECT
AND ppi.classify_ids = #{classifyId}
DISTINCT ppi.input_item_id
FROM
p_point_inputitem ppi
WHERE
ppi.point_id = #{pointId}
AND ppi.classify_ids = #{classifyId}
)
</select>
</select>
<select
id=
"getPointRefItem"
parameterType=
"list"
resultType=
"map"
>
<select
id=
"getPointRefItem"
parameterType=
"list"
resultType=
"map"
>
...
...
amos-boot-utils/amos-boot-utils-speech/pom.xml
0 → 100644
View file @
a28664c7
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<artifactId>
amos-boot-utils
</artifactId>
<groupId>
com.amosframework.boot
</groupId>
<version>
1.0.0
</version>
</parent>
<artifactId>
amos-boot-utils-speech
</artifactId>
<dependencies>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-core
</artifactId>
<version>
${amos-biz-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.73
</version>
</dependency>
<dependency>
<groupId>
com.aliyun
</groupId>
<artifactId>
aliyun-java-sdk-core
</artifactId>
<version>
3.7.1
</version>
</dependency>
<dependency>
<groupId>
com.alibaba.nls
</groupId>
<artifactId>
nls-sdk-transcriber
</artifactId>
<version>
2.2.1
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/SpeechApplication.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
SpeechApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SpeechApplication
.
class
,
args
);
}
}
\ No newline at end of file
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/AppNslClient.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
speech
;
import
com.alibaba.nls.client.AccessToken
;
import
com.alibaba.nls.client.protocol.NlsClient
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
/**
* 阿里云nlsClient语音识别客户端
* 应用全局创建一个NlsClient实例,默认服务地址为阿里云线上服务地址,默认值:wss://nls-gateway.cn-shanghai.aliyuncs.com/ws/v1
*/
public
class
AppNslClient
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AppNslClientToken
.
class
);
private
volatile
static
NlsClient
nlsClient
;
private
AppNslClient
()
{
}
public
static
NlsClient
instance
()
{
if
(
nlsClient
==
null
)
{
synchronized
(
NlsClient
.
class
)
{
if
(
nlsClient
==
null
)
{
logger
.
warn
(
"AppNslClient语音识别客户端为空,开始创建..."
);
nlsClient
=
new
NlsClient
(
AppNslClientToken
.
instance
().
getToken
());
return
nlsClient
;
}
}
}
//设置访问token
nlsClient
.
setToken
(
AppNslClientToken
.
instance
().
getToken
());
return
nlsClient
;
}
}
/**
* AppNslClientToken
*/
class
AppNslClientToken
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AppNslClientToken
.
class
);
private
volatile
static
AccessToken
accessToken
;
private
static
long
getTokenTime
;
private
AppNslClientToken
()
{
}
public
static
AccessToken
instance
()
{
if
(
accessToken
==
null
)
{
synchronized
(
NlsClient
.
class
)
{
if
(
accessToken
==
null
)
{
logger
.
warn
(
"token为空,开始获取token..."
);
accessToken
=
getAccessToken
();
getTokenTime
=
System
.
currentTimeMillis
();
}
}
}
//token过期自更新
if
(
getTokenTime
+
accessToken
.
getExpireTime
()
<=
System
.
currentTimeMillis
())
{
logger
.
warn
(
"token已过期,开始重新获取..."
);
accessToken
=
getAccessToken
();
getTokenTime
=
System
.
currentTimeMillis
();
}
else
{
long
time
=
getTokenTime
+
accessToken
.
getExpireTime
()
-
System
.
currentTimeMillis
();
logger
.
warn
(
"token过期还剩:"
+
"("
+
time
/
(
1000
*
60
*
60
*
24
)
+
"天)"
);
}
return
accessToken
;
}
/**
* 获取访问Token,包含token和过期时间(2021-11-30测试Token过期时间为18天)
* 集成项目中,token放到缓存中,避免多次获取可能导致已进行的任务token失效
*
* @return token 访问token
*/
private
static
AccessToken
getAccessToken
()
{
AccessToken
accessToken
=
new
AccessToken
(
SpeechConfig
.
AccessKeId
,
SpeechConfig
.
AccessKeySecret
);
try
{
accessToken
.
apply
();
logger
.
warn
(
"获取到最新的token: "
+
accessToken
.
getToken
()
+
", 过期时间: "
+
accessToken
.
getExpireTime
()
+
"("
+
accessToken
.
getExpireTime
()
/
(
1000
*
60
*
60
*
24
)
+
"天)"
);
return
accessToken
;
}
catch
(
IOException
e
)
{
logger
.
error
(
"获取语音识别客户端token失败!原因:"
+
e
.
getMessage
());
throw
new
RuntimeException
(
"获取语音识别客户端token失败!原因:"
+
e
.
getMessage
());
}
}
}
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/AppOkHttpClient.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
speech
;
import
okhttp3.*
;
import
java.io.File
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
* okHttp客户端
*/
public
class
AppOkHttpClient
{
static
OkHttpClient
client
=
new
OkHttpClient
.
Builder
()
.
connectTimeout
(
20
,
TimeUnit
.
SECONDS
)
.
readTimeout
(
120
,
TimeUnit
.
SECONDS
)
.
writeTimeout
(
120
,
TimeUnit
.
SECONDS
)
.
build
();
/**
* okHttp post提交文件请求
*
* @param url 请求地址
* @param headers 请求头
* @param speechFile 待识别文件
* @param callback 识别回调函数
*/
public
static
void
sendPostFile
(
String
url
,
HashMap
<
String
,
String
>
headers
,
File
speechFile
,
Callback
callback
)
{
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/octet-stream"
),
speechFile
);
Headers
.
Builder
hb
=
new
Headers
.
Builder
();
if
(
headers
!=
null
&&
!
headers
.
isEmpty
())
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
headers
.
entrySet
())
{
hb
.
add
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
Request
request
=
new
Request
.
Builder
()
.
url
(
url
)
.
headers
(
hb
.
build
())
.
post
(
body
)
.
build
();
client
.
newCall
(
request
).
enqueue
(
callback
);
}
}
\ No newline at end of file
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/SpeechConfig.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
speech
;
/**
* 阿里云语音识别
* <p>
* 试用版
* <p>
* 自2020年03月01日起,免费试用版规则调整为如下内容:
* 试用版不计费,如有变化,请关注官网通知。
* 一句话识别、实时语音识别、语音合成每自然日内支持2个并发调用,每自然日用量不限,免费试用期限为三个月。
* 录音文件识别每自然日识别时长不超过2小时,免费试用期限为三个月。
* 长文本语音合成和录音文件识别极速版均不支持试用版,如需使用请开通商用版本。
* <p>
* 商用版
* <p>
* 2019年06月10日零时后自动调整为如上新规计费方式。
* 对于录音文件识别,若您需要超过2个小时或更长的接口使用时长,请开通商用版。
* 开通商用版默认为后付费方式。购买预付费资源包后,自动变更为预付费方式,并优先使用资源包内资源进行抵扣,当预付费资源包内资源使用完后,会再次变更为后付费方式。
* 商用版按每自然日使用量计费,无免费额度,不使用则不产生费用。北京时间每日24时,系统将自动对当日用量进行全量计算并计费,账单生成将稍有延迟。
* 开通商用版后,不建议再次降配为试用版。商用版降配试用版后,可用并发数将置为0,服务将无法继续使用。
*/
public
class
SpeechConfig
{
/**
* 测试信息,可在阿里云上配置
*/
public
static
final
String
AccessKeId
=
"LTAI5t7mGN6dYoCwMdKiLTgt"
;
public
static
final
String
AccessKeySecret
=
"0LYdEnvKzQxBg0lpIahDp5rzB2r4Dp"
;
public
static
final
String
AppKey
=
"EG5fJBBIqkNMj6bM"
;
}
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/SpeechFlashRecognizer.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
speech
;
import
okhttp3.Callback
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.File
;
import
java.util.HashMap
;
/**
* 不支持免费用户测试
* 录音文件识别极速版(支持提交音频文件识别,文件大小,文件时长有限制)
* <p>
* 音频格式:支持AAC/MP3/OPUS/WAV格式编码的音频。
* 使用限制:支持100 MB以内且不超过2小时的音频文件的识别。
*
* @see SpeechRecognizer
* 时长超过2小时的文件请使用录音文件识别普通版
*
* <p>
* 模型类型:8000(电话)/16000(非电话)。
* <p>
* 同步返回识别结果
*/
public
class
SpeechFlashRecognizer
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SpeechFlashRecognizer
.
class
);
//音频文件
private
final
File
speechFile
;
//音频格式
private
final
String
format
;
//音频采样率
private
final
int
sampleRate
;
//识别回调函数
private
final
Callback
callback
;
public
SpeechFlashRecognizer
(
File
speechFile
,
int
sampleRate
,
Callback
callback
)
{
if
(
speechFile
==
null
||
!
speechFile
.
exists
()
||
!
speechFile
.
isFile
())
{
throw
new
IllegalArgumentException
(
"待识别的文件存在异常"
);
}
if
(
sampleRate
==
0
)
{
throw
new
IllegalArgumentException
(
"音频采样率不能为0"
);
}
String
[]
split
=
speechFile
.
getName
().
split
(
"\\."
);
if
(
split
.
length
!=
0
)
{
this
.
format
=
split
[
split
.
length
-
1
];
}
else
{
throw
new
IllegalArgumentException
(
"音频文件格式提取失败"
);
}
this
.
speechFile
=
speechFile
;
this
.
sampleRate
=
sampleRate
;
this
.
callback
=
callback
;
}
/**
* 设置HTTPS REST POST请求
* 1.使用http协议
* 2.语音识别服务域名:nls-gateway.cn-shanghai.aliyuncs.com
* 3.语音识别接口请求路径:/stream/v1/FlashRecognizer
* 4.设置必须请求参数:appkey、token、format、sample_rate
* 5.Content-Type 类型必须为 application/octet-stream
*/
public
void
process
()
{
String
request
=
"https://nls-gateway.cn-shanghai.aliyuncs.com/stream/v1/FlashRecognizer"
;
request
=
request
+
"?appkey="
+
SpeechConfig
.
AppKey
;
request
=
request
+
"&token="
+
AppNslClientToken
.
instance
().
getToken
();
request
=
request
+
"&format="
+
format
;
request
=
request
+
"&sample_rate="
+
sampleRate
;
logger
.
info
(
"Request: "
+
request
);
HashMap
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"Content-Type"
,
"application/octet-stream"
);
AppOkHttpClient
.
sendPostFile
(
request
,
headers
,
this
.
speechFile
,
this
.
callback
);
}
}
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/SpeechRecognizer.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
speech
;
import
com.alibaba.fastjson.JSONObject
;
import
com.aliyuncs.CommonRequest
;
import
com.aliyuncs.CommonResponse
;
import
com.aliyuncs.DefaultAcsClient
;
import
com.aliyuncs.IAcsClient
;
import
com.aliyuncs.exceptions.ClientException
;
import
com.aliyuncs.http.MethodType
;
import
com.aliyuncs.profile.DefaultProfile
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.concurrent.TimeUnit
;
/**
* 不支持提交文件
* 录音文件识别普通版(提供外网访问的音频文件地址)
* <p>
* 识别的文件需要提交基于HTTP可访问的URL地址,可以通过URL访问,不支持提交本地文件
* 上传的录音文件URL的访问权限需要设置为公开,URL中只能使用域名不能使用IP地址、不可包含空格
*
* @see SpeechFlashRecognizer
* (内网考虑使用录音文件识别极速版,极速版可以提交文件识别,但极速版不提供试用)
* <p>
* 支持单轨/双轨的.wav、.mp3、.m4a、.wma、.aac、.ogg、.amr、.flac格式录音文件识别
* 文件大小需控制在512 MB以下
* 免费用户每日可识别不超过2小时时长的录音文件
* 提交录音文件识别请求后,免费用户的识别任务在24小时内完成并返回识别文本; 付费用户的识别任务在6小时内完成并返回识别文本。识别结果在服务端可保存72小时
*/
@Deprecated
public
class
SpeechRecognizer
{
// 地域ID,常量,固定值。
public
static
final
String
REGIONID
=
"cn-shanghai"
;
public
static
final
String
ENDPOINTNAME
=
"cn-shanghai"
;
public
static
final
String
PRODUCT
=
"nls-filetrans"
;
public
static
final
String
DOMAIN
=
"filetrans.cn-shanghai.aliyuncs.com"
;
public
static
final
String
API_VERSION
=
"2018-08-17"
;
public
static
final
String
POST_REQUEST_ACTION
=
"SubmitTask"
;
public
static
final
String
GET_REQUEST_ACTION
=
"GetTaskResult"
;
// 请求参数
public
static
final
String
KEY_APP_KEY
=
"appkey"
;
public
static
final
String
KEY_FILE_LINK
=
"file_link"
;
public
static
final
String
KEY_VERSION
=
"version"
;
public
static
final
String
KEY_ENABLE_WORDS
=
"enable_words"
;
// 响应参数
public
static
final
String
KEY_TASK
=
"Task"
;
public
static
final
String
KEY_TASK_ID
=
"TaskId"
;
public
static
final
String
KEY_STATUS_TEXT
=
"StatusText"
;
public
static
final
String
KEY_RESULT
=
"Result"
;
// 状态值
public
static
final
String
STATUS_SUCCESS
=
"SUCCESS"
;
private
static
final
String
STATUS_RUNNING
=
"RUNNING"
;
private
static
final
String
STATUS_QUEUEING
=
"QUEUEING"
;
// 阿里云鉴权client
IAcsClient
client
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SpeechRecognizer
.
class
);
public
SpeechRecognizer
()
{
// 设置endpoint
try
{
DefaultProfile
.
addEndpoint
(
ENDPOINTNAME
,
REGIONID
,
PRODUCT
,
DOMAIN
);
}
catch
(
ClientException
e
)
{
e
.
printStackTrace
();
}
// 创建DefaultAcsClient实例并初始化
DefaultProfile
profile
=
DefaultProfile
.
getProfile
(
REGIONID
,
SpeechConfig
.
AccessKeId
,
SpeechConfig
.
AccessKeySecret
);
this
.
client
=
new
DefaultAcsClient
(
profile
);
}
/**
* 提交录音文件地址
*/
public
String
submitFileTransRequest
(
String
fileLink
)
{
/**
* 1. 创建CommonRequest,设置请求参数。
*/
CommonRequest
postRequest
=
new
CommonRequest
();
// 设置域名
postRequest
.
setDomain
(
DOMAIN
);
// 设置API的版本号,格式为YYYY-MM-DD。
postRequest
.
setVersion
(
API_VERSION
);
// 设置action
postRequest
.
setAction
(
POST_REQUEST_ACTION
);
// 设置产品名称
postRequest
.
setProduct
(
PRODUCT
);
/**
* 2. 设置录音文件识别请求参数,以JSON字符串的格式设置到请求Body中。
*/
JSONObject
taskObject
=
new
JSONObject
();
// 设置appkey
taskObject
.
put
(
KEY_APP_KEY
,
SpeechConfig
.
AppKey
);
// 设置音频文件访问链接
taskObject
.
put
(
KEY_FILE_LINK
,
fileLink
);
// 新接入请使用4.0版本,已接入(默认2.0)如需维持现状,请注释掉该参数设置。
taskObject
.
put
(
KEY_VERSION
,
"4.0"
);
// 设置是否输出词信息,默认为false,开启时需要设置version为4.0及以上。
taskObject
.
put
(
KEY_ENABLE_WORDS
,
true
);
String
task
=
taskObject
.
toJSONString
();
logger
.
info
(
task
);
// 设置以上JSON字符串为Body参数。
postRequest
.
putBodyParameter
(
KEY_TASK
,
task
);
// 设置为POST方式的请求。
postRequest
.
setMethod
(
MethodType
.
POST
);
/**
* 3. 提交录音文件识别请求,获取录音文件识别请求任务的ID,以供识别结果查询使用。
*/
String
taskId
=
null
;
try
{
CommonResponse
postResponse
=
client
.
getCommonResponse
(
postRequest
);
logger
.
warn
(
"提交录音文件识别请求的响应:"
+
postResponse
.
getData
());
if
(
postResponse
.
getHttpStatus
()
==
200
)
{
JSONObject
result
=
JSONObject
.
parseObject
(
postResponse
.
getData
());
String
statusText
=
result
.
getString
(
KEY_STATUS_TEXT
);
if
(
STATUS_SUCCESS
.
equals
(
statusText
))
{
taskId
=
result
.
getString
(
KEY_TASK_ID
);
}
}
}
catch
(
ClientException
e
)
{
e
.
printStackTrace
();
}
return
taskId
;
}
/**
* 根据任务ID轮询识别结果
*/
public
String
getFileTransResult
(
String
taskId
)
{
/**
* 1. 创建CommonRequest,设置任务ID。
*/
CommonRequest
getRequest
=
new
CommonRequest
();
// 设置域名
getRequest
.
setDomain
(
DOMAIN
);
// 设置API版本
getRequest
.
setVersion
(
API_VERSION
);
// 设置action
getRequest
.
setAction
(
GET_REQUEST_ACTION
);
// 设置产品名称
getRequest
.
setProduct
(
PRODUCT
);
// 设置任务ID为查询参数
getRequest
.
putQueryParameter
(
KEY_TASK_ID
,
taskId
);
// 设置为GET方式的请求
getRequest
.
setMethod
(
MethodType
.
GET
);
/**
* 2. 提交录音文件识别结果查询请求
* 以轮询的方式进行识别结果的查询,直到服务端返回的状态描述为“SUCCESS”或错误描述,则结束轮询。
*/
String
result
=
null
;
while
(
true
)
{
try
{
CommonResponse
getResponse
=
client
.
getCommonResponse
(
getRequest
);
logger
.
warn
(
"识别查询结果:"
+
getResponse
.
getData
());
if
(
getResponse
.
getHttpStatus
()
!=
200
)
{
break
;
}
JSONObject
rootObj
=
JSONObject
.
parseObject
(
getResponse
.
getData
());
String
statusText
=
rootObj
.
getString
(
KEY_STATUS_TEXT
);
if
(
STATUS_RUNNING
.
equals
(
statusText
)
||
STATUS_QUEUEING
.
equals
(
statusText
))
{
// 继续轮询,注意设置轮询时间间隔。
TimeUnit
.
SECONDS
.
sleep
(
3
);
}
else
{
// 状态信息为成功,返回识别结果;状态信息为异常,返回空。
if
(
STATUS_SUCCESS
.
equals
(
statusText
))
{
result
=
rootObj
.
getString
(
KEY_RESULT
);
// 状态信息为成功,但没有识别结果,则可能是由于文件里全是静音、噪音等导致识别为空。
if
(
result
==
null
)
{
result
=
""
;
}
}
break
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
result
;
}
}
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/SpeechTranscriber.java
0 → 100644
View file @
a28664c7
package
com
.
yeejoin
.
amos
.
speech
;
import
com.alibaba.nls.client.protocol.InputFormatEnum
;
import
com.alibaba.nls.client.protocol.SampleRateEnum
;
import
com.alibaba.nls.client.protocol.asr.SpeechTranscriberListener
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.util.concurrent.TimeUnit
;
/**
* 实时语音识别
* <p>
* 支持的输入格式:PCM(无压缩的PCM或WAV文件)、16 bit采样位数、单声道(mono)。
* 支持的音频采样率:8000 Hz和16000 Hz。
*/
public
class
SpeechTranscriber
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SpeechTranscriber
.
class
);
//语音识别文件
private
final
File
speechFile
;
//识别回调函数
private
final
SpeechTranscriberListener
listener
;
public
SpeechTranscriber
(
File
speechFile
,
SpeechTranscriberListener
listener
)
{
if
(
speechFile
!=
null
&&
speechFile
.
exists
()
&&
speechFile
.
isFile
())
{
this
.
speechFile
=
speechFile
;
this
.
listener
=
listener
;
}
else
{
throw
new
IllegalArgumentException
(
"待识别的文件存在异常"
);
}
}
/**
* 开始语音识别
*/
public
void
process
()
{
com
.
alibaba
.
nls
.
client
.
protocol
.
asr
.
SpeechTranscriber
transcriber
=
null
;
try
{
//创建实例、建立连接。
transcriber
=
new
com
.
alibaba
.
nls
.
client
.
protocol
.
asr
.
SpeechTranscriber
(
AppNslClient
.
instance
(),
listener
);
transcriber
.
setAppKey
(
SpeechConfig
.
AppKey
);
//输入音频编码方式。
transcriber
.
setFormat
(
InputFormatEnum
.
PCM
);
//输入音频采样率。
transcriber
.
setSampleRate
(
SampleRateEnum
.
SAMPLE_RATE_16K
);
//是否返回中间识别结果。
transcriber
.
setEnableIntermediateResult
(
true
);
//是否生成并返回标点符号。
transcriber
.
setEnablePunctuation
(
true
);
//是否将返回结果规整化,比如将一百返回为100。
transcriber
.
setEnableITN
(
false
);
//设置vad断句参数。默认值:800ms,有效值:200ms~2000ms。
//transcriber.addCustomedParam("max_sentence_silence", 600);
//设置是否语义断句。
//transcriber.addCustomedParam("enable_semantic_sentence_detection",false);
//设置是否开启顺滑。
//transcriber.addCustomedParam("disfluency",true);
//设置是否开启词模式。
//transcriber.addCustomedParam("enable_words",true);
//设置vad噪音阈值参数,参数取值为-1~+1,如-0.9、-0.8、0.2、0.9。
//取值越趋于-1,判定为语音的概率越大,亦即有可能更多噪声被当成语音被误识别。
//取值越趋于+1,判定为噪音的越多,亦即有可能更多语音段被当成噪音被拒绝识别。
//该参数属高级参数,调整需慎重和重点测试。
//transcriber.addCustomedParam("speech_noise_threshold",0.3);
//设置训练后的定制语言模型id。
//transcriber.addCustomedParam("customization_id","你的定制语言模型id");
//设置训练后的定制热词id。
//transcriber.addCustomedParam("vocabulary_id","你的定制热词id");
//设置是否忽略单句超时。
transcriber
.
addCustomedParam
(
"enable_ignore_sentence_timeout"
,
false
);
//vad断句开启后处理。
//transcriber.addCustomedParam("enable_vad_unify_post",false);
//此方法将以上参数设置序列化为JSON发送给服务端,并等待服务端确认。
transcriber
.
start
();
FileInputStream
fis
=
new
FileInputStream
(
speechFile
);
byte
[]
b
=
new
byte
[
3200
];
int
len
;
while
((
len
=
fis
.
read
(
b
))
>
0
)
{
logger
.
info
(
"send data pack length: "
+
len
);
transcriber
.
send
(
b
,
len
);
//本案例用读取本地文件的形式模拟实时获取语音流并发送的,因为读取速度较快,这里需要设置sleep,如果实时获取语音则无需设置sleep
TimeUnit
.
MILLISECONDS
.
sleep
(
1000
);
}
//通知服务端语音数据发送完毕,等待服务端处理完成。
long
now
=
System
.
currentTimeMillis
();
logger
.
info
(
"ASR wait for complete"
);
transcriber
.
stop
();
logger
.
info
(
"ASR latency : "
+
(
System
.
currentTimeMillis
()
-
now
)
+
" ms"
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
}
finally
{
if
(
null
!=
transcriber
)
{
transcriber
.
close
();
}
}
}
}
amos-boot-utils/amos-boot-utils-speech/src/main/resources/application.properties
0 → 100644
View file @
a28664c7
amos-boot-utils/amos-boot-utils-speech/src/test/java/com/yejoin/amos/SpeechApplicationTests.java
0 → 100644
View file @
a28664c7
package
com
.
yejoin
.
amos
;
import
com.alibaba.nls.client.protocol.asr.SpeechTranscriberListener
;
import
com.alibaba.nls.client.protocol.asr.SpeechTranscriberResponse
;
import
com.yeejoin.amos.speech.SpeechFlashRecognizer
;
import
com.yeejoin.amos.speech.SpeechRecognizer
;
import
com.yeejoin.amos.speech.SpeechTranscriber
;
import
okhttp3.Call
;
import
okhttp3.Callback
;
import
okhttp3.Response
;
import
org.junit.jupiter.api.Test
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.File
;
import
java.io.IOException
;
public
class
SpeechApplicationTests
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SpeechApplicationTests
.
class
);
/**
* 实时语音识别使用示例(提交文件流,免费可测试)
*/
@Test
void
testSpeechTranscriber
()
{
//本案例使用本地文件模拟发送实时流数据。您在实际使用时,可以实时采集或接收语音流并发送到ASR服务端。
String
fileLink
=
"https://gw.alipayobjects.com/os/bmw-prod/0574ee2e-f494-45a5-820f-63aee583045a.wav"
;
//将上面fileLink文件下载到本地后,替换filepath为本地地址测试
String
filepath
=
"D:\\ffmpeg-4.4-full_build-shared\\bin\\out.pcm"
;
SpeechTranscriber
transcriber
=
new
SpeechTranscriber
(
new
File
(
filepath
),
new
SpeechTranscriberListener
()
{
/**
* 语音识别过程中返回的结果。仅当setEnableIntermediateResult为true时,才会返回该消息。
*/
@Override
public
void
onTranscriptionResultChange
(
SpeechTranscriberResponse
response
)
{
logger
.
warn
(
"语音识别过程中返回的结果"
);
logger
.
warn
(
"task_id: "
+
response
.
getTaskId
()
+
", name: "
+
response
.
getName
()
+
//状态码“20000000”表示正常识别。
", status: "
+
response
.
getStatus
()
+
//句子编号,从1开始递增。
", index: "
+
response
.
getTransSentenceIndex
()
+
//当前的识别结果。
", result: "
+
response
.
getTransSentenceText
()
+
//当前已处理的音频时长,单位为毫秒。
", time: "
+
response
.
getTransSentenceTime
());
}
/**
* 服务端准备好了进行识别
*/
@Override
public
void
onTranscriberStart
(
SpeechTranscriberResponse
response
)
{
logger
.
warn
(
"服务端准备好了进行识别"
);
logger
.
warn
(
"task_id: "
+
response
.
getTaskId
()
+
", name: "
+
response
.
getName
()
+
", status: "
+
response
.
getStatus
());
}
/**
* 服务端检测到了一句话的开始
*/
@Override
public
void
onSentenceBegin
(
SpeechTranscriberResponse
response
)
{
logger
.
warn
(
"服务端检测到了一句话的开始"
);
logger
.
warn
(
"task_id: "
+
response
.
getTaskId
()
+
", name: "
+
response
.
getName
()
+
", status: "
+
response
.
getStatus
());
}
/**
* 服务端检测到了一句话的结束
* 识别出一句话。服务端会智能断句,当识别到一句话结束时会返回此消息。
*/
@Override
public
void
onSentenceEnd
(
SpeechTranscriberResponse
response
)
{
logger
.
warn
(
"服务端检测到了一句话的结束"
);
logger
.
warn
(
"task_id: "
+
response
.
getTaskId
()
+
", name: "
+
response
.
getName
()
+
//状态码“20000000”表示正常识别。
", status: "
+
response
.
getStatus
()
+
//句子编号,从1开始递增。
", index: "
+
response
.
getTransSentenceIndex
()
+
//当前的识别结果。
", result: "
+
response
.
getTransSentenceText
()
+
//置信度
", confidence: "
+
response
.
getConfidence
()
+
//开始时间
", begin_time: "
+
response
.
getSentenceBeginTime
()
+
//当前已处理的音频时长,单位为毫秒。
", time: "
+
response
.
getTransSentenceTime
());
}
/**
* 识别结束后返回的最终结果
*/
@Override
public
void
onTranscriptionComplete
(
SpeechTranscriberResponse
response
)
{
logger
.
warn
(
"识别结束后返回的最终结果"
);
logger
.
warn
(
"task_id: "
+
response
.
getTaskId
()
+
", name: "
+
response
.
getName
()
+
", status: "
+
response
.
getStatus
()
+
",result:"
+
response
.
getTransSentenceText
());
}
/**
* 失败处理
*/
@Override
public
void
onFail
(
SpeechTranscriberResponse
response
)
{
logger
.
error
(
"失败处理"
);
logger
.
error
(
"task_id: "
+
response
.
getTaskId
()
+
", status: "
+
response
.
getStatus
()
+
", status_text: "
+
response
.
getStatusText
());
}
});
transcriber
.
process
();
}
/**
* 语音文件识别极速版使用示例(提交文件,收费无法测试)
*/
@Test
void
testSpeechFlashRecognizer
()
{
//String fileName = SpeechRecognizerRestfulDemo.class.getClassLoader().getResource("./nls-sample-16k.wav").getPath();
// 重要:此处用一个本地文件来模拟发送实时流数据,实际使用时,您可以从某处实时采集或接收语音流并发送到ASR服务端。
String
fileName
=
"D:\\ffmpeg-4.4-full_build-shared\\bin\\test.mp3"
;
String
format
=
"mp3"
;
int
sampleRate
=
16000
;
SpeechFlashRecognizer
speechFlashRecognizer
=
new
SpeechFlashRecognizer
(
new
File
(
fileName
),
sampleRate
,
new
Callback
()
{
@Override
public
void
onFailure
(
Call
call
,
IOException
e
)
{
logger
.
error
(
"语音识别失败,原因:"
+
e
.
getMessage
());
}
@Override
public
void
onResponse
(
Call
call
,
Response
response
)
throws
IOException
{
assert
response
.
body
()
!=
null
;
logger
.
warn
(
"语音识别结果:"
+
response
.
body
().
string
());
}
});
speechFlashRecognizer
.
process
();
}
/**
* 语音文件识别普通版使用示例(提交文件地址,免费可测试)
*/
@Test
void
testSpeechRecognizer
()
{
String
fileLink
=
"https://gw.alipayobjects.com/os/bmw-prod/0574ee2e-f494-45a5-820f-63aee583045a.wav"
;
SpeechRecognizer
speechRecognizer
=
new
SpeechRecognizer
();
// 第一步:提交录音文件识别请求,获取任务ID用于后续的识别结果轮询。
String
taskId
=
speechRecognizer
.
submitFileTransRequest
(
fileLink
);
if
(
taskId
!=
null
)
{
logger
.
info
(
"录音文件识别请求成功,task_id: "
+
taskId
);
}
else
{
logger
.
error
(
"录音文件识别请求失败!"
);
return
;
}
// 第二步:根据任务ID轮询识别结果。
String
result
=
speechRecognizer
.
getFileTransResult
(
taskId
);
if
(
result
!=
null
)
{
logger
.
info
(
"录音文件识别结果查询成功:"
+
result
);
}
else
{
logger
.
error
(
"录音文件识别结果查询失败!"
);
}
}
}
amos-boot-utils/pom.xml
View file @
a28664c7
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<modelVersion>
4.0.0
</modelVersion>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
amos-biz-boot
</artifactId>
<parent>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-biz-boot
</artifactId>
<version>
1.0.0
</version>
<groupId>
com.amosframework.boot
</groupId>
</parent>
<version>
1.0.0
</version>
</parent>
<artifactId>
amos-boot-utils
</artifactId>
<artifactId>
amos-boot-utils
</artifactId>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<dependencies>
<dependencies>
</dependencies>
</dependencies>
<modules>
<modules>
<module>
amos-boot-utils-jpush
</module>
<module>
amos-boot-utils-jpush
</module>
<module>
amos-boot-utils-video
</module>
<module>
amos-boot-utils-video
</module>
</modules>
<module>
amos-boot-utils-speech
</module>
</modules>
</project>
</project>
\ No newline at end of file
pom.xml
View file @
a28664c7
...
@@ -283,6 +283,11 @@
...
@@ -283,6 +283,11 @@
<name>
Snapshots
</name>
<name>
Snapshots
</name>
<url>
http://172.16.1.6:8081/nexus/content/repositories/snapshots/
</url>
<url>
http://172.16.1.6:8081/nexus/content/repositories/snapshots/
</url>
</repository>
</repository>
<repository>
<id>
com.e-iceblue
</id>
<name>
e-iceblue
</name>
<url>
https://repo.e-iceblue.com/nexus/content/groups/public/
</url>
</repository>
</repositories>
</repositories>
<modules>
<modules>
...
...
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