Skip to content

Commit a31f3be

Browse files
committed
add flow code
1 parent f0b6572 commit a31f3be

File tree

38 files changed

+186
-92
lines changed

38 files changed

+186
-92
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const LeavePage = () => {
9292
>
9393

9494
<ProFormText
95-
name={"flowId"}
95+
name={"flowCode"}
9696
hidden={true}
9797
/>
9898

@@ -143,7 +143,7 @@ const LeavePage = () => {
143143

144144
<FlowSelect visible={flowSelectVisible} setVisible={setFlowSelectVisible} onSelect={(flow) => {
145145

146-
form.setFieldValue('flowId', flow.id);
146+
form.setFieldValue('flowCode', flow.code);
147147
form.setFieldValue('flowName', flow.title);
148148

149149
}}/>

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ const FlowPage = () => {
7575
dataIndex: 'id',
7676
search: false,
7777
},
78+
{
79+
title: '编码',
80+
dataIndex: 'code',
81+
},
7882
{
7983
title: '标题',
8084
dataIndex: 'title',
@@ -218,6 +222,17 @@ const FlowPage = () => {
218222
]}
219223
/>
220224

225+
<ProFormText
226+
name={"code"}
227+
label={"编码"}
228+
rules={[
229+
{
230+
required: true,
231+
message: "请输入编码"
232+
}
233+
]}
234+
/>
235+
221236
<ProFormTextArea
222237
name={"description"}
223238
label={"描述"}

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.2.3.dev</version>
8+
<version>3.3.2.4.dev</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
import com.codingapi.example.domain.User;
44
import com.codingapi.example.pojo.cmd.FlowCmd;
55
import com.codingapi.example.repository.UserRepository;
6-
import com.codingapi.springboot.flow.pojo.FlowDetail;
76
import com.codingapi.springboot.flow.service.FlowService;
87
import com.codingapi.springboot.framework.dto.response.Response;
9-
import com.codingapi.springboot.framework.dto.response.SingleResponse;
108
import lombok.AllArgsConstructor;
119
import lombok.extern.slf4j.Slf4j;
1210
import org.springframework.web.bind.annotation.PostMapping;
@@ -26,7 +24,7 @@ public class FlowRecordCmdController {
2624
@PostMapping("/startFlow")
2725
public Response startFlow(@RequestBody FlowCmd.StartFlow request) {
2826
User current = userRepository.getUserByUsername(request.getUserName());
29-
flowService.startFlow(request.getWorkId(), current, request.getBindData(), request.getAdvice());
27+
flowService.startFlow(request.getWorkCode(), current, request.getBindData(), request.getAdvice());
3028
return Response.buildSuccess();
3129
}
3230

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public Response startLeave(@RequestBody LeaveCmd.StartLeave request) {
3131
leave.setDays(request.getDays());
3232
leave.setCreateTime(System.currentTimeMillis());
3333

34-
flowService.startFlow(request.getFlowId(), user, leave, request.getDesc());
34+
flowService.startFlow(request.getFlowCode(), user, leave, request.getDesc());
3535

3636
return Response.buildSuccess();
3737
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class FlowCmd {
1414
@Getter
1515
public static class StartFlow {
1616

17-
private long workId;
17+
private String workCode;
1818
private String advice;
1919
private JSONObject formData;
2020

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
@@ -13,6 +13,7 @@ public static class CreateRequest{
1313

1414
private long id;
1515
private String title;
16+
private String code;
1617
private String description;
1718
private int postponedMax;
1819

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class LeaveCmd {
1111
public static class StartLeave{
1212
private String desc;
1313
private int days;
14-
private long flowId;
14+
private String flowCode;
1515

1616

1717
public String getUsername(){

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ public void save(FlowWorkCmd.CreateRequest request) {
2626
User user = userRepository.getUserByUsername(request.getUsername());
2727
long id = request.getId();
2828
if (id == 0) {
29-
FlowWork flowWork = new FlowWork(request.getTitle(), request.getDescription(), request.getPostponedMax(), user);
29+
FlowWork flowWork = new FlowWork(request.getCode(),request.getTitle(), request.getDescription(), request.getPostponedMax(), user);
3030
flowWorkRepository.save(flowWork);
3131
} else {
3232
FlowWorkEntity flowWork = flowWorkEntityRepository.getFlowWorkEntityById(id);
3333
flowWork.setTitle(request.getTitle());
34+
flowWork.setCode(request.getCode());
3435
flowWork.setDescription(request.getDescription());
3536
flowWork.setPostponedMax(request.getPostponedMax());
3637
flowWork.setUpdateTime(System.currentTimeMillis());

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.2.3.dev</version>
8+
<version>3.3.2.4.dev</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

0 commit comments

Comments
 (0)