mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
京东打印
This commit is contained in:
parent
67271b4461
commit
8cb668e4b6
@ -24,7 +24,6 @@ class BusinessOrderController extends Controller
|
|||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$shopIds = Shop::query()
|
$shopIds = Shop::query()
|
||||||
->where('plat_id', Shop::$PLAT_KTT)
|
|
||||||
->pluck('id');
|
->pluck('id');
|
||||||
$builder = BusinessOrder::query()
|
$builder = BusinessOrder::query()
|
||||||
->with([
|
->with([
|
||||||
@ -64,6 +63,7 @@ class BusinessOrderController extends Controller
|
|||||||
|
|
||||||
return Excel::download(new BusinessOrderExport($builder->get()->toArray()), $startDate . '~' . $endDate . "订单数据" . '.xlsx');
|
return Excel::download(new BusinessOrderExport($builder->get()->toArray()), $startDate . '~' . $endDate . "订单数据" . '.xlsx');
|
||||||
}
|
}
|
||||||
|
|
||||||
$businessOrders = $builder->orderByDesc('confirm_at')
|
$businessOrders = $builder->orderByDesc('confirm_at')
|
||||||
->paginate($request->get('per_page'));
|
->paginate($request->get('per_page'));
|
||||||
|
|
||||||
@ -179,12 +179,8 @@ class BusinessOrderController extends Controller
|
|||||||
|
|
||||||
public function print(Request $request)
|
public function print(Request $request)
|
||||||
{
|
{
|
||||||
$shopIds = Shop::query()
|
|
||||||
->where('plat_id', Shop::$PLAT_KTT)
|
|
||||||
->pluck('id');
|
|
||||||
$builder = BusinessOrder::query()
|
$builder = BusinessOrder::query()
|
||||||
->with('items')
|
->with('items')
|
||||||
->whereIn('shop_id', $shopIds)
|
|
||||||
->filter();
|
->filter();
|
||||||
$externalSkuIds = $request->get('external_sku_ids');
|
$externalSkuIds = $request->get('external_sku_ids');
|
||||||
|
|
||||||
|
|||||||
@ -6,9 +6,12 @@ use App\Models\BusinessGoodsSku;
|
|||||||
use App\Models\BusinessOrderItem;
|
use App\Models\BusinessOrderItem;
|
||||||
use App\Models\GoodsSku;
|
use App\Models\GoodsSku;
|
||||||
use App\Services\Business\BusinessClient;
|
use App\Services\Business\BusinessClient;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class MiaoXuan extends BusinessClient
|
class MiaoXuan extends BusinessClient
|
||||||
{
|
{
|
||||||
|
public $domain = "http://shop.dev.chutang66.com";
|
||||||
|
|
||||||
public function auth()
|
public function auth()
|
||||||
{
|
{
|
||||||
@ -54,7 +57,7 @@ class MiaoXuan extends BusinessClient
|
|||||||
$order->cancel_status = $queryOrder['cancel_status'];
|
$order->cancel_status = $queryOrder['cancel_status'];
|
||||||
$needUpdate = true;
|
$needUpdate = true;
|
||||||
}
|
}
|
||||||
if ($order->after_sales_status!= $queryOrder['after_sales_status']) {
|
if ($order->after_sales_status != $queryOrder['after_sales_status']) {
|
||||||
//售后状态更新
|
//售后状态更新
|
||||||
$order->after_sales_status = $queryOrder['after_sales_status'];
|
$order->after_sales_status = $queryOrder['after_sales_status'];
|
||||||
$needUpdate = true;
|
$needUpdate = true;
|
||||||
@ -100,7 +103,19 @@ class MiaoXuan extends BusinessClient
|
|||||||
|
|
||||||
public function createLogistic($orderSn, $waybillNo)
|
public function createLogistic($orderSn, $waybillNo)
|
||||||
{
|
{
|
||||||
// TODO: Implement createLogistic() method.
|
$path = "/miaoxuan/ship";
|
||||||
|
$url = $this->domain . $path;
|
||||||
|
$appendParams = [
|
||||||
|
"data" => [
|
||||||
|
"order_sn" => $orderSn,
|
||||||
|
"ship_sn" => $waybillNo,
|
||||||
|
"ship_time" => Carbon::now()->toDateTimeString(),
|
||||||
|
"company_code" => "JD",
|
||||||
|
],
|
||||||
|
"type"=>"miaoxuan.ship"
|
||||||
|
];
|
||||||
|
$res =$this->formDataPostRequest($url, $appendParams);
|
||||||
|
Log::info("同步物流发货信息".$orderSn,[$res,$appendParams]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancelLogistic($orderSn, $waybillNo)
|
public function cancelLogistic($orderSn, $waybillNo)
|
||||||
|
|||||||
@ -5,6 +5,7 @@ namespace App\Services\WayBill\JingDong;
|
|||||||
use App\Events\CreateLogisticEvent;
|
use App\Events\CreateLogisticEvent;
|
||||||
use App\Http\Enum\BusinessOrderShippingStatus;
|
use App\Http\Enum\BusinessOrderShippingStatus;
|
||||||
use App\Models\BusinessOrder;
|
use App\Models\BusinessOrder;
|
||||||
|
use App\Models\BusinessOrderItem;
|
||||||
use App\Models\GoodsSku;
|
use App\Models\GoodsSku;
|
||||||
use App\Models\ShopSender;
|
use App\Models\ShopSender;
|
||||||
use App\Models\ShopShip;
|
use App\Models\ShopShip;
|
||||||
@ -46,6 +47,7 @@ class WayBillService
|
|||||||
$waybill->status = Waybill::$STATUS_CREATE_WAYBILL_CODE;
|
$waybill->status = Waybill::$STATUS_CREATE_WAYBILL_CODE;
|
||||||
$waybill->waybill_code = $resp['waybillNo'];
|
$waybill->waybill_code = $resp['waybillNo'];
|
||||||
$waybill->save();
|
$waybill->save();
|
||||||
|
|
||||||
//物流发货
|
//物流发货
|
||||||
event(new CreateLogisticEvent($waybill->shop_id, $waybill->order_sn, $waybill->waybill_code));
|
event(new CreateLogisticEvent($waybill->shop_id, $waybill->order_sn, $waybill->waybill_code));
|
||||||
}
|
}
|
||||||
@ -126,7 +128,7 @@ class WayBillService
|
|||||||
$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'];
|
||||||
$waybill->participate_no = $order['participate_no'];
|
$waybill->participate_no = $order['participate_no'] ?? 0;
|
||||||
$waybill->note = $order['note'];
|
$waybill->note = $order['note'];
|
||||||
$waybill->items = json_encode($order['items'], 256);
|
$waybill->items = json_encode($order['items'], 256);
|
||||||
$waybill->save();
|
$waybill->save();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user