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
670da3f5
Commit
670da3f5
authored
Aug 23, 2024
by
张森
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消防储水量不少于4000m³ 预警问题
parent
02642fd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
1 deletion
+63
-1
PoolStatisticController.java
...ejoin/equipmanage/controller/PoolStatisticController.java
+5
-1
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+58
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/PoolStatisticController.java
View file @
670da3f5
...
@@ -119,7 +119,7 @@ public class PoolStatisticController {
...
@@ -119,7 +119,7 @@ public class PoolStatisticController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/panel/station/statistic"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/panel/station/statistic"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取水池统计信息"
,
notes
=
"获取水池统计信息"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取水池统计信息"
,
notes
=
"获取水池统计信息"
)
public
ResponseModel
getStationWaterPanelInfo
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getStationWaterPanelInfo
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
List
<
Map
<
String
,
Object
>>
infoList
=
fireFightingSystemMapper
.
getWaterInfoBySuper
(
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
infoList
=
fireFightingSystemMapper
.
getWaterInfoBySuper
(
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
normalList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
normalList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
abNormalList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
abNormalList
=
new
ArrayList
<>();
...
@@ -140,10 +140,14 @@ public class PoolStatisticController {
...
@@ -140,10 +140,14 @@ public class PoolStatisticController {
BigDecimal
bigDecimal
=
new
BigDecimal
(
String
.
valueOf
(
m
.
get
(
"volume"
))).
multiply
(
new
BigDecimal
(
String
.
valueOf
(
transResult
.
get
(
"abs"
)))).
divide
(
divide
,
0
,
RoundingMode
.
HALF_UP
);
BigDecimal
bigDecimal
=
new
BigDecimal
(
String
.
valueOf
(
m
.
get
(
"volume"
))).
multiply
(
new
BigDecimal
(
String
.
valueOf
(
transResult
.
get
(
"abs"
)))).
divide
(
divide
,
0
,
RoundingMode
.
HALF_UP
);
m
.
put
(
"volume"
,
bigDecimal
+
"m³"
);
m
.
put
(
"volume"
,
bigDecimal
+
"m³"
);
m
.
put
(
"levelAbs"
,
transResult
.
get
(
"abs"
)
+
"%"
);
m
.
put
(
"levelAbs"
,
transResult
.
get
(
"abs"
)
+
"%"
);
// 预警使用以下字段
m
.
put
(
"volumeBigDecimal"
,
bigDecimal
);
}
else
if
(
String
.
valueOf
(
transResult
.
get
(
"abs"
)).
equals
(
"100"
)
&&
String
.
valueOf
(
transResult
.
get
(
"status"
)).
equals
(
"1"
))
{
}
else
if
(
String
.
valueOf
(
transResult
.
get
(
"abs"
)).
equals
(
"100"
)
&&
String
.
valueOf
(
transResult
.
get
(
"status"
)).
equals
(
"1"
))
{
BigDecimal
bigDecimal
=
new
BigDecimal
(
String
.
valueOf
(
m
.
get
(
"volume"
)));
BigDecimal
bigDecimal
=
new
BigDecimal
(
String
.
valueOf
(
m
.
get
(
"volume"
)));
m
.
put
(
"volume"
,
bigDecimal
+
"m³"
);
m
.
put
(
"volume"
,
bigDecimal
+
"m³"
);
m
.
put
(
"levelAbs"
,
transResult
.
get
(
"abs"
)
+
"%"
);
m
.
put
(
"levelAbs"
,
transResult
.
get
(
"abs"
)
+
"%"
);
// 预警使用以下字段
m
.
put
(
"volumeBigDecimal"
,
bigDecimal
);
}
else
{
}
else
{
m
.
put
(
"levelAbs"
,
transResult
.
get
(
"abs"
));
m
.
put
(
"levelAbs"
,
transResult
.
get
(
"abs"
));
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
670da3f5
...
@@ -29,6 +29,7 @@ import com.yeejoin.equipmanage.common.utils.UUIDUtils;
...
@@ -29,6 +29,7 @@ import com.yeejoin.equipmanage.common.utils.UUIDUtils;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.common.vo.*
;
import
com.yeejoin.equipmanage.common.vo.BizMessage
;
import
com.yeejoin.equipmanage.common.vo.BizMessage
;
import
com.yeejoin.equipmanage.common.vo.CustomizeItems
;
import
com.yeejoin.equipmanage.common.vo.CustomizeItems
;
import
com.yeejoin.equipmanage.controller.PoolStatisticController
;
import
com.yeejoin.equipmanage.dto.TabContent
;
import
com.yeejoin.equipmanage.dto.TabContent
;
import
com.yeejoin.equipmanage.fegin.IotFeign
;
import
com.yeejoin.equipmanage.fegin.IotFeign
;
import
com.yeejoin.equipmanage.fegin.SystemctlFeign
;
import
com.yeejoin.equipmanage.fegin.SystemctlFeign
;
...
@@ -186,6 +187,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -186,6 +187,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired
@Autowired
private
ManufacturerInfoMapper
manufacturerInfoMapper
;
private
ManufacturerInfoMapper
manufacturerInfoMapper
;
@Autowired
private
PoolStatisticController
poolStatisticController
;
// @Autowired
// @Autowired
// private AmosRequestContext amosAuth;
// private AmosRequestContext amosAuth;
@Value
(
"${equipManage.name}"
)
@Value
(
"${equipManage.name}"
)
...
@@ -1130,6 +1134,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1130,6 +1134,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
iotDataVO
.
getKey
().
equalsIgnoreCase
(
FHS_WirelessliquidDetector_WaterLevel
)
||
iotDataVO
.
getKey
().
equalsIgnoreCase
(
FHS_WirelessliquidDetector_WaterLevel
)
||
iotDataVO
.
getKey
().
equalsIgnoreCase
(
FHS_LevelDetector_WaterLevel
))
{
iotDataVO
.
getKey
().
equalsIgnoreCase
(
FHS_LevelDetector_WaterLevel
))
{
alarmFlag
=
doWaterPoolLevel
(
iotDataVO
,
equipmentSpecificIndex
,
messageBodyMap
);
alarmFlag
=
doWaterPoolLevel
(
iotDataVO
,
equipmentSpecificIndex
,
messageBodyMap
);
// 处理每站消防储水量不少于4000m³ 预警问题
doWaterStationWarning
(
equipmentSpecificIndex
.
getBizOrgCode
(),
equipmentSpecificIndex
.
getBizOrgName
());
}
}
//稳压泵启停次数大于15次触发预警
//稳压泵启停次数大于15次触发预警
if
(
iotDataVO
.
getKey
().
equalsIgnoreCase
(
FHS_PressurePump_Start
)
||
if
(
iotDataVO
.
getKey
().
equalsIgnoreCase
(
FHS_PressurePump_Start
)
||
...
@@ -1456,6 +1462,58 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1456,6 +1462,58 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
return
alarmFlag
;
return
alarmFlag
;
}
}
private
void
doWaterStationWarning
(
String
bizOrgCode
,
String
bizOrgName
)
{
List
<
Map
<
String
,
Object
>>
result
=
poolStatisticController
.
getStationWaterPanelInfo
(
bizOrgCode
).
getResult
();
String
indexValue
=
result
.
stream
()
.
map
(
map
->
(
BigDecimal
)
map
.
get
(
"volumeBigDecimal"
))
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
).
toString
();
doWaterStationInfo
(
bizOrgCode
,
bizOrgName
,
indexValue
);
}
private
void
doWaterStationInfo
(
String
bizOrgCode
,
String
bizOrgName
,
String
indexValue
)
{
String
indexKey
=
"WATER_CAPACITY"
;
String
warningObjectCode
=
bizOrgCode
+
"@"
+
indexKey
;
HashMap
<
String
,
String
>
extra
=
new
HashMap
<>();
extra
.
put
(
"useSource"
,
"center"
);
extra
.
put
(
"codingSystem"
,
"center"
);
extra
.
put
(
"codingType"
,
"station"
);
extra
.
put
(
"problemReception"
,
"station"
);
extra
.
put
(
"bussId"
,
warningObjectCode
);
extra
.
put
(
"clearUniqueCode"
,
"station-WATER_CAPACITY"
);
TableContentVo
tableContentVo
=
new
TableContentVo
(
"分析结果"
,
"text"
,
"消防水池+工业水池储水量<4000m³"
,
"1"
);
TableContentVo
tableContentVo1
=
new
TableContentVo
(
"管理要求"
,
"text"
,
"每站消防储水量不少于4000m³"
,
"2"
);
TableContentVo
tableContentVo2
=
new
TableContentVo
(
"管理依据"
,
"text"
,
"换流站消防系统运行规程"
,
"3"
);
List
<
TableContentVo
>
tableContentVos
=
Arrays
.
asList
(
tableContentVo
,
tableContentVo1
,
tableContentVo2
);
// 触发预警业务
BizMessage
bizMessage
=
new
BizMessage
();
bizMessage
.
setIndexKey
(
indexKey
);
bizMessage
.
setIndexValue
(
indexValue
);
RiskBizInfoVo
riskBizInfoVo
=
new
RiskBizInfoVo
();
riskBizInfoVo
.
setWarningObjectName
(
"消防储水量"
);
riskBizInfoVo
.
setWarningObjectCode
(
warningObjectCode
);
riskBizInfoVo
.
setSourceAttribution
(
bizOrgCode
);
riskBizInfoVo
.
setSourceAttributionDesc
(
bizOrgName
);
List
<
RiskDynamicDetailsVo
>
detailsVos
=
new
ArrayList
<>();
RiskDynamicDetailsVo
dynamicDetailsVo
=
new
RiskDynamicDetailsVo
();
dynamicDetailsVo
.
setTabName
(
"预警详情"
);
detailsVos
.
add
(
dynamicDetailsVo
);
riskBizInfoVo
.
setDynamicDetails
(
detailsVos
);
CustomizeItems
customizeItems
=
new
CustomizeItems
();
customizeItems
.
setWarningContent
(
"消防水池+工业水池储水量<4000m³"
);
riskBizInfoVo
.
setCustomizeItems
(
customizeItems
);
riskBizInfoVo
.
setExtra
(
extra
);
riskBizInfoVo
.
setType
(
"waterCapacity"
);
riskBizInfoVo
.
getDynamicDetails
().
get
(
0
).
setTabContent
(
tableContentVos
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
bizMessage
.
setTraceId
(
warningObjectCode
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"fireIot/data/analysis"
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
private
void
doPressurePumInfo
(
TopicEntityVo
topicEntity
,
EquipmentSpecificIndex
equipmentSpecificIndex
)
{
private
void
doPressurePumInfo
(
TopicEntityVo
topicEntity
,
EquipmentSpecificIndex
equipmentSpecificIndex
)
{
// 查询iot该稳压泵的启停次数 一个小时内
// 查询iot该稳压泵的启停次数 一个小时内
String
startDate
=
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_DATETIME_PATTERN
);
String
startDate
=
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_DATETIME_PATTERN
);
...
...
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