|
4 | 4 | import com.codingapi.springboot.flow.domain.FlowNode;
|
5 | 5 | import com.codingapi.springboot.flow.domain.FlowWork;
|
6 | 6 | import com.codingapi.springboot.flow.domain.Opinion;
|
| 7 | +import com.codingapi.springboot.flow.em.FlowSourceDirection; |
7 | 8 | import com.codingapi.springboot.flow.error.NodeResult;
|
8 | 9 | import com.codingapi.springboot.flow.error.OperatorResult;
|
9 | 10 | import com.codingapi.springboot.flow.pojo.FlowResult;
|
10 | 11 | import com.codingapi.springboot.flow.pojo.FlowSubmitResult;
|
| 12 | +import com.codingapi.springboot.flow.query.FlowRecordQuery; |
11 | 13 | import com.codingapi.springboot.flow.record.FlowRecord;
|
12 | 14 | import com.codingapi.springboot.flow.result.MessageResult;
|
13 | 15 | import com.codingapi.springboot.flow.service.FlowService;
|
@@ -66,9 +68,13 @@ public Object getBean(String beanName) {
|
66 | 68 | }
|
67 | 69 |
|
68 | 70 |
|
| 71 | + public <T> T getBean(Class<T> clazz) { |
| 72 | + return provider.getBean(clazz); |
| 73 | + } |
| 74 | + |
69 | 75 |
|
70 | 76 | /**
|
71 |
| - * 获取审批意见 |
| 77 | + * 获取审批意见 |
72 | 78 | */
|
73 | 79 | public String getAdvice() {
|
74 | 80 | if (opinion != null) {
|
@@ -177,6 +183,24 @@ public MessageResult rejectFlow() {
|
177 | 183 | return MessageResult.create(result);
|
178 | 184 | }
|
179 | 185 |
|
| 186 | + /** |
| 187 | + * 是否为驳回状态 |
| 188 | + * |
| 189 | + * @return 是否为驳回状态 |
| 190 | + */ |
| 191 | + public boolean isRejectState() { |
| 192 | + long preId = flowRecord.getPreId(); |
| 193 | + if (preId == 0) { |
| 194 | + return false; |
| 195 | + } |
| 196 | + FlowRecordQuery flowRecordQuery = getBean(FlowRecordQuery.class); |
| 197 | + FlowRecord preRecord = flowRecordQuery.getFlowRecordById(preId); |
| 198 | + if (preRecord != null) { |
| 199 | + return preRecord.getFlowSourceDirection() == FlowSourceDirection.REJECT; |
| 200 | + } |
| 201 | + return false; |
| 202 | + } |
| 203 | + |
180 | 204 |
|
181 | 205 | /**
|
182 | 206 | * 预提交流程
|
|
0 commit comments