Skip to content

Commit 94f7d2d

Browse files
committed
fix #119
1 parent ef64d79 commit 94f7d2d

File tree

11 files changed

+34
-14
lines changed

11 files changed

+34
-14
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.7</version>
18+
<version>2.10.8</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.7</version>
9+
<version>2.10.8</version>
1010
</parent>
1111

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

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.7</version>
8+
<version>2.10.8</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.7</version>
9+
<version>2.10.8</version>
1010
</parent>
1111

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

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/event/FlowApprovalEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public class FlowApprovalEvent implements ISyncEvent {
3636
public static final int STATE_CIRCULATE = 9;
3737
// 保存
3838
public static final int STATE_SAVE = 10;
39+
// 删除
40+
public static final int STATE_DELETE = 11;
3941

4042

4143
private final int state;

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public FlowService(FlowWorkRepository flowWorkRepository,
4141
this.flowServiceRepositoryHolder = new FlowServiceRepositoryHolder(flowWorkRepository, flowRecordRepository, flowBindDataRepository, flowOperatorRepository, flowProcessRepository, flowBackupRepository);
4242
this.flowDetailService = new FlowDetailService(flowWorkRepository, flowRecordRepository, flowBindDataRepository, flowOperatorRepository, flowProcessRepository);
4343
this.flowCustomEventService = new FlowCustomEventService(flowWorkRepository, flowRecordRepository, flowProcessRepository);
44-
this.flowRecallService = new FlowRecallService(flowWorkRepository, flowRecordRepository, flowProcessRepository);
45-
this.flowRemoveService = new FlowRemoveService(flowWorkRepository, flowRecordRepository, flowProcessRepository);
44+
this.flowRecallService = new FlowRecallService(flowWorkRepository, flowRecordRepository, flowProcessRepository,flowBindDataRepository);
45+
this.flowRemoveService = new FlowRemoveService(flowWorkRepository, flowRecordRepository, flowProcessRepository,flowBindDataRepository);
4646
this.flowSaveService = new FlowSaveService(flowWorkRepository, flowRecordRepository, flowBindDataRepository, flowProcessRepository);
4747
this.flowTransferService = new FlowTransferService(flowWorkRepository, flowRecordRepository, flowBindDataRepository, flowProcessRepository);
4848
this.flowPostponedService = new FlowPostponedService(flowWorkRepository, flowRecordRepository, flowProcessRepository);
@@ -57,11 +57,13 @@ public FlowService(FlowWorkRepository flowWorkRepository,
5757
* @return 流程详情
5858
*/
5959
public FlowDetail detail(long recordId, String workCode, IFlowOperator currentOperator) {
60+
if (recordId > 0) {
61+
return flowDetailService.detail(recordId, currentOperator);
62+
}
6063
if (StringUtils.hasText(workCode)) {
6164
return flowDetailService.detail(workCode, currentOperator);
62-
} else {
63-
return flowDetailService.detail(recordId, currentOperator);
6465
}
66+
return null;
6567
}
6668

6769
/**

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package com.codingapi.springboot.flow.service.impl;
22

3+
import com.codingapi.springboot.flow.bind.BindDataSnapshot;
4+
import com.codingapi.springboot.flow.bind.IBindData;
35
import com.codingapi.springboot.flow.domain.FlowWork;
46
import com.codingapi.springboot.flow.event.FlowApprovalEvent;
57
import com.codingapi.springboot.flow.record.FlowRecord;
8+
import com.codingapi.springboot.flow.repository.FlowBindDataRepository;
69
import com.codingapi.springboot.flow.repository.FlowProcessRepository;
710
import com.codingapi.springboot.flow.repository.FlowRecordRepository;
811
import com.codingapi.springboot.flow.repository.FlowWorkRepository;
@@ -22,6 +25,7 @@ public class FlowRecallService {
2225
private final FlowWorkRepository flowWorkRepository;
2326
private final FlowRecordRepository flowRecordRepository;
2427
private final FlowProcessRepository flowProcessRepository;
28+
private final FlowBindDataRepository flowBindDataRepository;
2529

2630
/**
2731
* 撤回流程
@@ -47,6 +51,8 @@ public void recall(long recordId, IFlowOperator currentOperator) {
4751

4852
// 下一流程的流程记录
4953
List<FlowRecord> childrenRecords = flowRecordRepository.findFlowRecordByPreId(recordId);
54+
55+
BindDataSnapshot bindDataSnapshot = flowBindDataRepository.getBindDataSnapshotById(flowRecord.getSnapshotId());
5056
// 下一流程均为办理且未读
5157

5258
// 如果是在开始节点撤销,则直接删除
@@ -71,6 +77,8 @@ public void recall(long recordId, IFlowOperator currentOperator) {
7177
flowRecordRepository.delete(childrenRecords);
7278
}
7379

74-
EventPusher.push(new FlowApprovalEvent(FlowApprovalEvent.STATE_RECALL, flowRecord, currentOperator, flowWork, null), true);
80+
IBindData bindData = bindDataSnapshot.toBindData();
81+
82+
EventPusher.push(new FlowApprovalEvent(FlowApprovalEvent.STATE_RECALL, flowRecord, currentOperator, flowWork, bindData), true);
7583
}
7684
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.codingapi.springboot.flow.service.impl;
22

3+
import com.codingapi.springboot.flow.bind.BindDataSnapshot;
4+
import com.codingapi.springboot.flow.bind.IBindData;
35
import com.codingapi.springboot.flow.domain.FlowNode;
46
import com.codingapi.springboot.flow.domain.FlowWork;
57
import com.codingapi.springboot.flow.event.FlowApprovalEvent;
68
import com.codingapi.springboot.flow.record.FlowRecord;
9+
import com.codingapi.springboot.flow.repository.FlowBindDataRepository;
710
import com.codingapi.springboot.flow.repository.FlowProcessRepository;
811
import com.codingapi.springboot.flow.repository.FlowRecordRepository;
912
import com.codingapi.springboot.flow.repository.FlowWorkRepository;
@@ -23,7 +26,7 @@ public class FlowRemoveService {
2326
private final FlowWorkRepository flowWorkRepository;
2427
private final FlowRecordRepository flowRecordRepository;
2528
private final FlowProcessRepository flowProcessRepository;
26-
29+
private final FlowBindDataRepository flowBindDataRepository;
2730

2831
/**
2932
* 删除流程
@@ -44,15 +47,20 @@ public void remove(long recordId, IFlowOperator currentOperator) {
4447
flowRecordVerifyService.loadFlowNode();
4548
flowRecordVerifyService.verifyFlowRecordNotFinish();
4649
flowRecordVerifyService.verifyFlowRecordIsTodo();
50+
FlowWork flowWork = flowRecordVerifyService.getFlowWork();
4751
FlowNode flowNode = flowRecordVerifyService.getFlowNode();
4852
FlowRecord flowRecord = flowRecordVerifyService.getFlowRecord();
4953

5054
if(!flowNode.isStartNode()){
5155
throw new IllegalArgumentException("flow record not remove");
5256
}
5357

54-
flowProcessRepository.deleteByProcessId(flowRecord.getProcessId());
58+
BindDataSnapshot bindDataSnapshot = flowBindDataRepository.getBindDataSnapshotById(flowRecord.getSnapshotId());
59+
IBindData bindData = bindDataSnapshot.toBindData();
5560

61+
flowProcessRepository.deleteByProcessId(flowRecord.getProcessId());
5662
flowRecordRepository.deleteByProcessId(flowRecord.getProcessId());
63+
64+
EventPusher.push(new FlowApprovalEvent(FlowApprovalEvent.STATE_DELETE, flowRecord, currentOperator, flowWork, bindData), true);
5765
}
5866
}

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.7</version>
9+
<version>2.10.8</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.7</version>
8+
<version>2.10.8</version>
99
</parent>
1010
<artifactId>springboot-starter</artifactId>
1111

0 commit comments

Comments
 (0)