From 69cca8eef3564630fdf4de489815385e1ac8b46a Mon Sep 17 00:00:00 2001 From: erdanergou Date: Mon, 12 Jun 2023 13:37:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E5=BA=93=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E4=B8=BA=E5=A4=87=E5=93=81=E5=A4=87=E4=BB=B6=E5=BA=93?= =?UTF-8?q?=E6=97=B6=E7=AC=AC=E4=B8=80=E4=B8=AA=E8=8A=82=E7=82=B9=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E8=AE=BE=E5=A4=87=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/QyWxOperationService.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java index 425ed0ec..c135eaa8 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java @@ -1777,7 +1777,7 @@ public class QyWxOperationService { // 获取第一个节点成员uid List userIdList = new ArrayList<>(); - if(flag == 11){ + if (flag == 11) { // 如果是办公用品库 @@ -1792,22 +1792,35 @@ public class QyWxOperationService { } - }else if(flag == 12){ + } else if (flag == 12) { // 如果是备品备件库 // 获取申请用户所在部门的设备员 List userByPortList = PublicConfig.findUserByAdminorgAndPosition(applicantUser.getMaindeparment(), "设备员", userKey, token); - for (UserByPort userByPort : userByPortList) { - String other_workwechat = userByPort.getWorkwechat(); - if (other_workwechat == null || "".equals(other_workwechat)) { - other_workwechat = userByPort.getWechat(); + if (userByPortList != null && userByPortList.size() > 0) { + // 如果有设备员 + for (UserByPort userByPort : userByPortList) { + String other_workwechat = userByPort.getWorkwechat(); + if (other_workwechat == null || "".equals(other_workwechat)) { + other_workwechat = userByPort.getWechat(); + } + userIdList.add(other_workwechat); + } + } else { + // 如果没有 + List departmentHeadForUserToken = PublicConfig.findDepartmentHeadByUser(applicantUser.getMaindeparment(), userKey, token); + for (UserByPort departmentHead : departmentHeadForUserToken + ) { + String departmentHeadWorkwechat = departmentHead.getWorkwechat(); + if (departmentHeadWorkwechat == null || "".equals(departmentHeadWorkwechat)) { + departmentHeadWorkwechat = departmentHead.getWechat(); + } + userIdList.add(departmentHeadWorkwechat); } - userIdList.add(other_workwechat); } } - // 用于设置第一个节点流程 Approval_template_approver approval_template_approver_departMentHeader = new Approval_template_approver(); approval_template_approver_departMentHeader.setAttr(1);