forked from erp-dev/erp
feat: notification sending for printing order created
This commit is contained in:
@@ -12,8 +12,9 @@ class PrintingConfig(AppConfig):
|
||||
def ready(self):
|
||||
"""注册信号处理函数"""
|
||||
from stateflow.signals import process_completed, state_advanced
|
||||
from .models import PrintingJob
|
||||
from .models import PrintingJob, PrintingOrder
|
||||
from . import handlers
|
||||
from .signals import printing_order_created
|
||||
|
||||
# 监听 PrintingJob 流程完成信号
|
||||
process_completed.connect(
|
||||
@@ -26,6 +27,13 @@ class PrintingConfig(AppConfig):
|
||||
handlers.on_printing_job_state_advanced,
|
||||
sender=PrintingJob
|
||||
)
|
||||
|
||||
# 监听 PrintingOrder 创建事件(领域 signal)
|
||||
printing_order_created.connect(
|
||||
handlers.on_printing_order_created,
|
||||
sender=PrintingOrder,
|
||||
dispatch_uid="printing.on_printing_order_created",
|
||||
)
|
||||
|
||||
logger.info(
|
||||
f'[printing.apps] 已注册 process_completed 信号处理器, '
|
||||
@@ -34,4 +42,8 @@ class PrintingConfig(AppConfig):
|
||||
logger.info(
|
||||
f'[printing.apps] 已注册 state_advanced 信号处理器, '
|
||||
f'sender={PrintingJob}, handler={handlers.on_printing_job_state_advanced}'
|
||||
)
|
||||
logger.info(
|
||||
f'[printing.apps] 已注册 printing_order_created 信号处理器, '
|
||||
f'sender={PrintingOrder}, handler={handlers.on_printing_order_created}'
|
||||
)
|
||||
Reference in New Issue
Block a user