Commit c26862f3e4ec8e30f27b69fa9fafe772f09afa06
1 parent
77d518b9
【功能简化】工作流:移除“导入”流程的功能,原生 bpmn 设计器,已经提供导入
Showing
3 changed files
with
3 additions
and
19 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java
| @@ -4,9 +4,7 @@ import cn.hutool.core.collection.CollUtil; | @@ -4,9 +4,7 @@ import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | 6 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 7 | -import cn.iocoder.yudao.framework.common.util.io.IoUtils; | ||
| 8 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 7 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 9 | -import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 10 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*; | 8 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*; |
| 11 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO; | 9 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO; |
| 12 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelUpdateReqVO; | 10 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelUpdateReqVO; |
| @@ -30,7 +28,6 @@ import org.springframework.security.access.prepost.PreAuthorize; | @@ -30,7 +28,6 @@ import org.springframework.security.access.prepost.PreAuthorize; | ||
| 30 | import org.springframework.validation.annotation.Validated; | 28 | import org.springframework.validation.annotation.Validated; |
| 31 | import org.springframework.web.bind.annotation.*; | 29 | import org.springframework.web.bind.annotation.*; |
| 32 | 30 | ||
| 33 | -import java.io.IOException; | ||
| 34 | import java.util.HashSet; | 31 | import java.util.HashSet; |
| 35 | import java.util.List; | 32 | import java.util.List; |
| 36 | import java.util.Map; | 33 | import java.util.Map; |
| @@ -100,7 +97,7 @@ public class BpmModelController { | @@ -100,7 +97,7 @@ public class BpmModelController { | ||
| 100 | @Operation(summary = "新建模型") | 97 | @Operation(summary = "新建模型") |
| 101 | @PreAuthorize("@ss.hasPermission('bpm:model:create')") | 98 | @PreAuthorize("@ss.hasPermission('bpm:model:create')") |
| 102 | public CommonResult<String> createModel(@Valid @RequestBody BpmModelCreateReqVO createRetVO) { | 99 | public CommonResult<String> createModel(@Valid @RequestBody BpmModelCreateReqVO createRetVO) { |
| 103 | - return success(modelService.createModel(createRetVO, null)); | 100 | + return success(modelService.createModel(createRetVO)); |
| 104 | } | 101 | } |
| 105 | 102 | ||
| 106 | @PutMapping("/update") | 103 | @PutMapping("/update") |
| @@ -111,16 +108,6 @@ public class BpmModelController { | @@ -111,16 +108,6 @@ public class BpmModelController { | ||
| 111 | return success(true); | 108 | return success(true); |
| 112 | } | 109 | } |
| 113 | 110 | ||
| 114 | - @PostMapping("/import") | ||
| 115 | - @Operation(summary = "导入模型") | ||
| 116 | - @PreAuthorize("@ss.hasPermission('bpm:model:import')") | ||
| 117 | - public CommonResult<String> importModel(@Valid BpmModeImportReqVO importReqVO) throws IOException { | ||
| 118 | - BpmModelCreateReqVO createReqVO = BeanUtils.toBean(importReqVO, BpmModelCreateReqVO.class); | ||
| 119 | - // 读取文件 | ||
| 120 | - String bpmnXml = IoUtils.readUtf8(importReqVO.getBpmnFile().getInputStream(), false); | ||
| 121 | - return success(modelService.createModel(createReqVO, bpmnXml)); | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | @PostMapping("/deploy") | 111 | @PostMapping("/deploy") |
| 125 | @Operation(summary = "部署模型") | 112 | @Operation(summary = "部署模型") |
| 126 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 113 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelService.java
| @@ -29,10 +29,9 @@ public interface BpmModelService { | @@ -29,10 +29,9 @@ public interface BpmModelService { | ||
| 29 | * 创建流程模型 | 29 | * 创建流程模型 |
| 30 | * | 30 | * |
| 31 | * @param modelVO 创建信息 | 31 | * @param modelVO 创建信息 |
| 32 | - * @param bpmnXml BPMN XML | ||
| 33 | * @return 创建的流程模型的编号 | 32 | * @return 创建的流程模型的编号 |
| 34 | */ | 33 | */ |
| 35 | - String createModel(@Valid BpmModelCreateReqVO modelVO, String bpmnXml); | 34 | + String createModel(@Valid BpmModelCreateReqVO modelVO); |
| 36 | 35 | ||
| 37 | /** | 36 | /** |
| 38 | * 获得流程模块 | 37 | * 获得流程模块 |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java
| @@ -90,7 +90,7 @@ public class BpmModelServiceImpl implements BpmModelService { | @@ -90,7 +90,7 @@ public class BpmModelServiceImpl implements BpmModelService { | ||
| 90 | 90 | ||
| 91 | @Override | 91 | @Override |
| 92 | @Transactional(rollbackFor = Exception.class) | 92 | @Transactional(rollbackFor = Exception.class) |
| 93 | - public String createModel(@Valid BpmModelCreateReqVO createReqVO, String bpmnXml) { | 93 | + public String createModel(@Valid BpmModelCreateReqVO createReqVO) { |
| 94 | if (!ValidationUtils.isXmlNCName(createReqVO.getKey())) { | 94 | if (!ValidationUtils.isXmlNCName(createReqVO.getKey())) { |
| 95 | throw exception(MODEL_KEY_VALID); | 95 | throw exception(MODEL_KEY_VALID); |
| 96 | } | 96 | } |
| @@ -106,8 +106,6 @@ public class BpmModelServiceImpl implements BpmModelService { | @@ -106,8 +106,6 @@ public class BpmModelServiceImpl implements BpmModelService { | ||
| 106 | model.setTenantId(FlowableUtils.getTenantId()); | 106 | model.setTenantId(FlowableUtils.getTenantId()); |
| 107 | // 保存流程定义 | 107 | // 保存流程定义 |
| 108 | repositoryService.saveModel(model); | 108 | repositoryService.saveModel(model); |
| 109 | - // 保存 BPMN XML | ||
| 110 | - saveModelBpmnXml(model.getId(), bpmnXml); | ||
| 111 | return model.getId(); | 109 | return model.getId(); |
| 112 | } | 110 | } |
| 113 | 111 |