<?php

namespace App\Http\Controllers;


use App\Authority;
use App\Batch;
use App\Carrier;
use App\CarType;
use App\City;
use App\Commodity;
use App\CommodityBarcode;
use App\Console\Commands\CreateOwnerAreaReport;
use App\Console\Commands\CreateOwnerBillReport;
use App\Console\Commands\CreateOwnerReport;
use App\Console\Commands\SyncBatchTask;
use App\Console\Commands\SyncWmsCommoditiesInformation;
use App\Console\Commands\SyncWMSOrderTask;
use App\Console\Commands\WasSyncWmsAsnInformation;
use App\DeliveryAppointment;
use App\Events\BroadcastToStation;
use App\DeliveryAppointmentCar;
use App\Events\DeliveryAppointmentEvent;
use App\Exceptions\ErrorException;
use App\Events\CancelOrder;
use App\Events\SendEmailEvent;
use App\Exceptions\Exception;
use App\Feature;
use App\Http\Controllers\api\thirdPart\haiq\PickStationController;
use App\Http\Controllers\api\thirdPart\hengli\PackageController;
use App\Http\Controllers\api\thirdPart\weight\WeightBaseController;
use App\Http\Requests\ForeignHaiRobotic_taskUpdateRequest;
use App\Http\Requests\TestAaRequest;
use App\Imports\OrderTrackingImport;
use App\InventoryAccount;
use App\Jobs\BatchTaskJob;
use App\Jobs\DeleteRepetitionSkuItem;
use App\Jobs\LogisticYTOSync;
use App\Jobs\OrderCreateInstantBill;
use App\Jobs\OrderFreeze;
use App\Jobs\StoreCreateInstantBill;
use App\Jobs\ResetInstantBill;
use App\LaborReport;
use App\LaborReportStatus;
use App\Log;
use App\Logistic;
use App\MaterialBox;
use App\MeasuringMachine;
use App\Menu;
use App\Notifications\SendEmailNotification;
use App\OracleActAllocationDetails;
use App\OracleBasCustomer;
use App\OracleBasSKU;
use App\OracleDOCASNHeader;
use App\OracleDOCOrderDetail;
use App\OracleDOCOrderHeader;
use App\OracleDocOrderPackingSummary;
use App\OracleDocOrderSerialNo;
use App\OracleDOCWaveDetails;
use App\OracleDOCWaveHeader;
use App\OracleInvLotLocId;
use App\Order;
use App\OrderBin;
use App\OrderCommodity;
use App\OrderIssue;
use App\OrderPackage;
use App\Owner;
use App\OwnerAreaReport;
use App\OwnerBillReport;
use App\OwnerFeeDetail;
use App\OwnerFeeDetailLogistic;
use App\OwnerMaterial;
use App\OwnerPriceExpress;
use App\OwnerPriceOperation;
use App\OwnerPriceOperationItem;
use App\OwnerPriceSystem;
use App\OwnerReport;
use App\OwnerStoragePriceModel;
use App\Package;
use App\Process;
use App\ProcessDaily;
use App\ProcessStatistic;
use App\Procurement;
use App\ProcurementCheckSheet;
use App\ProcurementDeliverie;
use App\ProcurementQuotation;
use App\ProcurementTotalBill;
use App\Province;
use App\Region;
use App\RejectedBill;
use App\RejectedBillItem;
use App\Services\CacheService;
use App\Services\CommodityService;
use App\Services\common\BatchUpdateService;
use App\Services\common\DataHandlerService;
use App\Services\common\QueryService;
use App\Services\DocWaveHeaderService;
use App\Services\FeatureService;
use App\Services\InventoryCompareService;
use App\Services\LogisticService;
use App\Services\LogisticZopService;
use App\Services\LogService;
use App\Services\OracleActAllocationDetailService;
use App\Services\OracleBasSkuService;
use App\Services\OracleDocAsnHerderService;
use App\Services\OracleDOCOrderHeaderService;
use App\Services\OracleDocWaveDetailService;
use App\Services\OrderCommodityService;
use App\Services\OrderPackageExceptionTypeCountingRecordService;
use App\Services\OrderPackageReceivedSyncService;
use App\Services\OrderPackageService;
use App\Services\OrderService;
use App\Services\OrderTrackingOwnerService;
use App\Services\OrderTrackingService;
use App\Services\OwnerPriceOperationService;
use App\Services\OwnerService;
use App\Services\ProcurementService;
use App\Services\RegionService;
use App\Services\RejectedBillService;
use App\Services\ShopService;
use App\Services\StoreService;
use App\Services\SupplierService;
use App\Services\WarehouseService;
use App\Station;
use App\StationRuleBatch;
use App\StationTask;
use App\StationTaskMaterialBox;
use App\StationType;
use App\Store;
use App\StationTaskBatch;
use App\StoreCheckingReceiveItem;
use App\StoreItem;
use App\StoreItems;
use App\Supplier;
use App\Traits\ModelLogChanging;
use App\Unit;
use App\User;
use App\UserDetail;
use App\UserDutyCheck;
use App\ValueStore;
use App\Warehouse;
use App\Waybill;
use App\WaybillPriceModel;
use Carbon\Carbon;
use Carbon\CarbonPeriod;
use ChangeColumnOrderIdToOrderIssues;
use Doctrine\DBAL\Exception\DatabaseObjectExistsException;
use Doctrine\DBAL\Query\QueryBuilder;
use Illuminate\Database\Connection;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Maatwebsite\Excel\Facades\Excel;
use Mockery\Mock;
use Overtrue\LaravelPinyin\Facades\Pinyin;
use PhpMyAdmin\Server\Status\Data;
use Ramsey\Collection\Collection;
use Zttp\Zttp;

class TestController extends Controller
{
    const ASNREFERENCE_2 = 'ASNREFERENCE2';
    private $data = [];

    public function __construct()
    {
        $this->data["active_test"] = "active";
    }

    public function method(Request $request, $method)
    {
        return call_user_func([$this, $method], $request);
    }
    public function test()
    {
        Owner::query()->where("id",360)->update([
            "relevance" => [0,1],
        ]);
        $customers = DB::connection("oracle")->select(DB::raw("select * from BAS_CUSTOMER where CUSTOMER_TYPE = 'CA'"));
        foreach ($customers as $customer){
            $l = Logistic::query()->where("code",$customer->customerid)->orWhere("name",$customer->descr_c)->first();
            if ($l)$l->update(["english_name"=>$customer->descr_e]);
        }
        dd("OK");
        $asnno = "ASN2105141388";
        $query = DB::raw("SELECT b.ALTERNATE_SKU1,h.WAREHOUSEID,h.asnno,d.ASNLINENO,d.SKUDESCRC,h.CUSTOMERID,d.SKU,d.PACKID,d.RECEIVEDQTY_EACH,d.EXPECTEDQTY_EACH,d.LOTATT01,d.LOTATT02,d.lotatt04,".
            "d.lotatt05,d.lotatt08,d.USERDEFINE1,d.USERDEFINE2,d.USERDEFINE3,d.USERDEFINE4,d.USERDEFINE5,d.RECEIVINGLOCATION FROM DOC_ASN_DETAILS d ".
            " LEFT JOIN BAS_SKU b ON d.CUSTOMERID = b.CUSTOMERID AND d.SKU = b.SKU INNER JOIN DOC_ASN_HEADER h ON d.ASNNO = h.ASNNO WHERE h.ASNNO = ?");
        $detail = DB::connection("oracle")->selectOne($query,[$asnno]);
        //dd($detail);
        $ser = new StoreService();
        $result = $ser->warehousing(array(
            "IN_Warehouse" => $detail->warehouseid ?? '',
            "In_ASNNo_C" => $detail->asnno ?? '',
            "In_ASNLineNo_C" => $detail->asnlineno ?? '',
            "In_New_TraceID_C" => (string)rand(100,999),
            "In_CustomerID" => $detail->customerid ?? '',
            "In_SKU" => $detail->sku ?? '',
            "In_ReceivedQty" => (string)((int)$detail->expectedqty_each - (int)$detail->receivedqty_each) ?? '',
            "In_PackID" => $detail->packid ?? '',
            "In_LotAtt01_C" => $detail->lotatt01 ?? '',
            "In_LotAtt02_C" => $detail->lotatt02 ?? '',
            "In_LotAtt04_C" => $detail->lotatt04 ?? '',
            "In_LotAtt05_C" => $detail->lotatt05 ?? '',
            "In_LotAtt08_C" => $detail->lotatt08 ?? '',
            "In_UserDefine1" => $detail->userdefine1 ?? '',
            "In_UserDefine2" => $detail->userdefine2 ?? '',
            "In_UserDefine3" => $detail->userdefine3 ?? '',
            "In_UserDefine4" => $detail->userdefine4 ?? '',
            "In_UserDefine5" => $detail->userdefine5 ?? '',
            "In_FMLocation"  => 'STAGE' . $detail->warehouseid,
            "In_TOLocation_C" => 'STAGE' . $detail->warehouseid,//'IDE0000001',
        ));
       dd($result);
        /*$order = Order::query()->where("code","SO210511005663")->first();
        $ser = new OrderService();
        $ser->createInstantBill($order);
        dd();*/
        $store = Store::query()->find(173382);dd($store->load("storeItems.commodity"));
        $ser = new StoreService();
        $ser->createInstantBill($store);
        dd($store);
    }
    public function orderCreateBill()
    {
        $order = Order::query()->find(\request("id"));
        $ser = new OrderService();
        $ser->createInstantBill($order);
        dd("order create bill success");
    }
    public function supplementMarchOwnerReport()
    {
        $ows = OwnerAreaReport::query()->select("owner_id")->where("counting_month",'like',"2021-03%")->get();
        $owners = Owner::query()->whereNotIn("id",array_column($ows->toArray(),"owner_id"))->get();
        $createOwnerAreaReport = [];
        foreach ($owners as $owner){
            if (!$owner->ownerStoragePriceModels)continue;
            foreach ($owner->ownerStoragePriceModels as $model){
                $key = $owner->id."_".$model->id;
                if (!isset($sign[$key])) $createOwnerAreaReport[] = [
                    "owner_id"              => $owner->id,
                    "counting_month"        => "2021-03-01",
                    "user_owner_group_id"   => $owner->user_owner_group_id,
                    "created_at"            => "2021-04-15 00:00:00",
                    "owner_storage_price_model_id"  => $model->id,
                ];
            }
        }
        if ($createOwnerAreaReport)DB::table("owner_area_reports")->insert($createOwnerAreaReport);
    }

    public function assignBatch()
    {
        $batches = collect([
            [
                "id" => 87255,
                "code" => "W210312000317",
                "status" => "\u672a\u5904\u7406",
                "type" => null,
                "wms_type" => "09.[BAOSHI]\u622a\u5355\u6ce2\u6b21\u3010\u65e0\u5907\u6ce8\u3011",
                "wms_status" => "\u90e8\u5206\u6536\u8d27",
                "wms_created_at" => "0000-00-00 00=>00=>00",
                "created_at" => "2021-03-12T09=>10=>44.000000Z",
                "updated_at" => "2021-03-12T09=>10=>44.000000Z",
                "remark" => null,
                "owner_id" => "42",
                "station_task_batch" => null
            ]
        ]);
        $batches = Batch::query()->where('id', data_get($batches, '*.id'))->get();
        app('BatchService')->assignTasks($batches);
    }

    public function zzd()
    {
        ini_set('max_execution_time', 2500);
        ini_set('memory_limit', '1526M');
        $menus = [
            "A管理" => [
                "A二级" => [
                    "A三级"
                ]
            ],
            "B管理" => []
        ];
        /*$authorities = [
            "A管理"=>[
                "A二级"=>[9
                    "A三级"=>[
                        "A四级"
                    ]
                ]
            ]
        ];*/
    }

    public function updateLaborRemark()
    {
        $laborReports = LaborReport::query()->with(['remarks' => function ($query) {
            return $query->whereNotNull('mark');
        }])->get();
        $updateParams = [[
            'id', 'remark', 'updated_at'
        ]];
        $updated_at = Carbon::now()->toDateTimeString();
        foreach ($laborReports as $laborReport) {
            if ($laborReport->remarks) {
                $updateParams[] = [
                    'id' => $laborReport->id,
                    'remark' => $laborReport->remarks->mark,
                    'updated_at' => $updated_at,
                ];
            }
        }
        if (count($updateParams) > 1) {
            app(BatchUpdateService::class)->batchUpdate('labor_reports', $updateParams);
        }
    }

    function packageFromLog(Request $request)
    { //x        $packagesBatch=Package::where('batch_number',$batch_number)->first();
        ini_set('max_execution_time', 2500);
        ini_set('memory_limit', '1526M');
        $uploaded = 0;
        $count = DB::table('logs')->where('operation', 'like', "%PackageController::new_%")
            ->where('created_at', '>', "2020-06-08 15:46:00")
            ->where('created_at', '<', "2020-06-08 15:47:00")
            ->where('type', "request_new_")
            ->count();
        $requests = DB::table('logs')->where('operation', 'like', "%PackageController::new_%")
            ->where('created_at', '>', "2020-06-08 15:46:00")
            ->where('created_at', '<', "2020-06-08 15:47:00")
            ->where('type', "request_new_")
            ->get();
        $requests->each(function ($request) use (&$uploaded) {
            $requestJson = json_decode($request->description, true);
            $response = Zttp::withHeaders(['content-type' => 'application/json',
            ])->post('https://was.baoshi56.com/api/thirdPart/flux/package/new',
                $requestJson
            );
            if ($response->json() && $response->json()['response'] && $response->json()['response']['flag'] == 'Y')
                $uploaded += 1;
        });
        dd($uploaded . '/' . $count);
    }

    function setCache(Request $request)
    {
        $today = now();
        Cache::put('storedTest', $today);
        return "cacheing:'$today'<script>localStorage.setItem('storedTest','{$today}')</script>";
    }

    function getCache(Request $request)
    {
        $cache = Cache::get('storedTest');
        return "cacheing get:'$cache'<script>document.write('<br>localStorage:'+localStorage.getItem('storedTest'))</script>";
    }

