shish 7 сар өмнө
parent
commit
06ebbaf37f

+ 19 - 0
common/components/rabbitmq/notifyConsumer.php

@@ -61,6 +61,7 @@ class notifyConsumer implements ConsumerInterface
                     break;
                 case 'hd_pt_error':
                     //花店跑腿异常通知
+                    $result = $this->hdPtErrorAction($data);
                     break;
                 default:
                     noticeUtil::push("通知的消费者提示:Unknown notify type: {$type}", '15280215347');
@@ -96,6 +97,24 @@ class notifyConsumer implements ConsumerInterface
         return true;
     }
 
+    private function hdPtErrorAction($data)
+    {
+        $orderId = $data['orderId'] ?? 0;
+        $event = $data['event'] ?? '';
+        $order = \bizHd\order\classes\OrderClass::getById($orderId, true);
+        if (!empty($order)) {
+            $sendNum = $order->sendNum ?? '';
+            $result = $event . ',取货号:' . $sendNum;
+            $customName = $order->customName ?? '';
+            $shopId = $order->shopId ?? '';
+            $shop = ShopClass::getById($shopId, true);
+            if (!empty($shop)) {
+                WxMessageClass::expressErrorInform($shop, $customName, $orderId, $result);
+            }
+        }
+        return true;
+    }
+
     private function ghsNewOrderNotify($data)
     {
         $orderId = $data['orderId'] ?? 0;