[新增] 代办查询
This commit is contained in:
-18
@@ -2,12 +2,9 @@ package com.adc.da.wkflow.business_activiti.service;
|
|||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.adc.da.wkflow.business_activiti.dto.TaskCommonQuery;
|
import com.adc.da.wkflow.business_activiti.dto.TaskCommonQuery;
|
||||||
import com.adc.da.wkflow.business_main.mapper.TaskMapper;
|
|
||||||
import com.adc.da.wkflow.util.date.DateTools;
|
import com.adc.da.wkflow.util.date.DateTools;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import org.activiti.engine.TaskService;
|
import org.activiti.engine.TaskService;
|
||||||
import org.activiti.engine.task.NativeTaskQuery;
|
import org.activiti.engine.task.NativeTaskQuery;
|
||||||
import org.activiti.engine.task.Task;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -15,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待办任务注入类,动态修改 Task的assignee等
|
* 待办任务注入类,动态修改 Task的assignee等
|
||||||
@@ -31,8 +27,6 @@ public class TaskTodoService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TaskService taskService;
|
private TaskService taskService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TaskMapper taskMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询待办任务 拼接sql 包含待办任务和委托任务
|
* 查询待办任务 拼接sql 包含待办任务和委托任务
|
||||||
@@ -83,16 +77,4 @@ public class TaskTodoService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Page<Task> selectTask(TaskCommonQuery taskCommonQuery){
|
|
||||||
Page<Task> page = new Page<>();
|
|
||||||
page.setCurrent(taskCommonQuery.getCurrent());
|
|
||||||
page.setSize(taskCommonQuery.getSize());
|
|
||||||
List<Task> tasks = taskMapper.todoTaskList(page, taskCommonQuery);
|
|
||||||
long count = taskMapper.todoTaskListCount( taskCommonQuery);
|
|
||||||
page.setRecords(tasks);
|
|
||||||
page.setSize(count);
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-6
@@ -130,11 +130,9 @@ public class TodoTaskController {
|
|||||||
}
|
}
|
||||||
// 创建查询对象
|
// 创建查询对象
|
||||||
NativeTaskQuery nativeTaskQuery = taskTodoService.createSql(taskCommonQuery);
|
NativeTaskQuery nativeTaskQuery = taskTodoService.createSql(taskCommonQuery);
|
||||||
// com.baomidou.mybatisplus.extension.plugins.pagination.Page<Task> page1 = taskTodoService.selectTask(taskCommonQuery);
|
List<Task> list = nativeTaskQuery.list();
|
||||||
// List<Task> list = page1.getRecords();
|
List<Task> listPage = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||||
List<Task> list1 = nativeTaskQuery.list();
|
List<Map<String, Object>> listEnd = ActivitiTools.turnTasks(listPage);
|
||||||
List<Task> list = nativeTaskQuery.listPage(taskCommonQuery.getCurrent(),taskCommonQuery.getSize());
|
|
||||||
List<Map<String, Object>> listEnd = ActivitiTools.turnTasks(list);
|
|
||||||
for (Map<String, Object> map : listEnd) {
|
for (Map<String, Object> map : listEnd) {
|
||||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(map.get("processDefinitionId") + "").singleResult();
|
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(map.get("processDefinitionId") + "").singleResult();
|
||||||
map.put("processInstanceName", processDefinition.getName());
|
map.put("processInstanceName", processDefinition.getName());
|
||||||
@@ -188,7 +186,7 @@ public class TodoTaskController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
page.setList(todoList);
|
page.setList(todoList);
|
||||||
page.setCount((long) list1.size());
|
page.setCount((long)list.size());
|
||||||
// page.setCount(page1.getSize());
|
// page.setCount(page1.getSize());
|
||||||
return Result.success(page);
|
return Result.success(page);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
package com.adc.da.wkflow.business_main.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@TableName("ACT_RU_TASK")
|
|
||||||
public class TaskEntity {
|
|
||||||
|
|
||||||
@TableId(value = "ID_", type = IdType.INPUT)
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
@TableField("REV_")
|
|
||||||
private int rev;
|
|
||||||
|
|
||||||
@TableField("EXECUTION_ID_")
|
|
||||||
private String executionId;
|
|
||||||
|
|
||||||
@TableField("PROC_INST_ID_")
|
|
||||||
private String processInstanceId;
|
|
||||||
|
|
||||||
@TableField("PROC_DEF_ID_")
|
|
||||||
private String processDefinitionId;
|
|
||||||
|
|
||||||
@TableField("NAME_")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@TableField("PARENT_TASK_ID_")
|
|
||||||
private String parentTaskId;
|
|
||||||
|
|
||||||
@TableField("DESCRIPTION_")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@TableField("TASK_DEF_KEY_")
|
|
||||||
private String taskDefinitionKey;
|
|
||||||
|
|
||||||
@TableField("OWNER_")
|
|
||||||
private String owner;
|
|
||||||
|
|
||||||
@TableField("ASSIGNEE_")
|
|
||||||
private String assignee;
|
|
||||||
|
|
||||||
@TableField("DELEGATION_")
|
|
||||||
private String delegation;
|
|
||||||
|
|
||||||
@TableField("PRIORITY_")
|
|
||||||
private int priority;
|
|
||||||
|
|
||||||
@TableField("CREATE_TIME_")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@TableField("DUE_DATE_")
|
|
||||||
private Date dueDate;
|
|
||||||
|
|
||||||
@TableField("CATEGORY_")
|
|
||||||
private String category;
|
|
||||||
|
|
||||||
@TableField("SUSPENSION_STATE_")
|
|
||||||
private int suspensionState;
|
|
||||||
|
|
||||||
@TableField("TENANT_ID_")
|
|
||||||
private String tenantId;
|
|
||||||
|
|
||||||
@TableField("FORM_KEY_")
|
|
||||||
private String formKey;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package com.adc.da.wkflow.business_main.mapper;
|
|
||||||
|
|
||||||
import com.adc.da.wkflow.business_activiti.dto.TaskCommonQuery;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import org.activiti.engine.task.Task;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface TaskMapper extends BaseMapper<Task> {
|
|
||||||
|
|
||||||
|
|
||||||
List<Task> todoTaskList(Page<Task> page, @Param("pageVO") TaskCommonQuery taskCommonQuery);
|
|
||||||
|
|
||||||
long todoTaskListCount(@Param("pageVO") TaskCommonQuery taskCommonQuery);
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user