提交代码

main
姜玉琦 2024-02-24 23:32:04 +08:00
parent 04c7450903
commit 6a1132e248
23 changed files with 1320 additions and 138 deletions

141
sql/vw_sql.sql 100644
View File

@ -0,0 +1,141 @@
##全部根据finishTime判断代办已办
DROP view vw_flow_all;
CREATE VIEW vw_flow_all AS (
SELECT
RES.ID_ AS procInsId,
DEF.DEPLOYMENT_ID_ AS deployId,
RES.START_TIME_ AS createTime,
RES.END_TIME_ AS finishTime,
CASE
WHEN RES.END_TIME_ IS NULL THEN
TIMESTAMPDIFF(
MINUTE,
RES.START_TIME_,
DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S')
)
ELSE
TIMESTAMPDIFF(
MINUTE,
RES.START_TIME_,
RES.END_TIME_
)
END AS duration,
DEF.NAME_ AS procDefName,
DEF.VERSION_ AS procDefVersion,
DEF.CATEGORY_ AS category,
DEF.KEY_ AS procDefKey,
ppa.id AS businessKey,
ppa.dept_id as businessDeptId,
ppa.proj_name AS businessKeyName,
ppa.par_proj_name as businessKeyParName,
ru.user_id AS startUserId,
ru.nick_name AS startUserName,
rd.dept_name AS startDeptName,
ht.*
FROM
ACT_HI_PROCINST RES
LEFT OUTER JOIN ACT_RE_PROCDEF DEF ON RES.PROC_DEF_ID_ = DEF.ID_
LEFT OUTER JOIN pro_project_apply ppa ON RES.BUSINESS_KEY_ = ppa.id
LEFT JOIN sys_user ru ON ru.user_id = RES.START_USER_ID_
LEFT JOIN sys_dept rd ON rd.dept_id = ru.dept_id
LEFT JOIN (
SELECT
ht.ID_ AS taskId,
ht.NAME_ AS taskName,
tu.user_id AS assigneeId,
tu.nick_name AS assigneeName,
td.dept_name AS assigneeDeptName,
ht.PROC_INST_ID_
FROM
act_hi_taskinst ht
LEFT JOIN sys_user tu ON tu.user_id = ht.ASSIGNEE_
LEFT JOIN sys_dept td ON td.dept_id = tu.dept_id
WHERE
ht.ID_ IN (
SELECT
MAX(ID_)
FROM
act_hi_taskinst
GROUP BY
PROC_INST_ID_
)
GROUP BY ht.PROC_INST_ID_
) ht ON ht.PROC_INST_ID_ = RES.PROC_INST_ID_
);
##待办
DROP view vw_flow_await;
CREATE VIEW vw_flow_await AS (SELECT
RES.ID_ AS taskId,
RES.NAME_ AS taskName,
re.ID_ AS procInsId,
DEF.DEPLOYMENT_ID_ AS deployId,
DATE_FORMAT(re.START_TIME_, '%Y-%m-%d %H:%i:%S') AS createTime,
TIMESTAMPDIFF(
MINUTE,
re.START_TIME_,
DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S')
) AS duration,
DEF.NAME_ AS procDefName,
DEF.VERSION_ AS procDefVersion,
DEF.CATEGORY_ AS category,
DEF.KEY_ AS procDefKey,
ppa.id AS businessKey,
ppa.dept_id AS businessDeptId,
ppa.proj_name AS businessKeyName,
ppa.par_proj_name as businessKeyParName,
ru.user_id AS startUserId,
ru.nick_name AS startUserName,
rd.dept_name AS startDeptName,
RES.SUSPENSION_STATE_,
RES.ASSIGNEE_,
LINK.USER_ID_,
LINK.GROUP_ID_
FROM
ACT_RU_TASK RES
LEFT JOIN act_ru_execution re ON re.PARENT_ID_ IS NULL
AND re.PROC_INST_ID_ = RES.PROC_INST_ID_
LEFT OUTER JOIN ACT_RE_PROCDEF DEF ON re.PROC_DEF_ID_ = DEF.ID_
LEFT OUTER JOIN pro_project_apply ppa ON re.BUSINESS_KEY_ = ppa.id
LEFT JOIN sys_user ru ON ru.user_id = re.START_USER_ID_
LEFT JOIN sys_dept rd ON rd.dept_id = ru.dept_id
left JOIN ACT_RU_IDENTITYLINK LINK on LINK.TASK_ID_ = RES.ID_ AND LINK.TYPE_ = 'candidate'
WHERE
RES.SUSPENSION_STATE_ = 1)
##已办
DROP view vw_flow_finished;
CREATE VIEW vw_flow_finished AS (SELECT
RES.ID_ AS taskId,
RES.NAME_ AS taskName,
RES.PROC_INST_ID_ AS procInsId,
pd.DEPLOYMENT_ID_ as deployId,
DATE_FORMAT(RES.START_TIME_, '%Y-%m-%d %H:%i:%S') AS createTime,
DATE_FORMAT(RES.END_TIME_, '%Y-%m-%d %H:%i:%S') AS endTime,
TIMESTAMPDIFF(
MINUTE,
res.START_TIME_,
RES.END_TIME_
) AS duration,
DEF.END_TIME_ as finishTime,
pd.NAME_ AS procDefName,
pd.CATEGORY_ AS category,
pd.KEY_ AS procDefKey,
ppa.id AS businessKey,
ppa.dept_id AS businessDeptId,
ppa.proj_name AS businessKeyName,
ppa.par_proj_name as businessKeyParName,
ru.user_id AS startUserId,
ru.nick_name AS startUserName,
rd.dept_name AS startDeptName,
RES.ASSIGNEE_
FROM
act_hi_taskinst RES
LEFT OUTER JOIN act_hi_procinst DEF ON RES.PROC_INST_ID_ = DEF.PROC_INST_ID_
LEFT OUTER join act_re_procdef pd on RES.PROC_DEF_ID_ = pd.ID_
LEFT OUTER JOIN pro_project_apply ppa ON DEF.BUSINESS_KEY_ = ppa.id
LEFT JOIN sys_user ru ON ru.user_id = RES.ASSIGNEE_
LEFT JOIN sys_dept rd ON rd.dept_id = ru.dept_id
WHERE
RES.ASSIGNEE_ is not null and RES.END_TIME_ is not null)

View File

@ -35,6 +35,9 @@ public class BaseEntity implements Serializable
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/** 选中页签 */
private String activeName;
/** 备注 */
private String remark;
@ -115,4 +118,12 @@ public class BaseEntity implements Serializable
{
this.params = params;
}
public String getActiveName() {
return activeName;
}
public void setActiveName(String activeName) {
this.activeName = activeName;
}
}

View File

@ -0,0 +1,116 @@
package com.yanzhu.flowable.controller;
import com.yanzhu.common.core.controller.BaseController;
import com.yanzhu.common.core.domain.AjaxResult;
import com.yanzhu.common.core.domain.entity.SysUser;
import com.yanzhu.common.core.page.TableDataInfo;
import com.yanzhu.flowable.service.IFlowBusinessKeyService;
import com.yanzhu.system.domain.flowable.FlowTaskEntity;
import com.yanzhu.system.service.ISysDeptService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.stream.Collectors;
/**
* <p>
*
* </p>
*
* @author JiangYuQi
* @date 2024-04-03
*/
@Slf4j
@Api(tags = "业务工作流程")
@RestController
@RequestMapping("/flowable/businessKey")
public class FlowBusinessKeyController extends BaseController {
@Autowired
private ISysDeptService sysDeptService;
@Autowired
private IFlowBusinessKeyService flowBusinessKeyService;
/**
*
* @param flowTaskEntity
* @return
*/
@GetMapping(value = "/allList")
public TableDataInfo allList(FlowTaskEntity flowTaskEntity) {
startPage();
//超管查询所有数据
if(!SysUser.isAdmin(super.getUserId())){
flowTaskEntity.setDeptAncestors(super.getLoginUser().getUser().getDept().getAncestors());
}
return getDataTable(flowBusinessKeyService.selectAllFlowTaskByParams(flowTaskEntity));
}
/**
*
* @param flowTaskEntity
* @return
*/
@GetMapping(value = "/queryCount")
public AjaxResult queryCount(FlowTaskEntity flowTaskEntity) {
//超管查询所有数据
if(!SysUser.isAdmin(super.getUserId())){
flowTaskEntity.setDeptAncestors(super.getLoginUser().getUser().getDept().getAncestors());
}
return success(flowBusinessKeyService.quueryCount(flowTaskEntity));
}
/**
* Id
* @param procInsId
* @return
*/
@GetMapping(value = "/findCommentByProcInsId")
public AjaxResult findCommentByProcInsId(String procInsId) {
return success(flowBusinessKeyService.selectCommentByProcInsId(procInsId));
}
/**
* Id
* @param procInsId
* @return
*/
@GetMapping(value = "/findFormDatasByProcInsId")
public AjaxResult findFormDatasByProcInsId(String procInsId) {
return success(flowBusinessKeyService.selectFormDatasByProcInsId(procInsId));
}
/**
*
* @param flowTaskEntity
* @return
*/
@GetMapping(value = "/myAwaitFlowTaskList")
public TableDataInfo myAwaitFlowTaskList(FlowTaskEntity flowTaskEntity) {
startPage();
//超管查询所有数据
if(!SysUser.isAdmin(super.getUserId())){
SysUser sysUser = super.getLoginUser().getUser();
flowTaskEntity.setDeptAncestors(sysUser.getDept().getAncestors());
flowTaskEntity.setRoleIds(sysUser.getRoles().stream().map(role -> role.getRoleId()).collect(Collectors.toList()));
}
return getDataTable(flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity));
}
/**
*
* @param flowTaskEntity
* @return
*/
@GetMapping(value = "/myFinishedFlowTaskList")
public TableDataInfo myFinishedFlowTaskList(FlowTaskEntity flowTaskEntity) {
startPage();
flowTaskEntity.setAssigneeId(super.getUserId());
return getDataTable(flowBusinessKeyService.selectMyFinishedFlowTask(flowTaskEntity));
}
}

View File

@ -4,6 +4,7 @@ import com.yanzhu.common.core.controller.BaseController;
import com.yanzhu.common.core.domain.AjaxResult;
import com.yanzhu.common.core.domain.entity.SysRole;
import com.yanzhu.common.core.domain.entity.SysUser;
import com.yanzhu.common.core.text.Convert;
import com.yanzhu.flowable.domain.FlowSaveXmlVo;
import com.yanzhu.system.domain.flowable.FlowQueryVo;
import com.yanzhu.flowable.service.IFlowDefinitionService;
@ -66,6 +67,9 @@ public class FlowDefinitionController extends BaseController {
@GetMapping(value = "/list")
@ApiOperation(value = "流程定义列表", response = FlowProcDefDto.class)
public AjaxResult list(FlowQueryVo flowQueryVo) {
if(!SysUser.isAdmin(super.getUserId())){
flowQueryVo.setDeptId(Convert.toLong(super.getLoginUser().getUser().getDept().getAncestors().split(",")[2]));
}
return AjaxResult.success(flowDefinitionService.list(flowQueryVo));
}

View File

@ -1,7 +1,7 @@
package com.yanzhu.flowable.controller;
import com.yanzhu.common.core.domain.AjaxResult;
import com.yanzhu.system.domain.flowable.dto.FlowTaskDto;
import com.yanzhu.flowable.domain.FlowTaskDto;
import com.yanzhu.system.domain.flowable.FlowQueryVo;
import com.yanzhu.system.domain.flowable.FlowTaskVo;
import com.yanzhu.flowable.service.IFlowTaskService;

View File

@ -1,4 +1,4 @@
package com.yanzhu.system.domain.flowable.dto;
package com.yanzhu.flowable.domain;
import lombok.Builder;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.yanzhu.system.domain.flowable.dto;
package com.yanzhu.flowable.domain;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.yanzhu.system.domain.flowable.dto;
package com.yanzhu.flowable.domain;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.yanzhu.system.domain.flowable.dto;
package com.yanzhu.flowable.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;

View File

@ -1,4 +1,4 @@
package com.yanzhu.system.domain.flowable.dto;
package com.yanzhu.flowable.domain;
import lombok.Data;

View File

@ -0,0 +1,56 @@
package com.yanzhu.flowable.service;
import com.yanzhu.system.domain.flowable.FlowTaskEntity;
import java.util.List;
import java.util.Map;
/**
* @author JiangYuQi
* @date 2021-04-03 14:41
*/
public interface IFlowBusinessKeyService {
/**
*
* @param flowTaskEntity
* @return
*/
public List<FlowTaskEntity> selectAllFlowTaskByParams(FlowTaskEntity flowTaskEntity);
/**
*
* @param flowTaskEntity
* @return
*/
public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity);
/**
* Id
* @param procInsId
* @return
*/
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId);
/**
* Id
* @param procInsId
* @return
*/
public Map<String, Object> selectFormDatasByProcInsId(String procInsId);
/**
*
* @param flowTaskEntity
* @return
*/
public List<Map<String, Object>> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity);
/**
*
* @param flowTaskEntity
* @return
*/
public List<Map<String, Object>> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity);
}

View File

@ -0,0 +1,102 @@
package com.yanzhu.flowable.service.impl;
import com.yanzhu.common.core.text.Convert;
import com.yanzhu.flowable.service.IFlowBusinessKeyService;
import com.yanzhu.system.domain.flowable.FlowTaskEntity;
import com.yanzhu.system.mapper.FlowBusinessKeyMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
*
*
* @author Tony
* @date 2021-04-03
*/
@Service
@Slf4j
public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
@Resource
private FlowBusinessKeyMapper flowBusinessKeyMapper;
/**
*
* @param flowTaskEntity
* @return
*/
@Override
public List<FlowTaskEntity> selectAllFlowTaskByParams(FlowTaskEntity flowTaskEntity) {
return flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity);
}
/**
*
* @param flowTaskEntity
* @return
*/
@Override
public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity) {
flowTaskEntity.setActiveName("await");
int awaitSize = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity).size();
flowTaskEntity.setActiveName("finished");
int finishedSize = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity).size();
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("await",awaitSize);
dataMap.put("finished",finishedSize);
return dataMap;
}
/**
* Id
* @param procInsId
* @return
*/
@Override
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId) {
return flowBusinessKeyMapper.selectCommentByProcInsId(procInsId);
}
/**
* Id
* @param procInsId
* @return
*/
@Override
public Map<String, Object> selectFormDatasByProcInsId(String procInsId) {
Map<String, Object> dataMap = new HashMap<>();
List<Map<String, Object>> list = flowBusinessKeyMapper.selectFormDatasByProcInsId(procInsId);
Iterator<Map<String, Object>> it = list.iterator();
while (it.hasNext()) {
Map<String, Object> map = it.next();
dataMap.put(Convert.toStr(map.get("name")), map.get("text"));
}
return dataMap;
}
/**
*
* @param flowTaskEntity
* @return
*/
@Override
public List<Map<String, Object>> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity){
return flowBusinessKeyMapper.selectMyAwaitFlowTask(flowTaskEntity);
}
/**
*
* @param flowTaskEntity
* @return
*/
@Override
public List<Map<String, Object>> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity) {
return flowBusinessKeyMapper.selectMyFinishedFlowTask(flowTaskEntity);
}
}

View File

