| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace biz\common\classes;
- use biz\base\classes\BaseClass;
- use common\components\noticeUtil;
- use Yii;
- class GhsNotifyClass extends BaseClass
- {
- //供货商新订单通知 ssh 20251202
- public static function newOrderNotify($orderId)
- {
- try {
- $producer = Yii::$app->rabbitmq->getProducer('notifyProducer');
- $msg = serialize(['type' => 'ghs_new_order_notify', 'orderId' => $orderId]);
- $producer->publish($msg, 'notifyExchange', 'notifyRoute', ['delivery_mode' => 2, 'content_type' => 'application/octet-stream']);
- } catch (\Exception $e) {
- $msg = $e->getMessage();
- $remind = "批发,新订单通知,生产消息端报错 {$orderId} {$msg}";
- noticeUtil::push($remind, '15280215347');
- }
- }
- //跑腿异常通知
- public static function ptErrorNotify($orderId, $event)
- {
- try {
- $producer = Yii::$app->rabbitmq->getProducer('notifyProducer');
- $msg = serialize(['type' => 'ghs_pt_error', 'orderId' => $orderId, 'event' => $event]);
- $producer->publish($msg, 'notifyExchange', 'notifyRoute', ['delivery_mode' => 2, 'content_type' => 'application/octet-stream']);
- } catch (\Exception $e) {
- $msg = $e->getMessage();
- $remind = "批发,跑腿异常通知,生产消息端报错 {$orderId} {$msg}";
- noticeUtil::push($remind, '15280215347');
- }
- }
- }
|