基于jeecg-boot的flowable流程跳转功能实现

这篇具有很好参考价值的文章主要介绍了基于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

      今天我们实现nbcio-boot的flowable的流程跳转功能。

一、前端实现

界面实现,就是点击跳转出来的窗口

<!--跳转流程-->
    <a-modal :z-index="100" :title="jumpTitle" @cancel="jumpOpen = false" :visible.sync="jumpOpen" :width="'40%'" append-to-body>
      <el-form ref="jumpForm" :model="jumpForm" label-width="160px">
        <el-form-item label="跳转节点" prop="jumpType" :rules="[{ required: true, message: '请选择跳转节点', trigger: 'blur' }]">
          <a-table
            size="middle"
            :columns="jumpNodeColumns"
            :loading="jumpNodeLoading"
            :pagination="false"
            :dataSource="jumpNodeData"
            :rowKey="(record) => record.id"
            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange ,type:'radio' }"
          />
        </el-form-item>
        
        <el-form-item label="处理意见" prop="comment" :rules="[{ required: true, message: '请输入处理意见', trigger: 'blur' }]">
          <el-input type="textarea" v-model="jumpForm.comment" placeholder="请输入处理意见" />
        </el-form-item>
        <el-form-item label="附件"  prop="commentFileDto.fileurl">
          <j-upload v-model="jumpForm.commentFileDto.fileurl"   ></j-upload>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="jumpOpen = false">取 消</el-button>
        <el-button type="primary" @click="jumpComplete(true)">确 定</el-button>
      </span>
    </a-modal>

  相关处理函数如下:

/** 跳转 */
      handleJump() {
        this.jumpOpen = true;
        this.jumpTitle = "跳转流程";
        this.jumpNodeLoading = true
        userTaskList({ taskId: this.taskForm.taskId }).then((res) => {
          this.jumpNodeLoading = false
          this.jumpNodeData = res.result
        })
      },
      jumpComplete() {
        if (this.selectedRows.length < 1) {
          this.$message.warning('请选择跳转节点')
          return
        }
        // 流程信息
        this.jumpForm.deployId = this.$route.query && this.$route.query.deployId;
        this.jumpForm.taskId = this.$route.query && this.$route.query.taskId;
        this.jumpForm.procInsId = this.$route.query && this.$route.query.procInsId;
        this.jumpForm.instanceId = this.$route.query && this.$route.query.procInsId;
        // 初始化表单
        this.jumpForm.procDefId = this.$route.query && this.$route.query.procDefId;
        this.jumpForm.businessKey = this.$route.query && this.$route.query.businessKey;
        this.jumpForm.category = this.$route.query && this.$route.query.category;
        this.jumpForm.dataId = this.$route.query && this.$route.query.businessKey;
        //节点类型
        this.jumpForm.nodeType = this.$route.query && this.$route.query.nodeType;
        //online表单id和数据id
        this.jumpForm.onlineId = this.$route.query && this.$route.query.onlineId;
        if (this.jumpForm.category === 'online') {
          this.jumpForm.onlineDataId = this.$route.query && this.$route.query.businessKey;
        }  
        //对formdesigner后续加签审批的时候需要用到
        this.jumpForm.values = this.taskForm.values;
        //目标选择的节点信息
        this.jumpForm.targetActId = this.selectedRows[0].id;
        this.jumpForm.targetActName = this.selectedRows[0].name;
        console.log("this.jumpForm=",this.jumpForm);
        jumpTask(this.jumpForm).then(res => {
          if (res.success) {
            this.$message.success('跳转成功')
            this.jumpOpen = false;
            this.goBack();
          } else {
            this.$message.error('跳转失败:' + res.message)
          }
        });
      },
      
      /**
       * 跳转节点列表选择
       */
      onSelectChange (selectedRowKeys, selectedRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectedRows = selectedRows
      },

二、后端代码实现

