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


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

    gitee源代码地址

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

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

     

    之前自定义业务表单只能关联自定义业务的流程应用类型,所以需要根据这个进行选择与显示

    1、ProcessQuery 参数增加appType

    1. public class ProcessQuery {
    2. /**
    3. * 流程标识
    4. */
    5. private String processKey;
    6. /**
    7. * 流程名称
    8. */
    9. private String processName;
    10. /**
    11. * 流程分类
    12. */
    13. private String category;
    14. /**
    15. * 流程应用类型
    16. */
    17. private String appType;
    18. /**
    19. * 状态
    20. */
    21. private String state;
    22. /**
    23. * 请求参数
    24. */
    25. private Map params = new HashMap<>();
    26. }

    2、同时queryPageList的发布流程列表修改如下,要根据应用类型来进行选择过滤

    1. @Override
    2. public TableDataInfo queryPageList(ProcessQuery processQuery, PageQuery pageQuery) {
    3. // 流程定义列表数据查询
    4. ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery()
    5. .latestVersion()
    6. .orderByProcessDefinitionKey()
    7. .asc();
    8. // 构建搜索条件
    9. ProcessUtils.buildProcessSearch(processDefinitionQuery, processQuery);
    10. long pageTotal = processDefinitionQuery.count();
    11. if (pageTotal <= 0) {
    12. return TableDataInfo.build();
    13. }
    14. int offset = pageQuery.getPageSize() * (pageQuery.getPageNum() - 1);
    15. List definitionList = processDefinitionQuery.listPage(offset, pageQuery.getPageSize());
    16. List deployVoList = new ArrayList<>(definitionList.size());
    17. for (ProcessDefinition processDefinition : definitionList) {
    18. if( StringUtils.isNotBlank(processQuery.getAppType())) {
    19. if ( processQuery.getAppType().equalsIgnoreCase(categoryMapper.selectAppTypeByCode(processDefinition.getCategory()))) {
    20. String deploymentId = processDefinition.getDeploymentId();
    21. Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
    22. WfDeployVo vo = new WfDeployVo();
    23. vo.setDefinitionId(processDefinition.getId());
    24. vo.setProcessKey(processDefinition.getKey());
    25. vo.setProcessName(processDefinition.getName());
    26. vo.setVersion(processDefinition.getVersion());
    27. vo.setCategory(processDefinition.getCategory());
    28. vo.setAppType(categoryMapper.selectAppTypeByCode(processDefinition.getCategory()));
    29. vo.setDeploymentId(processDefinition.getDeploymentId());
    30. vo.setSuspended(processDefinition.isSuspended());
    31. // 流程部署信息
    32. vo.setCategory(deployment.getCategory());
    33. vo.setDeploymentTime(deployment.getDeploymentTime());
    34. deployVoList.add(vo);
    35. }
    36. }
    37. else {
    38. String deploymentId = processDefinition.getDeploymentId();
    39. Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
    40. WfDeployVo vo = new WfDeployVo();
    41. vo.setDefinitionId(processDefinition.getId());
    42. vo.setProcessKey(processDefinition.getKey());
    43. vo.setProcessName(processDefinition.getName());
    44. vo.setVersion(processDefinition.getVersion());
    45. vo.setCategory(processDefinition.getCategory());
    46. vo.setAppType(categoryMapper.selectAppTypeByCode(processDefinition.getCategory()));
    47. vo.setDeploymentId(processDefinition.getDeploymentId());
    48. vo.setSuspended(processDefinition.isSuspended());
    49. // 流程部署信息
    50. vo.setCategory(deployment.getCategory());
    51. vo.setDeploymentTime(deployment.getDeploymentTime());
    52. deployVoList.add(vo);
    53. }
    54. }
    55. Page page = new Page<>();
    56. page.setRecords(deployVoList);
    57. page.setTotal(pageTotal);
    58. return TableDataInfo.build(page);
    59. }

    3、效果如下:

  • 相关阅读:
    13-1-SRGAN-图像超分-残差模块-亚像素卷积
    Mysql 分页,排序 打字练习
    在Winform系统开发中,使用MediatR来实现类似事件总线的消息处理
    Git 安装和基础命令、IDEA 基础操作
    Unable to parse response body for Response...
    nexus 5X刷机并使用Magisk获取root权限
    cocos2dx中,将png图片打包plist图集,使用什么工具呢?
    Spring - BeanFactoryPostProcessor 扩展接口
    iOS 关于UIWebView常见使用方法
    【PyTorch攻略(2/7)】 加载数据集
  • 原文地址:https://blog.csdn.net/qq_40032778/article/details/133746729