From cd4eae7450447127d9d95e2e13581be6d3eaa203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Sat, 9 Sep 2023 22:33:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/MyDefaultProcessDiagramCanvas.java | 191 +++++++-------- .../controller/FlowBusinessKeyController.java | 54 ++++- .../service/IFlowBusinessKeyService.java | 28 +++ .../impl/FlowBusinessKeyServiceImpl.java | 53 +++++ .../service/impl/FlowTaskServiceImpl.java | 22 +- .../ruoyi/system/domain/FlowTaskEntity.java | 21 ++ .../system/mapper/FlowBusinessKeyMapper.java | 30 +++ .../mapper/flowable/FlowBusinessKeyMapper.xml | 59 ++++- ruoyi-ui/src/api/flowable/businessKey.js | 37 +++ ruoyi-ui/src/store/getters.js | 1 + ruoyi-ui/src/store/modules/user.js | 5 + .../flowable/task/finished/detail/index.vue | 8 +- .../views/flowable/task/finished/index.vue | 167 +++++++++---- .../flowable/task/myProcess/detail/index.vue | 4 +- .../task/myProcess/detail/initTaskDrawer.vue | 223 ++++++++++++++++++ .../views/flowable/task/myProcess/index.vue | 54 +++-- .../task/myProcess/initTaskDrawer.vue | 8 +- .../src/views/flowable/task/todo/index.vue | 130 +++++----- 18 files changed, 853 insertions(+), 242 deletions(-) create mode 100644 ruoyi-ui/src/views/flowable/task/myProcess/detail/initTaskDrawer.vue diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/config/MyDefaultProcessDiagramCanvas.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/config/MyDefaultProcessDiagramCanvas.java index 3233c6d4..974cbc4e 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/config/MyDefaultProcessDiagramCanvas.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/config/MyDefaultProcessDiagramCanvas.java @@ -1,95 +1,96 @@ -//package com.ruoyi.flowable.config; -// -//import com.sun.prism.paint.Color; -//import org.flowable.bpmn.model.AssociationDirection; -//import org.flowable.image.impl.DefaultProcessDiagramCanvas; -// -//import java.awt.*; -//import java.awt.geom.Line2D; -//import java.awt.geom.RoundRectangle2D; -// -///** -// * @author Tony -// * @date 2021-04-03 -// */ -//public class MyDefaultProcessDiagramCanvas extends DefaultProcessDiagramCanvas { -// //设置高亮线的颜色 这里我设置成绿色 -// protected static Color HIGHLIGHT_SEQUENCEFLOW_COLOR = Color.GREEN; -// -// public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) { -// super(width, height, minX, minY, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader); -// } -// -// public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) { -// super(width, height, minX, minY, imageType); -// } -// -// -// /** -// * 画线颜色设置 -// */ -// @Override -// public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType, -// AssociationDirection associationDirection, boolean highLighted, double scaleFactor) { -// -// Paint originalPaint = g.getPaint(); -// Stroke originalStroke = g.getStroke(); -// -// g.setPaint(CONNECTION_COLOR); -// if (connectionType.equals("association")) { -// g.setStroke(ASSOCIATION_STROKE); -// } else if (highLighted) { -// //设置线的颜色 -// g.setPaint(originalPaint); -// g.setStroke(HIGHLIGHT_FLOW_STROKE); -// } -// -// for (int i = 1; i < xPoints.length; i++) { -// Integer sourceX = xPoints[i - 1]; -// Integer sourceY = yPoints[i - 1]; -// Integer targetX = xPoints[i]; -// Integer targetY = yPoints[i]; -// Line2D.Double line = new Line2D.Double(sourceX, sourceY, targetX, targetY); -// g.draw(line); -// } -// -// if (isDefault) { -// Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]); -// drawDefaultSequenceFlowIndicator(line, scaleFactor); -// } -// -// if (conditional) { -// Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]); -// drawConditionalSequenceFlowIndicator(line, scaleFactor); -// } -// -// if (associationDirection == AssociationDirection.ONE || associationDirection == AssociationDirection.BOTH) { -// Line2D.Double line = new Line2D.Double(xPoints[xPoints.length - 2], yPoints[xPoints.length - 2], xPoints[xPoints.length - 1], yPoints[xPoints.length - 1]); -// drawArrowHead(line, scaleFactor); -// } -// if (associationDirection == AssociationDirection.BOTH) { -// Line2D.Double line = new Line2D.Double(xPoints[1], yPoints[1], xPoints[0], yPoints[0]); -// drawArrowHead(line, scaleFactor); -// } -// g.setPaint(originalPaint); -// g.setStroke(originalStroke); -// } -// -// /** -// * 高亮节点设置 -// */ -// @Override -// public void drawHighLight(int x, int y, int width, int height) { -// Paint originalPaint = g.getPaint(); -// Stroke originalStroke = g.getStroke(); -// //设置高亮节点的颜色 -// g.setPaint(HIGHLIGHT_COLOR); -// g.setStroke(THICK_TASK_BORDER_STROKE); -// -// RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20); -// g.draw(rect); -// -// g.setPaint(originalPaint); -// g.setStroke(originalStroke); -// } -//} +package com.ruoyi.flowable.config; + +import com.sun.prism.paint.Color; +import org.flowable.bpmn.model.AssociationDirection; +import org.flowable.image.impl.DefaultProcessDiagramCanvas; + +import java.awt.*; +import java.awt.geom.Line2D; +import java.awt.geom.RoundRectangle2D; + +/** + * @author Tony + * @date 2021-04-03 + */ +public class MyDefaultProcessDiagramCanvas extends DefaultProcessDiagramCanvas { + + //设置高亮线的颜色 这里我设置成绿色 + protected static Color HIGHLIGHT_SEQUENCEFLOW_COLOR = Color.GREEN; + + public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) { + super(width, height, minX, minY, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader); + } + + public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) { + super(width, height, minX, minY, imageType); + } + + + /** + * 画线颜色设置 + */ + @Override + public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType, + AssociationDirection associationDirection, boolean highLighted, double scaleFactor) { + + Paint originalPaint = g.getPaint(); + Stroke originalStroke = g.getStroke(); + + g.setPaint(CONNECTION_COLOR); + if (connectionType.equals("association")) { + g.setStroke(ASSOCIATION_STROKE); + } else if (highLighted) { + //设置线的颜色 + g.setPaint(originalPaint); + g.setStroke(HIGHLIGHT_FLOW_STROKE); + } + + for (int i = 1; i < xPoints.length; i++) { + Integer sourceX = xPoints[i - 1]; + Integer sourceY = yPoints[i - 1]; + Integer targetX = xPoints[i]; + Integer targetY = yPoints[i]; + Line2D.Double line = new Line2D.Double(sourceX, sourceY, targetX, targetY); + g.draw(line); + } + + if (isDefault) { + Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]); + drawDefaultSequenceFlowIndicator(line, scaleFactor); + } + + if (conditional) { + Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]); + drawConditionalSequenceFlowIndicator(line, scaleFactor); + } + + if (associationDirection == AssociationDirection.ONE || associationDirection == AssociationDirection.BOTH) { + Line2D.Double line = new Line2D.Double(xPoints[xPoints.length - 2], yPoints[xPoints.length - 2], xPoints[xPoints.length - 1], yPoints[xPoints.length - 1]); + drawArrowHead(line, scaleFactor); + } + if (associationDirection == AssociationDirection.BOTH) { + Line2D.Double line = new Line2D.Double(xPoints[1], yPoints[1], xPoints[0], yPoints[0]); + drawArrowHead(line, scaleFactor); + } + g.setPaint(originalPaint); + g.setStroke(originalStroke); + } + + /** + * 高亮节点设置 + */ + @Override + public void drawHighLight(int x, int y, int width, int height) { + Paint originalPaint = g.getPaint(); + Stroke originalStroke = g.getStroke(); + //设置高亮节点的颜色 + g.setPaint(HIGHLIGHT_COLOR); + g.setStroke(THICK_TASK_BORDER_STROKE); + + RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20); + g.draw(rect); + + g.setPaint(originalPaint); + g.setStroke(originalStroke); + } +} diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowBusinessKeyController.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowBusinessKeyController.java index 8320f4cb..2a97526c 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowBusinessKeyController.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowBusinessKeyController.java @@ -5,15 +5,13 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.enums.SysRoleEnum; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.flowable.service.IFlowBusinessKeyService; -import com.ruoyi.system.domain.FlowProcDefDto; import com.ruoyi.system.domain.FlowTaskEntity; import com.ruoyi.system.service.ISysDeptService; import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -72,4 +70,54 @@ public class FlowBusinessKeyController extends BaseController { flowTaskEntity.setNowUser(Convert.toStr(getUserId())); 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(); + flowTaskEntity.setNowRole(Convert.toStr(getUserFirstRole())); + if(SysRoleEnum.ZGS.getCode().equals(flowTaskEntity.getNowRole())){ + flowTaskEntity.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(getDeptId()))); + }else{ + flowTaskEntity.setNowDept(Convert.toStr(getDeptId())); + } + flowTaskEntity.setNowUser(Convert.toStr(SecurityUtils.getUserId())); + return getDataTable(flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity)); + } + + /** + * 根据条件查询我的已办任务 + * @param flowTaskEntity + * @return + */ + @GetMapping(value = "/myFinishedFlowTaskList") + public TableDataInfo myFinishedFlowTaskList(FlowTaskEntity flowTaskEntity) { + startPage(); + flowTaskEntity.setNowUser(Convert.toStr(SecurityUtils.getUserId())); + return getDataTable(flowBusinessKeyService.selectMyFinishedFlowTask(flowTaskEntity)); + } } diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowBusinessKeyService.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowBusinessKeyService.java index 519f9724..d9b6459c 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowBusinessKeyService.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowBusinessKeyService.java @@ -24,4 +24,32 @@ public interface IFlowBusinessKeyService { * @return */ public Map quueryCount(FlowTaskEntity flowTaskEntity); + + /** + * 根据条件流程Id查询操作日志 + * @param procInsId + * @return + */ + public List> selectCommentByProcInsId(String procInsId); + + /** + * 根据流程Id查询表单数据 + * @param procInsId + * @return + */ + public Map selectFormDatasByProcInsId(String procInsId); + + /** + * 查询我的代办任务 + * @param flowTaskEntity + * @return + */ + public List> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity); + + /** + * 查询我的已办任务 + * @param flowTaskEntity + * @return + */ + public List> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity); } diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowBusinessKeyServiceImpl.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowBusinessKeyServiceImpl.java index 12329514..efdb90e6 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowBusinessKeyServiceImpl.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowBusinessKeyServiceImpl.java @@ -1,5 +1,7 @@ package com.ruoyi.flowable.service.impl; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.flowable.service.IFlowBusinessKeyService; import com.ruoyi.system.domain.FlowTaskEntity; import com.ruoyi.system.mapper.FlowBusinessKeyMapper; @@ -8,8 +10,10 @@ 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; +import java.util.stream.Collectors; /** * 业务工作流程自定义 @@ -38,6 +42,7 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService { * @param flowTaskEntity * @return */ + @Override public Map quueryCount(FlowTaskEntity flowTaskEntity) { flowTaskEntity.setActiveName("await"); int awaitSize = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity).size(); @@ -48,4 +53,52 @@ public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService { dataMap.put("finished",finishedSize); return dataMap; } + + /** + * 根据条件流程Id查询操作日志 + * @param procInsId + * @return + */ + @Override + public List> selectCommentByProcInsId(String procInsId) { + return flowBusinessKeyMapper.selectCommentByProcInsId(procInsId); + } + + /** + * 根据流程Id查询表单数据 + * @param procInsId + * @return + */ + @Override + public Map selectFormDatasByProcInsId(String procInsId) { + Map dataMap = new HashMap<>(); + List> list = flowBusinessKeyMapper.selectFormDatasByProcInsId(procInsId); + Iterator> it = list.iterator(); + while (it.hasNext()) { + Map map = it.next(); + dataMap.put(Convert.toStr(map.get("name")), map.get("text")); + } + return dataMap; + } + + /** + * 查询我的代办任务 + * @param flowTaskEntity + * @return + */ + @Override + public List> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity){ + flowTaskEntity.setRoleIds(SecurityUtils.getLoginUser().getUser().getRoles().stream().map(role -> role.getRoleId()).collect(Collectors.toList())); + return flowBusinessKeyMapper.selectMyAwaitFlowTask(flowTaskEntity); + } + + /** + * 查询我的已办任务 + * @param flowTaskEntity + * @return + */ + @Override + public List> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity) { + return flowBusinessKeyMapper.selectMyFinishedFlowTask(flowTaskEntity); + } } diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java index cfb6488d..6f8a835a 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java @@ -108,8 +108,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask taskService.resolveTask(taskVo.getTaskId(), taskVo.getVariables()); } else { taskService.addComment(taskVo.getTaskId(), taskVo.getInstanceId(), FlowComment.NORMAL.getType(), taskVo.getComment()); - Long userId = SecurityUtils.getLoginUser().getUser().getUserId(); - taskService.setAssignee(taskVo.getTaskId(), userId.toString()); + taskService.setAssignee(taskVo.getTaskId(), taskVo.getUserId()); taskService.complete(taskVo.getTaskId(), taskVo.getVariables()); } return AjaxResult.success(); @@ -214,8 +213,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask } })); // 设置驳回意见 - currentTaskIds.forEach(item -> taskService.addComment(item, task.getProcessInstanceId(), FlowComment.REJECT.getType(), flowTaskVo.getComment())); - + currentTaskIds.forEach(item -> + taskService.addComment(item, task.getProcessInstanceId(), FlowComment.REJECT.getType(), flowTaskVo.getComment())); + taskService.setAssignee(flowTaskVo.getTaskId(), flowTaskVo.getUserId()); try { // 如果父级任务多于 1 个,说明当前节点不是并行节点,原因为不考虑多对多情况 if (targetIds.size() > 1) { @@ -884,13 +884,13 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask map.put("flowList", hisFlowList); } // 第一次申请获取初始化表单 - if (StringUtils.isNotBlank(deployId)) { - SysForm sysForm = sysInstanceFormService.selectSysDeployFormByDeployId(deployId); - if (Objects.isNull(sysForm)) { - return AjaxResult.error("请先配置流程表单"); - } - map.put("formData", JSONObject.parseObject(sysForm.getFormContent())); - } +// if (StringUtils.isNotBlank(deployId)) { +// SysForm sysForm = sysInstanceFormService.selectSysDeployFormByDeployId(deployId); +// if (Objects.isNull(sysForm)) { +// return AjaxResult.error("请先配置流程表单"); +// } +// map.put("formData", JSONObject.parseObject(sysForm.getFormContent())); +// } return AjaxResult.success(map); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/FlowTaskEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/FlowTaskEntity.java index 6d12dac5..8b6edad4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/FlowTaskEntity.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/FlowTaskEntity.java @@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModelProperty; import java.util.Date; +import java.util.List; /** *

