Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
49bd8187
Commit
49bd8187
authored
Dec 10, 2021
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:消防水池液位计算修改
parent
5a91d84b
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
187 additions
and
24 deletions
+187
-24
pom.xml
YeeAmosFireAutoSysCommon/pom.xml
+1
-1
pom.xml
YeeAmosFireAutoSysService/pom.xml
+2
-2
FormInstanceMapper.java
...join/amos/fas/business/dao/mapper/FormInstanceMapper.java
+19
-0
FormInstanceServiceImpl.java
...os/fas/business/service/impl/FormInstanceServiceImpl.java
+31
-0
HandlerMqttMessageImpl.java
...mos/fas/business/service/impl/HandlerMqttMessageImpl.java
+9
-0
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+14
-17
IFormInstanceService.java
...amos/fas/business/service/intfc/IFormInstanceService.java
+24
-0
ScheduledUtil.java
...ava/com/yeejoin/amos/fas/business/util/ScheduledUtil.java
+48
-0
pom.xml
YeeAmosFireAutoSysStart/pom.xml
+2
-2
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+3
-0
dbTemplate_form_instance.xml
...src/main/resources/db/mapper/dbTemplate_form_instance.xml
+30
-0
dbTemplate_risk_source.xml
...t/src/main/resources/db/mapper/dbTemplate_risk_source.xml
+3
-1
pom.xml
pom.xml
+1
-1
No files found.
YeeAmosFireAutoSysCommon/pom.xml
View file @
49bd8187
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<parent>
<parent>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<version>
3.0.1.
4
</version>
<version>
3.0.1.
5
</version>
</parent>
</parent>
<!-- <dependencies>
<!-- <dependencies>
...
...
YeeAmosFireAutoSysService/pom.xml
View file @
49bd8187
...
@@ -14,14 +14,14 @@
...
@@ -14,14 +14,14 @@
<parent>
<parent>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<version>
3.0.1.
4
</version>
<version>
3.0.1.
5
</version>
</parent>
</parent>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysCommon
</artifactId>
<artifactId>
YeeAmosFireAutoSysCommon
</artifactId>
<version>
3.0.1.
4
</version>
<version>
3.0.1.
5
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FormInstanceMapper.java
0 → 100644
View file @
49bd8187
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.dao.mapper
* @ClassName: FormInstanceMapper
* @Author: Jianqiang Gao
* @Description:
* @Date: 2021/12/10 17:53
* @Version: 1.0
*/
public
interface
FormInstanceMapper
extends
BaseMapper
{
List
<
Map
<
String
,
String
>>
queryFirePool
(
@Param
(
"firePoolIndexKey"
)
String
firePoolIndexKey
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FormInstanceServiceImpl.java
0 → 100644
View file @
49bd8187
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.yeejoin.amos.fas.business.dao.mapper.FormInstanceMapper
;
import
com.yeejoin.amos.fas.business.service.intfc.IFormInstanceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.service.impl
* @ClassName: FormInstanceImpl
* @Author: Jianqiang Gao
* @Description: 建筑类业务
* @Date: 2021/12/10 17:46
* @Version: 1.0
*/
@Service
(
"formInstanceService"
)
public
class
FormInstanceServiceImpl
implements
IFormInstanceService
{
@Autowired
private
FormInstanceMapper
formInstanceMapper
;
@Override
public
List
<
Map
<
String
,
String
>>
queryFirePool
(
String
firePoolIndexKey
)
{
return
formInstanceMapper
.
queryFirePool
(
firePoolIndexKey
);
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java
View file @
49bd8187
...
@@ -124,6 +124,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
...
@@ -124,6 +124,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Value
(
"${security.loginId}"
)
@Value
(
"${security.loginId}"
)
private
String
loginId
;
private
String
loginId
;
@Value
(
"${autoSys.fire.pool.index_key}"
)
private
String
firePoolIndexKey
;
@Autowired
@Autowired
PlanDetailMapper
planDetailMapper
;
PlanDetailMapper
planDetailMapper
;
...
@@ -147,6 +150,12 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
...
@@ -147,6 +150,12 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
}
}
String
specificIndexType
=
equipmentSpecificIndex
.
getType
();
String
specificIndexType
=
equipmentSpecificIndex
.
getType
();
String
typeCode
=
equipmentSpecificIndex
.
getTypeCode
();
String
typeCode
=
equipmentSpecificIndex
.
getTypeCode
();
String
nameKey
=
equipmentSpecificIndex
.
getNameKey
();
String
iotCode
=
equipmentSpecificIndex
.
getIotCode
();
String
value
=
equipmentSpecificIndex
.
getValue
();
if
(
nameKey
!=
null
&&
nameKey
.
equalsIgnoreCase
(
firePoolIndexKey
))
{
redisTemplate
.
opsForValue
().
set
(
"WaterLevel:Value:"
+
iotCode
,
value
);
}
if
(
topicEntity
.
getSimulationDate
().
equals
(
"false"
)
&&
nameKeys
.
contains
(
typeCode
)
&&
indexStateIsChange
(
equipmentSpecificIndex
)){
if
(
topicEntity
.
getSimulationDate
().
equals
(
"false"
)
&&
nameKeys
.
contains
(
typeCode
)
&&
indexStateIsChange
(
equipmentSpecificIndex
)){
log
.
info
(
"指标值没有发生变化: "
+
equipmentSpecificIndex
.
getIotCode
()+
"-"
+
equipmentSpecificIndex
.
getNameKey
()+
":"
+
equipmentSpecificIndex
.
getValue
());
log
.
info
(
"指标值没有发生变化: "
+
equipmentSpecificIndex
.
getIotCode
()+
"-"
+
equipmentSpecificIndex
.
getNameKey
()+
":"
+
equipmentSpecificIndex
.
getValue
());
// 三维屏指标状态推送
// 三维屏指标状态推送
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
49bd8187
...
@@ -1397,30 +1397,27 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1397,30 +1397,27 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@Override
public
List
<
Map
>
queryContingencyWater
()
{
public
List
<
Map
>
queryContingencyWater
()
{
List
<
Map
>
list
=
riskSourceMapper
.
queryContingencyWater
();
List
<
Map
>
list
=
riskSourceMapper
.
queryContingencyWater
();
HashOperations
hashOperations
=
redisTemplate
.
opsForHash
();
for
(
Map
map
:
list
)
{
for
(
Map
map
:
list
)
{
String
iotCode
=
""
;
String
maxlevel
=
""
;
String
volume
=
""
;
double
area
=
0
;
double
area
=
0
;
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"area"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"area"
)))
{
area
=
Double
.
valueOf
(
map
.
get
(
"area"
).
toString
());
area
=
Double
.
valueOf
(
map
.
get
(
"area"
).
toString
());
}
}
String
maxlevel
=
map
.
get
(
"max_level"
)
!=
null
?
map
.
get
(
"max_level"
).
toString
()
:
"0.0"
;
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"iot_code"
)))
{
// String level = map.get("value") != null && StringUtil.isNumeric(map.get("value").toString()) ? String.format("%.2f", (Double.valueOf(map.get("value").toString()))) : maxlevel;
iotCode
=
map
.
get
(
"iot_code"
).
toString
();
String
volume
=
map
.
get
(
"volume"
)
!=
null
&&
StringUtil
.
isNumeric
(
map
.
get
(
"volume"
).
toString
())
?
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"volume"
).
toString
())))
:
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
maxlevel
)
*
area
);
}
// String volume = String.format("%.2f", Double.valueOf(level) * area);
Object
value
=
redisTemplate
.
opsForValue
().
get
(
"WaterLevel:Value:"
+
iotCode
);
if
(
hashOperations
.
size
(
"Analogue"
)
>
0
)
{
if
(
StringUtil
.
isNotEmpty
(
value
))
{
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"code"
))
||
!
hashOperations
.
hasKey
(
"Analogue"
,
map
.
get
(
"code"
)))
{
maxlevel
=
map
.
get
(
"max_level"
)
!=
null
?
map
.
get
(
"max_level"
).
toString
()
:
value
.
toString
();
map
.
put
(
"level"
,
maxlevel
);
volume
=
map
.
get
(
"volume"
)
!=
null
&&
StringUtil
.
isNumeric
(
map
.
get
(
"volume"
).
toString
())
?
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"volume"
).
toString
())))
:
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
value
.
toString
())
*
area
);
map
.
put
(
"volume"
,
volume
);
continue
;
}
EquipCommunicationData
data
=
(
EquipCommunicationData
)
hashOperations
.
get
(
"Analogue"
,
map
.
get
(
"code"
));
String
level
=
StringUtil
.
isNumeric
(
data
.
getState
())
?
data
.
getState
()
:
maxlevel
;
map
.
put
(
"level"
,
level
);
map
.
put
(
"volume"
,
map
.
get
(
"volume"
)
!=
null
&&
StringUtil
.
isNumeric
(
map
.
get
(
"volume"
).
toString
())
?
volume
:
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
level
)
*
area
)));
}
else
{
}
else
{
ma
p
.
put
(
"level"
,
maxlevel
)
;
ma
xlevel
=
map
.
get
(
"max_level"
)
!=
null
?
map
.
get
(
"max_level"
).
toString
()
:
"0.0"
;
map
.
put
(
"volume"
,
volume
);
volume
=
map
.
get
(
"volume"
)
!=
null
&&
StringUtil
.
isNumeric
(
map
.
get
(
"volume"
).
toString
())
?
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"volume"
).
toString
())))
:
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
maxlevel
)
*
area
);
}
}
map
.
put
(
"level"
,
maxlevel
);
map
.
put
(
"volume"
,
volume
);
}
}
return
list
;
return
list
;
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IFormInstanceService.java
0 → 100644
View file @
49bd8187
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
java.util.List
;
import
java.util.Map
;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.service.intfc
* @ClassName: IFormInstance
* @Author: Jianqiang Gao
* @Description: 建筑接口类
* @Date: 2021/12/10 17:45
* @Version: 1.0
*/
public
interface
IFormInstanceService
{
/**
* 获取消防水池
* @return
* @param firePoolIndexKey
*/
List
<
Map
<
String
,
String
>>
queryFirePool
(
String
firePoolIndexKey
);
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/ScheduledUtil.java
0 → 100644
View file @
49bd8187
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
import
com.yeejoin.amos.fas.business.service.intfc.IFormInstanceService
;
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.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Map
;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.util
* @ClassName: ScheduledUtil
* @Author: Jianqiang Gao
* @Description: 定时任务工具类
* @Date: 2021/12/10 16:58
* @Version: 1.0
*/
@Slf4j
@Component
public
class
ScheduledUtil
{
@Autowired
private
IFormInstanceService
formInstanceService
;
@Autowired
private
RedisTemplate
redisTemplate
;
@Value
(
"${autoSys.fire.pool.index_key}"
)
private
String
firePoolIndexKey
;
@Scheduled
(
cron
=
"0 * * * * ? "
)
synchronized
private
void
syncByRedis
()
{
List
<
Map
<
String
,
String
>>
list
=
formInstanceService
.
queryFirePool
(
firePoolIndexKey
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
Map
<
String
,
String
>
map
:
list
)
{
Object
[]
toArray
=
map
.
values
().
toArray
();
redisTemplate
.
opsForValue
().
set
(
"WaterLevel:Code:"
+
toArray
[
0
],
toArray
[
1
]);
}
}
}
}
\ No newline at end of file
YeeAmosFireAutoSysStart/pom.xml
View file @
49bd8187
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<parent>
<parent>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<version>
3.0.1.
4
</version>
<version>
3.0.1.
5
</version>
</parent>
</parent>
<dependencies>
<dependencies>
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<dependency>
<dependency>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysService
</artifactId>
<artifactId>
YeeAmosFireAutoSysService
</artifactId>
<version>
3.0.1.
4
</version>
<version>
3.0.1.
5
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
49bd8187
...
@@ -82,6 +82,9 @@ autoSys.alarm.nameKeys=BREAKDOWN,FIREALARM,SHIELD
...
@@ -82,6 +82,9 @@ autoSys.alarm.nameKeys=BREAKDOWN,FIREALARM,SHIELD
autoSys.alarm.status
=
2,3
autoSys.alarm.status
=
2,3
autoSys.alarm.value
=
true
autoSys.alarm.value
=
true
#消防水池指标编码
autoSys.fire.pool.index_key
=
FHS_FirePoolDevice_WaterLevel
#查询装备分类
#查询装备分类
#消防视频:xfsp
#消防视频:xfsp
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_form_instance.xml
0 → 100644
View file @
49bd8187
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.FormInstanceMapper"
>
<select
id=
"queryFirePool"
resultType=
"java.util.HashMap"
>
SELECT
es.iot_code AS iotCode,
MAX( CASE WHEN a.field_name = 'code' THEN a.field_value END ) AS `code`
FROM
`wl_form_instance` a
LEFT JOIN wl_equipment_specific es ON a.instance_id = es.warehouse_structure_id
WHERE
a.group_code IN ( 'pool', 'r_pool' )
AND a.instance_id IN (
SELECT
es.warehouse_structure_id
FROM
wl_equipment_specific es
<where>
es.warehouse_structure_id IS NOT NULL
<if
test=
"firePoolIndexKey != null and firePoolIndexKey != ''"
>
AND es.realtime_iot_index_key = #{firePoolIndexKey}
</if>
</where>
)
GROUP BY
a.instance_id
</select>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_risk_source.xml
View file @
49bd8187
...
@@ -652,9 +652,11 @@
...
@@ -652,9 +652,11 @@
MAX( CASE WHEN a.field_name = 'height' THEN a.field_value END ) AS max_level,
MAX( CASE WHEN a.field_name = 'height' THEN a.field_value END ) AS max_level,
MAX( CASE WHEN a.field_name = 'lowWaterHeight' THEN a.field_value END ) AS alarm_level,
MAX( CASE WHEN a.field_name = 'lowWaterHeight' THEN a.field_value END ) AS alarm_level,
MAX( CASE WHEN a.field_name = 'bottomArea' THEN a.field_value END ) AS area,
MAX( CASE WHEN a.field_name = 'bottomArea' THEN a.field_value END ) AS area,
MAX( CASE WHEN a.field_name = 'volume' THEN a.field_value END ) AS volume
MAX( CASE WHEN a.field_name = 'volume' THEN a.field_value END ) AS volume,
es.iot_code
FROM
FROM
`wl_form_instance` a
`wl_form_instance` a
LEFT JOIN wl_equipment_specific es ON a.instance_id = es.warehouse_structure_id
WHERE
WHERE
a.group_code IN ( 'pool', 'r_pool' )
a.group_code IN ( 'pool', 'r_pool' )
GROUP BY
GROUP BY
...
...
pom.xml
View file @
49bd8187
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<version>
3.0.1.
4
</version>
<version>
3.0.1.
5
</version>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<name>
YeeAmosFireAutoSysRoot
</name>
<name>
YeeAmosFireAutoSysRoot
</name>
...
...
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