5
5
import com .codingapi .springboot .flow .record .FlowRecord ;
6
6
import com .codingapi .springboot .flow .repository .FlowProcessRepository ;
7
7
import com .codingapi .springboot .flow .repository .FlowRecordRepository ;
8
+ import com .codingapi .springboot .flow .repository .FlowWorkRepository ;
8
9
import com .codingapi .springboot .flow .user .IFlowOperator ;
9
10
import lombok .Getter ;
10
11
@@ -22,6 +23,7 @@ public class FlowRecordVerifyService {
22
23
// register repository
23
24
final FlowRecordRepository flowRecordRepository ;
24
25
final FlowProcessRepository flowProcessRepository ;
26
+ final FlowWorkRepository flowWorkRepository ;
25
27
26
28
// load Object
27
29
@ Getter
@@ -31,10 +33,13 @@ public class FlowRecordVerifyService {
31
33
@ Getter
32
34
private final FlowRecord flowRecord ;
33
35
34
- public FlowRecordVerifyService (FlowRecordRepository flowRecordRepository ,
35
- FlowProcessRepository flowProcessRepository ,
36
- long recordId ,
37
- IFlowOperator currentOperator ) {
36
+ public FlowRecordVerifyService (
37
+ FlowWorkRepository flowWorkRepository ,
38
+ FlowRecordRepository flowRecordRepository ,
39
+ FlowProcessRepository flowProcessRepository ,
40
+ long recordId ,
41
+ IFlowOperator currentOperator ) {
42
+ this .flowWorkRepository = flowWorkRepository ;
38
43
this .flowRecordRepository = flowRecordRepository ;
39
44
this .flowProcessRepository = flowProcessRepository ;
40
45
@@ -46,13 +51,16 @@ public FlowRecordVerifyService(FlowRecordRepository flowRecordRepository,
46
51
this .flowRecord = flowRecord ;
47
52
}
48
53
49
- public FlowRecordVerifyService (FlowRecordRepository flowRecordRepository ,
54
+ public FlowRecordVerifyService (FlowWorkRepository flowWorkRepository ,
55
+ FlowRecordRepository flowRecordRepository ,
50
56
FlowProcessRepository flowProcessRepository ,
51
57
FlowRecord flowRecord ,
52
58
FlowWork flowWork ,
53
59
IFlowOperator currentOperator ) {
60
+ this .flowWorkRepository = flowWorkRepository ;
54
61
this .flowRecordRepository = flowRecordRepository ;
55
62
this .flowProcessRepository = flowProcessRepository ;
63
+
56
64
this .currentOperator = currentOperator ;
57
65
this .flowRecord = flowRecord ;
58
66
this .flowWork = flowWork ;
@@ -149,8 +157,11 @@ public void verifyTargetOperatorIsNotCurrentOperator(IFlowOperator targetOperato
149
157
* 获取流程设计对象
150
158
*/
151
159
public void loadFlowWork () {
152
- if (this .flowWork ==null ) {
160
+ if (this .flowWork == null ) {
153
161
FlowWork flowWork = flowProcessRepository .getFlowWorkByProcessId (flowRecord .getProcessId ());
162
+ if (flowWork == null ) {
163
+ flowWork = flowWorkRepository .getFlowWorkByCode (flowRecord .getWorkCode ());
164
+ }
154
165
if (flowWork == null ) {
155
166
throw new IllegalArgumentException ("flow work not found" );
156
167
}
0 commit comments