Commit d8a7d668a4658b9ece574e4eb497795889bd6a04

Authored by YunaiV
1 parent 9927dd44

【功能新增】BPM:支持通过“历史”进行恢复

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 25 @Schema(description = "流程图标", example = "https://www.iocoder.cn/yudao.jpg")
26 26 private String icon;
27 27  
28   - @Schema(description = "流程分类编码", example = "1")
  28 + @Schema(description = "流程分类编号", example = "1")
29 29 private String category;
30 30 @Schema(description = "流程分类名字", example = "请假")
31 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 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 4 import io.swagger.v3.oas.annotations.media.Schema;
4 5 import lombok.Data;
5 6  
6 7 import java.time.LocalDateTime;
7   -import java.util.List;
8 8  
9 9 @Schema(description = "管理后台 - 流程定义 Response VO")
10 10 @Data
11   -public class BpmProcessDefinitionRespVO {
  11 +public class BpmProcessDefinitionRespVO extends BpmModelMetaInfoVO {
12 12  
13 13 @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
14 14 private String id;
... ... @@ -22,36 +22,19 @@ public class BpmProcessDefinitionRespVO {
22 22 @Schema(description = "流程标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao")
23 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 25 @Schema(description = "流程分类", example = "1")
32 26 private String category;
33 27 @Schema(description = "流程分类名字", example = "请假")
34 28 private String categoryName;
35 29  
  30 + @Schema(description = "流程模型的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "ABC")
  31 + private String modelId;
  32 +
36 33 @Schema(description = "流程模型的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
37 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 36 @Schema(description = "表单名字", example = "请假表单")
44 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 39 @Schema(description = "中断状态-参见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
57 40 private Integer suspensionState; // 参见 SuspensionState 枚举
... ... @@ -67,7 +50,7 @@ public class BpmProcessDefinitionRespVO {
67 50  
68 51 @Schema(description = "流程定义排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
69 52 private Long sort;
70   -
  53 +
71 54 @Schema(description = "BPMN UserTask 用户任务")
72 55 @Data
73 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 2  
3 3 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
4 4 import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler;
5   -import cn.iocoder.yudao.framework.mybatis.core.type.StringListTypeHandler;
6 5 import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelMetaInfoVO;
7 6 import cn.iocoder.yudao.module.bpm.enums.definition.BpmAutoApproveTypeEnum;
8 7 import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum;
... ... @@ -61,6 +60,14 @@ public class BpmProcessDefinitionInfoDO extends BaseDO {
61 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 73 private String icon;
... ... @@ -149,7 +156,7 @@ public class BpmProcessDefinitionInfoDO extends BaseDO {
149 156 *
150 157 * 关联 {@link AdminUserRespDTO#getId()} 字段的数组
151 158 */
152   - @TableField(typeHandler = StringListTypeHandler.class) // 为了可以使用 find_in_set 进行过滤
  159 + @TableField(typeHandler = LongListTypeHandler.class) // 为了可以使用 find_in_set 进行过滤
153 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 143  
144 144 // 插入拓展表
145 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 147 .setModelType(modelMetaInfo.getType()).setSimpleModel(simpleJson);
148   -
149 148 if (form != null) {
150 149 definitionDO.setFormFields(form.getFields()).setFormConf(form.getConf());
151 150 }
... ...