工作流角色多选
This commit is contained in:
parent
5ae9a08425
commit
b5497a6b75
|
@ -45,12 +45,12 @@ class State(CommonAModel):
|
||||||
(0, '无处理人'),
|
(0, '无处理人'),
|
||||||
(PARTICIPANT_TYPE_PERSONAL, '个人'),
|
(PARTICIPANT_TYPE_PERSONAL, '个人'),
|
||||||
(PARTICIPANT_TYPE_MULTI, '多人'),
|
(PARTICIPANT_TYPE_MULTI, '多人'),
|
||||||
(PARTICIPANT_TYPE_DEPT, '部门'),
|
# (PARTICIPANT_TYPE_DEPT, '部门'),
|
||||||
(PARTICIPANT_TYPE_ROLE, '角色'),
|
(PARTICIPANT_TYPE_ROLE, '角色'),
|
||||||
(PARTICIPANT_TYPE_VARIABLE, '变量'),
|
# (PARTICIPANT_TYPE_VARIABLE, '变量'),
|
||||||
(PARTICIPANT_TYPE_ROBOT, '脚本'),
|
(PARTICIPANT_TYPE_ROBOT, '脚本'),
|
||||||
(PARTICIPANT_TYPE_FIELD, '工单的字段'),
|
(PARTICIPANT_TYPE_FIELD, '工单的字段'),
|
||||||
(PARTICIPANT_TYPE_PARENT_FIELD, '父工单的字段'),
|
# (PARTICIPANT_TYPE_PARENT_FIELD, '父工单的字段'),
|
||||||
(PARTICIPANT_TYPE_FORMCODE, '代码获取')
|
(PARTICIPANT_TYPE_FORMCODE, '代码获取')
|
||||||
)
|
)
|
||||||
STATE_DISTRIBUTE_TYPE_ACTIVE = 1 # 主动接单
|
STATE_DISTRIBUTE_TYPE_ACTIVE = 1 # 主动接单
|
||||||
|
|
|
@ -147,11 +147,11 @@ class WfService(object):
|
||||||
if destination_participant_type == State.PARTICIPANT_TYPE_FIELD:
|
if destination_participant_type == State.PARTICIPANT_TYPE_FIELD:
|
||||||
destination_participant = ticket_data.get(destination_participant, 0) if destination_participant in ticket_data \
|
destination_participant = ticket_data.get(destination_participant, 0) if destination_participant in ticket_data \
|
||||||
else Ticket.ticket_data.get(destination_participant, 0)
|
else Ticket.ticket_data.get(destination_participant, 0)
|
||||||
elif destination_participant_type == State.PARTICIPANT_TYPE_DEPT:#单部门
|
elif destination_participant_type == State.PARTICIPANT_TYPE_DEPT:#部门
|
||||||
destination_participant = list(User.objects.filter(dept=destination_participant).values_list('id', flat=True))
|
destination_participant = list(User.objects.filter(dept__in=destination_participant).values_list('id', flat=True))
|
||||||
|
|
||||||
elif destination_participant_type == State.PARTICIPANT_TYPE_ROLE:#单角色
|
elif destination_participant_type == State.PARTICIPANT_TYPE_ROLE:#角色
|
||||||
user_queryset = User.objects.filter(roles=destination_participant)
|
user_queryset = User.objects.filter(roles__in=destination_participant)
|
||||||
# 如果选择了角色, 需要走过滤策略
|
# 如果选择了角色, 需要走过滤策略
|
||||||
if ticket.filter_policy == 1:
|
if ticket.filter_policy == 1:
|
||||||
user_queryset = user_queryset.filter(dept=ticket.belong_dept)
|
user_queryset = user_queryset.filter(dept=ticket.belong_dept)
|
||||||
|
|
Loading…
Reference in New Issue