Commit c26862f3e4ec8e30f27b69fa9fafe772f09afa06

Authored by YunaiV
1 parent 77d518b9

【功能简化】工作流:移除“导入”流程的功能,原生 bpmn 设计器,已经提供导入

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 4 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
5 5 import cn.iocoder.yudao.framework.common.pojo.PageResult;
6 6 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
7   -import cn.iocoder.yudao.framework.common.util.io.IoUtils;
8 7 import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
9   -import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
10 8 import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*;
11 9 import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO;
12 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 28 import org.springframework.validation.annotation.Validated;
31 29 import org.springframework.web.bind.annotation.*;
32 30  
33   -import java.io.IOException;
34 31 import java.util.HashSet;
35 32 import java.util.List;
36 33 import java.util.Map;
... ... @@ -100,7 +97,7 @@ public class BpmModelController {
100 97 @Operation(summary = "新建模型")
101 98 @PreAuthorize("@ss.hasPermission('bpm:model:create')")
102 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 103 @PutMapping("/update")
... ... @@ -111,16 +108,6 @@ public class BpmModelController {
111 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 111 @PostMapping("/deploy")
125 112 @Operation(summary = "部署模型")
126 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 29 * 创建流程模型
30 30 *
31 31 * @param modelVO 创建信息
32   - * @param bpmnXml BPMN XML
33 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 90  
91 91 @Override
92 92 @Transactional(rollbackFor = Exception.class)
93   - public String createModel(@Valid BpmModelCreateReqVO createReqVO, String bpmnXml) {
  93 + public String createModel(@Valid BpmModelCreateReqVO createReqVO) {
94 94 if (!ValidationUtils.isXmlNCName(createReqVO.getKey())) {
95 95 throw exception(MODEL_KEY_VALID);
96 96 }
... ... @@ -106,8 +106,6 @@ public class BpmModelServiceImpl implements BpmModelService {
106 106 model.setTenantId(FlowableUtils.getTenantId());
107 107 // 保存流程定义
108 108 repositoryService.saveModel(model);
109   - // 保存 BPMN XML
110   - saveModelBpmnXml(model.getId(), bpmnXml);
111 109 return model.getId();
112 110 }
113 111  
... ...