新增api通知处方生成功能

This commit is contained in:
2025-03-06 17:11:45 +08:00
parent baa9a34e5e
commit cf169fb514
2 changed files with 48 additions and 11 deletions

View File

@@ -701,7 +701,6 @@ class PrescriptionController extends BaseAppController
public function actionNotifyOrderGeneration()
{
return ['测试'];
$param = \Yii::$app->request->post();
$this->requestValidate($param, [
['prescription', 'required'],
@@ -709,18 +708,18 @@ class PrescriptionController extends BaseAppController
]);
$prescription = $param['prescription'];
$productOrder = $param['product_order'];
// //触发处方自动失效事件
// $prescriptionEvent = new PrescriptionEvent();
// $prescriptionEvent->prescription = $prescription;
// $prescriptionEvent->sender = $this;
// \Yii::$app->trigger(Prescription::AUTO_EXPIRE, $prescriptionEvent);
//触发处方自动失效事件
$prescriptionEvent = new PrescriptionEvent();
$prescriptionEvent->prescription = $prescription;
$prescriptionEvent->sender = $this;
\Yii::$app->trigger(Prescription::AUTO_EXPIRE, $prescriptionEvent);
//触发订单创建事件
// $event = new ProductOrderEvent();
// $event->order = $productOrder;
// $event->sender = $this;
// \Yii::$app->trigger(ProductOrder::EVENT_CREATED, $event);
$event = new ProductOrderEvent();
$event->order = $productOrder;
$event->sender = $this;
\Yii::$app->trigger(ProductOrder::EVENT_CREATED, $event);
//处方开具待支付订阅消息通知
\Yii::$app->queue->push(new PrescriptionCreated([