    function hProcessed(Request $request)
    {
        app('ForeignHaiRoboticsService')->markBinProcessed(
            '1',
            'IDE0005714',
            true,
            "2021-56-24 05-03-15",
            '',
            true
        );
    }

    function hHasTaken(Request $request)
    {
        app('ForeignHaiRoboticsService')->taskUpdate(
            301
            , 1
            , 0
            , 'IDE0005714'
        );
    }

    function hBatch(Request $request)
    {
        $a = [
            new Batch(
                [
                    "id" => 91045,
                    "code" => "W210325000388",
                    "status" => "\u672a\u5904\u7406",
                    "type" => null,
                    "wms_type" => "09.[BAOSHI]\u622a\u5355\u6ce2\u6b21\u3010\u65e0\u5907\u6ce8\u3011",
                    "wms_status" => "\u90e8\u5206\u6536\u8d27",
                    "wms_created_at" => "0000-00-00 00:00:00",
                    "created_at" => "2021-03-25T10:58:46.000000Z",
                    "updated_at" => "2021-03-25T10:58:46.000000Z",
                    "remark" => null,
                    "owner_id" => "42"
                ])
        ];
        app('BatchService')->assignTasks($a);
        dd($a);
    }

    function packageT(Request $request)
    {

        $stationTaskBatch = app('StationTaskBatchService')->get(['batch_id' => 93037])->first();
        dd($stationTaskBatch['id'] ?? null);
    }

    function injectJS(Request $request)
    {
        $items = RejectedBillItem::whereHas('rejectedBill', function ($query) {
            return $query->where('id_owner', 2);
        })->where('created_at', '>', '2019-12-23 18:11:00')->where('created_at', '<', '2019-12-24 11:25:00')->get();
        (new RejectedBillItemController())->collectionsToPackConfirm($items);
    }

    public function tj2(Request $request)
    {

        dd((function (){
            try{
                throw new Exception();
                return 1;
            }catch (\Exception $e){
                return 2;
            }
        })());
    }

    public function mergerPackageData()
    {
        ini_set('max_execution_time', 36000);
        ini_set('memory_limit', '1526M');
        $number = 3000;
        $start_at = 1;
        $sum = Package::query()->where('id', '>', $start_at)->count();
        $len = ceil($sum / $number);
        $id = $start_at;
        for ($i = 1; $i <= $len; $i++) {
            $packages = Package::query()->orderBy('id')->where('id', '>', $id)->limit($number)->get();
            $error = [];
            foreach ($packages as $package) {
                /** @var $service OrderPackageService */
                $service = app('OrderPackageService');
                $orderPackage = $service->firstOrCreate($package->logistic_number,
                    ['batch_number' => $package->batch_number,
                        'batch_rule' => $package->batch_rule,
                        'bulk' => $package->bulk,
                        'weight' => $package->weight,
                        'length' => $package->length,
                        'width' => $package->width,
                        'height' => $package->height,
                        'paper_box_id' => $package->paper_box_id,
                        'measuring_machine_id' => $package->measuring_machine_id,
                        'weighed_at' => $package->weighed_at,
                        'status' => $package->status]);
                if (!$orderPackage) array_push($error, $package->id);
            }
            app('LogService')->log(__METHOD__, "同步时WMS中未找到这些订单", json_encode($error));
            $id = $packages[count($packages) - 1]->id;
            echo $number . ' a bunch done at:' . now()->toFormattedDateString() . '<br>';
        }
    }

    public function ld()
    {
        dd(
            json_encode(collect(collect(collect([City::query()->first()]))))

        );
    }

