Переглянути джерело

Merge branch 'zhongqi-delivery'

shizhongqi 7 місяців тому
батько
коміт
480367ee91

+ 5 - 2
common/components/delivery/services/DispatchService.php

@@ -1006,12 +1006,15 @@ class DispatchService
                     $serviceType = [0 => '拼送', 1 => '直送'];
 
                     foreach($item['estimateList'] as $arr) {
+                        $serType = $arr['serviceType'] ?? null;
+                        $type = empty($serType) ? '' : $serviceType[$serType];
+
                         $deliveryList[] = [
-                            'name' => '滴滴' . ' (' . $this->adapters['didi']->carType($arr['carType']) . ')',
+                            'name' => '滴滴' . ' (' . $this->adapters['didi']->carType($arr['carType'])  . $type . ')',
                             'en_name' => 'didi',
                             'price' => $arr['fee'],
                             'distance' => $arr['distance'],
-                            'type' => $serviceType[$arr['serviceType']], //服务商或车型名称
+                            'type' => $type, //服务商或车型名称
                             'isAble' => true,
                             // ---------------------------------------------
                             'estimateId' => $arr['estimateId'],

+ 17 - 1
common/components/delivery/services/adapter/DidiAdapter.php

@@ -71,6 +71,19 @@ class DidiAdapter extends Didi implements Adapter
                 'serviceLevel' => 0,
                 'serviceType' => 0,  // 服务类型(快送专用,拉货不需要传) -- 拼送
             ],
+            // 普通货运业务类型
+            [
+                'bizType' => 0,     // 业务类型 -- 普通货运
+                'carType' => 1012,   // 车型 -- 微面
+                'serviceLevel' => 0, // 服服务等级
+                //'serviceType' => 1,
+            ],
+            [
+                'bizType' => 0,     // 业务类型 -- 普通货运
+                'carType' => 1001,   // 车型 -- 小面包
+                'serviceLevel' => 0, // 服服务等级
+                //'serviceType' => 1,
+            ],
         ];
         // 如果是预约单,则使用以下 拉货(普通货运)
         $laHuo_serviceCategoryList = [
@@ -156,12 +169,15 @@ class DidiAdapter extends Didi implements Adapter
         $payload = $this->buildRequestPayload($businessParams);
         $apiUrl = $this->getApiUrl('freight.open.platform.channel.standard.estimate');
 
-        return [
+        $request = [
             'url' => $apiUrl,
             'data' => $payload,
             'headers' => ["Content-Type" => "application/x-www-form-urlencoded"],
             'timeout' => 10.0,
         ];
+
+        //Yii::info('滴滴构建运费报价请求信息 -- ' .json_encode($request, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
+        return $request;
     }
 
     /**

+ 4 - 1
common/components/delivery/services/adapter/ShunfengAdapter.php

@@ -444,12 +444,15 @@ class ShunfengAdapter extends Shunfeng implements Adapter
         // 计算签名(SignHelper 会自动递归过滤空值)
         $sign = $this->generateSignature($payload);
 
-        return [
+        $request = [
             'url' => $this->baseUrl . 'precreateorder?sign=' .  $sign,
             'data' => $payload,
             'headers' => ["Content-Type" => "application/json"],
             'timeout' => 10.0,
         ];
+
+        Yii::info('顺丰构建运费报价请求信息 -- ' .json_encode($request, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
+        return $request;
     }
 
     public function addTip($data)