feat: #10000 更新
This commit is contained in:
parent
80fa23f2d3
commit
6380543412
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Events\CreateLogisticEvent;
|
||||||
use App\Events\StockUpdateEvent;
|
use App\Events\StockUpdateEvent;
|
||||||
use App\Exports\DiffTodayPriceGoodsExport;
|
use App\Exports\DiffTodayPriceGoodsExport;
|
||||||
use App\Models\BusinessGoodsSku;
|
use App\Models\BusinessGoodsSku;
|
||||||
|
|||||||
@ -265,11 +265,22 @@ class KuaiTuanTuan extends BusinessClient
|
|||||||
|
|
||||||
public function createLogistic($orderSn, $waybillNo)
|
public function createLogistic($orderSn, $waybillNo)
|
||||||
{
|
{
|
||||||
return Order::createOrderLogistic($orderSn, $waybillNo);
|
[$type, $appendParams] = Order::createOrderLogistic($orderSn, $waybillNo);
|
||||||
|
|
||||||
|
return $this->doRequest($type, $appendParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancelLogistic($orderSn, $waybillNo)
|
public function cancelLogistic($orderSn, $waybillNo)
|
||||||
{
|
{
|
||||||
return Order::deleteOrderLogistic($orderSn, $waybillNo);
|
[$type, $appendParams] = Order::deleteOrderLogistic($orderSn, $waybillNo);
|
||||||
|
|
||||||
|
return $this->doRequest($type, $appendParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLogisticsCompanies()
|
||||||
|
{
|
||||||
|
[$type, $appendParams] = Order::getLogisticsCompanies();
|
||||||
|
|
||||||
|
return $this->doRequest($type, $appendParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class Order
|
|||||||
return [$type, $appendParams];
|
return [$type, $appendParams];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLogisticsCompanies()
|
public static function getLogisticsCompanies()
|
||||||
{
|
{
|
||||||
$type = 'pdd.logistics.companies.get';
|
$type = 'pdd.logistics.companies.get';
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ class Order
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function createOrderLogistic($orderSn, $waybillNo, $logisticsId = '', $logisticsName = '')
|
public static function createOrderLogistic($orderSn, $waybillNo, $logisticsId = 44, $logisticsName = '顺丰快递')
|
||||||
{
|
{
|
||||||
// 不支持拆单发货
|
// 不支持拆单发货
|
||||||
$type = 'pdd.ktt.order.logistic.create';
|
$type = 'pdd.ktt.order.logistic.create';
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class WayBillService
|
|||||||
'participate_no' => $waybill->participate_no,
|
'participate_no' => $waybill->participate_no,
|
||||||
'note' => $waybill->note,
|
'note' => $waybill->note,
|
||||||
];
|
];
|
||||||
event(new CreateLogisticEvent($shopId, $waybill->order_sn, $data['waybill_code']));
|
event(new CreateLogisticEvent($shopShip->shop_id, $waybill->order_sn, $data['waybill_code']));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$contents[$waybill->id] = [
|
$contents[$waybill->id] = [
|
||||||
@ -116,13 +116,13 @@ class WayBillService
|
|||||||
return [$documents, $orderIds];
|
return [$documents, $orderIds];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function saveWayBill($order, $shop, $senderConfig)
|
private function saveWayBill($order, $shopShip, $senderConfig)
|
||||||
{
|
{
|
||||||
$waybill = Waybill::query()->firstOrNew(
|
$waybill = Waybill::query()->firstOrNew(
|
||||||
['order_sn' => $order['order_sn']]
|
['order_sn' => $order['order_sn']]
|
||||||
);
|
);
|
||||||
|
|
||||||
$waybill->shop_id = $shop->shop_id;
|
$waybill->shop_id = $shopShip->shop_id;
|
||||||
$waybill->object_id = $this->objectId;
|
$waybill->object_id = $this->objectId;
|
||||||
|
|
||||||
$waybill->sender_country = $senderConfig['country'];
|
$waybill->sender_country = $senderConfig['country'];
|
||||||
@ -140,7 +140,7 @@ class WayBillService
|
|||||||
$waybill->recipient_name = $order['recipient_name'];
|
$waybill->recipient_name = $order['recipient_name'];
|
||||||
$waybill->recipient_mobile = $order['recipient_mobile'];
|
$waybill->recipient_mobile = $order['recipient_mobile'];
|
||||||
|
|
||||||
$waybill->user_id = $shop->owner_id;
|
$waybill->user_id = $shopShip->owner_id;
|
||||||
$waybill->wp_code = $senderConfig['wp_code'];
|
$waybill->wp_code = $senderConfig['wp_code'];
|
||||||
$waybill->order_sn = $order['order_sn'];
|
$waybill->order_sn = $order['order_sn'];
|
||||||
$waybill->order_id = $order['id'];
|
$waybill->order_id = $order['id'];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user