工作流任务

@@ -16,6 +17,8 @@ public class FlowTaskEntity extends BaseEntity{ private static final long serialVersionUID = 1L; + private String businessKey; + @ApiModelProperty("业务名称") private String businessKeyName; @@ -96,6 +99,8 @@ public class FlowTaskEntity extends BaseEntity{ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date finishTime; + private List roleIds; + public String getBusinessKeyName() { return businessKeyName; } @@ -305,4 +310,20 @@ public class FlowTaskEntity extends BaseEntity{ public void setFinishTime(Date finishTime) { this.finishTime = finishTime; } + + public List getRoleIds() { + return roleIds; + } + + public void setRoleIds(List roleIds) { + this.roleIds = roleIds; + } + + public String getBusinessKey() { + return businessKey; + } + + public void setBusinessKey(String businessKey) { + this.businessKey = businessKey; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FlowBusinessKeyMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FlowBusinessKeyMapper.java index 455118d7..55e9d67b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FlowBusinessKeyMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FlowBusinessKeyMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.system.mapper; import com.ruoyi.system.domain.FlowTaskEntity; import java.util.List; +import java.util.Map; /*** * 工作流业务相关 @@ -15,4 +16,33 @@ public interface FlowBusinessKeyMapper { * @return */ public List selectAllFlowTaskByParams(FlowTaskEntity flowTaskEntity); + + /** + * 根据流程Id查询操作日志 + * @param procInsId + * @return + */ + public List> selectCommentByProcInsId(String procInsId); + + /** + * 根据流程Id查询表单数据 + * @param procInsId + * @return + */ + public List> selectFormDatasByProcInsId(String procInsId); + + /** + * 查询我的代办任务 + * @param flowTaskEntity + * @return + */ + public List> selectMyAwaitFlowTask(FlowTaskEntity flowTaskEntity); + + /** + * 查询我的已办任务 + * @param flowTaskEntity + * @return + */ + public List> selectMyFinishedFlowTask(FlowTaskEntity flowTaskEntity); + } diff --git a/ruoyi-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml b/ruoyi-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml index 6c56707f..2ce008e9 100644 --- a/ruoyi-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml @@ -38,7 +38,7 @@ and fa.businesDeptId = #{nowDept} - and fa.businesDeptId = #{nowDept} + and fa.businessKey in (select DISTINCT projectId from sur_project_unit_info where unitId=#{nowDept} and del_flag=0) and fa.startUserId = #{nowUser} and fa.finishTime is null @@ -47,4 +47,61 @@ order by fa.createTime desc + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/flowable/businessKey.js b/ruoyi-ui/src/api/flowable/businessKey.js index 0d6f93d8..2afdbe5c 100644 --- a/ruoyi-ui/src/api/flowable/businessKey.js +++ b/ruoyi-ui/src/api/flowable/businessKey.js @@ -17,3 +17,40 @@ export function queryCount(query) { params: query }) } + +// 根据业务流程查询操作日志 +export function findCommentByProcInsId(query) { + return request({ + url: '/flowable/businessKey/findCommentByProcInsId', + method: 'get', + params: query + }) +} + +// 根据业务流程查询表单数据 +export function findFormDatasByProcInsId(query) { + return request({ + url: '/flowable/businessKey/findFormDatasByProcInsId', + method: 'get', + params: query + }) +} + +// 根据条件查询我的代办任务 +export function myAwaitFlowTaskList(query) { + return request({ + url: '/flowable/businessKey/myAwaitFlowTaskList', + method: 'get', + params: query + }) +} + +// 根据条件查询我的已办任务 +export function myFinishedFlowTaskList(query) { + return request({ + url: '/flowable/businessKey/myFinishedFlowTaskList', + method: 'get', + params: query + }) +} + diff --git a/ruoyi-ui/src/store/getters.js b/ruoyi-ui/src/store/getters.js index 6de9f893..5f45eefc 100644 --- a/ruoyi-ui/src/store/getters.js +++ b/ruoyi-ui/src/store/getters.js @@ -7,6 +7,7 @@ const getters = { cachedViews: state => state.tagsView.cachedViews, token: state => state.user.token, avatar: state => state.user.avatar, + userId: state => state.user.userId, name: state => state.user.name, dept:state=>state.user.dept, introduction: state => state.user.introduction, diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js index ba166675..b8297c74 100644 --- a/ruoyi-ui/src/store/modules/user.js +++ b/ruoyi-ui/src/store/modules/user.js @@ -4,6 +4,7 @@ import { getToken, setToken, removeToken } from '@/utils/auth' const user = { state: { token: getToken(), + userId:'', name: '', avatar: '', dept:null, @@ -15,6 +16,9 @@ const user = { SET_TOKEN: (state, token) => { state.token = token }, + SET_USER_ID: (state, id) => { + state.userId = id + }, SET_NAME: (state, name) => { state.name = name }, @@ -62,6 +66,7 @@ const user = { } else { commit('SET_ROLES', ['ROLE_DEFAULT']) } + commit('SET_USER_ID', user.userId) commit('SET_NAME', user.userName) commit("SET_DEPT",user.dept); commit('SET_AVATAR', avatar) diff --git a/ruoyi-ui/src/views/flowable/task/finished/detail/index.vue b/ruoyi-ui/src/views/flowable/task/finished/detail/index.vue index a3f15c41..a5df3c96 100644 --- a/ruoyi-ui/src/views/flowable/task/finished/detail/index.vue +++ b/ruoyi-ui/src/views/flowable/task/finished/detail/index.vue @@ -124,10 +124,10 @@ export default { this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId; // 回显流程记录 // 流程任务重获取变量表单 - if (this.taskForm.taskId){ - this.processVariables( this.taskForm.taskId) - } - this.getFlowRecordList( this.taskForm.procInsId, this.taskForm.deployId); + //if (this.taskForm.taskId){ + // this.processVariables( this.taskForm.taskId) + //} + //this.getFlowRecordList( this.taskForm.procInsId, this.taskForm.deployId); }, methods: { handleClick(tab, event) { diff --git a/ruoyi-ui/src/views/flowable/task/finished/index.vue b/ruoyi-ui/src/views/flowable/task/finished/index.vue index 96cb0944..b91c700d 100644 --- a/ruoyi-ui/src/views/flowable/task/finished/index.vue +++ b/ruoyi-ui/src/views/flowable/task/finished/index.vue @@ -1,22 +1,40 @@ @@ -213,10 +214,12 @@ import { myProcessList,stopProcess } from "@/api/flowable/process"; import {allList,queryCount} from "@/api/flowable/businessKey"; import {myDefinitionList} from "@/api/flowable/definition"; import initTaskDrawer from "./initTaskDrawer.vue"; +import detailDrawer from "./detail/detailDrawer.vue"; export default { name: "Deploy", components: { - initTaskDrawer + initTaskDrawer, + detailDrawer }, dicts: ["sys_process_category"], data() { @@ -385,21 +388,24 @@ export default { const params = { instanceId: row.procInsId } - this.loading = true; - stopProcess(params).then( res => { - this.$modal.msgSuccess(res.msg); - this.loading=false; + this.$modal.confirm('撤销流程会终止,是否继续?').then(function() { + this.loading = true; + return stopProcess(params); + }).then(res => { + this.$modal.msgSuccess(res.msg); + this.loading=false; this.getList(); }); }, /** 流程流转记录 */ handleFlowRecord(row){ - this.$router.push({ path: '/flowable/task/myProcess/detail/index', - query: { - procInsId: row.procInsId, - deployId: row.deployId, - taskId: row.taskId - }}) + this.$refs.detailDrawer.show(row); + // this.$router.push({ path: '/flowable/task/myProcess/detail/index', + // query: { + // procInsId: row.procInsId, + // deployId: row.deployId, + // taskId: row.taskId + // }}) }, /** 修改按钮操作 */ handleUpdate(row) { @@ -434,7 +440,7 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const ids = row.procInsId || this.ids;// 暂不支持删除多个流程 - this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", { + this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?删除后数据将不可找回!!', "警告", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" @@ -480,10 +486,24 @@ export default { hours = parseInt(min/60); min = min % 60; } - if(day<10) day="0"+day; - if(hours<10) hours="0"+hours; - if(min<10) min="0"+min; - return day+"天"+hours+"小时"+min+"分钟"; + if(day>0){ + if(day<10) day="0"+day; + if(hours<10) hours="0"+hours; + if(min<10) min="0"+min; + return day+"天"+hours+"小时"+min+"分钟"; + } + if(hours>0){ + if(hours<10) hours="0"+hours; + if(min<10) min="0"+min; + return hours+"小时"+min+"分钟"; + } + if(min>0){ + if(min<10) min="0"+min; + return min+"分钟"; + } + if(min==0){ + return "1分钟"; + } }, } }; diff --git a/ruoyi-ui/src/views/flowable/task/myProcess/initTaskDrawer.vue b/ruoyi-ui/src/views/flowable/task/myProcess/initTaskDrawer.vue index 6b21a994..ec237b38 100644 --- a/ruoyi-ui/src/views/flowable/task/myProcess/initTaskDrawer.vue +++ b/ruoyi-ui/src/views/flowable/task/myProcess/initTaskDrawer.vue @@ -64,11 +64,11 @@ rows="5" /> +

+ 提交流程 + 取 消 +
-
- 提交流程 - 取 消 -
diff --git a/ruoyi-ui/src/views/flowable/task/todo/index.vue b/ruoyi-ui/src/views/flowable/task/todo/index.vue index d9251aa3..4d18ef00 100644 --- a/ruoyi-ui/src/views/flowable/task/todo/index.vue +++ b/ruoyi-ui/src/views/flowable/task/todo/index.vue @@ -1,22 +1,40 @@ -