@@ -49,16 +49,30 @@ public class ProcessNode {
4949 */
5050 private int state ;
5151
52+
5253 /**
5354 * 节点审批人
5455 */
5556 private List <FlowOperatorBody > operators ;
5657
5758
58- public boolean isHistory (){
59+ public boolean isHistory () {
5960 return this .state == STATE_HISTORY ;
6061 }
6162
63+ private ProcessNode (IFlowNode flowNode ) {
64+ this .state = STATE_HISTORY ;
65+ this .operators = new ArrayList <>();
66+ this .nodeType = flowNode .getType ();
67+ this .nodeName = flowNode .getName ();
68+ this .nodeId = flowNode .getId ();
69+ }
70+
71+ public static ProcessNode createEndNode (Workflow workflow ) {
72+ IFlowNode endNode = workflow .getEndNode ();
73+ return new ProcessNode (endNode );
74+ }
75+
6276 public ProcessNode (FlowRecord flowRecord , Workflow workflow ) {
6377 this .nodeId = flowRecord .getNodeId ();
6478 IFlowNode flowNode = workflow .getFlowNode (this .nodeId );
@@ -92,7 +106,7 @@ public void setCurrentState() {
92106
93107 @ Override
94108 public boolean equals (Object target ) {
95- if (target instanceof ProcessNode ) {
109+ if (target instanceof ProcessNode ) {
96110 ProcessNode targetNode = (ProcessNode ) target ;
97111 return targetNode .getNodeId ().equals (this .getNodeId ());
98112 }
@@ -122,7 +136,11 @@ public static class FlowOperatorBody {
122136 private String signKey ;
123137
124138 /**
125- * 审批记录
139+ * 审批动作
140+ */
141+ private String actionName ;
142+ /**
143+ * 审批人
126144 */
127145 private FlowOperator flowOperator ;
128146 /**
@@ -134,6 +152,7 @@ public FlowOperatorBody(FlowRecord flowRecord) {
134152 this .advice = flowRecord .getAdvice ();
135153 this .signKey = flowRecord .getSignKey ();
136154 this .approveTime = flowRecord .getCreateTime ();
155+ this .actionName = flowRecord .getActionName ();
137156 this .flowOperator = new FlowOperator (flowRecord .getCurrentOperatorId (), flowRecord .getCurrentOperatorName ());
138157 }
139158
0 commit comments