Procházet zdrojové kódy

风速订单拆分

dong025 před 4 dny
rodič
revize
d5556e16fb
2 změnil soubory, kde provedl 22 přidání a 13 odebrání
  1. 20 11
      app/admin/command/FengSu.php
  2. 2 2
      app/admin/service/FengsuService.php

+ 20 - 11
app/admin/command/FengSu.php

@@ -79,6 +79,7 @@ class FengSu extends Command
 
 
                 $list = $resquet['data']['list'];
+                // dump($list);
                 // return;
                 $this->insertOrder($list);
                 //dump($resquet);
@@ -181,26 +182,33 @@ class FengSu extends Command
         //     'goodsFlag'    => 2
         // ];
         $body = [
-            'goodType' => 2,
+            'startTime' =>$startTime,
+            // 'startTime' =>'2026-01-03 00:23:00',
+            'endTime' => $endTime,
+            // 'endTime' => '2026-01-07 23:30:00',
             'current' => $pageNum,
+            // 'current' => 1,
+            
+            'goodType' => 2,
+            'goodsFlag' => 1,
+            'orderPrefixSelect' => 'waybillNos',
+            'prepareShip'=>0,
             'size' => 50,
             'sort' => 'CONSIGN_TIME',
-            'sortAsc' => false,
-            'tradeStatus' => 4,
-            'orderPrefixSelect' => 'waybillNos',
+            'sortAsc' => true,
+            
             'timeType' => 2,
+            'tradeStatus' => 2,
             'skuOuterIdExact' => false,
             'skuPropExact' => false,
-            'startTime' =>$startTime,
-            'endTime' => $endTime,
-            'goodsFlag' => 1,
-            'tradeSources' => [],
-            'prepareShip' => 0
+            'tradeSources' => []
         ];
             // 'waybillNos'   => ['73589756512463']
         $body = json_encode($body);
         
         $request = new Request('POST', 'https://fsdy2.fengsutb.com/amount/ship-list-new', $headers, $body);
+        // $request = new Request('POST', 'https://fsdy2.fengsutb.com/trade/print-list', $headers, $body);
+        
         $res = $client->sendAsync($request)->wait();
         $json = [];
         if ($res->getStatusCode() == 200) {
@@ -227,7 +235,7 @@ class FengSu extends Command
             $goods_id = $item['tradeOrderPrintVos'][0]['goodsId'];
             $oid = $item['tradeOrderPrintVos'][0]['oid'];
             $sku_id = $item['tradeOrderPrintVos'][0]['skuId'];
-            $waybill_no = $item['waybillNo'];
+            $waybill_no = $item['tradeOrderPrintVos'][0]['waybillNo'];
             if (empty($waybill_no)) continue;
             $add_status = JuShuiTanService::prevent_duplicate_additions($sku_id, $waybill_no);
             if ($add_status) continue;
@@ -257,7 +265,7 @@ class FengSu extends Command
                 'city'          => $item['receiverCity'],
                 'company_name'  => $item['companyName'],
                 'waybill_no'    => $waybill_no,
-                'consign_time'  => $item['consignTime'],
+                'consign_time'  => $item['tradeOrderPrintVos'][0]['consignTime'],
                 'goods_id'      => $goods_id,
                 'sku_id'        => $item['tradeOrderPrintVos'][0]['skuId'],
                 'num'           => $item['tradeOrderPrintVos'][0]['total'],
@@ -276,6 +284,7 @@ class FengSu extends Command
 
             ];
         }
+        // dump($queue);
         // 保存到数据库
         $shopDelivery->saveAll($shopDelivery_list);
         (new ImportList())->saveAll($queue);

+ 2 - 2
app/admin/service/FengsuService.php

@@ -91,10 +91,10 @@ class FengsuService {
                         'price'         => $box->price??0,
                         'total_price'   => bcmul((string)$box->price, (string)$item['tradeOrderPrintVos'][0]['total'], 2),
                         'company_name'  => $item['tradeOrderPrintVos'][0]['companyName'],
-                        'waybill_no'    => $item['waybillNo'],
+                        'waybill_no'    => $item['tradeOrderPrintVos'][0]['waybillNo'],
                         'region'        => $item['receiverProvince'].' '.$item['receiverCity'],
                         'other_price'   => $other_price,
-                        'ship_date'     => $item['consignTime'],
+                        'ship_date'     => $item['tradeOrderPrintVos'][0]['consignTime'],
                         'incubator'   => $getPackSpecsFee['pack_specs_type'],
                         'insulation_money'   => $getPackSpecsFee['surcharge_money'],
                         'labor_cost_money'   => $getPackSpecsFee['data']['labor_cost_money'],