From b5497a6b75727a12773692e40b8e8fa1144ebd91 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 21 Oct 2021 11:32:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/wf/models.py | 6 +++--- hb_server/apps/wf/services.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hb_server/apps/wf/models.py b/hb_server/apps/wf/models.py index 6592d49..fff81ed 100644 --- a/hb_server/apps/wf/models.py +++ b/hb_server/apps/wf/models.py @@ -45,12 +45,12 @@ class State(CommonAModel): (0, '无处理人'), (PARTICIPANT_TYPE_PERSONAL, '个人'), (PARTICIPANT_TYPE_MULTI, '多人'), - (PARTICIPANT_TYPE_DEPT, '部门'), + # (PARTICIPANT_TYPE_DEPT, '部门'), (PARTICIPANT_TYPE_ROLE, '角色'), - (PARTICIPANT_TYPE_VARIABLE, '变量'), + # (PARTICIPANT_TYPE_VARIABLE, '变量'), (PARTICIPANT_TYPE_ROBOT, '脚本'), (PARTICIPANT_TYPE_FIELD, '工单的字段'), - (PARTICIPANT_TYPE_PARENT_FIELD, '父工单的字段'), + # (PARTICIPANT_TYPE_PARENT_FIELD, '父工单的字段'), (PARTICIPANT_TYPE_FORMCODE, '代码获取') ) STATE_DISTRIBUTE_TYPE_ACTIVE = 1 # 主动接单 diff --git a/hb_server/apps/wf/services.py b/hb_server/apps/wf/services.py index 9acdcce..ad45929 100644 --- a/hb_server/apps/wf/services.py +++ b/hb_server/apps/wf/services.py @@ -147,11 +147,11 @@ class WfService(object): if destination_participant_type == State.PARTICIPANT_TYPE_FIELD: destination_participant = ticket_data.get(destination_participant, 0) if destination_participant in ticket_data \ else Ticket.ticket_data.get(destination_participant, 0) - elif destination_participant_type == State.PARTICIPANT_TYPE_DEPT:#单部门 - destination_participant = list(User.objects.filter(dept=destination_participant).values_list('id', flat=True)) + elif destination_participant_type == State.PARTICIPANT_TYPE_DEPT:#部门 + destination_participant = list(User.objects.filter(dept__in=destination_participant).values_list('id', flat=True)) - elif destination_participant_type == State.PARTICIPANT_TYPE_ROLE:#单角色 - user_queryset = User.objects.filter(roles=destination_participant) + elif destination_participant_type == State.PARTICIPANT_TYPE_ROLE:#角色 + user_queryset = User.objects.filter(roles__in=destination_participant) # 如果选择了角色, 需要走过滤策略 if ticket.filter_policy == 1: user_queryset = user_queryset.filter(dept=ticket.belong_dept)