Skip to content

Commit 8717601

Browse files
committed
update 3.5.58
1 parent 0864cc5 commit 8717601

File tree

30 files changed

+169
-16
lines changed

30 files changed

+169
-16
lines changed

admin-ui/src/api/flow.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ export async function startFlow(body:any) {
4242
return post('/api/cmd/flowRecord/startFlow', body);
4343
}
4444

45+
export async function removeFlow(body:any) {
46+
return post('/api/cmd/flowRecord/remove', body);
47+
}
48+
49+
4550
export async function detail(id?:any,workCode?:any) {
4651
return get('/api/query/flowRecord/detail', {id,workCode});
4752
}

admin-ui/src/components/Flow/flow/events.tsx

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
import {useEffect} from "react";
22
import {FormInstance} from "antd/es/form/hooks/useForm";
33
import {FlowData, FlowSubmitResultBuilder, FlowTrySubmitResultBuilder} from "@/components/Flow/flow/data";
4-
import {custom, postponed, recall, saveFlow, startFlow, submitFlow, transfer, trySubmitFlow, urge} from "@/api/flow";
4+
import {
5+
custom,
6+
postponed,
7+
recall,
8+
removeFlow,
9+
saveFlow,
10+
startFlow,
11+
submitFlow,
12+
transfer,
13+
trySubmitFlow,
14+
urge
15+
} from "@/api/flow";
516
import {message} from "antd";
617
import {useDispatch, useSelector} from "react-redux";
718
import {
@@ -231,6 +242,24 @@ export const registerEvents = (id: string,
231242
})
232243
}
233244

245+
246+
// 删除流程
247+
const handleRemoveFlow = () => {
248+
const body = {
249+
recordId,
250+
}
251+
setRequestLoading(true);
252+
removeFlow(body).then(res => {
253+
if (res.success) {
254+
message.success('流程已删除').then();
255+
closeFlow();
256+
}
257+
}).finally(() => {
258+
setRequestLoading(false)
259+
})
260+
}
261+
262+
234263
// 延期流程
235264
const handlePostponedFlow = () => {
236265
const body = {
@@ -418,6 +447,10 @@ export const registerEvents = (id: string,
418447
handleRecallFlow();
419448
break;
420449
}
450+
case 'REMOVE': {
451+
handleRemoveFlow();
452+
break;
453+
}
421454
case 'URGE': {
422455
handlerUrgeFlow();
423456
break;

admin-ui/src/components/Flow/flow/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export type CustomButtonType =
1616
| 'POSTPONED'
1717
| 'URGE'
1818
| 'CUSTOM'
19-
| 'VIEW';
19+
| 'VIEW'
20+
| 'REMOVE';
2021

2122
// 流程图中线的类型
2223
export type EdgeType = 'line' | 'polyline' | 'bezier';

admin-ui/src/components/Flow/panel/ButtonPanel.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ const buttonEventOptions = [
6969
label: "自定义事件",
7070
value: "VIEW"
7171
},
72+
{
73+
label: "删除",
74+
value: "REMOVE"
75+
},
7276
] as {
7377
label: string;
7478
value: CustomButtonType;

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.57</version>
8+
<version>3.3.58</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-application/src/main/java/com/codingapi/example/command/FlowRecordCmdController.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,11 @@ public Response urge(@RequestBody FlowCmd.UrgeFlow request) {
100100
}
101101

102102

103+
@PostMapping("/remove")
104+
public Response remove(@RequestBody FlowCmd.RemoveFlow request) {
105+
User current = userRepository.getUserByUsername(request.getUserName());
106+
flowService.remove(request.getRecordId(), current);
107+
return Response.buildSuccess();
108+
}
109+
103110
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,17 @@ public String getUserName() {
180180
}
181181
}
182182

183+
@Setter
184+
@Getter
185+
public static class RemoveFlow {
186+
187+
private long recordId;
188+
189+
public String getUserName() {
190+
return TokenContext.current().getUsername();
191+
}
192+
}
193+
183194

184195
@Setter
185196
@Getter

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.57</version>
8+
<version>3.3.58</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.57</version>
8+
<version>3.3.58</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

example/example-infra-flow/src/main/java/com/codingapi/example/jpa/FlowProcessEntityRepository.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ public interface FlowProcessEntityRepository extends FastRepository<FlowProcessE
77

88
FlowProcessEntity getFlowProcessEntityByProcessId(String processId);
99

10+
11+
void deleteByProcessId(String processId);
12+
1013
}

0 commit comments

Comments
 (0)