@Override
	@Transactional(rollbackFor = Exception.class)
	public void jumpTask(FlowTaskVo flowTaskVo) {
		//校验任务是否存在
		Task task = taskService.createTaskQuery().taskId(flowTaskVo.getTaskId()).singleResult();
        //当前节点id
        String currentActId = task.getTaskDefinitionKey();
        //获取流程实例id
        String processInstanceId = task.getProcessInstanceId();
        //当前活动节点名称(任务名称)
        String currentActName = task.getName();
        //获取当前操作人姓名
        SysUser loginuser = iFlowThirdService.getLoginUser();
        String name = loginuser.getRealname();
        String type = FlowComment.JUMP.getType();
        //添加跳转意见 name + "将任务跳转到【" + targetActName + "】,跳转原因:" + comment + ";";
        taskService.addComment(task.getId(), processInstanceId, type,"当前任务["+currentActName +"]由" + name + "跳转到[" + flowTaskVo.getTargetActName() + "],跳转原因:" + flowTaskVo.getComment());
        //执行跳转操作
        runtimeService.createChangeActivityStateBuilder()
                .processInstanceId(processInstanceId)
                .moveActivityIdTo(currentActId, flowTaskVo.getTargetActId()).changeState();
		
	}

	@Override
	public Result userTaskList(FlowTaskVo flowTaskVo) {
		List<UserTaskVo> resultList = new ArrayList<UserTaskVo>();
      
        // 当前任务 task
        Task task = taskService.createTaskQuery().taskId(flowTaskVo.getTaskId()).singleResult();
        // 获取流程定义信息
        ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult();

        //根据流程定义获取deployment
        String deploymentId = processDefinition.getDeploymentId();
        Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
        if (ObjectUtil.isEmpty(deployment)) {
            throw new FlowableException("流程还没布置");
        }

        //获取bpmnModel并转为modelNode
        BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
        //获取主流程
        Process mainProcess = bpmnModel.getMainProcess();
        //获取用户任务节点类型,深入子流程
        mainProcess.findFlowElementsOfType(UserTask.class, true).forEach(userTask -> {
        	UserTaskVo userTaskResult = new UserTaskVo();
        	userTaskResult.setId(userTask.getId());
        	userTaskResult.setProcessDefinitionId(processDefinition.getId());
        	userTaskResult.setName(userTask.getName());
        	resultList.add(userTaskResult);
        });
        return Result.OK(resultList);
	}

三、效果图

基于jeecg-boot的flowable流程跳转功能实现,前端vue,java开发,nbcio-boot,java,vue,nbcio-boot

基于jeecg-boot的flowable流程跳转功能实现,前端vue,java开发,nbcio-boot,java,vue,nbcio-boot

 文章来源地址https://www.toymoban.com/news/detail-681814.html

 

