20 lines
594 B
Python
20 lines
594 B
Python
from threading import Thread
|
|
from apps.hrm.models import Employee
|
|
from apps.hrm.services import HrmService
|
|
from apps.vm.models import Visit, Vpeople
|
|
from apps.wf.models import Ticket
|
|
|
|
|
|
def bind_visit(ticket, transition, new_ticket_data: dict):
|
|
visit = Visit.objects.get(id=new_ticket_data['visit'])
|
|
visit.ticket = ticket
|
|
if visit.state == Visit.V_CREATE:
|
|
visit.state = Visit.V_AUDIT
|
|
visit.save()
|
|
|
|
|
|
def get_receptionist(state, ticket, new_ticket_data, handler):
|
|
visit = Visit.objects.filter(ticket=ticket).first()
|
|
if visit:
|
|
return [visit.receptionist.id]
|