增加序列号
This commit is contained in:
parent
11422c57bf
commit
dc76bd8a30
|
@ -2,6 +2,7 @@ package com.snow.web.controller.flowable;
|
|||
|
||||
import com.snow.common.core.controller.BaseController;
|
||||
import com.snow.common.core.domain.AjaxResult;
|
||||
import com.snow.common.core.page.PageModel;
|
||||
import com.snow.common.core.page.TableDataInfo;
|
||||
import com.snow.common.exception.BusinessException;
|
||||
import com.snow.common.utils.StringUtils;
|
||||
|
@ -86,10 +87,9 @@ public class FlowController extends BaseController {
|
|||
@PostMapping("/getMyHistoricProcessInstance")
|
||||
@ResponseBody
|
||||
public TableDataInfo getMyHistoricProcessInstance(ProcessInstanceDTO processInstanceDTO){
|
||||
startPage();
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
processInstanceDTO.setStartedUserId(String.valueOf(sysUser.getUserId()));
|
||||
List<ProcessInstanceVO> historicProcessInstance = flowableService.getHistoricProcessInstance(processInstanceDTO);
|
||||
return getDataTable(historicProcessInstance);
|
||||
PageModel<ProcessInstanceVO> historicProcessInstance = flowableService.getHistoricProcessInstance(processInstanceDTO);
|
||||
return getFlowDataTable(historicProcessInstance);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.snow.web.controller.flowable;
|
|||
import com.snow.common.annotation.Log;
|
||||
import com.snow.common.core.controller.BaseController;
|
||||
import com.snow.common.core.domain.AjaxResult;
|
||||
import com.snow.common.core.page.PageModel;
|
||||
import com.snow.common.core.page.TableDataInfo;
|
||||
import com.snow.common.enums.BusinessType;
|
||||
import com.snow.flowable.domain.*;
|
||||
|
@ -82,10 +83,9 @@ public class FlowModelerController extends BaseController
|
|||
@ResponseBody
|
||||
public TableDataInfo findTasksByUserId(TaskBaseDTO taskBaseDTO)
|
||||
{
|
||||
startPage();
|
||||
Long userId = ShiroUtils.getUserId();
|
||||
List<TaskVO> taskList = flowableService.findTasksByUserId(String.valueOf(userId), taskBaseDTO);
|
||||
return getDataTable(taskList);
|
||||
PageModel<TaskVO> taskList = flowableService.findTasksByUserId(String.valueOf(userId), taskBaseDTO);
|
||||
return getFlowDataTable(taskList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -77,6 +77,8 @@ public class SysOaLeaveController extends BaseController
|
|||
public TableDataInfo list(SysOaLeave sysOaLeave)
|
||||
{
|
||||
startPage();
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
sysOaLeave.setCreateBy(sysUser.getUserName());
|
||||
List<SysOaLeave> list = sysOaLeaveService.selectSysOaLeaveList(sysOaLeave);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
|
@ -288,4 +288,13 @@ public class SysUserController extends BaseController
|
|||
userService.checkUserAllowed(user);
|
||||
return toAjax(userService.changeStatus(user));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getUserInfoById")
|
||||
@ResponseBody
|
||||
public AjaxResult getUserInfoById(Long id)
|
||||
{
|
||||
SysUser sysUser = userService.selectUserById(id);
|
||||
return AjaxResult.success(sysUser);
|
||||
}
|
||||
}
|
|
@ -76,7 +76,8 @@
|
|||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
<logger name="org.flowable.task.service.impl.persistence.entity" level="DEBUG" />
|
||||
|
||||
<logger name="org.flowable.db.mapping.entity" level="DEBUG" />
|
||||
<logger name="org.flowable.engine.impl.persistence.entity" level="DEBUG" />
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
|
|
@ -1699,6 +1699,21 @@ var table = {
|
|||
isMobile: function () {
|
||||
return navigator.userAgent.match(/(Android|iPhone|SymbianOS|Windows Phone|iPad|iPod)/i);
|
||||
},
|
||||
getDataById: function(url,id) {
|
||||
$.ajaxSettings.async = false;
|
||||
var resultData='';
|
||||
$.post(url, {"id":id}, function(result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
console.log(result)
|
||||
resultData=result.data;
|
||||
} else if (result.code == web_status.WARNING) {
|
||||
$.modal.alertWarning(result.msg)
|
||||
} else {
|
||||
$.modal.alertError(result.msg);
|
||||
}
|
||||
});
|
||||
return resultData;
|
||||
},
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
showColumns: false, // 是否显示隐藏某列下拉框
|
||||
showToggle: false,
|
||||
showSearch: false, // 是否显示检索信息
|
||||
rowStyle:rowStyle,//通过自定义函数设置行样式
|
||||
// rowStyle:rowStyle,//通过自定义函数设置行样式
|
||||
modalName: "我的待办",
|
||||
columns: [{
|
||||
title: '序号',
|
||||
|
@ -260,6 +260,8 @@
|
|||
</script>
|
||||
<script th:inline="javascript">
|
||||
var removeFlag = [[${@permission.hasPermi('system:flow:remove')}]];
|
||||
|
||||
var processInstanceStatusDatas = [[${@dict.getType('process_instance_status')}]];
|
||||
var prefix = ctx + "modeler";
|
||||
var prefixFlow = ctx + "flow";
|
||||
$(function() {
|
||||
|
@ -273,7 +275,7 @@
|
|||
showColumns: false, // 是否显示隐藏某列下拉框
|
||||
showToggle: false,
|
||||
showSearch: false, // 是否显示检索信息
|
||||
rowStyle:rowStyle,//通过自定义函数设置行样式
|
||||
// rowStyle:rowStyle,//通过自定义函数设置行样式
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
|
@ -293,11 +295,18 @@
|
|||
},
|
||||
{
|
||||
field: 'startUserId',
|
||||
title: '流程发起人'
|
||||
title: '流程发起人',
|
||||
formatter: function(value, row, index) {
|
||||
var data= $.common.getDataById('/system/user/getUserInfoById',value);
|
||||
return data.userName;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'isFinished',
|
||||
title: '流程状态'
|
||||
title: '流程状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(processInstanceStatusDatas, value);
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
|
|
|
@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import com.snow.common.core.page.PageModel;
|
||||
import com.snow.common.utils.ServletUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -63,7 +64,6 @@ public class BaseController
|
|||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求排序数据
|
||||
*/
|
||||
|
@ -117,6 +117,21 @@ public class BaseController
|
|||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* flowable的分页
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
protected TableDataInfo getFlowDataTable(PageModel<?> list)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(0);
|
||||
rspData.setRows(list.getPagedRecords());
|
||||
rspData.setTotal(list.getTotalCount());
|
||||
rspData.setPageIndex(list.getPageNo());
|
||||
rspData.setPageSize(list.getPageSize());
|
||||
return rspData;
|
||||
}
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
package com.snow.common.core.page;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qimingjin
|
||||
* @Title:
|
||||
* @Description:
|
||||
* @date 2020/11/26 14:33
|
||||
*/
|
||||
public class PageModel<T> implements Serializable {
|
||||
private static final long serialVersionUID = -1183925952330439225L;
|
||||
public static final int DEFAULT_PAGE_SIZE = 10;
|
||||
private int pageNo = 1;
|
||||
private int pageSize = 10;
|
||||
private int totalCount;
|
||||
private List<T> pagedRecords;
|
||||
|
||||
public PageModel() {
|
||||
}
|
||||
|
||||
public int getTotalPages() {
|
||||
return (this.totalCount + this.pageSize - 1) / this.pageSize;
|
||||
}
|
||||
|
||||
public int getPageFrom() {
|
||||
return (this.pageNo - 1) * this.pageSize + 1;
|
||||
}
|
||||
|
||||
public int getPageEnd() {
|
||||
int endIndex = this.pageNo * this.pageSize;
|
||||
return endIndex > this.totalCount ? this.totalCount : endIndex;
|
||||
}
|
||||
|
||||
public int getOffset() {
|
||||
return (this.pageNo - 1) * this.pageSize;
|
||||
}
|
||||
|
||||
public int getPrevPage() {
|
||||
return this.pageNo <= 1 ? 1 : this.pageNo - 1;
|
||||
}
|
||||
|
||||
public int getNextPage() {
|
||||
if (this.pageNo > this.getTotalPages()) {
|
||||
return this.getTotalPages() == 0 ? 1 : this.getTotalPages();
|
||||
} else {
|
||||
return this.pageNo + 1;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFirstPage() {
|
||||
return this.pageNo == 1;
|
||||
}
|
||||
|
||||
public boolean isLastPage() {
|
||||
return this.pageNo == this.getTotalPages();
|
||||
}
|
||||
|
||||
public int getPageNo() {
|
||||
return this.pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(int pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return this.pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getTotalCount() {
|
||||
return this.totalCount;
|
||||
}
|
||||
|
||||
public void setTotalCount(int totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
public List<T> getPagedRecords() {
|
||||
return this.pagedRecords;
|
||||
}
|
||||
|
||||
public void setPagedRecords(List<T> pagedRecords) {
|
||||
this.pagedRecords = pagedRecords;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "PageModel [pageNo=" + this.pageNo + ", pageSize=" + this.pageSize + ", totalCount=" + this.totalCount + ", pagedRecords=" + this.pagedRecords + "]";
|
||||
}
|
||||
}
|
|
@ -18,6 +18,12 @@ import java.io.Serializable;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FlowBaseDTO implements Serializable {
|
||||
/** 当前记录起始索引 */
|
||||
private Integer pageNum;
|
||||
|
||||
/** 每页显示记录数 */
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 初始页
|
||||
*/
|
||||
|
@ -26,4 +32,21 @@ public class FlowBaseDTO implements Serializable {
|
|||
* 每页数
|
||||
*/
|
||||
private int maxResults=10;
|
||||
|
||||
|
||||
public Integer getPageNum() {
|
||||
return (this.pageNum - 1) * this.pageSize;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
package com.snow.flowable.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author qimingjin
|
||||
* @Title:
|
||||
* @Description:
|
||||
* @date 2020/11/26 16:41
|
||||
*/
|
||||
@Data
|
||||
public class HistoricTaskInstanceDTO extends FlowBaseDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
public String userId;
|
||||
public String taskDefinitionId;
|
||||
public String processDefinitionId;
|
||||
public String processDefinitionKey;
|
||||
public String processDefinitionKeyLike;
|
||||
public String processDefinitionName;
|
||||
public String processDefinitionNameLike;
|
||||
|
||||
public String deploymentId;
|
||||
public Collection<String> deploymentIds;
|
||||
public String cmmnDeploymentId;
|
||||
|
||||
public String processInstanceId;
|
||||
|
||||
public String BusinessKey;
|
||||
public String BusinessKeyLike;
|
||||
|
||||
public String executionId;
|
||||
public String scopeId;
|
||||
public String subScopeId;
|
||||
public String scopeType;
|
||||
public String scopeDefinitionId;
|
||||
public String propagatedStageInstanceId;
|
||||
public String processInstanceIdWithChildren;
|
||||
public String caseInstanceIdWithChildren;
|
||||
public String caseDefinitionKey;
|
||||
public String caseDefinitionKeyLike;
|
||||
public String caseDefinitionKeyLikeIgnoreCase;
|
||||
public String taskId;
|
||||
public String taskName;
|
||||
public String taskNameLike;
|
||||
public String taskNameLikeIgnoreCase;
|
||||
public String taskParentTaskId;
|
||||
public String taskDescription;
|
||||
public String taskDescriptionLike;
|
||||
public String taskDescriptionLikeIgnoreCase;
|
||||
public String taskDeleteReason;
|
||||
public String taskDeleteReasonLike;
|
||||
public String taskOwner;
|
||||
public String taskOwnerLike;
|
||||
public String taskOwnerLikeIgnoreCase;
|
||||
public String taskAssignee;
|
||||
public String taskAssigneeLike;
|
||||
public String taskAssigneeLikeIgnoreCase;
|
||||
public String taskDefinitionKey;
|
||||
public String taskDefinitionKeyLike;
|
||||
|
||||
public String candidateUser;
|
||||
public String candidateGroup;
|
||||
|
||||
public String involvedUser;
|
||||
public boolean ignoreAssigneeValue;
|
||||
public Integer taskPriority;
|
||||
public Integer taskMinPriority;
|
||||
public Integer taskMaxPriority;
|
||||
public boolean finished;
|
||||
public boolean unfinished;
|
||||
/**
|
||||
* 流程状态(0--进行中,1-结束)
|
||||
*/
|
||||
public Integer processStatus;
|
||||
|
||||
public Date dueDate;
|
||||
public Date dueAfter;
|
||||
public Date dueBefore;
|
||||
public boolean withoutDueDate;
|
||||
public Date creationDate;
|
||||
public Date creationAfterDate;
|
||||
public Date creationBeforeDate;
|
||||
public Date completedDate;
|
||||
public Date completedAfterDate;
|
||||
public Date completedBeforeDate;
|
||||
public String category;
|
||||
public boolean withFormKey;
|
||||
public String formKey;
|
||||
public String tenantId;
|
||||
public String tenantIdLike;
|
||||
public Integer taskVariablesLimit;
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.snow.flowable.domain;
|
||||
|
||||
import com.snow.common.utils.StringUtils;
|
||||
import com.snow.common.utils.bean.BeanUtils;
|
||||
import lombok.Data;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.task.api.history.HistoricTaskInstance;
|
||||
import org.flowable.task.service.TaskServiceConfiguration;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author qimingjin
|
||||
* @Title:
|
||||
* @Description:
|
||||
* @date 2020/11/26 16:41
|
||||
*/
|
||||
@Data
|
||||
public class HistoricTaskInstanceVO implements Serializable {
|
||||
public String executionId;
|
||||
public String processInstanceId;
|
||||
public String processDefinitionId;
|
||||
public String taskDefinitionId;
|
||||
public String scopeId;
|
||||
public String subScopeId;
|
||||
public String scopeType;
|
||||
public String scopeDefinitionId;
|
||||
public String propagatedStageInstanceId;
|
||||
public Date createTime;
|
||||
public Date endTime;
|
||||
public Long durationInMillis;
|
||||
public String deleteReason;
|
||||
public String name;
|
||||
public String localizedName;
|
||||
public String parentTaskId;
|
||||
public String description;
|
||||
public String localizedDescription;
|
||||
public String owner;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
public String assignee;
|
||||
public String taskDefinitionKey;
|
||||
public String formKey;
|
||||
public int priority;
|
||||
public Date dueDate;
|
||||
public Date claimTime;
|
||||
public String category;
|
||||
public String tenantId = TaskServiceConfiguration.NO_TENANT_ID;
|
||||
public Date lastUpdateTime;
|
||||
|
||||
public static List<HistoricTaskInstanceVO> warpList(List<HistoricTaskInstance> historicTaskInstanceList){
|
||||
return historicTaskInstanceList.stream().map(t->{
|
||||
HistoricTaskInstanceVO historicTaskInstanceVO=new HistoricTaskInstanceVO();
|
||||
BeanUtils.copyProperties(t,historicTaskInstanceVO);
|
||||
|
||||
return historicTaskInstanceVO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@ import java.io.Serializable;
|
|||
* @date 2020/11/20 13:43
|
||||
*/
|
||||
@Data
|
||||
public class TaskBaseDTO implements Serializable {
|
||||
public class TaskBaseDTO extends FlowBaseDTO implements Serializable {
|
||||
|
||||
private String processInstanceId;
|
||||
|
||||
|
@ -20,13 +20,6 @@ public class TaskBaseDTO implements Serializable {
|
|||
private String taskId;
|
||||
|
||||
private String businessKey;
|
||||
/**
|
||||
* 初始页
|
||||
*/
|
||||
private int firstResult=0;
|
||||
/**
|
||||
* 每页数
|
||||
*/
|
||||
private int maxResults=10;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.snow.flowable.service;
|
||||
|
||||
import com.snow.common.core.page.PageModel;
|
||||
import com.snow.flowable.domain.*;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
|
@ -8,7 +9,6 @@ import org.flowable.task.api.history.HistoricTaskInstance;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author qimingjin
|
||||
|
@ -55,12 +55,12 @@ public interface FlowableService {
|
|||
Task getTask(String taskId);
|
||||
|
||||
/**
|
||||
* 获取代办
|
||||
* 获取代办 分页获取
|
||||
* @param userId
|
||||
* @param taskBaseDTO
|
||||
* @return
|
||||
*/
|
||||
List<TaskVO> findTasksByUserId(String userId,TaskBaseDTO taskBaseDTO);
|
||||
PageModel<TaskVO> findTasksByUserId(String userId,TaskBaseDTO taskBaseDTO);
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
|
@ -110,9 +110,18 @@ public interface FlowableService {
|
|||
List<TaskVO> getDynamicFlowNodeInfo(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 查询历史流程实例
|
||||
* 查询历史流程实例(分页)
|
||||
* 可查询我发起的流程
|
||||
* @param processInstanceDTO
|
||||
* @return
|
||||
*/
|
||||
List<ProcessInstanceVO> getHistoricProcessInstance(ProcessInstanceDTO processInstanceDTO);
|
||||
PageModel<ProcessInstanceVO> getHistoricProcessInstance(ProcessInstanceDTO processInstanceDTO);
|
||||
|
||||
/**
|
||||
* 查询历史任务实例(分页)
|
||||
* 可查询我经办的
|
||||
* @param historicTaskInstanceDTO
|
||||
* @return
|
||||
*/
|
||||
PageModel<HistoricTaskInstanceVO> getHistoricTaskInstance(HistoricTaskInstanceDTO historicTaskInstanceDTO);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.snow.flowable.service.impl;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.snow.common.core.page.PageModel;
|
||||
import com.snow.common.core.text.Convert;
|
||||
import com.snow.common.exception.BusinessException;
|
||||
import com.snow.flowable.domain.*;
|
||||
|
@ -22,7 +23,6 @@ import org.flowable.engine.*;
|
|||
import org.flowable.engine.history.HistoricActivityInstance;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.engine.history.HistoricProcessInstanceQuery;
|
||||
import org.flowable.engine.impl.el.JuelExpression;
|
||||
import org.flowable.engine.repository.Deployment;
|
||||
import org.flowable.engine.repository.DeploymentQuery;
|
||||
import org.flowable.engine.repository.ProcessDefinition;
|
||||
|
@ -33,7 +33,6 @@ import org.flowable.task.api.Task;
|
|||
import org.flowable.task.api.TaskQuery;
|
||||
import org.flowable.task.api.history.HistoricTaskInstance;
|
||||
import org.flowable.task.api.history.HistoricTaskInstanceQuery;
|
||||
import org.flowable.variable.api.history.HistoricVariableInstance;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -42,7 +41,6 @@ import org.springframework.util.CollectionUtils;
|
|||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
@ -194,7 +192,7 @@ public class FlowableServiceImpl implements FlowableService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<TaskVO> findTasksByUserId(String userId, TaskBaseDTO taskBaseDTO) {
|
||||
public PageModel<TaskVO> findTasksByUserId(String userId, TaskBaseDTO taskBaseDTO) {
|
||||
//根据用户ID获取角色
|
||||
List<SysRole> sysRoles = roleService.selectRolesByUserId(Long.parseLong(userId));
|
||||
|
||||
|
@ -220,10 +218,15 @@ public class FlowableServiceImpl implements FlowableService {
|
|||
if(StringUtils.isEmpty(taskBaseDTO.getDefinitionKey())){
|
||||
taskQuery.processDefinitionKey(taskBaseDTO.getDefinitionKey());
|
||||
}
|
||||
long count = taskQuery
|
||||
.orderByTaskCreateTime()
|
||||
.desc()
|
||||
.count();
|
||||
List<Task> taskList = taskQuery.endOr()
|
||||
.orderByTaskCreateTime()
|
||||
.desc()
|
||||
.listPage(taskBaseDTO.getFirstResult(), taskBaseDTO.getMaxResults());
|
||||
.listPage(taskBaseDTO.getPageNum(), taskBaseDTO.getPageSize());
|
||||
|
||||
List<TaskVO> taskVoList = taskList.stream().map(t -> {
|
||||
TaskVO taskVO = new TaskVO();
|
||||
taskVO.setTaskId(t.getId());
|
||||
|
@ -244,7 +247,10 @@ public class FlowableServiceImpl implements FlowableService {
|
|||
taskVO.setStartTime(historicProcessInstance.getStartTime());
|
||||
return taskVO;
|
||||
}).collect(Collectors.toList());
|
||||
return taskVoList;
|
||||
PageModel<TaskVO> pageModel = new PageModel<> ();
|
||||
pageModel.setTotalCount((int)count);
|
||||
pageModel.setPagedRecords(taskVoList);
|
||||
return pageModel;
|
||||
}
|
||||
|
||||
|
||||
|
@ -447,7 +453,7 @@ public class FlowableServiceImpl implements FlowableService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ProcessInstanceVO> getHistoricProcessInstance(ProcessInstanceDTO processInstanceDTO) {
|
||||
public PageModel<ProcessInstanceVO> getHistoricProcessInstance(ProcessInstanceDTO processInstanceDTO) {
|
||||
HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery();
|
||||
if(!StringUtils.isEmpty(processInstanceDTO.getBusinessKey())){
|
||||
historicProcessInstanceQuery.processInstanceBusinessKey(processInstanceDTO.getBusinessKey());
|
||||
|
@ -467,13 +473,50 @@ public class FlowableServiceImpl implements FlowableService {
|
|||
if(!StringUtils.isEmpty(processInstanceDTO.getFinishedAfter())){
|
||||
historicProcessInstanceQuery.finishedAfter(processInstanceDTO.getFinishedAfter());
|
||||
}
|
||||
|
||||
if(!StringUtils.isEmpty(processInstanceDTO.getStartedUserId())){
|
||||
historicProcessInstanceQuery.startedBy(processInstanceDTO.getStartedUserId());
|
||||
}
|
||||
long count = historicProcessInstanceQuery.
|
||||
orderByProcessInstanceStartTime().
|
||||
desc().
|
||||
count();
|
||||
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.
|
||||
orderByProcessInstanceStartTime().
|
||||
desc().
|
||||
listPage(processInstanceDTO.getFirstResult(), processInstanceDTO.getMaxResults());
|
||||
//List<ProcessInstanceVO> processInstanceVOS = com.snow.common.utils.bean.BeanUtils.transformList(historicProcessInstances, ProcessInstanceVO.class);
|
||||
return ProcessInstanceVO.warpList(historicProcessInstances);
|
||||
listPage(processInstanceDTO.getPageNum(), processInstanceDTO.getPageSize());
|
||||
PageModel<ProcessInstanceVO> pageModel = new PageModel<> ();
|
||||
pageModel.setTotalCount((int)count);
|
||||
pageModel.setPagedRecords(ProcessInstanceVO.warpList(historicProcessInstances));
|
||||
//List<ProcessInstanceVO> processInstanceVOS = com.snow.common.utils.bean.BeanUtils.transformList(pageInfo.getList(), ProcessInstanceVO.class);
|
||||
return pageModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageModel<HistoricTaskInstanceVO> getHistoricTaskInstance(HistoricTaskInstanceDTO historicTaskInstanceDTO) {
|
||||
HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery();
|
||||
if(!StringUtils.isEmpty(historicTaskInstanceDTO.getProcessDefinitionName())){
|
||||
historicTaskInstanceQuery.processDefinitionName(historicTaskInstanceDTO.getProcessDefinitionName());
|
||||
}
|
||||
if(!StringUtils.isEmpty(historicTaskInstanceDTO.getUserId())){
|
||||
historicTaskInstanceQuery.taskAssignee(historicTaskInstanceDTO.getUserId());
|
||||
}
|
||||
if(!StringUtils.isEmpty(historicTaskInstanceDTO.getBusinessKey())){
|
||||
historicTaskInstanceQuery.processInstanceBusinessKey(historicTaskInstanceDTO.getBusinessKey());
|
||||
}
|
||||
if(!StringUtils.isEmpty(historicTaskInstanceDTO.getBusinessKeyLike())){
|
||||
historicTaskInstanceQuery.processInstanceBusinessKeyLike(historicTaskInstanceDTO.getBusinessKeyLike());
|
||||
}
|
||||
long count = historicTaskInstanceQuery.orderByHistoricTaskInstanceStartTime().
|
||||
desc().
|
||||
count();
|
||||
List<HistoricTaskInstance> historicTaskInstances = historicTaskInstanceQuery.orderByHistoricTaskInstanceStartTime().
|
||||
desc().
|
||||
listPage(historicTaskInstanceDTO.getPageNum(), historicTaskInstanceDTO.getPageSize());
|
||||
// List<HistoricTaskInstanceVO> processInstanceVOS = com.snow.common.utils.bean.BeanUtils.transformList(historicTaskInstances, HistoricTaskInstanceVO.class);
|
||||
PageModel<HistoricTaskInstanceVO> pageModel = new PageModel<> ();
|
||||
pageModel.setTotalCount((int)count);
|
||||
pageModel.setPagedRecords(HistoricTaskInstanceVO.warpList(historicTaskInstances));
|
||||
return pageModel;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue