相关方入厂项目service

This commit is contained in:
曹前明 2022-07-14 15:42:13 +08:00
parent 99543ed413
commit 65d2a740fb
2 changed files with 20 additions and 5 deletions

View File

@ -186,8 +186,11 @@ class HrmService:
ti.update(data)
ep.third_info = ti
ep.save()
if ep.user and ep.user.phone != ep.phone:
ep.user.phone = ep.phone
if ep.user:
if ep.user.phone != ep.phone:
ep.user.phone = ep.phone
if ep.user.type != ep.type:
ep.user.type = ep.type
ep.user.save()
return ep

View File

@ -33,6 +33,7 @@ def rpj_audit_end(ticket):
ep.phone = rep.phone
ep.photo = rep.photo
ep.type = 'remployee'
ep.belong_dept = rpj.rparty.dept
ep.save()
rep.employee = ep
rep.rpj = rpj # 更新当前入厂项目
@ -41,7 +42,18 @@ def rpj_audit_end(ticket):
Thread(target=HrmService.sync_dahua_employee, args=(ep, '', rpj.come_time, rpj.leave_time)).start()
# 更新入厂项目人员证书库
for i in Rcertificate.objects.filter(rpj=rpj):
Certificate.objects.get_or_create(
)
ct = Certificate.objects.filter(number=i.number)
if ct:
pass
else:
ct = Certificate()
ct.name = i.name
ct.number = i.number
ct.type = i.type
ct.issue_date = i.issue_date
ct.expiration_date = i.expiration_date
ct.review_date = i.review_date
ct.file = i.file
ct.employee = i.rpj_member.remployee.employee
ct.save()
# 发送通知?