调整流程定义模块的代码
parent
ff7b9d9d26
commit
a0c7692c3c
|
@ -1,50 +1,50 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.FileResp;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model.ModelPageReqVo;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model.ModelVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.ModelPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.BpmModelCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.workflow.BpmModelService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.repository.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 工作流模型
|
||||
* @author yunlongn
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/workflow/models")
|
||||
@Api(tags = "工作流模型")
|
||||
@RequiredArgsConstructor
|
||||
public class ModelController {
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
private final BpmModelService bpmModelService;
|
||||
@Api(tags = "流程定义")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/model")
|
||||
@Validated
|
||||
public class BpmModelController {
|
||||
|
||||
@Resource
|
||||
private BpmModelService bpmModelService;
|
||||
|
||||
// TODO @芋艿:权限
|
||||
|
||||
@GetMapping ("/page")
|
||||
@ApiOperation(value = "分页数据")
|
||||
public CommonResult<PageResult<Model>> pageList(ModelPageReqVo modelPageReqVo) {
|
||||
return CommonResult.success(bpmModelService.pageList(modelPageReqVo));
|
||||
public CommonResult<PageResult<Model>> getModelPage(ModelPageReqVO pageVO) {
|
||||
return success(bpmModelService.getModelPage(pageVO));
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation(value = "新建模型")
|
||||
public CommonResult<String> newModel(@RequestBody ModelVO modelVO) {
|
||||
return bpmModelService.newModel(modelVO);
|
||||
public CommonResult<String> createModel(@RequestBody BpmModelCreateReqVO createRetVO) {
|
||||
return success(bpmModelService.createModel(createRetVO));
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@ApiOperation(value = "修改模型属性")
|
||||
public CommonResult<String> updateModel(@RequestBody ModelVO modelVO) {
|
||||
public CommonResult<String> updateModel(@RequestBody BpmModelCreateReqVO modelVO) {
|
||||
return bpmModelService.updateModel(modelVO);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* 流程定义 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class BpmModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "流程名称", required = true, example = "芋道")
|
||||
@NotEmpty(message = "流程名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "流程描述", example = "我是描述")
|
||||
@NotEmpty(message = "流程描述不能为空")
|
||||
private String description;
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@ApiModel("流程定义的创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmModelCreateReqVO extends BpmModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "流程标识", required = true, example = "process_yudao")
|
||||
@NotEmpty(message = "流程标识不能为空")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = "BPMN XML", required = true)
|
||||
@NotEmpty(message = "BPMN XML 不能为空")
|
||||
private String bpmnXml;
|
||||
|
||||
// @ApiModelProperty(value = "版本号")
|
||||
// private Integer revision;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("流程定义 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmModelRespVO extends BpmModelBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "编号", required = true, example = "1024")
|
||||
private String id;
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model;
|
||||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
@ -7,14 +7,14 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author yunlong.li
|
||||
*/
|
||||
@ApiModel("模型分页 Request VO")
|
||||
|
||||
@ApiModel("流程定义分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ModelPageReqVo extends PageParam {
|
||||
@ApiModelProperty("模型名字")
|
||||
public class ModelPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "名字", example = "芋道")
|
||||
private String name;
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author yunlong.li
|
||||
*/
|
||||
@ApiModel("模型出口内容 Request VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class ModelRespVo {
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
// TODO @Li:新增和更新 ModelVO 最好分开哈。
|
||||
// TODO @Li:swagger 的 example 属性,还有参数校验要加一下哈。
|
||||
// TODO @Li:前缀要加 Bpm 。因为是单体工程,不拆分,很容易重复类名
|
||||
/**
|
||||
* 新增模型 VO
|
||||
* @author yunlongn
|
||||
*/
|
||||
@Data
|
||||
public class ModelVO {
|
||||
|
||||
@ApiModelProperty(value = "模型Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "模型名字", required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "模型描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "版本号")
|
||||
private Integer revision;
|
||||
|
||||
@ApiModelProperty(value = "key值")
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = "bpmnXml")
|
||||
private String bpmnXml;
|
||||
}
|
|
@ -1,10 +1,7 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.convert.workflow;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.TodoTaskRespVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model.ModelRespVo;
|
||||
import org.activiti.api.task.model.Task;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.BpmModelRespVO;
|
||||
import org.activiti.engine.repository.Model;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
|
@ -16,5 +13,5 @@ import org.mapstruct.factory.Mappers;
|
|||
public interface ModelConvert {
|
||||
ModelConvert INSTANCE = Mappers.getMapper(ModelConvert.class);
|
||||
|
||||
ModelRespVo convert(Model model);
|
||||
BpmModelRespVO convert(Model model);
|
||||
}
|
||||
|
|
|
@ -1,41 +1,43 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.workflow;
|
||||
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.FileResp;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model.ModelPageReqVo;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model.ModelVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.ModelPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.BpmModelCreateReqVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import org.activiti.engine.repository.Model;
|
||||
|
||||
/**
|
||||
* 工作流模型接口
|
||||
* 流程定义接口
|
||||
*
|
||||
* @author yunlongn
|
||||
*/
|
||||
public interface BpmModelService {
|
||||
|
||||
/**
|
||||
* 模型数据分页返回
|
||||
* @param modelPageReqVo 分页入参
|
||||
* @return 分页model
|
||||
* 获得流程定义分页
|
||||
*
|
||||
* @param pageVO 分页查询
|
||||
* @return 流程定义分页
|
||||
*/
|
||||
// TODO @Li:getBpmModelPage。命名上,项目是 动词 + 完整实体;
|
||||
PageResult<Model> pageList(ModelPageReqVo modelPageReqVo);
|
||||
PageResult<Model> getModelPage(ModelPageReqVO pageVO);
|
||||
|
||||
// TODO @Li:不用返回 CommonResult
|
||||
// TODO @Li:createBpmModal。
|
||||
/**
|
||||
* 新增一个模型
|
||||
* @param modelVO 模型对象
|
||||
* @return 返回成功
|
||||
* 创建流程定义
|
||||
*
|
||||
* @param modelVO 创建信息
|
||||
* @return 创建的流程定义的编号
|
||||
*/
|
||||
CommonResult<String> newModel(ModelVO modelVO);
|
||||
String createModel(BpmModelCreateReqVO modelVO);
|
||||
|
||||
/**
|
||||
* 修改模型属性,填充bpmn数据
|
||||
* @param modelVO 模型对象
|
||||
* @return 返回成功
|
||||
*/
|
||||
CommonResult<String> updateModel(ModelVO modelVO);
|
||||
CommonResult<String> updateModel(BpmModelCreateReqVO modelVO);
|
||||
|
||||
/**
|
||||
* 部署模型 使模型成为一个 process
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package cn.iocoder.yudao.adminserver.modules.bpm.service.workflow.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.BpmModelCreateReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.ModelPageReqVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.FileResp;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model.ModelPageReqVo;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.controller.workflow.vo.model.ModelVO;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants;
|
||||
import cn.iocoder.yudao.adminserver.modules.bpm.service.workflow.BpmModelService;
|
||||
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.iocoder.yudao.framework.common.util.object.PageUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.bpmn.converter.BpmnXMLConverter;
|
||||
import org.activiti.bpmn.model.BpmnModel;
|
||||
|
@ -21,7 +21,9 @@ import org.activiti.engine.repository.ModelQuery;
|
|||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.xml.stream.XMLInputFactory;
|
||||
import javax.xml.stream.XMLStreamReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
@ -31,80 +33,75 @@ import java.util.List;
|
|||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 工作流模型实现
|
||||
* 流程定义实现
|
||||
*
|
||||
* @author yunlongn
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class BpmModelServiceImpl implements BpmModelService {
|
||||
|
||||
private final RepositoryService repositoryService;
|
||||
@Resource
|
||||
private RepositoryService repositoryService;
|
||||
|
||||
@Override
|
||||
public PageResult<Model> pageList(ModelPageReqVo modelPageReqVo) {
|
||||
public PageResult<Model> getModelPage(ModelPageReqVO pageVO) {
|
||||
ModelQuery modelQuery = repositoryService.createModelQuery();
|
||||
String likeName = modelPageReqVo.getName();
|
||||
if (StrUtil.isNotBlank(likeName)){
|
||||
modelQuery.modelNameLike("%"+likeName+"%");
|
||||
if (StrUtil.isNotBlank(pageVO.getName())) {
|
||||
modelQuery.modelNameLike("%" + pageVO.getName() + "%"); // 模糊匹配
|
||||
}
|
||||
// 执行查询
|
||||
List<Model> models = modelQuery.orderByCreateTime().desc()
|
||||
.listPage((modelPageReqVo.getPageNo() - 1) * modelPageReqVo.getPageSize(), modelPageReqVo.getPageSize());
|
||||
return new PageResult<>(models, modelQuery.count());
|
||||
.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize());
|
||||
long modelCount = modelQuery.count();
|
||||
return new PageResult<>(models, modelCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<String> newModel(ModelVO modelVO) {
|
||||
try {
|
||||
//初始化一个空模型
|
||||
Model model = repositoryService.newModel();
|
||||
// TODO @Li:name 可以直接赋值过去哈,不用声明一个变量
|
||||
String name = Optional.ofNullable(modelVO.getName()).orElse("new-process");
|
||||
//设置一些默认信息
|
||||
model.setName(name);
|
||||
model.setKey(Optional.ofNullable(modelVO.getKey()).orElse("processKey"));
|
||||
model.setMetaInfo(JsonUtils.toJsonString(modelVO));
|
||||
repositoryService.saveModel(model);
|
||||
if (!ObjectUtils.isEmpty(modelVO.getBpmnXml())) {
|
||||
repositoryService.addModelEditorSource(model.getId(), modelVO.getBpmnXml().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
return CommonResult.success(model.getId());
|
||||
}catch (Exception e){
|
||||
// TODO @Li:这里可以捕获,交给全局么?
|
||||
// TODO @Li:异常,是不是 error 比较合适,然后堆栈使用 e 直接打印即可
|
||||
log.info("模型创建失败!modelVO = {} e = {} ", modelVO, ExceptionUtils.getStackTrace(e));
|
||||
throw ServiceExceptionUtil.exception(BpmErrorCodeConstants.BPMN_MODEL_ERROR);
|
||||
}
|
||||
public String createModel(BpmModelCreateReqVO createReqVO) {
|
||||
// TODO 芋艿:校验 key 是否重复
|
||||
// 创建流程定义
|
||||
Model model = repositoryService.newModel();
|
||||
model.setName(createReqVO.getName());
|
||||
model.setKey(createReqVO.getKey());
|
||||
// TODO 芋艿:metaInfo,description、category、formId
|
||||
model.setMetaInfo(JsonUtils.toJsonString(createReqVO));
|
||||
// 保存流程定义
|
||||
repositoryService.saveModel(model);
|
||||
// 添加 BPMN XML
|
||||
repositoryService.addModelEditorSource(model.getId(), StrUtil.utf8Bytes(createReqVO.getBpmnXml()));
|
||||
return model.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<String> updateModel(ModelVO modelVO) {
|
||||
try {
|
||||
Model model = repositoryService.getModel(modelVO.getId());
|
||||
if (ObjectUtils.isEmpty(model)) {
|
||||
throw ServiceExceptionUtil.exception(BpmErrorCodeConstants.BPMN_MODEL_EDITOR_SOURCE_NOT_EXISTS);
|
||||
}
|
||||
// 只能修改名字跟描述
|
||||
ModelVO modelCreateVO = JsonUtils.parseObject(model.getMetaInfo(), ModelVO.class);
|
||||
if (ObjectUtils.isEmpty(modelCreateVO)) {
|
||||
modelCreateVO = new ModelVO();
|
||||
}
|
||||
modelCreateVO.setName(modelVO.getName());
|
||||
modelCreateVO.setDescription(modelVO.getDescription());
|
||||
model.setMetaInfo(JsonUtils.toJsonString(modelCreateVO));
|
||||
model.setName(modelVO.getName());
|
||||
model.setKey(modelVO.getKey());
|
||||
// 更新模型
|
||||
repositoryService.saveModel(model);
|
||||
|
||||
repositoryService.addModelEditorSource(model.getId(), modelVO.getBpmnXml().getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
return CommonResult.success("保存成功");
|
||||
}catch (Exception e){
|
||||
log.info("模型更新失败!modelVO = {}", modelVO, e);
|
||||
throw ServiceExceptionUtil.exception(BpmErrorCodeConstants.BPMN_MODEL_ERROR);
|
||||
}
|
||||
public CommonResult<String> updateModel(BpmModelCreateReqVO modelVO) {
|
||||
// try {
|
||||
// Model model = repositoryService.getModel(modelVO.getId());
|
||||
// if (ObjectUtils.isEmpty(model)) {
|
||||
// throw ServiceExceptionUtil.exception(BpmErrorCodeConstants.BPMN_MODEL_EDITOR_SOURCE_NOT_EXISTS);
|
||||
// }
|
||||
// // 只能修改名字跟描述
|
||||
// BpmModelCreateReqVO modelCreateVO = JsonUtils.parseObject(model.getMetaInfo(), BpmModelCreateReqVO.class);
|
||||
// if (ObjectUtils.isEmpty(modelCreateVO)) {
|
||||
// modelCreateVO = new BpmModelCreateReqVO();
|
||||
// }
|
||||
// modelCreateVO.setName(modelVO.getName());
|
||||
// modelCreateVO.setDescription(modelVO.getDescription());
|
||||
// model.setMetaInfo(JsonUtils.toJsonString(modelCreateVO));
|
||||
// model.setName(modelVO.getName());
|
||||
// model.setKey(modelVO.getKey());
|
||||
// // 更新模型
|
||||
// repositoryService.saveModel(model);
|
||||
//
|
||||
// repositoryService.addModelEditorSource(model.getId(), modelVO.getBpmnXml().getBytes(StandardCharsets.UTF_8));
|
||||
//
|
||||
// return CommonResult.success("保存成功");
|
||||
// }catch (Exception e){
|
||||
// log.info("模型更新失败!modelVO = {}", modelVO, e);
|
||||
// throw ServiceExceptionUtil.exception(BpmErrorCodeConstants.BPMN_MODEL_ERROR);
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
|
||||
export function page(query) {
|
||||
return request({
|
||||
url: '/workflow/models/page',
|
||||
url: '/bpm/model/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function exportBpmnXml(query) {
|
||||
return request({
|
||||
url: '/workflow/models/exportBpmnXml',
|
||||
url: '/bpm/model/exportBpmnXml',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
@ -18,7 +18,7 @@ export function exportBpmnXml(query) {
|
|||
|
||||
export function modelUpdate(data) {
|
||||
return request({
|
||||
url: '/workflow/models/update',
|
||||
url: '/bpm/model/update',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
|
@ -26,7 +26,7 @@ export function modelUpdate(data) {
|
|||
|
||||
export function modelSave(data) {
|
||||
return request({
|
||||
url: '/workflow/models/create',
|
||||
url: '/bpm/model/create',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
|
@ -34,14 +34,15 @@ export function modelSave(data) {
|
|||
|
||||
export function modelDelete(data) {
|
||||
return request({
|
||||
url: '/workflow/models/delete?modelId='+ data.modelId,
|
||||
url: '/bpm/model/delete?modelId='+ data.modelId,
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function modelDeploy(data) {
|
||||
return request({
|
||||
url: '/workflow/models/deploy?modelId='+ data.modelId,
|
||||
url: '/bpm/model/deploy?modelId='+ data.modelId,
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package cn.iocoder.yudao.framework.common.util.object;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* {@link cn.iocoder.yudao.framework.common.pojo.PageParam} 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public class PageUtils {
|
||||
|
||||
public static int getStart(PageParam pageParam) {
|
||||
return (pageParam.getPageNo() - 1) * pageParam.getPageSize();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue