mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-11-10 11:13:44 +08:00
update 调整流程实例,待办查询
This commit is contained in:
@@ -7,6 +7,7 @@ import org.dromara.common.core.domain.R;
|
|||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.workflow.domain.vo.FlowInstanceVo;
|
||||||
import org.dromara.workflow.service.IFlwInstanceService;
|
import org.dromara.workflow.service.IFlwInstanceService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -34,7 +35,7 @@ public class FlwInstanceController extends BaseController {
|
|||||||
* @param pageQuery 分页
|
* @param pageQuery 分页
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getPageByRunning")
|
@GetMapping("/getPageByRunning")
|
||||||
public TableDataInfo<Instance> getPageByRunning(Instance instance, PageQuery pageQuery) {
|
public TableDataInfo<FlowInstanceVo> getPageByRunning(Instance instance, PageQuery pageQuery) {
|
||||||
return flwInstanceService.getPageByRunning(instance, pageQuery);
|
return flwInstanceService.getPageByRunning(instance, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ public class FlwInstanceController extends BaseController {
|
|||||||
* @param pageQuery 分页
|
* @param pageQuery 分页
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getPageByFinish")
|
@GetMapping("/getPageByFinish")
|
||||||
public TableDataInfo<Instance> getPageByFinish(Instance instance, PageQuery pageQuery) {
|
public TableDataInfo<FlowInstanceVo> getPageByFinish(Instance instance, PageQuery pageQuery) {
|
||||||
return flwInstanceService.getPageByFinish(instance, pageQuery);
|
return flwInstanceService.getPageByFinish(instance, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package org.dromara.workflow.domain.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务请求对象
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FlowInstanceBo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义名称
|
||||||
|
*/
|
||||||
|
private String flowName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义编码
|
||||||
|
*/
|
||||||
|
private String flowCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
private List<String> permissionList;
|
||||||
|
}
|
||||||
@@ -33,6 +33,9 @@ public class FlowTaskBo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String flowCode;
|
private String flowCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例id
|
||||||
|
*/
|
||||||
private Long instanceId;
|
private Long instanceId;
|
||||||
|
|
||||||
private List<String> permissionList;
|
private List<String> permissionList;
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
package org.dromara.workflow.domain.vo;
|
package org.dromara.workflow.domain.vo;
|
||||||
|
|
||||||
import com.warm.flow.orm.entity.FlowHisTask;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 历史任务视图
|
* 历史任务视图
|
||||||
@@ -12,13 +15,147 @@ import java.io.Serializable;
|
|||||||
* @author may
|
* @author may
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class FlowHisTaskVo extends FlowHisTask implements Serializable {
|
public class FlowHisTaskVo implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户ID
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标记
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应flow_definition表的id
|
||||||
|
*/
|
||||||
|
private Long definitionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
*/
|
||||||
|
private String flowName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例表id
|
||||||
|
*/
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务表id
|
||||||
|
*/
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协作方式(1审批 2转办 3委派 4会签 5票签 6加签 7减签)
|
||||||
|
*/
|
||||||
|
private Integer cooperateType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务id
|
||||||
|
*/
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始节点编码
|
||||||
|
*/
|
||||||
|
private String nodeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始节点名称
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)
|
||||||
|
*/
|
||||||
|
private Integer nodeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标节点编码
|
||||||
|
*/
|
||||||
|
private String targetNodeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束节点名称
|
||||||
|
*/
|
||||||
|
private String targetNodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批者
|
||||||
|
*/
|
||||||
|
private String approver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协作人(只有转办、会签、票签、委派)
|
||||||
|
*/
|
||||||
|
private String collaborator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限标识 permissionFlag的list形式
|
||||||
|
*/
|
||||||
|
private List<String> permissionList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跳转类型(PASS通过 REJECT退回 NONE无动作)
|
||||||
|
*/
|
||||||
|
private String skipType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程状态(1审批中 2 审批通过 9已退回 10失效)
|
||||||
|
*/
|
||||||
|
private Integer flowStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批意见
|
||||||
|
*/
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务详情 存业务类的json
|
||||||
|
*/
|
||||||
|
private String ext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批表单是否自定义(Y是 2否)
|
||||||
|
*/
|
||||||
|
private String formCustom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批表单路径
|
||||||
|
*/
|
||||||
|
private String formPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程定义编码
|
* 流程定义编码
|
||||||
*/
|
*/
|
||||||
private String flowCode;
|
private String flowCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批者
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "approver")
|
||||||
|
private String approverName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package org.dromara.workflow.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例视图
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FlowInstanceVo {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户ID
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标记
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应flow_definition表的id
|
||||||
|
*/
|
||||||
|
private Long definitionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
*/
|
||||||
|
private String flowName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
*/
|
||||||
|
private String flowCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务id
|
||||||
|
*/
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)
|
||||||
|
*/
|
||||||
|
private Integer nodeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程节点编码 每个流程的nodeCode是唯一的,即definitionId+nodeCode唯一,在数据库层面做了控制
|
||||||
|
*/
|
||||||
|
private String nodeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程节点名称
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程变量
|
||||||
|
*/
|
||||||
|
private String variable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程状态(0待提交 1审批中 2 审批通过 3自动通过 8已完成 9已退回 10失效)
|
||||||
|
*/
|
||||||
|
private Integer flowStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程激活状态(0挂起 1激活)
|
||||||
|
*/
|
||||||
|
private Integer activityStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批表单是否自定义(Y是 2否)
|
||||||
|
*/
|
||||||
|
private String formCustom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批表单是否自定义(Y是 2否)
|
||||||
|
*/
|
||||||
|
private String formPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段,预留给业务系统使用
|
||||||
|
*/
|
||||||
|
private String ext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义版本
|
||||||
|
*/
|
||||||
|
private String version;
|
||||||
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
package org.dromara.workflow.domain.vo;
|
package org.dromara.workflow.domain.vo;
|
||||||
|
|
||||||
import com.warm.flow.orm.entity.FlowTask;
|
import com.warm.flow.core.entity.User;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.common.core.domain.dto.UserDTO;
|
import org.dromara.common.core.domain.dto.UserDTO;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,16 +15,98 @@ import java.util.List;
|
|||||||
* @author may
|
* @author may
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class FlowTaskVo extends FlowTask implements Serializable {
|
public class FlowTaskVo implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户ID
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标记
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应flow_definition表的id
|
||||||
|
*/
|
||||||
|
private Long definitionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例表id
|
||||||
|
*/
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
*/
|
||||||
|
private String flowName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务id
|
||||||
|
*/
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点编码
|
||||||
|
*/
|
||||||
|
private String nodeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点名称
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)
|
||||||
|
*/
|
||||||
|
private Integer nodeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限标识 permissionFlag的list形式
|
||||||
|
*/
|
||||||
|
private List<String> permissionList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程用户列表
|
||||||
|
*/
|
||||||
|
private List<User> userList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批表单是否自定义(Y是 2否)
|
||||||
|
*/
|
||||||
|
private String formCustom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批表单
|
||||||
|
*/
|
||||||
|
private String formPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程定义编码
|
* 流程定义编码
|
||||||
*/
|
*/
|
||||||
private String flowCode;
|
private String flowCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程版本号
|
||||||
|
*/
|
||||||
|
private String version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程状态
|
* 流程状态
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.dromara.workflow.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.dromara.workflow.domain.bo.FlowInstanceBo;
|
||||||
|
import org.dromara.workflow.domain.vo.FlowInstanceVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实例信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-02
|
||||||
|
*/
|
||||||
|
public interface FlwInstanceMapper {
|
||||||
|
/**
|
||||||
|
* 流程实例信息
|
||||||
|
*
|
||||||
|
* @param page 分页
|
||||||
|
* @param queryWrapper 条件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
|
||||||
|
Page<FlowInstanceVo> page(@Param("page") Page<FlowInstanceVo> page,
|
||||||
|
@Param(Constants.WRAPPER) Wrapper<FlowInstanceBo> queryWrapper);
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import com.warm.flow.core.entity.Instance;
|
|||||||
import com.warm.flow.orm.entity.FlowInstance;
|
import com.warm.flow.orm.entity.FlowInstance;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.workflow.domain.vo.FlowInstanceVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ public interface IFlwInstanceService {
|
|||||||
* @param pageQuery 分页
|
* @param pageQuery 分页
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
TableDataInfo<Instance> getPageByRunning(Instance instance, PageQuery pageQuery);
|
TableDataInfo<FlowInstanceVo> getPageByRunning(Instance instance, PageQuery pageQuery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询已结束的流程实例
|
* 分页查询已结束的流程实例
|
||||||
@@ -30,7 +31,7 @@ public interface IFlwInstanceService {
|
|||||||
* @param pageQuery 分页
|
* @param pageQuery 分页
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
TableDataInfo<Instance> getPageByFinish(Instance instance, PageQuery pageQuery);
|
TableDataInfo<FlowInstanceVo> getPageByFinish(Instance instance, PageQuery pageQuery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按照业务id查询流程实例
|
* 按照业务id查询流程实例
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package org.dromara.workflow.service.impl;
|
package org.dromara.workflow.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.warm.flow.core.FlowFactory;
|
import com.warm.flow.core.FlowFactory;
|
||||||
import com.warm.flow.core.constant.ExceptionCons;
|
import com.warm.flow.core.constant.ExceptionCons;
|
||||||
import com.warm.flow.core.dto.FlowParams;
|
import com.warm.flow.core.dto.FlowParams;
|
||||||
@@ -15,7 +18,6 @@ import com.warm.flow.core.service.InsService;
|
|||||||
import com.warm.flow.core.service.NodeService;
|
import com.warm.flow.core.service.NodeService;
|
||||||
import com.warm.flow.core.service.TaskService;
|
import com.warm.flow.core.service.TaskService;
|
||||||
import com.warm.flow.core.utils.AssertUtil;
|
import com.warm.flow.core.utils.AssertUtil;
|
||||||
import com.warm.flow.core.utils.page.Page;
|
|
||||||
import com.warm.flow.orm.entity.FlowInstance;
|
import com.warm.flow.orm.entity.FlowInstance;
|
||||||
import com.warm.flow.orm.mapper.FlowInstanceMapper;
|
import com.warm.flow.orm.mapper.FlowInstanceMapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -23,6 +25,9 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.workflow.domain.bo.FlowInstanceBo;
|
||||||
|
import org.dromara.workflow.domain.vo.FlowInstanceVo;
|
||||||
|
import org.dromara.workflow.mapper.FlwInstanceMapper;
|
||||||
import org.dromara.workflow.service.IFlwInstanceService;
|
import org.dromara.workflow.service.IFlwInstanceService;
|
||||||
import org.dromara.workflow.utils.WorkflowUtils;
|
import org.dromara.workflow.utils.WorkflowUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -45,6 +50,7 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
|
|||||||
private final DefService defService;
|
private final DefService defService;
|
||||||
private final TaskService taskService;
|
private final TaskService taskService;
|
||||||
private final FlowInstanceMapper flowInstanceMapper;
|
private final FlowInstanceMapper flowInstanceMapper;
|
||||||
|
private final FlwInstanceMapper flwInstanceMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询正在运行的流程实例
|
* 分页查询正在运行的流程实例
|
||||||
@@ -53,12 +59,12 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
|
|||||||
* @param pageQuery 分页
|
* @param pageQuery 分页
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<Instance> getPageByRunning(Instance instance, PageQuery pageQuery) {
|
public TableDataInfo<FlowInstanceVo> getPageByRunning(Instance instance, PageQuery pageQuery) {
|
||||||
Page<Instance> page = Page.pageOf(pageQuery.getPageNum(), pageQuery.getPageSize());
|
QueryWrapper<FlowInstanceBo> queryWrapper = new QueryWrapper<>();
|
||||||
instance.setFlowStatus(FlowStatus.APPROVAL.getKey());
|
queryWrapper.eq("t.flow_status", FlowStatus.APPROVAL.getKey());
|
||||||
page = insService.orderByCreateTime().desc().page(instance, page);
|
Page<FlowInstanceVo> page = flwInstanceMapper.page(pageQuery.build(), queryWrapper);
|
||||||
TableDataInfo<Instance> build = TableDataInfo.build();
|
TableDataInfo<FlowInstanceVo> build = TableDataInfo.build();
|
||||||
build.setRows(page.getList());
|
build.setRows(BeanUtil.copyToList(page.getRecords(), FlowInstanceVo.class));
|
||||||
build.setTotal(page.getTotal());
|
build.setTotal(page.getTotal());
|
||||||
return build;
|
return build;
|
||||||
}
|
}
|
||||||
@@ -70,12 +76,12 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
|
|||||||
* @param pageQuery 分页
|
* @param pageQuery 分页
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<Instance> getPageByFinish(Instance instance, PageQuery pageQuery) {
|
public TableDataInfo<FlowInstanceVo> getPageByFinish(Instance instance, PageQuery pageQuery) {
|
||||||
Page<Instance> page = Page.pageOf(pageQuery.getPageNum(), pageQuery.getPageSize());
|
QueryWrapper<FlowInstanceBo> queryWrapper = new QueryWrapper<>();
|
||||||
instance.setFlowStatus(FlowStatus.FINISHED.getKey());
|
queryWrapper.eq("t.flow_status", FlowStatus.FINISHED.getKey());
|
||||||
page = insService.orderByCreateTime().desc().page(instance, page);
|
Page<FlowInstanceVo> page = flwInstanceMapper.page(pageQuery.build(), queryWrapper);
|
||||||
TableDataInfo<Instance> build = TableDataInfo.build();
|
TableDataInfo<FlowInstanceVo> build = TableDataInfo.build();
|
||||||
build.setRows(page.getList());
|
build.setRows(BeanUtil.copyToList(page.getRecords(), FlowInstanceVo.class));
|
||||||
build.setTotal(page.getTotal());
|
build.setTotal(page.getTotal());
|
||||||
return build;
|
return build;
|
||||||
}
|
}
|
||||||
@@ -136,10 +142,7 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
|
|||||||
// 获取下一个节点,如果是网关节点,则重新获取后续节点
|
// 获取下一个节点,如果是网关节点,则重新获取后续节点
|
||||||
List<Node> nextNodes = FlowFactory.taskService().getNextByCheckGateWay(new FlowParams(), getFirstBetween(startNode));
|
List<Node> nextNodes = FlowFactory.taskService().getNextByCheckGateWay(new FlowParams(), getFirstBetween(startNode));
|
||||||
Node node = nextNodes.get(0);
|
Node node = nextNodes.get(0);
|
||||||
FlowParams flowParams = FlowParams.build()
|
FlowParams flowParams = FlowParams.build().nodeCode(node.getNodeCode()).skipType(SkipType.PASS.getKey()).permissionFlag(WorkflowUtils.permissionList());
|
||||||
.nodeCode(node.getNodeCode())
|
|
||||||
.skipType(SkipType.PASS.getKey())
|
|
||||||
.permissionFlag(WorkflowUtils.permissionList());
|
|
||||||
taskService.skip(list.get(0).getId(), flowParams);
|
taskService.skip(list.get(0).getId(), flowParams);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
@@ -148,10 +151,8 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Node getFirstBetween(Node startNode) {
|
private Node getFirstBetween(Node startNode) {
|
||||||
List<Skip> skips = FlowFactory.skipService().list(FlowFactory.newSkip()
|
List<Skip> skips = FlowFactory.skipService().list(FlowFactory.newSkip().setDefinitionId(startNode.getDefinitionId()).setNowNodeCode(startNode.getNodeCode()));
|
||||||
.setDefinitionId(startNode.getDefinitionId()).setNowNodeCode(startNode.getNodeCode()));
|
|
||||||
Skip skip = skips.get(0);
|
Skip skip = skips.get(0);
|
||||||
return FlowFactory.nodeService().getOne(FlowFactory.newNode().setDefinitionId(startNode.getDefinitionId())
|
return FlowFactory.nodeService().getOne(FlowFactory.newNode().setDefinitionId(startNode.getDefinitionId()).setNodeCode(skip.getNextNodeCode()));
|
||||||
.setNodeCode(skip.getNextNodeCode()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.dromara.workflow.mapper.FlwInstanceMapper">
|
||||||
|
<resultMap type="org.dromara.workflow.domain.vo.FlowInstanceVo" id="FlowInstanceResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="nodeCode" column="node_code"/>
|
||||||
|
<result property="nodeName" column="node_name"/>
|
||||||
|
<result property="nodeType" column="node_type"/>
|
||||||
|
<result property="definitionId" column="definition_id"/>
|
||||||
|
<result property="flowStatus" column="flow_status"/>
|
||||||
|
<result property="activityStatus" column="activity_status"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="tenantId" column="tenant_id"/>
|
||||||
|
<result property="businessId" column="business_id"/>
|
||||||
|
<result property="flowName" column="flow_name"/>
|
||||||
|
<result property="flowCode" column="flow_code"/>
|
||||||
|
<result property="formCustom" column="form_custom"/>
|
||||||
|
<result property="formPath" column="form_path"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="ext" column="ext"/>
|
||||||
|
</resultMap>
|
||||||
|
<select id="page" resultMap="FlowInstanceResult">
|
||||||
|
select *
|
||||||
|
from (SELECT a.id,
|
||||||
|
a.create_time,
|
||||||
|
a.update_time,
|
||||||
|
a.tenant_id,
|
||||||
|
a.del_flag,
|
||||||
|
a.definition_id,
|
||||||
|
a.business_id,
|
||||||
|
a.node_type,
|
||||||
|
a.node_code,
|
||||||
|
a.node_name,
|
||||||
|
a.variable,
|
||||||
|
a.flow_status,
|
||||||
|
a.activity_status,
|
||||||
|
a.create_by,
|
||||||
|
a.ext,
|
||||||
|
b.flow_name,
|
||||||
|
b.flow_code,
|
||||||
|
b.version
|
||||||
|
FROM flow_instance a
|
||||||
|
LEFT JOIN flow_definition b ON a.definition_id = b.id) t
|
||||||
|
${ew.getCustomSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -45,20 +45,7 @@
|
|||||||
<result property="flowCode" column="flow_code"/>
|
<result property="flowCode" column="flow_code"/>
|
||||||
<result property="delFlag" column="del_flag"/>
|
<result property="delFlag" column="del_flag"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap type="org.dromara.workflow.domain.vo.FlowTaskVo" id="TaskVoResult">
|
<select id="getTaskWaitByPage" resultMap="FlowTaskResult">
|
||||||
<result property="id" column="id"/>
|
|
||||||
<result property="createTime" column="create_time"/>
|
|
||||||
<result property="updateTime" column="update_time"/>
|
|
||||||
<result property="nodeCode" column="node_code"/>
|
|
||||||
<result property="nodeType" column="node_type"/>
|
|
||||||
<result property="tenantId" column="tenant_id"/>
|
|
||||||
<result property="delFlag" column="del_flag"/>
|
|
||||||
<result property="definitionId" column="definition_id"/>
|
|
||||||
<result property="instanceId" column="instance_id"/>
|
|
||||||
<result property="flowName" column="flow_name"/>
|
|
||||||
<result property="flowCode" column="flow_code"/>
|
|
||||||
</resultMap>
|
|
||||||
<select id="getTaskWaitByPage" resultMap="TaskVoResult">
|
|
||||||
select*from (
|
select*from (
|
||||||
SELECT
|
SELECT
|
||||||
distinct t.id,
|
distinct t.id,
|
||||||
@@ -84,7 +71,7 @@
|
|||||||
${ew.getCustomSqlSegment}
|
${ew.getCustomSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTaskFinishByPage" resultMap="TaskVoResult">
|
<select id="getTaskFinishByPage" resultMap="FlowHisTaskResult">
|
||||||
select * from (
|
select * from (
|
||||||
select
|
select
|
||||||
t.id,
|
t.id,
|
||||||
@@ -111,7 +98,7 @@
|
|||||||
from ( SELECT MAX(id) as id
|
from ( SELECT MAX(id) as id
|
||||||
FROM flow_his_task
|
FROM flow_his_task
|
||||||
<where>
|
<where>
|
||||||
flow_status <![CDATA[<> '10']]>
|
flow_status <![CDATA[<> '10']]> and node_type = 1
|
||||||
<if test="flowTaskBo.permissionList != null and flowTaskBo.permissionList.size > 0">
|
<if test="flowTaskBo.permissionList != null and flowTaskBo.permissionList.size > 0">
|
||||||
AND approver in
|
AND approver in
|
||||||
<foreach item="permission" collection="flowTaskBo.permissionList" open="(" separator="," close=")">
|
<foreach item="permission" collection="flowTaskBo.permissionList" open="(" separator="," close=")">
|
||||||
|
|||||||
Reference in New Issue
Block a user