    public function featureIt()
    {
        LogisticNumberFeatureController::loadRecentRejectedsToFeatures(5, 2500);
    }
//    public function reNewB()
//    {
//        $response=Zttp::
////        withHeaders(['Content-Type'=> 'application/json'])->
//            post('https://wcs.baoshi56.com/api/thirdPart/flux/sorting/newBatch',
//            json_decode('{"request":[{"waveno":"W201112000054","taskprocess":"40","order_list":[{"docno":"SO201111041961","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361840","alternate_sku1":"8200700241004,,","sku":"8200700241004","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361841","alternate_sku1":"8192000354003,,","sku":"8192000354003","descr_c":"\u5973\u56f4\u5dfe","fmqty_each":"1"}],"reservedfield01":"58"},{"docno":"SO201111043706","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361685","alternate_sku1":"8201900168003,,","sku":"8201900168003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361686","alternate_sku1":"8201300188402,,","sku":"8201300188402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361687","alternate_sku1":"8201901091004,,","sku":"8201901091004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"12"},{"docno":"SO201111043710","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361813","alternate_sku1":"8201900388402,,","sku":"8201900388402","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361814","alternate_sku1":"8201700408202,,","sku":"8201700408202","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361815","alternate_sku1":"8200600051002,,","sku":"8200600051002","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"2"}],"reservedfield01":"48"},{"docno":"SO201111043711","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361844","alternate_sku1":"7201300388403,,","sku":"7201300388403","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361845","alternate_sku1":"7191901371003,,","sku":"7191901371003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"60"},{"docno":"SO201111043716","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361819","alternate_sku1":"8201900258004,,","sku":"8201900258004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361820","alternate_sku1":"7192400166203,,","sku":"7192400166203","descr_c":"\u5973\u889c\uff08\u9ed1\/\u7070\/\u84dd\/\u7d2b\/\u767d\u8272\uff09\uff08\u4e94\u53cc\/\u5957\uff09","fmqty_each":"1"},{"ptltaskid":"1361821","alternate_sku1":"6202400286203,,NW","sku":"6202400286203","descr_c":"\u5973\u889c","fmqty_each":"1"}],"reservedfield01":"50"},{"docno":"SO201111043717","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361655","alternate_sku1":"7192400146203,,","sku":"7192400146203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361656","alternate_sku1":"8201300712204,,","sku":"8201300712204","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361657","alternate_sku1":"8202100041003,,","sku":"8202100041003","descr_c":"\u5973\u5e3d\u5b50","fmqty_each":"1"},{"ptltaskid":"1361658","alternate_sku1":"8201900849003,,","sku":"8201900849003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"4"},{"docno":"SO201111043726","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361674","alternate_sku1":"8201900621004,,","sku":"8201900621004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361675","alternate_sku1":"8201300188402,,","sku":"8201300188402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361676","alternate_sku1":"7206400499203,,","sku":"7206400499203","descr_c":"\u7537\u536b\u8863","fmqty_each":"1"}],"reservedfield01":"8"},{"docno":"SO201111043729","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361664","alternate_sku1":"8201000139203,,","sku":"8201000139203","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361665","alternate_sku1":"8201000047703,,","sku":"8201000047703","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361666","alternate_sku1":"81945001193100,,","sku":"81945001193100","descr_c":"\u5973\u7ae5\u68c9\u670d","fmqty_each":"1"},{"ptltaskid":"1361667","alternate_sku1":"8201000022203,,","sku":"8201000022203","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361668","alternate_sku1":"8201400029203,,","sku":"8201400029203","descr_c":"\u5973\u9a6c\u5939","fmqty_each":"1"},{"ptltaskid":"1361669","alternate_sku1":"8191500059103,,","sku":"8191500059103","descr_c":"\u5973\u68c9\u8863","fmqty_each":"1"}],"reservedfield01":"6"},{"docno":"SO201111043733","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361756","alternate_sku1":"5200400178403,,","sku":"5200400178403","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361757","alternate_sku1":"7190400206203,,","sku":"7190400206203","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361758","alternate_sku1":"8191901538003,,","sku":"8191901538003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361759","alternate_sku1":"8196800496003,,","sku":"8196800496003","descr_c":"\u7537\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"}],"reservedfield01":"30"},{"docno":"SO201111043734","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361789","alternate_sku1":"6202400306203,,","sku":"6202400306203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361790","alternate_sku1":"8201500069103,,","sku":"8201500069103","descr_c":"\u5973\u77ed\u6b3e\u68c9\u8863","fmqty_each":"1"},{"ptltaskid":"1361791","alternate_sku1":"6204100033056,,","sku":"6204100033056","descr_c":"\u5973\u62d6\u978b","fmqty_each":"1"}],"reservedfield01":"40"},{"docno":"SO201111043735","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361825","alternate_sku1":"5201000527402,,","sku":"5201000527402","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361826","alternate_sku1":"72031003910103,,","sku":"72031003910103","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361827","alternate_sku1":"7201001337204,,","sku":"7201001337204","descr_c":"\u5973\u77ed\u8896T\u6064","fmqty_each":"1"}],"reservedfield01":"52"},{"docno":"SO201111042109","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361804","alternate_sku1":"8201900124103,,","sku":"8201900124103","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361805","alternate_sku1":"7201901555002,,","sku":"7201901555002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361806","alternate_sku1":"8198100181003,,","sku":"8198100181003","descr_c":"\u7537\u56f4\u5dfe","fmqty_each":"1"}],"reservedfield01":"45"},{"docno":"SO201111043736","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361682","alternate_sku1":"8201700029204,,","sku":"8201700029204","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361683","alternate_sku1":"8201300188402,,","sku":"8201300188402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361684","alternate_sku1":"8201300326004,,","sku":"8201300326004","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"11"},{"docno":"SO201111043738","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361729","alternate_sku1":"8190600089203,,","sku":"8190600089203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361730","alternate_sku1":"8190700022103,,","sku":"8190700022103","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"3"},{"ptltaskid":"1361731","alternate_sku1":"8201300398403,,","sku":"8201300398403","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"23"},{"docno":"SO201111043741","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361822","alternate_sku1":"8190100101024,,","sku":"8190100101024","descr_c":"\u5973\u725b\u4ed4\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361823","alternate_sku1":"7200100376024,,","sku":"7200100376024","descr_c":"\u5973\u725b\u4ed4\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361824","alternate_sku1":"8201300338402,,","sku":"8201300338402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"51"},{"docno":"SO201111043742","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361643","alternate_sku1":"8201300388202,,","sku":"8201300388202","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361644","alternate_sku1":"8191800429202,,","sku":"8191800429202","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361645","alternate_sku1":"8200600731004,,","sku":"8200600731004","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361646","alternate_sku1":"8201700029002,,","sku":"8201700029002","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361647","alternate_sku1":"8201300388201,,","sku":"8201300388201","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361648","alternate_sku1":"8201900228403,,","sku":"8201900228403","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361649","alternate_sku1":"8201800306004,,","sku":"8201800306004","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361650","alternate_sku1":"8201900066002,,","sku":"8201900066002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"2"},{"docno":"SO201111043744","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361764","alternate_sku1":"7194600010297,,","sku":"7194600010297","descr_c":"\u5973\u7ae5\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361765","alternate_sku1":"7190100826004,,","sku":"7190100826004","descr_c":"\u5973\u725b\u4ed4\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361766","alternate_sku1":"7191900591004,,","sku":"7191900591004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361767","alternate_sku1":"7190700779204,,","sku":"7190700779204","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"32"},{"docno":"SO201111043748","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361709","alternate_sku1":"7201200048003,,","sku":"7201200048003","descr_c":"\u6d0b\u6c14\u8d85\u4ed9\u7f51\u7eb1\u5c0f\u6e05\u65b0\u906e\u809a\u5b50\u96ea\u7eba\u886b","fmqty_each":"1"},{"ptltaskid":"1361710","alternate_sku1":"7201900124203,,","sku":"7201900124203","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361711","alternate_sku1":"7201901601003,,","sku":"7201901601003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361712","alternate_sku1":"8201900109203,,","sku":"8201900109203","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"18"},{"docno":"SO201111043749","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361760","alternate_sku1":"8190401126303,,","sku":"8190401126303","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361761","alternate_sku1":"8190400641003,,","sku":"8190400641003","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361762","alternate_sku1":"8190400839203,,","sku":"8190400839203","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361763","alternate_sku1":"8190401126304,,","sku":"8190401126304","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"}],"reservedfield01":"31"},{"docno":"SO201111043757","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361702","alternate_sku1":"7201801009203,,","sku":"7201801009203","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361703","alternate_sku1":"8196100028005,,","sku":"8196100028005","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361704","alternate_sku1":"8201400029203,,","sku":"8201400029203","descr_c":"\u5973\u9a6c\u5939","fmqty_each":"1"}],"reservedfield01":"16"},{"docno":"SO201111043761","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361721","alternate_sku1":"8201900735002,,","sku":"8201900735002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361722","alternate_sku1":"8201700045202,,","sku":"8201700045202","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361723","alternate_sku1":"8201700438203,,","sku":"8201700438203","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361724","alternate_sku1":"8206100021005,,","sku":"8206100021005","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"}],"reservedfield01":"21"},{"docno":"SO201111043765","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361778","alternate_sku1":"8206600101005,,","sku":"8206600101005","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361775","alternate_sku1":"7196600149205,,","sku":"7196600149205","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361776","alternate_sku1":"8201300618402,,","sku":"8201300618402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361777","alternate_sku1":"8201900311002,,","sku":"8201900311002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"35"},{"docno":"SO201111043651","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361807","alternate_sku1":"7201901097702,,","sku":"7201901097702","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361808","alternate_sku1":"7203100479202,,","sku":"7203100479202","descr_c":"\u5973\u4e0a\u8863","fmqty_each":"1"},{"ptltaskid":"1361809","alternate_sku1":"7200700114002,,","sku":"7200700114002","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"46"},{"docno":"SO201111043768","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361838","alternate_sku1":"7200600329203,,","sku":"7200600329203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361839","alternate_sku1":"8200600101002,,","sku":"8200600101002","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"57"},{"docno":"SO201111043772","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361697","alternate_sku1":"8191900208404,,","sku":"8191900208404","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361698","alternate_sku1":"7191901298004,,","sku":"7191901298004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361699","alternate_sku1":"8190401121005,,","sku":"8190401121005","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361700","alternate_sku1":"8190400711005,,","sku":"8190400711005","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361701","alternate_sku1":"7191901418004,,","sku":"7191901418004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"15"},{"docno":"SO201111043773","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361725","alternate_sku1":"7200700221003,,","sku":"7200700221003","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361726","alternate_sku1":"7190700706003,,","sku":"7190700706003","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361727","alternate_sku1":"8190500049302,,","sku":"8190500049302","descr_c":"\u5973\u77ed\u88e4","fmqty_each":"1"},{"ptltaskid":"1361728","alternate_sku1":"8201300173004,,","sku":"8201300173004","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"22"},{"docno":"SO201111043774","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361834","alternate_sku1":"8190400609201,,","sku":"8190400609201","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361835","alternate_sku1":"8191800488401,,","sku":"8191800488401","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"}],"reservedfield01":"55"},{"docno":"SO201111043782","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361670","alternate_sku1":"8197200844105,,","sku":"8197200844105","descr_c":"\u7537\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361671","alternate_sku1":"8201901248003,,","sku":"8201901248003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361672","alternate_sku1":"8201300188402,,","sku":"8201300188402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361673","alternate_sku1":"8201300051002,,","sku":"8201300051002","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"7"},{"docno":"SO201111043784","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361810","alternate_sku1":"8206600013004,,","sku":"8206600013004","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361811","alternate_sku1":"7206600681003,,","sku":"7206600681003","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361812","alternate_sku1":"8207200161004,,","sku":"8207200161004","descr_c":"\u7537\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"47"},{"docno":"SO201111043786","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361842","alternate_sku1":"8201900608002,,","sku":"8201900608002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361843","alternate_sku1":"8201900394003,,","sku":"8201900394003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"59"},{"docno":"SO201111043788","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361784","alternate_sku1":"8201800231002,,","sku":"8201800231002","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361785","alternate_sku1":"8203100018402,,","sku":"8203100018402","descr_c":"\u5973\u4e0a\u8863","fmqty_each":"1"},{"ptltaskid":"1361786","alternate_sku1":"8201800518201,,","sku":"8201800518201","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"}],"reservedfield01":"38"},{"docno":"SO201111043789","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361705","alternate_sku1":"8201900806002,,","sku":"8201900806002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361706","alternate_sku1":"8201900928402,,","sku":"8201900928402","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361707","alternate_sku1":"7200401058002,,","sku":"7200401058002","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361708","alternate_sku1":"8202100139303,,","sku":"8202100139303","descr_c":"\u5973\u5e3d\u5b50","fmqty_each":"1"}],"reservedfield01":"17"},{"docno":"SO201111043792","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361782","alternate_sku1":"8196100021003,,","sku":"8196100021003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361783","alternate_sku1":"5196400031003,,","sku":"5196400031003","descr_c":"\u7537\u536b\u8863","fmqty_each":"1"}],"reservedfield01":"37"},{"docno":"SO201111043695","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361744","alternate_sku1":"7205300486004,,","sku":"7205300486004","descr_c":"\u7537\u4fee\u8eab\u7a84\u811a\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361745","alternate_sku1":"5208700084004,,","sku":"5208700084004","descr_c":"\u7537\u5185\u88e4","fmqty_each":"2"},{"ptltaskid":"1361746","alternate_sku1":"8206800043304,,","sku":"8206800043304","descr_c":"\u7537\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361747","alternate_sku1":"7206600444203,,","sku":"7206600444203","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"27"},{"docno":"SO201111043793","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361748","alternate_sku1":"7201001231003,,","sku":"7201001231003","descr_c":"\u5973\u77ed\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361749","alternate_sku1":"8200600731003,,","sku":"8200600731003","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361750","alternate_sku1":"7200600659203,,","sku":"7200600659203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361751","alternate_sku1":"8201700057404,,","sku":"8201700057404","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"}],"reservedfield01":"28"},{"docno":"SO201111043794","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361677","alternate_sku1":"7192400146203,,","sku":"7192400146203","descr_c":"\u5973\u889c","fmqty_each":"3"},{"ptltaskid":"1361678","alternate_sku1":"8201300388202,,","sku":"8201300388202","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"9"},{"docno":"SO201111043796","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361713","alternate_sku1":"7206600064502,,","sku":"7206600064502","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361714","alternate_sku1":"7192400156203,,","sku":"7192400156203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361715","alternate_sku1":"7206400241002,,","sku":"7206400241002","descr_c":"\u7537\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361716","alternate_sku1":"7205500021002,,","sku":"7205500021002","descr_c":"\u7537\u9488\u7ec7\u4e2d\u88e4","fmqty_each":"1"}],"reservedfield01":"19"},{"docno":"SO201111043798","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361752","alternate_sku1":"8191901388303,,","sku":"8191901388303","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361753","alternate_sku1":"8191900589502,,","sku":"8191900589502","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361754","alternate_sku1":"5201900089003,,","sku":"5201900089003","descr_c":"\u6175\u61d2\u98ce\u5973\u5bbd\u677e\u5916\u7a7f\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361755","alternate_sku1":"7191900649203,,","sku":"7191900649203","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"29"},{"docno":"SO201111043799","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361831","alternate_sku1":"8201700029203,,","sku":"8201700029203","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361832","alternate_sku1":"8201600032202,,","sku":"8201600032202","descr_c":"\u5973\u957f\u6b3e\u5927\u8863","fmqty_each":"1"},{"ptltaskid":"1361833","alternate_sku1":"8201300132202,,","sku":"8201300132202","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"54"},{"docno":"SO201111043804","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361795","alternate_sku1":"8201300097704,,","sku":"8201300097704","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361796","alternate_sku1":"8201300028404,,","sku":"8201300028404","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361797","alternate_sku1":"8201500098404,,","sku":"8201500098404","descr_c":"\u5973\u77ed\u6b3e\u68c9\u8863","fmqty_each":"1"}],"reservedfield01":"42"},{"docno":"SO201111043810","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361787","alternate_sku1":"7200600161003,,","sku":"7200600161003","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361788","alternate_sku1":"8190600089203,,","sku":"8190600089203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"39"},{"docno":"SO201111043816","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361768","alternate_sku1":"8196100018003,,","sku":"8196100018003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361769","alternate_sku1":"8191902051003,,","sku":"8191902051003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361770","alternate_sku1":"8196100011003,,","sku":"8196100011003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"}],"reservedfield01":"33"},{"docno":"SO201111043817","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361816","alternate_sku1":"8190500049304,,","sku":"8190500049304","descr_c":"\u5973\u77ed\u88e4","fmqty_each":"1"},{"ptltaskid":"1361817","alternate_sku1":"8200700131204,,","sku":"8200700131204","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361818","alternate_sku1":"8200600031004,,","sku":"8200600031004","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"49"},{"docno":"SO201111043830","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361692","alternate_sku1":"8191800339201,,","sku":"8191800339201","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361693","alternate_sku1":"8201300018402,,","sku":"8201300018402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361694","alternate_sku1":"8201700248002,,","sku":"8201700248002","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361695","alternate_sku1":"7200700701003,,","sku":"7200700701003","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361696","alternate_sku1":"8200700254003,,","sku":"8200700254003","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"14"},{"docno":"SO201111043696","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361828","alternate_sku1":"8191900499202,,","sku":"8191900499202","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361829","alternate_sku1":"8201700057402,,","sku":"8201700057402","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361830","alternate_sku1":"8191300267702,,","sku":"8191300267702","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"53"},{"docno":"SO201111043833","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361732","alternate_sku1":"7201001189003,,","sku":"7201001189003","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361733","alternate_sku1":"8201700077402,,","sku":"8201700077402","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361734","alternate_sku1":"8207200519004,,","sku":"8207200519004","descr_c":"\u7537\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361735","alternate_sku1":"8201900288402,,","sku":"8201900288402","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"24"},{"docno":"SO201111043834","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361736","alternate_sku1":"7201901238202,,","sku":"7201901238202","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361737","alternate_sku1":"8201900849001,,","sku":"8201900849001","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361738","alternate_sku1":"8201900259202,,","sku":"8201900259202","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361739","alternate_sku1":"7200100196023,,","sku":"7200100196023","descr_c":"\u9ad8\u81708\u5206\u9ad8\u8170\u5fae\u5587\u957f\u88e4","fmqty_each":"1"}],"reservedfield01":"25"},{"docno":"SO201111043843","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361836","alternate_sku1":"7200401031002,,","sku":"7200401031002","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361837","alternate_sku1":"7200400539202,,","sku":"7200400539202","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"}],"reservedfield01":"56"},{"docno":"SO201111043846","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361717","alternate_sku1":"7194900359397,,","sku":"7194900359397","descr_c":"\u5973\u7ae5\u534a\u88d9","fmqty_each":"1"},{"ptltaskid":"1361718","alternate_sku1":"7199400431099,,","sku":"7199400431099","descr_c":"\u7537\u7ae5\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361719","alternate_sku1":"8201900806003,,","sku":"8201900806003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361720","alternate_sku1":"8201700341602,,","sku":"8201700341602","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"}],"reservedfield01":"20"},{"docno":"SO201111043847","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361634","alternate_sku1":"7201300771003,,","sku":"7201300771003","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361635","alternate_sku1":"8201800471003,,","sku":"8201800471003","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361636","alternate_sku1":"7201801104002,,","sku":"7201801104002","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361637","alternate_sku1":"8191800619303,,","sku":"8191800619303","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361638","alternate_sku1":"8201801061002,,","sku":"8201801061002","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361639","alternate_sku1":"8206800074002,,","sku":"8206800074002","descr_c":"\u7537\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361640","alternate_sku1":"8206800084002,,","sku":"8206800084002","descr_c":"\u7537\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361641","alternate_sku1":"7201300679303,,","sku":"7201300679303","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361642","alternate_sku1":"7201300059303,,","sku":"7201300059303","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"1"},{"docno":"SO201111043854","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361798","alternate_sku1":"7201000567603,,","sku":"7201000567603","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361799","alternate_sku1":"6190600320203,,","sku":"6190600320203","descr_c":"\u65e0\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361800","alternate_sku1":"6200600359203,,","sku":"6200600359203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"43"},{"docno":"SO201111043857","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361779","alternate_sku1":"8201901126004,,","sku":"8201901126004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361780","alternate_sku1":"8200700051004,,","sku":"8200700051004","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361781","alternate_sku1":"8190700022104,,","sku":"8190700022104","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"36"},{"docno":"SO201111043861","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361651","alternate_sku1":"7192400146203,,","sku":"7192400146203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361652","alternate_sku1":"8190400274003,,","sku":"8190400274003","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361653","alternate_sku1":"8197200964904,,","sku":"8197200964904","descr_c":"\u7537\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361654","alternate_sku1":"7205300121034,,","sku":"7205300121034","descr_c":"\u7537\u5408\u4f53\u4f11\u95f2\u957f\u88e4","fmqty_each":"1"}],"reservedfield01":"3"},{"docno":"SO201111043862","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361771","alternate_sku1":"7205800364003,,","sku":"7205800364003","descr_c":"\u7537\u9488\u7ec7\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361772","alternate_sku1":"7205800341003,,","sku":"7205800341003","descr_c":"\u7537\u9488\u7ec7\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361773","alternate_sku1":"7206400279204,,","sku":"7206400279204","descr_c":"\u7537\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361774","alternate_sku1":"7196600811004,,","sku":"7196600811004","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"34"},{"docno":"SO201111043868","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361740","alternate_sku1":"7201900541003,,","sku":"7201900541003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361741","alternate_sku1":"8206200026606,,","sku":"8206200026606","descr_c":"\u7537\u957f\u8896\u886c\u886b","fmqty_each":"1"},{"ptltaskid":"1361742","alternate_sku1":"71994003410100,,","sku":"71994003410100","descr_c":"\u7537\u7ae5\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361743","alternate_sku1":"5201900086003,,","sku":"5201900086003","descr_c":"\u6175\u61d2\u98ce\u5973\u5bbd\u677e\u5916\u7a7f\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"26"},{"docno":"SO201111043697","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361659","alternate_sku1":"8201900088402,,","sku":"8201900088402","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361660","alternate_sku1":"8200700261002,,","sku":"8200700261002","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361661","alternate_sku1":"8190700022102,,","sku":"8190700022102","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361662","alternate_sku1":"8196100018003,,","sku":"8196100018003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361663","alternate_sku1":"8196100021003,,","sku":"8196100021003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"}],"reservedfield01":"5"},{"docno":"SO201111043870","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361688","alternate_sku1":"8201900259203,,","sku":"8201900259203","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361689","alternate_sku1":"8201900258003,,","sku":"8201900258003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361690","alternate_sku1":"8201700059302,,","sku":"8201700059302","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361691","alternate_sku1":"7201300679303,,","sku":"7201300679303","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"13"},{"docno":"SO201111043699","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361792","alternate_sku1":"8201700188402,,","sku":"8201700188402","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361793","alternate_sku1":"8201700558402,,","sku":"8201700558402","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361794","alternate_sku1":"8191700268202,,","sku":"8191700268202","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"}],"reservedfield01":"41"},{"docno":"SO201111043704","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361679","alternate_sku1":"5208500096203,,","sku":"5208500096203","descr_c":"\u7537\u889c","fmqty_each":"1"},{"ptltaskid":"1361680","alternate_sku1":"6202400356203,,NW","sku":"6202400356203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361681","alternate_sku1":"7192400146203,,","sku":"7192400146203","descr_c":"\u5973\u889c","fmqty_each":"1"}],"reservedfield01":"10"},{"docno":"SO201111043705","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361801","alternate_sku1":"7201300679302,,","sku":"7201300679302","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361802","alternate_sku1":"8200500039303,,","sku":"8200500039303","descr_c":"\u5973\u77ed\u88e4","fmqty_each":"1"},{"ptltaskid":"1361803","alternate_sku1":"8201900394002,,","sku":"8201900394002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"44"}],"edittime":"2020-11-12 07:32:34"}]}')
//        );
//        dd($response->body(),json_decode('{"request":[{"waveno":"W201112000054","taskprocess":"40","order_list":[{"docno":"SO201111041961","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361840","alternate_sku1":"8200700241004,,","sku":"8200700241004","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361841","alternate_sku1":"8192000354003,,","sku":"8192000354003","descr_c":"\u5973\u56f4\u5dfe","fmqty_each":"1"}],"reservedfield01":"58"},{"docno":"SO201111043706","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361685","alternate_sku1":"8201900168003,,","sku":"8201900168003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361686","alternate_sku1":"8201300188402,,","sku":"8201300188402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361687","alternate_sku1":"8201901091004,,","sku":"8201901091004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"12"},{"docno":"SO201111043710","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361813","alternate_sku1":"8201900388402,,","sku":"8201900388402","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361814","alternate_sku1":"8201700408202,,","sku":"8201700408202","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361815","alternate_sku1":"8200600051002,,","sku":"8200600051002","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"2"}],"reservedfield01":"48"},{"docno":"SO201111043711","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361844","alternate_sku1":"7201300388403,,","sku":"7201300388403","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361845","alternate_sku1":"7191901371003,,","sku":"7191901371003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"60"},{"docno":"SO201111043716","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361819","alternate_sku1":"8201900258004,,","sku":"8201900258004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361820","alternate_sku1":"7192400166203,,","sku":"7192400166203","descr_c":"\u5973\u889c\uff08\u9ed1\/\u7070\/\u84dd\/\u7d2b\/\u767d\u8272\uff09\uff08\u4e94\u53cc\/\u5957\uff09","fmqty_each":"1"},{"ptltaskid":"1361821","alternate_sku1":"6202400286203,,NW","sku":"6202400286203","descr_c":"\u5973\u889c","fmqty_each":"1"}],"reservedfield01":"50"},{"docno":"SO201111043717","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361655","alternate_sku1":"7192400146203,,","sku":"7192400146203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361656","alternate_sku1":"8201300712204,,","sku":"8201300712204","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361657","alternate_sku1":"8202100041003,,","sku":"8202100041003","descr_c":"\u5973\u5e3d\u5b50","fmqty_each":"1"},{"ptltaskid":"1361658","alternate_sku1":"8201900849003,,","sku":"8201900849003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"4"},{"docno":"SO201111043726","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361674","alternate_sku1":"8201900621004,,","sku":"8201900621004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361675","alternate_sku1":"8201300188402,,","sku":"8201300188402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361676","alternate_sku1":"7206400499203,,","sku":"7206400499203","descr_c":"\u7537\u536b\u8863","fmqty_each":"1"}],"reservedfield01":"8"},{"docno":"SO201111043729","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361664","alternate_sku1":"8201000139203,,","sku":"8201000139203","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361665","alternate_sku1":"8201000047703,,","sku":"8201000047703","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361666","alternate_sku1":"81945001193100,,","sku":"81945001193100","descr_c":"\u5973\u7ae5\u68c9\u670d","fmqty_each":"1"},{"ptltaskid":"1361667","alternate_sku1":"8201000022203,,","sku":"8201000022203","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361668","alternate_sku1":"8201400029203,,","sku":"8201400029203","descr_c":"\u5973\u9a6c\u5939","fmqty_each":"1"},{"ptltaskid":"1361669","alternate_sku1":"8191500059103,,","sku":"8191500059103","descr_c":"\u5973\u68c9\u8863","fmqty_each":"1"}],"reservedfield01":"6"},{"docno":"SO201111043733","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361756","alternate_sku1":"5200400178403,,","sku":"5200400178403","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361757","alternate_sku1":"7190400206203,,","sku":"7190400206203","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361758","alternate_sku1":"8191901538003,,","sku":"8191901538003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361759","alternate_sku1":"8196800496003,,","sku":"8196800496003","descr_c":"\u7537\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"}],"reservedfield01":"30"},{"docno":"SO201111043734","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361789","alternate_sku1":"6202400306203,,","sku":"6202400306203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361790","alternate_sku1":"8201500069103,,","sku":"8201500069103","descr_c":"\u5973\u77ed\u6b3e\u68c9\u8863","fmqty_each":"1"},{"ptltaskid":"1361791","alternate_sku1":"6204100033056,,","sku":"6204100033056","descr_c":"\u5973\u62d6\u978b","fmqty_each":"1"}],"reservedfield01":"40"},{"docno":"SO201111043735","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361825","alternate_sku1":"5201000527402,,","sku":"5201000527402","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361826","alternate_sku1":"72031003910103,,","sku":"72031003910103","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361827","alternate_sku1":"7201001337204,,","sku":"7201001337204","descr_c":"\u5973\u77ed\u8896T\u6064","fmqty_each":"1"}],"reservedfield01":"52"},{"docno":"SO201111042109","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361804","alternate_sku1":"8201900124103,,","sku":"8201900124103","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361805","alternate_sku1":"7201901555002,,","sku":"7201901555002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361806","alternate_sku1":"8198100181003,,","sku":"8198100181003","descr_c":"\u7537\u56f4\u5dfe","fmqty_each":"1"}],"reservedfield01":"45"},{"docno":"SO201111043736","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361682","alternate_sku1":"8201700029204,,","sku":"8201700029204","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361683","alternate_sku1":"8201300188402,,","sku":"8201300188402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361684","alternate_sku1":"8201300326004,,","sku":"8201300326004","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"11"},{"docno":"SO201111043738","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361729","alternate_sku1":"8190600089203,,","sku":"8190600089203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361730","alternate_sku1":"8190700022103,,","sku":"8190700022103","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"3"},{"ptltaskid":"1361731","alternate_sku1":"8201300398403,,","sku":"8201300398403","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"23"},{"docno":"SO201111043741","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361822","alternate_sku1":"8190100101024,,","sku":"8190100101024","descr_c":"\u5973\u725b\u4ed4\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361823","alternate_sku1":"7200100376024,,","sku":"7200100376024","descr_c":"\u5973\u725b\u4ed4\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361824","alternate_sku1":"8201300338402,,","sku":"8201300338402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"51"},{"docno":"SO201111043742","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361643","alternate_sku1":"8201300388202,,","sku":"8201300388202","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361644","alternate_sku1":"8191800429202,,","sku":"8191800429202","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361645","alternate_sku1":"8200600731004,,","sku":"8200600731004","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361646","alternate_sku1":"8201700029002,,","sku":"8201700029002","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361647","alternate_sku1":"8201300388201,,","sku":"8201300388201","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361648","alternate_sku1":"8201900228403,,","sku":"8201900228403","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361649","alternate_sku1":"8201800306004,,","sku":"8201800306004","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361650","alternate_sku1":"8201900066002,,","sku":"8201900066002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"2"},{"docno":"SO201111043744","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361764","alternate_sku1":"7194600010297,,","sku":"7194600010297","descr_c":"\u5973\u7ae5\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361765","alternate_sku1":"7190100826004,,","sku":"7190100826004","descr_c":"\u5973\u725b\u4ed4\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361766","alternate_sku1":"7191900591004,,","sku":"7191900591004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361767","alternate_sku1":"7190700779204,,","sku":"7190700779204","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"32"},{"docno":"SO201111043748","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361709","alternate_sku1":"7201200048003,,","sku":"7201200048003","descr_c":"\u6d0b\u6c14\u8d85\u4ed9\u7f51\u7eb1\u5c0f\u6e05\u65b0\u906e\u809a\u5b50\u96ea\u7eba\u886b","fmqty_each":"1"},{"ptltaskid":"1361710","alternate_sku1":"7201900124203,,","sku":"7201900124203","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361711","alternate_sku1":"7201901601003,,","sku":"7201901601003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361712","alternate_sku1":"8201900109203,,","sku":"8201900109203","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"18"},{"docno":"SO201111043749","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361760","alternate_sku1":"8190401126303,,","sku":"8190401126303","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361761","alternate_sku1":"8190400641003,,","sku":"8190400641003","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361762","alternate_sku1":"8190400839203,,","sku":"8190400839203","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361763","alternate_sku1":"8190401126304,,","sku":"8190401126304","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"}],"reservedfield01":"31"},{"docno":"SO201111043757","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361702","alternate_sku1":"7201801009203,,","sku":"7201801009203","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361703","alternate_sku1":"8196100028005,,","sku":"8196100028005","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361704","alternate_sku1":"8201400029203,,","sku":"8201400029203","descr_c":"\u5973\u9a6c\u5939","fmqty_each":"1"}],"reservedfield01":"16"},{"docno":"SO201111043761","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361721","alternate_sku1":"8201900735002,,","sku":"8201900735002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361722","alternate_sku1":"8201700045202,,","sku":"8201700045202","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361723","alternate_sku1":"8201700438203,,","sku":"8201700438203","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361724","alternate_sku1":"8206100021005,,","sku":"8206100021005","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"}],"reservedfield01":"21"},{"docno":"SO201111043765","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361778","alternate_sku1":"8206600101005,,","sku":"8206600101005","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361775","alternate_sku1":"7196600149205,,","sku":"7196600149205","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361776","alternate_sku1":"8201300618402,,","sku":"8201300618402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361777","alternate_sku1":"8201900311002,,","sku":"8201900311002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"35"},{"docno":"SO201111043651","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361807","alternate_sku1":"7201901097702,,","sku":"7201901097702","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361808","alternate_sku1":"7203100479202,,","sku":"7203100479202","descr_c":"\u5973\u4e0a\u8863","fmqty_each":"1"},{"ptltaskid":"1361809","alternate_sku1":"7200700114002,,","sku":"7200700114002","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"46"},{"docno":"SO201111043768","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361838","alternate_sku1":"7200600329203,,","sku":"7200600329203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361839","alternate_sku1":"8200600101002,,","sku":"8200600101002","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"57"},{"docno":"SO201111043772","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361697","alternate_sku1":"8191900208404,,","sku":"8191900208404","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361698","alternate_sku1":"7191901298004,,","sku":"7191901298004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361699","alternate_sku1":"8190401121005,,","sku":"8190401121005","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361700","alternate_sku1":"8190400711005,,","sku":"8190400711005","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361701","alternate_sku1":"7191901418004,,","sku":"7191901418004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"15"},{"docno":"SO201111043773","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361725","alternate_sku1":"7200700221003,,","sku":"7200700221003","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361726","alternate_sku1":"7190700706003,,","sku":"7190700706003","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361727","alternate_sku1":"8190500049302,,","sku":"8190500049302","descr_c":"\u5973\u77ed\u88e4","fmqty_each":"1"},{"ptltaskid":"1361728","alternate_sku1":"8201300173004,,","sku":"8201300173004","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"22"},{"docno":"SO201111043774","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361834","alternate_sku1":"8190400609201,,","sku":"8190400609201","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361835","alternate_sku1":"8191800488401,,","sku":"8191800488401","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"}],"reservedfield01":"55"},{"docno":"SO201111043782","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361670","alternate_sku1":"8197200844105,,","sku":"8197200844105","descr_c":"\u7537\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361671","alternate_sku1":"8201901248003,,","sku":"8201901248003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361672","alternate_sku1":"8201300188402,,","sku":"8201300188402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361673","alternate_sku1":"8201300051002,,","sku":"8201300051002","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"7"},{"docno":"SO201111043784","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361810","alternate_sku1":"8206600013004,,","sku":"8206600013004","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361811","alternate_sku1":"7206600681003,,","sku":"7206600681003","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361812","alternate_sku1":"8207200161004,,","sku":"8207200161004","descr_c":"\u7537\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"47"},{"docno":"SO201111043786","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361842","alternate_sku1":"8201900608002,,","sku":"8201900608002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361843","alternate_sku1":"8201900394003,,","sku":"8201900394003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"59"},{"docno":"SO201111043788","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361784","alternate_sku1":"8201800231002,,","sku":"8201800231002","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361785","alternate_sku1":"8203100018402,,","sku":"8203100018402","descr_c":"\u5973\u4e0a\u8863","fmqty_each":"1"},{"ptltaskid":"1361786","alternate_sku1":"8201800518201,,","sku":"8201800518201","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"}],"reservedfield01":"38"},{"docno":"SO201111043789","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361705","alternate_sku1":"8201900806002,,","sku":"8201900806002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361706","alternate_sku1":"8201900928402,,","sku":"8201900928402","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361707","alternate_sku1":"7200401058002,,","sku":"7200401058002","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361708","alternate_sku1":"8202100139303,,","sku":"8202100139303","descr_c":"\u5973\u5e3d\u5b50","fmqty_each":"1"}],"reservedfield01":"17"},{"docno":"SO201111043792","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361782","alternate_sku1":"8196100021003,,","sku":"8196100021003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361783","alternate_sku1":"5196400031003,,","sku":"5196400031003","descr_c":"\u7537\u536b\u8863","fmqty_each":"1"}],"reservedfield01":"37"},{"docno":"SO201111043695","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361744","alternate_sku1":"7205300486004,,","sku":"7205300486004","descr_c":"\u7537\u4fee\u8eab\u7a84\u811a\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361745","alternate_sku1":"5208700084004,,","sku":"5208700084004","descr_c":"\u7537\u5185\u88e4","fmqty_each":"2"},{"ptltaskid":"1361746","alternate_sku1":"8206800043304,,","sku":"8206800043304","descr_c":"\u7537\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361747","alternate_sku1":"7206600444203,,","sku":"7206600444203","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"27"},{"docno":"SO201111043793","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361748","alternate_sku1":"7201001231003,,","sku":"7201001231003","descr_c":"\u5973\u77ed\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361749","alternate_sku1":"8200600731003,,","sku":"8200600731003","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361750","alternate_sku1":"7200600659203,,","sku":"7200600659203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361751","alternate_sku1":"8201700057404,,","sku":"8201700057404","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"}],"reservedfield01":"28"},{"docno":"SO201111043794","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361677","alternate_sku1":"7192400146203,,","sku":"7192400146203","descr_c":"\u5973\u889c","fmqty_each":"3"},{"ptltaskid":"1361678","alternate_sku1":"8201300388202,,","sku":"8201300388202","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"9"},{"docno":"SO201111043796","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361713","alternate_sku1":"7206600064502,,","sku":"7206600064502","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361714","alternate_sku1":"7192400156203,,","sku":"7192400156203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361715","alternate_sku1":"7206400241002,,","sku":"7206400241002","descr_c":"\u7537\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361716","alternate_sku1":"7205500021002,,","sku":"7205500021002","descr_c":"\u7537\u9488\u7ec7\u4e2d\u88e4","fmqty_each":"1"}],"reservedfield01":"19"},{"docno":"SO201111043798","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361752","alternate_sku1":"8191901388303,,","sku":"8191901388303","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361753","alternate_sku1":"8191900589502,,","sku":"8191900589502","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361754","alternate_sku1":"5201900089003,,","sku":"5201900089003","descr_c":"\u6175\u61d2\u98ce\u5973\u5bbd\u677e\u5916\u7a7f\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361755","alternate_sku1":"7191900649203,,","sku":"7191900649203","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"29"},{"docno":"SO201111043799","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361831","alternate_sku1":"8201700029203,,","sku":"8201700029203","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361832","alternate_sku1":"8201600032202,,","sku":"8201600032202","descr_c":"\u5973\u957f\u6b3e\u5927\u8863","fmqty_each":"1"},{"ptltaskid":"1361833","alternate_sku1":"8201300132202,,","sku":"8201300132202","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"54"},{"docno":"SO201111043804","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361795","alternate_sku1":"8201300097704,,","sku":"8201300097704","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361796","alternate_sku1":"8201300028404,,","sku":"8201300028404","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361797","alternate_sku1":"8201500098404,,","sku":"8201500098404","descr_c":"\u5973\u77ed\u6b3e\u68c9\u8863","fmqty_each":"1"}],"reservedfield01":"42"},{"docno":"SO201111043810","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361787","alternate_sku1":"7200600161003,,","sku":"7200600161003","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361788","alternate_sku1":"8190600089203,,","sku":"8190600089203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"39"},{"docno":"SO201111043816","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361768","alternate_sku1":"8196100018003,,","sku":"8196100018003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361769","alternate_sku1":"8191902051003,,","sku":"8191902051003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361770","alternate_sku1":"8196100011003,,","sku":"8196100011003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"}],"reservedfield01":"33"},{"docno":"SO201111043817","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361816","alternate_sku1":"8190500049304,,","sku":"8190500049304","descr_c":"\u5973\u77ed\u88e4","fmqty_each":"1"},{"ptltaskid":"1361817","alternate_sku1":"8200700131204,,","sku":"8200700131204","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361818","alternate_sku1":"8200600031004,,","sku":"8200600031004","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"49"},{"docno":"SO201111043830","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361692","alternate_sku1":"8191800339201,,","sku":"8191800339201","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361693","alternate_sku1":"8201300018402,,","sku":"8201300018402","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361694","alternate_sku1":"8201700248002,,","sku":"8201700248002","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361695","alternate_sku1":"7200700701003,,","sku":"7200700701003","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361696","alternate_sku1":"8200700254003,,","sku":"8200700254003","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"14"},{"docno":"SO201111043696","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361828","alternate_sku1":"8191900499202,,","sku":"8191900499202","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361829","alternate_sku1":"8201700057402,,","sku":"8201700057402","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361830","alternate_sku1":"8191300267702,,","sku":"8191300267702","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"53"},{"docno":"SO201111043833","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361732","alternate_sku1":"7201001189003,,","sku":"7201001189003","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361733","alternate_sku1":"8201700077402,,","sku":"8201700077402","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361734","alternate_sku1":"8207200519004,,","sku":"8207200519004","descr_c":"\u7537\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361735","alternate_sku1":"8201900288402,,","sku":"8201900288402","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"24"},{"docno":"SO201111043834","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361736","alternate_sku1":"7201901238202,,","sku":"7201901238202","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361737","alternate_sku1":"8201900849001,,","sku":"8201900849001","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361738","alternate_sku1":"8201900259202,,","sku":"8201900259202","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361739","alternate_sku1":"7200100196023,,","sku":"7200100196023","descr_c":"\u9ad8\u81708\u5206\u9ad8\u8170\u5fae\u5587\u957f\u88e4","fmqty_each":"1"}],"reservedfield01":"25"},{"docno":"SO201111043843","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361836","alternate_sku1":"7200401031002,,","sku":"7200401031002","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361837","alternate_sku1":"7200400539202,,","sku":"7200400539202","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"}],"reservedfield01":"56"},{"docno":"SO201111043846","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361717","alternate_sku1":"7194900359397,,","sku":"7194900359397","descr_c":"\u5973\u7ae5\u534a\u88d9","fmqty_each":"1"},{"ptltaskid":"1361718","alternate_sku1":"7199400431099,,","sku":"7199400431099","descr_c":"\u7537\u7ae5\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361719","alternate_sku1":"8201900806003,,","sku":"8201900806003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361720","alternate_sku1":"8201700341602,,","sku":"8201700341602","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"}],"reservedfield01":"20"},{"docno":"SO201111043847","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361634","alternate_sku1":"7201300771003,,","sku":"7201300771003","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361635","alternate_sku1":"8201800471003,,","sku":"8201800471003","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361636","alternate_sku1":"7201801104002,,","sku":"7201801104002","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361637","alternate_sku1":"8191800619303,,","sku":"8191800619303","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361638","alternate_sku1":"8201801061002,,","sku":"8201801061002","descr_c":"\u5973\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361639","alternate_sku1":"8206800074002,,","sku":"8206800074002","descr_c":"\u7537\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361640","alternate_sku1":"8206800084002,,","sku":"8206800084002","descr_c":"\u7537\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361641","alternate_sku1":"7201300679303,,","sku":"7201300679303","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361642","alternate_sku1":"7201300059303,,","sku":"7201300059303","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"1"},{"docno":"SO201111043854","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361798","alternate_sku1":"7201000567603,,","sku":"7201000567603","descr_c":"\u5973\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361799","alternate_sku1":"6190600320203,,","sku":"6190600320203","descr_c":"\u65e0\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361800","alternate_sku1":"6200600359203,,","sku":"6200600359203","descr_c":"\u957f\u8896\u8fde\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"43"},{"docno":"SO201111043857","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361779","alternate_sku1":"8201901126004,,","sku":"8201901126004","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361780","alternate_sku1":"8200700051004,,","sku":"8200700051004","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361781","alternate_sku1":"8190700022104,,","sku":"8190700022104","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"}],"reservedfield01":"36"},{"docno":"SO201111043861","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361651","alternate_sku1":"7192400146203,,","sku":"7192400146203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361652","alternate_sku1":"8190400274003,,","sku":"8190400274003","descr_c":"\u5973\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361653","alternate_sku1":"8197200964904,,","sku":"8197200964904","descr_c":"\u7537\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361654","alternate_sku1":"7205300121034,,","sku":"7205300121034","descr_c":"\u7537\u5408\u4f53\u4f11\u95f2\u957f\u88e4","fmqty_each":"1"}],"reservedfield01":"3"},{"docno":"SO201111043862","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361771","alternate_sku1":"7205800364003,,","sku":"7205800364003","descr_c":"\u7537\u9488\u7ec7\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361772","alternate_sku1":"7205800341003,,","sku":"7205800341003","descr_c":"\u7537\u9488\u7ec7\u957f\u88e4","fmqty_each":"1"},{"ptltaskid":"1361773","alternate_sku1":"7206400279204,,","sku":"7206400279204","descr_c":"\u7537\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361774","alternate_sku1":"7196600811004,,","sku":"7196600811004","descr_c":"\u7537\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"34"},{"docno":"SO201111043868","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361740","alternate_sku1":"7201900541003,,","sku":"7201900541003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361741","alternate_sku1":"8206200026606,,","sku":"8206200026606","descr_c":"\u7537\u957f\u8896\u886c\u886b","fmqty_each":"1"},{"ptltaskid":"1361742","alternate_sku1":"71994003410100,,","sku":"71994003410100","descr_c":"\u7537\u7ae5\u536b\u8863","fmqty_each":"1"},{"ptltaskid":"1361743","alternate_sku1":"5201900086003,,","sku":"5201900086003","descr_c":"\u6175\u61d2\u98ce\u5973\u5bbd\u677e\u5916\u7a7f\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"26"},{"docno":"SO201111043697","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361659","alternate_sku1":"8201900088402,,","sku":"8201900088402","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361660","alternate_sku1":"8200700261002,,","sku":"8200700261002","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361661","alternate_sku1":"8190700022102,,","sku":"8190700022102","descr_c":"\u534a\u8eab\u88d9","fmqty_each":"1"},{"ptltaskid":"1361662","alternate_sku1":"8196100018003,,","sku":"8196100018003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"},{"ptltaskid":"1361663","alternate_sku1":"8196100021003,,","sku":"8196100021003","descr_c":"\u7537\u957f\u8896T\u6064","fmqty_each":"1"}],"reservedfield01":"5"},{"docno":"SO201111043870","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361688","alternate_sku1":"8201900259203,,","sku":"8201900259203","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361689","alternate_sku1":"8201900258003,,","sku":"8201900258003","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"},{"ptltaskid":"1361690","alternate_sku1":"8201700059302,,","sku":"8201700059302","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361691","alternate_sku1":"7201300679303,,","sku":"7201300679303","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"}],"reservedfield01":"13"},{"docno":"SO201111043699","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361792","alternate_sku1":"8201700188402,,","sku":"8201700188402","descr_c":"\u5973\u77ed\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361793","alternate_sku1":"8201700558402,,","sku":"8201700558402","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"},{"ptltaskid":"1361794","alternate_sku1":"8191700268202,,","sku":"8191700268202","descr_c":"\u5973\u4e2d\u957f\u6b3e\u7fbd\u7ed2\u670d","fmqty_each":"1"}],"reservedfield01":"41"},{"docno":"SO201111043704","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361679","alternate_sku1":"5208500096203,,","sku":"5208500096203","descr_c":"\u7537\u889c","fmqty_each":"1"},{"ptltaskid":"1361680","alternate_sku1":"6202400356203,,NW","sku":"6202400356203","descr_c":"\u5973\u889c","fmqty_each":"1"},{"ptltaskid":"1361681","alternate_sku1":"7192400146203,,","sku":"7192400146203","descr_c":"\u5973\u889c","fmqty_each":"1"}],"reservedfield01":"10"},{"docno":"SO201111043705","customerid":"JIANSHANG","docstatus":"40","barcode_list":[{"ptltaskid":"1361801","alternate_sku1":"7201300679302,,","sku":"7201300679302","descr_c":"\u5973\u5916\u5957","fmqty_each":"1"},{"ptltaskid":"1361802","alternate_sku1":"8200500039303,,","sku":"8200500039303","descr_c":"\u5973\u77ed\u88e4","fmqty_each":"1"},{"ptltaskid":"1361803","alternate_sku1":"8201900394002,,","sku":"8201900394002","descr_c":"\u5973\u9488\u7ec7\u886b","fmqty_each":"1"}],"reservedfield01":"44"}],"edittime":"2020-11-12 07:32:34"}]}'));
//        app('LogService')->log(__METHOD__,__FUNCTION__,$response->body());
//    }
//    public function reNewBatches3()
//    {
//        $batches=Batch::query()->where('id','>',324)->get('code');
//        $batchCodes = $batches->map(function($batch){
//            return $batch['code'];
//        })->toArray();
//        $requests=[];
////        $logs=Log::query()->select('description')->where('CREATED_AT','>','2020-11-11')
////            ->where('type',"issued_newBatch")
////            ->get();
////        dd($logs);
//        foreach($batchCodes as $code){
////            $request=Cache::get('temp'.$code)['description'];
//            $request=Log::query()->select('description')->where('CREATED_AT','>','2020-11-11')
//                ->where('type',"issued_newBatch")
//                ->where('description','like',"%{$code}%")
//                ->first();
//            if($request){
//                $response=Zttp::post('https://wcs.baoshi56.com/api/thirdPart/flux/sorting/newBatch',
//                    json_decode($request['description'])
//                );
//                app('LogService')->log(__METHOD__,__FUNCTION__,$response->body());
//                $requests[]=$response->body();
//            }
////            Cache::put('temp'.$code,$request);
////            $requests[]=$request;
//        }
//        dd($requests);
//    }

