diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/BpmModelController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/BpmModelController.java index ecd1c430c..1f58beff7 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/BpmModelController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/BpmModelController.java @@ -56,7 +56,7 @@ public class BpmModelController { public CommonResult importModel(@Valid BpmModeImportReqVO importReqVO) throws IOException { BpmModelCreateReqVO createReqVO = BpmModelConvert.INSTANCE.convert(importReqVO); // 读取文件 - createReqVO.setBpmnXml(IoUtils.readUtf8(importReqVO.getBpmnFile().getInputStream(), false)); +// createReqVO.setBpmnXml(IoUtils.readUtf8(importReqVO.getBpmnFile().getInputStream(), false)); return success(bpmModelService.createModel(createReqVO)); } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/vo/BpmModelCreateReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/vo/BpmModelCreateReqVO.java index 871fb2859..94a53a34d 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/vo/BpmModelCreateReqVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/vo/BpmModelCreateReqVO.java @@ -10,12 +10,17 @@ import javax.validation.constraints.NotEmpty; @ApiModel("流程模型的创建 Request VO") @Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class BpmModelCreateReqVO extends BpmModelBaseVO { +public class BpmModelCreateReqVO { - @ApiModelProperty(value = "BPMN XML", required = true) - @NotEmpty(message = "BPMN XML 不能为空") - private String bpmnXml; + @ApiModelProperty(value = "流程标识", required = true, example = "process_yudao") + @NotEmpty(message = "流程标识不能为空") + private String key; + + @ApiModelProperty(value = "流程名称", required = true, example = "芋道") + @NotEmpty(message = "流程名称不能为空") + private String name; + + @ApiModelProperty(value = "流程描述", example = "我是描述") + private String description; } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/vo/BpmModelUpdateReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/vo/BpmModelUpdateReqVO.java index fb1d2a185..5cc6f03ec 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/vo/BpmModelUpdateReqVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/vo/BpmModelUpdateReqVO.java @@ -18,8 +18,19 @@ public class BpmModelUpdateReqVO extends BpmModelBaseVO { @NotEmpty(message = "编号不能为空") private String id; + @ApiModelProperty(value = "流程名称", example = "芋道") + private String name; + + @ApiModelProperty(value = "流程描述", example = "我是描述") + private String description; + + @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") + private String category; + + @ApiModelProperty(value = "表单编号", example = "1024") + private Long formId; + @ApiModelProperty(value = "BPMN XML", required = true) - @NotEmpty(message = "BPMN XML 不能为空") private String bpmnXml; } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/model/BpmModelConvert.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/model/BpmModelConvert.java index 25c643a90..aacf1e17a 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/model/BpmModelConvert.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/model/BpmModelConvert.java @@ -95,8 +95,7 @@ public interface BpmModelConvert { default void copy(Model model, BpmModelCreateReqVO bean) { model.setName(bean.getName()); model.setKey(bean.getKey()); - model.setCategory(bean.getCategory()); - model.setMetaInfo(JsonUtils.toJsonString(this.buildMetaInfo(bean.getDescription(), bean.getFormId()))); + model.setMetaInfo(JsonUtils.toJsonString(this.buildMetaInfo(bean.getDescription(), null))); } default void copy(Model model, BpmModelUpdateReqVO bean) { diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/definition/BpmModelFormTypeEnum.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/definition/BpmModelFormTypeEnum.java new file mode 100644 index 000000000..917ec0f29 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/definition/BpmModelFormTypeEnum.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.adminserver.modules.bpm.enums.definition; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * BPM 模型的表单类型的枚举 + * + * @author 芋道源码 + */ +@Getter +@AllArgsConstructor +public enum BpmModelFormTypeEnum { + + NORMAL(10, "流程表单"), // 对应 BpmFormDO + CUSTOM(20, "业务表单") // 业务自己定义的表单,自己进行数据的存储 + ; + + private final Integer type; + private final String desc; +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/dto/BpmModelMetaInfoRespDTO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/dto/BpmModelMetaInfoRespDTO.java index f52bbb2c3..651fbf9ca 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/dto/BpmModelMetaInfoRespDTO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/dto/BpmModelMetaInfoRespDTO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto; +import cn.iocoder.yudao.adminserver.modules.bpm.enums.definition.BpmModelFormTypeEnum; import lombok.Data; /** @@ -15,9 +16,24 @@ public class BpmModelMetaInfoRespDTO { * 流程描述 */ private String description; + /** + * 表单类型 + */ + private Long formType; /** * 表单编号 + * 在表单类型为 {@link BpmModelFormTypeEnum#NORMAL} 时 */ private Long formId; + /** + * 自定义表单的提交路径,使用 Vue 的路由地址 + * 在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时 + */ + private String formCustomSubmitPath; + /** + * 自定义表单的查看路径,使用 Vue 的路由地址 + * 在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时 + */ + private String formCustomViewPath; } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java index d27ac9460..b0b184138 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java @@ -121,15 +121,12 @@ public class BpmModelServiceImpl implements BpmModelService { BpmModelConvert.INSTANCE.copy(model, createReqVO); // 保存流程定义 repositoryService.saveModel(model); - // 添加 BPMN XML - repositoryService.addModelEditorSource(model.getId(), StrUtil.utf8Bytes(createReqVO.getBpmnXml())); return model.getId(); } @Override @Transactional(rollbackFor = Exception.class) // 因为进行多个 activiti 操作,所以开启事务 public void updateModel(BpmModelUpdateReqVO updateReqVO) { - checkKeyNCName(updateReqVO.getKey()); // 校验流程模型存在 Model model = repositoryService.getModel(updateReqVO.getId()); if (model == null) { diff --git a/yudao-admin-server/src/main/resources/application-dev.yaml b/yudao-admin-server/src/main/resources/application-dev.yaml index e349e3239..57026afec 100644 --- a/yudao-admin-server/src/main/resources/application-dev.yaml +++ b/yudao-admin-server/src/main/resources/application-dev.yaml @@ -63,12 +63,12 @@ spring: # 工作流 Activiti 配置 activiti: - #1.false:默认值,activiti启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常 - #2.true:启动时会对数据库中所有表进行更新操作,如果表存在,不做处理,反之,自动创建表 - #3.create_drop:启动时自动创建表,关闭时自动删除表 - #4.drop_create:启动时,删除旧表,再创建新表 + # 1. false:默认值,activiti启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常 + # 2. true:启动时会对数据库中所有表进行更新操作,如果表存在,不做处理,反之,自动创建表 + # 3. create_drop:启动时自动创建表,关闭时自动删除表 + # 4. drop_create:启动时,删除旧表,再创建新表 database-schema-update: true - #activiti7默认不生成历史信息表,需手动设置开启 + # activiti7 默认不生成历史信息表,需手动设置开启 db-history-used: true check-process-definitions: true #full:保存历史数据的最高级别,可保存全部流程相关细节,包括流程流转各节点参数 diff --git a/yudao-admin-ui/src/views/bpm/model/index.vue b/yudao-admin-ui/src/views/bpm/model/index.vue index 469184fe5..ca9e78b9c 100644 --- a/yudao-admin-ui/src/views/bpm/model/index.vue +++ b/yudao-admin-ui/src/views/bpm/model/index.vue @@ -109,51 +109,50 @@ + + + + + + + + + + + + + + + + + + + - +
将文件拖到此处,或 点击上传
提示:仅允许导入“bpm”或“xml”格式文件!
- - - - -
- + + + + - - - - - - - - - - @@ -169,14 +168,12 @@