待办列表

This commit is contained in:
YunaiV 2022-01-04 09:46:39 +08:00
parent 2607f13abe
commit e43039b0c6
3 changed files with 14 additions and 2 deletions

View File

@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Api(tags = "流程实例") // 流程实例通过流程定义创建的一次申请 @Api(tags = "流程实例") // 流程实例通过流程定义创建的一次申请
@ -29,7 +28,9 @@ public class BpmProcessInstanceController {
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("新建流程实例") @ApiOperation("新建流程实例")
public CommonResult<String> createProcessInstance(@Valid @RequestBody BpmProcessInstanceCreateReqVO createReqVO) { public CommonResult<String> createProcessInstance(@Valid @RequestBody BpmProcessInstanceCreateReqVO createReqVO) {
return success(processInstanceService.createProcessInstance(getLoginUserId(), createReqVO)); // return success(processInstanceService.createProcessInstance(getLoginUserId(), createReqVO));
processInstanceService.getMyProcessInstancePage(getLoginUserId());
return null;
} }
} }

View File

@ -20,4 +20,6 @@ public interface BpmProcessInstanceService {
*/ */
String createProcessInstance(Long userId, @Valid BpmProcessInstanceCreateReqVO createReqVO); String createProcessInstance(Long userId, @Valid BpmProcessInstanceCreateReqVO createReqVO);
void getMyProcessInstancePage(Long userId);
} }

View File

@ -11,6 +11,7 @@ import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService; import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService; import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService; import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricProcessInstanceQuery; import org.activiti.engine.history.HistoricProcessInstanceQuery;
import org.activiti.engine.impl.identity.Authentication; import org.activiti.engine.impl.identity.Authentication;
import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.repository.ProcessDefinition;
@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
import java.util.Map; import java.util.Map;
import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.PROCESS_DEFINITION_IS_SUSPENDED; import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.PROCESS_DEFINITION_IS_SUSPENDED;
@ -92,9 +94,16 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
} }
public void getMyProcessInstancePage(Long userId) { public void getMyProcessInstancePage(Long userId) {
// id title 所属流程 当前审批环节 状态 结果 创建时间 提交申请时间 标题状态ActBusiness
// id title 流程类别 流程版本 提交时间 流程状态 耗时 当前节点 办理 标题提交时间HistoricProcessInstanceQuery
runtimeService.createProcessInstanceQuery().list();
HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery() HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery()
.startedBy(String.valueOf(userId)) // 发起人是自己 .startedBy(String.valueOf(userId)) // 发起人是自己
.orderByProcessInstanceStartTime().desc(); // 按照发起时间倒序 .orderByProcessInstanceStartTime().desc(); // 按照发起时间倒序
List<HistoricProcessInstance> list = historicProcessInstanceQuery.list();
System.out.println("test");
} }
} }