@ -21,6 +21,7 @@ import com.yanzhu.system.service.ISysDeptService;
import com.yanzhu.system.service.ISysPostService;
import com.yanzhu.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.engine.repository.Deployment;
@ -34,6 +35,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
/**
*
@ -81,7 +83,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
public Page<FlowProcDefDto> list(FlowQueryVo flowQueryVo) {
Page<FlowProcDefDto> page = new Page<>();
PageHelper.startPage(flowQueryVo.getPageNum(), flowQueryVo.getPageSize());
final List<FlowProcDefDto> dataList = flowDeployMapper.selectDeployList(flowQueryVo);
List<FlowProcDefDto> dataList = flowDeployMapper.selectDeployList(flowQueryVo);
// 加载挂表单
/**for (FlowProcDefDto procDef : dataList) {
SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(procDef.getDeploymentId());
@ -90,6 +92,14 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
procDef.setFormId(sysForm.getFormId());
}
}*/
if(flowQueryVo.getDeptId()!=null){
// 单位查询时::查询缺省工作流
List<String> categoryList = dataList.stream().map(FlowProcDefDto::getCategory).collect(Collectors.toList());
List<FlowProcDefDto> defaultList = flowDeployMapper.selectDefaultDeployList(categoryList);
if(CollectionUtils.isNotEmpty(defaultList)){
dataList.addAll(defaultList);
}
}
page.setTotal(new PageInfo(dataList).getTotal());
page.setRecords(dataList);
return page;
@ -125,7 +135,9 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
Long projectDeptId = Convert.toLong(SecurityUtils.getLoginUser().getUser().getDept().getAncestors().split(",")[2]);
flowDeptVo.setDeptId(projectDeptId);
}
flowDeployMapper.insertActReProcdefDept(flowDeptVo);
if(flowDeptVo.getDeptId()!=null){
flowDeployMapper.insertActReProcdefDept(flowDeptVo);
}
}
/**
@ -240,5 +252,4 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
repositoryService.deleteDeployment(deployId, true);
}
}

View File

@ -12,10 +12,10 @@ import com.yanzhu.common.core.domain.entity.SysUser;
import com.yanzhu.flowable.common.enums.FlowComment;
import com.yanzhu.common.exception.CustomException;
import com.yanzhu.common.utils.SecurityUtils;
import com.yanzhu.system.domain.flowable.dto.FlowCommentDto;
import com.yanzhu.system.domain.flowable.dto.FlowNextDto;
import com.yanzhu.system.domain.flowable.dto.FlowTaskDto;
import com.yanzhu.system.domain.flowable.dto.FlowViewerDto;
import com.yanzhu.flowable.domain.FlowCommentDto;
import com.yanzhu.flowable.domain.FlowNextDto;
import com.yanzhu.flowable.domain.FlowTaskDto;
import com.yanzhu.flowable.domain.FlowViewerDto;
import com.yanzhu.system.domain.flowable.FlowQueryVo;
import com.yanzhu.system.domain.flowable.FlowTaskVo;
import com.yanzhu.flowable.factory.FlowServiceFactory;
@ -510,10 +510,18 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
public AjaxResult myProcess(FlowQueryVo queryVo) {
Page<FlowTaskDto> page = new Page<>();
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery()
.startedBy(userId.toString())
.orderByProcessInstanceStartTime()
.desc();
HistoricProcessInstanceQuery historicProcessInstanceQuery;
//超管查询所有数据据
if(SecurityUtils.isAdmin(userId)){
historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery()
.orderByProcessInstanceStartTime()
.desc();
}else{
historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery()
.startedBy(userId.toString())
.orderByProcessInstanceStartTime()
.desc();
}
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.listPage(queryVo.getPageSize() * (queryVo.getPageNum() - 1), queryVo.getPageSize());
page.setTotal(historicProcessInstanceQuery.count());
List<FlowTaskDto> flowList = new ArrayList<>();

View File

@ -29,6 +29,14 @@ public class ProProjectApply extends BaseEntity
@Excel(name = "项目主键")
private Long projId;
/** 项目名称 */
@Excel(name = "项目名称")
private String projName;
/** 父级项目名称 */
@Excel(name = "父级项目名称")
private String parProjName;
/** 申请类型 */
@Excel(name = "申请类型")
private String applyType;
@ -152,6 +160,22 @@ public class ProProjectApply extends BaseEntity
return isDel;
}
public String getProjName() {
return projName;
}
public void setProjName(String projName) {
this.projName = projName;
}
public String getParProjName() {
return parProjName;
}
public void setParProjName(String parProjName) {
this.parProjName = parProjName;
}
public List<ProProjectApplyDetail> getProProjectApplyDetailList()
{
return proProjectApplyDetailList;
@ -168,6 +192,8 @@ public class ProProjectApply extends BaseEntity
.append("id", getId())
.append("deptId", getDeptId())
.append("projId", getProjId())
.append("projName", getProjName())
.append("projId", getParProjName())
.append("applyType", getApplyType())
.append("applyStatus", getApplyStatus())
.append("applyReason", getApplyReason())

View File

@ -0,0 +1,326 @@
package com.yanzhu.system.domain.flowable;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yanzhu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.List;
/**
* <p><p>
*
* @author JiangYuQi
* @date 2021-04-03
*/
public class FlowTaskEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
private String businessKey;
@ApiModelProperty("业务名称")
private String businessKeyName;
@ApiModelProperty("任务编号")
private String taskId;
@ApiModelProperty("任务执行编号")
private String executionId;
@ApiModelProperty("任务名称")
private String taskName;
@ApiModelProperty("任务Key")
private String taskDefKey;
@ApiModelProperty("部门名称")
private String deptName;
@ApiModelProperty("流程发起人部门名称")
private String startDeptName;
@ApiModelProperty("任务执行人Id")
private Long assigneeId;
@ApiModelProperty("任务执行人名称")
private String assigneeName;
@ApiModelProperty("任务执行人部门")
private String assigneeDeptName;;
@ApiModelProperty("流程发起人Id")
private String startUserId;
@ApiModelProperty("流程发起人名称")
private String startUserName;
@ApiModelProperty("流程类型")
private String category;
@ApiModelProperty("流程变量信息")
private Object procVars;
@ApiModelProperty("局部变量信息")
private Object taskLocalVars;
@ApiModelProperty("流程部署编号")
private String deployId;
@ApiModelProperty("流程ID")
private String procDefId;
@ApiModelProperty("流程key")
private String procDefKey;
@ApiModelProperty("流程定义名称")
private String procDefName;
@ApiModelProperty("流程定义内置使用版本")
private int procDefVersion;
@ApiModelProperty("流程实例ID")
private String procInsId;
@ApiModelProperty("历史流程实例ID")
private String hisProcInsId;
@ApiModelProperty("任务耗时")
private String duration;
@ApiModelProperty("候选执行人")
private String candidate;
@ApiModelProperty("任务完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date finishTime;
@ApiModelProperty("单位祖籍列表")
private String deptAncestors;
public String getBusinessKeyName() {
return businessKeyName;
}
public void setBusinessKeyName(String businessKeyName) {
this.businessKeyName = businessKeyName;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getExecutionId() {
return executionId;
}
public void setExecutionId(String executionId) {
this.executionId = executionId;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public String getTaskDefKey() {
return taskDefKey;
}
public void setTaskDefKey(String taskDefKey) {
this.taskDefKey = taskDefKey;
}
public Long getAssigneeId() {
return assigneeId;
}
public void setAssigneeId(Long assigneeId) {
this.assigneeId = assigneeId;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getStartDeptName() {
return startDeptName;
}
public void setStartDeptName(String startDeptName) {
this.startDeptName = startDeptName;
}
public String getAssigneeName() {
return assigneeName;
}
public void setAssigneeName(String assigneeName) {
this.assigneeName = assigneeName;
}
public String getAssigneeDeptName() {
return assigneeDeptName;
}
public void setAssigneeDeptName(String assigneeDeptName) {
this.assigneeDeptName = assigneeDeptName;
}
public String getStartUserId() {
return startUserId;
}
public void setStartUserId(String startUserId) {
this.startUserId = startUserId;
}
public String getStartUserName() {
return startUserName;
}
public void setStartUserName(String startUserName) {
this.startUserName = startUserName;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public Object getProcVars() {
return procVars;
}
public void setProcVars(Object procVars) {
this.procVars = procVars;
}
public Object getTaskLocalVars() {
return taskLocalVars;
}
public void setTaskLocalVars(Object taskLocalVars) {
this.taskLocalVars = taskLocalVars;
}
public String getDeployId() {
return deployId;
}
public void setDeployId(String deployId) {
this.deployId = deployId;
}
public String getProcDefId() {
return procDefId;
}
public void setProcDefId(String procDefId) {
this.procDefId = procDefId;
}
public String getProcDefKey() {
return procDefKey;
}
public void setProcDefKey(String procDefKey) {
this.procDefKey = procDefKey;
}
public String getProcDefName() {
return procDefName;
}
public void setProcDefName(String procDefName) {
this.procDefName = procDefName;
}
public int getProcDefVersion() {
return procDefVersion;
}
public void setProcDefVersion(int procDefVersion) {
this.procDefVersion = procDefVersion;
}
public String getProcInsId() {
return procInsId;
}
public void setProcInsId(String procInsId) {
this.procInsId = procInsId;
}
public String getHisProcInsId() {
return hisProcInsId;
}
public void setHisProcInsId(String hisProcInsId) {
this.hisProcInsId = hisProcInsId;
}
public String getDuration() {
return duration;
}
public void setDuration(String duration) {
this.duration = duration;
}
public String getCandidate() {
return candidate;
}
public void setCandidate(String candidate) {
this.candidate = candidate;
}
public Date getFinishTime() {
return finishTime;
}
public void setFinishTime(Date finishTime) {
this.finishTime = finishTime;
}
public String getBusinessKey() {
return businessKey;
}
public void setBusinessKey(String businessKey) {
this.businessKey = businessKey;
}
public String getDeptAncestors() {
return deptAncestors;
}
public void setDeptAncestors(String deptAncestors) {
this.deptAncestors = deptAncestors;
}
private List<Long> roleIds;
public List<Long> getRoleIds() {
return roleIds;
}
public void setRoleIds(List<Long> roleIds) {
this.roleIds = roleIds;
}
}

View File

@ -0,0 +1,48 @@
package com.yanzhu.system.mapper;
import com.yanzhu.system.domain.flowable.FlowTaskEntity;
import java.util.List;
import java.util.Map;
/***
*
*/
public interface FlowBusinessKeyMapper {
/**
*
* @param flowTaskEntity
* @return
*/
public List<FlowTaskEntity> selectAllFlowTaskByParams(FlowTaskEntity flowTaskEntity);
/**
* Id
* @param procInsId
* @return
*/
public List<Map<String, Object>> selectCommentByProcInsId(String procInsId);
/**
* Id
* @param procInsId
* @return
*/
public List<Map<String, Object>> selectFormDatasByProcInsId(String procInsId);
/**
*
* @param flowTaskEntity
* @return
*/
public List<Map<String, Object>> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity);
/**
*
* @param flowTaskEntity
* @return
*/
public List<Map<String, Object>> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity);
}

View File

@ -23,6 +23,13 @@ public interface FlowDeployMapper {
*/
List<FlowProcDefDto> selectDeployList(FlowQueryVo flowQueryVo);
/**
*
* @param list
* @return
*/
List<FlowProcDefDto> selectDefaultDeployList(List<String> list);
/**
*
*

View File

@ -0,0 +1,103 @@
<?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="com.yanzhu.system.mapper.FlowBusinessKeyMapper">
<select id="selectAllFlowTaskByParams" parameterType="com.yanzhu.system.domain.flowable.FlowTaskEntity" resultType="com.yanzhu.system.domain.flowable.FlowTaskEntity">
SELECT
fa.procInsId,
fa.deployId,
fa.createTime,
fa.finishTime,
fa.duration,
fa.procDefKey,
fa.procDefName,
fa.procDefVersion,
fa.category,
fa.businessKey,
fa.businessDeptId,
fa.businessKeyName,
fa.startUserId,
fa.startUserName,
fa.startDeptName,
fa.taskId,
fa.taskName,
fa.assigneeId,
fa.assigneeName,
fa.assigneeDeptName
FROM
vw_flow_all fa
<where>
<if test="taskName != null and taskName != ''"> and fa.taskName like concat('%', #{taskName}, '%')</if>
<if test="procDefName != null and procDefName != ''"> and fa.procDefName like concat('%', #{procDefName}, '%')</if>
<if test="businessKey != null and businessKey != ''"> and fa.businessKey = #{businessKey}</if>
<if test="startDeptName != null and startDeptName != ''"> and fa.startDeptName like concat('%', #{startDeptName}, '%')</if>
<if test="startUserName != null and startUserName != ''"> and fa.startUserName like concat('%', #{startUserName}, '%')</if>
<if test="businessKeyName != null and businessKeyName != ''"> and fa.businessKeyName like concat('%', #{businessKeyName}, '%')</if>
<if test="category != null and category != ''"> and fa.category = #{category}</if>
<if test="params.beginDate != null and params.beginDate != '' and params.endDate != null and params.endDate != ''"> and date(fa.createTime) between #{params.beginDate} and #{params.endDate}</if>
<!-- 查询条件-项目部门 -->
<if test="deptAncestors != null and deptAncestors != ''"> and find_in_set(fa.businessDeptId, #{deptAncestors}) </if>
<if test='activeName == "await"'> and fa.finishTime is null </if>
<if test='activeName == "finished"'> and fa.finishTime is not null </if>
</where>
order by fa.createTime desc
</select>
<!--查询工作流操作日志-->
<select id="selectCommentByProcInsId" parameterType="string" resultType="map">
select * from vw_flow_comment where procInstId = #{procInstId} order by startTime DESC
</select>
<!--查询工作流携带的参数-->
<select id="selectFormDatasByProcInsId" parameterType="string" resultType="map">
select hv.NAME_ as `name`,hv.TEXT_ as text from act_hi_varinst hv where hv.PROC_INST_ID_ = #{procInstId}
</select>
<!--查询我的代办任务-->
<select id="selectMyAwaitFlowTask" parameterType="com.yanzhu.system.domain.flowable.FlowTaskEntity" resultType="map">
select fa.* from vw_flow_await fa
where
1=1
<if test="procDefName != null and procDefName != ''"> and fa.procDefName like concat('%', #{procDefName}, '%')</if>
<if test="businessKey != null and businessKey != ''"> and fa.businessKey = #{businessKey}</if>
<if test="businessKeyName != null and businessKeyName != ''"> and fa.businessKeyName like concat('%', #{businessKeyName}, '%')</if>
<if test="category != null and category != ''"> and fa.category = #{category}</if>
<if test="params.beginDate != null and params.beginDate != '' and params.endDate != null and params.endDate != ''"> and date(fa.createTime) between #{params.beginDate} and #{params.endDate}</if>
<!-- 查询条件-项目部门 -->
<if test="deptAncestors != null and deptAncestors != ''"> and find_in_set(fa.businessDeptId, #{deptAncestors}) </if>
<if test="roleIds !=null and roleIds.size()>0">
AND (fa.ASSIGNEE_ = #{nowUser}
OR (
fa.ASSIGNEE_ IS NULL
AND (
fa.USER_ID_ = #{nowUser}
OR (
fa.GROUP_ID_ IN
<foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
)
)
)
)
</if>
order by fa.createTime desc
</select>
<!--查询我的已办任务-->
<select id="selectMyFinishedFlowTask" parameterType="com.yanzhu.system.domain.flowable.FlowTaskEntity" resultType="map">
select fa.* from vw_flow_finished fa
where
fa.ASSIGNEE_=#{assigneeId}
<if test="procDefName != null and procDefName != ''"> and fa.procDefName like concat('%', #{procDefName}, '%')</if>
<if test="businessKey != null and businessKey != ''"> and fa.businessKey = #{businessKey}</if>
<if test="businessKeyName != null and businessKeyName != ''"> and fa.businessKeyName like concat('%', #{businessKeyName}, '%')</if>
<if test="category != null and category != ''"> and fa.category = #{category}</if>
<if test="params.beginDate != null and params.beginDate != '' and params.endDate != null and params.endDate != ''"> and fa.endTime between #{params.beginDate} and #{params.endDate}</if>
order by fa.endTime desc
</select>
</mapper>

View File

@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
act_re_procdef rp
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
left join act_re_procdef_dept rpd on rp.id_ = rpd.PROCDEF_ID_
left join sys_dept sd on sd.dept_id = rpr.DEPT_ID_
left join sys_dept sd on sd.dept_id = rpd.DEPT_ID_
<where>
<if test="deptId != null">
and rpd.DEPT_ID_ = #{deptId}
@ -38,6 +38,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<!--查询缺省流程定义列表-->
<select id="selectDefaultDeployList" parameterType="String" resultType="com.yanzhu.system.domain.FlowProcDefDto">
SELECT
rp.id_ as id,
rp.deployment_id_ as deploymentId,
rd.name_ as name,
rd.category_ as category,
rp.key_ as flowKey,
rp.version_ as version,
rp.suspension_state_ as suspensionState,
rd.deploy_time_ as deploymentTime,
null as deptId,
null as deptName
FROM
act_re_procdef rp
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
left join act_re_procdef_dept rpd on rp.id_ = rpd.PROCDEF_ID_
<where>
and rpd.DEPT_ID_ is null
<if test="list !=null and list.size()>0">
and rd.category_ not in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<!--新增单位流程关系-->
<insert id="insertActReProcdefDept" parameterType="com.yanzhu.system.domain.flowable.FlowDeptVo">
insert into act_re_procdef_dept

View File

@ -36,7 +36,7 @@ $base-sub-menu-background:#000c17;
$base-sub-menu-hover:#001528;
*/
$base-sidebar-width: 200px;
$base-sidebar-width: 225px;
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass

View File

@ -1,22 +1,49 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-form-item label="流程名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
placeholder="请输入流程名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="deployTime">
<el-date-picker clearable size="small"
v-model="queryParams.deployTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择时间">
</el-date-picker>
<el-form-item label="项目名称" prop="deptName" v-if="showDeptName">
<el-input
v-model="queryParams.deptName"
placeholder="请输入项目名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="流程类型" prop="category">
<el-select
v-model="queryParams.category"
@keyup.enter.native="handleQuery"
placeholder="请选择流程类型"
clearable
>
<el-option
v-for="dict in dict.type.sys_process_category"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="办理时间">
<el-date-picker
v-model="daterangeCheckTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
@ -24,7 +51,7 @@
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
@ -37,21 +64,45 @@
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</el-row> -->
<el-table v-loading="loading" :data="finishedList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="任务编号" align="center" prop="taskId" :show-overflow-tooltip="true"/>
<el-table-column label="项目名称" align="center" prop="businessKeyName" width="20" :show-overflow-tooltip="true"/>
<el-table-column label="流程编号" align="center" prop="taskId" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/>
<el-table-column label="任务节点" align="center" prop="taskName" />
<el-table-column label="流程发起人" align="center">
<el-table-column label="流程类别" align="center" prop="category" width="130">
<template slot-scope="scope">
<label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>
<dict-tag
:options="dict.type.sys_process_category"
:value="scope.row.category"
/>
</template>
</el-table-column>
<el-table-column label="流程节点" align="center" prop="taskName" width="110">
<template slot-scope="scope">
<div v-if="scope.row.finishTime == null">{{ scope.row.taskName }}</div>
<div v-if="scope.row.finishTime != null"></div>
</template>
</el-table-column>
<el-table-column label="发起人" align="center" width="180">
<template slot-scope="scope">
<label>{{scope.row.startUserName}}<br/><el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>
</template>
</el-table-column>
<el-table-column label="接收时间" align="center" prop="createTime" width="160"/>
<el-table-column label="审批时间" align="center" prop="endTime" width="160"/>
<el-table-column label="审批耗时" align="center" prop="duration" width="140">
<template slot-scope="scope">
{{getDurationDate(scope.row)}}
</template>
</el-table-column>
<el-table-column label="流程状态" align="center" width="80">
<template slot-scope="scope">
<el-tag v-if="scope.row.finishTime == null" size="mini"></el-tag>
<el-tag type="success" v-if="scope.row.finishTime != null && scope.row.ASSIGNEE_ != null" size="mini"></el-tag>
<el-tag type="danger" v-if="scope.row.finishTime != null && scope.row.ASSIGNEE_ == null" size="mini"></el-tag>
</template>
</el-table-column>
<el-table-column label="接收时间" align="center" prop="createTime" width="180"/>
<el-table-column label="审批时间" align="center" prop="finishTime" width="180"/>
<el-table-column label="耗时" align="center" prop="duration" width="180"/>
<el-table-column label="操作" width="150" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -83,11 +134,13 @@
<script>
import { finishedList, getDeployment, delDeployment, addDeployment, updateDeployment, exportDeployment, revokeProcess } from "@/api/flowable/finished";
import {myFinishedFlowTaskList} from "@/api/flowable/businessKey";
import detailDrawer from "../myProcess/detail/detailDrawer.vue";
export default {
name: "Deploy",
components: {
},
dicts: ["sys_process_category"],
components: {},
data() {
return {
//
@ -121,23 +174,35 @@ export default {
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null
engineVersion: null,
params: null,
},
//
form: {},
//
rules: {
}
},
daterangeCheckTime:[],
showDeptName: false,
};
},
created() {
//
if (this.$store.getters.userId == 1) {
this.showDeptName = true;
}
this.getList();
},
methods: {
/** 查询流程定义列表 */
getList() {
this.loading = true;
finishedList(this.queryParams).then(response => {
this.queryParams.params = {};
if (null != this.daterangeCheckTime && "" != this.daterangeCheckTime) {
this.queryParams.params["beginDate"] = this.daterangeCheckTime[0];
this.queryParams.params["endDate"] = this.daterangeCheckTime[1];
}
myFinishedFlowTaskList(this.queryParams).then(response => {
this.finishedList = response.data.records;
this.total = response.data.total;
this.loading = false;
@ -162,6 +227,7 @@ export default {
parentDeploymentId: null,
engineVersion: null
};
this.daterangeCheckTime=[];
this.resetForm("form");
},
setIcon(val){
@ -187,6 +253,7 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCheckTime=[];
this.resetForm("queryForm");
this.handleQuery();
},

View File

@ -1,25 +1,60 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="流程名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
placeholder="请输入流程名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="deployTime">
<el-date-picker clearable size="small"
v-model="queryParams.deployTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择时间">
<el-form-item label="项目名称" prop="deptName" v-if="showDeptName">
<el-input
v-model="queryParams.deptName"
placeholder="请输入项目名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="流程类型" prop="category">
<el-select
v-model="queryParams.category"
@keyup.enter.native="handleQuery"
placeholder="请选择流程类型"
clearable
>
<el-option
v-for="dict in dict.type.sys_process_category"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="申请时间" prop="deployTime">
<el-date-picker
clearable
size="small"
v-model="queryParams.deployTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择申请时间"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
@ -33,9 +68,10 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:deployment:add']"
>新增流程</el-button>
>新增流程</el-button
>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
@ -45,46 +81,83 @@
@click="handleDelete"
v-hasPermi="['system:deployment:remove']"
>删除</el-button>
</el-col>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="myProcessList" border @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="myProcessList"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>
<el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/>
<el-table-column
label="流程编号"
align="center"
prop="procInsId"
:show-overflow-tooltip="true"
/>
<el-table-column
label="流程名称"
align="center"
prop="procDefName"
:show-overflow-tooltip="true"
/>
<el-table-column label="流程类别" align="center" prop="category" width="100px" />
<el-table-column label="流程版本" align="center" width="80px">
<template slot-scope="scope">
<el-tag size="medium" >v{{ scope.row.procDefVersion }}</el-tag>
<el-tag size="medium">v{{ scope.row.procDefVersion }}</el-tag>
</template>
</el-table-column>
<el-table-column label="提交时间" align="center" prop="createTime" width="180"/>
<el-table-column label="提交时间" align="center" prop="createTime" width="180" />
<el-table-column label="流程状态" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.finishTime == null" size="mini"></el-tag>
<el-tag type="success" v-if="scope.row.finishTime != null" size="mini"></el-tag>
<el-tag type="success" v-if="scope.row.finishTime != null" size="mini"
>已完成</el-tag
>
</template>
</el-table-column>
<el-table-column label="耗时" align="center" prop="duration" width="180"/>
<el-table-column label="当前节点" align="center" prop="taskName"/>
<el-table-column label="耗时" align="center" prop="duration" width="180" />
<el-table-column label="当前节点" align="center" prop="taskName" />
<el-table-column label="办理人" align="center">
<template slot-scope="scope">
<label v-if="scope.row.assigneeName">{{scope.row.assigneeName}} <el-tag type="info" size="mini">{{scope.row.assigneeDeptName}}</el-tag></label>
<!-- <label v-if="scope.row.candidate">{{scope.row.candidate}}</label>-->
<label v-if="scope.row.assigneeName"
>{{ scope.row.assigneeName }}
<el-tag type="info" size="mini">{{
scope.row.assigneeDeptName
}}</el-tag></label
>
<!-- <label v-if="scope.row.candidate">{{scope.row.candidate}}</label>-->
</template>
</el-table-column>
<el-table-column label="操作" width="150" fixed="right" class-name="small-padding fixed-width">
<el-table-column
label="操作"
width="150"
fixed="right"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button @click="handleFlowRecord(scope.row)" type="text" size="small">详情</el-button>
<el-button @click="handleStop(scope.row)" type="text" size="small">取消申请</el-button>
<el-button @click="handleDelete(scope.row)" type="text" size="small" v-hasPermi="['system:deployment:remove']"></el-button>
<el-button @click="handleFlowRecord(scope.row)" type="text" size="small"
>详情</el-button
>
<el-button @click="handleStop(scope.row)" type="text" size="small"
>取消申请</el-button
>
<el-button
@click="handleDelete(scope.row)"
type="text"
size="small"
v-hasPermi="['system:deployment:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@ -93,49 +166,92 @@
<!-- 发起流程 -->
<el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
<el-form :model="queryProcessParams" ref="queryProcessForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-form
:model="queryProcessParams"
ref="queryProcessForm"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<el-form-item label="流程名称" prop="name">
<el-input
v-model="queryProcessParams.name"
placeholder="请输入名称"
placeholder="请输入流程名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
@keyup.enter.native="handleProcessQuery"
/>
</el-form-item>
<el-form-item label="项目名称" prop="deptName" v-if="showDeptName">
<el-input
v-model="queryProcessParams.deptName"
placeholder="请输入项目名称"
clearable
size="small"
@keyup.enter.native="handleProcessQuery"
/>
</el-form-item>
<el-form-item label="流程类型" prop="category">
<el-select
v-model="queryProcessParams.category"
@keyup.enter.native="handleProcessQuery"
placeholder="请选择流程类型"
clearable
>
<el-option
v-for="dict in dict.type.sys_process_category"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleProcessQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetProcessQuery"></el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleProcessQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetProcessQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table v-loading="processLoading" fit :data="definitionList" border >
<el-table v-loading="processLoading" fit :data="definitionList" border>
<el-table-column label="流程名称" align="center" prop="name" />
<el-table-column label="流程版本" align="center">
<template slot-scope="scope">
<el-tag size="medium" >v{{ scope.row.version }}</el-tag>
<el-tag size="medium">v{{ scope.row.version }}</el-tag>
</template>
</el-table-column>
<el-table-column label="流程分类" align="center" prop="category" />
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
<el-table-column
label="操作"
align="center"
width="300"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="handleStartProcess(scope.row)"
>发起流程</el-button>
>发起流程</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="processTotal>0"
v-show="processTotal > 0"
:total="processTotal"
:page.sync="queryProcessParams.pageNum"
:limit.sync="queryProcessParams.pageSize"
@pagination="listDefinition"
/>
</el-dialog>
</div>
</template>
@ -146,14 +262,14 @@ import {
addDeployment,
updateDeployment,
exportDeployment,
flowRecord
flowRecord,
} from "@/api/flowable/finished";
import { myProcessList,stopProcess } from "@/api/flowable/process";
import {listDefinition} from "@/api/flowable/definition";
import { myProcessList, stopProcess } from "@/api/flowable/process";
import { listDefinition } from "@/api/flowable/definition";
export default {
name: "Deploy",
components: {
},
dicts: ["sys_process_category"],
components: {},
data() {
return {
//
@ -169,7 +285,7 @@ export default {
showSearch: true,
//
total: 0,
processTotal:0,
processTotal: 0,
//
myProcessList: [],
//
@ -177,7 +293,7 @@ export default {
//
open: false,
src: "",
definitionList:[],
definitionList: [],
//
queryParams: {
pageNum: 1,
@ -190,7 +306,8 @@ export default {
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null
engineVersion: null,
deptName: null,
},
//
queryProcessParams: {
@ -204,23 +321,28 @@ export default {
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null
engineVersion: null,
deptName: null,
},
//
form: {},
//
rules: {
},
rules: {},
showDeptName: false,
};
},
created() {
//
if (this.$store.getters.userId == 1) {
this.showDeptName = true;
}
this.getList();
},
methods: {
/** 查询流程定义列表 */
getList() {
this.loading = true;
myProcessList(this.queryParams).then(response => {
myProcessList(this.queryParams).then((response) => {
this.myProcessList = response.data.records;
this.total = response.data.total;
this.loading = false;
@ -243,7 +365,7 @@ export default {
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null
engineVersion: null,
};
this.resetForm("form");
},
@ -269,9 +391,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.procInsId)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.procInsId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -279,46 +401,49 @@ export default {
this.title = "发起流程";
this.listDefinition();
},
listDefinition(){
listDefinition(this.queryProcessParams).then(response => {
listDefinition() {
listDefinition(this.queryProcessParams).then((response) => {
this.definitionList = response.data.records;
this.processTotal = response.data.total;
this.processLoading = false;
});
},
/** 发起流程申请 */
handleStartProcess(row){
this.$router.push({ path: '/flowable/task/myProcess/send/index',
handleStartProcess(row) {
this.$router.push({
path: "/flowable/task/myProcess/send/index",
query: {
deployId: row.deploymentId,
procDefId: row.id
}
})
procDefId: row.id,
},
});
},
/** 取消流程申请 */
handleStop(row){
handleStop(row) {
const params = {
instanceId: row.procInsId
}
stopProcess(params).then( res => {
this.$modal.msgSuccess(res.msg);
instanceId: row.procInsId,
};
stopProcess(params).then((res) => {
this.$modal.msgSuccess(res.msg);
this.getList();
});
},
/** 流程流转记录 */
handleFlowRecord(row){
this.$router.push({ path: '/flowable/task/myProcess/detail/index',
handleFlowRecord(row) {
this.$router.push({
path: "/flowable/task/myProcess/detail/index",
query: {
procInsId: row.procInsId,
deployId: row.deployId,
taskId: row.taskId
}})
taskId: row.taskId,
},
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDeployment(id).then(response => {
const id = row.id || this.ids;
getDeployment(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改流程定义";
@ -326,17 +451,17 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateDeployment(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
updateDeployment(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeployment(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
addDeployment(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
@ -346,32 +471,35 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.procInsId || this.ids;//
const ids = row.procInsId || this.ids; //
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
return delDeployment(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
type: "warning",
})
.then(() => {
return delDeployment(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有流程定义数据项?', "警告", {
this.$confirm("是否确认导出所有流程定义数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
return exportDeployment(queryParams);
}).then(response => {
this.download(response.msg);
type: "warning",
})
}
}
.then(() => {
return exportDeployment(queryParams);
})
.then((response) => {
this.download(response.msg);
});
},
},
};
</script>