• 基于若依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、效果如下:

  • 相关阅读:
    国标GB28181协议视频平台EasyGBS国标平台设备播放断流现象的排查分析及解决
    计算机视觉系列 -MMDetection 之SSDLite经典算法
    一款云渗透工具 - Sea Moon
    计算机视觉(CV)技术:优势、挑战与前景
    【Linux】软件管理器yum和编辑器vim
    Harmonyos Next——图片上传与下载
    外包公司“混”了2年,我只认真做了5件事,如今顺利拿到阿里 Offer。
    手动给docusaurus添加一个搜索
    Spring-全面详解(学习总结---从入门到深化)
    发挥项目“临时性”威力,让项目顺利实施
  • 原文地址:https://blog.csdn.net/qq_40032778/article/details/133746729