    public function newSku()
    {
        $url = 'http://bswcs/api/sorting/flux/newSku';
        $response = Zttp::post($url, [
            'request' => [
                [
                    "SKU" => "1234567890",
                    "NAME" => "瑞士莲**巧克力",
                    "Alternate_SKU1" => "1122334455",
                    "GrossWeight" => "1.2",
                    "Cube" => "0.75",
                    "SKULength" => "0.25",
                    "SKUWidth" => "0.15",
                    "SKUHigh" => "0.05"
                ],
                [
                    "SKU" => "1234567892",
                    "NAME" => "跳跳饼",
                    "Alternate_SKU1" => "",
                    "GrossWeight" => "1.3",
                    "Cube" => "0.75",
                    "SKULength" => "0.25",
                    "SKUWidth" => "0.15",
                    "SKUHigh" => "0.25"
                ],
            ]
        ]);
        return $response->json();
    }

    public function changePackage()
    {
        $packages = Package::where('delivery_number', '<>', null)->where('logistic_id', null)->get();
        $packages = Package::whereRaw('delivery_number IS NOT NULL AND logistic_id IS NULL')->get();
        $logistics = Logistic::get();
        $packages->each(function ($package) use ($logistics) {
            $logistics->each(function ($logistic) use ($package) {
                if ($package->WMSReflectPackage->CarrierID == $logistic->code) {
                    $package->logistic_id = $logistic->id;
                    return;
                }
            });
        });
        return "OK";
    }

