forked from erp-dev/erp
feat: added wecom notify when printing_job production was completed(new status) and shipment was created
This commit is contained in:
@@ -7,6 +7,7 @@ from django.db import transaction
|
||||
from django.utils import timezone
|
||||
|
||||
from printing.models import PlateOrder, PlateOrderTiiaUploadFailure
|
||||
from printing.services import send_printing_job_production_completed_wecom
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -116,3 +117,18 @@ def upload_yesterday_plate_order_images_to_tencent_tiia(self):
|
||||
logger.info('[TIIA] 昨日 PlateOrder 图片上传任务完成: %s', payload)
|
||||
return payload
|
||||
|
||||
|
||||
@shared_task(bind=True)
|
||||
def notify_printing_job_production_completed_wecom(
|
||||
self,
|
||||
*,
|
||||
printing_job_id: int,
|
||||
triggered_by_id: int | None = None,
|
||||
) -> dict:
|
||||
payload = send_printing_job_production_completed_wecom(
|
||||
printing_job_id=printing_job_id,
|
||||
triggered_by_id=triggered_by_id,
|
||||
)
|
||||
payload["task_id"] = self.request.id
|
||||
logger.info("[printing.tasks] 印染任务完成生产企业微信通知发送完成: %s", payload)
|
||||
return payload
|
||||
|
||||
Reference in New Issue
Block a user