Commit 4054e5fdec80231d955290e16c8f73d0c4071af2
1 parent
e5c8be2b
fix: 发起流程报错,返回的VO缺少字段
Showing
3 changed files
with
12 additions
and
7 deletions
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 | 44 | private Integer formType; |
| 45 | 45 | @Schema(description = "表单编号", example = "1024") |
| 46 | 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 | 53 | @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create") |
| 48 | 54 | private String formCustomCreatePath; // 表单类型为 CUSTOM 时,必须非空 |
| 49 | 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 | 5 | import lombok.Data; |
| 6 | 6 | |
| 7 | 7 | import java.time.LocalDateTime; |
| 8 | +import java.util.List; | |
| 8 | 9 | |
| 9 | 10 | @Schema(description = "管理后台 - 流程定义 Response VO") |
| 10 | 11 | @Data |
| ... | ... | @@ -19,7 +20,7 @@ public class BpmProcessDefinitionRespVO extends BpmModelMetaInfoVO { |
| 19 | 20 | @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道") |
| 20 | 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 | 24 | private String key; |
| 24 | 25 | |
| 25 | 26 | @Schema(description = "流程分类", example = "1") |
| ... | ... | @@ -27,15 +28,9 @@ public class BpmProcessDefinitionRespVO extends BpmModelMetaInfoVO { |
| 27 | 28 | @Schema(description = "流程分类名字", example = "请假") |
| 28 | 29 | private String categoryName; |
| 29 | 30 | |
| 30 | - @Schema(description = "流程模型的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "ABC") | |
| 31 | - private String modelId; | |
| 32 | - | |
| 33 | 31 | @Schema(description = "流程模型的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") |
| 34 | 32 | private Integer modelType; // 参见 BpmModelTypeEnum 枚举类 |
| 35 | 33 | |
| 36 | - @Schema(description = "表单名字", example = "请假表单") | |
| 37 | - private String formName; | |
| 38 | - | |
| 39 | 34 | @Schema(description = "中断状态-参见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 40 | 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 | 74 | if (deployment != null) { |
| 75 | 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 | 81 | // BpmProcessDefinitionInfoDO |
| 78 | 82 | if (processDefinitionInfo != null) { |
| 79 | 83 | copyTo(processDefinitionInfo, respVO); | ... | ... |