Commit d8a7d668a4658b9ece574e4eb497795889bd6a04
1 parent
9927dd44
【功能新增】BPM:支持通过“历史”进行恢复
Showing
4 changed files
with
17 additions
and
28 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java
| @@ -25,7 +25,7 @@ public class BpmModelRespVO extends BpmModelMetaInfoVO { | @@ -25,7 +25,7 @@ public class BpmModelRespVO extends BpmModelMetaInfoVO { | ||
| 25 | @Schema(description = "流程图标", example = "https://www.iocoder.cn/yudao.jpg") | 25 | @Schema(description = "流程图标", example = "https://www.iocoder.cn/yudao.jpg") |
| 26 | private String icon; | 26 | private String icon; |
| 27 | 27 | ||
| 28 | - @Schema(description = "流程分类编码", example = "1") | 28 | + @Schema(description = "流程分类编号", example = "1") |
| 29 | private String category; | 29 | private String category; |
| 30 | @Schema(description = "流程分类名字", example = "请假") | 30 | @Schema(description = "流程分类名字", example = "请假") |
| 31 | private String categoryName; | 31 | private String categoryName; |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java
| 1 | package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; | 1 | package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelMetaInfoVO; | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.Data; | 5 | import lombok.Data; |
| 5 | 6 | ||
| 6 | import java.time.LocalDateTime; | 7 | import java.time.LocalDateTime; |
| 7 | -import java.util.List; | ||
| 8 | 8 | ||
| 9 | @Schema(description = "管理后台 - 流程定义 Response VO") | 9 | @Schema(description = "管理后台 - 流程定义 Response VO") |
| 10 | @Data | 10 | @Data |
| 11 | -public class BpmProcessDefinitionRespVO { | 11 | +public class BpmProcessDefinitionRespVO extends BpmModelMetaInfoVO { |
| 12 | 12 | ||
| 13 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | 13 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 14 | private String id; | 14 | private String id; |
| @@ -22,36 +22,19 @@ public class BpmProcessDefinitionRespVO { | @@ -22,36 +22,19 @@ public class BpmProcessDefinitionRespVO { | ||
| 22 | @Schema(description = "流程标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao") | 22 | @Schema(description = "流程标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao") |
| 23 | private String key; | 23 | private String key; |
| 24 | 24 | ||
| 25 | - @Schema(description = "流程图标", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/yudao.jpg") | ||
| 26 | - private String icon; | ||
| 27 | - | ||
| 28 | - @Schema(description = "流程描述", example = "我是描述") | ||
| 29 | - private String description; | ||
| 30 | - | ||
| 31 | @Schema(description = "流程分类", example = "1") | 25 | @Schema(description = "流程分类", example = "1") |
| 32 | private String category; | 26 | private String category; |
| 33 | @Schema(description = "流程分类名字", example = "请假") | 27 | @Schema(description = "流程分类名字", example = "请假") |
| 34 | private String categoryName; | 28 | private String categoryName; |
| 35 | 29 | ||
| 30 | + @Schema(description = "流程模型的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "ABC") | ||
| 31 | + private String modelId; | ||
| 32 | + | ||
| 36 | @Schema(description = "流程模型的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") | 33 | @Schema(description = "流程模型的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") |
| 37 | private Integer modelType; // 参见 BpmModelTypeEnum 枚举类 | 34 | private Integer modelType; // 参见 BpmModelTypeEnum 枚举类 |
| 38 | 35 | ||
| 39 | - @Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1") | ||
| 40 | - private Integer formType; | ||
| 41 | - @Schema(description = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024") | ||
| 42 | - private Long formId; | ||
| 43 | @Schema(description = "表单名字", example = "请假表单") | 36 | @Schema(description = "表单名字", example = "请假表单") |
| 44 | private String formName; | 37 | private String formName; |
| 45 | - @Schema(description = "表单的配置-JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 46 | - private String formConf; | ||
| 47 | - @Schema(description = "表单项的数组-JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 48 | - private List<String> formFields; | ||
| 49 | - @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", | ||
| 50 | - example = "/bpm/oa/leave/create") | ||
| 51 | - private String formCustomCreatePath; | ||
| 52 | - @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", | ||
| 53 | - example = "/bpm/oa/leave/view") | ||
| 54 | - private String formCustomViewPath; | ||
| 55 | 38 | ||
| 56 | @Schema(description = "中断状态-参见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | 39 | @Schema(description = "中断状态-参见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 57 | private Integer suspensionState; // 参见 SuspensionState 枚举 | 40 | private Integer suspensionState; // 参见 SuspensionState 枚举 |
| @@ -67,7 +50,7 @@ public class BpmProcessDefinitionRespVO { | @@ -67,7 +50,7 @@ public class BpmProcessDefinitionRespVO { | ||
| 67 | 50 | ||
| 68 | @Schema(description = "流程定义排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | 51 | @Schema(description = "流程定义排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 69 | private Long sort; | 52 | private Long sort; |
| 70 | - | 53 | + |
| 71 | @Schema(description = "BPMN UserTask 用户任务") | 54 | @Schema(description = "BPMN UserTask 用户任务") |
| 72 | @Data | 55 | @Data |
| 73 | public static class UserTask { | 56 | public static class UserTask { |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/definition/BpmProcessDefinitionInfoDO.java
| @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.definition; | @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.definition; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler; | 4 | import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler; |
| 5 | -import cn.iocoder.yudao.framework.mybatis.core.type.StringListTypeHandler; | ||
| 6 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelMetaInfoVO; | 5 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelMetaInfoVO; |
| 7 | import cn.iocoder.yudao.module.bpm.enums.definition.BpmAutoApproveTypeEnum; | 6 | import cn.iocoder.yudao.module.bpm.enums.definition.BpmAutoApproveTypeEnum; |
| 8 | import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum; | 7 | import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum; |
| @@ -61,6 +60,14 @@ public class BpmProcessDefinitionInfoDO extends BaseDO { | @@ -61,6 +60,14 @@ public class BpmProcessDefinitionInfoDO extends BaseDO { | ||
| 61 | private Integer modelType; | 60 | private Integer modelType; |
| 62 | 61 | ||
| 63 | /** | 62 | /** |
| 63 | + * 流程分类的编码 | ||
| 64 | + * | ||
| 65 | + * 关联 {@link BpmCategoryDO#getCode()} | ||
| 66 | + * | ||
| 67 | + * 为什么要存储?原因是,{@link ProcessDefinition#getCategory()} 无法设置 | ||
| 68 | + */ | ||
| 69 | + private String category; | ||
| 70 | + /** | ||
| 64 | * 图标 | 71 | * 图标 |
| 65 | */ | 72 | */ |
| 66 | private String icon; | 73 | private String icon; |
| @@ -149,7 +156,7 @@ public class BpmProcessDefinitionInfoDO extends BaseDO { | @@ -149,7 +156,7 @@ public class BpmProcessDefinitionInfoDO extends BaseDO { | ||
| 149 | * | 156 | * |
| 150 | * 关联 {@link AdminUserRespDTO#getId()} 字段的数组 | 157 | * 关联 {@link AdminUserRespDTO#getId()} 字段的数组 |
| 151 | */ | 158 | */ |
| 152 | - @TableField(typeHandler = StringListTypeHandler.class) // 为了可以使用 find_in_set 进行过滤 | 159 | + @TableField(typeHandler = LongListTypeHandler.class) // 为了可以使用 find_in_set 进行过滤 |
| 153 | private List<Long> managerUserIds; | 160 | private List<Long> managerUserIds; |
| 154 | 161 | ||
| 155 | /** | 162 | /** |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmProcessDefinitionServiceImpl.java
| @@ -143,9 +143,8 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ | @@ -143,9 +143,8 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ | ||
| 143 | 143 | ||
| 144 | // 插入拓展表 | 144 | // 插入拓展表 |
| 145 | BpmProcessDefinitionInfoDO definitionDO = BeanUtils.toBean(modelMetaInfo, BpmProcessDefinitionInfoDO.class) | 145 | BpmProcessDefinitionInfoDO definitionDO = BeanUtils.toBean(modelMetaInfo, BpmProcessDefinitionInfoDO.class) |
| 146 | - .setModelId(model.getId()).setProcessDefinitionId(definition.getId()) | 146 | + .setModelId(model.getId()).setCategory(model.getCategory()).setProcessDefinitionId(definition.getId()) |
| 147 | .setModelType(modelMetaInfo.getType()).setSimpleModel(simpleJson); | 147 | .setModelType(modelMetaInfo.getType()).setSimpleModel(simpleJson); |
| 148 | - | ||
| 149 | if (form != null) { | 148 | if (form != null) { |
| 150 | definitionDO.setFormFields(form.getFields()).setFormConf(form.getConf()); | 149 | definitionDO.setFormFields(form.getFields()).setFormConf(form.getConf()); |
| 151 | } | 150 | } |