基于若依的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、多实例效果图


相关文章
|
JSON API 数据格式
您可以在钉钉开放平台的API文档中找到对应的API接口来创建审批实例
您可以在钉钉开放平台的API文档中找到对应的API接口来创建审批实例【1月更文挑战第20天】【1月更文挑战第96篇】
371 2
|
XML Java Maven
Spring中AOP最简单实例-XML形式
Spring中AOP最简单实例-XML形式
203 0
|
前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程初步完成转bpmn设计(还有bug,以后再修改)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程初步完成转bpmn设计(还有bug,以后再修改)
502 0
阿里(钉钉部门)远程面,三面坐上“直通车”,拿下offer没问题
本人毕业于华南地区某不知名211院校,Java方向,目前钉钉三面已经结束,基本可以说是坐上了“直通车”,收到的反馈都是比较好的,跟HR沟通感觉希望很大,按道理来说拿下offer是没有太大问题的,以下内容就是我这次的钉钉远程面试经历的一个分享和一些心得,希望对大家能够有所帮助。
|
移动开发 监控 前端开发
作为部门的前端“独苗”,我的钉钉全栈化实践总结
作为前端总会在业务上面临资源、效率等问题,本文讲述如何发挥专业前端在特殊位置的价值,让整个人力的利用效率最大化,并且可以通过实践将这套方法论贡献给有需要的团队去复用实践!
|
存储 弹性计算 安全
课时23:案例分享——钉钉
钉钉作为企业级产品,采用SaaS平台技术,依托阿里云的ECS、OSS等服务,实现快速部署与客户需求的高效适应。其数据存储于阿里云RDS中,确保安全性和可靠性,并通过高强度加密保障信息传输安全。阿里云的安全防护措施为钉钉提供了坚实后盾,使其能专注于优化和创新,提升用户体验。
468 0
|
存储 弹性计算 安全
成功案例-钉钉 | 学习笔记
快速学习 成功案例-钉钉
661 0
|
存储 弹性计算 安全
案例分享——钉钉
rds数据库 阿里云为钉钉提供了安全性和整体服务的稳定性
案例分享——钉钉
|
存储 弹性计算 安全
案例分享——钉钉|学习笔记
快速学习 案例分享——钉钉
620 0

相关课程

更多