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
54706852
Commit
54706852
authored
Jun 09, 2022
by
xixinzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改预案重置
parent
459d0f2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
IPlanOperationRecordDao.java
.../fas/business/dao/repository/IPlanOperationRecordDao.java
+7
-0
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+26
-4
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanOperationRecordDao.java
View file @
54706852
...
...
@@ -23,4 +23,11 @@ public interface IPlanOperationRecordDao extends BaseDao<PlanOperationRecord, Lo
int
countByPlanId
(
Long
planId
);
/**
* 根据状态查找
* @param status 状态
* @return list
*/
List
<
PlanOperationRecord
>
findByStatus
(
Integer
status
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
54706852
...
...
@@ -73,7 +73,6 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
@Autowired
private
IDataSyncService
dataSyncService
;
private
final
PlanOperationRecordMapper
planOperationRecordMapper
;
private
final
IPlanDetailDao
planDetailDao
;
private
final
IPlanDocDao
planDocDao
;
...
...
@@ -749,10 +748,33 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
public
AtomicBoolean
planReset
()
{
AtomicBoolean
bool
=
new
AtomicBoolean
(
true
);
try
{
Date
date
=
new
Date
();
Integer
update
=
planDetailMapper
.
planReset
(
date
);
// 运行中的设置为重置
List
<
PlanOperationRecord
>
planList
=
planOperationRecordDao
.
findByStatus
(
0
);
if
(!
planList
.
isEmpty
())
{
planList
.
forEach
(
planOperationRecord
->
{
String
batchNo
=
planOperationRecord
.
getBatchNo
();
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
Optional
<
Equipment
>
equipment
;
try
{
equipment
=
iContingencyInstance
.
fire
(
batchNo
,
"0"
,
""
,
"FIRE_CANCEL"
,
"CONFIRM"
,
"B"
);
// 结束预案,更新设备重点设备参数
equipment
.
ifPresent
(
equip
->
{
equip
.
setEndTime
(
null
);
equip
.
setReserveSource
(
NumberEnum
.
ONE
.
getValue
());
equip
.
setStartTime
(
DateUtil
.
getDateNow
());
equip
.
setStatus
(
NumberEnum
.
ONE
.
getValue
());
equipmentService
.
save
(
equip
);
});
customerAction
.
intreeuptPlan
(
batchNo
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"预案重置失败batchNo:{}"
,
batchNo
,
e
);
e
.
printStackTrace
();
}
});
}
// 异步数据同步之消息发送
if
(
update
>
0
&&
dataSyncSwitch
)
{
if
(
!
planList
.
isEmpty
()
&&
dataSyncSwitch
)
{
try
{
dataSyncService
.
asyncInvoke
(()
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
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