Skip to content

Commit ffec917

Browse files
committed
fix #165
1 parent cb714b3 commit ffec917

File tree

9 files changed

+44
-8
lines changed

9 files changed

+44
-8
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<groupId>com.codingapi.springboot</groupId>
1717
<artifactId>springboot-parent</artifactId>
18-
<version>2.10.22</version>
18+
<version>2.10.23</version>
1919

2020
<url>https://github.com/codingapi/springboot-framewrok</url>
2121
<name>springboot-parent</name>

springboot-starter-data-authorization/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>2.10.22</version>
9+
<version>2.10.23</version>
1010
</parent>
1111

1212
<name>springboot-starter-data-authorization</name>

springboot-starter-data-fast/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-parent</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>2.10.22</version>
8+
<version>2.10.23</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-flow/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>2.10.22</version>
9+
<version>2.10.23</version>
1010
</parent>
1111

1212
<name>springboot-starter-flow</name>

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,19 @@ public void recallFlow() {
283283
}
284284

285285

286+
/**
287+
* 撤回流程
288+
* @param backStartNode 是否退回到发起节点(仅限于流程创建者有效)
289+
*/
290+
public void recallFlow(boolean backStartNode) {
291+
if (flowRecord == null) {
292+
throw new IllegalArgumentException("flow record is null");
293+
}
294+
FlowService flowService = loadFlowService();
295+
flowService.recall(flowRecord.getId(), currentOperator, backStartNode);
296+
}
297+
298+
286299
private FlowService loadFlowService() {
287300
return (FlowService) getBean("flowService");
288301
}

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/FlowService.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,17 @@ public void recall(long recordId, IFlowOperator currentOperator) {
281281
flowRecallService.recall(recordId, currentOperator);
282282
}
283283

284+
/**
285+
* 撤回流程
286+
*
287+
* @param recordId 流程记录id
288+
* @param currentOperator 当前操作者
289+
* @param backStartNode 是否退回到发起节点(仅限于流程创建者有效)
290+
*/
291+
public void recall(long recordId, IFlowOperator currentOperator, boolean backStartNode) {
292+
flowRecallService.recall(recordId, currentOperator,backStartNode);
293+
}
294+
284295

285296
/**
286297
* 删除流程

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowRecallService.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public class FlowRecallService {
3232
*
3333
* @param recordId 流程记录id
3434
* @param currentOperator 当前操作者
35+
* @param backStartNode 是否退回到发起节点(仅限于流程创建者有效)
3536
*/
36-
public void recall(long recordId, IFlowOperator currentOperator) {
37+
public void recall(long recordId, IFlowOperator currentOperator,boolean backStartNode) {
3738
FlowRecordVerifyService flowRecordVerifyService = new FlowRecordVerifyService(
3839
flowWorkRepository,
3940
flowRecordRepository,
@@ -51,7 +52,7 @@ public void recall(long recordId, IFlowOperator currentOperator) {
5152
FlowWork flowWork = flowRecordVerifyService.getFlowWork();
5253
BindDataSnapshot bindDataSnapshot = flowBindDataRepository.getBindDataSnapshotById(flowRecord.getSnapshotId());
5354

54-
if(flowRecordVerifyService.isCreateOperator()){
55+
if(backStartNode && flowRecordVerifyService.isCreateOperator()){
5556
List<FlowRecord> records = flowRecordRepository.findFlowRecordByProcessId(flowRecord.getProcessId());
5657
for(FlowRecord record:records){
5758
if(!record.isStartRecord()) {
@@ -88,4 +89,15 @@ public void recall(long recordId, IFlowOperator currentOperator) {
8889
IBindData bindData = bindDataSnapshot.toBindData();
8990
EventPusher.push(new FlowApprovalEvent(FlowApprovalEvent.STATE_RECALL, flowRecord, currentOperator, flowWork, bindData), true);
9091
}
92+
93+
94+
/**
95+
* 撤回流程
96+
*
97+
* @param recordId 流程记录id
98+
* @param currentOperator 当前操作者
99+
*/
100+
public void recall(long recordId, IFlowOperator currentOperator) {
101+
this.recall(recordId, currentOperator, true);
102+
}
91103
}

springboot-starter-security/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>2.10.22</version>
9+
<version>2.10.23</version>
1010
</parent>
1111

1212
<artifactId>springboot-starter-security</artifactId>

springboot-starter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.codingapi.springboot</groupId>
77
<artifactId>springboot-parent</artifactId>
8-
<version>2.10.22</version>
8+
<version>2.10.23</version>
99
</parent>
1010
<artifactId>springboot-starter</artifactId>
1111

0 commit comments

Comments
 (0)