|
|
|
@@ -23,6 +23,7 @@ import org.flowable.engine.runtime.ProcessInstance; |
|
|
|
import org.flowable.identitylink.api.IdentityLink; |
|
|
|
import org.flowable.image.ProcessDiagramGenerator; |
|
|
|
import org.flowable.task.api.Task; |
|
|
|
import org.flowable.task.api.TaskQuery; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -222,10 +223,14 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData list(Integer flowType, Integer pageNum, Integer pageSize,Long userId) { |
|
|
|
String flowKey = getFlowKeyByType(flowType); |
|
|
|
int total = taskService.createTaskQuery().processDefinitionKey(flowKey) |
|
|
|
.taskCandidateUser(userId.toString()).list().size(); |
|
|
|
public ResultData list(String flowType, Integer pageNum, Integer pageSize,Long userId) { |
|
|
|
List<String> definitionKeyList = new ArrayList<>(); |
|
|
|
for (String ft:flowType.split(",")) { |
|
|
|
definitionKeyList.add(getFlowKeyByType(Integer.parseInt(ft))); |
|
|
|
} |
|
|
|
TaskQuery taskQuery = taskService.createTaskQuery(); |
|
|
|
taskQuery.processDefinitionKeyIn(definitionKeyList); |
|
|
|
int total = taskQuery.taskCandidateUser(userId.toString()).list().size(); |
|
|
|
int pages; |
|
|
|
if(total % pageSize == 0){ |
|
|
|
pages = total / pageSize; |
|
|
|
@@ -233,8 +238,7 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
pages = total / pageSize +1; |
|
|
|
} |
|
|
|
|
|
|
|
List<Task> tasks = taskService.createTaskQuery().processDefinitionKey(flowKey) |
|
|
|
.taskCandidateUser(userId.toString()).orderByTaskCreateTime().desc() |
|
|
|
List<Task> tasks = taskQuery.orderByTaskCreateTime().desc() |
|
|
|
.listPage((pageNum -1) * pageSize,pageSize); |
|
|
|
List<Map<String,Object>> result = new ArrayList<>(); |
|
|
|
|
|
|
|
@@ -247,6 +251,7 @@ public class WxFlowServiceImpl implements WxFlowService { |
|
|
|
taskInfoMap.put("processInstanceId",task.getProcessInstanceId()); |
|
|
|
taskInfoMap.put("taskId",task.getId()); |
|
|
|
taskInfoMap.put("businessId",mapInfo.get("businessId")); |
|
|
|
taskInfoMap.put("businessType",mapInfo.get("flowType")); |
|
|
|
List<Map<String,String>> variables = (List)mapInfo.get("variables"); //定制variables,回传 |
|
|
|
if(CollectionUtils.isNotEmpty(variables)){ |
|
|
|
for (Map<String,String> m:variables) { |
|
|
|
|