|
|
@@ -309,17 +309,21 @@ class DispatchService
|
|
|
$adapter = $this->adapters['shunfeng'];
|
|
|
// is_person_direct -- 店铺是否支持专人直送,0不支持 1支持 2只能发独享专送
|
|
|
$isPersonDirect = $adapter->getIsPersonDirect();
|
|
|
- if($isPersonDirect != 2){
|
|
|
- //$customSettings = $this->adapters['shunfeng']->getCustomSettings();
|
|
|
- $customSettings = [];//自定义用户设置:默认不专人直送
|
|
|
- $preparedData['shunfeng'] = $this->prepareShunfengData($order, $shop, $customSettings);
|
|
|
- }
|
|
|
+ if($isPersonDirect != 2){
|
|
|
+ $customSettings = [];//自定义用户设置:默认不专人直送
|
|
|
+ $preparedData['shunfeng'] = $this->prepareShunfengData($order, $shop, $customSettings);
|
|
|
+ }
|
|
|
|
|
|
//添加专人直送的订单数据
|
|
|
- if(in_array($isPersonDirect, [1, 2])){
|
|
|
+ if(in_array($isPersonDirect, [1, 2])){ // 支持专人直送
|
|
|
$customSettings = ['isPersonDirect' => 1];//自定义用户设置:专人直送
|
|
|
$preparedData['shunfeng_1v1'] = $this->prepareShunfengData($order, $shop, $customSettings);
|
|
|
+ Yii::info('预创建订单 shunfeng_1v1 request data: ' . json_encode($preparedData['shunfeng_1v1']));
|
|
|
}
|
|
|
+ // else{
|
|
|
+ // $customSettings = [];//自定义用户设置:默认不专人直送
|
|
|
+ // $preparedData['shunfeng'] = $this->prepareShunfengData($order, $shop, $customSettings);
|
|
|
+ // }
|
|
|
} catch (\Exception $e) {
|
|
|
Yii::warning("Shunfeng 数据准备失败: {$e->getMessage()}");
|
|
|
}
|
|
|
@@ -551,25 +555,26 @@ class DispatchService
|
|
|
'user_lat' => (string)$order['lat'], // 用户地址纬度
|
|
|
'user_address' => $order['fullAddress'], // 用户详细地址
|
|
|
'weight' => $order['weight'] * 1000, // 物品重量(单位:克)
|
|
|
- 'product_type' => 4, // 物品类型(4:鲜花绿植)
|
|
|
+ 'product_type' => 14, // 物品类型(14:鲜花)
|
|
|
'push_time' => time(), // 推单时间(秒级时间戳)
|
|
|
- 'shop' => [ // 发货店铺信息
|
|
|
- 'shop_name' => $shop['merchantName'], // 店铺名称
|
|
|
- 'shop_address' => $shop['address'], // 店铺地址
|
|
|
- 'shop_lng' => (string)$shop['long'], // 店铺经度
|
|
|
- 'shop_lat' => (string)$shop['lat'], // 店铺纬度
|
|
|
- 'shop_phone' => $shop['mobile'], // 店铺联系电话
|
|
|
- ],
|
|
|
+ //shop 平台级开发者需要传入
|
|
|
+ // 'shop' => [ // 发货店铺信息
|
|
|
+ // 'shop_name' => $shop['merchantName'], // 店铺名称
|
|
|
+ // 'shop_address' => $shop['fullAddress'], // 店铺地址
|
|
|
+ // 'shop_lng' => (string)$shop['long'], // 店铺经度
|
|
|
+ // 'shop_lat' => (string)$shop['lat'], // 店铺纬度
|
|
|
+ // 'shop_phone' => $shop['mobile'], // 店铺联系电话
|
|
|
+ // ],
|
|
|
//-------------------------- 非必填 -------------------------------
|
|
|
'city_name' => $order['city'], // 发单城市
|
|
|
//'order_source' => '6', // 订单接入来源(6:京东秒送,可自定义)
|
|
|
'source_origin_order_id' => $order['orderSn'], // 商流订单号
|
|
|
'total_price' => (int)($order['actPrice'] * 100), // 用户订单总金额(单位:分)
|
|
|
'is_appoint' => 0, // 是否预约单(0:非预约单)
|
|
|
- 'appoint_type' => 0, // TODO 预约单类型(0:立即单)
|
|
|
- 'expect_time' => 0, // TODO 用户期望送达时间
|
|
|
- //'expect_pickup_time' => 0, // TODO 用户期望上门时间 -- appoint_type=2时需必传,秒级时间戳
|
|
|
- 'shop_expect_time' => 0, // TODO 商家期望送达时间 -- 格式为:{timestamp},
|
|
|
+ //'appoint_type' => 0, // 预约单的时候传入,1:预约送达单;2:预约上门单
|
|
|
+ //'expect_pickup_time' => 0, // TODO 用户期望上门时间 -- appoint_type=2时需必传,秒级时间戳
|
|
|
+ //'expect_time' => 0, // TODO 用户期望送达时间
|
|
|
+ //'shop_expect_time' => 0, // TODO 商家期望送达时间 -- 格式为:{timestamp},
|
|
|
'lbs_type' => 2, // 坐标类型(2:高德坐标)
|
|
|
'is_insured' => 0, // 是否保价(0:非保价)
|
|
|
'is_person_direct' => $customSettings['isPersonDirect'] ?? 0, // 是否专人直送(0:否 1:是)
|