Skip to content

Commit 39cfcc9

Browse files
authored
Merge pull request #41 from codingapi/dev
Dev
2 parents e6e7b02 + e4cfb0c commit 39cfcc9

14 files changed

Lines changed: 1855 additions & 121 deletions

File tree

designs/approval.pen

Lines changed: 973 additions & 0 deletions
Large diffs are not rendered by default.

flow-engine-framework/src/main/java/com/codingapi/flow/pojo/response/ProcessNode.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
@Data
1717
@NoArgsConstructor
1818
public class ProcessNode {
19+
20+
public final static int STATE_HISTORY = -1;
21+
public final static int STATE_CURRENT = 0;
22+
public final static int STATE_NEXT = 1;
23+
1924
/**
2025
* 节点名称
2126
*/
@@ -30,23 +35,30 @@ public class ProcessNode {
3035
private String nodeType;
3136

3237
/**
33-
* 是否历史记录
38+
* 记录状态
39+
* -1 为历史状态
40+
* 0 为当前状态
41+
* 1 为后续状态
3442
*/
35-
private boolean history;
43+
private int state;
3644

3745
/**
3846
* 节点审批人
3947
*/
4048
private List<FlowOperatorBody> operators;
4149

4250

51+
public boolean isHistory(){
52+
return this.state == STATE_HISTORY;
53+
}
54+
4355
public ProcessNode(FlowRecord flowRecord, Workflow workflow) {
4456
this.nodeId = flowRecord.getNodeId();
4557
IFlowNode flowNode = workflow.getFlowNode(this.nodeId);
4658
this.nodeName = flowNode.getName();
4759
this.nodeType = flowNode.getType();
4860
this.operators = new ArrayList<>();
49-
this.history = true;
61+
this.state = STATE_HISTORY;
5062
this.operators.add(new FlowOperatorBody(flowRecord));
5163
}
5264

@@ -56,7 +68,16 @@ public ProcessNode(IFlowNode flowNode, List<IFlowOperator> operators) {
5668
this.nodeName = flowNode.getName();
5769
this.nodeType = flowNode.getType();
5870
this.operators = operators.stream().map(FlowOperatorBody::new).toList();
59-
this.history = false;
71+
this.state = STATE_NEXT;
72+
}
73+
74+
75+
public boolean isFlowNode(IFlowNode currentNode) {
76+
return this.nodeId.equals(currentNode.getId());
77+
}
78+
79+
public void setCurrentState() {
80+
this.state = STATE_CURRENT;
6081
}
6182

6283

flow-engine-framework/src/main/java/com/codingapi/flow/service/impl/FlowProcessNodeService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ private void fetchNextNode(FlowSession flowSession, List<IFlowNode> nexNodes) {
122122
operators = operatorManager.getOperators();
123123
}
124124
ProcessNode processNode = new ProcessNode(flowNode,operators);
125+
if(processNode.isFlowNode(this.currentNode)){
126+
processNode.setCurrentState();
127+
}
125128
this.nodeList.add(processNode);
126129
List<IFlowNode> nextNodes = workflow.nextNodes(flowNode);
127130
this.fetchNextNode(flowSession.updateSession(flowNode), nextNodes);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# git push command
2+
3+
根据当前调整内容,并创建git的提交指令,并添加对应的提交信息,然后执行git push命令将本地的提交推送到远程仓库。

0 commit comments

Comments
 (0)