feat: resignation添加ticketMixin2
This commit is contained in:
parent
dc17c01aaf
commit
b939fcbef2
|
|
@ -498,18 +498,3 @@ class HrmService:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def bind_resignation(ticket: Ticket, transition: Transition, new_ticket_data: dict):
|
|
||||||
ins = Resignation.objects.get(id=new_ticket_data['t_id'])
|
|
||||||
if ins.ticket and ins.ticket.id != ticket.id:
|
|
||||||
raise ParseError('重复创建工单')
|
|
||||||
ticket_data = ticket.ticket_data
|
|
||||||
ticket_data.update({
|
|
||||||
't_model': 'resignation',
|
|
||||||
't_id': ins.id,
|
|
||||||
})
|
|
||||||
ticket.ticket_data = ticket_data
|
|
||||||
ticket.create_by = ins.create_by
|
|
||||||
ticket.save()
|
|
||||||
if ins.ticket is None:
|
|
||||||
ins.ticket = ticket
|
|
||||||
ins.save()
|
|
||||||
|
|
@ -399,4 +399,4 @@ class ResignationViewSet(TicketMixin, EuModelViewSet):
|
||||||
queryset = Resignation.objects.all()
|
queryset = Resignation.objects.all()
|
||||||
serializer_class = ResignationSerializer
|
serializer_class = ResignationSerializer
|
||||||
search_fields = ["employee__name"]
|
search_fields = ["employee__name"]
|
||||||
workflow_key = ["wf_resignation"]
|
workflow_key = "wf_resignation"
|
||||||
Loading…
Reference in New Issue