Skip to content

Commit c05a1a0

Browse files
authored
Merge pull request #84 from codingapi/flow-dev
Flow dev
2 parents c88ed6f + 61e2fe2 commit c05a1a0

File tree

38 files changed

+706
-450
lines changed

38 files changed

+706
-450
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ModalForm,
66
PageContainer,
77
ProForm,
8-
ProFormDigit,
8+
ProFormDigit, ProFormSwitch,
99
ProFormText, ProFormTextArea,
1010
ProTable
1111
} from "@ant-design/pro-components";
@@ -254,6 +254,12 @@ const FlowPage = () => {
254254
]}
255255
/>
256256

257+
<ProFormSwitch
258+
name={"skipIfSameApprover"}
259+
tooltip={"是否跳过相同审批人,默认为否"}
260+
label={"是否跳过相同审批人"}
261+
/>
262+
257263
</ModalForm>
258264

259265

example/example-application/pom.xml

Lines changed: 1 addition & 1 deletion
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.47</version>
8+
<version>3.3.48</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-application/src/main/java/com/codingapi/example/pojo/cmd/FlowWorkCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static class CreateRequest{
1616
private String code;
1717
private String description;
1818
private int postponedMax;
19+
private boolean skipIfSameApprover;
1920

2021

2122
public String getUsername(){

example/example-application/src/main/java/com/codingapi/example/router/FlowWorkRouter.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,21 @@ public void save(FlowWorkCmd.CreateRequest request) {
2929
User user = userRepository.getUserByUsername(request.getUsername());
3030
long id = request.getId();
3131
if (id == 0) {
32-
FlowWork flowWork = new FlowWork(request.getCode(),request.getTitle(), request.getDescription(), request.getPostponedMax(), user);
32+
FlowWork flowWork = new FlowWork(
33+
request.getCode(),
34+
request.getTitle(),
35+
request.getDescription(),
36+
request.isSkipIfSameApprover(),
37+
request.getPostponedMax(),
38+
user);
3339
flowWorkRepository.save(flowWork);
3440
} else {
3541
FlowWorkEntity flowWork = flowWorkEntityRepository.getFlowWorkEntityById(id);
3642
flowWork.setTitle(request.getTitle());
3743
flowWork.setCode(request.getCode());
3844
flowWork.setDescription(request.getDescription());
3945
flowWork.setPostponedMax(request.getPostponedMax());
46+
flowWork.setSkipIfSameApprover(request.isSkipIfSameApprover());
4047
flowWork.setUpdateTime(System.currentTimeMillis());
4148
flowWorkEntityRepository.save(flowWork);
4249
}

example/example-domain/pom.xml

Lines changed: 1 addition & 1 deletion
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.47</version>
8+
<version>3.3.48</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-flow/pom.xml

Lines changed: 1 addition & 1 deletion
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.47</version>
8+
<version>3.3.48</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-flow/src/main/java/com/codingapi/example/convert/FlowWorkConvertor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public static FlowWorkEntity convert(FlowWork flowWork) {
1919
entity.setCreateTime(flowWork.getCreateTime());
2020
entity.setUpdateTime(flowWork.getUpdateTime());
2121
entity.setEnable(flowWork.isEnable());
22+
entity.setSkipIfSameApprover(flowWork.isSkipIfSameApprover());
2223
entity.setPostponedMax(flowWork.getPostponedMax());
2324
entity.setSchema(flowWork.getSchema());
2425
return entity;

example/example-infra-flow/src/main/java/com/codingapi/example/entity/FlowWorkEntity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ public class FlowWorkEntity {
2828

2929
private Boolean enable;
3030

31+
/**
32+
* 是否跳过相同审批人,默认为false
33+
*/
34+
private Boolean skipIfSameApprover;
35+
36+
3137
private Integer postponedMax;
3238

3339
@Lob

example/example-infra-flow/src/main/java/com/codingapi/example/repository/FlowProcessRepositoryImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public FlowWork getFlowWorkByProcessId(String processId) {
3131
return null;
3232
}
3333
FlowBackup flowBackup = flowBackupRepository.getFlowBackupById(flowProcess.getBackupId());
34-
return flowBackup.resume(flowOperatorRepository);
34+
if(flowBackup!=null) {
35+
return flowBackup.resume(flowOperatorRepository);
36+
}
37+
return null;
3538
}
3639
}

example/example-infra-flow/src/main/java/com/codingapi/example/repository/FlowWorkRepositoryImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public FlowWork getFlowWorkById(long id) {
4949
entity.getCreateTime(),
5050
entity.getUpdateTime(),
5151
entity.getEnable(),
52+
entity.getSkipIfSameApprover(),
5253
entity.getPostponedMax(),
5354
flowNodes,
5455
flowRelations,
@@ -81,6 +82,7 @@ public FlowWork getFlowWorkByCode(String code) {
8182
entity.getCreateTime(),
8283
entity.getUpdateTime(),
8384
entity.getEnable(),
85+
entity.getSkipIfSameApprover(),
8486
entity.getPostponedMax(),
8587
flowNodes,
8688
flowRelations,

0 commit comments

Comments
 (0)