1
0
forked from erp-dev/erp

feat: wecomm notification support command

This commit is contained in:
2026-01-23 16:11:03 +08:00
parent 88688f9481
commit 34483e9753
5 changed files with 217 additions and 5 deletions

View File

@@ -203,11 +203,21 @@ def on_printing_job_state_advanced(sender, **kwargs):
"- **AdvancedAt**: `{advanced_at}`\n"
),
)
sender_label = None
completed_by = kwargs.get('completed_by')
if completed_by:
emp = getattr(completed_by, 'employee', None)
sender_label = getattr(emp, 'name', None) if emp is not None else None
sender_label = sender_label or getattr(completed_by, 'username', None) or '系统自动发送'
else:
sender_label = '系统自动发送'
message = template.format(
printing_order_id=str(printing_order_id) if printing_order_id is not None else '-',
printing_job_id=str(printing_job_id) if printing_job_id is not None else '-',
state_name=str(state_name),
advanced_at=str(advanced_at),
sender=str(sender_label),
)
def _send_wecom():