流程无法设置本部门领导审批?

bug反馈 未结 2 189
shang
shang VIP4 2021-03-06 15:20:44
收藏
产品:vue 版本:8.01
审核者选择“岗位→部长”时,所有部门的部长都能审核,而不是本部门的部长审核。这个怎么设置?
回帖
  • 2021-03-24 22:33:50
    这个通过自定义SQL 语句实现; 以下是我的解决方案,仅供参考 [pre] /sql String sql=flowAssignee.getValue (); if(StringUtils.isNoneBlank(sql)){ if(sql.contains("#{previousExecutor}")){ //上一步提交人 lastHisTask = SpringContextHolder.getBean (HistoryService.class).createHistoricTaskInstanceQuery ().processInstanceId (task.getProcessInstanceId ()).finished () .includeProcessVariables ().orderByHistoricTaskInstanceEndTime ().desc ().list ().get (0); sql=sql.replace("#{previousExecutor}","'"+lastHisTask.getAssignee ()+"'"); }else if(sql.contains("#{applyUserId}")){ //发起人 // 第一提交人,这里查询流程的第一个人 HistoricTaskInstance fristHisTask = SpringContextHolder.getBean (HistoryService.class).createHistoricTaskInstanceQuery ().processInstanceId (task.getProcessInstanceId ()).finished () .includeProcessVariables ().orderByHistoricTaskInstanceEndTime ().asc ().list ().get (0); sql=sql.replace("#{applyUserId}","'"+fristHisTask.getAssignee ()+"'"); }else if(sql.contains("#{currentUserId}")){ //当前登陆用户 sql=sql.replace("#{currentUserId}","'"+UserUtils.getUser ().getId ()+"'"); } System.out.println("分配办理人员 sql: ========== sql语句 "+sql); Map userMap = SpringContextHolder.getBean (JdbcTemplate.class).queryForMap (sql); candidateUserIds.add(userMap.get ("id").toString ()); } break; [/pre] 下拉框选择---> sql ,写入下面的sql语句 [pre] SELECT t1.id AS id from ( SELECT a.id, o.NAME AS officename FROM sys_user a LEFT JOIN sys_office c ON c.id = a.company_id LEFT JOIN sys_office o ON o.id = a.office_id LEFT JOIN sys_post p ON p.id = a.post_id WHERE a.del_flag = 0 AND p.CODE = 'depart' ) t1, ( SELECT o.NAME AS ofNAME FROM sys_user a LEFT JOIN sys_office c ON c.id = a.company_id LEFT JOIN sys_office o ON o.id = a.office_id WHERE a.del_flag = 0 AND a.id = #{applyUserId} ) t2 WHERE t1.officename = t2.ofNAME [/pre]
    0 回复
  • 2021-03-24 22:35:11
    sql 语句在 处理handler里面处理
    0 回复