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
42f8ab70
Commit
42f8ab70
authored
Jan 20, 2021
by
吴俊凯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预案启动暂时提交
parent
e914a731
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
228 additions
and
66 deletions
+228
-66
ExecutionTypeEnum.java
.../com/yeejoin/amos/fas/common/enums/ExecutionTypeEnum.java
+52
-0
PlanOperationRecord.java
.../com/yeejoin/amos/fas/dao/entity/PlanOperationRecord.java
+27
-3
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+37
-14
RiskSourceController.java
...in/amos/fas/business/controller/RiskSourceController.java
+1
-1
ImpAndFireEquipMapper.java
...n/amos/fas/business/dao/mapper/ImpAndFireEquipMapper.java
+3
-3
IEquipmentFireEquipmentDao.java
...s/business/dao/repository/IEquipmentFireEquipmentDao.java
+5
-4
IPlanEquipmentDao.java
...n/amos/fas/business/dao/repository/IPlanEquipmentDao.java
+2
-0
IPlanOperationRecordDao.java
.../fas/business/dao/repository/IPlanOperationRecordDao.java
+4
-0
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+0
-0
HandlerMqttMessageImpl.java
...mos/fas/business/service/impl/HandlerMqttMessageImpl.java
+20
-28
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+1
-6
IContingencyPlanService.java
...s/fas/business/service/intfc/IContingencyPlanService.java
+9
-2
IEquipmentHandlerService.java
.../fas/business/service/intfc/IEquipmentHandlerService.java
+6
-1
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+1
-1
ContingencyPlanParamVo.java
.../yeejoin/amos/fas/business/vo/ContingencyPlanParamVo.java
+27
-0
ContingencyPlanResponseVo.java
...ejoin/amos/fas/business/vo/ContingencyPlanResponseVo.java
+27
-0
TopicEntityVo.java
.../java/com/yeejoin/amos/fas/business/vo/TopicEntityVo.java
+1
-1
ReserveEnum.java
...ain/java/com/yeejoin/amos/fas/core/enums/ReserveEnum.java
+5
-2
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/ExecutionTypeEnum.java
0 → 100644
View file @
42f8ab70
package
com
.
yeejoin
.
amos
.
fas
.
common
.
enums
;
/**
* @author wjk
*/
public
enum
ExecutionTypeEnum
{
PLANCHECK
(
"预案验证"
,
0
),
FIREMANAGEMENT
(
"火灾处置"
,
1
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
Integer
code
;
private
ExecutionTypeEnum
(
String
name
,
Integer
code
){
this
.
name
=
name
;
this
.
code
=
code
;
}
public
static
ExecutionTypeEnum
getEnum
(
Integer
code
)
{
ExecutionTypeEnum
checkStatusEnum
=
null
;
for
(
ExecutionTypeEnum
type:
ExecutionTypeEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
checkStatusEnum
=
type
;
break
;
}
}
return
checkStatusEnum
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanOperationRecord.java
View file @
42f8ab70
...
...
@@ -6,12 +6,11 @@ import javax.persistence.Column;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* c_plan_operation_record
* @author
* @author
*/
@Data
@Entity
...
...
@@ -59,6 +58,30 @@ public class PlanOperationRecord extends BasicEntity {
* 运行状态(0、运行中,1、完毕,3、中断)
*/
private
Integer
status
;
/**
* 启动人名称
*/
@Column
(
name
=
"start_user_name"
)
private
String
startUserName
;
/**
* 启动人id
*/
@Column
(
name
=
"strat_user_id"
)
private
String
startUserId
;
/**
* 装备code
*/
@Column
(
name
=
"equipment_code"
)
private
String
equipmentCode
;
/**
* 执行方式(0、预案验证 1、火灾处置)
*/
@Column
(
name
=
"execution_type"
)
private
Integer
executionType
;
/**
* 装备名称
*/
@Column
(
name
=
"equipment_name"
)
private
String
equipmentName
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
42f8ab70
...
...
@@ -2,23 +2,20 @@ package com.yeejoin.amos.fas.business.controller;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyPlanService
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanParamVo
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil2
;
import
com.yeejoin.amos.fas.core.util.ResponseModel
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
@RestController
@RequestMapping
(
"/api/contingencyPlan"
)
...
...
@@ -160,15 +157,27 @@ public class ContingencyPlanController extends BaseController {
@ApiOperation
(
value
=
"启动"
)
@RequestMapping
(
value
=
"/start"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
start
(
@RequestBody
ContingencyPlanParamVo
vo
)
{
contingencyPlanService
.
planStart
(
vo
);
return
CommonResponseUtil2
.
success
();
Toke
toke
=
new
Toke
();
toke
.
setAppKey
(
getAppKey
());
toke
.
setProduct
(
getProduct
());
toke
.
setToke
(
getToken
());
AgencyUserModel
user
=
getUserInfo
();
vo
.
setUserId
(
user
.
getUserId
());
vo
.
setUserName
(
user
.
getUserName
());
ContingencyPlanResponseVo
result
=
contingencyPlanService
.
planStart
(
vo
,
toke
);
return
CommonResponseUtil2
.
success
(
result
);
}
@ApiOperation
(
value
=
"装备确景"
)
@RequestMapping
(
value
=
"/scene"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
scene
(
@ApiParam
(
value
=
"装备Id"
,
required
=
true
)
String
equipmentId
)
{
ContingencyPlanParamVo
vo
=
contingencyPlanService
.
equipmentScene
(
Long
.
parseLong
(
equipmentId
));
return
CommonResponseUtil2
.
success
(
vo
);
@RequestMapping
(
value
=
"/scene"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
scene
(
@ApiParam
(
value
=
"装备Id"
,
required
=
true
)
String
equipmentId
,
@ApiParam
(
value
=
"告警类型"
,
required
=
true
)
String
riskType
)
{
ContingencyPlanParamVo
vo
=
contingencyPlanService
.
equipmentScene
(
Long
.
parseLong
(
equipmentId
),
riskType
);
if
(
vo
==
null
){
return
CommonResponseUtil2
.
success
(
vo
,
"该装备没有预案"
);
}
else
{
return
CommonResponseUtil2
.
success
(
vo
,
"该装备可以启动预案"
);
}
}
@ApiOperation
(
value
=
"预案启动记录分页列表"
)
...
...
@@ -176,8 +185,22 @@ public class ContingencyPlanController extends BaseController {
public
ResponseModel
recordList
(
@RequestParam
int
current
,
@RequestParam
int
pageSize
,
@
ApiParam
(
value
=
"预案名称"
)
@
RequestParam
(
required
=
false
)
String
planName
)
{
@RequestParam
(
required
=
false
)
String
planName
)
{
Page
page
=
contingencyPlanService
.
recordListByPage
(
current
,
pageSize
,
planName
);
return
CommonResponseUtil2
.
success
(
page
);
}
@ApiOperation
(
value
=
"第一次查看预案记录"
)
@RequestMapping
(
value
=
"/frist/getRecord/{batchNo}"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
firstGetRecord
(
@PathVariable
(
value
=
"batchNo"
)
String
batchNo
)
{
Map
<
String
,
Object
>
map
=
contingencyPlanService
.
firstGetRecord
(
batchNo
);
return
CommonResponseUtil2
.
success
(
map
);
}
@ApiOperation
(
value
=
"查看预案记录列表"
)
@RequestMapping
(
value
=
"/getRecordList/{batchNo}"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
getRecordList
(
@PathVariable
(
value
=
"batchNo"
)
String
batchNo
)
{
List
<
HashMap
<
String
,
Object
>>
List
=
contingencyPlanService
.
getRecordList
(
batchNo
);
return
CommonResponseUtil2
.
success
(
List
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskSourceController.java
View file @
42f8ab70
...
...
@@ -625,7 +625,7 @@ public class RiskSourceController extends BaseController {
@RequestMapping
(
value
=
"/startEquipReserve"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
startEquipReserve
(
@RequestParam
Long
id
,
@RequestParam
String
typeCode
)
{
ReserveEnum
reserveEnum
=
riskSourceService
.
startEquipReserve
(
id
,
typeCode
,
null
);
ReserveEnum
reserveEnum
=
riskSourceService
.
startEquipReserve
(
id
,
typeCode
);
Integer
status
=
reserveEnum
.
getStatus
();
String
text
=
reserveEnum
.
getText
();
if
(
status
==
1
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ImpAndFireEquipMapper.java
View file @
42f8ab70
...
...
@@ -36,13 +36,13 @@ public interface ImpAndFireEquipMapper extends BaseMapper {
* @param equipmentId
* @return
*/
Map
queryCamera
(
@Param
(
"equipmentId"
)
String
equipmentId
);
Map
<
String
,
Object
>
queryCamera
(
@Param
(
"equipmentId"
)
String
equipmentId
);
List
<
Map
<
String
,
Object
>>
findEquipVideo
();
public
Boolean
existsAlarmPointByEqpPointIdAndEquipId
(
@Param
(
"pointId"
)
long
pointId
,
@Param
(
"equipmentId"
)
long
equipmentId
);
// Boolean containGroupedPoint(long id);
EquipmentSpecificIndexVo
findFireEqupmentByCode
(
String
code
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IEquipmentFireEquipmentDao.java
View file @
42f8ab70
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
org.springframework.data.jpa.repository.Modifying
;
import
java.util.List
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Repository
public
interface
IEquipmentFireEquipmentDao
extends
BaseDao
<
EquipmentFireEquipment
,
Long
>
{
...
...
@@ -21,9 +20,11 @@ public interface IEquipmentFireEquipmentDao extends BaseDao<EquipmentFireEquipme
*/
@Query
(
value
=
"select count(1) from f_equipment_fire_equipment WHERE equipment_id = ?1 and fire_equipment_id = ?2"
,
nativeQuery
=
true
)
int
findByEqmtIdAndFireEqmtId
(
Long
equipmentId
,
Long
fireEquipmentId
);
List
<
EquipmentFireEquipment
>
findAllByEquipmentId
(
Long
equipmentId
);
List
<
EquipmentFireEquipment
>
findAllByFireEquipmentId
(
Long
fireEquipmentId
);
@Query
(
value
=
"SELECT count(1) FROM `f_equipment_fire_equipment` WHERE fire_equipment_id in ?1"
,
nativeQuery
=
true
)
int
countImpEquipByIds
(
String
[]
ids
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanEquipmentDao.java
View file @
42f8ab70
...
...
@@ -21,5 +21,7 @@ public interface IPlanEquipmentDao extends BaseDao<PlanEquipment, Long> {
List
<
PlanEquipment
>
getPlanDocsByPlanId
(
Long
planId
);
List
<
PlanEquipment
>
findByPlanId
(
Long
planId
);
List
<
PlanEquipment
>
findAllByIsDelete
(
Boolean
isDelete
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanOperationRecordDao.java
View file @
42f8ab70
...
...
@@ -4,6 +4,8 @@ import com.yeejoin.amos.fas.dao.entity.PlanOperationRecord;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* <h1><h1>
*
...
...
@@ -14,4 +16,6 @@ import org.springframework.stereotype.Repository;
public
interface
IPlanOperationRecordDao
extends
BaseDao
<
PlanOperationRecord
,
Long
>
{
@Query
(
value
=
"SELECT * from c_plan_operation_record where batch_no = ?1 AND is_delete = 0 "
,
nativeQuery
=
true
)
PlanOperationRecord
findByBatchNo
(
String
batchNo
);
@Query
(
value
=
"SELECT * from c_plan_operation_record where plan_id = ?1 AND is_delete = 0 AND status = 0 ORDER BY create_date DESC"
,
nativeQuery
=
true
)
List
<
PlanOperationRecord
>
findByPlanId
(
Long
planId
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
42f8ab70
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java
View file @
42f8ab70
...
...
@@ -39,7 +39,6 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.*
;
...
...
@@ -268,8 +267,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
* @Author keyong
* @Date 2020/11/11 20:46
*/
@Async
void
executeDynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Toke
toke
,
String
recordId
)
{
// @Async
@Override
public
String
executeDynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Toke
toke
,
Long
recordId
)
{
String
batchNo
=
UUID
.
randomUUID
().
toString
();
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
...
...
@@ -278,10 +278,11 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
batchNo
;
}
public
void
alarmContingency
(
String
batchNo
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Equipment
equipment
,
Stri
ng
recordId
)
throws
Exception
{
Object
oldContingencyRo
=
redisTemplate
.
opsForValue
().
get
(
"contingencyRo"
);
public
void
alarmContingency
(
String
batchNo
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Equipment
equipment
,
Lo
ng
recordId
)
throws
Exception
{
//
Object oldContingencyRo = redisTemplate.opsForValue().get("contingencyRo");
ContingencyRo
contingencyRo
=
new
ContingencyRo
();
contingencyRo
.
setBatchNo
(
batchNo
);
contingencyRo
.
setEquipmentId
(
String
.
valueOf
(
equipment
.
getId
()));
...
...
@@ -297,7 +298,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
contingencyRo
.
setEquipmentOrgCode
(
equipment
.
getOrgCode
());
//查询重点设备关联视频点位
Map
cameraInfo
=
impAndFireEquipMapper
.
queryCamera
(
String
.
valueOf
(
equipment
.
getId
()));
Map
<
String
,
Object
>
cameraInfo
=
impAndFireEquipMapper
.
queryCamera
(
String
.
valueOf
(
equipment
.
getId
()));
if
(
cameraInfo
!=
null
&&
!
cameraInfo
.
isEmpty
())
{
contingencyRo
.
setCameraCodes
(
String
.
valueOf
(
cameraInfo
.
get
(
"codes"
)));
contingencyRo
.
setCameraIds
(
String
.
valueOf
(
cameraInfo
.
get
(
"ids"
)));
...
...
@@ -329,19 +330,19 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
}
// 获取遥信指标,暂不处理 code = 设备编码iot_code-指标项name_key
List
<
Map
>
points
=
fireEquipPointMapper
.
getPointsByEquipmentIdAndType
(
equipment
.
getId
(),
"SWITCH"
);
//物联属性指标 and 为true或false
HashMap
<
String
,
Integer
>
telesignallingMap
=
new
HashMap
<>();
for
(
Map
map
:
points
)
{
telesignallingMap
.
put
(
map
.
get
(
"code"
)
+
""
,
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"value"
))
||
"false"
.
equals
(
map
.
get
(
"value"
).
toString
()))
?
0
:
1
);
}
contingencyRo
.
setTelesignallingMap
(
telesignallingMap
);
// 获取遥测指标
points
=
fireEquipPointMapper
.
getPointsByEquipmentIdAndType
(
equipment
.
getId
(),
"ANALOGUE"
);
//物联指标 非 true false
HashMap
<
String
,
Double
>
telemetryMap
=
new
HashMap
<>();
for
(
Map
map
:
points
)
{
telemetryMap
.
put
(
map
.
get
(
"code"
)
+
""
,
Double
.
valueOf
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"value"
))
?
"0"
:
map
.
get
(
"value"
).
toString
()));
}
contingencyRo
.
setTelemetryMap
(
telemetryMap
);
//
List<Map> points = fireEquipPointMapper.getPointsByEquipmentIdAndType(equipment.getId(), "SWITCH");//物联属性指标 and 为true或false
//
HashMap<String, Integer> telesignallingMap = new HashMap<>();
//
for (Map map : points) {
//
telesignallingMap.put(map.get("code") + "", (ObjectUtils.isEmpty(map.get("value")) || "false".equals(map.get("value").toString())) ? 0 : 1);
//
}
//
contingencyRo.setTelesignallingMap(telesignallingMap);
//
// 获取遥测指标
//
points = fireEquipPointMapper.getPointsByEquipmentIdAndType(equipment.getId(), "ANALOGUE"); //物联指标 非 true false
//
HashMap<String, Double> telemetryMap = new HashMap<>();
//
for (Map map : points) {
//
telemetryMap.put(map.get("code") + "", Double.valueOf(ObjectUtils.isEmpty(map.get("value")) ? "0" : map.get("value").toString()));
//
}
//
contingencyRo.setTelemetryMap(telemetryMap);
log
.
debug
(
"开始调用规则"
);
Object
result
=
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
...
...
@@ -350,14 +351,5 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
//更新预案执行记录表的批次号
Optional
<
PlanOperationRecord
>
opt
=
planOperationRecordDao
.
findById
(
Long
.
valueOf
(
recordId
));
PlanOperationRecord
planOperationRecord
=
null
;
if
(
opt
.
get
()!=
null
){
planOperationRecord
=
opt
.
get
();
planOperationRecord
.
setBatchNo
(
contingencyOriginalData
.
getBatchNo
());
planOperationRecordDao
.
save
(
opt
.
get
());
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
42f8ab70
...
...
@@ -950,7 +950,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@Transactional
public
ReserveEnum
startEquipReserve
(
Long
id
,
String
typeCode
,
Long
recordId
)
{
public
ReserveEnum
startEquipReserve
(
Long
id
,
String
typeCode
)
{
int
count
=
equipmentService
.
countByStatus
(
NumberEnum
.
ONE
.
getValue
());
...
...
@@ -965,14 +965,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
TopicEntityVo
topicEntity
=
new
TopicEntityVo
();
topicEntity
.
setMessage
(
JSON
.
toJSONString
(
equipmentSpecificIndexVo
));
if
(
recordId
!=
null
){
topicEntity
.
setRecordId
(
Long
.
valueOf
(
recordId
).
toString
());
}
String
data
=
JSON
.
toJSONString
(
topicEntity
);
System
.
out
.
println
(
data
);
iEquipmentHandlerService
.
handlerMqttMessage
(
""
,
data
);
Equipment
equipment
=
equipmentService
.
queryOne
(
id
);
if
(
equipment
!=
null
)
{
equipment
.
setStartTime
(
DateUtil
.
getDateNow
());
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyPlanService.java
View file @
42f8ab70
...
...
@@ -2,12 +2,15 @@ package com.yeejoin.amos.fas.business.service.intfc;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanParamVo
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanResponseVo
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.dao.entity.PlanDetail
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -22,9 +25,9 @@ public interface IContingencyPlanService {
String
DELETE_SYNC_PLAN_RULE
=
"DELETE_SYNC_PLAN_RULE"
;
String
DELETE_SYNC_PLAN_EQUIP
=
"DELETE_SYNC_PLAN_EQUIP"
;
String
planStart
(
ContingencyPlanParamVo
vo
);
ContingencyPlanResponseVo
planStart
(
ContingencyPlanParamVo
vo
,
Toke
toke
);
ContingencyPlanParamVo
equipmentScene
(
Long
equipmentId
);
ContingencyPlanParamVo
equipmentScene
(
Long
equipmentId
,
String
riskType
);
Page
recordListByPage
(
int
current
,
int
pageSize
,
String
planName
);
/**
...
...
@@ -107,4 +110,8 @@ public interface IContingencyPlanService {
* 监听文档取消发布/规则、装备删除动态
*/
void
subscribeTopic
();
Map
<
String
,
Object
>
firstGetRecord
(
String
batchNo
);
List
<
HashMap
<
String
,
Object
>>
getRecordList
(
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEquipmentHandlerService.java
View file @
42f8ab70
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.business.param.AlarmParam
;
import
com.yeejoin.amos.fas.business.vo.EquipmentSpecificForRiskVo
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
/**
* @author keyong
...
...
@@ -16,4 +19,6 @@ public interface IEquipmentHandlerService {
// void subscribeTopic(ReginParams reginParams);
void
subscribeTopic
();
String
executeDynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Toke
toke
,
Long
recordId
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
42f8ab70
...
...
@@ -213,5 +213,5 @@ public interface IRiskSourceService {
*/
Boolean
removeBind
(
Long
instanceId
);
ReserveEnum
startEquipReserve
(
Long
id
,
String
typeCode
,
Long
recordId
);
ReserveEnum
startEquipReserve
(
Long
id
,
String
typeCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/ContingencyPlanParamVo.java
View file @
42f8ab70
...
...
@@ -8,6 +8,9 @@ public class ContingencyPlanParamVo {
public
Integer
status
;
public
String
riskType
;
public
String
userName
;
public
String
userId
;
public
String
getPlanId
()
{
return
planId
;
}
...
...
@@ -23,5 +26,29 @@ public class ContingencyPlanParamVo {
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
String
getRiskType
()
{
return
riskType
;
}
public
void
setRiskType
(
String
riskType
)
{
this
.
riskType
=
riskType
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/ContingencyPlanResponseVo.java
0 → 100644
View file @
42f8ab70
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
//请求参数
public
class
ContingencyPlanResponseVo
{
public
String
batchNo
;
public
String
message
;
public
String
getBatchNo
()
{
return
batchNo
;
}
public
void
setBatchNo
(
String
batchNo
)
{
this
.
batchNo
=
batchNo
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/TopicEntityVo.java
View file @
42f8ab70
...
...
@@ -23,5 +23,5 @@ public class TopicEntityVo {
private
String
type
;
private
Stri
ng
recordId
;
private
Lo
ng
recordId
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/enums/ReserveEnum.java
View file @
42f8ab70
...
...
@@ -13,8 +13,11 @@ public enum ReserveEnum {
RUN
(
1
,
"启动成功"
),
RUNNING
(
2
,
"已有预案正在启动"
),
NOFIRE
(
3
,
"该电力设备未安装火灾探测器"
),
NOEQUIP
(
4
,
"未找到该电力设备"
);
NOEQUIP
(
4
,
"未找到该电力设备"
),
NOFIRENOPLAN
(
5
,
"非火灾告警没有预案"
),
PLANSTATUSERROR
(
6
,
"预案启动状态不正确"
),
NOPLAN
(
7
,
"预案模型未绑定预案"
),
THISRUNNING
(
8
,
"此预案正在启动中"
);
private
Integer
status
;
private
String
text
;
...
...
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