Skip to content

Commit 8bfad98

Browse files
committed
finish over node
1 parent 55f1637 commit 8bfad98

File tree

18 files changed

+208
-204
lines changed

18 files changed

+208
-204
lines changed

admin-ui/src/pages/flow/work/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ const FlowPage = () => {
276276
onClick={async () => {
277277
const data = flowActionType.current?.getData();
278278
const json = JSON.stringify(data);
279-
console.log(json);
280279
await handlerSchema(json);
281280
}}
282281
>

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/domain/FlowNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ public boolean isStartNode() {
305305
}
306306

307307
/**
308-
* 是否抄送节点
308+
* 是否传阅节点
309309
*/
310-
public boolean isCC() {
311-
return approvalType == ApprovalType.CC;
310+
public boolean isCirculate() {
311+
return approvalType == ApprovalType.CIRCULATE;
312312
}
313313
}

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/domain/Opinion.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class Opinion {
2828
public static final int RESULT_PASS = 2;
2929
// 审批结果 驳回
3030
public static final int RESULT_REJECT = 3;
31+
// 审批结果 抄送
32+
public static final int RESULT_CIRCULATE = 4;
3133

3234
/**
3335
* 审批意见
@@ -68,6 +70,14 @@ public static Opinion unSignAutoSuccess() {
6870
return new Opinion("非会签自动审批", RESULT_PASS, TYPE_AUTO);
6971
}
7072

73+
public static Opinion circulate() {
74+
return new Opinion("抄送", RESULT_CIRCULATE, TYPE_AUTO);
75+
}
76+
77+
public boolean isCirculate() {
78+
return result == RESULT_CIRCULATE;
79+
}
80+
7181
public boolean isSuccess() {
7282
return result == RESULT_PASS;
7383
}

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/em/ApprovalType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public enum ApprovalType {
1414
*/
1515
UN_SIGN,
1616
/**
17-
* 抄送
17+
* 传阅
1818
*/
19-
CC;
19+
CIRCULATE;
2020

2121

2222
public static ApprovalType parser(String approvalType) {

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/em/FlowType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public enum FlowType {
1414
*/
1515
DONE,
1616
/**
17-
* 抄送
17+
* 传阅
1818
*/
19-
CC,
19+
CIRCULATE,
2020
/**
2121
* 转办
2222
*/

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/em/NodeType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public enum NodeType {
1414
*/
1515
APPROVAL,
1616
/**
17-
* 抄送
17+
* 传阅
1818
*/
19-
CC,
19+
CIRCULATE,
2020
/**
2121
* 结束
2222
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class FlowApprovalEvent implements ISyncEvent {
3333
// 催办
3434
public static final int STATE_URGE = 8;
3535
// 抄送
36-
public static final int STATE_CC = 9;
36+
public static final int STATE_CIRCULATE = 9;
3737

3838

3939
private final int state;

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/record/FlowRecord.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,17 @@ public void submitRecord(IFlowOperator flowOperator, BindDataSnapshot snapshot,
230230
this.opinion = opinion;
231231
}
232232

233+
234+
/**
235+
* 传阅流程
236+
*/
237+
public void circulate() {
238+
this.flowSourceDirection = FlowSourceDirection.PASS;
239+
this.flowType = FlowType.CIRCULATE;
240+
this.updateTime = System.currentTimeMillis();
241+
this.opinion = Opinion.circulate();
242+
}
243+
233244
/**
234245
* 转交流程
235246
*/

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/repository/FlowRecordRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@ public interface FlowRecordRepository {
6767
* @param childrenRecords 流程记录
6868
*/
6969
void delete(List<FlowRecord> childrenRecords);
70+
7071
}

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,34 @@ public FlowNodeService(FlowOperatorRepository flowOperatorRepository,
6363
}
6464

6565

66+
/**
67+
* 设置下一个节点
68+
*/
6669
public void setNextNode(FlowNode nextNode) {
6770
this.nextNode = nextNode;
6871
this.nextOperator = currentOperator;
6972
}
7073

7174

75+
/**
76+
* 加载下一个节点
77+
*/
7278
public void loadNextPassNode(FlowNode currentNode){
7379
this.nextNode = matcherNextNode(currentNode, false);
7480
this.nextOperator = currentOperator;
7581
}
7682

83+
/**
84+
* 跳过传阅节点流转
85+
*/
86+
public void skipCirculate() {
87+
this.nextNode = matcherNextNode(nextNode, false);
88+
this.nextOperator = currentOperator;
89+
}
90+
91+
/**
92+
* 加载默认回退节点
93+
*/
7794
public void loadDefaultBackNode(long parentRecordId){
7895
IFlowOperator flowOperator;
7996
// 拒绝时,默认返回上一个已办节点
@@ -94,6 +111,9 @@ public void loadDefaultBackNode(long parentRecordId){
94111
}
95112

96113

114+
/**
115+
* 加载自定义回退节点
116+
*/
97117
public void loadCustomBackNode(FlowNode flowNode, long parentRecordId){
98118
FlowNode nextNode = this.matcherNextNode(flowNode, true);
99119
if (nextNode == null) {
@@ -232,8 +252,8 @@ private List<FlowRecord> errMatcher(FlowNode currentNode, IFlowOperator currentO
232252
/**
233253
* 下一节点的类型
234254
*/
235-
public boolean nextNodeIsCC() {
236-
return nextNode.isCC();
255+
public boolean nextNodeIsCirculate() {
256+
return nextNode.isCirculate();
237257
}
238258

239259

@@ -243,4 +263,6 @@ public boolean nextNodeIsCC() {
243263
public boolean nextNodeIsOver(){
244264
return nextNode.isOverNode();
245265
}
266+
267+
246268
}

0 commit comments

Comments
 (0)