Skip to content

Commit

Permalink
bugfix: timer_transition
Browse files Browse the repository at this point in the history
  • Loading branch information
blackholll committed May 20, 2019
1 parent cc5a3c4 commit 0d1fe0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion service/ticket/ticket_base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ def handle_timer_transition(cls, ticket_id, destination_state_id):
for destination_transition in destination_transition_queryset:
if destination_transition.transition_type_id == CONSTANT_SERVICE.TRANSITION_TYPE_TIMER:
from tasks import timer_transition
timer_transition.apply_async(args=[ticket_id.id, destination_state_id, datetime.datetime.now(), destination_transition.id], countdown=destination_transition.timer, queue='loonflow')
timer_transition.apply_async(args=[ticket_id, destination_state_id, datetime.datetime.now(), destination_transition.id], countdown=destination_transition.timer, queue='loonflow')
return True, ''

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ def timer_transition(ticket_id, state_id, date_time, transition_id):
"""
# 需要满足工单此状态后续无其他操作才自动流转
# 查询该工单此状态所有操作
flow_log_set, msg = TicketBaseService().get_ticket_flow_log(ticket_id, per_page=1000)
flow_log_set, msg = TicketBaseService().get_ticket_flow_log(ticket_id, 'loonrobot', per_page=1000)
for flow_log in flow_log_set:
if flow_log.state_id == state_id and flow_log.gmt_created > date_time:
if flow_log.get('state').get('state_id') == state_id and flow_log.get('gmt_created') > date_time:
return True, '后续有操作,定时器失效'
# 执行流转
handle_ticket_data = dict(transition_id=transition_id, username='loonrobot', suggestion='定时器流转')
Expand Down

0 comments on commit 0d1fe0b

Please sign in to comment.