基于jeecg-boot的flowable流程自定义业务退回撤回或驳回到发起人后的再次流程提交

更多nbcio-boot功能请看演示系统

gitee源代码地址

后端代码: https://gitee.com/nbacheng/nbcio-boot

前端代码:https://gitee.com/nbacheng/nbcio-vue.git

在线演示(包括H5) : http://122.227.135.243:9888
 

     主要用户有些需求,需要自定义业务退回或撤回或驳回到发起人后能再次进行流程的提交,所以今天就解决这个问题。

    1、前端

      前端主要提供一个可以让用户进行选择再次提交的方法,同时检测是否是退回或撤回或驳回到发起人的节点

  

<style lang="less">
</style>
<template><span><a-button :type="btnType" @click="applySubmit()">{{text}}</a-button><a-modal :z-index="100" :title="firstInitiatorTitle" @cancel="firstInitiatorOpen = false" :visible.sync="firstInitiatorOpen":width="'50%'" append-to-body><a-descriptions bordered layout="vertical"><a-descriptions-item :span="3"><a-badge status="processing" text="选择提醒" /></a-descriptions-item><a-descriptions-item label="重新发起新流程按钮" labelStyle="{ color: '#fff', fontWeight: 'bold', fontSize='18px'}"> 重新发起新流程会删除之前发起的任务,重新开始.</a-descriptions-item><a-descriptions-item label="继续发起老流程按钮"> 继续发起流程就在原来流程基础上继续流转.</a-descriptions-item></a-descriptions>   <span slot="footer" class="dialog-footer"><el-button type="primary" @click="StartByDataId(true)">重新发起新流程</el-button><el-button type="primary" @click="StartByDataId(false)">继续发起老流程</el-button><el-button @click="firstInitiatorOpen = false">取 消</el-button></span></a-modal></span>
</template><script>import {definitionStartByDataId,isFirstInitiator,deleteActivityAndJoin} from "@views/flowable/api/definition";export default {name: 'ActApplyBtn',components: {},props: {btnType: {type: String,default: 'link',required: false},/**/dataId: {type: String,default: '',required: true},serviceName: {type: String,default: '',required: true},variables: {type: Object,default: {},},text: {type: String,default: '提交申请',required: false}},data() {return {modalVisible: false,submitLoading: false,form: {},firstInitiatorOpen: false,firstInitiatorTitle: '',};},created() {},watch: {},methods: {StartByDataId(isNewFlow) {if(isNewFlow) {this.submitLoading = true;deleteActivityAndJoin(this.dataId,this.variables).then(res => {if (res.success && res.result) { //若删除成功var params = Object.assign({dataId: this.dataId}, this.variables);definitionStartByDataId(this.dataId, this.serviceName, params).then(res => {if (res.success) {this.firstInitiatorOpen = false;this.$message.success(res.message);this.$emit('success');} else {this.$message.error(res.message);}})}}).finally(() => (this.submitLoading = false));}     else {//继续原有流程流转,跳到流程处理界面上console.log("this.variables",this.variables);this.$router.push({ path: '/flowable/task/record/index',query: {procInsId: this.variables.processInstanceId,deployId: this.variables.deployId,taskId: this.variables.taskId,businessKey: this.dataId,nodeType: "",category: "zdyyw",finished: true}})}},applySubmit() {if (this.dataId && this.dataId.length < 1) {this.error = '必须传入参数dataId';this.$message.error(this.error);return;}if (this.serviceName && this.serviceName.length < 1) {this.error = '必须传入参数serviceName';this.$message.error(this.error);return;} else {this.error = '';}//对于自定义业务,判断是否是驳回或退回的第一个发起人节点this.submitLoading = true;isFirstInitiator(this.dataId, this.variables).then(res => {if (res.success && res.result) { //若是,弹出窗口选择重新发起新流程还是继续老流程this.firstInitiatorTitle = "根据自己需要进行选择"this.firstInitiatorOpen = true;}else {this.submitLoading = true;var params = Object.assign({dataId: this.dataId}, this.variables);definitionStartByDataId(this.dataId, this.serviceName, params).then(res => {if (res.success) {this.$message.success(res.message);this.$emit('success');} else {this.$message.error(res.message);}}).finally(() => (this.submitLoading = false));}}).finally(() => (this.submitLoading = false));}}};
</script>

效果如下:

2、后端代码

   

 /*** 判断当前节点是否是第一个发起人节点(目前只针对自定义业务的驳回、撤回和退回操作)** @param processInstanceId, actStatusType*/@Overridepublic boolean isFirstInitiator(String processInstanceId, String actStatusType) {if(StringUtils.equalsAnyIgnoreCase(actStatusType, ActStatus.reject) ||StringUtils.equalsAnyIgnoreCase(actStatusType, ActStatus.recall) ||StringUtils.equalsAnyIgnoreCase(actStatusType, ActStatus.retrun) ) {if(StringUtils.isNotEmpty(processInstanceId)) {//  获取当前任务Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());//  获取当前活动节点FlowNode currentFlowNode = (FlowNode) bpmnModel.getMainProcess().getFlowElement(task.getTaskDefinitionKey());// 输入连线List<SequenceFlow> inFlows = currentFlowNode.getIncomingFlows();for (SequenceFlow sequenceFlow : inFlows) {FlowElement sourceFlowElement = sequenceFlow.getSourceFlowElement();// 如果上个节点为开始节点if (sourceFlowElement instanceof StartEvent) {log.info("当前节点为发起人节点,上个节点为开始节点:id=" + sourceFlowElement.getId() + ",name=" + sourceFlowElement.getName());return true;}}}}return false;	}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/69804.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

你知道Vue 3.0中Treeshaking特性吗?

介绍 Vue 3.0引入了Tree-shaking特性&#xff0c;旨在优化构建过程并减小最终生成的代码大小。Tree-shaking是一种在构建时移除未使用代码的技术&#xff0c;通过分析模块的依赖关系&#xff0c;将没有被引用的部分从最终的打包文件中排除掉。这可以大大减少应用的体积&#x…

【VL tracking】Towards Unified Token Learning for Vision-Language Tracking

不知道什么原因学校认证账号进不去&#xff0c;下载不了最新的PDF 广西师范大学 | 国科大 | 厦大 代码开源 zhihu指路&#x1f449;【VL tracking】MMTrack阅读 问题 一方面&#xff0c;传统的VL tracking方法需要昂贵的先验知识。例如&#xff0c;一些tracker是专门用于bou…

9月第1周榜单丨哔哩哔哩飞瓜数据B站UP主排行榜发布!

飞瓜轻数发布2023年8月28日-9月3日飞瓜数据UP主排行榜&#xff08;B站平台&#xff09;&#xff0c;通过充电数、涨粉数、成长指数、带货数据等维度来体现UP主账号成长的情况&#xff0c;为用户提供B站号综合价值的数据参考&#xff0c;根据UP主成长情况用户能够快速找到运营能…

无限访问 GPT-4,OpenAI 强势推出 ChatGPT 企业版!

继 ChatGPT 收费大降价、推出 App 版等系列动作之后&#xff0c;OpenAI 于今日宣布正式发布面向企业的 AI 助手——ChatGPT Enterprise 版。 与 To C 端的 ChatGPT 版本有所不同的是&#xff0c;该版本可以以更快速度无限制地访问 GPT-4&#xff0c;还可以用来处理更长输入的上…

vue3 + elementplus Cannot read properties of null (reading ‘isCE‘)

使用命令行直接下载的element-plus&#xff0c;使用时会报错。 卸载掉&#xff0c;然后在项目根目录下&#xff0c;使用vue ui安装依赖&#xff0c; 即可使用

搭建PyTorch神经网络进行气温预测

import numpy as np import pandas as pd import matplotlib.pyplot as plt import torch import torch.optim as optim import warnings warnings.filterwarnings("ignore") %matplotlib inline features pd.read_csv(temps.csv)#看看数据长什么样子 features.he…

stable diffusion实践操作-LyCORIS

系列文章目录 stable diffusion实践操作 文章目录 系列文章目录前言一、LyCORIS是什么&#xff1f;二、使用步骤1.下载2.安装3 使用 二、整理模型1.LoHa-v1.0-pynoise 总结 前言 LyCORIS&#xff0c;可以理解为lora的加强版本。 LyCORIS - Lora beYond Conventional methods,…

leetcode:1941. 检查是否所有字符出现次数相同(python3解法)

难度&#xff1a;简单 给你一个字符串 s &#xff0c;如果 s 是一个 好 字符串&#xff0c;请你返回 true &#xff0c;否则请返回 false 。 如果 s 中出现过的 所有 字符的出现次数 相同 &#xff0c;那么我们称字符串 s 是 好 字符串。 示例 1&#xff1a; 输入&#xff1a;s…

vue中实现签名画板

特意封装成了一个组件&#xff0c;签名之后会生成一张图片 signBoard.vue <template><el-drawer title"签名" :visible.sync"isShowBoard" append-to-body :show-close"false" :before-close"closeBoard" size"50%&quo…

数学建模--非整数规划问题蒙特卡洛方法的Python求解

目录 1.算法流程简介 2.算法核心代码 1.算法流程简介 #非线性整数规划 #我们一般采用蒙特卡洛算法来进行估算求解 #在实验次数足够多的情况下我们认为此解是非线性整数规划的最优解 """ #Qustion1:求解: max zx1^2x2^23x^24x4^22x5^2-8x1-2x2-3x3-x4-2x5s.t…

使用redis实现队列功能

使用redis实现队列功能 操作方法描述LPUSHLong lPush(String key, String… values)将一个或多个值 value 插入到列表 key 的表头&#xff0c;返回插入后列表中value的数量&#xff0c;若key不存在&#xff0c;会创建一个新的列表并执行 LPUSH 操作RPOPLPUSHString rPopLPush(S…

Modbus协议详解2:通信方式、地址规则、主从机通信状态

首先我们要清楚&#xff1a;Modbus是一种串行链路上的主从协议&#xff0c;在通信线路上只能有一个主机存在&#xff0c;不会有多主机存在的情况。虽然主机只有一个&#xff0c;但是从机是可以有多个的。 Modbus的通信过程都是由主机发起的&#xff0c;从机在接收到主机的请求后…

渗透测试漏洞原理之---【任意文件读取漏洞】

文章目录 1、概述1.1、漏洞成因1.2、漏洞危害1.3、漏洞分类1.4、任意文件读取1.4.1、文件读取函数1.4.2、任意文件读取 1.5、任意文件下载1.5.1、一般情况1.5.2、PHP实现1.5.3、任意文件下载 2、任意文件读取攻防2.1、路径过滤2.1.1、过滤../ 2.2、简单绕过2.2.1、双写绕过2.2.…

音视频 ffmpeg命令直播拉流推流

直播拉流 ffplay rtmp://server/live/streamName ffmpeg -i rtmp://server/live/streamName -c copy dump.flv对于不是rtmp的协议 -c copy要谨慎使用 直播推流 ffmpeg -re -i out.mp4 -c copy flvrtmp://server/live/streamName参数&#xff1a;-re,表示按时间戳读取文件 参…

docker笔记8:Docker网络

1.是什么 1.1 docker不启动&#xff0c;默认网络情况 ens33 lo virbr0 在CentOS7的安装过程中如果有选择相关虚拟化的的服务安装系统后&#xff0c;启动网卡时会发现有一个以网桥连接的私网地址的virbr0网卡(virbr0网卡&#xff1a;它还有一个固定的默认IP地址192.168.122…

vr智慧党建主题展厅赋予企业数字化内涵

现如今&#xff0c;VR全景技术的发展让我们动动手指就能在线上参观博物馆、纪念馆&#xff0c;不仅不用受时间和空间的限制&#xff0c;还能拥有身临其境般的体验&#xff0c;使得我们足不出户就能随时随地学习、传承红色文化。 很多党建展厅都是比较传统的&#xff0c;没有运用…

Protocol Buffers教程

Protocol Buffers教程 Protocol Buffers简介下载安装Protocol Buffers编译器编写第一个protobuf文件&#xff0c;并编译成go文件Protocol Buffers定义消息类型Protocol Buffers基本数据类型Protocol Buffers枚举类型Protobuf生成的go源码分析Protobuf序列化和反序列化protobuf…

【实用 Python 库】使用 XPath 与 lxml 模块在 Python 中高效解析 XML 与 HTML

在今天的信息时代&#xff0c;数据无处不在&#xff0c;从网络爬虫到数据挖掘&#xff0c;从文本处理到数据分析&#xff0c;我们时常需要从结构化文档中提取有用的信息。XPath 是一门强大的查询语言&#xff0c;它可以在 XML 与 HTML 等文档中定位特定的元素与数据。而在 Pyth…

C++中的##、#符号含义

在C中&#xff0c;## 和 # 是两个不同的预处理符号。这些符号都是在C的预处理阶段使用的&#xff0c;用于在代码编译之前对文本进行操作。 #&#xff08;字符串化操作符&#xff09;&#xff1a; 用于将宏参数转换为字符串常量。 #define STRINGIZE(x) #x const char* str S…

C++(QT)画图行车

通过鼠标在窗口上点击形成多个点的连线&#xff0c;绘制一辆汽车沿着绘制的连线轨迹前进。要求连线点数大于20.可以通过清除按钮清除已经绘制的连线&#xff0c;并可以重新绘制一条轨迹连线。当车辆行驶到轨迹终点时&#xff0c;自动停止。&#xff08;汽车实在可用方块代替&am…