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
de1edd17
Commit
de1edd17
authored
Jun 16, 2022
by
高东东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加预案代码
parent
8646f87c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
85 additions
and
21 deletions
+85
-21
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+13
-18
DeviceRo.java
.../com/yeejoin/amos/fas/business/action/model/DeviceRo.java
+12
-2
ImpAndFireEquipMapper.java
...n/amos/fas/business/dao/mapper/ImpAndFireEquipMapper.java
+1
-0
PlanDetailMapper.java
...eejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
+3
-0
IPlanDetailDao.java
...join/amos/fas/business/dao/repository/IPlanDetailDao.java
+3
-0
HandlerMqttMessageImpl.java
...mos/fas/business/service/impl/HandlerMqttMessageImpl.java
+31
-1
RuleRunigSnapshotServiceImpl.java
...s/business/service/impl/RuleRunigSnapshotServiceImpl.java
+3
-0
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+2
-0
PlanDetailMapper.xml
...ysStart/src/main/resources/db/mapper/PlanDetailMapper.xml
+17
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
de1edd17
...
@@ -856,29 +856,27 @@ public class ContingencyAction implements CustomerAction {
...
@@ -856,29 +856,27 @@ public class ContingencyAction implements CustomerAction {
public
void
clearExecute
(
public
void
clearExecute
(
@MethodParam
(
paramLabel
=
"步骤编号"
)
String
stepCode
,
@MethodParam
(
paramLabel
=
"步骤编号"
)
String
stepCode
,
@MethodParam
(
paramLabel
=
"按钮编码"
)
String
buttonCode
,
@MethodParam
(
paramLabel
=
"按钮编码"
)
String
buttonCode
,
@MethodParam
(
paramLabel
=
"
设备数据"
)
Object
paramObj
)
{
@MethodParam
(
paramLabel
=
"
重点设备ID"
)
String
fireEquipmentId
)
{
SafteyPlanResult
result
=
new
SafteyPlanResult
();
SafteyPlanResult
result
=
new
SafteyPlanResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
content
.
put
(
"stepCode"
,
stepCode
);
content
.
put
(
"stepCode"
,
stepCode
);
content
.
put
(
"buttonCode"
,
buttonCode
);
content
.
put
(
"buttonCode"
,
buttonCode
);
if
(
ObjectUtils
.
isEmpty
(
fireEquipmentId
))
{
DeviceRo
ro
=
(
DeviceRo
)
paramObj
;
return
;
Map
<
String
,
Object
>
equipemtnPoints
=
pointCache
.
get
(
ro
.
getEquipmentId
());
if
(!
ObjectUtils
.
isEmpty
(
equipemtnPoints
))
{
equipemtnPoints
.
remove
(
stepCode
+
"-"
+
buttonCode
);
}
}
String
batchNo
=
planDetailMapper
.
queryBatchNoByFireEquipmentId
(
fireEquipmentId
);
if
(
ObjectUtils
.
isEmpty
(
batchNo
))
{
return
;
}
content
.
put
(
"batchNo"
,
batchNo
);
tempmap1
.
put
(
"type"
,
"buttonCache"
);
tempmap1
.
put
(
"type"
,
"buttonCache"
);
if
(!
ObjectUtils
.
isEmpty
(
equipemtnPoints
))
{
tempmap1
.
put
(
"content"
,
content
);
tempmap1
.
put
(
"content"
,
equipemtnPoints
.
values
());
}
else
{
tempmap1
.
put
(
"content"
,
new
ArrayList
());
}
result
.
add
(
tempmap1
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"message"
,
r
o
,
r
esult
);
this
.
sendcmd
(
"message"
,
result
);
}
}
@RuleMethod
(
methodLabel
=
"同步自动执行步骤"
,
project
=
"换流站消防专项预案"
)
@RuleMethod
(
methodLabel
=
"同步自动执行步骤"
,
project
=
"换流站消防专项预案"
)
...
@@ -916,7 +914,7 @@ public class ContingencyAction implements CustomerAction {
...
@@ -916,7 +914,7 @@ public class ContingencyAction implements CustomerAction {
}
}
}
}
public
void
sendcmd
(
String
msgType
,
DeviceRo
deviceRo
,
SafteyPlanResult
result
)
{
public
void
sendcmd
(
String
msgType
,
SafteyPlanResult
result
)
{
Constructor
<?>
constructor
;
Constructor
<?>
constructor
;
try
{
try
{
constructor
=
Class
.
forName
(
constructor
=
Class
.
forName
(
...
@@ -924,7 +922,7 @@ public class ContingencyAction implements CustomerAction {
...
@@ -924,7 +922,7 @@ public class ContingencyAction implements CustomerAction {
.
getConstructor
(
ActionResult
.
class
);
.
getConstructor
(
ActionResult
.
class
);
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
AbstractActionResultMessage
<?>
action
=
(
AbstractActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
if
(
"mqtt"
.
equals
(
pushType
.
toLowerCase
()))
{
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
deviceRo
,
result
.
toJson
());
ToipResponse
toipResponse
=
action
.
buildResponse
(
msgType
,
null
,
result
.
toJson
());
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
log
.
info
(
String
.
format
(
"mqtt[%s]:【 %s 】"
,
topic
,
toipResponse
.
toJsonStr
()));
log
.
info
(
String
.
format
(
"mqtt[%s]:【 %s 】"
,
topic
,
toipResponse
.
toJsonStr
()));
webMqttComponent
.
publish
(
topic
,
toipResponse
.
toJsonStr
());
webMqttComponent
.
publish
(
topic
,
toipResponse
.
toJsonStr
());
...
@@ -933,11 +931,8 @@ public class ContingencyAction implements CustomerAction {
...
@@ -933,11 +931,8 @@ public class ContingencyAction implements CustomerAction {
event
.
setMsgBody
(
toipResponse
.
toJsonStr
());
event
.
setMsgBody
(
toipResponse
.
toJsonStr
());
event
.
setTopic
(
topic
);
event
.
setTopic
(
topic
);
event
.
setMsgType
(
msgType
);
event
.
setMsgType
(
msgType
);
event
.
setContingency
(
deviceRo
);
contingencyLogPublisher
.
publish
(
event
);
contingencyLogPublisher
.
publish
(
event
);
}
else
if
(
"websocket"
.
equals
(
pushType
.
toLowerCase
()))
{
}
action
.
execute
(
msgType
,
deviceRo
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/model/DeviceRo.java
View file @
de1edd17
...
@@ -13,12 +13,22 @@ public class DeviceRo implements Serializable{
...
@@ -13,12 +13,22 @@ public class DeviceRo implements Serializable{
/**
/**
*
*
*/
*/
private
static
final
long
serialVersionUID
=
299646964348882067
L
;
private
static
final
long
serialVersionUID
=
7404825884689318992
L
;
@Label
(
"点编码"
)
@Label
(
"点编码"
)
private
String
pointCode
;
private
String
pointCode
;
@Label
(
"值"
)
@Label
(
"值"
)
private
String
value
;
private
String
value
;
@Label
(
"
重点
装备ID"
)
@Label
(
"装备ID"
)
private
Long
equipmentId
;
private
Long
equipmentId
;
@Label
(
"装备编码"
)
private
String
equipmentCode
;
@Label
(
"重点装备编码"
)
private
String
equipmentSpecificCode
;
@Label
(
"重点装备ID"
)
private
Long
equipmentSpecificId
;
@Label
(
"物联编码"
)
private
String
iotCode
;
@Label
(
"物联指标KEY"
)
private
String
equipmentIndexKey
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ImpAndFireEquipMapper.java
View file @
de1edd17
...
@@ -45,4 +45,5 @@ public interface ImpAndFireEquipMapper extends BaseMapper {
...
@@ -45,4 +45,5 @@ public interface ImpAndFireEquipMapper extends BaseMapper {
EquipmentSpecificIndexVo
findFireEqupmentByCode
(
String
code
);
EquipmentSpecificIndexVo
findFireEqupmentByCode
(
String
code
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
View file @
de1edd17
...
@@ -54,4 +54,7 @@ public interface PlanDetailMapper {
...
@@ -54,4 +54,7 @@ public interface PlanDetailMapper {
Integer
planReset
(
@Param
(
"date"
)
Date
date
);
Integer
planReset
(
@Param
(
"date"
)
Date
date
);
List
<
PlanDetailSyncBo
>
getPlanDetailSyncBoList
(
Map
<
String
,
Object
>
map
);
List
<
PlanDetailSyncBo
>
getPlanDetailSyncBoList
(
Map
<
String
,
Object
>
map
);
String
queryBatchNoByFireEquipmentId
(
@Param
(
"fireEquipmentId"
)
String
fireEquipmentId
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanDetailDao.java
View file @
de1edd17
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.PlanDetail
;
import
com.yeejoin.amos.fas.dao.entity.PlanDetail
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -22,4 +24,5 @@ public interface IPlanDetailDao extends BaseDao<PlanDetail, Long> {
...
@@ -22,4 +24,5 @@ public interface IPlanDetailDao extends BaseDao<PlanDetail, Long> {
List
<
PlanDetail
>
getPlanDetailsByIdInAndIsDelete
(
List
<
Long
>
idList
,
Boolean
isDelete
);
List
<
PlanDetail
>
getPlanDetailsByIdInAndIsDelete
(
List
<
Long
>
idList
,
Boolean
isDelete
);
boolean
existsByClassifyIdInAndIsDelete
(
Collection
<
Long
>
classifyList
,
Boolean
isDelete
);
boolean
existsByClassifyIdInAndIsDelete
(
Collection
<
Long
>
classifyList
,
Boolean
isDelete
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java
View file @
de1edd17
...
@@ -6,6 +6,7 @@ import com.google.common.collect.Lists;
...
@@ -6,6 +6,7 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Sets
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.DeviceRo
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe
;
import
com.yeejoin.amos.fas.business.bo.SafetyExecuteBo
;
import
com.yeejoin.amos.fas.business.bo.SafetyExecuteBo
;
...
@@ -74,6 +75,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
...
@@ -74,6 +75,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Value
(
"${integrated3Dtype}"
)
@Value
(
"${integrated3Dtype}"
)
private
String
integrated3Dtype
;
private
String
integrated3Dtype
;
@Value
(
"${plan.dynamic.execut.topic}"
)
private
String
planDynamicExecutTopic
;
@Autowired
@Autowired
private
WebMqttComponent
webMqttComponent
;
private
WebMqttComponent
webMqttComponent
;
...
@@ -277,9 +281,35 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
...
@@ -277,9 +281,35 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
String
title
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"data/refresh/monitorData"
);
String
title
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"data/refresh/monitorData"
);
webMqttComponent
.
publish
(
title
,
JSON
.
toJSONString
(
view3dService
.
getEquipStatusList
(
equipmentSpecific
.
getOrgCode
())));
webMqttComponent
.
publish
(
title
,
JSON
.
toJSONString
(
view3dService
.
getEquipStatusList
(
equipmentSpecific
.
getOrgCode
())));
}
}
DeviceRo
deviceRo
=
new
DeviceRo
();
// Equipment equipment1 = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(eqSpecId);
// deviceRo.setEquipmentCode(equipment1.getCode());
// deviceRo.setEquipmentId(equipment1.getId());
deviceRo
.
setEquipmentSpecificId
(
equipmentSpecific
.
getId
());
deviceRo
.
setEquipmentSpecificCode
(
equipmentSpecific
.
getCode
());
deviceRo
.
setIotCode
(
equipmentSpecific
.
getIotCode
());
deviceRo
.
setValue
(
equipmentSpecificIndex
.
getValue
());
deviceRo
.
setEquipmentIndexKey
(
equipmentSpecificIndex
.
getNameKey
());
planAutoExec
(
equipment
,
toke
,
deviceRo
);
}
}
@Async
/**
* 触发规则(用来)动态执行规则步骤
* @param equipment
* @param toke
* @param deviceRo
*/
private
void
planAutoExec
(
Equipment
equipment
,
Toke
toke
,
DeviceRo
deviceRo
)
{
try
{
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
ruleTrigger
.
publish
(
deviceRo
,
planDynamicExecutTopic
,
new
String
[]
{});
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Async
public
void
sendWaterLevel
(
FormInstanceVo
formInstanceVo
)
{
public
void
sendWaterLevel
(
FormInstanceVo
formInstanceVo
)
{
try
{
try
{
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"analogue"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"analogue"
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RuleRunigSnapshotServiceImpl.java
View file @
de1edd17
...
@@ -131,6 +131,9 @@ public class RuleRunigSnapshotServiceImpl
...
@@ -131,6 +131,9 @@ public class RuleRunigSnapshotServiceImpl
}
else
{
}
else
{
batchNo
=
(
String
)
redisTemplate
.
opsForValue
().
get
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
batchNo
=
(
String
)
redisTemplate
.
opsForValue
().
get
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
}
}
if
(
ObjectUtils
.
isEmpty
(
batchNo
))
{
return
;
}
RuleRuningSnapshot
ruleRuningSnapshot
=
new
RuleRuningSnapshot
();
RuleRuningSnapshot
ruleRuningSnapshot
=
new
RuleRuningSnapshot
();
ruleRuningSnapshot
.
setId
(
UUID
.
randomUUID
().
toString
());
ruleRuningSnapshot
.
setId
(
UUID
.
randomUUID
().
toString
());
ruleRuningSnapshot
.
setMethodClass
(
"com.yeejoin.amos.fas.business.action.ContingencyAction"
);
ruleRuningSnapshot
.
setMethodClass
(
"com.yeejoin.amos.fas.business.action.ContingencyAction"
);
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
de1edd17
...
@@ -80,3 +80,5 @@ integrated3Dtype =web
...
@@ -80,3 +80,5 @@ integrated3Dtype =web
#数据同步开关
#数据同步开关
systemctl.sync.switch
=
true
systemctl.sync.switch
=
true
plan.dynamic.execut.topic
=
\u6362\u
6D41
\u
7AD9
\u
6D88
\u9632\u
4E13
\u9879\u9884\u6848
/autoExec
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanDetailMapper.xml
View file @
de1edd17
...
@@ -161,4 +161,20 @@
...
@@ -161,4 +161,20 @@
</if>
</if>
</where>
</where>
</select>
</select>
<select
id=
"queryBatchNoByFireEquipmentId"
resultType=
"String"
>
SELECT
p.batch_no
FROM
f_equipment_fire_equipment fe
RIGHT JOIN f_equipment e ON fe.equipment_id = e.id
RIGHT JOIN c_plan_operation_record p ON e.id = p.fire_equipment_id
WHERE
fe.fire_equipment_id = #{fireEquipmentId}
AND p.end_time is null
AND p.`status` = 0
ORDER BY p.start_time desc
limit 0, 1
</select>
</mapper>
</mapper>
\ No newline at end of file
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