【功能简化】工作流:移除“导入”流程的功能,原生 bpmn 设计器,已经提供导入
This commit is contained in:
parent
77d518b9c8
commit
c26862f3e4
|
@ -4,9 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.io.IoUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelUpdateReqVO;
|
||||
|
@ -30,7 +28,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -100,7 +97,7 @@ public class BpmModelController {
|
|||
@Operation(summary = "新建模型")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:create')")
|
||||
public CommonResult<String> createModel(@Valid @RequestBody BpmModelCreateReqVO createRetVO) {
|
||||
return success(modelService.createModel(createRetVO, null));
|
||||
return success(modelService.createModel(createRetVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
|
@ -111,16 +108,6 @@ public class BpmModelController {
|
|||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/import")
|
||||
@Operation(summary = "导入模型")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:model:import')")
|
||||
public CommonResult<String> importModel(@Valid BpmModeImportReqVO importReqVO) throws IOException {
|
||||
BpmModelCreateReqVO createReqVO = BeanUtils.toBean(importReqVO, BpmModelCreateReqVO.class);
|
||||
// 读取文件
|
||||
String bpmnXml = IoUtils.readUtf8(importReqVO.getBpmnFile().getInputStream(), false);
|
||||
return success(modelService.createModel(createReqVO, bpmnXml));
|
||||
}
|
||||
|
||||
@PostMapping("/deploy")
|
||||
@Operation(summary = "部署模型")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
|
|
|
@ -29,10 +29,9 @@ public interface BpmModelService {
|
|||
* 创建流程模型
|
||||
*
|
||||
* @param modelVO 创建信息
|
||||
* @param bpmnXml BPMN XML
|
||||
* @return 创建的流程模型的编号
|
||||
*/
|
||||
String createModel(@Valid BpmModelCreateReqVO modelVO, String bpmnXml);
|
||||
String createModel(@Valid BpmModelCreateReqVO modelVO);
|
||||
|
||||
/**
|
||||
* 获得流程模块
|
||||
|
|
|
@ -90,7 +90,7 @@ public class BpmModelServiceImpl implements BpmModelService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createModel(@Valid BpmModelCreateReqVO createReqVO, String bpmnXml) {
|
||||
public String createModel(@Valid BpmModelCreateReqVO createReqVO) {
|
||||
if (!ValidationUtils.isXmlNCName(createReqVO.getKey())) {
|
||||
throw exception(MODEL_KEY_VALID);
|
||||
}
|
||||
|
@ -106,8 +106,6 @@ public class BpmModelServiceImpl implements BpmModelService {
|
|||
model.setTenantId(FlowableUtils.getTenantId());
|
||||
// 保存流程定义
|
||||
repositoryService.saveModel(model);
|
||||
// 保存 BPMN XML
|
||||
saveModelBpmnXml(model.getId(), bpmnXml);
|
||||
return model.getId();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue