Commit 4054e5fdec80231d955290e16c8f73d0c4071af2

Authored by smallNorthLee
1 parent e5c8be2b

fix: 发起流程报错,返回的VO缺少字段

yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelMetaInfoVO.java
@@ -44,6 +44,12 @@ public class BpmModelMetaInfoVO { @@ -44,6 +44,12 @@ public class BpmModelMetaInfoVO {
44 private Integer formType; 44 private Integer formType;
45 @Schema(description = "表单编号", example = "1024") 45 @Schema(description = "表单编号", example = "1024")
46 private Long formId; // formType 为 NORMAL 使用,必须非空 46 private Long formId; // formType 为 NORMAL 使用,必须非空
  47 + @Schema(description = "表单名字", example = "请假表单")
  48 + private String formName;
  49 + @Schema(description = "表单的配置-JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", requiredMode = Schema.RequiredMode.REQUIRED)
  50 + private String formConf;
  51 + @Schema(description = "表单项的数组-JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", requiredMode = Schema.RequiredMode.REQUIRED)
  52 + private List<String> formFields;
47 @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create") 53 @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create")
48 private String formCustomCreatePath; // 表单类型为 CUSTOM 时,必须非空 54 private String formCustomCreatePath; // 表单类型为 CUSTOM 时,必须非空
49 @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view") 55 @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view")
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java
@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema; @@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
5 import lombok.Data; 5 import lombok.Data;
6 6
7 import java.time.LocalDateTime; 7 import java.time.LocalDateTime;
  8 +import java.util.List;
8 9
9 @Schema(description = "管理后台 - 流程定义 Response VO") 10 @Schema(description = "管理后台 - 流程定义 Response VO")
10 @Data 11 @Data
@@ -19,7 +20,7 @@ public class BpmProcessDefinitionRespVO extends BpmModelMetaInfoVO { @@ -19,7 +20,7 @@ public class BpmProcessDefinitionRespVO extends BpmModelMetaInfoVO {
19 @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道") 20 @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
20 private String name; 21 private String name;
21 22
22 - @Schema(description = "流程标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao") 23 + @Schema(description = "流程标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "easy-build")
23 private String key; 24 private String key;
24 25
25 @Schema(description = "流程分类", example = "1") 26 @Schema(description = "流程分类", example = "1")
@@ -27,15 +28,9 @@ public class BpmProcessDefinitionRespVO extends BpmModelMetaInfoVO { @@ -27,15 +28,9 @@ public class BpmProcessDefinitionRespVO extends BpmModelMetaInfoVO {
27 @Schema(description = "流程分类名字", example = "请假") 28 @Schema(description = "流程分类名字", example = "请假")
28 private String categoryName; 29 private String categoryName;
29 30
30 - @Schema(description = "流程模型的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "ABC")  
31 - private String modelId;  
32 -  
33 @Schema(description = "流程模型的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") 31 @Schema(description = "流程模型的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
34 private Integer modelType; // 参见 BpmModelTypeEnum 枚举类 32 private Integer modelType; // 参见 BpmModelTypeEnum 枚举类
35 33
36 - @Schema(description = "表单名字", example = "请假表单")  
37 - private String formName;  
38 -  
39 @Schema(description = "中断状态-参见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") 34 @Schema(description = "中断状态-参见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
40 private Integer suspensionState; // 参见 SuspensionState 枚举 35 private Integer suspensionState; // 参见 SuspensionState 枚举
41 36
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmProcessDefinitionConvert.java
@@ -74,6 +74,10 @@ public interface BpmProcessDefinitionConvert { @@ -74,6 +74,10 @@ public interface BpmProcessDefinitionConvert {
74 if (deployment != null) { 74 if (deployment != null) {
75 respVO.setDeploymentTime(LocalDateTimeUtil.of(deployment.getDeploymentTime())); 75 respVO.setDeploymentTime(LocalDateTimeUtil.of(deployment.getDeploymentTime()));
76 } 76 }
  77 + // 图标为null时,处理成空字符串,否则copyTo的to.setIcon( from.getIcon() );会报错
  78 + if (respVO.getIcon() == null) {
  79 + respVO.setIcon("");
  80 + }
77 // BpmProcessDefinitionInfoDO 81 // BpmProcessDefinitionInfoDO
78 if (processDefinitionInfo != null) { 82 if (processDefinitionInfo != null) {
79 copyTo(processDefinitionInfo, respVO); 83 copyTo(processDefinitionInfo, respVO);