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
5eb576ec
Commit
5eb576ec
authored
Oct 15, 2024
by
maoying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
双预案修改
parent
8ba5d81b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
362 additions
and
73 deletions
+362
-73
ContingencyInstanceInfo.java
.../yeejoin/amos/fas/dao/entity/ContingencyInstanceInfo.java
+2
-0
ContingencyOriginalData.java
.../yeejoin/amos/fas/dao/entity/ContingencyOriginalData.java
+12
-1
ContingencyPlanInstance.java
.../yeejoin/amos/fas/dao/entity/ContingencyPlanInstance.java
+14
-0
Equipment.java
.../main/java/com/yeejoin/amos/fas/dao/entity/Equipment.java
+40
-0
PlanDetail.java
...main/java/com/yeejoin/amos/fas/dao/entity/PlanDetail.java
+13
-1
PlanOperationRecord.java
.../com/yeejoin/amos/fas/dao/entity/PlanOperationRecord.java
+8
-0
PlanRule.java
...c/main/java/com/yeejoin/amos/fas/dao/entity/PlanRule.java
+8
-0
BubbleTipAction.java
...com/yeejoin/amos/fas/business/action/BubbleTipAction.java
+6
-0
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+0
-0
CustomerAction.java
.../com/yeejoin/amos/fas/business/action/CustomerAction.java
+5
-0
RiskSituationAction.java
...yeejoin/amos/fas/business/action/RiskSituationAction.java
+6
-0
SimpleTipAction.java
...com/yeejoin/amos/fas/business/action/SimpleTipAction.java
+6
-0
ContingencyRo.java
...yeejoin/amos/fas/business/action/model/ContingencyRo.java
+4
-0
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+3
-2
EmergencyTaskController.java
...amos/fas/business/controller/EmergencyTaskController.java
+1
-1
TimeLineController.java
...join/amos/fas/business/controller/TimeLineController.java
+26
-7
PlanDetailMapper.java
...eejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
+5
-0
IPlanDetailDao.java
...join/amos/fas/business/dao/repository/IPlanDetailDao.java
+3
-0
IPlanOperationRecordDao.java
.../fas/business/dao/repository/IPlanOperationRecordDao.java
+4
-0
BizContingencyHandler.java
...eejoin/amos/fas/business/event/BizContingencyHandler.java
+16
-13
FireContingencyHandler.java
...ejoin/amos/fas/business/event/FireContingencyHandler.java
+12
-34
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+0
-0
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+0
-0
EmergencyTaskServiceImpl.java
...s/fas/business/service/impl/EmergencyTaskServiceImpl.java
+3
-2
HandlerMqttMessageImpl.java
...mos/fas/business/service/impl/HandlerMqttMessageImpl.java
+4
-3
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+0
-0
IContingencyInstance.java
...amos/fas/business/service/intfc/IContingencyInstance.java
+9
-5
IContingencyPlanService.java
...s/fas/business/service/intfc/IContingencyPlanService.java
+1
-1
IEmergencyTaskService.java
...mos/fas/business/service/intfc/IEmergencyTaskService.java
+1
-1
IEquipmentHandlerService.java
.../fas/business/service/intfc/IEquipmentHandlerService.java
+1
-1
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+1
-1
ToipResponse.java
...yeejoin/amos/fas/business/service/model/ToipResponse.java
+3
-0
ContingencyPlanParamVo.java
.../yeejoin/amos/fas/business/vo/ContingencyPlanParamVo.java
+2
-0
PlanExecuteVo.java
.../java/com/yeejoin/amos/fas/business/vo/PlanExecuteVo.java
+1
-0
fas-2.0.1.xml
...utoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
+108
-0
PlanDetailMapper.xml
...ysStart/src/main/resources/db/mapper/PlanDetailMapper.xml
+34
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/ContingencyInstanceInfo.java
View file @
5eb576ec
...
...
@@ -45,6 +45,8 @@ public class ContingencyInstanceInfo extends Model<ContingencyInstanceInfo>{
@TableField
private
String
duration
;
private
String
planRuleNo
;
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/ContingencyOriginalData.java
View file @
5eb576ec
...
...
@@ -99,6 +99,9 @@ public class ContingencyOriginalData extends BusinessEntity {
@Column
(
name
=
"equipment_code"
)
private
String
equipmentCode
;
@Column
(
name
=
"plan_rule_no"
)
private
String
planRuleNo
;
/**
* 位置
...
...
@@ -107,7 +110,15 @@ public class ContingencyOriginalData extends BusinessEntity {
private
String
position
;
public
String
getPosition
()
{
public
String
getPlanRuleNo
()
{
return
planRuleNo
;
}
public
void
setPlanRuleNo
(
String
planRuleNo
)
{
this
.
planRuleNo
=
planRuleNo
;
}
public
String
getPosition
()
{
return
position
;
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/ContingencyPlanInstance.java
View file @
5eb576ec
...
...
@@ -84,6 +84,12 @@ public class ContingencyPlanInstance extends BusinessEntity{
@Column
(
name
=
"step_code"
)
private
String
stepCode
;
/**
* 当前预案执行的序号
*/
@Column
(
name
=
"plan_rule_no"
)
private
String
planRuleNo
;
public
void
setTaskSort
(
Integer
taskSort
)
{
this
.
taskSort
=
taskSort
;
...
...
@@ -238,4 +244,12 @@ public class ContingencyPlanInstance extends BusinessEntity{
public
void
setBatchNo
(
String
batchNo
)
{
this
.
batchNo
=
batchNo
;
}
public
String
getPlanRuleNo
()
{
return
planRuleNo
;
}
public
void
setPlanRuleNo
(
String
planRuleNo
)
{
this
.
planRuleNo
=
planRuleNo
;
}
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/Equipment.java
View file @
5eb576ec
...
...
@@ -149,6 +149,46 @@ public class Equipment extends BasicEntity {
*/
@Column
(
name
=
"reserve_source"
)
private
Integer
reserveSource
;
/**
* 第二个预案相关参数
*/
private
Integer
secStatus
;
/**
* 预案开始时间
*/
@Column
(
name
=
"sec_start_time"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
secStartTime
;
/**
* 预案结束时间
*/
@Column
(
name
=
"sec_end_time"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
secEndTime
;
/**
* 预案来源:1-手动触发,0-自动触发(默认)
*/
@Column
(
name
=
"sec_reserve_source"
)
private
Integer
secReserveSource
;
/**
* 当前设备预案执行的序号
*/
private
String
planRuleNo
;
@Transient
public
String
getPlanRuleNo
()
{
return
this
.
planRuleNo
;
}
public
void
setPlanRuleNo
(
String
planRuleNo
)
{
this
.
planRuleNo
=
planRuleNo
;
}
public
Equipment
()
{
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanDetail.java
View file @
5eb576ec
...
...
@@ -64,9 +64,14 @@ public class PlanDetail extends BasicEntity {
private
String
remark
;
/**
* 预案状态
*
第一个
预案状态
*/
private
Integer
status
;
/**
* 第二个预案状态
*/
private
Integer
secStatus
;
/**
* 创建人
...
...
@@ -102,5 +107,11 @@ public class PlanDetail extends BasicEntity {
@Column
(
name
=
"input_time"
)
private
Date
inputTime
;
/**
* 当前预案执行的序号
*/
@Column
(
name
=
"plan_rule_no"
)
private
String
planRuleNo
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanOperationRecord.java
View file @
5eb576ec
...
...
@@ -96,5 +96,12 @@ public class PlanOperationRecord extends BasicEntity {
*/
@Column
(
name
=
"fire_equipment_id"
)
private
Long
fireEquipmentId
;
/**
* 预案编号,默认为1,若一个设备有多个预案模型依次递增
*/
@Column
(
name
=
"plan_rule_no"
)
private
String
planRuleNo
=
"1"
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanRule.java
View file @
5eb576ec
...
...
@@ -26,6 +26,12 @@ public class PlanRule extends BasicEntity {
*/
@Column
(
name
=
"rule_id"
)
private
String
ruleId
;
/**
* 第二个规则ID
*/
@Column
(
name
=
"sec_rule_id"
)
private
String
secRuleId
;
/**
* 预案ID
...
...
@@ -56,6 +62,7 @@ public class PlanRule extends BasicEntity {
*/
@Column
(
name
=
"plan_step"
)
private
String
planStep
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/BubbleTipAction.java
View file @
5eb576ec
...
...
@@ -69,4 +69,10 @@ public class BubbleTipAction implements CustomerAction
public
void
intreeuptPlan
(
String
batchNo
)
{
}
@Override
public
void
secIntreeuptPlan
(
String
batchNo
)
{
// TODO Auto-generated method stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
5eb576ec
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/CustomerAction.java
View file @
5eb576ec
...
...
@@ -6,4 +6,9 @@ public interface CustomerAction {
*数字预案中断
*/
void
intreeuptPlan
(
String
batchNo
);
/**
*数字预案2中断
*/
void
secIntreeuptPlan
(
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/RiskSituationAction.java
View file @
5eb576ec
...
...
@@ -153,4 +153,10 @@ public class RiskSituationAction implements CustomerAction
public
void
intreeuptPlan
(
String
batchNo
)
{
}
@Override
public
void
secIntreeuptPlan
(
String
batchNo
)
{
// TODO Auto-generated method stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/SimpleTipAction.java
View file @
5eb576ec
...
...
@@ -88,6 +88,12 @@ public class SimpleTipAction implements CustomerAction
}
@Override
public
void
secIntreeuptPlan
(
String
batchNo
)
{
// TODO Auto-generated method stub
}
// @SuppressWarnings("unchecked")
// private void saveMessageAction(AbstractActionResult abstractActionResult,String type)
// {
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/model/ContingencyRo.java
View file @
5eb576ec
...
...
@@ -105,4 +105,8 @@ public class ContingencyRo implements Serializable {
@Label
(
"位置"
)
private
String
position
;
@Label
(
"预案序号"
)
private
String
planRuleNo
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
5eb576ec
...
...
@@ -91,14 +91,15 @@ public class ContingencyPlanController extends BaseController {
@RequestParam
(
value
=
"editOrgName"
,
required
=
false
)
String
editOrgName
,
@RequestParam
(
value
=
"implementationTimeLeft"
,
required
=
false
)
Long
implementationTimeLeftStamp
,
@RequestParam
(
value
=
"implementationTimeRight"
,
required
=
false
)
Long
implementationTimeRightStamp
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"planRuleNo"
,
required
=
false
)
String
planRuleNo
)
{
if
(
current
<
1
||
size
<
1
)
{
throw
new
YeeException
(
"分页参数有误"
);
}
Date
implementationTimeLeft
=
implementationTimeLeftStamp
==
null
?
null
:
new
Date
(
implementationTimeLeftStamp
);
Date
implementationTimeRight
=
implementationTimeRightStamp
==
null
?
null
:
new
Date
(
implementationTimeRightStamp
);
Page
page
=
new
Page
(
current
,
size
);
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
pageFilter
(
page
,
planName
,
classifyId
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
));
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
pageFilter
(
page
,
planName
,
classifyId
,
planRange
,
editOrgName
,
implementationTimeLeft
,
implementationTimeRight
,
planRuleNo
));
}
/**
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/EmergencyTaskController.java
View file @
5eb576ec
...
...
@@ -227,7 +227,7 @@ public class EmergencyTaskController extends BaseController{
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增流程任务"
,
notes
=
"新增流程任务"
)
@PostMapping
(
value
=
"/task/add"
,
produces
=
"application/json; charset=UTF-8"
)
public
CommonResponse
addTaskContent
(
@RequestBody
String
stepCode
){
iEmergencyTaskService
.
saveTask
(
stepCode
,
null
);
iEmergencyTaskService
.
saveTask
(
stepCode
,
null
,
null
);
return
CommonResponseUtil
.
success
();
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/TimeLineController.java
View file @
5eb576ec
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.yeejoin.amos.fas.business.action.CustomerAction
;
import
com.yeejoin.amos.fas.business.service.impl.RiskSourceServiceImpl
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
...
...
@@ -15,6 +16,7 @@ import com.yeejoin.amos.fas.core.enums.NumberEnum;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.DateUtil
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
...
...
@@ -49,6 +51,9 @@ public class TimeLineController extends BaseController {
@Autowired
IRuleRunningSnapshotService
iRuleRunningSnapshotService
;
@Autowired
IContingencyInstance
iContingencyInstanceImpl
;
@Autowired
IEquipmentService
equipmentService
;
...
...
@@ -72,9 +77,14 @@ public class TimeLineController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"点击按钮"
,
notes
=
"点击按钮"
)
@RequestMapping
(
value
=
"/fire"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
fire
(
@RequestBody
PlanExecuteVo
vo
)
throws
Exception
{
AgencyUserModel
userInfo
=
getUserInfo
();
ContingencyPlanInstance
instance
=
iContingencyInstanceImpl
.
getMessageById
(
vo
.
getContingencyPlanId
());
if
(
ObjectUtils
.
isEmpty
(
instance
)){
return
CommonResponseUtil
.
failure
(
"预案不存在"
);
}
AgencyUserModel
userInfo
=
getUserInfo
();
String
user
=
userInfo
.
getRealName
();
iContingencyInstance
.
fire
(
vo
.
getBatchNo
(),
vo
.
getStepCode
(),
vo
.
getButtonJson
(),
vo
.
getContingencyPlanId
(),
vo
.
getButtonCode
(),
vo
.
getConfirm
(),
vo
.
getStepState
(),
"true"
,
"false"
,
getToken
(),
getProduct
(),
getAppKey
(),
user
);
iContingencyInstance
.
fire
(
vo
.
getBatchNo
(),
vo
.
getStepCode
(),
vo
.
getButtonJson
(),
vo
.
getContingencyPlanId
(),
vo
.
getButtonCode
(),
vo
.
getConfirm
(),
vo
.
getStepState
()
,
"true"
,
"false"
,
getToken
(),
getProduct
(),
getAppKey
(),
user
,
instance
.
getPlanRuleNo
());
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
...
...
@@ -84,7 +94,8 @@ public class TimeLineController extends BaseController {
public
CommonResponse
clickButton
(
@RequestBody
PlanExecuteVo
vo
)
throws
Exception
{
AgencyUserModel
userInfo
=
getUserInfo
();
String
user
=
userInfo
.
getRealName
();
iContingencyInstance
.
clickButton
(
vo
.
getBatchNo
(),
vo
.
getStepCode
(),
vo
.
getButtonJson
(),
vo
.
getContingencyPlanId
(),
vo
.
getButtonCode
(),
vo
.
getConfirm
(),
vo
.
getStepState
(),
"true"
,
"false"
,
getToken
(),
getProduct
(),
getAppKey
(),
user
);
iContingencyInstance
.
clickButton
(
vo
.
getBatchNo
(),
vo
.
getStepCode
(),
vo
.
getButtonJson
(),
vo
.
getContingencyPlanId
()
,
vo
.
getButtonCode
(),
vo
.
getConfirm
(),
vo
.
getStepState
(),
"true"
,
"false"
,
getToken
(),
getProduct
(),
getAppKey
(),
user
);
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
...
...
@@ -102,10 +113,18 @@ public class TimeLineController extends BaseController {
Optional
<
Equipment
>
equipment
=
iContingencyInstance
.
fire
(
batchNo
,
stepCode
,
""
,
buttonCode
,
confirm
,
stepState
);
// 结束预案,更新设备重点设备参数
equipment
.
ifPresent
(
equip
->
{
equip
.
setStartTime
(
DateUtil
.
getDateNow
());
equip
.
setEndTime
(
null
);
equip
.
setReserveSource
(
NumberEnum
.
ONE
.
getValue
());
equip
.
setStatus
(
NumberEnum
.
ONE
.
getValue
());
if
(
"1"
.
equals
(
equip
.
getPlanRuleNo
())){
equip
.
setStartTime
(
DateUtil
.
getDateNow
());
equip
.
setEndTime
(
null
);
equip
.
setReserveSource
(
NumberEnum
.
ONE
.
getValue
());
equip
.
setStatus
(
NumberEnum
.
ONE
.
getValue
());
}
else
{
equip
.
setSecStartTime
(
DateUtil
.
getDateNow
());
equip
.
setSecEndTime
(
null
);
equip
.
setSecReserveSource
(
NumberEnum
.
ONE
.
getValue
());
equip
.
setSecStatus
(
NumberEnum
.
ONE
.
getValue
());
}
equipmentService
.
save
(
equip
);
});
customerAction
.
intreeuptPlan
(
batchNo
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
View file @
5eb576ec
...
...
@@ -47,6 +47,9 @@ public interface PlanDetailMapper {
List
<
PlanDetailVo
>
filterList
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
List
<
Long
>
classifyId
,
@Param
(
"planRange"
)
List
<
String
>
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
,
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
);
List
<
String
>
getRuleIdByEquipment
(
@Param
(
"id"
)
Long
id
);
List
<
String
>
getSecRuleIdByEquipment
(
@Param
(
"id"
)
Long
id
);
PlanDetailVo
getPlanDetailByEquipmentId
(
@Param
(
"fireEquipmentId"
)
Long
fireEquipmentId
);
...
...
@@ -57,6 +60,8 @@ public interface PlanDetailMapper {
String
queryBatchNoByFireEquipmentId
(
@Param
(
"fireEquipmentId"
)
String
fireEquipmentId
);
Map
<
String
,
String
>
queryBatchNoAndRuleNoByFireEquipmentId
(
@Param
(
"fireEquipmentId"
)
String
fireEquipmentId
);
PlanDetailVo
getPlanDetailById
(
@Param
(
"id"
)
String
id
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanDetailDao.java
View file @
5eb576ec
...
...
@@ -20,6 +20,9 @@ public interface IPlanDetailDao extends BaseDao<PlanDetail, Long> {
@Query
(
value
=
"SELECT * from c_plan_detail where status in (?1) AND is_delete = 0 "
,
nativeQuery
=
true
)
List
<
PlanDetail
>
findByStatus
(
Integer
[]
status
);
@Query
(
value
=
"SELECT * from c_plan_detail where sec_status in (?1) AND is_delete = 0 "
,
nativeQuery
=
true
)
List
<
PlanDetail
>
findBySecStatus
(
Integer
[]
status
);
List
<
PlanDetail
>
getPlanDetailsByIdInAndIsDelete
(
List
<
Long
>
idList
,
Boolean
isDelete
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanOperationRecordDao.java
View file @
5eb576ec
...
...
@@ -19,6 +19,10 @@ public interface IPlanOperationRecordDao extends BaseDao<PlanOperationRecord, Lo
@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
>
findByPlanId1
(
Long
planId
);
@Query
(
value
=
"SELECT * from c_plan_operation_record where is_delete = 0 AND status = 0 AND plan_id = ?1 AND plan_rule_no = ?2 ORDER BY create_date DESC"
,
nativeQuery
=
true
)
List
<
PlanOperationRecord
>
findByPlanIdAndPlanRuleNo
(
Long
planId
,
String
PlanRuleNo
);
int
countByPlanId
(
Long
planId
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/event/BizContingencyHandler.java
View file @
5eb576ec
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.event;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.action.ContingencyAction
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
...
...
@@ -16,6 +17,8 @@ import com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
...
@@ -39,7 +42,7 @@ import java.util.*;
@Component
public
class
BizContingencyHandler
implements
EventHandler
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
BizContingencyHandler
.
class
);
@Autowired
...
...
@@ -101,13 +104,8 @@ public class BizContingencyHandler implements EventHandler{
public
void
updateData
(
ContingecyExecEvent
event
)
throws
Exception
{
try
{
// fire(event.getPlanExecute().getBatchNo(),
// event.getPlanExecute().getStepCode(),
// event.getPlanExecute().getContingencyPlanId(),
// event.getPlanExecute().getButtonCode(),
// event.getPlanExecute().getConfirm(),
// event.getPlanExecute().getStepState());
log
.
info
(
String
.
format
(
"==BizContingencyHandler===fire====updateData==[%s]"
,
JSONObject
.
toJSONString
(
event
)));
// 更新redis中预案步骤数据
planVisual3dService
.
updatePlanStepToRedis
(
event
.
getPlanExecute
().
getBatchNo
(),
...
...
@@ -115,18 +113,21 @@ public class BizContingencyHandler implements EventHandler{
event
.
getPlanExecute
().
getButtonJson
(),
event
.
getPlanExecute
().
getContingencyPlanId
(),
event
.
getPlanExecute
().
getButtonCode
(),
event
.
getPlanExecute
().
getIsExecute
(),
event
.
getPlanExecute
().
getIsExecute
(),
event
.
getPlanExecute
().
getPlanRuleNo
(),
event
.
getPlanExecute
().
getIsAuto
());
setButtonExecuted
(
event
.
getPlanExecute
().
getBatchNo
(),
event
.
getPlanExecute
().
getContingencyPlanId
(),
event
.
getPlanExecute
().
getButtonCode
(),
event
.
getPlanExecute
().
getConfirm
(),
event
.
getPlanExecute
().
getPlanRuleNo
(),
RequestContext
.
getLoginId
());
log
.
info
(
"========BizContingencyHandler=======> updateData==PlanRuleNo===="
+
JSON
.
toJSONString
(
event
.
getPlanExecute
().
getPlanRuleNo
()).
toString
());
}
catch
(
Exception
e
)
{
throw
e
;
}
finally
{
// 更新记录之后发送消息刷新
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
(
"1"
.
equals
(
event
.
getPlanExecute
().
getPlanRuleNo
())?
"plan"
:
"secPlan"
)
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"contingency"
,
new
ContingencyRo
());
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
...
...
@@ -137,9 +138,10 @@ public class BizContingencyHandler implements EventHandler{
@Transactional
public
void
setButtonExecuted
(
String
batchNo
,
String
contingencyPlanId
,
String
code
,
String
buttonState
,
String
user
)
throws
Exception
{
public
void
setButtonExecuted
(
String
batchNo
,
String
contingencyPlanId
,
String
code
,
String
buttonState
,
String
planRuleNo
,
String
user
)
throws
Exception
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ContingencyPlanInstance
contingencyPlanInstance
=
contingencyInstance
.
getMessageById
(
contingencyPlanId
);
log
.
info
(
"===============setButtonExecuted=planRuleNo==,{}"
,
JSON
.
toJSONString
(
planRuleNo
));
if
(
contingencyPlanInstance
!=
null
)
{
if
(
"OPERATE"
.
equals
(
contingencyPlanInstance
.
getRecordType
()))
{
...
...
@@ -176,8 +178,9 @@ public class BizContingencyHandler implements EventHandler{
}
}
ContingencyPlanInstance
instance
=
repository
.
save
(
contingencyPlanInstance
);
if
(
buttonState
.
equals
(
"CONFIRM"
))
{
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
(
"1"
.
equals
(
planRuleNo
)?
"plan"
:
"secPlan"
)
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"contingency"
,
new
ContingencyRo
());
map
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
...
...
@@ -185,7 +188,7 @@ public class BizContingencyHandler implements EventHandler{
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
map
));
}
if
(
buttonState
.
equals
(
"CANCEL_0"
))
{
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
(
"1"
.
equals
(
planRuleNo
)?
"plan"
:
"secPlan"
)
);
System
.
out
.
println
(
"=========================> 规则触发 初始化动作 initOperate "
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"contingency"
,
new
ContingencyRo
());
...
...
@@ -215,7 +218,7 @@ public class BizContingencyHandler implements EventHandler{
planStep
=
planStepService
.
getPlanStep
();
}
JSONArray
objects
=
JSON
.
parseArray
(
planStep
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
(
"1"
.
equals
(
planRuleNo
)?
"plan"
:
"secPlan"
)
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"contingency"
,
new
ContingencyRo
());
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/event/FireContingencyHandler.java
View file @
5eb576ec
...
...
@@ -101,9 +101,11 @@ public class FireContingencyHandler implements EventHandler{
@Override
public
void
handler
(
ContingecyExecEvent
event
)
throws
Exception
{
/**
* TODO 只处理调用触发下次原,不错业务数据更新
*/
log
.
info
(
String
.
format
(
"=====FireContingencyHandler===ContingecyExecEvent==[%s]"
,
JSONObject
.
toJSONString
(
event
)));
fire
(
event
.
getPlanExecute
().
getBatchNo
(),
event
.
getPlanExecute
().
getStepCode
(),
event
.
getPlanExecute
().
getContingencyPlanId
(),
...
...
@@ -122,7 +124,8 @@ public class FireContingencyHandler implements EventHandler{
public
void
fire
(
String
batchNo
,
String
stepCode
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isAuto
)
throws
Exception
{
//火灾误报
ContingencyOriginalData
contingencyOriginalData
=
iContingencyOriginalDataDao
.
findByBatchNo
(
batchNo
);
log
.
info
(
String
.
format
(
"=====FireContingencyHandler===fire==[%s]"
,
JSONObject
.
toJSONString
(
contingencyOriginalData
)));
String
planRuleNo
=
contingencyOriginalData
.
getPlanRuleNo
();
String
stepKey
=
batchNo
+
"_"
+
stepCode
;
if
(
stepMap
.
get
(
stepKey
)
==
null
)
stepMap
.
put
(
stepKey
,
""
);
...
...
@@ -139,11 +142,7 @@ public class FireContingencyHandler implements EventHandler{
&&
stepCode
.
equals
(
contingencyOriginalData
.
getStep
()))
contingencyOriginalData
.
setStepState
(
contingencyOriginalData
.
getStepState
()
+
stepStateOnbutton
);
//请求中的步骤小于以保存的步骤
// if (Integer.parseInt(stepCode) < Integer.parseInt(contingencyOriginalData.getStep()) ) {
// contingencyOriginalData.setRunstep(true);
// }
if
(
Integer
.
parseInt
(
stepCode
)
>
Integer
.
parseInt
(
contingencyOriginalData
.
getStep
()))
{
contingencyOriginalData
.
setStepState
(
stepStateOnbutton
);
}
...
...
@@ -163,12 +162,7 @@ public class FireContingencyHandler implements EventHandler{
}
else
{
contingencyRo
.
setFireTruckRoute
(
"false"
);
}
// //需要优化
// ContingencyInstanceInfoVO infoVO = contingencyInstanceInfoService.selectDisposalDetails(batchNo);
// if (!ObjectUtils.isEmpty(infoVO.getPosition())) {
// contingencyOriginalData.setPosition(infoVO.getPosition());
// }
contingencyOriginalData
.
setPosition
(
contingencyOriginalData
.
getFireEquipmentPosition
());
BeanUtils
.
copyProperties
(
contingencyOriginalData
,
contingencyRo
);
...
...
@@ -182,20 +176,6 @@ public class FireContingencyHandler implements EventHandler{
}
log
.
info
(
"stepstate:"
+
contingencyRo
.
getStepState
());
log
.
info
(
"stepCode:"
+
stepCode
);
// equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(Long.parseLong(contingencyRo.getFireEquipmentId()));
// if (equipment != null) {
// contingencyRo.setEquipmentCode(equipment.getCode());
// Map<String, Object> params = contingencyRo.getParams();
// params.put("appKey", RequestContext.getAppKey());
// params.put("product", RequestContext.getProduct());
// params.put("token", RequestContext.getToken());
//
// contingencyRo.setParams(params);
//
// List<String> plan = this.getNumberPlan(Long.parseLong(contingencyRo.getEquipmentId()));
//
// ruleTrigger.publish(contingencyRo, "换流站消防专项预案/" + plan.get(0), ArrayUtils.toArray(equipment.getName()));
// }
if
(
StringUtils
.
isNotEmpty
(
contingencyOriginalData
.
getEquipmentName
()))
{
Map
<
String
,
Object
>
params
=
contingencyRo
.
getParams
();
...
...
@@ -206,12 +186,9 @@ public class FireContingencyHandler implements EventHandler{
params
.
put
(
"product"
,
amosRequestContext
.
getProduct
());
params
.
put
(
"token"
,
amosRequestContext
.
getToken
());
log
.
info
(
"appKey===,{}"
,
amosRequestContext
.
getAppKey
());
log
.
info
(
"product====,{}"
,
amosRequestContext
.
getProduct
());
log
.
info
(
"token====,{}"
,
amosRequestContext
.
getToken
());
contingencyRo
.
setParams
(
params
);
List
<
String
>
plan
=
this
.
getNumberPlan
(
Long
.
parseLong
(
contingencyRo
.
getEquipmentId
()));
List
<
String
>
plan
=
"1"
.
equals
(
planRuleNo
)?
this
.
getNumberPlan
(
Long
.
parseLong
(
contingencyRo
.
getEquipmentId
())):
planDetailMapper
.
getSecRuleIdByEquipment
(
Long
.
parseLong
(
contingencyRo
.
getEquipmentId
()));
ruleTrigger
.
publish
(
contingencyRo
,
"换流站消防专项预案/"
+
plan
.
get
(
0
),
ArrayUtils
.
toArray
(
contingencyOriginalData
.
getEquipmentName
()));
}
...
...
@@ -246,9 +223,10 @@ public class FireContingencyHandler implements EventHandler{
ContingencyRo
paramObj
=
new
ContingencyRo
();
paramObj
.
setBatchNo
(
contingencyRo
.
getBatchNo
());
paramObj
.
setEquipmentId
(
contingencyRo
.
getEquipmentId
());
paramObj
.
setPlanRuleNo
(
contingencyRo
.
getPlanRuleNo
());
contingencyAction
.
sendcmdT
(
"recordarea"
,
paramObj
,
result
);
if
(
StringUtils
.
isNotEmpty
(
contingencyOriginalData
.
getEquipmentName
()))
{
publisherPlanLog
(
stepCode
,
buttonCode
,
batchNo
);
publisherPlanLog
(
stepCode
,
buttonCode
,
batchNo
,
planRuleNo
);
}
}
else
{
throw
new
Exception
(
"数据异常,请联系管理员."
);
...
...
@@ -261,7 +239,7 @@ public class FireContingencyHandler implements EventHandler{
return
ruleId
;
}
private
void
publisherPlanLog
(
String
stepCode
,
String
buttonCode
,
String
batchNo
)
{
private
void
publisherPlanLog
(
String
stepCode
,
String
buttonCode
,
String
batchNo
,
String
planRuleNo
)
{
ContingencyEvent
event
=
new
ContingencyEvent
(
this
);
JSONObject
json
=
new
JSONObject
();
JSONObject
msgContext
=
new
JSONObject
();
...
...
@@ -273,7 +251,7 @@ public class FireContingencyHandler implements EventHandler{
json
.
put
(
"msgType"
,
"message"
);
json
.
put
(
"msgContext"
,
msgContext
);
event
.
setMsgBody
(
json
.
toJSONString
());
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
(
"1"
.
equals
(
planRuleNo
)?
"plan"
:
"secPlan"
)
);
event
.
setTopic
(
topic
);
event
.
setMsgType
(
"clickEvent"
);
event
.
setContingency
(
batchNo
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
5eb576ec
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
5eb576ec
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EmergencyTaskServiceImpl.java
View file @
5eb576ec
...
...
@@ -143,7 +143,7 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
@Async
@Transactional
@Override
public
void
saveTask
(
String
stepCode
,
String
batchId
)
{
public
void
saveTask
(
String
stepCode
,
String
batchId
,
String
planRuleNo
)
{
String
planType
=
null
;
if
(
redisTemplate
.
hasKey
(
"planType"
))
{
planType
=
redisTemplate
.
boundValueOps
(
"planType"
).
get
(
0
,
-
1
);
...
...
@@ -170,6 +170,7 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
contingencyPlanInstance
.
setTaskSort
(
taskNum
);
contingencyPlanInstance
.
setStepCode
(
stepCode
);
contingencyPlanInstance
.
setContent
(
buttonJson
);
contingencyPlanInstance
.
setPlanRuleNo
(
planRuleNo
);
contingencyPlanInstanceRepository
.
saveAndFlush
(
contingencyPlanInstance
);
if
(
"0"
.
equals
(
stepCode
))
{
...
...
@@ -183,7 +184,7 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
planStep
=
planStepService
.
getPlanStep
();
}
JSONArray
objects
=
JSON
.
parseArray
(
planStep
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
(
"1"
.
equals
(
planRuleNo
)?
"plan"
:
"secPlan"
)
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"contingency"
,
new
ContingencyRo
());
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/HandlerMqttMessageImpl.java
View file @
5eb576ec
...
...
@@ -543,20 +543,20 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
*/
@Async
@Override
public
String
executeDynamicPlan
(
String
batchNo
,
AlarmParam
deviceData
,
Equipment
equipment
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Toke
toke
,
Long
recordId
)
{
public
String
executeDynamicPlan
(
String
batchNo
,
AlarmParam
deviceData
,
Equipment
equipment
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Toke
toke
,
Long
recordId
,
String
planRuleNo
)
{
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
try
{
sleep
(
1000
);
alarmContingency
(
batchNo
,
equipmentSpecific
,
equipment
,
recordId
,
deviceData
.
getIsMock
());
alarmContingency
(
batchNo
,
equipmentSpecific
,
equipment
,
recordId
,
deviceData
.
getIsMock
()
,
planRuleNo
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
batchNo
;
}
public
void
alarmContingency
(
String
batchNo
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Equipment
equipment
,
Long
recordId
,
Boolean
isMock
)
throws
Exception
{
public
void
alarmContingency
(
String
batchNo
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Equipment
equipment
,
Long
recordId
,
Boolean
isMock
,
String
planRuleNo
)
throws
Exception
{
ContingencyRo
contingencyRo
=
new
ContingencyRo
();
contingencyRo
.
setBatchNo
(
batchNo
);
contingencyRo
.
setEquipmentId
(
String
.
valueOf
(
equipment
.
getId
()));
...
...
@@ -574,6 +574,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
contingencyRo
.
getParams
().
put
(
"equipmentId"
,
equipment
.
getId
());
contingencyRo
.
setIsMock
(
isMock
);
contingencyRo
.
setPosition
(
equipmentSpecific
.
getPosition
());
contingencyRo
.
setPlanRuleNo
(
planRuleNo
);
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
5eb576ec
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyInstance.java
View file @
5eb576ec
...
...
@@ -8,7 +8,7 @@ import java.util.Optional;
public
interface
IContingencyInstance
{
ContingencyPlanInstance
createInstanceRecord
(
String
instanceNo
,
String
category
,
String
subCategory
,
String
content
,
String
recordType
,
String
icon
);
ContingencyPlanInstance
createInstanceRecord
(
String
instanceNo
,
String
category
,
String
subCategory
,
String
content
,
String
recordType
,
String
icon
,
String
planRuleNo
);
...
...
@@ -19,13 +19,17 @@ public interface IContingencyInstance {
void
setButtonWait
(
String
batchNo
,
String
contingencyPlanId
,
String
buttonState
)
throws
Exception
;
Optional
<
Equipment
>
fire
(
String
batchNo
,
String
stepCode
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
)
throws
Exception
;
Optional
<
Equipment
>
fire
(
String
batchNo
,
String
stepCode
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
)
throws
Exception
;
void
updateStep
(
String
step
,
String
batchNo
);
void
updateStep
(
String
step
,
String
batchNo
,
String
planRuleNo
);
Optional
<
Equipment
>
fire
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isExecute
,
String
isAuto
,
String
token
,
String
product
,
String
appKey
,
String
startUserName
)
throws
Exception
;
Optional
<
Equipment
>
fire
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isExecute
,
String
isAuto
,
String
token
,
String
product
,
String
appKey
,
String
startUserName
,
String
planRuleNo
)
throws
Exception
;
Optional
<
Equipment
>
clickButton
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isExecute
,
String
isAuto
,
String
token
,
String
product
,
String
appKey
,
String
startUserName
)
throws
Exception
;
Optional
<
Equipment
>
clickButton
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isExecute
,
String
isAuto
,
String
token
,
String
product
,
String
appKey
,
String
startUserName
)
throws
Exception
;
/**
* 扩展属性赋值
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyPlanService.java
View file @
5eb576ec
...
...
@@ -98,7 +98,7 @@ public interface IContingencyPlanService {
* @param implementationTimeRight 实施时间右界限
* @return Page
*/
Page
<
PlanDetailVo
>
pageFilter
(
Page
page
,
String
planName
,
Long
classifyId
,
List
<
String
>
planRange
,
String
editOrgName
,
Date
implementationTimeLeft
,
Date
implementationTimeRight
);
Page
<
PlanDetailVo
>
pageFilter
(
Page
page
,
String
planName
,
Long
classifyId
,
List
<
String
>
planRange
,
String
editOrgName
,
Date
implementationTimeLeft
,
Date
implementationTimeRight
,
String
planRuleNo
);
/**
* 查询预案使用的文档ID
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEmergencyTaskService.java
View file @
5eb576ec
...
...
@@ -28,7 +28,7 @@ public interface IEmergencyTaskService {
String
getRolesNameByUserId
(
String
userId
);
void
saveTask
(
String
stepCode
,
String
batchNo
);
void
saveTask
(
String
stepCode
,
String
batchNo
,
String
planRuleNo
);
List
<
EmergencyTaskContentVo
>
getMustTaskList
(
String
stepCode
,
String
planType
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEquipmentHandlerService.java
View file @
5eb576ec
...
...
@@ -20,5 +20,5 @@ public interface IEquipmentHandlerService {
void
subscribeTopic
();
String
executeDynamicPlan
(
String
batchNO
,
AlarmParam
deviceData
,
Equipment
equipment
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Toke
toke
,
Long
recordId
);
String
executeDynamicPlan
(
String
batchNO
,
AlarmParam
deviceData
,
Equipment
equipment
,
EquipmentSpecificForRiskVo
equipmentSpecific
,
Toke
toke
,
Long
recordId
,
String
planRuleNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
5eb576ec
...
...
@@ -87,7 +87,7 @@ public interface IPlanVisual3dService {
void
updatePlanStep
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
isExecute
);
void
updatePlanStepToRedis
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
isExecute
,
String
isAuto
);
void
updatePlanStepToRedis
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
isExecute
,
String
planRuleNo
,
String
isAuto
);
Page
<
ContingencyPlanInstanceVO
>
selectDisposalActionPage
(
int
current
,
int
size
,
String
batchNo
,
List
<
RoleModel
>
roleModelList
,
int
dataType
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/ToipResponse.java
View file @
5eb576ec
...
...
@@ -54,6 +54,9 @@ public class ToipResponse implements Serializable
private
boolean
mockData
;
public
String
planRuleNo
=
"1"
;
public
String
toJsonStr
()
{
return
JSON
.
toJSONString
(
this
,
SerializerFeature
.
WriteMapNullValue
,
SerializerFeature
.
DisableCircularReferenceDetect
,
SerializerFeature
.
SkipTransientField
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/ContingencyPlanParamVo.java
View file @
5eb576ec
...
...
@@ -23,6 +23,8 @@ public class ContingencyPlanParamVo {
*/
public
String
triggerMode
=
"manual"
;
public
String
planRuleNo
=
"1"
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/PlanExecuteVo.java
View file @
5eb576ec
...
...
@@ -14,4 +14,5 @@ public class PlanExecuteVo {
private
String
stepState
;
private
String
isAuto
;
private
String
isExecute
;
private
String
planRuleNo
=
"1"
;
}
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
View file @
5eb576ec
...
...
@@ -1018,4 +1018,111 @@
ALTER TABLE `c_plan_classify_tree` ADD COLUMN plan_type varchar(100) NULL COMMENT '分类TYPE';
</sql>
</changeSet>
<changeSet
author=
"my"
id=
"2024091301-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"c_plan_operation_record"
columnName=
"plan_rule_no"
/>
</not>
</preConditions>
<comment>
c_plan_operation_record.plan_rule_no
</comment>
<sql>
ALTER TABLE `c_plan_operation_record`
ADD COLUMN `plan_rule_no` varchar(5) NULL DEFAULT 1 COMMENT '预案编号,默认为1,若一个设备有多个预案模型依次递增';
</sql>
</changeSet>
<changeSet
author=
"my"
id=
"2024091301-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"c_plan_detail"
columnName=
"sec_status"
/>
</not>
</preConditions>
<comment>
c_plan_detail.sec_status
</comment>
<sql>
ALTER TABLE `c_plan_detail`
ADD COLUMN `sec_status` int(0) NULL COMMENT '第二个预案运行状态' AFTER `status`;
</sql>
</changeSet>
<changeSet
author=
"my"
id=
"2024091301-3"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"f_equipment"
columnName=
"sec_status"
/>
</not>
</preConditions>
<comment>
f_equipment.sec_status
</comment>
<sql>
ALTER TABLE `f_equipment`
ADD COLUMN `sec_status` int(0) NULL COMMENT '第二个预案状态 1-启动 0 未启动' ,
ADD COLUMN `sec_start_time` datetime(0) NULL COMMENT '第二个预案启动时间',
ADD COLUMN `sec_end_time` datetime(0) NULL COMMENT '第二个预案结束时间',
ADD COLUMN `sec_reserve_source` int(0) NULL COMMENT '预案来源:1-手动触发,0-自动触发(默认)';
</sql>
</changeSet>
<changeSet
author=
"my"
id=
"2024091301-4"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"c_plan_rule"
columnName=
"sec_rule_id"
/>
</not>
</preConditions>
<comment>
c_plan_rule.sec_rule_id
</comment>
<sql>
ALTER TABLE `c_plan_rule`
ADD COLUMN `sec_rule_id` varchar(32) NULL COMMENT '第二个预案规则id' AFTER `rule_id`;
</sql>
</changeSet>
<changeSet
author=
"my"
id=
"2024091301-5"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"contingency_instance_info"
columnName=
"plan_rule_no"
/>
</not>
</preConditions>
<comment>
contingency_instance_info.plan_rule_no
</comment>
<sql>
ALTER TABLE `contingency_instance_info`
ADD COLUMN `plan_rule_no` varchar(5) NULL DEFAULT 1 COMMENT '预案规则执行号默认1执行第一个预案,自动化可执行2第二个';
</sql>
</changeSet>
<changeSet
author=
"my"
id=
"2024091301-6"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"contingency_original_data"
columnName=
"plan_rule_no"
/>
</not>
</preConditions>
<comment>
contingency_original_data.plan_rule_no
</comment>
<sql>
ALTER TABLE `contingency_original_data`
ADD COLUMN `plan_rule_no` varchar(5) NULL DEFAULT 1 COMMENT '预案规则执行号默认1执行第一个预案,自动化可执行2第二个';
</sql>
</changeSet>
<changeSet
author=
"my"
id=
"2024091301-7"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"c_plan_detail"
columnName=
"plan_rule_no"
/>
</not>
</preConditions>
<comment>
c_plan_detail.plan_rule_no
</comment>
<sql>
ALTER TABLE `c_plan_detail`
ADD COLUMN `plan_rule_no` varchar(5) NULL DEFAULT 1 COMMENT '预案规则执行号默认1执行第一个预案,自动化可执行2第二个';
</sql>
</changeSet>
<changeSet
author=
"my"
id=
"2024091301-8"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"contingency_plan_instance"
columnName=
"plan_rule_no"
/>
</not>
</preConditions>
<comment>
contingency_plan_instance.plan_rule_no
</comment>
<sql>
ALTER TABLE `contingency_plan_instance`
ADD COLUMN `plan_rule_no` varchar(5) NULL DEFAULT 1 COMMENT '预案规则执行号默认1执行第一个预案,自动化可执行2第二个';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanDetailMapper.xml
View file @
5eb576ec
...
...
@@ -64,6 +64,7 @@
, implementation_time implementationTime
, cpd.remark
, status
, sec_status
, creator
, reviser
, update_time updateTime
...
...
@@ -122,6 +123,21 @@
AND equip.is_delete != 1
AND rule.is_delete !=1
</select>
<select
id=
"getSecRuleIdByEquipment"
parameterType=
"java.lang.Long"
resultType=
"java.lang.String"
>
SELECT
sec_rule_id
FROM
c_plan_detail cpd
LEFT JOIN c_plan_rule rule ON rule.plan_id = cpd.id
LEFT JOIN c_plan_equipment equip ON equip.plan_id = cpd.id
LEFT JOIN f_equipment equipment ON equipment.id = equip.fire_equipment_id
where
equipment.id = #{id}
AND equip.is_delete != 1
AND rule.is_delete !=1
</select>
<select
id=
"getPlanDetailByEquipmentId"
resultType=
"com.yeejoin.amos.fas.business.vo.PlanDetailVo"
>
select
d.id,
...
...
@@ -188,4 +204,21 @@
limit 0, 1
</select>
<select
id=
"queryBatchNoAndRuleNoByFireEquipmentId"
resultType=
"Map"
>
SELECT
p.batch_no as batchNo,p.plan_rule_no as planRuleNo
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>
\ 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