Java Code Examples for org.activiti.engine.task.TaskQuery#taskAssignee()
The following examples show how to use
org.activiti.engine.task.TaskQuery#taskAssignee() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BxlcTaskListeningImpl.java From gem with MIT License | 6 votes |
/** * @Description:流程列表 * @param id 用户主键 * @author: Ryan * @date 2018年11月18日 */ public List<TaskDetails> findTaskList(String id) { List<TaskDetails> arrayList = new ArrayList<TaskDetails>(); TaskQuery createTaskQuery = taskService.createTaskQuery(); createTaskQuery.taskAssignee(id); List<Task> list = createTaskQuery.list(); if(list!=null && list.size()>0) { for (Task task : list) { TaskDetails taskDetails = new TaskDetails(); String id2 = task.getId(); taskDetails.setId(id2); taskDetails.setName(task.getName()); taskDetails.setVariables(taskService.getVariables(id2)); arrayList.add(taskDetails); } } return arrayList; }
Example 2
Source File: ProcessEngineService.java From open-cloud with MIT License | 5 votes |
/** * 获取代办列表 * * @param userId * @return */ public IPage<Task> findTodoTask(String userId, int firstResult, int maxResults) { //得到用户待办 TaskQuery query = taskService.createTaskQuery(); query.includeTaskLocalVariables(); if (StringUtils.isNotBlank(userId)) { query.taskAssignee(userId); } List<Task> list = query.listPage(firstResult, maxResults); IPage page = new Page(); page.setRecords(list); page.setTotal(query.count()); return page; }
Example 3
Source File: PurchaseApplyUserInnerServiceSMOImpl.java From MicroCommunity with Apache License 2.0 | 5 votes |
/** * 查询用户任务数 * * @param user * @return */ public long getUserTaskCount(@RequestBody AuditUser user) { TaskService taskService = processEngine.getTaskService(); TaskQuery query = taskService.createTaskQuery().processDefinitionKey("resourceEnter"); query.taskAssignee(user.getUserId()); return query.count(); }
Example 4
Source File: ResourceEntryStoreInnerServiceSMOImpl.java From MicroCommunity with Apache License 2.0 | 5 votes |
/** * 查询用户任务数 * * @param user * @return */ public long getUserTaskCount(@RequestBody AuditUser user) { TaskService taskService = processEngine.getTaskService(); TaskQuery query = taskService.createTaskQuery().processDefinitionKey("resourceEntry"); query.taskAssignee(user.getUserId()); return query.count(); }
Example 5
Source File: ComplaintUserInnerServiceSMOImpl.java From MicroCommunity with Apache License 2.0 | 5 votes |
/** * 查询用户任务数 * * @param user * @return */ public long getUserTaskCount(@RequestBody AuditUser user) { TaskService taskService = processEngine.getTaskService(); TaskQuery query = taskService.createTaskQuery().processDefinitionKey(getWorkflowDto(user.getCommunityId())); query.taskAssignee(user.getUserId()); return query.count(); }
Example 6
Source File: PurchaseApplyUserInnerServiceSMOImpl.java From MicroCommunity with Apache License 2.0 | 4 votes |
/** * 获取用户任务 * * @param user 用户信息 */ public List<PurchaseApplyDto> getUserTasks(@RequestBody AuditUser user) { TaskService taskService = processEngine.getTaskService(); TaskQuery query = taskService.createTaskQuery().processDefinitionKey("resourceEnter"); ; query.taskAssignee(user.getUserId()); query.orderByTaskCreateTime().desc(); List<Task> list = null; if (user.getPage() != PageDto.DEFAULT_PAGE) { list = query.listPage((user.getPage() - 1) * user.getRow(), user.getRow()); } else { list = query.list(); } List<String> complaintIds = new ArrayList<>(); Map<String, String> taskBusinessKeyMap = new HashMap<>(); for (Task task : list) { String processInstanceId = task.getProcessInstanceId(); //3.使用流程实例,查询 ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); //4.使用流程实例对象获取BusinessKey String business_key = pi.getBusinessKey(); complaintIds.add(business_key); taskBusinessKeyMap.put(business_key, task.getId()); } if (complaintIds == null || complaintIds.size() == 0) { return new ArrayList<>(); } //查询 投诉信息 PurchaseApplyDto purchaseApplyDto = new PurchaseApplyDto(); List<PurchaseApplyDto> purchaseApplyDtos = new ArrayList<>(); // ComplaintDto complaintDto = new ComplaintDto(); // complaintDto.setStoreId(user.getStoreId()); // complaintDto.setCommunityId(user.getCommunityId()); // complaintDto.setComplaintIds(complaintIds.toArray(new String[complaintIds.size()])); // List<ComplaintDto> tmpComplaintDtos = complaintInnerServiceSMOImpl.queryComplaints(complaintDto); // // for (ComplaintDto tmpComplaintDto : tmpComplaintDtos) { // tmpComplaintDto.setTaskId(taskBusinessKeyMap.get(tmpComplaintDto.getComplaintId())); // } return purchaseApplyDtos; }
Example 7
Source File: ResourceEntryStoreInnerServiceSMOImpl.java From MicroCommunity with Apache License 2.0 | 4 votes |
/** * 获取用户任务 * * @param user 用户信息 */ public List<PurchaseApplyDto> getUserTasks(@RequestBody AuditUser user) { TaskService taskService = processEngine.getTaskService(); TaskQuery query = taskService.createTaskQuery().processDefinitionKey("resourceEntry"); query.taskAssignee(user.getUserId()); query.orderByTaskCreateTime().desc(); List<Task> list = null; if(user.getPage() >=1){ user.setPage(user.getPage()-1); } if (user.getPage() != PageDto.DEFAULT_PAGE) { list = query.listPage(user.getPage(), user.getRow()); }else{ list = query.list(); } // List<PurchaseApplyDto> purchaseApplyDtos = new ArrayList<>(); // // for (Task task : list) { // String id = task.getId(); // //System.out.println("tasks:" + JSONObject.toJSONString(task)); // PurchaseApplyDto purchaseApplyDto = (PurchaseApplyDto) taskService.getVariable(id, "purchaseApplyDto"); // purchaseApplyDto.setTaskId(id); // purchaseApplyDto.setProcessInstanceId(task.getProcessInstanceId()); // purchaseApplyDtos.add(purchaseApplyDto); // } // return purchaseApplyDtos; List<String> applyOrderIds = new ArrayList<>(); Map<String, String> taskBusinessKeyMap = new HashMap<>(); for (Task task : list) { String processInstanceId = task.getProcessInstanceId(); //3.使用流程实例,查询 ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); //4.使用流程实例对象获取BusinessKey String business_key = pi.getBusinessKey(); applyOrderIds.add(business_key); taskBusinessKeyMap.put(business_key, task.getId()); } if (applyOrderIds == null || applyOrderIds.size() == 0) { return new ArrayList<>(); } //查询 投诉信息 PurchaseApplyDto purchaseApplyDto = new PurchaseApplyDto(); purchaseApplyDto.setStoreId(user.getStoreId()); purchaseApplyDto.setApplyOrderIds(applyOrderIds.toArray(new String[applyOrderIds.size()])); List<PurchaseApplyDto> tmpPurchaseApplyDtos = purchaseApplyInnerServiceSMOImpl.queryPurchaseApplyAndDetails(purchaseApplyDto); for (PurchaseApplyDto tmpPurchaseApplyDto : tmpPurchaseApplyDtos) { tmpPurchaseApplyDto.setTaskId(taskBusinessKeyMap.get(tmpPurchaseApplyDto.getApplyOrderId())); } return tmpPurchaseApplyDtos; }
Example 8
Source File: ComplaintUserInnerServiceSMOImpl.java From MicroCommunity with Apache License 2.0 | 4 votes |
/** * 获取用户任务 * * @param user 用户信息 */ public List<ComplaintDto> getUserTasks(@RequestBody AuditUser user) { TaskService taskService = processEngine.getTaskService(); TaskQuery query = taskService.createTaskQuery().processDefinitionKey(getWorkflowDto(user.getCommunityId())); ; query.taskAssignee(user.getUserId()); query.orderByTaskCreateTime().desc(); List<Task> list = null; if (user.getPage() != PageDto.DEFAULT_PAGE) { list = query.listPage((user.getPage() - 1) * user.getRow(), user.getRow()); } else { list = query.list(); } List<String> complaintIds = new ArrayList<>(); Map<String, String> taskBusinessKeyMap = new HashMap<>(); for (Task task : list) { String processInstanceId = task.getProcessInstanceId(); //3.使用流程实例,查询 ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); //4.使用流程实例对象获取BusinessKey String business_key = pi.getBusinessKey(); complaintIds.add(business_key); taskBusinessKeyMap.put(business_key, task.getId()); } if (complaintIds == null || complaintIds.size() == 0) { return new ArrayList<>(); } //查询 投诉信息 ComplaintDto complaintDto = new ComplaintDto(); complaintDto.setStoreId(user.getStoreId()); complaintDto.setCommunityId(user.getCommunityId()); complaintDto.setComplaintIds(complaintIds.toArray(new String[complaintIds.size()])); List<ComplaintDto> tmpComplaintDtos = complaintInnerServiceSMOImpl.queryComplaints(complaintDto); for (ComplaintDto tmpComplaintDto : tmpComplaintDtos) { tmpComplaintDto.setTaskId(taskBusinessKeyMap.get(tmpComplaintDto.getComplaintId())); } return tmpComplaintDtos; }
Example 9
Source File: FlowableProcessController.java From hsweb-framework with Apache License 2.0 | 3 votes |
@GetMapping("/todo") @ApiOperation("获取待办任务") @Authorize(merge = false) public ResponseMessage<PagerResult<TaskInfo>> getTodoList(QueryParamEntity query, Authentication authentication) { TaskQuery taskQuery = taskService.createTaskQuery(); taskQuery.taskAssignee(authentication.getUser().getId()); PagerResult<TaskInfo> result = QueryUtils.doQuery(taskQuery, query, TaskInfo::of); return ResponseMessage.ok(result).exclude(query.getExcludes()).include(query.getIncludes()); }