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
8646f87c
Commit
8646f87c
authored
Jun 13, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:数据同步,还原类名
parent
45faffa0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
59 deletions
+61
-59
PlanOperationRecord.java
.../com/yeejoin/amos/fas/dao/entity/PlanOperationRecord.java
+4
-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/
C
PlanOperationRecord.java
→
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanOperationRecord.java
View file @
8646f87c
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
...
@@ -15,8 +16,9 @@ import java.util.Date;
...
@@ -15,8 +16,9 @@ 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 CPlanOperationRecord e"
)
@NamedQuery
(
name
=
"PlanOperationRecord.findAll"
,
query
=
"SELECT e FROM PlanOperationRecord e"
)
public
class
CPlanOperationRecord
extends
BasicEntity
{
@TableName
(
"c_plan_operation_record"
)
public
class
PlanOperationRecord
extends
BasicEntity
{
/**
/**
* 预案ID
* 预案ID
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
8646f87c
...
@@ -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.
C
PlanOperationRecord
;
import
com.yeejoin.amos.fas.dao.entity.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 {
}
}
// 结束预案 更新预案记录表,预案状态
// 结束预案 更新预案记录表,预案状态
CPlanOperationRecord
C
PlanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
contingencyRo
.
getBatchNo
());
PlanOperationRecord
PlanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
contingencyRo
.
getBatchNo
());
if
(
CPlanOperationRecord
!=
null
&&
C
PlanOperationRecord
.
getStatus
()
==
PlanRecordStatusEnum
.
OPERATION
.
getCode
())
{
if
(
PlanOperationRecord
!=
null
&&
PlanOperationRecord
.
getStatus
()
==
PlanRecordStatusEnum
.
OPERATION
.
getCode
())
{
C
PlanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
COMPLETE
.
getCode
());
PlanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
COMPLETE
.
getCode
());
C
PlanOperationRecord
.
setEndTime
(
new
Date
());
PlanOperationRecord
.
setEndTime
(
new
Date
());
CPlanOperationRecord
record
=
planOperationRecordDao
.
save
(
C
PlanOperationRecord
);
PlanOperationRecord
record
=
planOperationRecordDao
.
save
(
PlanOperationRecord
);
// 异步数据同步之消息发送
// 异步数据同步之消息发送
planOperationRecordDataSync
(
record
);
planOperationRecordDataSync
(
record
);
Optional
<
PlanDetail
>
optionalPlanDetail
=
planDetailDao
.
findById
(
C
PlanOperationRecord
.
getPlanId
());
Optional
<
PlanDetail
>
optionalPlanDetail
=
planDetailDao
.
findById
(
PlanOperationRecord
.
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
(
C
PlanOperationRecord
record
)
{
private
void
planOperationRecordDataSync
(
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
)
{
// 结束预案 更新预案记录表,预案状态
// 结束预案 更新预案记录表,预案状态
CPlanOperationRecord
C
PlanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
batchNo
);
PlanOperationRecord
PlanOperationRecord
=
planOperationRecordDao
.
findByBatchNo
(
batchNo
);
if
(
C
PlanOperationRecord
!=
null
)
{
if
(
PlanOperationRecord
!=
null
)
{
C
PlanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
INTERRUPT
.
getCode
());
PlanOperationRecord
.
setStatus
(
PlanRecordStatusEnum
.
INTERRUPT
.
getCode
());
C
PlanOperationRecord
.
setEndTime
(
new
Date
());
PlanOperationRecord
.
setEndTime
(
new
Date
());
CPlanOperationRecord
record
=
planOperationRecordDao
.
save
(
C
PlanOperationRecord
);
PlanOperationRecord
record
=
planOperationRecordDao
.
save
(
PlanOperationRecord
);
// 异步数据同步之消息发送
// 异步数据同步之消息发送
planOperationRecordDataSync
(
record
);
planOperationRecordDataSync
(
record
);
Optional
<
PlanDetail
>
optionalPlanDetail
=
planDetailDao
.
findById
(
C
PlanOperationRecord
.
getPlanId
());
Optional
<
PlanDetail
>
optionalPlanDetail
=
planDetailDao
.
findById
(
PlanOperationRecord
.
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 @
8646f87c
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.
C
PlanOperationRecord
;
import
com.yeejoin.amos.fas.dao.entity.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
<
C
PlanOperationRecord
,
Long
>
{
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
)
@Query
(
value
=
"SELECT * from c_plan_operation_record where batch_no = ?1 AND is_delete = 0 "
,
nativeQuery
=
true
)
C
PlanOperationRecord
findByBatchNo
(
String
batchNo
);
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
<
C
PlanOperationRecord
>
findByPlanId1
(
Long
planId
);
List
<
PlanOperationRecord
>
findByPlanId1
(
Long
planId
);
int
countByPlanId
(
Long
planId
);
int
countByPlanId
(
Long
planId
);
...
@@ -28,6 +28,6 @@ public interface IPlanOperationRecordDao extends BaseDao<CPlanOperationRecord, L
...
@@ -28,6 +28,6 @@ public interface IPlanOperationRecordDao extends BaseDao<CPlanOperationRecord, L
* @param status 状态
* @param status 状态
* @return list
* @return list
*/
*/
List
<
C
PlanOperationRecord
>
findByStatus
(
Integer
status
);
List
<
PlanOperationRecord
>
findByStatus
(
Integer
status
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
8646f87c
This diff is collapsed.
Click to expand it.
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