shish 2 jaren geleden
bovenliggende
commit
5b508d356d
2 gewijzigde bestanden met toevoegingen van 7 en 7 verwijderingen
  1. 2 2
      biz-ghs/order/classes/OrderClass.php
  2. 5 5
      common/components/printUtil.php

+ 2 - 2
biz-ghs/order/classes/OrderClass.php

@@ -1326,7 +1326,7 @@ class OrderClass extends BaseClass
         $customId = $orderInfo['customId'] ?? 0;
         $c = CustomClass::getById($customId);
         $debtAmount = $c['debtAmount'] ?? 0.00;
-
+        $orderSn = $orderInfo['orderSn'] ?? '';
         $shopId = $orderInfo['shopId'] ?? 0;
         $shop = ShopClass::getById($shopId, true);
         if (empty($shop)) {
@@ -1560,7 +1560,7 @@ class OrderClass extends BaseClass
         $printSn = $ext['printSn'] ?? '';
         if (!empty($printSn)) {
             $p = new printUtil($printSn);
-            $p->printMsg($content, $shop);
+            $p->printMsg($content, $shop, $orderSn);
         }
     }
 

+ 5 - 5
common/components/printUtil.php

@@ -47,7 +47,7 @@ class printUtil
         }
     }
 
-    public function printMsg($content, $shop = null)
+    public function printMsg($content, $shop = null, $orderSn = '')
     {
         $time = time();         //请求时间
         $msgInfo = array(
@@ -60,9 +60,9 @@ class printUtil
             'times' => $this->times//打印次数
         );
         $client = new \HttpClient(self::IP, self::PORT);
-        if (!$client->post(self::PATH, $msgInfo)) {
+        //if (!$client->post(self::PATH, $msgInfo)) {
             //echo 'error';
-        } else {
+        //} else {
             //服务器返回的JSON字符串,建议要当做日志记录起来
             $result = $client->getContent();
             Yii::info('打印日志:' . $result);
@@ -72,7 +72,7 @@ class printUtil
                 $sjName = $shop->merchantName ?? '';
                 $mainId = $shop->mainId ?? 0;
                 $shopName = $shop->shopName ?? '';
-                noticeUtil::push($sjName . ' ' . $shopName . '有订单打印未成功,报错内容:' . $msg, '15280215347');
+                noticeUtil::push($sjName . $shopName . "出现订单打印未成功{$orderSn},报错内容:" . $msg, '15280215347');
                 $staffList = ShopAdminClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
                 if (!empty($staffList)) {
                     foreach ($staffList as $staff) {
@@ -87,7 +87,7 @@ class printUtil
                     }
                 }
             }
-        }
+        //}
     }
 
     public function signature($time)