• 基于若依ruoyi-nbcio支持flowable流程增加自定义业务表单(二)


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

    gitee源代码地址

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

    演示地址:RuoYi-Nbcio后台管理系统

    之前讲了自定义业务表单,现在讲如何与流程进行关联

    1、后端部分

    WfCustomFormMapper.xml

    1. "updateCustom" parameterType="Object">
    2. update wf_custom_form set deploy_id= #{customFormVo.deployId}, flow_name=#{customFormVo.flowName} where id = #{customFormVo.id}

    WfCustomFormMapper.java

    1. import com.ruoyi.workflow.domain.WfCustomForm;
    2. import com.ruoyi.workflow.domain.vo.CustomFormVo;
    3. import com.ruoyi.workflow.domain.vo.WfCustomFormVo;
    4. import org.apache.ibatis.annotations.Param;
    5. import com.ruoyi.common.core.mapper.BaseMapperPlus;
    6. /**
    7. * 流程业务单Mapper接口
    8. *
    9. * @author nbacheng
    10. * @date 2023-10-09
    11. */
    12. public interface WfCustomFormMapper extends BaseMapperPlus {
    13. void updateCustom(@Param("customFormVo") CustomFormVo customFormVo);
    14. }

    control接口

    1. /**
    2. * 关联流程业务单
    3. */
    4. @SaCheckPermission("workflow:customForm:edit")
    5. @Log(title = "流程业务单", businessType = BusinessType.UPDATE)
    6. @RepeatSubmit()
    7. @PostMapping("/updateCustom")
    8. public R updateCustom( @RequestBody CustomFormVo customFormVo) {
    9. iWfCustomFormService.updateCustom(customFormVo);
    10. return R.ok("关联流程成功!");
    11. }

    CustomFormVo.java

    1. package com.ruoyi.workflow.domain.vo;
    2. import lombok.Data;
    3. /**
    4. * @Author nbacheng
    5. * @Date 2022/5/3
    6. * @Description:
    7. * @Version 1.0
    8. */
    9. @Data
    10. public class CustomFormVo {
    11. private String id;
    12. private String deployId;
    13. private String flowName;
    14. }

    2、前端部分

    customForm的index.vue代码如下