    public function deletePackageAuthority()
    {
        $authorities = Authority::where('name', 'like', '%包裹信息%')->get();
        $authorities->each(function ($authority) {
            $authority->delete();
        });
    }

    /*1*/
    function socket(Request $request)
    {/**/
        $a = microtime(true);
        error_reporting(E_ALL);
        set_time_limit(0);
        echo "<h2>TCP/IP Connection</h2>\n";

        $port = 8091;
        $ip = "127.0.0.1";
        /*
         +-------------------------------
         *    @socket连接整个过程
         +-------------------------------
         *    @socket_create
         *    @socket_connect
         *    @socket_write
         *    @socket_read
         *    @socket_close
         +--------------------------------
         */

        $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
        if ($socket < 0) {
            echo "socket_create() failed: reason: " . socket_strerror($socket) . "\n";
        } else {
            echo "OK.\n";
        }

        echo "试图连接 '$ip' 端口 '$port'...\n";
        $result = socket_connect($socket, $ip, $port);
        if ($result < 0) {
            echo "socket_connect() failed.\nReason: ($result) " . socket_strerror($result) . "\n";
        } else {
            echo "连接OK\n";
        }
        $b = microtime(true);
        echo "连接耗时：" . ($b - $a) . "\n";
        $content = Commodity::query()->limit(200)->get();

        $c = microtime(true);
        echo "查询数据耗时：" . ($c - $b) . "\n";
        $content->toArray();
        /*$chunks=$content->chunk(100);
        foreach ($chunks as $chunk){
            $chunk->toJson();
            var_dump(mb_strlen($chunk->toJson()));
            //socket_write($socket, $chunk->toJson(), mb_strlen($chunk->toJson()));
        }*/
        $d = microtime(true);
        echo "发送数据耗时：" . ($d - $c) . "\n";
        socket_close($socket);
        $e = microtime(true);
        echo "共耗时：" . ($e - $a) . "\n";
    }