到了这里,关于基于jeecg-boot的flowable流程跳转功能实现的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 记录一下基于jeecg-boot3.0的待办消息移植记录

        因为之前没有记录,所以还要看代码进行寻找,比较费劲,所以今天记录一下: 1、后端 SysAnnouncementController 下面函数增加待办的几个显示内容给前端用  具体代码如下: 2、前端 HeaderNotice.vue 文件 获取系统消息里增加待办内容   同时显示的地方做调整,包括样式与内容

    2024年02月12日
    浏览(29)
  • 基于jeecg-boot的nbcio-boot亿事达企业管理平台发布

    目前这个演示系统与代码都同步,以后也尽量保持同步。 更多功能看演示系统 gitee源代码地址 后端代码: https://gitee.com/nbacheng/nbcio-boot 前端代码:https://gitee.com/nbacheng/nbcio-vue.git 在线演示(包括H5) : http://122.227.135.243:9888   这次主要更新增加的内容如下: 1、我的日历    

    2024年02月17日
    浏览(35)
  • Jeecg-Boot /jeecg-boot/jmreport/qurestSql接口sql注入漏洞复现

    一、Jeecg-Boot介绍 JeecgBoot 是一款基于代码生成器的 低代码开发平台 !前后端分离架构 SpringBoot2.x,SpringCloud,Ant DesignVue,Mybatis-plus,Shiro,JWT,支持微服务。强大的代码生成器让前后端代码一键生成,实现低代码开发! JeecgBoot 引领新的低代码开发模式(OnlineCoding- 代码生成器

    2024年02月09日
    浏览(31)
  • jeecg-boot批量导入问题注意事项

    由于批量导入数据速度很快, 因为数据库中的create time字段的时间可能一样,并且jeecg框架自带的是根据生成时间排序, 因此在前端翻页查询的时候,数据每次排序可能会不一样, 会出现第一页已经出现过一次的数据在第二页还会出现。 在后端的查询接口中,要在拼接一个

    2024年02月12日
    浏览(36)
  • jeecg-boot微服务部署步骤详细说明

    大家好,我是小龙人。 通常小企业是如何成长起来的?接外包,然后将公司慢慢的养起来,最后开始研发自己的产品,产品上线,上市! 哈哈,可能有点理想化了,但是身边好多朋友都自己出去创业了,今儿个张三开了个公司,明儿个李四也注册了个公司,但是了解了下,

    2023年04月09日
    浏览(69)
  • 详解 Jeecg-boot 框架如何配置 elasticsearch

    目录 一、下载安装 Elasticsearch 1、 地址:https://www.elastic.co/cn/downloads/elasticsearch 2、下载完成后,解压缩,进入config目录更改配置文件 3、 修改配置完成后,前往bin目录启动el 4、访问:localhost:9200 测试  二、配置 Jeecg-boot 框架 1、导入jeecg项目后,打开application-dev.yml配置文件,

    2024年01月17日
    浏览(30)
  • Jeecg-Boot 集成Activiti 6 (含源码)

    本项目是2020 年集成的,采用的是当时版本的Jeecg-Boot,集成时请注意版本。 Jeecg-Boot 免费版没有工作流,于是我简单集成了一套,并且运用于公司项目中。 论坛中的Activiti 功能介绍,都来自该代码。 本项目中是多租户模式,如不需要多租户将想要接口中tenantId 赋值删除即可

    2024年02月16日
    浏览(40)
  • 【vue】vue中Mixins的用法(jeecg-boot为例):

    一、jeecg-boot本身只有JeecgListMixin.js Mixin是为将页面的一些 公共方法 放在一起处理(节省重复性代码,方便维护) 优先级: 页面里面的方法 Mixin里面的方法=》所以维护时要注意查找 二、使用Mixin: 注意: 这里import 导入的js文件,要在js文件里面有导出 三、mixins详解: 【1】由

    2024年02月14日
    浏览(34)
  • Jeecg-Boot 存在前台SQL注入漏洞(CVE-2023-1454)

    微信公众号搜索:南风漏洞复现文库 南风网络安全公众号首发 eecgBoot是一款基于BPM的低代码平台!前后端分离架构 SpringBoot 2.x,SpringCloud,Ant DesignVue,Mybatis-plus,Shiro,JWT,支持微服务。强大的代码生成器让前后端代码一键生成,实现低代码开发#x

    2024年02月06日
    浏览(112)
  • Jeecg-Boot 未授权SQL注入漏洞(CVE-2023-1454)

    原创文章创作不易,个人博客charis3306.top  JDK: 1.8+ (小于11) Maven: 3.5+ MySql: 5.7+ Redis: 3.2 + Node Js: 10.0 + Npm: 5.6.0+ Yarn: 1.21.1+ 下载源码 后端源码 https://github.com/jeecgboot/jeecg-boot/tree/v3.5.0 前端源码 https://github.com/jeecgboot/jeecgboot-vue3 安装手册 http://doc.jeecg.com/2043871 下载完成后放在bc中。

    2024年02月05日
    浏览(31)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包