Browse Source

Merge branch 'zhongqi-delivery' of git.huaml.com:zhh/huahuibao into zhongqi-delivery

shizhongqi 8 months ago
parent
commit
934bc54405

+ 2 - 2
app-ghs/controllers/OrderController.php

@@ -161,8 +161,8 @@ class OrderController extends BaseController
         if ($order->status == 5) {
             util::fail('订单已取消');
         }
-        if (!in_array($order->sendStatus, [-1, -4])){
-            util::fail('已使用跑腿配送');
+        if (!in_array($order->sendStatus, [-1, -4, -2])) {
+            util::fail('已经叫跑腿了');
         }
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();

+ 44 - 0
common/components/delivery/platform/shunfeng/CallBackHandler.php

@@ -485,4 +485,48 @@ class CallBackHandler
 
         return '未知';
     }
+
+    private function cancelFrom($sendStatus, $cancelCode = 0)
+    {
+        if($sendStatus == -1){
+            $reasons = [
+                100 => '误操作,抢错订单',
+                101 => '订单距离太远',
+                102 => '餐箱已满,无法配送',
+                103 => '物品过大无法配送',
+                104 => '联系不上寄件人',
+                105 => '寄方无法提供待配送物品(缺货/出餐慢/已配送等)',
+                106 => '寄方要求取消(暂时不需要寄件了/重复发单/信息有误)',
+                107 => '配送车辆故障',
+                108 => '其他,请注明原因',
+                303 => '骑士要求取消',
+                310 => '超出配送范围',
+                500 => '15分钟无人接单',
+                501 => '不兜底订单自动取消',
+                502 => '超期望送达8小时未完成',
+            ];
+            return $reasons[$cancelCode] ?? '未知';
+        }
+
+        if($sendStatus == -2){
+            $exIds = [
+                1001 => '商家出货慢',
+                1007 => '更改取货地址',
+                2001 => '顾客电话无法接通',
+                2004 => '更改期望送达时间',
+                2005 => '顾客拒收',
+                2008 => '顾客不在家',
+                2009 => '更改送货地址',
+                2010 => '顾客拒绝实名认证',
+                2013 => '无法联系用户,退回寄件人',
+                3004 => '实名认证校验失败',
+                4001 => '配送地址错误',
+                4002 => '其他',
+                4003 => '托寄物丢失或损坏',
+            ];
+            return $exIds[$cancelCode] ?? '未知';
+        }
+
+        return '未知';
+    }
 }

+ 2 - 2
common/components/rabbitmq/notifyConsumer.php

@@ -86,7 +86,7 @@ class notifyConsumer implements ConsumerInterface
         $order = OrderClass::getById($orderId, true);
         if (!empty($order)) {
             $sendNum = $order->sendNum ?? '';
-            $result = $event . ',取货号' . $sendNum;
+            $result = $event . ',取货号 ' . $sendNum;
             $customName = $order->customName ?? '';
             $shopId = $order->shopId ?? '';
             $shop = ShopClass::getById($shopId, true);
@@ -104,7 +104,7 @@ class notifyConsumer implements ConsumerInterface
         $order = \bizHd\order\classes\OrderClass::getById($orderId, true);
         if (!empty($order)) {
             $sendNum = $order->sendNum ?? '';
-            $result = $event . ',取货号' . $sendNum;
+            $result = $event . ',取货号 ' . $sendNum;
             $customName = $order->customName ?? '';
             $shopId = $order->shopId ?? '';
             $shop = ShopClass::getById($shopId, true);