    public function output()
    {
        /** @var CacheService $cacheService */
        $cacheService = app('CacheService');
        $authorities = $cacheService->getOrExecute('userxx', function () {
            return Authority::with('roles')->get();
        });
        dd($authorities);
    }

    public function output2()
    {
        StationTaskBatch::query()->insert([[
            'batch_id' => 41414351,
            'station_id' => 4131251,
            'station_task_batch_type_id' => 1231231251,
            'status' => '待处理',
            'created_at' => now(),
            'updated_at' => now(),
        ]]);
//        (new StationTaskBatch([
//            'batch_id' => 41414324,
//            'station_id' => 4131224,
//            'station_task_batch_type_id' => 123123124,
//            'status' => '待处理'
//        ]))->save();
    }


    public function changeOrder()
    {
        /**
         * @var OrderService $orderService
         */
        $carbon = Carbon::now()->subMinutes(30);
        var_dump('$orderHeader', new Carbon());
        $orderHeader_start = OracleDOCOrderHeader::query()->selectRaw(implode(',', OracleDOCOrderHeaderService::$columns))
            ->with(['oracleBASCustomer' => function ($query) {
                $query->selectRaw('BAS_CUSTOMER.CustomerID,BAS_CUSTOMER.Customer_Type,BAS_CUSTOMER.Descr_C,BAS_CUSTOMER.Active_Flag');
            }, 'oracleDOCOrderDetails' => function ($query) {
                $query->selectRaw('doc_order_details.orderNo,doc_order_details.customerid,doc_order_details.sku,doc_order_details.QtyOrdered');
            }, 'actAllocationDetails' => function ($query) {
                $query->selectRaw('ACT_Allocation_Details.AllocationDetailsID,ACT_Allocation_Details.OrderNo,ACT_Allocation_Details.Qty_Each,ACT_Allocation_Details.PickToTraceID,ACT_Allocation_Details.CustomerID,ACT_Allocation_Details.Sku');
            }, 'oracleBASCode' => function ($query) {
                $query->selectRaw('BAS_Codes.CodeID,BAS_Codes.CodeName_C,BAS_Codes.Code');
            }])
            ->where('DOC_Order_Header.addTime', '>=', $carbon)
//            ->where('DOC_Order_Header.editTime','>=',$carbon)
            ->get();
        var_dump((string)Carbon::now());

        $orderService = app('OrderService');
        $orderService->syncOrder($orderHeader_start);
//      $orderService->syncOrder($orderHeader_edit);
        var_dump((string)Carbon::now());
//      orderService  getCreateOrderModelsByWMSOrderHeaders
    }

    public function cleanOrderRepeat()
    {

        ini_set('max_execution_time', 6500);
        ini_set('memory_limit', '1526M');
        for ($i = 0; true; $i++) {
            $orders_repeating = Order::query()
                ->selectRaw('count(*) as count, code, id')
                ->whereNotNull('code')
                ->groupBy('code')
                ->having('count', '>', 1)
                ->limit(100)
                ->get();
            if ($orders_repeating->count() == 0) break;
            $orders_repeating->each(function ($order) {
                $code_repeating = $order['code'];
                $orders_toCombine = Order::query()
                    ->where('code', $code_repeating)
                    ->orderByDesc('updated_at')
                    ->get();
                $orderId_unique = (function () use ($orders_toCombine) {
                    $order_toLive = $orders_toCombine->first();
                    foreach ($orders_toCombine as $key => $order_toEliminate) {
                        if ($key == 0) continue;
                        if (!$order_toLive['batch_id']) $order_toLive['batch_id'] = $order_toEliminate['batch_id'];
                        if (!$order_toLive['owner_id']) $order_toLive['owner_id'] = $order_toEliminate['owner_id'];
                        if (!$order_toLive['status']) $order_toLive['status'] = $order_toEliminate['status'];
                        if (!$order_toLive['created_at']) $order_toLive['created_at'] = $order_toEliminate['created_at'];
                        if (!$order_toLive['code']) $order_toLive['code'] = $order_toEliminate['code'];
                        if (!$order_toLive['shop_id']) $order_toLive['shop_id'] = $order_toEliminate['shop_id'];
                        if (!$order_toLive['owner_id']) $order_toLive['owner_id'] = $order_toEliminate['owner_id'];
                        if (!$order_toLive['client_code']) $order_toLive['client_code'] = $order_toEliminate['client_code'];
                        if (!$order_toLive['logistic_id']) $order_toLive['logistic_id'] = $order_toEliminate['logistic_id'];
                        if (!$order_toLive['consignee_name']) $order_toLive['consignee_name'] = $order_toEliminate['consignee_name'];
                        if (!$order_toLive['consignee_phone']) $order_toLive['consignee_phone'] = $order_toEliminate['consignee_phone'];
                        if (!$order_toLive['province']) $order_toLive['province'] = $order_toEliminate['province'];
                        if (!$order_toLive['city']) $order_toLive['city'] = $order_toEliminate['city'];
                        if (!$order_toLive['district']) $order_toLive['district'] = $order_toEliminate['district'];
                        if (!$order_toLive['address']) $order_toLive['address'] = $order_toEliminate['address'];
                        if (!$order_toLive['wms_status']) $order_toLive['wms_status'] = $order_toEliminate['wms_status'];
                        if (!$order_toLive['status']) $order_toLive['status'] = $order_toEliminate['status'];
                        if (!$order_toLive['warehouse_id']) $order_toLive['warehouse_id'] = $order_toEliminate['warehouse_id'];
                        if (!$order_toLive['wms_edittime']) $order_toLive['wms_edittime'] = $order_toEliminate['wms_edittime'];
                    }
                    $order_toLive->save();
                    return $order_toLive['id'];
                })();
                $orderIds_toRemove = (function () use ($orders_toCombine) {
                    $orders_toCombine->shift();
                    return $orders_toCombine->map(function ($order) {
                        return $order['id'];
                    });
                })();
                OrderPackage::query()->whereIn('order_id', $orderIds_toRemove)->update(['order_id' => $orderId_unique]);
                OrderIssue::query()->whereIn('order_id', $orderIds_toRemove)->update(['order_id' => $orderId_unique]);
                OrderCommodity::query()->whereIn('order_id', $orderIds_toRemove)->update(['order_id' => $orderId_unique]);
                OrderBin::query()->whereIn('order_id', $orderIds_toRemove)->update(['order_id' => $orderId_unique]);
                Order::destroy($orderIds_toRemove);
                app('LogService')->log(__METHOD__, __FUNCTION__, 'orders_toCombine:' . json_encode($orderIds_toRemove) . '|toBe OrderId: ' . json_encode($orderId_unique));
            });
            app('LogService')->log(__METHOD__, __FUNCTION__, 'orders_repeating:' . $orders_repeating->toJson());
        }
        echo $i;
    }

    public function testImp()
    {
        $batch=Batch::query()->first();
        dump($batch->created_at);
        dump($batch->created_at<Carbon::now()->subDay());
        dump(Carbon::now()->subDay());
    }

//    public function deleteOrderInfo()
//    {
//        $orders = Order::query()->where('created_at', '>', '2020-11-17 18:00:00')->where('code', 'like', 'null%')->get();
//        $order_ids = data_get($orders, '*.id');unset($orders);
//        Order::query()->whereIn('id',$order_ids)->delete();
//
//        if(count($order_ids)==0)return;
//        $packages = OrderPackage::query()->whereIn('order_id', $order_ids)->get();
//        $packages_ids = data_get($packages, '*.id');unset($packages);
//        OrderPackage::query()->whereIn('id',$packages_ids)->delete();
//
//        if(count($packages_ids)==0)return;
//        $commoodities = OrderPackageCommodities::query()->whereIn('order_package_id',$packages_ids)->get();
//        $commooditie_ids = data_get($commoodities, '*.id');unset($commoodities);
//        OrderPackageCommodities::query()->whereIn('id',$commooditie_ids)->delete();
//
//        if(count($commooditie_ids)==0)return;
//        $tackings = OrderTracking::query()->whereIn('order_package_commodity_id',$commooditie_ids )->get();
//        $tacking_ids = data_get($tackings, '*.id');unset($tackings);
//        OrderTracking::query()->whereIn('id',$tacking_ids)->delete();
//    }
//    public function destroyOrders_()
//    {
//        $orders = Order::query()->where('created_at', '>', '2020-11-17 17:00:00')
//            ->where('code', 'like', 'null%')
//            ->where('owner_id',71)->get();
//        $orderIds = data_get($orders,'*.id');
//        $orderPackages=OrderPackage::query()->whereIn('order_id',$orderIds)->get();
//        $orderPackageIds = data_get($orderPackages,'*.id');
//        OrderPackageCommodities::query()->whereIn('order_package_id',$orderPackageIds)->delete();
//        OrderPackage::query()->whereIn('order_id',$orderIds)->delete();
//        Order::query()->whereIn('id',$orderIds)->delete();
//
//        $orderTrackings=OrderTracking::query()->where('id','>',1780)->where('created_at','0000-00-00 00:00:00')->get();
//        $orderTrackingIds = data_get($orderTrackings,'*.id');
//        OrderTracking::query()->whereIn('id',$orderTrackingIds)->delete();
//
//        app('LogService')->log(__METHOD__,__FUNCTION__,json_encode(['$orderIds'=>$orderIds,'$orderPackages'=>$orderPackages,'$orderPackageIds'=>$orderPackageIds,'$orderTrackingIds'=>$orderTrackingIds,]));
//
//    }

    public function reNewBatches3()
    {
        $batches = Batch::query()->where('id', '>', 111090)->get('code');
        $batchCodes = $batches->map(function ($batch) {
            return $batch['code'];
        })->toArray();
        dump($batchCodes);
//        $batchCodes = ['W201201000037',
//            'W201201000038',
//            'W201201000039',
//            'W201201000040',
//            'W201201000041',
//            'W201201000052',
//            'W201201000053',
//            'W201201000054',
//            'W201201000055',
//            'W201201000056',
//            'W201201000057',
//            'W201201000071',
//            'W201201000074',
//            'W201201000075',
//            'W201201000076',];
        $requests = [];
//        $logs=Log::query()->select('description')->where('CREATED_AT','>','2020-11-11')
//            ->where('type',"issued_newBatch")
//            ->get();
//        dd($logs);
        foreach ($batchCodes as $code) {
//            $request=Cache::get('temp'.$code)['description'];
            $request = Log::query()->select('description')->where('CREATED_AT', '>=', '2021-05-18 15:00')
                ->where('method', "issued_newBatch")
                ->where('description', 'like', "%{$code}%")
                ->first();
            if ($request) {
                $response = Zttp::post('https://wcs.baoshi56.com/api/thirdPart/flux/sorting/newBatch',
                    json_decode($request['description'])
                );
                app('LogService')->log(__METHOD__, __FUNCTION__, $response->body());
                $requests[] = $response->body();
            }
//            Cache::put('temp'.$code,$request);
//            $requests[]=$request;
        }
        dd($requests);
    }


    public function testUpdateSkuNameBarcodeToCommodity_id()
    {
        $amount = 1000;
        $storeItem = StoreItem::query()->orderByDesc('id')->first();
        $sum = $storeItem->id;
        $number = ceil($sum / $amount);
        for ($i = 0; $i < $number; $i++) {
            $storeItems = StoreItem::query()->with('store')
                ->where('id', '>=', $i * $amount)
                ->where('id', '<', ($i * $amount + $amount))
                ->get();
            if (count($storeItems) < 1) continue;
            $owner_ids = array_diff(array_unique(data_get($storeItems, '*.store.owner_id')), ['', ' ', '*', null]);
            $skus = array_diff(array_unique(data_get($storeItems, '*.sku')), ['', ' ', '*', null]);
            $this->addCommodityIdToStoreItem($owner_ids, $skus, $storeItems);
        }
    }

    private function addCommodityIdToStoreItem($owner_ids, $skus, $storeItems)
    {
        /**
         * @var CommodityService $commodityService
         * @var DataHandlerService $dataHandlerService
         */
        $commodityService = app(CommodityService::class);
        $dataHandlerService = app(DataHandlerService::class);
        $commodities = $commodityService->get_($owner_ids, $skus, [], true);
        $commodities_map = $dataHandlerService->dataHeader(['owner_id', 'sku'], $commodities);
        $updateParams = [[
            'id', 'commodity_id', 'updated_at'
        ]];
        foreach ($storeItems as $storeItem) {
            $commodity = $dataHandlerService
                ->getKeyValue(['owner_id' => $storeItem->store->owner_id, 'sku' => $storeItem->sku], $commodities_map);
            if (!$commodity) continue;
            $updateParams[] = [
                'id' => $storeItem->id,
                'commodity_id' => $commodity->id,
                'updated_at' => Carbon::now()->toDateTimeString(),
            ];
        }
        if (count($updateParams) > 0) app(BatchUpdateService::class)->batchUpdate('store_items', $updateParams);
    }

