Skip to content

Commit f5f31c4

Browse files
committed
3.3.51
1 parent bc82c0d commit f5f31c4

File tree

17 files changed

+55
-22
lines changed

17 files changed

+55
-22
lines changed

example/example-application/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.50</version>
8+
<version>3.3.51</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-domain/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.50</version>
8+
<version>3.3.51</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-flow/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.50</version>
8+
<version>3.3.51</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-flow/src/main/java/com/codingapi/example/query/FlowRecordQueryImpl.java

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ public class FlowRecordQueryImpl implements FlowRecordQuery {
1818
private final FlowRecordEntityRepository flowRecordEntityRepository;
1919
private final UserRepository userRepository;
2020

21+
22+
@Override
23+
public FlowRecord getFlowRecordById(long id) {
24+
return FlowRecordConvertor.convert(flowRecordEntityRepository.getFlowRecordEntityById(id),userRepository);
25+
}
26+
2127
@Override
2228
public Page<FlowRecord> findAll(PageRequest pageRequest) {
2329
Page<FlowRecordEntity> page = flowRecordEntityRepository.findAllFlowRecords(pageRequest);

example/example-infra-jpa/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.50</version>
8+
<version>3.3.51</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-server/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-example</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.50</version>
8+
<version>3.3.51</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</parent>
1818

1919
<artifactId>springboot-example</artifactId>
20-
<version>3.3.50</version>
20+
<version>3.3.51</version>
2121

2222
<name>springboot-example</name>
2323
<description>springboot-example project for Spring Boot</description>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<groupId>com.codingapi.springboot</groupId>
1717
<artifactId>springboot-parent</artifactId>
18-
<version>3.3.50</version>
18+
<version>3.3.51</version>
1919

2020
<url>https://github.com/codingapi/springboot-framewrok</url>
2121
<name>springboot-parent</name>

springboot-starter-data-authorization/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.codingapi.springboot</groupId>
88
<artifactId>springboot-parent</artifactId>
9-
<version>3.3.50</version>
9+
<version>3.3.51</version>
1010
</parent>
1111

1212
<artifactId>springboot-starter-data-authorization</artifactId>

springboot-starter-data-fast/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-parent</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>3.3.50</version>
8+
<version>3.3.51</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-flow/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>3.3.50</version>
9+
<version>3.3.51</version>
1010
</parent>
1111

1212
<name>springboot-starter-flow</name>

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java

+17-9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.codingapi.springboot.flow.error.OperatorResult;
1010
import com.codingapi.springboot.flow.pojo.FlowResult;
1111
import com.codingapi.springboot.flow.pojo.FlowSubmitResult;
12+
import com.codingapi.springboot.flow.query.FlowRecordQuery;
1213
import com.codingapi.springboot.flow.record.FlowRecord;
1314
import com.codingapi.springboot.flow.result.MessageResult;
1415
import com.codingapi.springboot.flow.service.FlowService;
@@ -67,8 +68,13 @@ public Object getBean(String beanName) {
6768
}
6869

6970

71+
public <T> T getBean(Class<T> clazz) {
72+
return provider.getBean(clazz);
73+
}
74+
75+
7076
/**
71-
* 获取审批意见
77+
* 获取审批意见
7278
*/
7379
public String getAdvice() {
7480
if (opinion != null) {
@@ -179,16 +185,18 @@ public MessageResult rejectFlow() {
179185

180186
/**
181187
* 是否为驳回状态
188+
*
182189
* @return 是否为驳回状态
183190
*/
184-
public boolean isRejectState(){
185-
List<FlowRecord> historyRecords = this.historyRecords;
186-
if(historyRecords!=null) {
187-
for (FlowRecord record : historyRecords) {
188-
if (record.getId() == this.flowRecord.getPreId()) {
189-
return record.getFlowSourceDirection() == FlowSourceDirection.REJECT;
190-
}
191-
}
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;
192200
}
193201
return false;
194202
}

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSessionBeanProvider.java

+7
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,11 @@ public Object getBean(String beanName) {
2727
return null;
2828
}
2929

30+
public <T> T getBean(Class<T> clazz) {
31+
if (spring != null) {
32+
return spring.getBean(clazz);
33+
}
34+
return null;
35+
}
36+
3037
}

springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/query/FlowRecordQuery.java

+12
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,19 @@
99
*/
1010
public interface FlowRecordQuery {
1111

12+
/**
13+
* 根据ID获取流程记录
14+
* @param id 流程记录ID
15+
* @return 流程记录
16+
*/
17+
FlowRecord getFlowRecordById(long id);
18+
1219

20+
/**
21+
* 查询所有流程记录
22+
* @param pageRequest 分页参数
23+
* @return 流程记录
24+
*/
1325
Page<FlowRecord> findAll(PageRequest pageRequest);
1426

1527

springboot-starter-security/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>3.3.50</version>
9+
<version>3.3.51</version>
1010
</parent>
1111

1212
<artifactId>springboot-starter-security</artifactId>

springboot-starter/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.codingapi.springboot</groupId>
77
<artifactId>springboot-parent</artifactId>
8-
<version>3.3.50</version>
8+
<version>3.3.51</version>
99
</parent>
1010
<artifactId>springboot-starter</artifactId>
1111

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
------------------------------------------------------
2-
CodingApi SpringBoot-Starter 3.3.49
2+
CodingApi SpringBoot-Starter 3.3.51
33
springboot version (${spring-boot.version})
44
------------------------------------------------------

0 commit comments

Comments
 (0)