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
45faffa0
Commit
45faffa0
authored
Jun 10, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:数据同步,修改类名
parent
8db56518
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
59 deletions
+59
-59
CPlanOperationRecord.java
...com/yeejoin/amos/fas/dao/entity/CPlanOperationRecord.java
+2
-2
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+14
-14
IPlanOperationRecordDao.java
.../fas/business/dao/repository/IPlanOperationRecordDao.java
+5
-5
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+38
-38
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanOperationRecord.java
→
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/
C
PlanOperationRecord.java
View file @
45faffa0
...
@@ -15,8 +15,8 @@ import java.util.Date;
...
@@ -15,8 +15,8 @@ import java.util.Date;
@Data
@Data
@Entity
@Entity
@Table
(
name
=
"c_plan_operation_record"
)
@Table
(
name
=
"c_plan_operation_record"
)
@NamedQuery
(
name
=
"PlanOperationRecord.findAll"
,
query
=
"SELECT e FROM PlanOperationRecord e"
)
@NamedQuery
(
name
=
"PlanOperationRecord.findAll"
,
query
=
"SELECT e FROM
C
PlanOperationRecord e"
)
public
class
PlanOperationRecord
extends
BasicEntity
{
public
class
C
PlanOperationRecord
extends
BasicEntity
{
/**
/**
* 预案ID
* 预案ID
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
45faffa0
...
@@ -38,7 +38,7 @@ import com.yeejoin.amos.fas.core.util.DateUtil;
...
@@ -38,7 +38,7 @@ import com.yeejoin.amos.fas.core.util.DateUtil;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.PlanDetail
;
import
com.yeejoin.amos.fas.dao.entity.PlanDetail
;
import
com.yeejoin.amos.fas.dao.entity.PlanOperationRecord
;
import
com.yeejoin.amos.fas.dao.entity.
C
PlanOperationRecord
;
import
com.yeejoin.amos.fas.datasync.bo.PlanDetailSyncBo
;
import
com.yeejoin.amos.fas.datasync.bo.PlanDetailSyncBo
;
import
com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo
;
import
com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -754,14 +754,14 @@ public class ContingencyAction implements CustomerAction {
...
@@ -754,14 +754,14 @@ public class ContingencyAction implements CustomerAction {
}
}
// 结束预案 更新预案记录表,预案状态
// 结束预案 更新预案记录表,预案状态
PlanOperationRecord
p
lanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
contingencyRo
.
getBatchNo
());
CPlanOperationRecord
CP
lanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
contingencyRo
.
getBatchNo
());
if
(
planOperationRecord
!=
null
&&
p
lanOperationRecord
.
getStatus
()
==
PlanRecordStatusEnum
.
OPERATION
.
getCode
())
{
if
(
CPlanOperationRecord
!=
null
&&
CP
lanOperationRecord
.
getStatus
()
==
PlanRecordStatusEnum
.
OPERATION
.
getCode
())
{
p
lanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
COMPLETE
.
getCode
());
CP
lanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
COMPLETE
.
getCode
());
p
lanOperationRecord
.
setEndTime
(
new
Date
());
CP
lanOperationRecord
.
setEndTime
(
new
Date
());
PlanOperationRecord
record
=
planOperationRecordDao
.
save
(
p
lanOperationRecord
);
CPlanOperationRecord
record
=
planOperationRecordDao
.
save
(
CP
lanOperationRecord
);
// 异步数据同步之消息发送
// 异步数据同步之消息发送
planOperationRecordDataSync
(
record
);
planOperationRecordDataSync
(
record
);
Optional
<
PlanDetail
>
optionalPlanDetail
=
planDetailDao
.
findById
(
p
lanOperationRecord
.
getPlanId
());
Optional
<
PlanDetail
>
optionalPlanDetail
=
planDetailDao
.
findById
(
CP
lanOperationRecord
.
getPlanId
());
if
(
optionalPlanDetail
.
get
()
!=
null
)
{
if
(
optionalPlanDetail
.
get
()
!=
null
)
{
PlanDetail
planDetail
=
optionalPlanDetail
.
get
();
PlanDetail
planDetail
=
optionalPlanDetail
.
get
();
planDetail
.
setStatus
(
ContingencyPlanStatusEnum
.
AVAILABLE
.
getCode
());
planDetail
.
setStatus
(
ContingencyPlanStatusEnum
.
AVAILABLE
.
getCode
());
...
@@ -790,7 +790,7 @@ public class ContingencyAction implements CustomerAction {
...
@@ -790,7 +790,7 @@ public class ContingencyAction implements CustomerAction {
}
}
}
}
private
void
planOperationRecordDataSync
(
PlanOperationRecord
record
)
{
private
void
planOperationRecordDataSync
(
C
PlanOperationRecord
record
)
{
// 异步数据同步之消息发送
// 异步数据同步之消息发送
if
(
dataSyncSwitch
)
{
if
(
dataSyncSwitch
)
{
try
{
try
{
...
@@ -975,14 +975,14 @@ public class ContingencyAction implements CustomerAction {
...
@@ -975,14 +975,14 @@ public class ContingencyAction implements CustomerAction {
*/
*/
public
void
updateNumberPlan
(
String
batchNo
)
{
public
void
updateNumberPlan
(
String
batchNo
)
{
// 结束预案 更新预案记录表,预案状态
// 结束预案 更新预案记录表,预案状态
PlanOperationRecord
p
lanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
batchNo
);
CPlanOperationRecord
CP
lanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
batchNo
);
if
(
p
lanOperationRecord
!=
null
)
{
if
(
CP
lanOperationRecord
!=
null
)
{
p
lanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
INTERRUPT
.
getCode
());
CP
lanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
INTERRUPT
.
getCode
());
p
lanOperationRecord
.
setEndTime
(
new
Date
());
CP
lanOperationRecord
.
setEndTime
(
new
Date
());
PlanOperationRecord
record
=
planOperationRecordDao
.
save
(
p
lanOperationRecord
);
CPlanOperationRecord
record
=
planOperationRecordDao
.
save
(
CP
lanOperationRecord
);
// 异步数据同步之消息发送
// 异步数据同步之消息发送
planOperationRecordDataSync
(
record
);
planOperationRecordDataSync
(
record
);
Optional
<
PlanDetail
>
optionalPlanDetail
=
planDetailDao
.
findById
(
p
lanOperationRecord
.
getPlanId
());
Optional
<
PlanDetail
>
optionalPlanDetail
=
planDetailDao
.
findById
(
CP
lanOperationRecord
.
getPlanId
());
if
(
optionalPlanDetail
.
get
()
!=
null
)
{
if
(
optionalPlanDetail
.
get
()
!=
null
)
{
PlanDetail
planDetail
=
optionalPlanDetail
.
get
();
PlanDetail
planDetail
=
optionalPlanDetail
.
get
();
planDetail
.
setStatus
(
ContingencyPlanStatusEnum
.
AVAILABLE
.
getCode
());
planDetail
.
setStatus
(
ContingencyPlanStatusEnum
.
AVAILABLE
.
getCode
());
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanOperationRecordDao.java
View file @
45faffa0
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.PlanOperationRecord
;
import
com.yeejoin.amos.fas.dao.entity.
C
PlanOperationRecord
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -13,12 +13,12 @@ import java.util.List;
...
@@ -13,12 +13,12 @@ import java.util.List;
* @date 2021/1/15 10:36
* @date 2021/1/15 10:36
*/
*/
@Repository
@Repository
public
interface
IPlanOperationRecordDao
extends
BaseDao
<
PlanOperationRecord
,
Long
>
{
public
interface
IPlanOperationRecordDao
extends
BaseDao
<
C
PlanOperationRecord
,
Long
>
{
@Query
(
value
=
"SELECT * from c_plan_operation_record where batch_no = ?1 AND is_delete = 0 "
,
nativeQuery
=
true
)
@Query
(
value
=
"SELECT * from c_plan_operation_record where batch_no = ?1 AND is_delete = 0 "
,
nativeQuery
=
true
)
PlanOperationRecord
findByBatchNo
(
String
batchNo
);
C
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
)
@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
);
List
<
C
PlanOperationRecord
>
findByPlanId1
(
Long
planId
);
int
countByPlanId
(
Long
planId
);
int
countByPlanId
(
Long
planId
);
...
@@ -28,6 +28,6 @@ public interface IPlanOperationRecordDao extends BaseDao<PlanOperationRecord, Lo
...
@@ -28,6 +28,6 @@ public interface IPlanOperationRecordDao extends BaseDao<PlanOperationRecord, Lo
* @param status 状态
* @param status 状态
* @return list
* @return list
*/
*/
List
<
PlanOperationRecord
>
findByStatus
(
Integer
status
);
List
<
C
PlanOperationRecord
>
findByStatus
(
Integer
status
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
45faffa0
...
@@ -120,7 +120,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -120,7 +120,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
ReserveEnum
reserveEnum
=
this
.
runCheck
(
vo
);
ReserveEnum
reserveEnum
=
this
.
runCheck
(
vo
);
result
.
setMessage
(
reserveEnum
.
getText
());
result
.
setMessage
(
reserveEnum
.
getText
());
if
(
ReserveEnum
.
THISRUNNING
.
getStatus
().
equals
(
reserveEnum
.
getStatus
()))
{
if
(
ReserveEnum
.
THISRUNNING
.
getStatus
().
equals
(
reserveEnum
.
getStatus
()))
{
List
<
PlanOperationRecord
>
recordList
=
planOperationRecordDao
.
findByPlanId1
(
Long
.
valueOf
(
vo
.
getPlanId
()));
List
<
C
PlanOperationRecord
>
recordList
=
planOperationRecordDao
.
findByPlanId1
(
Long
.
valueOf
(
vo
.
getPlanId
()));
result
.
setMessage
(
ReserveEnum
.
THISRUNNING
.
getText
());
result
.
setMessage
(
ReserveEnum
.
THISRUNNING
.
getText
());
result
.
setBatchNo
(
recordList
.
get
(
0
).
getBatchNo
());
result
.
setBatchNo
(
recordList
.
get
(
0
).
getBatchNo
());
return
result
;
return
result
;
...
@@ -166,24 +166,24 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -166,24 +166,24 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
}
//插入运行记录表
//插入运行记录表
PlanOperationRecord
planOperationRecord
=
new
PlanOperationRecord
();
CPlanOperationRecord
CPlanOperationRecord
=
new
C
PlanOperationRecord
();
p
lanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
OPERATION
.
getCode
());
CP
lanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
OPERATION
.
getCode
());
p
lanOperationRecord
.
setPlanId
(
PlanDetailOp
.
get
().
getId
());
CP
lanOperationRecord
.
setPlanId
(
PlanDetailOp
.
get
().
getId
());
p
lanOperationRecord
.
setIsDelete
(
false
);
CP
lanOperationRecord
.
setIsDelete
(
false
);
p
lanOperationRecord
.
setStartTime
(
new
Date
());
CP
lanOperationRecord
.
setStartTime
(
new
Date
());
p
lanOperationRecord
.
setPlanPattern
(
vo
.
getStatus
());
CP
lanOperationRecord
.
setPlanPattern
(
vo
.
getStatus
());
p
lanOperationRecord
.
setStartUserId
(
vo
.
getUserId
());
CP
lanOperationRecord
.
setStartUserId
(
vo
.
getUserId
());
p
lanOperationRecord
.
setStartUserName
(
vo
.
getUserName
());
CP
lanOperationRecord
.
setStartUserName
(
vo
.
getUserName
());
p
lanOperationRecord
.
setEquipmentCode
(
equipmentSpecific
.
getCode
());
CP
lanOperationRecord
.
setEquipmentCode
(
equipmentSpecific
.
getCode
());
p
lanOperationRecord
.
setEquipmentName
(
equipmentSpecific
.
getName
());
CP
lanOperationRecord
.
setEquipmentName
(
equipmentSpecific
.
getName
());
p
lanOperationRecord
.
setEquipmentId
(
equipmentSpecific
.
getId
());
CP
lanOperationRecord
.
setEquipmentId
(
equipmentSpecific
.
getId
());
p
lanOperationRecord
.
setFireEquipmentId
(
equipment
.
getId
());
CP
lanOperationRecord
.
setFireEquipmentId
(
equipment
.
getId
());
if
(
ContingencyPlanStatusEnum
.
SIMULATION_START
.
getCode
().
equals
(
vo
.
getStatus
()))
{
if
(
ContingencyPlanStatusEnum
.
SIMULATION_START
.
getCode
().
equals
(
vo
.
getStatus
()))
{
p
lanOperationRecord
.
setExecutionType
(
ExecutionTypeEnum
.
PLANCHECK
.
getCode
());
CP
lanOperationRecord
.
setExecutionType
(
ExecutionTypeEnum
.
PLANCHECK
.
getCode
());
}
else
{
}
else
{
p
lanOperationRecord
.
setExecutionType
(
ExecutionTypeEnum
.
FIREMANAGEMENT
.
getCode
());
CP
lanOperationRecord
.
setExecutionType
(
ExecutionTypeEnum
.
FIREMANAGEMENT
.
getCode
());
}
}
PlanOperationRecord
operationRecord
=
planOperationRecordDao
.
save
(
p
lanOperationRecord
);
CPlanOperationRecord
operationRecord
=
planOperationRecordDao
.
save
(
CP
lanOperationRecord
);
// 异步数据同步之消息发送
// 异步数据同步之消息发送
planOperationRecordDataSync
(
operationRecord
);
planOperationRecordDataSync
(
operationRecord
);
//预案启动
//预案启动
...
@@ -200,7 +200,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -200,7 +200,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
planDetailDataSync
(
detail
);
planDetailDataSync
(
detail
);
//更新预案执行记录表的批次号
//更新预案执行记录表的批次号
operationRecord
.
setBatchNo
(
batchNo
);
operationRecord
.
setBatchNo
(
batchNo
);
PlanOperationRecord
record
=
planOperationRecordDao
.
save
(
operationRecord
);
C
PlanOperationRecord
record
=
planOperationRecordDao
.
save
(
operationRecord
);
// 异步数据同步之消息发送
// 异步数据同步之消息发送
planOperationRecordDataSync
(
record
);
planOperationRecordDataSync
(
record
);
result
.
setMessage
(
ReserveEnum
.
RUN
.
getText
());
result
.
setMessage
(
ReserveEnum
.
RUN
.
getText
());
...
@@ -209,7 +209,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -209,7 +209,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
return
result
;
return
result
;
}
}
private
void
planOperationRecordDataSync
(
PlanOperationRecord
operationRecord
)
{
private
void
planOperationRecordDataSync
(
C
PlanOperationRecord
operationRecord
)
{
if
(
dataSyncSwitch
)
{
if
(
dataSyncSwitch
)
{
try
{
try
{
dataSyncService
.
asyncInvoke
(()
->
{
dataSyncService
.
asyncInvoke
(()
->
{
...
@@ -227,30 +227,30 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -227,30 +227,30 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
@Override
@Override
public
Map
<
String
,
Object
>
firstGetRecord
(
String
batchNo
)
{
public
Map
<
String
,
Object
>
firstGetRecord
(
String
batchNo
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
PlanOperationRecord
p
lanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
batchNo
);
CPlanOperationRecord
CP
lanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
batchNo
);
if
(
p
lanOperationRecord
==
null
)
{
if
(
CP
lanOperationRecord
==
null
)
{
throw
new
YeeException
(
"执行记录不存在"
);
throw
new
YeeException
(
"执行记录不存在"
);
}
else
{
}
else
{
PlanDetail
planDetail
=
planDetailDao
.
getOne
(
p
lanOperationRecord
.
getPlanId
());
PlanDetail
planDetail
=
planDetailDao
.
getOne
(
CP
lanOperationRecord
.
getPlanId
());
if
(
planDetail
==
null
)
{
if
(
planDetail
==
null
)
{
throw
new
YeeException
(
"数字预案模型被删除"
);
throw
new
YeeException
(
"数字预案模型被删除"
);
}
}
map
.
put
(
"status"
,
p
lanOperationRecord
.
getStatus
());
map
.
put
(
"status"
,
CP
lanOperationRecord
.
getStatus
());
if
(
PlanRecordStatusEnum
.
OPERATION
==
PlanRecordStatusEnum
.
getEnum
(
p
lanOperationRecord
.
getStatus
()))
{
if
(
PlanRecordStatusEnum
.
OPERATION
==
PlanRecordStatusEnum
.
getEnum
(
CP
lanOperationRecord
.
getStatus
()))
{
map
.
put
(
"executionTime"
,
(
System
.
currentTimeMillis
()
-
p
lanOperationRecord
.
getStartTime
().
getTime
())
/
1000
);
map
.
put
(
"executionTime"
,
(
System
.
currentTimeMillis
()
-
CP
lanOperationRecord
.
getStartTime
().
getTime
())
/
1000
);
}
else
{
}
else
{
map
.
put
(
"executionTime"
,
(
planOperationRecord
.
getEndTime
().
getTime
()
-
p
lanOperationRecord
.
getStartTime
().
getTime
())
/
1000
);
map
.
put
(
"executionTime"
,
(
CPlanOperationRecord
.
getEndTime
().
getTime
()
-
CP
lanOperationRecord
.
getStartTime
().
getTime
())
/
1000
);
}
}
map
.
put
(
"crateDate"
,
p
lanOperationRecord
.
getStartTime
());
map
.
put
(
"crateDate"
,
CP
lanOperationRecord
.
getStartTime
());
if
(
ContingencyPlanStatusEnum
.
getEnum
(
p
lanOperationRecord
.
getPlanPattern
())
==
ContingencyPlanStatusEnum
.
SIMULATION_START
)
{
if
(
ContingencyPlanStatusEnum
.
getEnum
(
CP
lanOperationRecord
.
getPlanPattern
())
==
ContingencyPlanStatusEnum
.
SIMULATION_START
)
{
map
.
put
(
"userName"
,
p
lanOperationRecord
.
getStartUserName
());
map
.
put
(
"userName"
,
CP
lanOperationRecord
.
getStartUserName
());
map
.
put
(
"startType"
,
"手动"
);
map
.
put
(
"startType"
,
"手动"
);
}
else
{
}
else
{
map
.
put
(
"userName"
,
"系统"
);
map
.
put
(
"userName"
,
"系统"
);
map
.
put
(
"startType"
,
"自动"
);
map
.
put
(
"startType"
,
"自动"
);
}
}
map
.
put
(
"executionType"
,
p
lanOperationRecord
.
getExecutionType
());
map
.
put
(
"executionType"
,
CP
lanOperationRecord
.
getExecutionType
());
map
.
put
(
"equipmentName"
,
p
lanOperationRecord
.
getEquipmentName
());
map
.
put
(
"equipmentName"
,
CP
lanOperationRecord
.
getEquipmentName
());
map
.
put
(
"PlanName"
,
planDetail
.
getPlanName
());
map
.
put
(
"PlanName"
,
planDetail
.
getPlanName
());
}
}
return
map
;
return
map
;
...
@@ -289,7 +289,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -289,7 +289,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
if
(
planEquipments
.
isEmpty
())
{
if
(
planEquipments
.
isEmpty
())
{
return
ReserveEnum
.
PLAN_EQUIP_IS_DELETE
;
return
ReserveEnum
.
PLAN_EQUIP_IS_DELETE
;
}
}
List
<
PlanOperationRecord
>
recordList
=
planOperationRecordDao
.
findByPlanId1
(
Long
.
valueOf
(
vo
.
getPlanId
()));
List
<
C
PlanOperationRecord
>
recordList
=
planOperationRecordDao
.
findByPlanId1
(
Long
.
valueOf
(
vo
.
getPlanId
()));
if
(
recordList
.
size
()
>
0
&&
!
vo
.
getStatus
().
equals
(
ContingencyPlanStatusEnum
.
ONGOING
.
getCode
()))
{
if
(
recordList
.
size
()
>
0
&&
!
vo
.
getStatus
().
equals
(
ContingencyPlanStatusEnum
.
ONGOING
.
getCode
()))
{
return
ReserveEnum
.
THISRUNNING
;
return
ReserveEnum
.
THISRUNNING
;
}
}
...
@@ -308,9 +308,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -308,9 +308,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
}
List
<
PlanDetail
>
countMn
=
planDetailDao
.
findByStatus
((
Integer
[])
Arrays
.
asList
(
ContingencyPlanStatusEnum
.
SIMULATION_START
.
getCode
()).
toArray
());
List
<
PlanDetail
>
countMn
=
planDetailDao
.
findByStatus
((
Integer
[])
Arrays
.
asList
(
ContingencyPlanStatusEnum
.
SIMULATION_START
.
getCode
()).
toArray
());
if
(
countMn
.
size
()
>
NumberEnum
.
ZERO
.
getValue
())
{
if
(
countMn
.
size
()
>
NumberEnum
.
ZERO
.
getValue
())
{
List
<
PlanOperationRecord
>
p
lanOperationRecordList
=
planOperationRecordDao
.
findByPlanId1
(
countMn
.
get
(
0
).
getId
());
List
<
CPlanOperationRecord
>
CP
lanOperationRecordList
=
planOperationRecordDao
.
findByPlanId1
(
countMn
.
get
(
0
).
getId
());
if
(
p
lanOperationRecordList
.
size
()
>
0
)
{
if
(
CP
lanOperationRecordList
.
size
()
>
0
)
{
Optional
<
Equipment
>
equipment
=
iContingencyInstance
.
fire
(
p
lanOperationRecordList
.
get
(
0
).
getBatchNo
(),
"0"
,
""
,
"FIRE_CANCEL"
,
"CONFIRM"
,
"B"
);
Optional
<
Equipment
>
equipment
=
iContingencyInstance
.
fire
(
CP
lanOperationRecordList
.
get
(
0
).
getBatchNo
(),
"0"
,
""
,
"FIRE_CANCEL"
,
"CONFIRM"
,
"B"
);
// 结束预案,更新设备重点设备参数
// 结束预案,更新设备重点设备参数
equipment
.
ifPresent
(
equip
->
{
equipment
.
ifPresent
(
equip
->
{
equip
.
setStartTime
(
DateUtil
.
getDateNow
());
equip
.
setStartTime
(
DateUtil
.
getDateNow
());
...
@@ -319,7 +319,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -319,7 +319,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
equip
.
setStatus
(
NumberEnum
.
ONE
.
getValue
());
equip
.
setStatus
(
NumberEnum
.
ONE
.
getValue
());
equipmentService
.
save
(
equip
);
equipmentService
.
save
(
equip
);
});
});
customerAction
.
intreeuptPlan
(
p
lanOperationRecordList
.
get
(
0
).
getBatchNo
());
customerAction
.
intreeuptPlan
(
CP
lanOperationRecordList
.
get
(
0
).
getBatchNo
());
}
}
}
}
...
@@ -749,10 +749,10 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -749,10 +749,10 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
AtomicBoolean
bool
=
new
AtomicBoolean
(
true
);
AtomicBoolean
bool
=
new
AtomicBoolean
(
true
);
try
{
try
{
// 运行中的设置为重置
// 运行中的设置为重置
List
<
PlanOperationRecord
>
planList
=
planOperationRecordDao
.
findByStatus
(
0
);
List
<
C
PlanOperationRecord
>
planList
=
planOperationRecordDao
.
findByStatus
(
0
);
if
(!
planList
.
isEmpty
())
{
if
(!
planList
.
isEmpty
())
{
planList
.
forEach
(
p
lanOperationRecord
->
{
planList
.
forEach
(
CP
lanOperationRecord
->
{
String
batchNo
=
p
lanOperationRecord
.
getBatchNo
();
String
batchNo
=
CP
lanOperationRecord
.
getBatchNo
();
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
Optional
<
Equipment
>
equipment
;
Optional
<
Equipment
>
equipment
;
try
{
try
{
...
...
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