    function testUpdateStores()
    {
        $stores = Store::query()->where('stored_method', '快速入库')->get();
        $updated_at = Carbon::now()->toDateTimeString();
        $updateParams = [[
            'id', 'is_fast_stored', 'updated_at'
        ]];
        foreach ($stores as $store) {
            if ($store->stored_method != '快速入库') continue;
            $updateParams[] = [
                'id' => $store->id,
                'is_fast_stored' => '快速入库',
                'updated_at' => $updated_at,
            ];
        }
        if (count($updateParams) > 1) app(BatchUpdateService::class)->batchUpdate('stores', $updateParams);
    }

    public function testSyncAsn()
    {
//        dump('hendle...');
        dump((string)Carbon::now());
//        dump(memory_get_usage() / 1024 / 1024);
        $task = new WasSyncWmsAsnInformation();
        $task->handle();
        dump((string)Carbon::now());
//        dump('hendle...end');
//        dump(memory_get_usage() / 1024 / 1024);
//        dump(memory_get_peak_usage() / 1024 / 1024);
//        return view('test');
    }

    public function editOrderSyncAt()
    {
        ValueStore::query()->where('name', 'order_last_created_sync_at')->update(['value' => '2020-12-22 09:00:00']);
        ValueStore::query()->where('name', 'order_last_updated_sync_at')->update(['value' => '2020-12-22 09:00:00']);
    }

    public function testHz()
    {
        dump('start' . Carbon::now()->toDateTimeString());
        $ownerAreaReportTask = new CreateOwnerAreaReport();
        $ownerAreaReportTask->handle();
        $ownerBillReportTask = new CreateOwnerBillReport();
        $ownerBillReportTask->handle();
        $ownerReportTask = new CreateOwnerReport();
        $ownerReportTask->handle();
        dump('end' . Carbon::now()->toDateTimeString());
    }

    public function testGetLogisticNumbers(): array
    {
        $orderPackageReceivedSyncService = new OrderPackageReceivedSyncService();
        return $orderPackageReceivedSyncService->getLogisticNumbers();
    }

    public function test_orderPackage_updated()
    {
        $orderPackageReceivedSyncService = new OrderPackageReceivedSyncService();
        $response = $orderPackageReceivedSyncService->getLogisticRoutes(['SF' => ['SF1038343374236']]);

        $orderPackage = OrderPackage::query()->where('logistic_number', 'SF1038343374236')->first();
        $orderPackage->transfer_status = json_decode($orderPackage->transfer_status);

        $orderPackageReceivedSyncService->update($response);
        $orderPackage = OrderPackage::query()->where('logistic_number', 'SF1038343374236')->first();
        $orderPackage->transfer_status = json_decode($orderPackage->transfer_status);
        dump($orderPackage);
    }

    public function logistic_route_sync()
    {
        $orderPackageReceivedSyncService = new OrderPackageReceivedSyncService();
        $orderPackageReceivedSyncService->syncLogisticRoute();
    }

    public function logistic_route_sync_ZT()
    {
        $service = new LogisticZopService();
        $result = $service->get([]);
        dd($result);
    }

    public function sendEmail()
    {
        event(new SendEmailEvent());
    }

    public function ld2()
    {
        $m=MaterialBox::query()->first();
        dump($m);
        $m['status'] = '在缓存架';
        dump($m['status']);
        $m->update();
        $m=MaterialBox::query()->first();
        dump($m['status']);

    }
    public function y111()
    {
        $controller = new SendEmailsController();
        $controller->index();
    }

    public function updateRejectBillCheckedStatus()
    {
        $time = Carbon::parse("2021-01-22 00:00:00")->subDays(15)->toDateTimeString();
        $asnHeaders = OracleDOCASNHeader::query()
            ->where('addtime', '>=', $time)
            ->select('asnno', 'addtime', 'edittime', 'customerid', 'notes', 'asnreference3')
            ->get();
        $chunks = $asnHeaders->chunk(1000);
        foreach ($chunks as $chunk) {
            /** @var RejectedBillService $rejectedBillService */
            $rejectedBillService = app(RejectedBillService::class);
            $updates = $rejectedBillService->getNeedUpdateCheckedStatusByWms($chunk);
            app(BatchUpdateService::class)->batchUpdate('rejected_bills', $updates);
        }
    }


    public function updateLaborReport()
    {
        UserDutyCheck::query()->find(13565)->update(['user_id' => 1004]);
        LaborReportStatus::query()->find(26614)->update(['labor_report_id' => 6835]);
    }

    public function cleanLaborsCache()
    {
        $beginDate = now()->subYears(1)->startOfDay();
        $now = now()->startOfDay();
        $dateList = $beginDate->daysUntil($now, 1);
        $count = 0;
        foreach ($dateList as $date) {
            $key = 'laborReportsCountingRecords_' . $date->toDateString() . '_' . '日';
            $bool = Cache::forget($key);
            if ($bool) {
                $count++;
            }
        }
        return $count;
        $procurementQuotations = ProcurementQuotation::query()
            ->with('procurement.ownerMaterial.material')
            ->where('status', 0)
            ->whereNull('offer')
            //->where('created_at','>=',Carbon::parse($now)->subHours(4))
            //->where('created_at','<=',$now)
            ->get();
        dd($procurementQuotations->toJson());
    }

    public function deleteRepetitionSku()
    {
        $Commodities = Commodity::query()->selectRaw('owner_id,sku,count(1) as counts ')->whereNotNull(['owner_id', 'sku'])->groupBy('owner_id', 'sku')->having('counts', '>', '1')->get();
        $CommodityItems = $Commodities->chunk(200);
        foreach ($CommodityItems as $items) {
            $Commodities = Commodity::query()->whereIn('owner_id', data_get($items, '*.owner_id'))->whereIn('sku', data_get($items, '*.sku'))->get();
            $arr = collect($Commodities->toArray());
            $arr = $arr->groupBy(['owner_id', 'sku']);
            foreach ($arr as $item) {
                foreach ($item as $value) {
                    if (count($value) <= 1) continue;
                    dispatch(new DeleteRepetitionSkuItem($value));
                }
            }
        }
    }
    public function addProcurementData()
    {
        $this->syncUserDetail();
        $this->addProcurementDeliver();
        $this->addProcurement();
        $this->addProcurementQuotation();
        $this->addProcurementCheckSheet();
    }
    public function syncUserDetail()
    {
        $sql=DB::raw('SELECT * from user where supplierid is not null');
        $params = DB::connection('erp')->select($sql);
        $user_Details=UserDetail::query()->where('created_at','like','2021-04-12%')->get();
        $dataHandlerService = app(DataHandlerService::class);
        $user_Details_map = $dataHandlerService->dataHeader(['mobile_phone'], $user_Details);
        foreach ($params as $param){
            $user_detail = $dataHandlerService->getKeyValue(['mobile_phone' => $param->mobile], $user_Details_map);
            if (!$user_detail) continue;
            $user_detail->update(['procurement_wechat_open_id'=>$param->openid]);
        }
    }

