From 52ad96f177974bbb48cf4db87eda9e954b7d9ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Thu, 14 Jul 2022 15:49:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=A4=84=E7=90=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=B2=97=E4=BD=8D=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wf/services.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/wf/services.py b/apps/wf/services.py index 68c891ac..3aefdda7 100755 --- a/apps/wf/services.py +++ b/apps/wf/services.py @@ -174,6 +174,19 @@ class WfService(object): destination_participant = list(User.objects.filter( dept__in=destination_participant).values_list('id', flat=True)) + elif destination_participant_type == State.PARTICIPANT_TYPE_POST: # 岗位 + user_queryset = User.objects.filter(posts__in=destination_participant) + # 如果选择了岗位, 需要走过滤策略 + if state.filter_policy == 1: + depts = get_parent_queryset(ticket.belong_dept) + user_queryset = user_queryset.filter(dept__in=depts) + elif state.filter_policy == 2: + depts = get_parent_queryset(ticket.create_by.belong_dept) + user_queryset = user_queryset.filter(dept__in=depts) + elif state.filter_policy == 3: + depts = get_parent_queryset(handler.belong_dept) + user_queryset = user_queryset.filter(dept__in=depts) + destination_participant = list(user_queryset.values_list('id', flat=True)) elif destination_participant_type == State.PARTICIPANT_TYPE_ROLE: # 角色 user_queryset = User.objects.filter(roles__in=destination_participant) # 如果选择了角色, 需要走过滤策略