接口注释,增加controller
This commit is contained in:
parent
874ef9f259
commit
394e0449e8
@ -0,0 +1,116 @@
|
||||
package cn.axzo.server.controller.web;
|
||||
|
||||
import cn.axzo.framework.jackson.utility.JSON;
|
||||
import cn.axzo.workflow.core.service.BpmModelService;
|
||||
import cn.axzo.workflow.core.service.dto.request.model.BpmModelBpmPageDTO;
|
||||
import cn.axzo.workflow.core.service.dto.request.model.BpmModelCreateDTO;
|
||||
import cn.axzo.workflow.core.service.dto.request.model.BpmModelUpdateDTO;
|
||||
import cn.axzo.workflow.core.service.dto.response.BpmPageResult;
|
||||
import cn.axzo.workflow.core.service.dto.response.model.BpmModelDetailVO;
|
||||
import cn.axzo.workflow.core.service.dto.response.model.BpmModelPageItemVO;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Slf4j
|
||||
@RequestMapping("/web/v1/api/BpmModel")
|
||||
@RestController
|
||||
public class BpmModelController {
|
||||
|
||||
@Autowired
|
||||
private BpmModelService bpmModelService;
|
||||
|
||||
/**
|
||||
* 获取流程模型的查询结果
|
||||
*/
|
||||
@GetMapping("/getModelPage")
|
||||
public CommonResponse<BpmPageResult<BpmModelPageItemVO>> create(@Valid @RequestBody BpmModelBpmPageDTO dto) {
|
||||
log.info("获取流程模型getModelPage===>>>参数:{}", JSON.toJSONString(dto));
|
||||
BpmPageResult<BpmModelPageItemVO> result=bpmModelService.getModelPage(dto);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 创建流程,
|
||||
* return modelId的主键
|
||||
* */
|
||||
@PostMapping("/create")
|
||||
public CommonResponse<String> create(@Valid @RequestBody BpmModelCreateDTO dto) {
|
||||
log.info("创建流程createBpmModel===>>>参数:{}", JSON.toJSONString(dto));
|
||||
String result=bpmModelService.createBpmModel(dto);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型
|
||||
* */
|
||||
@GetMapping("/getModelDetailById")
|
||||
public CommonResponse<BpmModelDetailVO> getModelDetailById(@RequestBody String modelId) {
|
||||
log.info("获取模型getModelDetailById===>>>参数:{}", JSON.toJSONString(modelId));
|
||||
BpmModelDetailVO result=bpmModelService.getModelDetailById(modelId);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取模型
|
||||
* */
|
||||
@GetMapping("/getModelDetailByKey")
|
||||
public CommonResponse<BpmModelDetailVO> getModelDetailByKey(@RequestBody String modelKey) {
|
||||
log.info("获取模型getModelDetailByKey===>>>参数:{}", JSON.toJSONString(modelKey));
|
||||
BpmModelDetailVO result=bpmModelService.getModelDetailByKey(modelKey);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改流程信息
|
||||
* */
|
||||
@PutMapping("/updateBpmModel")
|
||||
public CommonResponse updateBpmModel(@Valid @RequestBody BpmModelUpdateDTO dto) {
|
||||
log.info("修改流程信息updateBpmModel===>>>参数:{}", JSON.toJSONString(dto));
|
||||
bpmModelService.updateBpmModel(dto);
|
||||
return CommonResponse.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 部署模型
|
||||
* return 部署完成的流程定义Id
|
||||
* */
|
||||
@PostMapping("/deployBpmModelById")
|
||||
public CommonResponse<String> deployBpmModelById(@RequestBody String modelId) {
|
||||
log.info("部署模型deployBpmModelById===>>>参数:{}", JSON.toJSONString(modelId));
|
||||
String result=bpmModelService.deployBpmModelById(modelId);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 部署模型
|
||||
* return 部署完成的流程定义Id
|
||||
* */
|
||||
@PostMapping("/deployBpmModelByKey")
|
||||
public CommonResponse<String> deployBpmModelByKey(@RequestBody String modelKey) {
|
||||
log.info("部署模型deployBpmModelByKey===>>>参数:{}", JSON.toJSONString(modelKey));
|
||||
String result=bpmModelService.deployBpmModelByKey(modelKey);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除模型
|
||||
* */
|
||||
@PostMapping("/deleteBpmModel")
|
||||
public CommonResponse deleteBpmModel(@RequestBody String id) {
|
||||
log.info("删除模型deleteBpmModel===>>>参数:{}", JSON.toJSONString(id));
|
||||
bpmModelService.deleteBpmModel(id);
|
||||
return CommonResponse.success();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package cn.axzo.server.controller.web;
|
||||
|
||||
import cn.axzo.framework.jackson.utility.JSON;
|
||||
import cn.axzo.workflow.core.service.BpmProcessDefinitionService;
|
||||
import cn.axzo.workflow.core.service.dto.request.model.BpmModelBpmPageDTO;
|
||||
import cn.axzo.workflow.core.service.dto.request.model.BpmModelCreateDTO;
|
||||
import cn.axzo.workflow.core.service.dto.request.process.BpmProcessDefinitionPageDTO;
|
||||
import cn.axzo.workflow.core.service.dto.response.BpmPageResult;
|
||||
import cn.axzo.workflow.core.service.dto.response.model.BpmModelPageItemVO;
|
||||
import cn.axzo.workflow.core.service.dto.response.process.BpmProcessDefinitionPageItemRespVO;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.common.engine.impl.db.SuspensionState;
|
||||
import org.flowable.engine.repository.Model;
|
||||
import org.flowable.engine.repository.ProcessDefinition;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Slf4j
|
||||
@RequestMapping("/web/v1/api/BpmProcessDefinition")
|
||||
@RestController
|
||||
public class BpmProcessDefinitionController {
|
||||
@Autowired
|
||||
private BpmProcessDefinitionService bpmProcessDefinitionService;
|
||||
|
||||
/**
|
||||
* 创建流程定义
|
||||
* 模型发布时,会自动调用,通常情况无需手动创建
|
||||
* */
|
||||
@PostMapping("/createProcessDeinition")
|
||||
public CommonResponse<String> createProcessDeinition(@RequestBody Model model, byte[] bpmnBytes) {
|
||||
log.info("创建流程定义createProcessDeinition===>>>参数:{}", JSON.toJSONString(model));
|
||||
String result=bpmProcessDefinitionService.createProcessDeinition(model,bpmnBytes);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃的流程定义分页
|
||||
* */
|
||||
@GetMapping("/getProcessDefinitionPage")
|
||||
public CommonResponse<BpmPageResult<BpmProcessDefinitionPageItemRespVO>> getProcessDefinitionPage(@Valid @RequestBody BpmProcessDefinitionPageDTO dto) {
|
||||
log.info("获取活跃的流程定义分页getProcessDefinitionPage===>>>参数:{}", JSON.toJSONString(dto));
|
||||
BpmPageResult<BpmProcessDefinitionPageItemRespVO> result=bpmProcessDefinitionService.getProcessDefinitionPage(dto);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获得编号对应的 ProcessDefinition
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 流程定义
|
||||
*/
|
||||
@GetMapping("/getProcessDefinition")
|
||||
public CommonResponse<ProcessDefinition> getProcessDefinition( @RequestBody String id) {
|
||||
log.info("获取活跃的流程定义分页getProcessDefinition===>>>参数:{}", JSON.toJSONString(id));
|
||||
ProcessDefinition result=bpmProcessDefinitionService.getProcessDefinition(id);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获得 deploymentId 对应的 ProcessDefinition
|
||||
*
|
||||
* @param deploymentId 部署编号
|
||||
* @return 流程定义
|
||||
*/
|
||||
@GetMapping("/getProcessDefinition")
|
||||
public CommonResponse<ProcessDefinition> getProcessDefinitionByDeploymentId( @RequestBody String deploymentId) {
|
||||
log.info(" 获得 deploymentId 对应的 getProcessDefinitionByDeploymentId===>>>参数:{}", JSON.toJSONString(deploymentId));
|
||||
ProcessDefinition result=bpmProcessDefinitionService.getProcessDefinitionByDeploymentId(deploymentId);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获得流程定义标识对应的激活的流程定义
|
||||
*
|
||||
* @param key 流程定义的标识
|
||||
* @return 流程定义
|
||||
*/
|
||||
@GetMapping("/getActiveProcessDefinitionByKey")
|
||||
public CommonResponse<ProcessDefinition> getActiveProcessDefinitionByKey( @RequestBody String key) {
|
||||
log.info("获得流程定义标识对应的激活的流程定义 getActiveProcessDefinitionByKey===>>>参数:{}", JSON.toJSONString(key));
|
||||
ProcessDefinition result=bpmProcessDefinitionService.getActiveProcessDefinitionByKey(key);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 挂起/激活流程,
|
||||
* 激活:SuspensionState.ACTIVE.getStateCode()
|
||||
* 挂起:SuspensionState.SUSPENDED.getStateCode()
|
||||
* {@link SuspensionState}
|
||||
* */
|
||||
@GetMapping("/getActiveProcessDefinitionByKey")
|
||||
public CommonResponse getActiveProcessDefinitionByKey( @RequestBody String processDefinitionId, Integer state) {
|
||||
log.info("挂起/激活流程 updateProcessDefinitionSuspendedState===>>>参数:{},{}", processDefinitionId,state);
|
||||
bpmProcessDefinitionService.updateProcessDefinitionSuspendedState(processDefinitionId,state);
|
||||
return CommonResponse.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定模型激活的定义 ID
|
||||
* @return 流程定义ID
|
||||
*/
|
||||
@GetMapping("/getActiveProcessDefinitionId")
|
||||
public CommonResponse<String> getActiveProcessDefinitionId( @RequestBody String tenantId, String category) {
|
||||
log.info("挂起/激活流程 getActiveProcessDefinitionId===>>>参数:{},{}", tenantId,category);
|
||||
String result=bpmProcessDefinitionService.getActiveProcessDefinitionId(tenantId,category);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
package cn.axzo.server.controller.web;
|
||||
|
||||
import cn.axzo.framework.jackson.utility.JSON;
|
||||
import cn.axzo.workflow.core.service.BpmProcessInstanceService;
|
||||
import cn.axzo.workflow.core.service.dto.request.process.BpmProcessInstanceCreateDTO;
|
||||
import cn.axzo.workflow.core.service.dto.response.process.BpmProcessInstanceVO;
|
||||
import cn.axzo.workflow.core.service.dto.response.process.BpmProcessInstanceWithdrawDTO;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Slf4j
|
||||
@RequestMapping("/web/v1/api/BpmProcessInstance")
|
||||
@RestController
|
||||
public class BpmProcessInstanceController {
|
||||
|
||||
@Autowired
|
||||
private BpmProcessInstanceService bpmProcessInstanceService;
|
||||
|
||||
|
||||
/**
|
||||
* 发起审核
|
||||
* */
|
||||
@PostMapping("/createProcessInstance")
|
||||
public CommonResponse<String> createProcessInstance(@Valid @RequestBody BpmProcessInstanceCreateDTO dto) {
|
||||
log.info("发起审核createProcessInstance===>>>参数:{}", JSON.toJSONString(dto));
|
||||
String result=bpmProcessInstanceService.createProcessInstance(dto);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获得流程实例
|
||||
*
|
||||
* @param id 流程实例的编号
|
||||
* @return 流程实例, 租户Id不必传
|
||||
*/
|
||||
@GetMapping("/getProcessInstance")
|
||||
public CommonResponse<ProcessInstance> getProcessInstance( @RequestBody String id, String tenantId) {
|
||||
log.info("获得流程实例 getProcessInstance===>>>参数:{},{}", id,tenantId);
|
||||
ProcessInstance result=bpmProcessInstanceService.getProcessInstance(id,tenantId);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得流程实例
|
||||
*
|
||||
* @param id 流程实例的编号
|
||||
* @param tenantId 租户Id
|
||||
* @param hasVariable 查询结果是否包含流程参数,
|
||||
* @return 流程实例, 租户Id不必传
|
||||
*/
|
||||
@GetMapping("/getProcessInstances")
|
||||
public CommonResponse<ProcessInstance> getProcessInstances( @RequestBody String id, String tenantId, boolean hasVariable) {
|
||||
log.info("获得流程实例 getProcessInstances===>>>参数:{},{}", id,tenantId);
|
||||
ProcessInstance result=bpmProcessInstanceService.getProcessInstance(id,tenantId,hasVariable);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获得流程实例
|
||||
*
|
||||
* @param processInstanceId 流程实例的编号
|
||||
* @param status 租户Id
|
||||
*/
|
||||
@GetMapping("/updateProcessStatus")
|
||||
public CommonResponse<Boolean> updateProcessStatus( @RequestBody String processInstanceId, String status) {
|
||||
log.info("获得流程实例 updateProcessStatus===>>>参数:{},{}", processInstanceId,status);
|
||||
Boolean result=bpmProcessInstanceService.updateProcessStatus(processInstanceId,status);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获得历史的流程实例
|
||||
*
|
||||
* @param id 流程实例的编号
|
||||
* @return 历史的流程实例
|
||||
*/
|
||||
@GetMapping("/getHistoricProcessInstance")
|
||||
public CommonResponse<HistoricProcessInstance> getHistoricProcessInstance( @RequestBody String id, String tenantId) {
|
||||
log.info("获得历史的流程实例 getHistoricProcessInstance===>>>参数:{},{}", id,tenantId);
|
||||
HistoricProcessInstance result=bpmProcessInstanceService.getHistoricProcessInstance(id,tenantId);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获得流程实例 VO 信息
|
||||
*
|
||||
* @param id 流程实例的编号
|
||||
* @return 流程实例
|
||||
*/
|
||||
@GetMapping("/getProcessInstanceVO")
|
||||
public CommonResponse<BpmProcessInstanceVO> getProcessInstanceVO( @RequestBody String id, String tenantId) {
|
||||
log.info("获得历史的流程实例 getProcessInstanceVO===>>>参数:{},{}", id,tenantId);
|
||||
BpmProcessInstanceVO result=bpmProcessInstanceService.getProcessInstanceVO(id,tenantId);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getWithdrawProcessInstance")
|
||||
public CommonResponse<Boolean> getWithdrawProcessInstance(@Valid @RequestBody BpmProcessInstanceWithdrawDTO dto) {
|
||||
log.info("withdrawProcessInstance===>>>参数:{}", dto);
|
||||
Boolean result=bpmProcessInstanceService.withdrawProcessInstance(dto);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package cn.axzo.server.controller.web;
|
||||
|
||||
import cn.axzo.workflow.core.service.BpmTaskService;
|
||||
import cn.axzo.workflow.core.service.dto.request.task.BpmTaskAuditDTO;
|
||||
import cn.axzo.workflow.core.service.dto.request.task.BpmTaskTodoBpmPageDTO;
|
||||
import cn.axzo.workflow.core.service.dto.response.BpmPageResult;
|
||||
import cn.axzo.workflow.core.service.dto.response.process.BpmProcessInstanceVO;
|
||||
import cn.axzo.workflow.core.service.dto.response.task.BpmTaskDonePageItemVO;
|
||||
import cn.axzo.workflow.core.service.dto.response.task.BpmTaskTodoPageItemVO;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.flowable.task.api.history.HistoricTaskInstance;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RequestMapping("/web/v1/api/BpmTask")
|
||||
@RestController
|
||||
public class BpmTaskController {
|
||||
|
||||
@Autowired
|
||||
private BpmTaskService bpmTaskService;
|
||||
|
||||
|
||||
/**
|
||||
* 待审核列表
|
||||
* */
|
||||
@GetMapping("/getTodoTaskPage")
|
||||
public CommonResponse<BpmPageResult<BpmTaskTodoPageItemVO>> getTodoTaskPage(@RequestBody BpmTaskTodoBpmPageDTO dto) {
|
||||
log.info("待审核列表 getTodoTaskPage===>>>参数:{}", dto);
|
||||
BpmPageResult<BpmTaskTodoPageItemVO> result=bpmTaskService.getTodoTaskPage(dto);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 已完成的审批列表
|
||||
* */
|
||||
@GetMapping("/getDoneTaskPage")
|
||||
public CommonResponse<BpmPageResult<BpmTaskDonePageItemVO>> getDoneTaskPage(@RequestBody BpmTaskTodoBpmPageDTO dto) {
|
||||
log.info("已完成的审批列表 getDoneTaskPage===>>>参数:{}", dto);
|
||||
BpmPageResult<BpmTaskDonePageItemVO> result=bpmTaskService.getDoneTaskPage(dto);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 我发起的审批列表
|
||||
* */
|
||||
@GetMapping("/getOwnTaskPage")
|
||||
public CommonResponse<BpmPageResult<BpmTaskDonePageItemVO>> getOwnTaskPage(@RequestBody BpmTaskTodoBpmPageDTO dto) {
|
||||
log.info("我发起的审批列表 getOwnTaskPage===>>>参数:{}", dto);
|
||||
BpmPageResult<BpmTaskDonePageItemVO> result=bpmTaskService.getOwnTaskPage(dto);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同意
|
||||
* */
|
||||
@PostMapping("/approveTask")
|
||||
public CommonResponse approveTask(@RequestBody BpmTaskAuditDTO dto) {
|
||||
log.info("同意 approveTask===>>>参数:{}", dto);
|
||||
bpmTaskService.approveTask(dto);
|
||||
return CommonResponse.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 拒绝
|
||||
* */
|
||||
@PostMapping("/rejectTask")
|
||||
public CommonResponse rejectTask(@RequestBody BpmTaskAuditDTO dto) {
|
||||
log.info("拒绝 rejectTask===>>>参数:{}", dto);
|
||||
bpmTaskService.rejectTask(dto);
|
||||
return CommonResponse.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取历史已审批的列表详情
|
||||
*/
|
||||
@GetMapping("/getTaskListByProcessInstanceId")
|
||||
public CommonResponse<List<HistoricTaskInstance>> getTaskListByProcessInstanceId(@RequestBody String processInstanceId) {
|
||||
log.info("获取历史已审批的列表详情 getTaskListByProcessInstanceId===>>>参数:{}", processInstanceId);
|
||||
List<HistoricTaskInstance> result=bpmTaskService.getTaskListByProcessInstanceId(processInstanceId);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实例正在审核的人列表
|
||||
* */
|
||||
@GetMapping("/getActiveTasksByProcessInstanceId")
|
||||
public CommonResponse<List<Task>> getActiveTasksByProcessInstanceId(@RequestBody String processInstanceId) {
|
||||
log.info(" 获取实例正在审核的人列表 getActiveTasksByProcessInstanceId===>>>参数:{}", processInstanceId);
|
||||
List<Task> result=bpmTaskService.getActiveTasksByProcessInstanceId(processInstanceId);
|
||||
return CommonResponse.success(result);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user