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
37c3e824
Commit
37c3e824
authored
Feb 23, 2022
by
maoying
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_bitmap' of 172.16.10.76:moa/amos-boot-biz into dev_bitmap
parents
25ff30a2
39b15f6e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
67 additions
and
44 deletions
+67
-44
EquipmentStateVo.java
...eejoin/equipmanage/common/entity/vo/EquipmentStateVo.java
+6
-0
EquipmentStateUtil.java
.../yeejoin/equipmanage/common/utils/EquipmentStateUtil.java
+7
-9
SpeIndexVo.java
...in/java/com/yeejoin/equipmanage/common/vo/SpeIndexVo.java
+4
-0
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+3
-11
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+38
-19
RiskSourceSceneServiceImpl.java
.../equipmanage/service/impl/RiskSourceSceneServiceImpl.java
+1
-1
EquipmentSpecificMapper.xml
...uip/src/main/resources/mapper/EquipmentSpecificMapper.xml
+5
-3
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+3
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/vo/EquipmentStateVo.java
View file @
37c3e824
...
...
@@ -54,4 +54,10 @@ public class EquipmentStateVo {
*/
private
List
<
SpeIndexVo
>
speindexList
;
/**
* 紧急程度颜色
*/
private
String
color
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/EquipmentStateUtil.java
View file @
37c3e824
...
...
@@ -6,10 +6,13 @@ import com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum;
import
com.yeejoin.equipmanage.common.enums.EquipmentStateEnum
;
import
com.yeejoin.equipmanage.common.enums.TrueOrFalseEnum
;
import
com.yeejoin.equipmanage.common.vo.AlarmDataVO
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
javax.validation.Validation
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
...
...
@@ -264,15 +267,10 @@ public class EquipmentStateUtil {
}
public
static
String
judgeEquipState
(
EquipmentSpecificIndex
index
)
{
String
status
=
EquipmentStateEnum
.
ZC
.
getStatus
();
String
keyValue
=
String
.
valueOf
(
index
.
getValue
());
for
(
EquipmentRiskTypeEnum
enums
:
EquipmentRiskTypeEnum
.
values
())
{
if
(
enums
.
getCode
().
equals
(
index
.
getTypeCode
())
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
keyValue
))
{
status
=
enums
.
getStateCode
();
break
;
}
if
(
TrueOrFalseEnum
.
real
.
value
.
toUpperCase
().
equals
(
String
.
valueOf
(
index
.
getValue
()).
toUpperCase
()))
{
return
StringUtils
.
isNotEmpty
(
index
.
getEmergencyLevelColor
())
?
index
.
getEmergencyLevelColor
()
:
"#49AA19"
;
}
else
{
return
"#49AA19"
;
}
log
.
info
(
"此装备的状态为: "
+
status
+
"(屏蔽-5, 火灾告警-4, 故障-3, 正常-2, 挂起-1)"
);
return
status
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/SpeIndexVo.java
View file @
37c3e824
...
...
@@ -27,4 +27,8 @@ public class SpeIndexVo {
private
String
emergencyLevel
=
""
;
private
String
emergencyLevelDescribe
=
""
;
private
String
indexValue
;
private
String
indexName
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
37c3e824
...
...
@@ -542,6 +542,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
SpeIndexVo
latestVo
=
statusList
.
get
(
0
);
BeanUtils
.
copyProperties
(
latestVo
,
spe
);
spe
.
setName
(
"当前状态"
);
spe
.
setValue
(
getStatus
(
statusList
));
statusList
.
clear
();
statusList
.
add
(
spe
);
statusList
.
addAll
(
newList
);
...
...
@@ -556,17 +557,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
*/
private
String
getStatus
(
List
<
SpeIndexVo
>
statusList
)
{
SpeIndexVo
indexVo
=
statusList
.
get
(
0
);
if
(
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
indexVo
.
getValue
()))
{
return
"报警"
;
}
if
(
EquipmentRiskTypeEnum
.
GZ
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
indexVo
.
getValue
()))
{
return
"故障"
;
}
if
(
EquipmentRiskTypeEnum
.
PB
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
&&
TrueOrFalseEnum
.
real
.
value
.
equals
(
indexVo
.
getValue
()))
{
return
"屏蔽"
;
}
if
(
EquipmentRiskTypeEnum
.
YXZT
.
getCode
().
equals
(
indexVo
.
getTypeCode
())
&&
TrueOrFalseEnum
.
fake
.
value
.
equals
(
indexVo
.
getValue
()))
{
return
"停运"
;
if
(
StringUtil
.
isNotEmpty
(
indexVo
.
getIndexValue
())
&&
TrueOrFalseEnum
.
real
.
value
.
toUpperCase
().
equals
(
indexVo
.
getIndexValue
().
toUpperCase
()))
{
return
indexVo
.
getIndexName
();
}
return
"运行"
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
37c3e824
...
...
@@ -387,18 +387,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
syncDataService
.
syncCreatedFireEquipMeasurement
(
fireEquipMeasurementCollect
);
}
}
String
status
=
EquipmentStateUtil
.
judgeEquipState
(
newIndexList
);
equipmentStateVo
.
setStatus
(
status
);
// 添加性能指标项
equipmentStateVo
.
setSpeindexList
(
fireFightingSystemService
.
getSpeIndex
(
equipmentSpecificIndexList
.
get
(
0
).
getEquipmentSpecificId
()));
//平台数据结构调整,equipCode、status 放到一个对象里
Map
<
String
,
Object
>
topicObject
=
new
HashMap
<>();
topicObject
.
put
(
"equipCode"
,
equipmentStateVo
.
getEquipCode
());
topicObject
.
put
(
"status"
,
equipmentStateVo
.
getStatus
());
Map
<
String
,
Object
>
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentStateVo
));
map
.
put
(
canvasTopic
,
topicObject
);
// 发送数据至画布
mqttSendGateway
.
sendToMqtt
(
canvasTopic
,
JSON
.
toJSONString
(
map
));
// 发送数据到画布
publishDataToCanvas
(
newIndexList
,
iotCode
);
}
// 设备报警日报表数据储存更新
...
...
@@ -735,13 +725,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
});
//若为物联设备,则更新拓扑节点数据及告警状态
if
(!
ObjectUtils
.
isEmpty
(
indexList
))
{
EquipmentVo
equipmentVo
=
equipmentService
.
getEquipBySpecific
(
indexList
.
get
(
0
).
getEquipmentSpecificId
());
if
(
equipmentVo
.
getIsIot
().
equals
(
"1"
))
{
List
<
EquipmentSpecificAlarm
>
alarmList
=
equipmentSpecificAlarmService
.
getEquipListBySpecific
(
true
,
indexList
.
get
(
0
).
getEquipmentSpecificId
());
topographyService
.
updateNodeDateByEquipId
(
indexList
.
get
(
0
).
getEquipmentSpecificId
(),
indexList
,
alarmList
);
}
}
//
if (!ObjectUtils.isEmpty(indexList)) {
//
EquipmentVo equipmentVo = equipmentService.getEquipBySpecific(indexList.get(0).getEquipmentSpecificId());
//
if (equipmentVo.getIsIot().equals("1")) {
//
List<EquipmentSpecificAlarm> alarmList = equipmentSpecificAlarmService.getEquipListBySpecific(true, indexList.get(0).getEquipmentSpecificId());
//
topographyService.updateNodeDateByEquipId(indexList.get(0).getEquipmentSpecificId(), indexList, alarmList);
//
}
//
}
}
static
void
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
)
{
...
...
@@ -759,6 +749,35 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
}
public
void
publishDataToCanvas
(
List
<
EquipmentSpecificIndex
>
indexList
,
String
iotCode
)
{
if
(!
ObjectUtils
.
isEmpty
(
indexList
))
{
EquipmentSpecificIndex
index
=
indexList
.
stream
().
filter
(
x
->
x
.
getUpdateDate
()
!=
null
)
.
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
.
collect
(
Collectors
.
toList
()).
get
(
0
);
EquipmentStateVo
equipmentStateVo
=
new
EquipmentStateVo
();
equipmentStateVo
.
setEquipName
(
index
.
getEquipmentSpecificName
());
equipmentStateVo
.
setOrgCode
(
index
.
getOrgCode
());
equipmentStateVo
.
setSpecificId
(
index
.
getEquipmentSpecificId
());
equipmentStateVo
.
setEquipCode
(
index
.
getQrCode
());
equipmentStateVo
.
setEquipIotCode
(
iotCode
);
equipmentStateVo
.
setStatus
(
""
);
equipmentStateVo
.
setColor
(
index
.
getEmergencyLevelColor
());
// 添加性能指标项
equipmentStateVo
.
setSpeindexList
(
fireFightingSystemService
.
getSpeIndex
(
index
.
getEquipmentSpecificId
()));
Map
<
String
,
Object
>
topicObject
=
new
HashMap
<>();
topicObject
.
put
(
"equipCode"
,
equipmentStateVo
.
getEquipCode
());
if
(
TrueOrFalseEnum
.
real
.
value
.
toUpperCase
().
equals
(
index
.
getValue
().
toUpperCase
()))
{
topicObject
.
put
(
"color"
,
equipmentStateVo
.
getColor
());
}
else
{
topicObject
.
put
(
"color"
,
"#49AA19"
);
}
Map
<
String
,
Object
>
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentStateVo
));
map
.
put
(
canvasTopic
,
topicObject
);
// 发送数据至画布
mqttSendGateway
.
sendToMqtt
(
canvasTopic
,
JSON
.
toJSONString
(
map
));
}
}
void
syncSystemctlMsg
(
EquipmentSpecificAlarmLog
equipmentSpecificAlarmLog
)
{
try
{
MessageModel
model
=
new
MessageModel
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/RiskSourceSceneServiceImpl.java
View file @
37c3e824
...
...
@@ -348,7 +348,7 @@ public class RiskSourceSceneServiceImpl extends ServiceImpl<RiskSourceSceneMappe
equipIndexLatestStatus
.
forEach
(
action
->{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"equipCode"
,
action
.
getQrCode
());
map
.
put
(
"color"
,
action
.
getEmergencyLevelColor
(
));
map
.
put
(
"color"
,
EquipmentStateUtil
.
judgeEquipState
(
action
));
data
.
add
(
map
);
});
return
data
;
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml
View file @
37c3e824
...
...
@@ -275,13 +275,15 @@
SELECT
equipindex.`value`,
ei.type_code AS 'typeCode',
es.qr_code AS 'qrCode'
es.qr_code AS 'qrCode',
equipindex.color AS emergencyLevelColor
FROM
(
SELECT
esi.equipment_index_id,
esi.equipment_specific_id,
esi.`value`
esi.`value`,
esi.emergency_level_color as color
FROM
wl_equipment_specific_index esi,
(
...
...
@@ -316,7 +318,7 @@
es.qr_code AS 'qrCode',
es.iot_code AS 'iotCode',
es.realtime_iot_index_value AS 'value',
sc.
color AS color
sc.
emergency_level_color AS 'emergencyLevelColor'
FROM
wl_equipment_specific es,
wl_equipment_index ei,
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
37c3e824
...
...
@@ -361,7 +361,9 @@
spein.emergency_level_color AS color,
spein.is_alarm AS isAlarm,
spein.emergency_level AS emergencyLevel,
spein.emergency_level_describe AS emergencyLevelDescribe
spein.emergency_level_describe AS emergencyLevelDescribe,
spein.`value` AS indexValue,
spein.equipment_index_name AS indexName
FROM
wl_equipment_specific_index AS spein
LEFT JOIN wl_equipment_index AS eqin ON spein.equipment_index_id = eqin.id
...
...
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