    public function addProcurementDeliver(){
        //送货单
        $sql=DB::raw('SELECT
deliver.id id,request.id procurement_id,deliver.delivernum amount,deliver.status status,deliver.accepttime signed_at,
deliver.createtime created_at,deliver.createtime updated_at,deliver.confirmnum receipt_amount
from deliver
LEFT JOIN purch on deliver.purchid=purch.id
LEFT JOIN ask on purch.askid=ask.id
LEFT JOIN request on ask.requestid=request.id
where purch.islower=1');
        $params = DB::connection('erp')->select($sql);
        $insert=[];
        foreach ($params as $param){
            $insert[]=[
                'id'=>$param->id,
                'procurement_id'=>$param->procurement_id,
                'amount'=>$param->amount,
                'status'=>$param->status?$param->status-1:$param->status,
                'signed_at'=>Carbon::parse($param->signed_at)->toDateString(),
                'created_at'=>Carbon::parse($param->created_at)->toDateTimeString(),
                'updated_at'=>Carbon::parse($param->updated_at)->toDateTimeString(),
                'receipt_amount'=>$param->receipt_amount,
            ];
        }
        ProcurementDeliverie::query()->insert($insert);
    }

    public function addProcurement()
    {

        //采购单
        $sql=DB::raw('select request.id id,
request.number code,request.type type,request.resourceid owner_material_id,purch.supplierid supplier_id,request.num quantity, request.sellnum amount,
request.price unit_price,purch.acceptprice cost_price,request.status status,request.createtime created_at,request.createtime updated_at,
purch.accepttime deadline
from purch
LEFT JOIN ask on purch.askid= ask.id
LEFT JOIN request on ask.requestid=request.id
where purch.islower=1 and request.type=3 ORDER BY request.id ASC');
        $params = DB::connection('erp')->select($sql);
        $insert=[];
        foreach ($params as $param){
            if (!$param->status)continue;
            if ($param->status==0)$status=10;
            if ($param->status==1)$status=0;
            if ($param->status==2)$status=1;
            if ($param->status==3)$status=2;
            if ($param->status==4)$status=11;
            if ($param->status==5)$status=4;
            if ($param->status==6)$status=5;
            if ($param->status==7)$status=6;
            if ($param->status==8)$status=8;
            if ($param->status==9)$status=9;
            $key=$param->id;
            $insert[$key]=[
                'id'=>$param->id,
                'code'=>$param->code,
                'type'=>0,
                'owner_material_id'=>$param->owner_material_id,
                'supplier_id'=>$param->supplier_id,
                'quantity'=>$param->quantity,
                'amount'=>$param->amount,
                'unit_price'=>$param->unit_price,
                'cost_price'=>$param->cost_price,
                'initiator'=>0,
                'status'=>$status,
                'created_at'=>Carbon::parse($param->created_at)->toDateTimeString(),
                'updated_at'=>Carbon::parse($param->updated_at)->toDateTimeString(),
                'deadline'=>Carbon::parse($param->deadline)->toDateTimeString(),
            ];
        }
        Procurement::query()->insert($insert);

        //打样 或者 询价
        $procurement_ids=Procurement::query()->select('id')->get();
        $ids = $procurement_ids->map(function($procurement){
            return $procurement['id'];
        });
        $idSql = "(''";
        foreach ($ids as $id)$idSql.=",".$id;
        $idSql .= ")";
        $sql=DB::raw('select * from request where id  not in '.$idSql);
        $params=DB::connection('erp')->select($sql);
        $insert=[];
        foreach ($params as $param){
            if (!$param->status)continue;
            if (!$param->type)continue;
            if ($param->status==0)$status=10;
            if ($param->status==1)$status=0;
            if ($param->status==2)$status=1;
            if ($param->status==3)$status=2;
            if ($param->status==4)$status=11;
            if ($param->status==5)$status=4;
            if ($param->status==6)$status=5;
            if ($param->status==7)$status=6;
            if ($param->status==8)$status=8;
            if ($param->status==9)$status=9;
            if ($param->type==3){
                $type=0;
            }else{
                $type=$param->type;
            }
            $insert[$param->id]=[
                'id'=>$param->id,
                'code'=>$param->number,
                'type'=>$type,
                'owner_material_id'=>$param->resourceid,
                'quantity'=>$param->num,
                'amount'=>$param->sellnum,
                'unit_price'=>$param->price,
                'initiator'=>0,
                'status'=>$status,
                'created_at'=>Carbon::parse($param->createtime)->toDateTimeString(),
                'updated_at'=>Carbon::parse($param->createtime)->toDateTimeString(),
                'deadline'=>Carbon::parse($param->createtime)->subHours(-4)->toDateTimeString(),
            ];
        }
        Procurement::query()->insert($insert);

        //删除没有项目耗材的采购记录
        $OwnerMaterialIds=OwnerMaterial::query()->select('id')->get();
        $Procurements=Procurement::query()->whereNotIn('owner_material_id',$OwnerMaterialIds)->get();
        $data=[];
        foreach ($Procurements as $procurement){
            $data[]=$procurement->owner_material_id;
            $procurement->delete();
        }
    }
    public function addProcurementQuotation(){
        //报价单
        $procurement_ids=Procurement::query()->select('id')->get();
        $ids = $procurement_ids->map(function($procurement){
            return $procurement['id'];
        });
        $idSql = "(''";
        foreach ($ids as $id)$idSql.=",".$id;
        $idSql .= ")";
        $sql=DB::raw('SELECT purch.id id,request.id procurement_id,purch.supplierid supplier_id,
purch.acceptprice offer,purch.accepttime quoted_at,purch.status status,
purch.accepttime created_at,purch.accepttime updated_at
FROM purch
LEFT JOIN ask on purch.askid=ask.id
LEFT JOIN request on ask.requestid=request.id
where request.id in'.$idSql);
        $params=DB::connection('erp')->select($sql);
        foreach ($params as $param){
            $key=$param->id;
            $insert[$key]=[
                'id'=>$param->id,
                'procurement_id'=>$param->procurement_id,
                'supplier_id'=>$param->supplier_id,
                'offer'=>$param->offer,
                'status'=>$param->status,
                'quoted_at'=>Carbon::parse($param->quoted_at)->toDateTimeString(),
                'created_at'=>Carbon::parse($param->created_at)->toDateTimeString(),
                'updated_at'=>Carbon::parse($param->updated_at)->toDateTimeString(),
            ];
        }
        ProcurementQuotation::query()->insert($insert);
    }
    public function addProcurementCheckSheet(){
        //对账单
        $procurement_delivers=ProcurementDeliverie::query()->get();
        $dataHandlerService = app(DataHandlerService::class);
        $procurement_delivers_map = $dataHandlerService->dataHeader(['procurement_id'], $procurement_delivers);
        $sql=DB::raw('select request.id procurement_id,billdetail.billno invoice_number,billdetail.status status,purch.acceptnum amount,purch.acceptprice price,
purch.accepttime created_at,purch.accepttime updated_at
FROM billdetail
LEFT JOIN purch on purch.id=billdetail.purchid
LEFT JOIN ask on purch.askid=ask.id
LEFT JOIN request on ask.requestid=request.id
where purch.islower=1');
        $params=DB::connection('erp')->select($sql);

        $insert=[];
        foreach ($params as $param){
            $procurement_deliver = $dataHandlerService->getKeyValue(['procurement_id' => $param->procurement_id], $procurement_delivers_map);
            if (!$procurement_deliver) continue;
            $insert[$param->procurement_id]=[
                'procurement_delivery_id'=>$procurement_deliver->id,
                'invoice_number'=>$param->invoice_number??null,
                'account_payable'=>$param->amount*$param->price,
                'status'=>$param->status,
                'created_at'=>$param->created_at,
                'updated_at'=>$param->updated_at,
            ];
        }
        ProcurementCheckSheet::query()->insert($insert);
    }

    public function order_packages_exception_type_sync()
    {
        $count = OrderPackage::query()->where('status', '派送异常')->update(['exception_type' => '派件异常','exception' => '是']);
        dump('更新了： '.$count);
    }

    public function order_packages_exception_type_and_exception_update()
    {
        $count_1 = OrderPackage::query()
            ->whereIn('exception_type', ['疑似库内丢件','揽件异常'])
            ->whereNotNull('transfer_status')
            ->update(['exception_type' => '无','exception' => '否']);
        $count_2 =   OrderPackage::query()
            ->where('status','已收件')
            ->update(['exception_type' => '无','exception' => '否']);
        dump('更新了： '.($count_1 + $count_2));
    }
    public function addProcurementDeliverAndCheckMeet()
    {
        $id=ProcurementDeliverie::query()->orderByDesc('id')->value('id');
        $sql=DB::raw('SELECT
deliver.id id,request.id procurement_id,deliver.delivernum amount,deliver.status status,deliver.accepttime signed_at,
deliver.createtime created_at,deliver.createtime updated_at,deliver.confirmnum receipt_amount
from deliver
LEFT JOIN purch on deliver.purchid=purch.id
LEFT JOIN ask on purch.askid=ask.id
LEFT JOIN request on ask.requestid=request.id
where purch.islower=1 and deliver.id>'.$id);
        $params = DB::connection('erp')->select($sql);
        $insert=[];
        foreach ($params as $param){
            $insert[]=[
                'id'=>$param->id,
                'procurement_id'=>$param->procurement_id,
                'amount'=>$param->amount,
                'status'=>$param->status?$param->status-1:$param->status,
                'signed_at'=>Carbon::parse($param->signed_at)->toDateString(),
                'created_at'=>Carbon::parse($param->created_at)->toDateTimeString(),
                'updated_at'=>Carbon::parse($param->updated_at)->toDateTimeString(),
                'receipt_amount'=>$param->receipt_amount,
            ];
        }
        ProcurementDeliverie::query()->insert($insert);

        $procurement_delivers=ProcurementDeliverie::query()->where('id','>',$id)->get();
        $dataHandlerService = app(DataHandlerService::class);
        $procurement_delivers_map = $dataHandlerService->dataHeader(['procurement_id'], $procurement_delivers);
        $sql=DB::raw('SELECT deliver.id id,request.id procurement_id,
deliver.createtime created_at,deliver.createtime updated_at,purch.acceptnum amount,purch.acceptprice price
from deliver
LEFT JOIN purch on deliver.purchid=purch.id
LEFT JOIN ask on purch.askid=ask.id
LEFT JOIN request on ask.requestid=request.id
where purch.islower=1 and deliver.id>'.$id);
        $params=DB::connection('erp')->select($sql);
        $insert_=[];
        foreach ($params as $param){
            $procurement_deliver = $dataHandlerService->getKeyValue(['procurement_id' => $param->procurement_id], $procurement_delivers_map);
            if (!$procurement_deliver) continue;
            $insert_[$param->procurement_id]=[
                'procurement_delivery_id'=>$procurement_deliver->id,
                'account_payable'=>$param->amount*$param->price,
                'status'=>0,
                'created_at'=>$param->created_at,
                'updated_at'=>$param->updated_at,
            ];
        }
        ProcurementCheckSheet::query()->insert($insert_);
    }
    public function updateProcurementCheckSheet()
    {
        $pro=ProcurementDeliverie::query()->find(515);
        $pro->update([
            'signed_at'=>'2021-04-02',
            'created_at'=>'2021-04-02 08:34:51',
            'updated_at'=>'2021-04-02 08:34:51',
        ]);
        $pro=$pro->loadMissing('procurement');
        ProcurementCheckSheet::query()->create([
            'procurement_delivery_id'=>$pro['id'],
            'account_payable'=>$pro['procurement']['cost_price']*$pro['receipt_amount'],
            'created_at'=>$pro['created_at'],
            'updated_at'=>$pro['updated_at'],
        ]);
        $collect=ProcurementDeliverie::query()->with('procurement')->where('id','>=',517)
            ->where('id','<=',528)->get();
        $insert=[];

        foreach ($collect as $item){
            if ($item['receipt_amount']==0){
                $receipt_amount=$item['amount'];
            }else{
                $receipt_amount=$item['receipt_amount'];
            }
            $insert[]=[
                'procurement_delivery_id'=>$item['id'],
                'account_payable'=>$item['procurement']['cost_price']*$receipt_amount,
                'created_at'=>$item['created_at'],
                'updated_at'=>$item['updated_at'],
            ];
        }
        ProcurementCheckSheet::query()->insert($insert);
    }
    public function testPro(){
        /**@var SupplierService $supplierService*/
        $supplierService=app(SupplierService::class);
        $supplier_ids=$supplierService->screenSupplierIds();
//        $status=0;
//        $procurements=Procurement::query()
//            ->withCount('procurementQuotations')
//            ->with('ownerMaterial.material')
//            ->where('status',$status)
//            ->whereHas("ownerMaterial",function (Builder $query)use($supplier_ids){
//                $query->whereHas("material",function (Builder $query)use($supplier_ids){
//                    $query->whereHas("supplier",function (Builder $query)use($supplier_ids){
//                        $query->whereIn('id',$supplier_ids);
//                    });
//                });
//            })
//            ->get();
//        $keys = [];
//        foreach ($procurements as $key=>$procurement){
////            if ($procurement->procurement_quotations_count>0 && $status==0 )$keys[]= $key;
//            if ($procurement->type==2 && $procurement->supplier_id )$keys[]= $key;
//            if (Carbon::parse($procurement->deadline)->gt(Carbon::now())) $procurement->deadline=Carbon::parse($procurement->deadline)->diffInMilliseconds();
//            else $procurement->deadline=0;
//        }
//        $procurements = $procurements->diffKeys($keys);
//        dd($procurements);
        $status=0;//0:待报价,2:待接单
        $procurements=Procurement::query()
            ->withCount('procurementQuotations')
            ->with(['ownerMaterial.material','procurementQuotations'])
            ->where('status',$status)
            ->get();
        dd($procurements);
        $keys = [];
        foreach ($procurements as $key=>$procurement){
            if ($procurement->procurement_quotations_count>0 ){
                foreach ($procurement->procurementQuotations as $procurementQuotation){
                    if (in_array($procurementQuotation->supplier_id,$supplier_ids))$keys[]= $key;
                }
            }
            if ($procurement->type==2 && $procurement->supplier_id )$keys[]= $key;
            if (Carbon::parse($procurement->deadline)->gt(Carbon::now())) $procurement->deadline=Carbon::parse($procurement->deadline)->diffInMilliseconds();
            else $procurement->deadline=0;
        }
        $procurements = $procurements->diffKeys($keys);
        dd($procurements);
    }

    public function pushToWmsWeight()
    {
        $orderPackages = OrderPackage::query()->where('measuring_machine_id',12)->where('uploaded_to_wms','!=','是')->whereNotNull('weight')->get();
        $packageController = new WeightBaseController();
        foreach ($orderPackages as $orderPackage) {
            $packageController->activityWaveNoProcessing($orderPackage);
        }
    }

    public function firstAndCreated()
    {
        $arr = ['name' => '缓存货架3'];
        $created = ['name'=>'缓存货架3','station_type_id' => (function(){
            $type =StationType::query()->where('name','缓存架')->first();
            return $type['id'];
        })()];
        $station = Station::query()->firstOrCreate($arr,$created);
        dd($station);
    }


    public function syncOrderTracking()
    {
        $orderNos = ['OSSO21040013','OSSO21040012'];
        $service = new OrderTrackingService();
        $orderHeaderService = new OracleDOCOrderHeaderService();
        $orderHeaders = $orderHeaderService->getQuery()->whereIn('DOC_Order_Header.SoReference1',$orderNos)->get();
        $service->createByWmsOrderHeader($orderHeaders);
        $service->updateByWmsOrderHeaders($orderHeaders);
    }

    public function testArr()
    {
        $serialNos = OracleDocOrderSerialNo::query()->selectRaw('OrderNo')->get();
        $orderNos  = data_get($serialNos,'*.orderno');
        $service = app(OrderTrackingService::class);
        $orderHeadService = app(OracleDOCOrderHeaderService::class);
        $orderHeaders = $orderHeadService->getOrderTracking()->whereIn('DOC_Order_Header.OrderNo',$orderNos)->get();
        app(OrderService::class)->syncOrderByWMSOrderHeaders($orderHeaders);
        app("OrderCommodityService")->syncOrderCommodity($orderHeaders);
        app('OrderPackageService')->syncOrderPackage($orderHeaders);
        app("OrderPackageCommoditiesService")->syncOrderPackageCommodities($orderHeaders);
        app('OrderPackageCommoditySerialNumberService')->syncOrderPackageCommoditySerialNumbers($orderHeaders);
        $service->createByWmsOrderHeader($orderHeaders);
    }
    public function addHaiBox(Request $request)
    {
        echo <<<TEXT
    <form>
    <textarea name="boxes">

</textarea>
<input type="submit"/>
</form>
TEXT;
        $input = $request->input('boxes');
        if($input){
            $input=preg_replace('/[\n\r]/',',',trim($input));
            $boxes=explode(',',$input);
            dd($boxes);
        }
    }


    public function order(){
        MeasuringMachine::query()->firstOrCreate(['code'=>'hengli003'],['name'=>'hengli003']);
    }

    public function testProcurement()
    {
        $procurementTotals = ProcurementTotalBill::query()
            ->where('status', 1)
            ->where('counting_month', '2021-04-01')
            ->get();
        foreach ($procurementTotals as $procurementTotalBill) {
            /** @var  ProcurementTotalBill $procurementTotalBill */
            $procurementTotalBill->setCurrentMothProcurements();
            if (isset($procurementTotalBill->procurementCheckSheets)) {
                $procurementCheckSheets = $procurementTotalBill->procurementCheckSheets;
                foreach ($procurementCheckSheets as $procurementCheckSheet) {
                    $procurementCheckSheet->update(['status' => 2]);//2 已出账
                }
            }
        }
    }

    public function testHttp()
    {
        return view('httpTest');
    }

    public function updateStation()
    {
//        $hid = 'hengli004';
//        $measuringMachine = MeasuringMachine::query()->firstOrCreate(['code' => $hid],['name' => $hid]); // 称重设备
        StationTask::query()->where('id',709)->update(
            ['status'=>'完成']
        );
//        StationTaskMaterialBox::query()->where('id',7033)->delete();
//        Station::query()->where('id',9)->delete();
//        Station::query()->where('code' ,'缓存架01')->update(['code' => 'B1']);
//        Station::query()->where('code' ,'缓存架02')->update(['code' => 'B2']);
//        Station::query()->where('name' ,'HAI缓存架01-03-03')->update(['name' => 'HAIB1-03-03']);
    }

    public function orderPackageUnique()
    {
        // select logistic_number,count(1) counts from order_packages where id >= 1590001   GROUP BY logistic_number HAVING counts > 1;
        $orderPackages = OrderPackage::query()->selectRaw('count(1) counts,logistic_number')->where('id','>=','1590000')->groupBy('logistic_number')->having('counts','>','1')->get();
        dd($orderPackages);
        foreach ($orderPackages as $orderPackage) {
            $items = OrderPackage::query()->where('logistic_number',$orderPackage['logistic_number'])->get();
            $orderPackage = $items->first();
            foreach ($items as $item) {
                $orderPackage['batch_number'] = $item['batch_number'] ?? $orderPackage['batch_number'];
                $orderPackage['batch_rule'] = $item['batch_rule'] ?? $orderPackage['batch_rule'];
                $orderPackage['bulk'] = $item['bulk'] ?? $orderPackage['bulk'];
                $orderPackage['weight'] = $item['weight'] ?? $orderPackage['weight'];
                $orderPackage['length'] = $item['length'] ?? $orderPackage['length'];
                $orderPackage['width'] = $item['width'] ?? $orderPackage['width'];
                $orderPackage['height'] = $item['height'] ?? $orderPackage['height'];
                $orderPackage['measuring_machine_id'] = $item['measuring_machine_id'] ?? $orderPackage['measuring_machine_id'];
                $orderPackage['weighed_at'] = $item['weighed_at'] ?? $orderPackage['weighed_at'];
                $orderPackage['owner_id'] = $item['owner_id'] ?? $orderPackage['owner_id'];
                $orderPackage['received_at'] = $item['received_at'] ?? $orderPackage['received_at'];
                $orderPackage['transfer_status'] = $item['transfer_status'] ?? $orderPackage['transfer_status'];
                $orderPackage['status'] = $item['status'] != '无' ? $item['status'] : $orderPackage['transfer_status'];
                $orderPackage['uploaded_to_wms'] = $item['uploaded_to_wms'] != '否' ? $item['uploaded_to_wms'] : $orderPackage['transfer_status'];
            }
            $orderPackages_filter = $items->filter(function($item)use($orderPackage){
                if($orderPackage['id'] === $item['id'])return false;
                return true;
            });
            $ids = $orderPackages_filter->map(function($item){
                return $item['id'];
            });
            LogService::log('order_packages','order_packages_logistic_number_unique_delete',json_encode($orderPackages_filter));
            OrderPackage::query()->whereIn('id',$ids)->delete();
            $orderPackage->save();
        }
    }

    public function endStationTask()
    {
        $stationTask = StationTask::query()->where('id',711)->first();
        $stationTask->update(['status'=>'完成']);
    }

    public function order_package_exception_type_counting_record_init()
    {
        /**
         * @var $service OrderPackageExceptionTypeCountingRecordService
         */
        $service = app('OrderPackageExceptionTypeCountingRecordService');
        $service->updateOrCreate(30);
    }
}
