forked from erp-dev/erp
feat: notification sending for printing order created
This commit is contained in:
@@ -254,3 +254,39 @@ def send_printing_job_latest_state_wecom(
|
||||
"errcode": resp.errcode,
|
||||
"errmsg": resp.errmsg,
|
||||
}
|
||||
|
||||
|
||||
def render_printing_order_created_markdown(
|
||||
*,
|
||||
printing_order_id: str,
|
||||
printing_order_human_id: str,
|
||||
created_at: str,
|
||||
sender_label: str,
|
||||
customer_name: str,
|
||||
fabric: str,
|
||||
outgoing_date: str,
|
||||
) -> str:
|
||||
template = getattr(
|
||||
settings,
|
||||
"PRINTING_ORDER_CREATED_WECOM_MARKDOWN_TEMPLATE",
|
||||
(
|
||||
"### 印染订单创建\n"
|
||||
"\n"
|
||||
"- **印染订单ID**:`{printing_order_id}`\n"
|
||||
"- **订单编号**:`{printing_order_human_id}`\n"
|
||||
"- **创建时间**:`{created_at}`\n"
|
||||
"- **发送者**:{sender}\n"
|
||||
"- **客户**:{customer_name}\n"
|
||||
"- **面料**:{fabric}\n"
|
||||
"- **出货日期**:`{outgoing_date}`\n"
|
||||
),
|
||||
)
|
||||
return template.format(
|
||||
printing_order_id=str(printing_order_id),
|
||||
printing_order_human_id=str(printing_order_human_id),
|
||||
created_at=str(created_at),
|
||||
sender=str(sender_label or "系统自动发送"),
|
||||
customer_name=str(customer_name or "-"),
|
||||
fabric=str(fabric or "-"),
|
||||
outgoing_date=str(outgoing_date or "-"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user