Parcourir la source

采购和通知

shish il y a 8 mois
Parent
commit
2bdbffc183
1 fichiers modifiés avec 25 ajouts et 13 suppressions
  1. 25 13
      app-hd/controllers/NoticeController.php

+ 25 - 13
app-hd/controllers/NoticeController.php

@@ -2,6 +2,7 @@
 
 namespace hd\controllers;
 
+use biz\common\classes\GhsNotifyClass;
 use biz\shop\classes\ShopClass;
 use bizGhs\custom\classes\CustomClass;
 use bizGhs\custom\classes\CustomRechargeClass;
@@ -9,6 +10,7 @@ use bizGhs\order\classes\OrderClearClass;
 use bizGhs\order\classes\RefundOrderClass;
 use bizHd\cg\classes\CgRefundClass;
 use bizHd\ghs\classes\GhsClass;
+use bizHd\notice\classes\NoticeClass;
 use bizHd\purchase\classes\PurchaseClass;
 use bizHd\purchase\classes\PurchaseClearClass;
 use bizHd\wx\classes\WxOpenClass;
@@ -236,7 +238,7 @@ class NoticeController extends PublicController
                         $cgShopId = $cg->shopId ?? 0;
                         $cgShop = ShopClass::getById($cgShopId, true);
                         if (!empty($cgShop)) {
-                            \bizHd\notice\classes\NoticeClass::cgSuccessMiniNotice($cgShop, $cg);
+                            NoticeClass::cgSuccessMiniNotice($cgShop, $cg);
                         }
                         //如果是门店用手机开单,让客户扫码付款的,则也要语音提示
                         if (isset($order->shopAdminId) && $order->shopAdminId > 0) {
@@ -245,10 +247,14 @@ class NoticeController extends PublicController
                         $shopId = $order->shopId ?? 0;
                         $shop = ShopClass::getById($shopId, true);
                         if (!empty($shop)) {
+
                             //花店采购,供货商端微信收到通知
-                            $noticeText = json_encode(['orderId' => $saleId]);
-                            $noticeKey = "hdCgNoticeGhs";
-                            Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
+//                            $noticeText = json_encode(['orderId' => $saleId]);
+//                            $noticeKey = "hdCgNoticeGhs";
+//                            Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
+
+                            GhsNotifyClass::newOrderNotify($saleId);
+
                         }
                     }
                 }
@@ -459,7 +465,7 @@ class NoticeController extends PublicController
                         $cgShopId = $cg->shopId ?? 0;
                         $cgShop = ShopClass::getById($cgShopId, true);
                         if (!empty($cgShop)) {
-                            \bizHd\notice\classes\NoticeClass::cgSuccessMiniNotice($cgShop, $cg);
+                            //NoticeClass::cgSuccessMiniNotice($cgShop, $cg);
                         }
                         //如果是门店用手机开单,让客户扫码付款的,则也要语音提示
                         if (isset($order->shopAdminId) && $order->shopAdminId > 0) {
@@ -470,9 +476,11 @@ class NoticeController extends PublicController
                         if (!empty($shop)) {
                             //花店采购供货商端微信收到通知
                             //WxMessageClass::ghsHasNewOrderInform($shop, $order);
-                            $noticeText = json_encode(['orderId' => $saleId]);
-                            $noticeKey = "hdCgNoticeGhs";
-                            Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
+//                            $noticeText = json_encode(['orderId' => $saleId]);
+//                            $noticeKey = "hdCgNoticeGhs";
+//                            Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
+
+                            GhsNotifyClass::newOrderNotify($saleId);
 
                             //向供货商APP发通知
 //                            $cgShop = ShopClass::getById($cg->shopId, true, 'shopName, merchantName');
@@ -595,7 +603,7 @@ class NoticeController extends PublicController
                         $cgShopId = $cg->shopId ?? 0;
                         $cgShop = ShopClass::getById($cgShopId, true);
                         if (!empty($cgShop)) {
-                            \bizHd\notice\classes\NoticeClass::cgSuccessMiniNotice($cgShop, $cg);
+                            //NoticeClass::cgSuccessMiniNotice($cgShop, $cg);
                         }
                         //如果是门店用手机开单,让客户扫码付款的,则也要语音提示
                         if (isset($order->shopAdminId) && $order->shopAdminId > 0) {
@@ -606,9 +614,11 @@ class NoticeController extends PublicController
                         if (!empty($shop)) {
                             //花店采购供货商端微信收到通知
                             //WxMessageClass::ghsHasNewOrderInform($shop, $order);
-                            $noticeText = json_encode(['orderId' => $saleId]);
-                            $noticeKey = "hdCgNoticeGhs";
-                            Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
+//                            $noticeText = json_encode(['orderId' => $saleId]);
+//                            $noticeKey = "hdCgNoticeGhs";
+//                            Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
+
+                            GhsNotifyClass::newOrderNotify($saleId);
 
                             //向供货商端APP发通知
 //                            $cgShop = ShopClass::getById($cg->shopId, true, 'shopName, merchantName');
@@ -842,7 +852,7 @@ class NoticeController extends PublicController
                             $cgShopId = $cg->shopId ?? 0;
                             $cgShop = ShopClass::getById($cgShopId, true);
                             if (!empty($cgShop)) {
-                                \bizHd\notice\classes\NoticeClass::cgSuccessMiniNotice($cgShop, $cg);
+                                NoticeClass::cgSuccessMiniNotice($cgShop, $cg);
                             }
                             $shopId = $order->shopId ?? 0;
                             $shop = ShopClass::getById($shopId, true);
@@ -853,6 +863,8 @@ class NoticeController extends PublicController
                                 $noticeKey = "hdCgNoticeGhs";
                                 Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
 
+                                GhsNotifyClass::newOrderNotify($saleId);
+
                                 //向供货商端APP发通知
 //                                $cgShop = ShopClass::getById($cg->shopId, true, 'shopName, merchantName');
 //                                $push = new push('ghs', push::MSG_TYPE_ORDER);