访客和相关方项目发送通知

This commit is contained in:
曹前明 2022-08-29 08:23:54 +08:00
parent 4d3a54fe58
commit 9b9dde6a07
3 changed files with 13 additions and 1 deletions

View File

@ -201,7 +201,7 @@ def create_remind(event: Event, params: dict):
# 发送短信通知
Thread(target=send_sms, args=(i.recipient.employee.phone,
'1003', params), daemon=True).start()
1003, params), daemon=True).start()
if i.notify_setting.wechat_enable:
pass
event.is_pushed = True

View File

@ -2,6 +2,7 @@
from apps.hrm.models import Certificate, Employee
from apps.hrm.services import HrmService
from apps.system.models import Post, User, UserPost
from apps.utils.sms import send_sms
from apps.utils.tools import ranstr
from apps.wf.models import Ticket, Transition
from apps.rpm.models import Remployee, Rfile, Rparty, Rpj, Rpjcertificate, Rpjfile, Rpjmember
@ -120,3 +121,8 @@ def rpj_audit_end(ticket):
rpj.state = Rpj.RPJ_ENTER
rpj.save()
# 发送通知?
try:
phone = rpj.create_by.employee.phone
send_sms(phone=phone, template_code=1004, template_param={'name': '相关方项目'})
except Exception:
pass

View File

@ -1,6 +1,7 @@
from apps.hrm.models import Employee
from apps.hrm.services import HrmService
from apps.utils.sms import send_sms
from apps.vm.models import Visit, Visitor, Vpeople
@ -58,3 +59,8 @@ def visit_audit_end(ticket):
visit.state = Visit.V_ENTER
visit.save()
# 发送通知?
try:
phone = visit.create_by.employee.phone
send_sms(phone=phone, template_code=1004, template_param={'name': '访客项目'})
except Exception:
pass