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:
24
shipment/tasks.py
Normal file
24
shipment/tasks.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import logging
|
||||
|
||||
from celery import shared_task
|
||||
|
||||
from shipment.services import send_shipment_created_wecom
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@shared_task(bind=True)
|
||||
def notify_shipment_created_wecom(
|
||||
self,
|
||||
*,
|
||||
shipment_id: int,
|
||||
created_by_id: int | None = None,
|
||||
) -> dict:
|
||||
payload = send_shipment_created_wecom(
|
||||
shipment_id=shipment_id,
|
||||
created_by_id=created_by_id,
|
||||
)
|
||||
payload["task_id"] = self.request.id
|
||||
logger.info("[shipment.tasks] 出货单创建企业微信通知发送完成: %s", payload)
|
||||
return payload
|
||||
Reference in New Issue
Block a user