Commit bcdc117e59487bee1d1378ed6daef42110a1146d
1 parent
5eef27da
调整 definition =》processDefinition,主要考虑更加明确一些
Showing
9 changed files
with
54 additions
and
54 deletions
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmDefinitionController.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmProcessDefinitionController.java
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.definition; | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.definition; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO; | 3 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO; |
| 4 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageReqVO; | 4 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageReqVO; |
| 5 | -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmDefinitionService; | 5 | +import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; |
| 6 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 6 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 8 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| @@ -21,18 +21,19 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | @@ -21,18 +21,19 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 21 | 21 | ||
| 22 | @Api(tags = "流程定义") | 22 | @Api(tags = "流程定义") |
| 23 | @RestController | 23 | @RestController |
| 24 | -@RequestMapping("/bpm/definition") | 24 | +@RequestMapping("/bpm/process-definition") |
| 25 | @Validated | 25 | @Validated |
| 26 | -public class BpmDefinitionController { | 26 | +public class BpmProcessDefinitionController { |
| 27 | 27 | ||
| 28 | @Resource | 28 | @Resource |
| 29 | - private BpmDefinitionService bpmDefinitionService; | 29 | + private BpmProcessDefinitionService bpmDefinitionService; |
| 30 | 30 | ||
| 31 | @GetMapping ("/page") | 31 | @GetMapping ("/page") |
| 32 | @ApiOperation(value = "获得流程定义分页") | 32 | @ApiOperation(value = "获得流程定义分页") |
| 33 | @PreAuthorize("@ss.hasPermission('bpm:model:query')") // 暂时使用 model 的权限标识 | 33 | @PreAuthorize("@ss.hasPermission('bpm:model:query')") // 暂时使用 model 的权限标识 |
| 34 | - public CommonResult<PageResult<BpmProcessDefinitionPageItemRespVO>> getDefinitionPage(BpmProcessDefinitionPageReqVO pageReqVO) { | ||
| 35 | - return success(bpmDefinitionService.getDefinitionPage(pageReqVO)); | 34 | + public CommonResult<PageResult<BpmProcessDefinitionPageItemRespVO>> getProcessDefinitionPage( |
| 35 | + BpmProcessDefinitionPageReqVO pageReqVO) { | ||
| 36 | + return success(bpmDefinitionService.getProcessDefinitionPage(pageReqVO)); | ||
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | // TODO 芋艿:需要重写该方法 | 39 | // TODO 芋艿:需要重写该方法 |
| @@ -49,8 +50,8 @@ public class BpmDefinitionController { | @@ -49,8 +50,8 @@ public class BpmDefinitionController { | ||
| 49 | @ApiOperation(value = "获得流程定义的 BPMN XML") | 50 | @ApiOperation(value = "获得流程定义的 BPMN XML") |
| 50 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) | 51 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) |
| 51 | @PreAuthorize("@ss.hasPermission('bpm:model:query')") // 暂时使用 model 的权限标识 | 52 | @PreAuthorize("@ss.hasPermission('bpm:model:query')") // 暂时使用 model 的权限标识 |
| 52 | - public CommonResult<String> getDefinitionBpmnXML(@RequestParam("id") String id) { | ||
| 53 | - String bpmnXML = bpmDefinitionService.getDefinitionBpmnXML(id); | 53 | + public CommonResult<String> getProcessDefinitionBpmnXML(@RequestParam("id") String id) { |
| 54 | + String bpmnXML = bpmDefinitionService.getProcessDefinitionBpmnXML(id); | ||
| 54 | return success(bpmnXML); | 55 | return success(bpmnXML); |
| 55 | } | 56 | } |
| 56 | 57 |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/vo/BpmProcessDefinitionPageItemRespVO.java
| @@ -12,7 +12,7 @@ import java.util.Date; | @@ -12,7 +12,7 @@ import java.util.Date; | ||
| 12 | @Data | 12 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 15 | -public class BpmProcessDefinitionPageItemRespVO extends ProcessDefinitionRespVO { | 15 | +public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionRespVO { |
| 16 | 16 | ||
| 17 | @ApiModelProperty(value = "表单名字", example = "请假表单") | 17 | @ApiModelProperty(value = "表单名字", example = "请假表单") |
| 18 | private String formName; | 18 | private String formName; |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/vo/ProcessDefinitionRespVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/vo/BpmProcessDefinitionRespVO.java
| @@ -8,7 +8,7 @@ import javax.validation.constraints.NotEmpty; | @@ -8,7 +8,7 @@ import javax.validation.constraints.NotEmpty; | ||
| 8 | 8 | ||
| 9 | @ApiModel("流程定义 Response VO") | 9 | @ApiModel("流程定义 Response VO") |
| 10 | @Data | 10 | @Data |
| 11 | -public class ProcessDefinitionRespVO { | 11 | +public class BpmProcessDefinitionRespVO { |
| 12 | 12 | ||
| 13 | @ApiModelProperty(value = "编号", required = true, example = "1024") | 13 | @ApiModelProperty(value = "编号", required = true, example = "1024") |
| 14 | private String id; | 14 | private String id; |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/BpmErrorCodeConstants.java
| @@ -13,7 +13,6 @@ public interface BpmErrorCodeConstants { | @@ -13,7 +13,6 @@ public interface BpmErrorCodeConstants { | ||
| 13 | ErrorCode PROCESS_INSTANCE_NOT_EXISTS = new ErrorCode(1009000001, "流程实例不存在"); | 13 | ErrorCode PROCESS_INSTANCE_NOT_EXISTS = new ErrorCode(1009000001, "流程实例不存在"); |
| 14 | ErrorCode HIGHLIGHT_IMG_ERROR = new ErrorCode(1009000002, "获取高亮流程图异常"); | 14 | ErrorCode HIGHLIGHT_IMG_ERROR = new ErrorCode(1009000002, "获取高亮流程图异常"); |
| 15 | 15 | ||
| 16 | - | ||
| 17 | // ========== OA 流程模块 1-009-001-000 ========== | 16 | // ========== OA 流程模块 1-009-001-000 ========== |
| 18 | ErrorCode OA_LEAVE_NOT_EXISTS = new ErrorCode(1009001001, "请假申请不存在"); | 17 | ErrorCode OA_LEAVE_NOT_EXISTS = new ErrorCode(1009001001, "请假申请不存在"); |
| 19 | ErrorCode OA_PM_POST_NOT_EXISTS = new ErrorCode(1009001002, "项目经理岗位未设置"); | 18 | ErrorCode OA_PM_POST_NOT_EXISTS = new ErrorCode(1009001002, "项目经理岗位未设置"); |
| @@ -29,9 +28,9 @@ public interface BpmErrorCodeConstants { | @@ -29,9 +28,9 @@ public interface BpmErrorCodeConstants { | ||
| 29 | ErrorCode MODEL_KEY_VALID = new ErrorCode(1009002002, "流程标识格式不正确,需要以字母或下划线开头,后接任意字母、数字、中划线、下划线、句点!"); | 28 | ErrorCode MODEL_KEY_VALID = new ErrorCode(1009002002, "流程标识格式不正确,需要以字母或下划线开头,后接任意字母、数字、中划线、下划线、句点!"); |
| 30 | 29 | ||
| 31 | // ========== 流程定义 1-009-003-000 ========== | 30 | // ========== 流程定义 1-009-003-000 ========== |
| 32 | - ErrorCode DEFINITION_KEY_NOT_MATCH = new ErrorCode(1009003000, "流程定义的标识期望是({}),当前是({}),请修改 BPMN 流程图"); | ||
| 33 | - ErrorCode DEFINITION_NAME_NOT_MATCH = new ErrorCode(1009003001, "流程定义的名字期望是({}),当前是({}),请修改 BPMN 流程图"); | ||
| 34 | - ErrorCode DEFINITION_NOT_EXISTS = new ErrorCode(1009003002, "流程定义不存在"); | 31 | + ErrorCode PROCESS_DEFINITION_KEY_NOT_MATCH = new ErrorCode(1009003000, "流程定义的标识期望是({}),当前是({}),请修改 BPMN 流程图"); |
| 32 | + ErrorCode PROCESS_DEFINITION_NAME_NOT_MATCH = new ErrorCode(1009003001, "流程定义的名字期望是({}),当前是({}),请修改 BPMN 流程图"); | ||
| 33 | + ErrorCode PROCESS_DEFINITION_NOT_EXISTS = new ErrorCode(1009003002, "流程定义不存在"); | ||
| 35 | 34 | ||
| 36 | // ========== 动态表单模块 1-009-004-000 ========== | 35 | // ========== 动态表单模块 1-009-004-000 ========== |
| 37 | ErrorCode FORM_NOT_EXISTS = new ErrorCode(1009004000, "动态表单不存在"); | 36 | ErrorCode FORM_NOT_EXISTS = new ErrorCode(1009004000, "动态表单不存在"); |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmDefinitionService.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmProcessDefinitionService.java
| @@ -20,7 +20,7 @@ import java.util.Set; | @@ -20,7 +20,7 @@ import java.util.Set; | ||
| 20 | * @author yunlong.li | 20 | * @author yunlong.li |
| 21 | * @author ZJQ | 21 | * @author ZJQ |
| 22 | */ | 22 | */ |
| 23 | -public interface BpmDefinitionService { | 23 | +public interface BpmProcessDefinitionService { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 获得流程定义分页 | 26 | * 获得流程定义分页 |
| @@ -28,7 +28,7 @@ public interface BpmDefinitionService { | @@ -28,7 +28,7 @@ public interface BpmDefinitionService { | ||
| 28 | * @param pageReqVO 分页入参 | 28 | * @param pageReqVO 分页入参 |
| 29 | * @return 流程定义 Page | 29 | * @return 流程定义 Page |
| 30 | */ | 30 | */ |
| 31 | - PageResult<BpmProcessDefinitionPageItemRespVO> getDefinitionPage(BpmProcessDefinitionPageReqVO pageReqVO); | 31 | + PageResult<BpmProcessDefinitionPageItemRespVO> getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageReqVO); |
| 32 | 32 | ||
| 33 | /** | 33 | /** |
| 34 | * 获得流程定义对应的 BPMN XML | 34 | * 获得流程定义对应的 BPMN XML |
| @@ -36,7 +36,7 @@ public interface BpmDefinitionService { | @@ -36,7 +36,7 @@ public interface BpmDefinitionService { | ||
| 36 | * @param id 流程定义编号 | 36 | * @param id 流程定义编号 |
| 37 | * @return BPMN XML | 37 | * @return BPMN XML |
| 38 | */ | 38 | */ |
| 39 | - String getDefinitionBpmnXML(String id); | 39 | + String getProcessDefinitionBpmnXML(String id); |
| 40 | 40 | ||
| 41 | /** | 41 | /** |
| 42 | * 获得 Bpmn 模型 | 42 | * 获得 Bpmn 模型 |
| @@ -52,7 +52,7 @@ public interface BpmDefinitionService { | @@ -52,7 +52,7 @@ public interface BpmDefinitionService { | ||
| 52 | * @param id 编号 | 52 | * @param id 编号 |
| 53 | * @return 流程定义 | 53 | * @return 流程定义 |
| 54 | */ | 54 | */ |
| 55 | - ProcessDefinition getDefinition(String id); | 55 | + ProcessDefinition getProcessDefinition(String id); |
| 56 | 56 | ||
| 57 | /** | 57 | /** |
| 58 | * 获得 id 对应的 Deployment | 58 | * 获得 id 对应的 Deployment |
| @@ -86,7 +86,7 @@ public interface BpmDefinitionService { | @@ -86,7 +86,7 @@ public interface BpmDefinitionService { | ||
| 86 | * @param deploymentId 部署编号 | 86 | * @param deploymentId 部署编号 |
| 87 | * @return 流程定义 | 87 | * @return 流程定义 |
| 88 | */ | 88 | */ |
| 89 | - ProcessDefinition getDefinitionByDeploymentId(String deploymentId); | 89 | + ProcessDefinition getProcessDefinitionByDeploymentId(String deploymentId); |
| 90 | 90 | ||
| 91 | /** | 91 | /** |
| 92 | * 获得 deploymentIds 对应的 ProcessDefinition 数组 | 92 | * 获得 deploymentIds 对应的 ProcessDefinition 数组 |
| @@ -94,7 +94,7 @@ public interface BpmDefinitionService { | @@ -94,7 +94,7 @@ public interface BpmDefinitionService { | ||
| 94 | * @param deploymentIds 部署编号的数组 | 94 | * @param deploymentIds 部署编号的数组 |
| 95 | * @return 流程定义的数组 | 95 | * @return 流程定义的数组 |
| 96 | */ | 96 | */ |
| 97 | - List<ProcessDefinition> getDefinitionListByDeploymentIds(Set<String> deploymentIds); | 97 | + List<ProcessDefinition> getProcessDefinitionListByDeploymentIds(Set<String> deploymentIds); |
| 98 | 98 | ||
| 99 | /** | 99 | /** |
| 100 | * 创建流程定义 | 100 | * 创建流程定义 |
| @@ -102,7 +102,7 @@ public interface BpmDefinitionService { | @@ -102,7 +102,7 @@ public interface BpmDefinitionService { | ||
| 102 | * @param createReqDTO 创建信息 | 102 | * @param createReqDTO 创建信息 |
| 103 | * @return 流程编号 | 103 | * @return 流程编号 |
| 104 | */ | 104 | */ |
| 105 | - String createDefinition(@Valid BpmDefinitionCreateReqDTO createReqDTO); | 105 | + String createProcessDefinition(@Valid BpmDefinitionCreateReqDTO createReqDTO); |
| 106 | 106 | ||
| 107 | /** | 107 | /** |
| 108 | * 更新流程定义的挂起状态 | 108 | * 更新流程定义的挂起状态 |
| @@ -110,6 +110,6 @@ public interface BpmDefinitionService { | @@ -110,6 +110,6 @@ public interface BpmDefinitionService { | ||
| 110 | * @param id 流程定义的编号 | 110 | * @param id 流程定义的编号 |
| 111 | * @param state 挂起状态 {@link org.activiti.engine.impl.persistence.entity.SuspensionState} | 111 | * @param state 挂起状态 {@link org.activiti.engine.impl.persistence.entity.SuspensionState} |
| 112 | */ | 112 | */ |
| 113 | - void updateDefinitionSuspensionState(String id, Integer state); | 113 | + void updateProcessDefinitionState(String id, Integer state); |
| 114 | 114 | ||
| 115 | } | 115 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmDefinitionServiceImpl.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmProcessDefinitionServiceImpl.java
| @@ -8,7 +8,7 @@ import cn.iocoder.yudao.adminserver.modules.bpm.convert.definition.BpmDefinition | @@ -8,7 +8,7 @@ import cn.iocoder.yudao.adminserver.modules.bpm.convert.definition.BpmDefinition | ||
| 8 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.definition.BpmProcessDefinitionDO; | 8 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.definition.BpmProcessDefinitionDO; |
| 9 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO; | 9 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO; |
| 10 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.definition.BpmProcessDefinitionMapper; | 10 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.definition.BpmProcessDefinitionMapper; |
| 11 | -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmDefinitionService; | 11 | +import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; |
| 12 | import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO; | 12 | import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO; |
| 13 | import cn.iocoder.yudao.adminserver.modules.bpm.service.form.BpmFormService; | 13 | import cn.iocoder.yudao.adminserver.modules.bpm.service.form.BpmFormService; |
| 14 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 14 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| @@ -29,8 +29,8 @@ import org.springframework.validation.annotation.Validated; | @@ -29,8 +29,8 @@ import org.springframework.validation.annotation.Validated; | ||
| 29 | import javax.annotation.Resource; | 29 | import javax.annotation.Resource; |
| 30 | import java.util.*; | 30 | import java.util.*; |
| 31 | 31 | ||
| 32 | -import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.DEFINITION_KEY_NOT_MATCH; | ||
| 33 | -import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.DEFINITION_NAME_NOT_MATCH; | 32 | +import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.PROCESS_DEFINITION_KEY_NOT_MATCH; |
| 33 | +import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.PROCESS_DEFINITION_NAME_NOT_MATCH; | ||
| 34 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 34 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 35 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; | 35 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; |
| 36 | 36 | ||
| @@ -44,7 +44,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. | @@ -44,7 +44,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. | ||
| 44 | @Service | 44 | @Service |
| 45 | @Validated | 45 | @Validated |
| 46 | @Slf4j | 46 | @Slf4j |
| 47 | -public class BpmDefinitionServiceImpl implements BpmDefinitionService { | 47 | +public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionService { |
| 48 | 48 | ||
| 49 | private static final String BPMN_FILE_SUFFIX = ".bpmn"; | 49 | private static final String BPMN_FILE_SUFFIX = ".bpmn"; |
| 50 | 50 | ||
| @@ -59,7 +59,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | @@ -59,7 +59,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | ||
| 59 | private BpmProcessDefinitionMapper processDefinitionMapper; | 59 | private BpmProcessDefinitionMapper processDefinitionMapper; |
| 60 | 60 | ||
| 61 | @Override | 61 | @Override |
| 62 | - public PageResult<BpmProcessDefinitionPageItemRespVO> getDefinitionPage(BpmProcessDefinitionPageReqVO pageVO) { | 62 | + public PageResult<BpmProcessDefinitionPageItemRespVO> getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageVO) { |
| 63 | ProcessDefinitionQuery definitionQuery = repositoryService.createProcessDefinitionQuery(); | 63 | ProcessDefinitionQuery definitionQuery = repositoryService.createProcessDefinitionQuery(); |
| 64 | if (StrUtil.isNotBlank(pageVO.getKey())) { | 64 | if (StrUtil.isNotBlank(pageVO.getKey())) { |
| 65 | definitionQuery.processDefinitionKey(pageVO.getKey()); | 65 | definitionQuery.processDefinitionKey(pageVO.getKey()); |
| @@ -94,7 +94,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | @@ -94,7 +94,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | ||
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | @Override | 96 | @Override |
| 97 | - public String getDefinitionBpmnXML(String id) { | 97 | + public String getProcessDefinitionBpmnXML(String id) { |
| 98 | BpmnModel bpmnModel = repositoryService.getBpmnModel(id); | 98 | BpmnModel bpmnModel = repositoryService.getBpmnModel(id); |
| 99 | if (bpmnModel == null) { | 99 | if (bpmnModel == null) { |
| 100 | return null; | 100 | return null; |
| @@ -109,7 +109,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | @@ -109,7 +109,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | ||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | @Override | 111 | @Override |
| 112 | - public ProcessDefinition getDefinition(String id) { | 112 | + public ProcessDefinition getProcessDefinition(String id) { |
| 113 | return repositoryService.getProcessDefinition(id); | 113 | return repositoryService.getProcessDefinition(id); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| @@ -134,12 +134,12 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | @@ -134,12 +134,12 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | ||
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | @Override | 136 | @Override |
| 137 | - public ProcessDefinition getDefinitionByDeploymentId(String deploymentId) { | 137 | + public ProcessDefinition getProcessDefinitionByDeploymentId(String deploymentId) { |
| 138 | return repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).singleResult(); | 138 | return repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).singleResult(); |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | @Override | 141 | @Override |
| 142 | - public List<ProcessDefinition> getDefinitionListByDeploymentIds(Set<String> deploymentIds) { | 142 | + public List<ProcessDefinition> getProcessDefinitionListByDeploymentIds(Set<String> deploymentIds) { |
| 143 | if (CollUtil.isEmpty(deploymentIds)) { | 143 | if (CollUtil.isEmpty(deploymentIds)) { |
| 144 | return Collections.emptyList(); | 144 | return Collections.emptyList(); |
| 145 | } | 145 | } |
| @@ -148,7 +148,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | @@ -148,7 +148,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | ||
| 148 | 148 | ||
| 149 | @Override | 149 | @Override |
| 150 | @Transactional(rollbackFor = Exception.class) // 因为进行多个 activiti 操作,所以开启事务 | 150 | @Transactional(rollbackFor = Exception.class) // 因为进行多个 activiti 操作,所以开启事务 |
| 151 | - public String createDefinition(BpmDefinitionCreateReqDTO createReqDTO) { | 151 | + public String createProcessDefinition(BpmDefinitionCreateReqDTO createReqDTO) { |
| 152 | // 创建 Deployment 部署 | 152 | // 创建 Deployment 部署 |
| 153 | Deployment deploy = repositoryService.createDeployment() | 153 | Deployment deploy = repositoryService.createDeployment() |
| 154 | .key(createReqDTO.getKey()).name(createReqDTO.getName()).category(createReqDTO.getCategory()) | 154 | .key(createReqDTO.getKey()).name(createReqDTO.getName()).category(createReqDTO.getCategory()) |
| @@ -162,10 +162,10 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | @@ -162,10 +162,10 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | ||
| 162 | // 注意 2,目前该项目的设计上,需要保证 Model、Deployment、ProcessDefinition 使用相同的 key,保证关联性。 | 162 | // 注意 2,目前该项目的设计上,需要保证 Model、Deployment、ProcessDefinition 使用相同的 key,保证关联性。 |
| 163 | // 否则,会导致 ProcessDefinition 的分页无法查询到。 | 163 | // 否则,会导致 ProcessDefinition 的分页无法查询到。 |
| 164 | if (!Objects.equals(definition.getKey(), createReqDTO.getKey())) { | 164 | if (!Objects.equals(definition.getKey(), createReqDTO.getKey())) { |
| 165 | - throw exception(DEFINITION_KEY_NOT_MATCH, createReqDTO.getKey(), definition.getKey()); | 165 | + throw exception(PROCESS_DEFINITION_KEY_NOT_MATCH, createReqDTO.getKey(), definition.getKey()); |
| 166 | } | 166 | } |
| 167 | if (!Objects.equals(definition.getName(), createReqDTO.getName())) { | 167 | if (!Objects.equals(definition.getName(), createReqDTO.getName())) { |
| 168 | - throw exception(DEFINITION_NAME_NOT_MATCH, createReqDTO.getName(), definition.getName()); | 168 | + throw exception(PROCESS_DEFINITION_NAME_NOT_MATCH, createReqDTO.getName(), definition.getName()); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | // 插入拓展表 | 171 | // 插入拓展表 |
| @@ -176,7 +176,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | @@ -176,7 +176,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | ||
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | @Override | 178 | @Override |
| 179 | - public void updateDefinitionSuspensionState(String id, Integer state) { | 179 | + public void updateProcessDefinitionState(String id, Integer state) { |
| 180 | // 激活 | 180 | // 激活 |
| 181 | if (Objects.equals(SuspensionState.ACTIVE.getStateCode(), state)) { | 181 | if (Objects.equals(SuspensionState.ACTIVE.getStateCode(), state)) { |
| 182 | repositoryService.activateProcessDefinitionById(id, true, null); | 182 | repositoryService.activateProcessDefinitionById(id, true, null); |
| @@ -187,7 +187,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | @@ -187,7 +187,7 @@ public class BpmDefinitionServiceImpl implements BpmDefinitionService { | ||
| 187 | repositoryService.suspendProcessDefinitionById(id, true, null); | 187 | repositoryService.suspendProcessDefinitionById(id, true, null); |
| 188 | return; | 188 | return; |
| 189 | } | 189 | } |
| 190 | - log.error("[updateDefinitionSuspensionState][流程定义({}) 修改未知状态({})]", id, state); | 190 | + log.error("[updateProcessDefinitionState][流程定义({}) 修改未知状态({})]", id, state); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | } | 193 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/model/impl/BpmModelServiceImpl.java
| @@ -4,7 +4,7 @@ import cn.hutool.core.util.StrUtil; | @@ -4,7 +4,7 @@ import cn.hutool.core.util.StrUtil; | ||
| 4 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.*; | 4 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.model.vo.*; |
| 5 | import cn.iocoder.yudao.adminserver.modules.bpm.convert.model.BpmModelConvert; | 5 | import cn.iocoder.yudao.adminserver.modules.bpm.convert.model.BpmModelConvert; |
| 6 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO; | 6 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO; |
| 7 | -import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmDefinitionService; | 7 | +import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; |
| 8 | import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO; | 8 | import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO; |
| 9 | import cn.iocoder.yudao.adminserver.modules.bpm.service.form.BpmFormService; | 9 | import cn.iocoder.yudao.adminserver.modules.bpm.service.form.BpmFormService; |
| 10 | import cn.iocoder.yudao.adminserver.modules.bpm.service.model.BpmModelService; | 10 | import cn.iocoder.yudao.adminserver.modules.bpm.service.model.BpmModelService; |
| @@ -52,7 +52,7 @@ public class BpmModelServiceImpl implements BpmModelService { | @@ -52,7 +52,7 @@ public class BpmModelServiceImpl implements BpmModelService { | ||
| 52 | @Resource | 52 | @Resource |
| 53 | private BpmFormService bpmFormService; | 53 | private BpmFormService bpmFormService; |
| 54 | @Resource | 54 | @Resource |
| 55 | - private BpmDefinitionService bpmDefinitionService; | 55 | + private BpmProcessDefinitionService bpmProcessDefinitionService; |
| 56 | 56 | ||
| 57 | @Override | 57 | @Override |
| 58 | public PageResult<BpmModelPageItemRespVO> getModelPage(ModelPageReqVO pageVO) { | 58 | public PageResult<BpmModelPageItemRespVO> getModelPage(ModelPageReqVO pageVO) { |
| @@ -80,9 +80,9 @@ public class BpmModelServiceImpl implements BpmModelService { | @@ -80,9 +80,9 @@ public class BpmModelServiceImpl implements BpmModelService { | ||
| 80 | // 获得 Deployment Map | 80 | // 获得 Deployment Map |
| 81 | Set<String> deploymentIds = new HashSet<>(); | 81 | Set<String> deploymentIds = new HashSet<>(); |
| 82 | models.forEach(model -> CollectionUtils.addIfNotNull(deploymentIds, model.getDeploymentId())); | 82 | models.forEach(model -> CollectionUtils.addIfNotNull(deploymentIds, model.getDeploymentId())); |
| 83 | - Map<String, Deployment> deploymentMap = bpmDefinitionService.getDeploymentMap(deploymentIds); | 83 | + Map<String, Deployment> deploymentMap = bpmProcessDefinitionService.getDeploymentMap(deploymentIds); |
| 84 | // 获得 ProcessDefinition Map | 84 | // 获得 ProcessDefinition Map |
| 85 | - List<ProcessDefinition> processDefinitions = bpmDefinitionService.getDefinitionListByDeploymentIds(deploymentIds); | 85 | + List<ProcessDefinition> processDefinitions = bpmProcessDefinitionService.getProcessDefinitionListByDeploymentIds(deploymentIds); |
| 86 | Map<String, ProcessDefinition> processDefinitionMap = convertMap(processDefinitions, ProcessDefinition::getDeploymentId); | 86 | Map<String, ProcessDefinition> processDefinitionMap = convertMap(processDefinitions, ProcessDefinition::getDeploymentId); |
| 87 | 87 | ||
| 88 | // 拼接结果 | 88 | // 拼接结果 |
| @@ -157,18 +157,18 @@ public class BpmModelServiceImpl implements BpmModelService { | @@ -157,18 +157,18 @@ public class BpmModelServiceImpl implements BpmModelService { | ||
| 157 | // 创建流程定义 | 157 | // 创建流程定义 |
| 158 | BpmDefinitionCreateReqDTO definitionCreateReqDTO = BpmModelConvert.INSTANCE.convert2(model) | 158 | BpmDefinitionCreateReqDTO definitionCreateReqDTO = BpmModelConvert.INSTANCE.convert2(model) |
| 159 | .setBpmnXml(StrUtil.utf8Str(bpmnBytes)); | 159 | .setBpmnXml(StrUtil.utf8Str(bpmnBytes)); |
| 160 | - String definitionId = bpmDefinitionService.createDefinition(definitionCreateReqDTO); | 160 | + String definitionId = bpmProcessDefinitionService.createProcessDefinition(definitionCreateReqDTO); |
| 161 | 161 | ||
| 162 | // 将老的流程定义进行挂起。也就是说,只有最新部署的流程定义,才可以发起任务。 | 162 | // 将老的流程定义进行挂起。也就是说,只有最新部署的流程定义,才可以发起任务。 |
| 163 | if (StrUtil.isNotEmpty(model.getDeploymentId())) { | 163 | if (StrUtil.isNotEmpty(model.getDeploymentId())) { |
| 164 | - ProcessDefinition oldDefinition = bpmDefinitionService.getDefinitionByDeploymentId(model.getDeploymentId()); | 164 | + ProcessDefinition oldDefinition = bpmProcessDefinitionService.getProcessDefinitionByDeploymentId(model.getDeploymentId()); |
| 165 | if (oldDefinition != null) { | 165 | if (oldDefinition != null) { |
| 166 | - bpmDefinitionService.updateDefinitionSuspensionState(oldDefinition.getId(), SuspensionState.SUSPENDED.getStateCode()); | 166 | + bpmProcessDefinitionService.updateProcessDefinitionState(oldDefinition.getId(), SuspensionState.SUSPENDED.getStateCode()); |
| 167 | } | 167 | } |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | // 更新 model 的 deploymentId,进行关联 | 170 | // 更新 model 的 deploymentId,进行关联 |
| 171 | - ProcessDefinition definition = bpmDefinitionService.getDefinition(definitionId); | 171 | + ProcessDefinition definition = bpmProcessDefinitionService.getProcessDefinition(definitionId); |
| 172 | model.setDeploymentId(definition.getDeploymentId()); | 172 | model.setDeploymentId(definition.getDeploymentId()); |
| 173 | repositoryService.saveModel(model); | 173 | repositoryService.saveModel(model); |
| 174 | } | 174 | } |
| @@ -192,13 +192,13 @@ public class BpmModelServiceImpl implements BpmModelService { | @@ -192,13 +192,13 @@ public class BpmModelServiceImpl implements BpmModelService { | ||
| 192 | throw exception(MODEL_NOT_EXISTS); | 192 | throw exception(MODEL_NOT_EXISTS); |
| 193 | } | 193 | } |
| 194 | // 校验流程定义存在 | 194 | // 校验流程定义存在 |
| 195 | - ProcessDefinition definition = bpmDefinitionService.getDefinitionByDeploymentId(model.getDeploymentId()); | 195 | + ProcessDefinition definition = bpmProcessDefinitionService.getProcessDefinitionByDeploymentId(model.getDeploymentId()); |
| 196 | if (definition == null) { | 196 | if (definition == null) { |
| 197 | - throw exception(DEFINITION_NOT_EXISTS); | 197 | + throw exception(PROCESS_DEFINITION_NOT_EXISTS); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | // 更新状态 | 200 | // 更新状态 |
| 201 | - bpmDefinitionService.updateDefinitionSuspensionState(definition.getId(), state); | 201 | + bpmProcessDefinitionService.updateProcessDefinitionState(definition.getId(), state); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | private Model getModelByKey(String key) { | 204 | private Model getModelByKey(String key) { |
yudao-admin-ui/src/api/bpm/definition.js
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | 2 | ||
| 3 | -export function getDefinitionPage(query) { | 3 | +export function getProcessDefinitionPage(query) { |
| 4 | return request({ | 4 | return request({ |
| 5 | - url: '/bpm/definition/page', | 5 | + url: '/bpm/process-definition/page', |
| 6 | method: 'get', | 6 | method: 'get', |
| 7 | params: query | 7 | params: query |
| 8 | }) | 8 | }) |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | -export function getDefinitionBpmnXML(id) { | 11 | +export function getProcessDefinitionBpmnXML(id) { |
| 12 | return request({ | 12 | return request({ |
| 13 | - url: '/bpm/definition/get-bpmn-xml?id=' + id, | 13 | + url: '/bpm/process-definition/get-bpmn-xml?id=' + id, |
| 14 | method: 'get' | 14 | method: 'get' |
| 15 | }) | 15 | }) |
| 16 | } | 16 | } |
yudao-admin-ui/src/views/bpm/definition/index.vue
| @@ -60,7 +60,7 @@ | @@ -60,7 +60,7 @@ | ||
| 60 | </template> | 60 | </template> |
| 61 | 61 | ||
| 62 | <script> | 62 | <script> |
| 63 | -import {getDefinitionBpmnXML, getDefinitionPage} from "@/api/bpm/definition"; | 63 | +import {getProcessDefinitionBpmnXML, getProcessDefinitionPage} from "@/api/bpm/definition"; |
| 64 | import {DICT_TYPE, getDictDatas} from "@/utils/dict"; | 64 | import {DICT_TYPE, getDictDatas} from "@/utils/dict"; |
| 65 | import {getForm} from "@/api/bpm/form"; | 65 | import {getForm} from "@/api/bpm/form"; |
| 66 | import {decodeFields} from "@/utils/formGenerator"; | 66 | import {decodeFields} from "@/utils/formGenerator"; |
| @@ -113,7 +113,7 @@ export default { | @@ -113,7 +113,7 @@ export default { | ||
| 113 | /** 查询流程定义列表 */ | 113 | /** 查询流程定义列表 */ |
| 114 | getList() { | 114 | getList() { |
| 115 | this.loading = true; | 115 | this.loading = true; |
| 116 | - getDefinitionPage(this.queryParams).then(response => { | 116 | + getProcessDefinitionPage(this.queryParams).then(response => { |
| 117 | this.list = response.data.list; | 117 | this.list = response.data.list; |
| 118 | this.total = response.data.total; | 118 | this.total = response.data.total; |
| 119 | this.loading = false; | 119 | this.loading = false; |
| @@ -135,7 +135,7 @@ export default { | @@ -135,7 +135,7 @@ export default { | ||
| 135 | }, | 135 | }, |
| 136 | /** 流程图的详情按钮操作 */ | 136 | /** 流程图的详情按钮操作 */ |
| 137 | handleBpmnDetail(row) { | 137 | handleBpmnDetail(row) { |
| 138 | - getDefinitionBpmnXML(row.id).then(response => { | 138 | + getProcessDefinitionBpmnXML(row.id).then(response => { |
| 139 | this.bpmnXML = response.data | 139 | this.bpmnXML = response.data |
| 140 | // 弹窗打开 | 140 | // 弹窗打开 |
| 141 | this.showBpmnOpen = true | 141 | this.showBpmnOpen = true |