基于若依的ruoyi-nbcio流程管理系统里修正仿钉钉流程部门主管与多实例转xml的bug

简介: 基于若依的ruoyi-nbcio流程管理系统里修正仿钉钉流程部门主管与多实例转xml的bug

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

gitee源代码地址

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

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

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

gitee源代码地址

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

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

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

1、后端代码 createUserTask方法里修正如下:

根据不通类型进行分别判断出来xml生成

String assignType = properties.getString("assigneeType");
            if(StringUtils.equalsAnyIgnoreCase("user", assignType)) {
              JSONArray approvers = properties.getJSONArray("approvers");
              JSONObject approver = approvers.getJSONObject(0);
              ExtensionAttribute extDataTypeAttribute =  new ExtensionAttribute();
              extDataTypeAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extDataTypeAttribute.setName("dataType");
              extDataTypeAttribute.setValue("USERS");
              userTask.addAttribute(extDataTypeAttribute);
              ExtensionAttribute extTextAttribute =  new ExtensionAttribute();
              extTextAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extTextAttribute.setName("text");
              extTextAttribute.setValue(approver.getString("nickName"));
              userTask.addAttribute(extTextAttribute);
              userTask.setFormKey(properties.getString("formKey"));
              userTask.setAssignee(approver.getString("userName"));
            }
            else if (StringUtils.equalsAnyIgnoreCase("director", assignType)) {
              ExtensionAttribute extDataTypeAttribute =  new ExtensionAttribute();
              extDataTypeAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extDataTypeAttribute.setName("dataType");
              extDataTypeAttribute.setValue("MANAGER");
              userTask.addAttribute(extDataTypeAttribute);
              ExtensionAttribute extTextAttribute =  new ExtensionAttribute();
              extTextAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extTextAttribute.setName("text");
              extTextAttribute.setValue("部门经理");
              userTask.addAttribute(extTextAttribute);
              userTask.setFormKey(properties.getString("formKey"));
              userTask.setAssignee("${DepManagerHandler.getUser(execution)}");
            }
            else if (StringUtils.equalsAnyIgnoreCase("role", assignType)) {
              JSONArray approvers = properties.getJSONArray("approvers");
              JSONObject approver = approvers.getJSONObject(0);
              ExtensionAttribute extDataTypeAttribute =  new ExtensionAttribute();
              extDataTypeAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extDataTypeAttribute.setName("dataType");
              extDataTypeAttribute.setValue("ROLES");
              userTask.addAttribute(extDataTypeAttribute);
              ExtensionAttribute extTextAttribute =  new ExtensionAttribute();
              extTextAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extTextAttribute.setName("text");
              extTextAttribute.setValue(approver.getString("roleName"));
              userTask.addAttribute(extTextAttribute);
              userTask.setFormKey(properties.getString("formKey"));
              List<SysRole> sysroleslist = approvers.toJavaList(SysRole.class);
              List<String> roleslist = sysroleslist.stream().map(e->e.getRoleKey()).collect(Collectors.toList());
              userTask.setCandidateGroups(roleslist);
              userTask.setAssignee("${assignee}");
              MultiInstanceLoopCharacteristics loopCharacteristics = new MultiInstanceLoopCharacteristics();
              if(StringUtils.equalsAnyIgnoreCase(properties.getString("counterSign"), "true")) {//并行会签
                loopCharacteristics.setSequential(false);
                loopCharacteristics.setInputDataItem("${multiInstanceHandler.getUserNames(execution)}");
                loopCharacteristics.setElementVariable("assignee");
                loopCharacteristics.setCompletionCondition("${nrOfCompletedInstances &gt;= nrOfInstances}");
              }
              else {
                loopCharacteristics.setSequential(false);
                loopCharacteristics.setInputDataItem("${multiInstanceHandler.getUserNames(execution)}");
                loopCharacteristics.setElementVariable("assignee");
                loopCharacteristics.setCompletionCondition("${nrOfCompletedInstances &gt; 0}");
              }
              userTask.setLoopCharacteristics(loopCharacteristics);
            }

2、部门主管效果图

3、多实例效果图


相关文章
|
人工智能 自然语言处理 运维
钉钉MCP能力上新:AI如何提效你的工作流程
钉钉通讯录 & 部门管理、日程管理、待办任务、机器人&通知等高频场景API提供MCP服务
1339 0
钉钉MCP能力上新:AI如何提效你的工作流程
|
JSON 数据格式 开发者
钉钉的待办功能怎么实现?我看着官网的流程下来,发送完之后没有收到代办?
本文对比了钉钉官方教程与实际操作界面的差异。根据官网教程(链接已附),开发员工待办任务应参考相关步骤,但实际页面中存在不一致情况:1) 缺少JSON-SCHEMA选项,需输入JSON处无法匹配;2) 连接流配置中仅有出参配置,未发现教程提及的入参配置。这些问题可能导致开发者在实现过程中遇到障碍,建议钉钉更新文档或优化界面以保持一致性。
|
XML 算法 API
访问者模式问题之钉钉审批流程配置为什么适合使用访问者模式
访问者模式问题之钉钉审批流程配置为什么适合使用访问者模式
|
XML Java Maven
Spring中AOP最简单实例-XML形式
Spring中AOP最简单实例-XML形式
213 0
|
存储 弹性计算 安全
课时23:案例分享——钉钉
钉钉作为企业级产品,采用SaaS平台技术,依托阿里云的ECS、OSS等服务,实现快速部署与客户需求的高效适应。其数据存储于阿里云RDS中,确保安全性和可靠性,并通过高强度加密保障信息传输安全。阿里云的安全防护措施为钉钉提供了坚实后盾,使其能专注于优化和创新,提升用户体验。
542 0
|
存储 弹性计算 安全
成功案例-钉钉 | 学习笔记
快速学习 成功案例-钉钉
686 0
|
存储 弹性计算 安全
案例分享——钉钉
rds数据库 阿里云为钉钉提供了安全性和整体服务的稳定性
案例分享——钉钉
|
存储 弹性计算 安全
案例分享——钉钉|学习笔记
快速学习 案例分享——钉钉
638 0
|
存储 弹性计算 监控

热门文章

最新文章

相关课程

更多