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
36006126
Commit
36006126
authored
Jun 28, 2022
by
maoying
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_dl_plan6' of
http://39.98.45.134:8090/moa/amos-boot-biz
into develop_dl_plan6
parents
66588777
38bedb55
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
878 additions
and
108 deletions
+878
-108
amos-biz-boot.iml
amos-biz-boot.iml
+3
-3
FireStationInfoDto.java
...join/amos/boot/module/ccs/api/dto/FireStationInfoDto.java
+8
-0
FireEquipmentSignalLogMapper.java
...t/module/ccs/api/mapper/FireEquipmentSignalLogMapper.java
+7
-0
FireFightingSystemMapper.java
.../boot/module/ccs/api/mapper/FireFightingSystemMapper.java
+4
-0
FireStationInfoMapper.java
...mos/boot/module/ccs/api/mapper/FireStationInfoMapper.java
+52
-0
FireVehicleMapper.java
...in/amos/boot/module/ccs/api/mapper/FireVehicleMapper.java
+5
-0
MqttReceiveService.java
.../amos/boot/module/ccs/api/service/MqttReceiveService.java
+10
-2
AlarmCountVO.java
...com/yeejoin/amos/boot/module/ccs/api/vo/AlarmCountVO.java
+7
-3
AlarmEventLogVO.java
.../yeejoin/amos/boot/module/ccs/api/vo/AlarmEventLogVO.java
+48
-0
CarInfoVO.java
...va/com/yeejoin/amos/boot/module/ccs/api/vo/CarInfoVO.java
+17
-0
CarNumberVO.java
.../com/yeejoin/amos/boot/module/ccs/api/vo/CarNumberVO.java
+8
-0
DateAlarmCountVO.java
...yeejoin/amos/boot/module/ccs/api/vo/DateAlarmCountVO.java
+12
-0
QuestionVO.java
...a/com/yeejoin/amos/boot/module/ccs/api/vo/QuestionVO.java
+12
-0
RawDataVO.java
...va/com/yeejoin/amos/boot/module/ccs/api/vo/RawDataVO.java
+55
-0
ReceiveDataVO.java
...om/yeejoin/amos/boot/module/ccs/api/vo/ReceiveDataVO.java
+14
-0
FireEquipmentSignalLogMapper.xml
...rc/main/resources/mapper/FireEquipmentSignalLogMapper.xml
+10
-1
FireFightingSystemMapper.xml
...pi/src/main/resources/mapper/FireFightingSystemMapper.xml
+8
-0
FireStationInfoMapper.xml
...s-api/src/main/resources/mapper/FireStationInfoMapper.xml
+104
-0
FireVehicleMapper.xml
...e-ccs-api/src/main/resources/mapper/FireVehicleMapper.xml
+12
-0
EquipmentSpecificAlarm.java
...oin/equipmanage/common/entity/EquipmentSpecificAlarm.java
+3
-0
EquipmentSpecificAlarmLog.java
.../equipmanage/common/entity/EquipmentSpecificAlarmLog.java
+3
-0
EquipmentSpecificIndex.java
...oin/equipmanage/common/entity/EquipmentSpecificIndex.java
+3
-1
IotDataVO.java
...ain/java/com/yeejoin/equipmanage/common/vo/IotDataVO.java
+5
-0
pom.xml
...oot-module-api/amos-boot-module-knowledgebase-api/pom.xml
+2
-2
CcsMqttReceiveConfig.java
...amos/boot/module/ccs/biz/config/CcsMqttReceiveConfig.java
+12
-10
FireStationInfoController.java
.../module/ccs/biz/controller/FireStationInfoController.java
+78
-0
FireStationInfoServiceImpl.java
...dule/ccs/biz/service/impl/FireStationInfoServiceImpl.java
+143
-2
MqttReceiveServiceImpl.java
...t/module/ccs/biz/service/impl/MqttReceiveServiceImpl.java
+102
-40
ConfirmAlarmController.java
...eejoin/equipmanage/controller/ConfirmAlarmController.java
+22
-13
SourceSceneMapper.java
...ava/com/yeejoin/equipmanage/mapper/SourceSceneMapper.java
+1
-0
IConfirmAlarmService.java
...com/yeejoin/equipmanage/service/IConfirmAlarmService.java
+2
-0
ConfirmAlarmServiceImpl.java
...oin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
+20
-10
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+15
-5
pom.xml
...ule/amos-boot-module-biz/amos-boot-module-jcs-biz/pom.xml
+0
-7
pom.xml
amos-boot-module/pom.xml
+0
-1
application-dev.properties
...-system-ccs/src/main/resources/application-dev.properties
+3
-1
changelog-master.xml
...m-equip/src/main/resources/changelog/changelog-master.xml
+2
-0
wl-3.6.0.xml
...ot-system-equip/src/main/resources/changelog/wl-3.6.0.xml
+43
-0
SourceSceneMapper.xml
...tem-equip/src/main/resources/mapper/SourceSceneMapper.xml
+11
-0
pom.xml
pom.xml
+12
-7
No files found.
amos-biz-boot.iml
View file @
36006126
...
...
@@ -136,15 +136,15 @@
<orderEntry
type=
"library"
name=
"Maven: org.checkerframework:checker-qual:2.11.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.google.errorprone:error_prone_annotations:2.3.4"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.google.j2objc:j2objc-annotations:1.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.alibaba:fastjson:1.2.
67
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.yeejoin:amos-feign-privilege:1.7.
1
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.alibaba:fastjson:1.2.
83
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.yeejoin:amos-feign-privilege:1.7.
8
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.typroject:tyboot-core-foundation:1.1.21"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.belerweb:pinyin4j:2.5.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: commons-beanutils:commons-beanutils:1.9.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.esotericsoftware.reflectasm:reflectasm:1.09"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.github.axet:kaptcha:0.0.9"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.jhlabs:filters:2.0.235"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.yeejoin:amos-component-feign:1.7.
1
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.yeejoin:amos-component-feign:1.7.
8
"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.2.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.cloud:spring-cloud-openfeign-core:2.2.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: io.github.openfeign.form:feign-form-spring:3.8.0"
level=
"project"
/>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/dto/FireStationInfoDto.java
View file @
36006126
...
...
@@ -96,4 +96,12 @@ public class FireStationInfoDto extends BaseDto {
@ApiModelProperty
(
value
=
"关联站id"
)
private
String
stationContactId
;
@ApiModelProperty
(
"现存告警数量"
)
private
Integer
alarmNum
=
0
;
@ApiModelProperty
(
"已处理数量"
)
private
Integer
confirmTrueNum
=
0
;
@ApiModelProperty
(
"未处理数量"
)
private
Integer
confirmFalseNum
=
0
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/mapper/FireEquipmentSignalLogMapper.java
View file @
36006126
...
...
@@ -32,4 +32,11 @@ public interface FireEquipmentSignalLogMapper extends BaseMapper<FireEquipmentSi
* @return List<FireEquipmentDto>
*/
List
<
FireEquipmentDto
>
distinctByEquipmentId
(
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"alarmDate"
)
String
alarmDate
);
/**
* 根据系统
* @param mrid
* @return
*/
Integer
getAlarmCountByMrid
(
@Param
(
"mrid"
)
String
mrid
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/mapper/FireFightingSystemMapper.java
View file @
36006126
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.ccs.api.mapper;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireFightingSystem
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
* 消防系统信息 Mapper 接口
*
...
...
@@ -11,4 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
FireFightingSystemMapper
extends
BaseMapper
<
FireFightingSystem
>
{
List
<
FireFightingSystem
>
getMridByCode
(
String
stationCode
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/mapper/FireStationInfoMapper.java
View file @
36006126
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.ccs.api.mapper;
import
com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireStationInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.AlarmCountVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.DateAlarmCountVO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -32,4 +34,54 @@ public interface FireStationInfoMapper extends BaseMapper<FireStationInfo> {
List
<
Map
<
String
,
Object
>>
queryStationEquipInfo
(
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"stationName"
)
String
stationName
);
List
<
Map
<
String
,
Object
>>
lastYearAlarmCount
();
/**
* 换流站告警信息
*
* @param stationCode
* @return List<FireStationInfoDto>
*/
List
<
FireStationInfoDto
>
queryStationAlarmListByCode
(
@Param
(
"stationCode"
)
String
stationCode
);
/**
* 查询各个环流站的警情数量
*
* @return
*/
List
<
AlarmCountVO
>
queryAlarmCountByCode
();
/**
* 查询各个环流站的警情数量(包含历史和即时警情)
*
* @return
*/
List
<
AlarmCountVO
>
queryAllAlarmCountByCode
(
@Param
(
"beginDateTime"
)
String
beginDateTime
,
@Param
(
"endDateTime"
)
String
endDateTime
);
/**
* 根据code和时间查警情数量
*
* @return
*/
Integer
queryAlarmCountByDateAndCode
(
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"date"
)
String
date
);
/**
* 查询指定时间段的告警趋势
*
* @param stationCode
* @param beginDate
* @param endDate
* @return
*/
List
<
DateAlarmCountVO
>
getAlarmTrendByDatePeriod
(
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"beginDate"
)
String
beginDate
,
@Param
(
"endDate"
)
String
endDate
);
/**
* 查询指定时间段的告警趋势
*
* @param stationCode
* @param beginDateTime
* @param endDateTime
* @return
*/
List
<
DateAlarmCountVO
>
getAlarmNumByDateTimePeriodByStationCode
(
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"beginDateTime"
)
String
beginDateTime
,
@Param
(
"endDateTime"
)
String
endDateTime
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/mapper/FireVehicleMapper.java
View file @
36006126
...
...
@@ -2,6 +2,10 @@ package com.yeejoin.amos.boot.module.ccs.api.mapper;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireVehicle
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.CarInfoVO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 消防车辆信息 Mapper 接口
...
...
@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
FireVehicleMapper
extends
BaseMapper
<
FireVehicle
>
{
List
<
CarInfoVO
>
getCarInfoByStationCode
(
@Param
(
"stationCode"
)
String
stationCode
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/service/MqttReceiveService.java
View file @
36006126
...
...
@@ -5,9 +5,17 @@ package com.yeejoin.amos.boot.module.ccs.api.service;
public
interface
MqttReceiveService
{
/**
*
增量数据处理
*
处理警情消息
* @param topic 主题
* @param message 消息内容
*/
void
handlerMqttIncrementMessage
(
String
topic
,
String
message
);
void
handlerMqttAlarmMessage
(
String
topic
,
String
message
);
/**
* 处理问题下发消息
* @param topic 主题
* @param message 消息内容
*/
void
handlerMqttQuestionMessage
(
String
topic
,
String
message
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/
MqttData
VO.java
→
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/
AlarmCount
VO.java
View file @
36006126
...
...
@@ -11,9 +11,13 @@ import lombok.Data;
* @date 2021/1/7 17:44
*/
@Data
public
class
MqttData
VO
{
public
class
AlarmCount
VO
{
private
String
key
;
private
String
stationCode
;
private
Object
value
;
private
Integer
alarmNum
;
private
Integer
confirmTrueNum
;
private
Integer
confirmFalseNum
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/AlarmEventLogVO.java
0 → 100644
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
AlarmEventLogVO
implements
Serializable
{
private
String
id
;
private
String
valid
;
private
String
record
;
private
String
date
;
private
String
creator
;
private
String
creatorName
;
private
String
status
;
private
String
bizOrgName
;
private
String
bizOrgCode
;
private
String
orgCode
;
private
String
severityLevel
;
private
String
objcectType
;
private
String
objcectId
;
private
String
objcectCode
;
private
String
objcectName
;
private
String
objcectIndexName
;
private
String
objcectIndexKey
;
private
String
alarmTime
;
private
String
signalId
;
private
String
controlModelId
;
private
String
modelIndexId
;
private
String
deviationIndexId
;
private
String
questionNum
;
private
String
questionReportedTime
;
private
String
subject
;
private
String
content
;
private
String
questionReason
;
private
String
questionEffect
;
private
String
rectificationProposal
;
private
String
severityLevelLABEL
;
private
String
protectedObjectCode
;
private
String
protectedObjectName
;
private
String
buildingName
;
private
String
buildingCode
;
private
String
systemCode
;
private
String
systemName
;
private
String
objcectIndexValue
;
private
String
objcectIndexType
;
private
String
recoveryStatus
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/CarInfoVO.java
0 → 100644
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
CarInfoVO
implements
Serializable
{
private
Integer
total
;
private
String
carType
;
private
String
strCarNumber
;
private
List
<
CarNumberVO
>
carList
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/CarNumberVO.java
0 → 100644
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
api
.
vo
;
import
lombok.Data
;
@Data
public
class
CarNumberVO
{
private
String
carNum
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/DateAlarmCountVO.java
0 → 100644
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
DateAlarmCountVO
implements
Serializable
{
public
String
alarmNums
;
public
String
date
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/QuestionVO.java
0 → 100644
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
QuestionVO
implements
Serializable
{
private
List
<
AlarmEventLogVO
>
alarmEventLog
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/RawDataVO.java
0 → 100644
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
RawDataVO
implements
Serializable
{
private
String
id
;
private
String
valid
;
private
String
record
;
private
String
date
;
private
String
creator
;
private
String
creatorName
;
private
String
status
;
private
String
equipmentSpecificId
;
private
String
equipmentSpecificName
;
private
String
equipmentId
;
private
String
equipmentName
;
private
String
systemId
;
private
String
equipmentDetailCode
;
private
String
equipmentDetailId
;
private
String
typeName
;
private
String
equipmentIndexKey
;
private
String
equipmentIndexName
;
private
String
equipmentIndexId
;
private
String
indexValue
;
private
String
systemName
;
private
String
valueEnum
;
private
String
emergencyLevelColor
;
private
String
isAlarm
;
private
String
emergencyLevel
;
private
String
emergencyLevelDescribe
;
private
String
isTrend
;
private
String
typeCode
;
private
String
groupName
;
private
String
sortNum
;
private
String
unit
;
private
String
buildPosition
;
private
String
isIot
;
private
String
bizOrgName
;
private
String
bizOrgCode
;
private
String
orgCode
;
private
String
equipmentSpecificCode
;
private
String
categoryCode
;
private
String
categoryName
;
private
String
systemCode
;
private
String
detailPosition
;
private
String
buildId
;
private
String
buildCode
;
private
String
buildName
;
private
String
companyCode
;
private
String
equipmentSpecificIotCode
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/ReceiveDataVO.java
0 → 100644
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ReceiveDataVO
implements
Serializable
{
private
String
active
;
private
AlarmEventLogVO
alarmEventLog
;
private
RawDataVO
rawData
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/resources/mapper/FireEquipmentSignalLogMapper.xml
View file @
36006126
...
...
@@ -41,7 +41,7 @@
a.station_code = s.code
and s.status = false
<if
test=
"isAlarm != null"
>
and is_alarm = #{isAlarm}
and
a.
is_alarm = #{isAlarm}
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
and a.station_code = #{stationCode}
...
...
@@ -74,4 +74,13 @@
and ai.station_code =#{stationCode}
</if>
</select>
<select
id=
"getAlarmCountByMrid"
resultType=
"java.lang.Integer"
>
SELECT
IFNULL( sum( is_alarm ), 0 )
FROM
asf_fire_equipment_signal_log
WHERE
FIND_IN_SET(#{mrid,jdbcType=VARCHAR}, system_mrids)
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
36006126
...
...
@@ -2,4 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ccs.api.mapper.FireFightingSystemMapper"
>
<select
id=
"getMridByCode"
resultType=
"com.yeejoin.amos.boot.module.ccs.api.entity.FireFightingSystem"
>
SELECT *
FROM
ast_fire_fighting_system
where station_code = #{stationCode,jdbcType=VARCHAR}
GROUP BY
mrid
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/resources/mapper/FireStationInfoMapper.xml
View file @
36006126
...
...
@@ -56,4 +56,108 @@
FROM
`asf_fire_station_info` s
</select>
<select
id=
"queryStationAlarmListByCode"
resultType=
"com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto"
>
SELECT
i.*
FROM
`asf_fire_station_info` i
where i.status = false
<if
test=
"stationCode != null and stationCode != ''"
>
and i.code = #{stationCode,jdbcType=VARCHAR}
</if>
</select>
<select
id=
"queryAlarmCountByCode"
resultType=
"com.yeejoin.amos.boot.module.ccs.api.vo.AlarmCountVO"
>
SELECT
station_code,
sum( is_alarm ) as alarmNum,
sum( confirm_state ) as confirmTrueNum,
count(*) - sum( confirm_state ) as confirmfalseNum
FROM
asf_fire_equipment_signal_log
GROUP BY
station_code
</select>
<select
id=
"queryAllAlarmCountByCode"
resultType=
"com.yeejoin.amos.boot.module.ccs.api.vo.AlarmCountVO"
>
SELECT
station_code,
count(*) as alarmNum
FROM
asf_fire_equipment_signal_log
<where>
<if
test=
"beginDateTime != null and beginDateTime != '' and endDateTime != null and endDateTime != ''"
>
and confirm_date between #{beginDateTime} and #{endDateTime}
</if>
</where>
GROUP BY
station_code
</select>
<select
id=
"queryAlarmCountByDateAndCode"
resultType=
"java.lang.Integer"
>
select count(*) from asf_fire_equipment_signal_log
<where>
1 = 1
<if
test=
"stationCode != null and stationCode != ''"
>
and station_code = #{stationCode,jdbcType=VARCHAR}
</if>
<if
test=
"date != null and date != ''"
>
and confirm_date like concat(#{date,jdbcType=VARCHAR},'%')
</if>
</where>
</select>
<select
id=
"getAlarmTrendByDatePeriod"
resultType=
"com.yeejoin.amos.boot.module.ccs.api.vo.DateAlarmCountVO"
>
select
(SELECT
IFNULL(count(s.id),0)
FROM `asf_fire_equipment_signal_log` s
<where>
<if
test=
"stationCode != null and stationCode != ''"
>
and s.station_code = #{stationCode}
</if>
and s.confirm_date like concat(t.date,'%')
</where>
) as alarmNums,
date
from
(SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 0 ) temp
WHERE
@s
<![CDATA[<=]]>
DATEDIFF(#{endDate},#{beginDate})) t
GROUP BY t.date
</select>
<select
id=
"getAlarmNumByDateTimePeriodByStationCode"
resultType=
"com.yeejoin.amos.boot.module.ccs.api.vo.DateAlarmCountVO"
>
select
(SELECT
IFNULL(count(s.id),0)
FROM `asf_fire_equipment_signal_log` s
<where>
<if
test=
"stationCode != null and stationCode != ''"
>
and s.station_code = #{stationCode}
</if>
and s.confirm_date like concat(date ,'%')
</where>
) as alarmNums,
concat(date ,'时') as date
from
(SELECT
DATE_FORMAT( DATE_ADD( #{beginDateTime}, INTERVAL @s HOUR ),'%Y-%m-%d %H') AS date,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
@s
<![CDATA[<=]]>
hour(TIMEDIFF(#{endDateTime},#{beginDateTime}))) t
GROUP BY t.date
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/resources/mapper/FireVehicleMapper.xml
View file @
36006126
...
...
@@ -2,4 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ccs.api.mapper.FireVehicleMapper"
>
<select
id=
"getCarInfoByStationCode"
resultType=
"com.yeejoin.amos.boot.module.ccs.api.vo.CarInfoVO"
>
SELECT
count(*) as total,
`type` as carType,
group_concat( `number` ) AS strCarNumber
FROM
ast_fire_vehicle
WHERE
station_code = #{stationCode,jdbcType=VARCHAR}
GROUP BY
`type`
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentSpecificAlarm.java
View file @
36006126
...
...
@@ -108,6 +108,9 @@ public class EquipmentSpecificAlarm extends BaseEntity {
@TableField
(
"confirm_date"
)
private
Date
confirmDate
;
@ApiModelProperty
(
value
=
"iot数据上报唯一id"
)
private
String
traceId
;
@ApiModelProperty
(
value
=
"画布id"
)
@TableField
(
exist
=
false
)
private
Long
sceneId
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentSpecificAlarmLog.java
View file @
36006126
...
...
@@ -132,6 +132,9 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField
(
"status"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"iot数据上报唯一id"
)
private
String
traceId
;
@ApiModelProperty
(
value
=
"画布id"
)
@TableField
(
exist
=
false
)
private
Long
sceneId
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentSpecificIndex.java
View file @
36006126
...
...
@@ -75,6 +75,9 @@ public class EquipmentSpecificIndex extends BaseEntity {
*/
@TableField
(
value
=
"emergency_level_describe"
)
private
String
emergencyLevelDescribe
;
@ApiModelProperty
(
value
=
"iot数据上报唯一id"
)
private
String
traceId
;
@TableField
(
exist
=
false
)
private
String
nameKey
;
...
...
@@ -143,5 +146,4 @@ public class EquipmentSpecificIndex extends BaseEntity {
@TableField
(
exist
=
false
)
private
String
buildId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/IotDataVO.java
View file @
36006126
...
...
@@ -16,4 +16,9 @@ public class IotDataVO {
private
String
key
;
private
Object
value
;
/**
* iot数据上报唯一id
*/
private
String
traceId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-knowledgebase-api/pom.xml
View file @
36006126
...
...
@@ -23,8 +23,8 @@
</dependency>
<!-- 规则模块 -->
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-rule
</artifactId>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-rule
</artifactId>
</dependency>
<!-- 解析word -->
<dependency>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-ccs-biz/src/main/java/com/yeejoin/amos/boot/module/ccs/biz/config/CcsMqttReceiveConfig.java
View file @
36006126
...
...
@@ -47,8 +47,12 @@ public class CcsMqttReceiveConfig {
@Value
(
"${emqx.client-id}"
)
private
String
clientId
;
@Value
(
"${mqtt.topic}"
)
private
String
defaultTopic
;
@Value
(
"${mqtt.topic.alarm}"
)
private
String
alarmTopic
;
@Value
(
"${mqtt.topic.question}"
)
private
String
questionTopic
;
// @Value("${spring.mqtt.completionTimeout}")
// private int completionTimeout;
...
...
@@ -88,7 +92,7 @@ public class CcsMqttReceiveConfig {
//配置client,监听的topic
@Bean
public
MessageProducer
inbound
()
{
adapter
=
new
MqttPahoMessageDrivenChannelAdapter
(
clientId
,
mqttPahoClientFactory
(),
default
Topic
);
adapter
=
new
MqttPahoMessageDrivenChannelAdapter
(
clientId
,
mqttPahoClientFactory
(),
alarmTopic
,
question
Topic
);
// adapter.setCompletionTimeout(completionTimeout);
adapter
.
setConverter
(
new
DefaultPahoMessageConverter
());
adapter
.
setQos
(
0
);
...
...
@@ -103,13 +107,11 @@ public class CcsMqttReceiveConfig {
return
message
->
{
String
topic
=
message
.
getHeaders
().
get
(
"mqtt_receivedTopic"
).
toString
();
String
msg
=
message
.
getPayload
().
toString
();
// int endIndex = topic.lastIndexOf("/");
// if (endIndex > 0 && StringUtil.isNotEmpty(String.valueOf(message))) {
// String dataType = topic.substring(endIndex + 1);
// if (dataType.equals("property") && StringUtil.isNotEmpty(msg)) {
mqttReceiveService
.
handlerMqttIncrementMessage
(
topic
,
msg
);
// }
// }
if
(
alarmTopic
.
equals
(
topic
))
{
mqttReceiveService
.
handlerMqttAlarmMessage
(
topic
,
msg
);
}
else
if
(
questionTopic
.
equals
(
topic
))
{
mqttReceiveService
.
handlerMqttQuestionMessage
(
topic
,
msg
);
}
};
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-ccs-biz/src/main/java/com/yeejoin/amos/boot/module/ccs/biz/controller/FireStationInfoController.java
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
biz
.
controller
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.util.StrUtil
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto
;
import
com.yeejoin.amos.boot.module.ccs.api.enums.StationOrderByTypeEnum
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.CarInfoVO
;
import
com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireStationInfoServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -11,10 +14,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
/**
...
...
@@ -50,4 +55,77 @@ public class FireStationInfoController extends BaseController {
public
ResponseModel
getOne
(
@PathVariable
String
stationCode
)
{
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getOneByCode
(
stationCode
));
}
/**
* 日常动态左侧警情统计top10
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"日常动态左侧警情统计top10"
,
notes
=
"日常动态左侧警情统计top10"
)
@GetMapping
(
value
=
"/getStationSafetyListByCode"
)
public
ResponseModel
<
List
<
FireStationInfoDto
>>
stationSafetyList
(
@ApiParam
(
value
=
"换流站编码"
)
@RequestParam
(
required
=
false
)
String
stationCode
,
@ApiParam
(
value
=
"数量"
)
@RequestParam
(
required
=
false
)
Integer
top
)
{
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
queryStationAlarmListByCode
(
stationCode
,
top
));
}
/**
* 日常动态左侧警情统计top10
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"中间上部分告警数量统计"
,
notes
=
"中间上部分告警数量统计"
)
@GetMapping
(
value
=
"/getAlarmNumByDate"
)
public
ResponseModel
<
Map
<
String
,
Integer
>>
getAlarmNumByDate
(
@ApiParam
(
value
=
"换流站编码"
)
@RequestParam
(
required
=
false
)
String
stationCode
)
{
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getAlarmNumByDate
(
stationCode
));
}
/**
* 日常动态左侧警情统计top10
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"换流站24小时警情数量"
,
notes
=
"换流站24小时警情数量"
)
@GetMapping
(
value
=
"/getAlarmNumByDateTimePeriod"
)
public
ResponseModel
<
Map
<
String
,
List
<
String
>>>
getAlarmNumByDateTimePeriod
(
@ApiParam
(
value
=
"换流站编码"
)
@RequestParam
(
required
=
false
)
String
stationCode
,
@ApiParam
(
value
=
"开始时间,格式:"
+
DatePattern
.
NORM_DATETIME_PATTERN
,
required
=
true
)
@RequestParam
(
required
=
true
)
String
beginDateTime
,
@ApiParam
(
value
=
"结束时间,格式:"
+
DatePattern
.
NORM_DATETIME_PATTERN
,
required
=
true
)
@RequestParam
(
required
=
true
)
String
endDateTime
)
{
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getAlarmNumByDateTimePeriod
(
stationCode
,
beginDateTime
,
endDateTime
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询指定时间段的告警趋势"
,
notes
=
"查询指定时间段的告警趋势"
)
@GetMapping
(
value
=
"/getAlarmTrendByDatePeriod"
)
public
ResponseModel
getAlarmTrendByDatePeriod
(
@ApiParam
(
value
=
"开始日期,格式:"
+
DatePattern
.
NORM_DATE_PATTERN
,
required
=
true
)
@RequestParam
(
value
=
"beginDate"
)
String
beginDate
,
@ApiParam
(
value
=
"结束日期,格式:"
+
DatePattern
.
NORM_DATE_PATTERN
,
required
=
true
)
@RequestParam
(
value
=
"endDate"
)
String
endDate
,
@ApiParam
(
value
=
"换流站编号"
)
@RequestParam
(
required
=
false
)
String
stationCode
)
{
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getAlarmTrendByDatePeriod
(
stationCode
,
beginDate
,
endDate
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据换流站code统计消防车"
,
notes
=
"根据换流站code统计消防车"
)
@GetMapping
(
value
=
"/getCarInfoByStationCode"
)
public
ResponseModel
<
List
<
CarInfoVO
>>
getCarInfoByStationCode
(
@ApiParam
(
value
=
"换流站编号"
,
required
=
true
)
@RequestParam
(
required
=
true
)
String
stationCode
)
{
if
(
StrUtil
.
isEmpty
(
stationCode
))
{
throw
new
BadRequest
(
"换流站编号不能为空"
);
}
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getCarInfoByStationCode
(
stationCode
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据换流站code统计消防系统状态"
,
notes
=
"根据换流站code统计消防系统状态"
)
@GetMapping
(
value
=
"/getFireSystemByStationCode"
)
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
getFireSystemByStationCode
(
@ApiParam
(
value
=
"换流站编号"
,
required
=
true
)
@RequestParam
(
required
=
true
)
String
stationCode
)
{
if
(
StrUtil
.
isEmpty
(
stationCode
))
{
throw
new
BadRequest
(
"换流站编号不能为空"
);
}
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getFireSystemByStationCode
(
stationCode
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-ccs-biz/src/main/java/com/yeejoin/amos/boot/module/ccs/biz/service/impl/FireStationInfoServiceImpl.java
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
biz
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireFightingSystem
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireStationInfo
;
import
com.yeejoin.amos.boot.module.ccs.api.enums.StationOrderByTypeEnum
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentSignalLogMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireFightingSystemMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireStationInfoMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireVehicleMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.service.IFireStationInfoService
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.AlarmCountVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.CarInfoVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.CarNumberVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.DateAlarmCountVO
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.
List
;
import
java.util.
Optional
;
import
java.util.
*
;
import
java.util.
stream.Collectors
;
/**
* 站端信息表服务实现类
...
...
@@ -20,6 +36,16 @@ import java.util.Optional;
*/
@Service
public
class
FireStationInfoServiceImpl
extends
BaseService
<
FireStationInfoDto
,
FireStationInfo
,
FireStationInfoMapper
>
implements
IFireStationInfoService
{
@Autowired
private
FireVehicleMapper
fireVehicleMapper
;
@Autowired
private
FireFightingSystemMapper
fireFightingSystemMapper
;
@Autowired
private
FireEquipmentSignalLogMapper
fireEquipmentSignalLogMapper
;
/**
* 列表查询 示例
*
...
...
@@ -43,4 +69,118 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
}
return
dtos
.
iterator
().
next
();
}
public
List
<
FireStationInfoDto
>
queryStationAlarmListByCode
(
String
stationCode
,
Integer
top
)
{
List
<
FireStationInfoDto
>
fireStationInfoList
=
this
.
baseMapper
.
queryStationAlarmListByCode
(
stationCode
);
List
<
AlarmCountVO
>
alarmCountVOS
=
this
.
baseMapper
.
queryAlarmCountByCode
();
Map
<
String
,
AlarmCountVO
>
collect
=
alarmCountVOS
.
stream
().
collect
(
Collectors
.
toMap
(
AlarmCountVO:
:
getStationCode
,
t
->
t
));
fireStationInfoList
.
forEach
(
item
->
{
if
(
collect
.
containsKey
(
item
.
getCode
()))
{
item
.
setAlarmNum
(
collect
.
get
(
item
.
getCode
()).
getAlarmNum
());
item
.
setConfirmTrueNum
(
collect
.
get
(
item
.
getCode
()).
getConfirmTrueNum
());
item
.
setConfirmFalseNum
(
collect
.
get
(
item
.
getCode
()).
getConfirmFalseNum
());
}
});
List
<
FireStationInfoDto
>
finalVoList
=
new
ArrayList
<>();
if
(
null
==
top
)
{
finalVoList
=
fireStationInfoList
.
stream
().
skip
(
0
).
sorted
(
Comparator
.
comparing
(
FireStationInfoDto:
:
getAlarmNum
).
reversed
()).
collect
(
Collectors
.
toList
());
}
else
{
finalVoList
=
fireStationInfoList
.
stream
().
skip
(
0
).
limit
(
top
).
sorted
(
Comparator
.
comparing
(
FireStationInfoDto:
:
getAlarmNum
).
reversed
()).
collect
(
Collectors
.
toList
());
}
return
finalVoList
;
}
public
Map
<
String
,
Integer
>
getAlarmNumByDate
(
String
stationCode
)
{
Date
date
=
DateUtil
.
date
();
String
year
=
DateUtil
.
format
(
date
,
"YYYY"
);
String
currentMonth
=
DateUtil
.
format
(
date
,
DatePattern
.
NORM_MONTH_PATTERN
);
String
yesterday
=
DateUtil
.
format
(
DateUtil
.
offsetDay
(
date
,
-
1
),
DatePattern
.
NORM_DATE_PATTERN
);
Integer
todayNum
=
this
.
baseMapper
.
queryAlarmCountByDateAndCode
(
stationCode
,
DateUtil
.
now
());
Integer
currentYearNum
=
this
.
baseMapper
.
queryAlarmCountByDateAndCode
(
stationCode
,
year
);
Integer
currentMonthNum
=
this
.
baseMapper
.
queryAlarmCountByDateAndCode
(
stationCode
,
currentMonth
);
Integer
yesterdayNum
=
this
.
baseMapper
.
queryAlarmCountByDateAndCode
(
stationCode
,
yesterday
);
HashMap
<
String
,
Integer
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"todayNum"
,
todayNum
);
resultMap
.
put
(
"currentYearNum"
,
currentYearNum
);
resultMap
.
put
(
"currentMonthNum"
,
currentMonthNum
);
resultMap
.
put
(
"yesterdayNum"
,
yesterdayNum
);
return
resultMap
;
}
public
Map
<
String
,
List
<
String
>>
getAlarmNumByDateTimePeriod
(
String
stationCode
,
String
beginDateTime
,
String
endDateTime
)
{
HashMap
<
String
,
List
<
String
>>
resultMap
=
new
HashMap
<>();
if
(
StrUtil
.
isEmpty
(
beginDateTime
)
||
StrUtil
.
isEmpty
(
endDateTime
))
{
throw
new
BadRequest
(
"开始时间和结束时间不能为空"
);
}
if
(
StrUtil
.
isEmpty
(
stationCode
))
{
List
<
String
>
stationNameList
=
new
ArrayList
<>();
List
<
String
>
alarmNumList
=
new
ArrayList
<>();
List
<
FireStationInfoDto
>
fireStationInfoList
=
this
.
baseMapper
.
queryStationAlarmListByCode
(
stationCode
);
List
<
AlarmCountVO
>
alarmCountVOS
=
this
.
baseMapper
.
queryAllAlarmCountByCode
(
beginDateTime
,
endDateTime
);
Map
<
String
,
AlarmCountVO
>
collect
=
alarmCountVOS
.
stream
().
collect
(
Collectors
.
toMap
(
AlarmCountVO:
:
getStationCode
,
t
->
t
));
fireStationInfoList
.
forEach
(
item
->
{
if
(
collect
.
containsKey
(
item
.
getCode
()))
{
item
.
setAlarmNum
(
collect
.
get
(
item
.
getCode
()).
getAlarmNum
());
}
stationNameList
.
add
(
item
.
getName
());
alarmNumList
.
add
(
String
.
valueOf
(
item
.
getAlarmNum
()));
});
resultMap
.
put
(
"stationNames"
,
stationNameList
);
resultMap
.
put
(
"alarmNums"
,
alarmNumList
);
}
else
{
List
<
String
>
dateList
=
new
ArrayList
<>();
List
<
String
>
alarmNumList
=
new
ArrayList
<>();
List
<
DateAlarmCountVO
>
alarmNumByDateTimePeriodByStationCode
=
this
.
baseMapper
.
getAlarmNumByDateTimePeriodByStationCode
(
stationCode
,
beginDateTime
,
endDateTime
);
alarmNumByDateTimePeriodByStationCode
.
forEach
(
item
->
{
dateList
.
add
(
item
.
getDate
());
alarmNumList
.
add
(
item
.
getAlarmNums
());
});
resultMap
.
put
(
"date"
,
dateList
);
resultMap
.
put
(
"alarmNum"
,
alarmNumList
);
}
return
resultMap
;
}
public
Map
<
String
,
List
<
String
>>
getAlarmTrendByDatePeriod
(
String
stationCode
,
String
beginDate
,
String
endDate
)
{
HashMap
<
String
,
List
<
String
>>
resultMap
=
new
HashMap
<>();
List
<
String
>
dateList
=
new
ArrayList
<>();
List
<
String
>
alarmNumList
=
new
ArrayList
<>();
List
<
DateAlarmCountVO
>
alarmTrendByDatePeriod
=
this
.
baseMapper
.
getAlarmTrendByDatePeriod
(
stationCode
,
beginDate
,
endDate
);
alarmTrendByDatePeriod
.
forEach
(
item
->
{
dateList
.
add
(
item
.
getDate
());
alarmNumList
.
add
(
item
.
getAlarmNums
());
});
resultMap
.
put
(
"date"
,
dateList
);
resultMap
.
put
(
"alarmNum"
,
alarmNumList
);
return
resultMap
;
}
public
List
<
CarInfoVO
>
getCarInfoByStationCode
(
String
stationCode
)
{
List
<
CarInfoVO
>
carInfoByStationCode
=
fireVehicleMapper
.
getCarInfoByStationCode
(
stationCode
);
carInfoByStationCode
.
forEach
(
item
->
{
if
(
StrUtil
.
isNotEmpty
(
item
.
getStrCarNumber
()))
{
List
<
CarNumberVO
>
carNumberVOS
=
new
ArrayList
<>();
List
<
String
>
list
=
Arrays
.
asList
(
item
.
getStrCarNumber
().
split
(
","
));
list
.
forEach
(
carNum
->
{
CarNumberVO
carNumberVO
=
new
CarNumberVO
();
carNumberVO
.
setCarNum
(
carNum
);
carNumberVOS
.
add
(
carNumberVO
);
});
item
.
setCarList
(
carNumberVOS
);
}
});
return
carInfoByStationCode
;
}
public
List
<
Map
<
String
,
String
>>
getFireSystemByStationCode
(
String
stationCode
)
{
List
<
Map
<
String
,
String
>>
resultList
=
new
ArrayList
<>();
List
<
FireFightingSystem
>
mridList
=
fireFightingSystemMapper
.
getMridByCode
(
stationCode
);
mridList
.
forEach
(
item
->
{
HashMap
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"systemName"
,
item
.
getName
());
resultMap
.
put
(
"alarmNum"
,
String
.
valueOf
(
fireEquipmentSignalLogMapper
.
getAlarmCountByMrid
(
item
.
getMrid
())));
resultList
.
add
(
resultMap
);
});
return
resultList
;
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-ccs-biz/src/main/java/com/yeejoin/amos/boot/module/ccs/biz/service/impl/MqttReceiveServiceImpl.java
View file @
36006126
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
biz
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.
alibaba.fastjson.JSONArray
;
import
com.
github.xiaoymin.knife4j.core.util.StrUtil
;
import
com.
baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.
yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentSignalLog
;
import
com.yeejoin.amos.boot.module.ccs.api.service.IFireStationInfoService
;
import
com.yeejoin.amos.boot.module.ccs.api.service.MqttReceiveService
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.AlarmEventLogVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.QuestionVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.RawDataVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.ReceiveDataVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
public
class
MqttReceiveServiceImpl
implements
MqttReceiveService
{
private
static
Boolean
bool
=
Boolean
.
FALSE
;
@Autowired
private
FireEquipmentSignalLogServiceImpl
fireEquipmentSignalLogServiceImpl
;
//TODO 逻辑待补充
@Override
public
void
handlerMqttIncrementMessage
(
String
topic
,
String
message
)
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
try
{
list
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parseObject
(
message
,
List
.
class
);
// 将JSON字符串转换成实体类型
// List<FireEquipmentSignalLog> log = JSONUtil.toBean(message, FireEquipmentSignalLog.class);
}
catch
(
Exception
e
)
{
log
.
error
(
"解析失败"
);
throw
new
BadRequest
(
"解析失败"
);
}
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
FireEquipmentSignalLog
>
doList
=
new
ArrayList
<>();
for
(
Map
<
String
,
String
>
stringStringMap
:
list
)
{
FireEquipmentSignalLog
fireEquipmentSignalLog
=
new
FireEquipmentSignalLog
();
if
(
stringStringMap
.
containsKey
(
"objcect_type"
)
&&
StrUtil
.
isNotBlank
(
stringStringMap
.
get
(
"objcect_type"
)))
{
if
(!
stringStringMap
.
get
(
"objcect_type"
).
equals
(
"EQUIP"
))
{
continue
;
}
}
//当为告警时新增数据
doList
.
add
(
fireEquipmentSignalLog
);
//当为消除告警时修改原有数据 (根据设备编码、)
}
if
(
CollectionUtils
.
isNotEmpty
(
doList
))
{
fireEquipmentSignalLogServiceImpl
.
saveBatchLog
(
doList
);
}
}
log
.
info
(
String
.
format
(
"收到mqtt消息:%s"
,
message
));
}
private
static
Boolean
bool
=
Boolean
.
FALSE
;
@Autowired
private
FireEquipmentSignalLogServiceImpl
fireEquipmentSignalLogServiceImpl
;
@Autowired
private
IFireStationInfoService
fireStationInfoService
;
//TODO 逻辑待补充
@Override
public
void
handlerMqttAlarmMessage
(
String
topic
,
String
message
)
{
Date
now
=
DateUtil
.
date
();
ReceiveDataVO
receiveData
=
new
ReceiveDataVO
();
try
{
// 将JSON字符串转换成实体类型
receiveData
=
JSONUtil
.
toBean
(
message
,
ReceiveDataVO
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"接受消息解析失败,{}"
,
e
.
getMessage
());
throw
new
BadRequest
(
"接受消息解析失败"
);
}
if
(
ObjectUtil
.
isNotEmpty
(
receiveData
)
&&
StrUtil
.
isNotEmpty
(
receiveData
.
getActive
())
&&
"insert"
.
equals
(
receiveData
.
getActive
())
&&
ObjectUtil
.
isNotEmpty
(
receiveData
.
getAlarmEventLog
()))
{
AlarmEventLogVO
alarmEventLog
=
receiveData
.
getAlarmEventLog
();
if
(
StrUtil
.
isNotEmpty
(
alarmEventLog
.
getObjcectType
())
&&
"equipment"
.
equals
(
alarmEventLog
.
getObjcectType
())
&&
StrUtil
.
isNotEmpty
(
alarmEventLog
.
getObjcectIndexType
())
&&
"FIREALARM"
.
equals
(
alarmEventLog
.
getObjcectIndexType
()))
{
FireEquipmentSignalLog
fireEquipmentSignalLog
=
new
FireEquipmentSignalLog
();
fireEquipmentSignalLog
.
setStationName
(
alarmEventLog
.
getBizOrgName
());
fireEquipmentSignalLog
.
setStationCode
(
alarmEventLog
.
getOrgCode
());
fireEquipmentSignalLog
.
setFireEquipmentMrid
(
alarmEventLog
.
getObjcectCode
());
fireEquipmentSignalLog
.
setFireEquipmentName
(
alarmEventLog
.
getObjcectName
());
fireEquipmentSignalLog
.
setFireEquipmentIndexName
(
alarmEventLog
.
getObjcectIndexName
());
fireEquipmentSignalLog
.
setFireEquipmentIndexKey
(
alarmEventLog
.
getObjcectIndexKey
());
fireEquipmentSignalLog
.
setFireBuildingMrid
(
alarmEventLog
.
getBuildingCode
());
fireEquipmentSignalLog
.
setSignalType
(
alarmEventLog
.
getObjcectIndexType
());
fireEquipmentSignalLog
.
setSignalTypeName
(
"火灾告警"
);
fireEquipmentSignalLog
.
setAlarmReason
(
alarmEventLog
.
getQuestionReason
());
fireEquipmentSignalLog
.
setConfirmState
(
"0"
);
fireEquipmentSignalLog
.
setConfirmDate
(
DateUtil
.
parse
(
alarmEventLog
.
getAlarmTime
()));
fireEquipmentSignalLog
.
setSystemMrids
(
alarmEventLog
.
getSystemCode
());
fireEquipmentSignalLog
.
setSystemNames
(
alarmEventLog
.
getSystemName
());
fireEquipmentSignalLog
.
setProtectedObjectMrid
(
alarmEventLog
.
getProtectedObjectCode
());
fireEquipmentSignalLog
.
setProtectedObjectName
(
alarmEventLog
.
getProtectedObjectName
());
fireEquipmentSignalLog
.
setIsAlarm
(
"1"
.
equals
(
alarmEventLog
.
getRecoveryStatus
()));
fireEquipmentSignalLog
.
setCreateDate
(
now
);
fireEquipmentSignalLog
.
setSignalReportDate
(
DateUtil
.
today
());
fireEquipmentSignalLog
.
setLocation
(
alarmEventLog
.
getBuildingName
());
fireEquipmentSignalLog
.
setSynDate
(
now
);
FireStationInfoDto
oneByCode
=
fireStationInfoService
.
getOneByCode
(
fireEquipmentSignalLog
.
getStationCode
());
fireEquipmentSignalLog
.
setLng
(
oneByCode
.
getLng
());
fireEquipmentSignalLog
.
setLat
(
oneByCode
.
getLat
());
fireEquipmentSignalLogServiceImpl
.
save
(
fireEquipmentSignalLog
);
}
}
else
if
(
ObjectUtil
.
isNotEmpty
(
receiveData
)
&&
StrUtil
.
isNotEmpty
(
receiveData
.
getActive
())
&&
"update"
.
equals
(
receiveData
.
getActive
())
&&
ObjectUtil
.
isNotEmpty
(
receiveData
.
getRawData
())
&&
StrUtil
.
isNotEmpty
(
receiveData
.
getRawData
().
getEquipmentSpecificIotCode
()))
{
RawDataVO
rawData
=
receiveData
.
getRawData
();
FireEquipmentSignalLog
fireEquipmentSignalLog
=
new
FireEquipmentSignalLog
();
fireEquipmentSignalLog
.
setIsAlarm
(
false
);
UpdateWrapper
<
FireEquipmentSignalLog
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
lambda
().
eq
(
FireEquipmentSignalLog:
:
getFireEquipmentMrid
,
rawData
.
getEquipmentSpecificCode
())
.
eq
(
FireEquipmentSignalLog:
:
getFireEquipmentIndexKey
,
rawData
.
getEquipmentIndexKey
());
fireEquipmentSignalLogServiceImpl
.
update
(
fireEquipmentSignalLog
,
updateWrapper
);
}
log
.
info
(
String
.
format
(
"收到mqtt(警情)消息并处理完成:%s"
,
message
));
}
@Override
public
void
handlerMqttQuestionMessage
(
String
topic
,
String
message
)
{
Date
now
=
DateUtil
.
date
();
QuestionVO
questionVO
=
new
QuestionVO
();
try
{
// 将JSON字符串转换成实体类型
questionVO
=
JSONUtil
.
toBean
(
message
,
QuestionVO
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"接受消息解析失败,{}"
,
e
.
getMessage
());
throw
new
BadRequest
(
"接受消息解析失败"
);
}
if
(
ObjectUtil
.
isNotEmpty
(
questionVO
)
&&
CollUtil
.
isNotEmpty
(
questionVO
.
getAlarmEventLog
()))
{
questionVO
.
getAlarmEventLog
().
forEach
(
item
->
{
FireEquipmentSignalLog
fireEquipmentSignalLog
=
new
FireEquipmentSignalLog
();
fireEquipmentSignalLog
.
setConfirmState
(
item
.
getStatus
());
UpdateWrapper
<
FireEquipmentSignalLog
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
lambda
().
eq
(
FireEquipmentSignalLog:
:
getSignalId
,
item
.
getSignalId
());
fireEquipmentSignalLogServiceImpl
.
update
(
fireEquipmentSignalLog
,
updateWrapper
);
});
}
log
.
info
(
String
.
format
(
"收到mqtt(问题下发消息推送)消息并处理完成:%s"
,
message
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/ConfirmAlarmController.java
View file @
36006126
...
...
@@ -14,6 +14,7 @@ import org.springframework.http.MediaType;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
...
...
@@ -37,7 +38,7 @@ public class ConfirmAlarmController extends AbstractBaseController {
@GetMapping
(
value
=
"/getDetailsById"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"根据id,type查询确警页面相关数据"
)
public
Map
<
String
,
Object
>
getDetailsById
(
@RequestParam
Long
alamId
,
@RequestParam
(
required
=
false
)
Long
equipId
,
@RequestParam
(
required
=
false
)
String
type
,
@RequestParam
String
area
)
{
public
Map
<
String
,
Object
>
getDetailsById
(
@RequestParam
Long
alamId
,
@RequestParam
(
required
=
false
)
Long
equipId
,
@RequestParam
(
required
=
false
)
String
type
,
@RequestParam
String
area
)
{
return
iConfirmAlarmService
.
getDetailsById
(
alamId
,
equipId
,
type
,
area
);
}
...
...
@@ -63,30 +64,38 @@ public class ConfirmAlarmController extends AbstractBaseController {
@GetMapping
(
value
=
"/getFireAlarm"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"未处理消防告警"
)
public
Map
<
String
,
Object
>
getFireAlarm
()
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"FireAlarmNum"
,
iConfirmAlarmService
.
getFireAlarm
().
intValue
());
return
map
;
public
Map
<
String
,
Object
>
getFireAlarm
()
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"FireAlarmNum"
,
iConfirmAlarmService
.
getFireAlarm
().
intValue
());
return
map
;
}
@GetMapping
(
value
=
"/getFaultAlarm"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"未处理故障告警"
)
public
Map
<
String
,
Object
>
getFaultAlarm
()
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"FaultAlarmNum"
,
iConfirmAlarmService
.
getFaultAlarm
().
intValue
());
public
Map
<
String
,
Object
>
getFaultAlarm
()
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"FaultAlarmNum"
,
iConfirmAlarmService
.
getFaultAlarm
().
intValue
());
return
map
;
}
@GetMapping
(
value
=
"/getMonitorEvent"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"未处理物联告警"
)
public
Map
<
String
,
Object
>
getMonitorEvent
()
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
public
Map
<
String
,
Object
>
getMonitorEvent
()
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
LambdaQueryWrapper
<
MonitorEvent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
MonitorEvent:
:
getEventState
,
"未处理"
);
int
monitorEventNum
=
monitorEventService
.
getBaseMapper
().
selectCount
(
queryWrapper
);
map
.
put
(
"monitorEventNum"
,
monitorEventNum
);
queryWrapper
.
eq
(
MonitorEvent:
:
getEventState
,
"未处理"
);
int
monitorEventNum
=
monitorEventService
.
getBaseMapper
().
selectCount
(
queryWrapper
);
map
.
put
(
"monitorEventNum"
,
monitorEventNum
);
return
map
;
}
@GetMapping
(
value
=
"/{equipmentSpecificId}/relation"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询设备画布及关联摄像头信息"
)
public
Map
<
String
,
Object
>
getEquipSceneAndRelationVideo
(
@PathVariable
Long
equipmentSpecificId
)
{
return
iConfirmAlarmService
.
getEquipSceneAndRelationVideo
(
equipmentSpecificId
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/SourceSceneMapper.java
View file @
36006126
...
...
@@ -12,4 +12,5 @@ import com.yeejoin.equipmanage.common.entity.SourceScene;
public
interface
SourceSceneMapper
extends
BaseMapper
<
SourceScene
>
{
SourceScene
queryEquipmentScene
(
Long
equipmentSpecificId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IConfirmAlarmService.java
View file @
36006126
...
...
@@ -29,4 +29,6 @@ public interface IConfirmAlarmService extends IService<EquipmentSpecificAlarm> {
* 未处理物联告警
*/
Integer
getFaultAlarm
();
Map
<
String
,
Object
>
getEquipSceneAndRelationVideo
(
Long
equipmentSpecificId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
View file @
36006126
...
...
@@ -4,12 +4,9 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.mchange.lang.DoubleUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.equipmanage.common.dto.UserDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
...
...
@@ -26,7 +23,6 @@ import com.yeejoin.equipmanage.remote.WebMqttHandler;
import
com.yeejoin.equipmanage.service.*
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
...
...
@@ -37,10 +33,8 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
ucar.ma2.ArrayDouble
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
public
class
ConfirmAlarmServiceImpl
extends
ServiceImpl
<
ConfirmAlarmMapper
,
EquipmentSpecificAlarm
>
implements
IConfirmAlarmService
{
...
...
@@ -64,9 +58,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired
private
ISyncDataService
syncDataService
;
@Autowired
MqttSendGateway
mqttSendGateway
;
@Autowired
...
...
@@ -115,6 +106,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired
private
IFormInstanceService
instanceService
;
@Autowired
private
SourceSceneMapper
sourceSceneMapper
;
@Override
public
Map
<
String
,
Object
>
getDetailsById
(
Long
alarmId
,
Long
equipId
,
String
type
,
String
area
)
{
final
String
videoType
=
"video"
;
...
...
@@ -184,7 +178,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
set
(
EquipmentSpecific:
:
getRealtimeIotIndexUpdateDate
,
new
Date
()).
eq
(
EquipmentSpecific:
:
getId
,
alarm
.
getEquipmentSpecificId
());
equipmentSpecificSerivce
.
update
(
wrapper
);
MqttReceiveServiceImpl
.
upAlarmLogStatus
(
alarmLog
.
getIotCode
(),
alarmLog
.
getEquipmentSpecificIndexKey
(),
equipmentSpecificAlarmLogService
);
MqttReceiveServiceImpl
.
upAlarmLogStatus
(
alarmLog
.
getIotCode
(),
alarmLog
.
getEquipmentSpecificIndexKey
(),
null
,
equipmentSpecificAlarmLogService
);
}
// 如果是批量确警,先查询,再确警,用于批量消息推送
isBatch
=
ent
.
getIsBatch
();
...
...
@@ -299,6 +293,22 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
return
confirmAlarmMapper
.
getFaultAlarm
();
}
@Override
public
Map
<
String
,
Object
>
getEquipSceneAndRelationVideo
(
Long
equipmentSpecificId
)
{
Map
<
String
,
Object
>
res
=
new
HashMap
<>();
// 设备关联的摄像头
List
<
AlamVideoVO
>
video
=
videoMapper
.
getVideoBySpeId
(
equipmentSpecificId
);
video
.
forEach
(
action
->
{
action
.
setVedioFormat
(
vedioFormat
);
action
.
setUrl
(
videoService
.
getVideoUrl
(
action
.
getName
(),
action
.
getPresetPosition
(),
action
.
getUrl
(),
action
.
getCode
()));
});
res
.
put
(
"video"
,
video
);
// 设备所在楼层画布
SourceScene
scene
=
sourceSceneMapper
.
queryEquipmentScene
(
equipmentSpecificId
);
res
.
put
(
"scene"
,
scene
);
return
res
;
}
// public void sendIotSystemAlarm(EquipmentSpecificAlarmLog ent, String userId, String appKey, String product, String token){
//// Token serverToken = remoteSecurityService.getServerToken();
// ResponseModel<List<UserDto>> responseModel = null;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
36006126
...
...
@@ -21,6 +21,7 @@ import org.springframework.transaction.support.TransactionSynchronization;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
com.alibaba.fastjson.JSON
;
...
...
@@ -288,7 +289,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
EquipmentSpecificIndex
equipmentSpeIndex
=
new
EquipmentSpecificIndex
();
BeanUtils
.
copyProperties
(
equipmentSpecificIndex
,
equipmentSpeIndex
);
String
value
=
iotDataVO
.
getValue
().
toString
();
String
traceId
=
iotDataVO
.
getTraceId
().
toString
();
equipmentSpeIndex
.
setValue
(
value
);
equipmentSpeIndex
.
setTraceId
(
traceId
);
equipmentSpeIndex
.
setValueLabel
(
valueTranslate
(
value
,
equipmentSpecificIndex
.
getValueEnum
()));
equipmentSpeIndex
.
setUpdateDate
(
new
Date
());
equipmentSpecificIndexService
.
updateById
(
equipmentSpeIndex
);
...
...
@@ -372,9 +375,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
carIndexsList
.
add
(
carProperty
);
}
});
boolean
updateBatchById
=
carPropertyService
.
updateBatchById
(
carIndexsList
);
boolean
updateBatchById
=
false
;
if
(!
carIndexsList
.
isEmpty
()){
carPropertyService
.
updateBatchById
(
carIndexsList
);
updateBatchById
=
true
;
}
if
(
updateBatchById
)
{
carTransactionSynch
(
carProperties
,
carPropertyVos
);
}
...
...
@@ -382,7 +387,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
public
static
List
<
EquipmentSpecificAlarmLog
>
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
)
{
String
traceId
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
)
{
LambdaQueryWrapper
<
EquipmentSpecificAlarmLog
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getIotCode
,
iotCode
);
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
equipmentSpecificIndexKey
);
...
...
@@ -392,6 +397,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
logs
.
forEach
(
x
->
{
x
.
setCleanTime
(
new
Date
());
x
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
x
.
setTraceId
(
traceId
);
}
});
if
(!
logs
.
isEmpty
())
{
equipmentSpecificAlarmLogService
.
updateBatchById
(
logs
);
...
...
@@ -588,6 +596,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
action
.
setFrequency
((
action
.
getFrequency
()
+
1
));
}
// 更新所在系统,设备可能编辑过
action
.
setTraceId
(
equipmentSpecificIndex
.
getTraceId
());
action
.
setSystemIds
(
equipmentSpecificIndex
.
getSystemId
());
action
.
setSystemCodes
(
this
.
getSystemCodeBySpeId
(
equipmentSpecificIndex
.
getSystemId
()));
action
.
setUpdateDate
(
new
Date
());
...
...
@@ -736,7 +745,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
}
else
{
equipmentAlarmLogs
.
addAll
(
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
equipmentAlarmLogs
.
addAll
(
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
action
.
getTraceId
(),
equipmentSpecificAlarmLogService
));
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
bool
=
Boolean
.
TRUE
;
...
...
@@ -888,6 +897,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
action
.
setUpdateDate
(
new
Date
());
// 更新所在系统,设备可能编辑过,更新所在系统、装备名称、装备定义code
action
.
setTraceId
(
equipmentSpcIndex
.
getTraceId
());
action
.
setSystemIds
(
equipmentSpcIndex
.
getSystemId
());
action
.
setSystemCodes
(
this
.
getSystemCodeBySpeId
(
equipmentSpcIndex
.
getSystemId
()));
action
.
setEquipmentSpecificName
(
equipmentSpcIndex
.
getEquipmentSpecificName
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/pom.xml
View file @
36006126
...
...
@@ -59,11 +59,4 @@
<scope>
compile
</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>
com.e-iceblue
</id>
<url>
http://repo.e-iceblue.cn/repository/maven-public/
</url>
</repository>
</repositories>
</project>
amos-boot-module/pom.xml
View file @
36006126
...
...
@@ -28,7 +28,6 @@
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-rule
</artifactId>
<version>
1.7.0
</version>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
...
...
amos-boot-system-ccs/src/main/resources/application-dev.properties
View file @
36006126
...
...
@@ -20,5 +20,6 @@ emqx.password=public
#mqtt.scene.host=mqtt://172.16.10.201:18083/mqtt
#mqtt.client.product.id=mqtt
mqtt.topic
=
topic_mqtt
mqtt.topic.alarm
=
idx/eventlog
mqtt.topic.question
=
idx/eventlog/question
#
spring.mqtt.completionTimeout
=
3000
\ No newline at end of file
amos-boot-system-equip/src/main/resources/changelog/changelog-master.xml
View file @
36006126
...
...
@@ -6,6 +6,7 @@
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
>
<include
file=
"wl-3.0.1.xml"
relativeToChangelogFile=
"true"
/>
<include
file=
"wl-3.6.0.xml"
relativeToChangelogFile=
"true"
/>
<!--全量包含视图和函数-->
<include
file=
"sql-task-all.xml"
relativeToChangelogFile=
"true"
/>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/changelog/wl-3.6.0.xml
0 → 100644
View file @
36006126
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
>
<changeSet
author=
"gaojianqiang"
id=
"20220624-1732-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"wl_equipment_specific_index"
columnName=
"trace_id"
/>
</not>
</preConditions>
<comment>
新增属性字段 trace_id
</comment>
<sql>
alter table `wl_equipment_specific_index` add column `trace_id` varchar(64) DEFAULT NULL COMMENT 'iot数据上报唯一id';
</sql>
</changeSet>
<changeSet
author=
"gaojianqiang"
id=
"20220624-1732-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"wl_equipment_specific_alarm"
columnName=
"trace_id"
/>
</not>
</preConditions>
<comment>
新增属性字段 trace_id
</comment>
<sql>
alter table `wl_equipment_specific_alarm` add column `trace_id` varchar(64) DEFAULT NULL COMMENT 'iot数据上报唯一id';
</sql>
</changeSet>
<changeSet
author=
"gaojianqiang"
id=
"20220624-1732-3"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"wl_equipment_specific_alarm_log"
columnName=
"trace_id"
/>
</not>
</preConditions>
<comment>
新增属性字段 trace_id
</comment>
<sql>
alter table `wl_equipment_specific_alarm_log` add column `trace_id` varchar(64) DEFAULT NULL COMMENT 'iot数据上报唯一id';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/mapper/SourceSceneMapper.xml
View file @
36006126
...
...
@@ -2,4 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.equipmanage.mapper.SourceSceneMapper"
>
<select
id=
"queryEquipmentScene"
resultType=
"com.yeejoin.equipmanage.common.entity.SourceScene"
>
SELECT
sou.id,
sou.scene_id
FROM
wl_source_scene sou
WHERE
find_in_set(#{equipmentSpecificId},sou.point_in_scene)>0
and EXISTS (SELECT distinct fi.instance_id from wl_form_instance fi where fi.instance_id = sou.source_id)
limit 1
</select>
</mapper>
pom.xml
View file @
36006126
...
...
@@ -26,6 +26,7 @@
<maven-jar-plugin.version>
3.1.1
</maven-jar-plugin.version>
<tyboot-version>
1.1.20
</tyboot-version>
<amos.version>
1.7.8
</amos.version>
<rule.version>
1.7.9-SNAPSHOT
</rule.version>
<itext.version>
7.1.1
</itext.version>
</properties>
...
...
@@ -242,7 +243,12 @@
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-rule
</artifactId>
<version>
${amos.version}
</version>
<version>
${rule.version}
</version>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-rule
</artifactId>
<version>
${rule.version}
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
...
...
@@ -310,16 +316,15 @@
<url>
http://36.46.149.14:8081/nexus/content/repositories/releases/
</url>
</repository>
<repository>
<id>
com.e-iceblue
</id>
<name>
e-iceblue
</name>
<url>
https://repo.e-iceblue.com/nexus/content/groups/public/
</url>
</repository>
<repository>
<id>
Snapshots
</id>
<name>
Snapshots
</name>
<url>
http://36.46.149.14:8081/nexus/content/repositories/snapshots/
</url>
</repository>
<repository>
<id>
com.e-iceblue
</id>
<name>
e-iceblue
</name>
<url>
https://repo.e-iceblue.com/nexus/content/groups/public/
</url>
</repository>
</repositories>
<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