<?php

namespace App\Http\Controllers;


use App\Authority;
use App\Commodity;
use App\CommodityBarcode;
use App\Events\CancelOrder;
use App\Imports\OrderTrackingImport;
use App\InventoryAccount;
use App\LaborReport;
use App\Log;
use App\Logistic;
use App\OracleActAllocationDetails;
use App\OracleDOCOrderHeader;
use App\OracleDocOrderPackingSummary;
use App\OracleDOCWaveDetails;
use App\Order;
use App\OrderBin;
use App\OrderCommodity;
use App\OrderIssue;
use App\OrderPackage;
use App\Owner;
use App\Package;
use App\Process;
use App\ProcessDaily;
use App\ProcessStatistic;
use App\RejectedBill;
use App\RejectedBillItem;
use App\Services\CacheService;
use App\Services\common\BatchUpdateService;
use App\Services\common\DataHandlerService;
use App\Services\InventoryCompareService;
use App\Services\OracleDocAsnHerderService;
use App\Services\OracleDOCOrderHeaderService;
use App\Services\OrderPackageService;
use App\Services\OrderService;
use App\Services\OrderTrackingOwnerService;
use App\Services\OrderTrackingService;
use App\Services\OwnerService;
use App\Services\StoreService;
use App\Services\WarehouseService;
use App\Unit;
use App\User;
use App\Warehouse;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Maatwebsite\Excel\Facades\Excel;
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 updateInventory(){
        $inventoryAccounts=InventoryAccount::query()->get();
        $updateParams = [[
            'id','processed','ignored','updated_at'
        ]];
        $updated_at=Carbon::now()->toDateTimeString();
        foreach ($inventoryAccounts as $inventoryAccount){
            if ($inventoryAccount->getIgnoredAmount()>0){
                $updateParams[] = [
                    'id'=>$inventoryAccount->id,
                    'processed'=>$inventoryAccount->getProcessedAmount(),
                    'ignored' => $inventoryAccount->getIgnoredAmount(),
                    'updated_at'=>$updated_at,
                ];
            }
        }
        if(count($updateParams) > 1){
            app(BatchUpdateService::class)->batchUpdate('inventory_accounts',$updateParams);
        }
    }
    public function test4(){
        DB::beginTransaction();
        Unit::query()->lockForUpdate()->where("id",14)->first();
        for($i=0;$i<=100;$i++){
            sleep(1);
            var_dump($i);
        }
    }

    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);
        }
    }
    public function test2(){
        $b = Logistic::query()->first();
        $a = OrderPackage::query()->with("order")->first();
        $a->bulk = 521;
        $a->save();
        if (!$a->order) $a->order = new Order();
        dd($a);
        if (!$a->order->logistic)$a->order->logistic = $b;
        dd($a->order->logistic);
        dd($a);
        $a->save();
        dd($a);
    }

    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 wmsSql()
    {
        $owner=Owner::first();
//        $owner['phone_number'] ?? $owner['phone_number'] = '31115';
//        $owner->update();
        dd($owner);
    }
    function issues()
    {
        /** @var OrderPackageService $orderPackageService */
        $orderPackageService = app('OrderPackageService');
        $ids = [741, 739, 738, 736, 735, 733, 732, 731, 730, 729, 728, 725, 724, 723, 721, 720, 719, 718, 717, 715, 714, 713, 712, 711, 710, 705, 703, 702, 701, 700, 699, 698, 696, 694, 693, 692, 691, 690];
        $orderIssues = OrderIssue::query()->whereIn('id', $ids)->get();
        $order_ids = data_get($orderIssues, '*.order_id');
        $orders = Order::query()->whereIn('id', $order_ids)->get();
        foreach ($orders as $item) {
            $orderPackageService->createdByOrder($item);
        }
    }

    function t2(Request $request)
    { //x        $packagesBatch=Package::where('batch_number',$batch_number)->first();


        $inventoryCompareService = new InventoryCompareService();
        echo ($inventoryCompareService)->getCreatingMissionCode('安桥主品');
        echo ($inventoryCompareService)->getCreatingMissionCode('安桥主品');
        echo ($inventoryCompareService)->getCreatingMissionCode('安桥主品');
        echo ($inventoryCompareService)->getCreatingMissionCode('安桥主品');
    }

    function tlog(Request $request)
    {
        app('LogService')->log(__METHOD__,'cczdelme'.__FUNCTION__,json_encode($request->all()),null);
    }
    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 t1(Request $request)
    {
        {
            $username = config('database.connections.oracle.username');
            $password = config('database.connections.oracle.password');
            $host = config('database.connections.oracle.host');
            $service_name = config('database.connections.oracle.service_name');
            $conn = oci_connect($username, $password, $host . '/' . $service_name); //连接oracle数据库
            $IN_WarehouseID = '';
            $IN_TraceID = '';
            $IN_WavenNo = '';
            $IN_UserID = '';
            $IN_Language = '';
            $OUT_Return_Code = '';
            $sql_sp = "begin SPCUS_EDI_WCS001(:IN_WarehouseID,:IN_Process_Action_C,:IN_Process_By_C,
        :IN_WaveNO_C,:IN_OrderNO_C,:IN_OrderLineNO_C,:IN_AllocationDetailsID,:IN_Language,:IN_UserID,:OUT_Return_Code); end;";
            $stmt = oci_parse($conn, $sql_sp);
            oci_bind_by_name($stmt, ':IN_Warehouse', $IN_WarehouseID);
            oci_bind_by_name($stmt, ':IN_TraceID', $IN_TraceID);
            oci_bind_by_name($stmt, ':IN_WavenNo', $IN_WavenNo);
            oci_bind_by_name($stmt, ':IN_Language', $IN_Language);
            oci_bind_by_name($stmt, ':IN_UserID', $IN_UserID);
            oci_bind_by_name($stmt, ':OUT_Return_Code', $OUT_Return_Code);
            return oci_execute($stmt);

        }


    }


    function packageT(Request $request)
    {
        $package = Package::where('created_at', '<', '2020-07-08')->whereNotNull('logistic_number')->first();
        $package->fetchLogistic();
    }

    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)
    {
        $numbersesOfBatch = OracleDOCWaveDetails::select('picktotraceid as logistic_number', 'act_allocation_details.orderno')->where('doc_wave_details.waveno', 'W190630000042')
            ->leftJoin('act_allocation_details', 'doc_wave_details.orderno', 'act_allocation_details.orderno')->get();

        $oneIdxAsrsReceive = OracleDocOrderPackingSummary::where('traceid', $numbersesOfBatch[0]['logistic_number'])->first();
        if (!$oneIdxAsrsReceive) {
            $inserts = '';
            $values = [];
            foreach ($numbersesOfBatch as $numbers) {
                $inserts .= " into doc_order_packing_summary (traceid,orderno,grossweight,addwho,addtime,editwho,edittime)values(?,?,?,?,?,?,?) ";
                $values[] = $numbers['logistic_number'] ?? '';
                $values[] = $numbers['orderno'] ?? '';
                $values[] = 12;
                $values[] = 'WAS';
                $values[] = Carbon::now();
                $values[] = 'WAS';
                $values[] = Carbon::now();
            }
            DB::connection('oracle')->insert("insert all {$inserts} select * from dual", $values);
        } else {
            $logisticNumbers = $numbersesOfBatch->map(function ($numbers) {
                return $numbers['logistic_number'];
            });
            OracleDocOrderPackingSummary::whereIn('traceid', $logisticNumbers)->update(['grossweight' => 32]);
        }
    }

    public function delme()
    {
        $fields = [
            'doc_order_header.userdefine1',
            'doc_order_header.userdefine2',
            'doc_order_header.SOReference5',
            'doc_order_header.waveno',
            'doc_order_header.orderno',
            'doc_order_header.customerid',
            'doc_order_header.Consigneename'
        ];
        if ('') {
            $resultOracleObj = OracleDOCOrderHeader::select($fields)->where('orderno', 'SO200603004708');
        } else {
            $resultOracleObj = OracleActAllocationDetails::select($fields);
            $resultOracleObj->where('picktotraceid', '546152742096');
            $resultOracleObj->leftJoin('DOC_Order_Header', 'act_allocation_details.orderno', 'doc_order_header.orderno');
        }
        $_temOracleInfo = $resultOracleObj->first();

        dd($_temOracleInfo);
    }

    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 excelIt()
    {
        $excel = new ExcelController();
        return $excel->makeExcel();
    }

    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 tNull()
    {
        User::query()->get()->toArray();
        User::query()->get()->toJson();
    }

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

    function test()
    {
        $ids = [];
        $logs = Log::query()->select('description')->where('type', '同步时WMS中未找到这些订单')->get();
        foreach ($logs as $log) {
            $arr = [];
            eval("\$arr = " . $log->description . '; ');
            if (count($arr) < 1) continue;
            $ids = array_merge($ids, $arr);
        }
        $ids = array_unique($ids);
        $error = [];
        foreach ($ids as $id) {
            $package = Package::query()->find($id);
            /** @var OrderPackageService */
            $orderPackage = app('OrderPackageService')->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);
        }
        if (count($error) > 0) app('LogService')->log(__METHOD__, "同步时WMS中未找到这些订单_two", json_encode($error));
    }

    function test1()
    {
        $statistics = ProcessStatistic::query()->whereNull('revenue')->get();
        $id = array_column($statistics->toArray(), 'process_id');
        $processes = Process::query()->where(function (Builder $query) {
            $query->where('status', '待交接')->orWhere('status', '交接完成');
        })->whereIn('id', $id)->get();
        $sign_end = true;
        foreach ($processes as $process) {
            if (count($process->processDailies) > 0) {
                $completed_amount = 0;
                foreach ($process->processDailies as $processDaily) {
                    $completed_amount = $completed_amount + ($processDaily->output);
                }
                $process->completed_amount = $completed_amount;
            }
            //统计：
            $revenue = ($process->unit_price) * ($process->completed_amount);   //收入合计
            $processDailies = ProcessDaily::with('processDailyParticipants')->where('process_id', $process->id)->where('output', '>', 0)->get();
            $duration_days = count($processDailies);      //完成天数
            $duration_man_hours = 0;      //总工时
            $total_cost = 0;              //合计成本
            foreach ($processDailies as $processDailyOne) {
                foreach ($processDailyOne->processDailyParticipants as $processDailyParticipant) {
                    if (!$processDailyParticipant->unit_price && !$processDailyParticipant->hour_price) continue;
                    $duration_man_hours += $processDailyParticipant->hour_count;
                    if ($processDailyParticipant->unit_count) {
                        $total_cost += ($processDailyParticipant->unit_count) * ($processDailyParticipant->unit_price);
                        continue;
                    }
                    $total_cost += ($processDailyParticipant->hour_count) * ($processDailyParticipant->hour_price);
                }
            };
            $processStatistic = ProcessStatistic::query()->find($process->id);
            $processStatistic->revenue = $revenue;
            $processStatistic->duration_days = $duration_days;
            $processStatistic->duration_man_hours = $duration_man_hours;
            if ($sign_end) $processStatistic->ended_at = date('Y-m-d H:i:s');
            if (!$revenue || !$total_cost) {
                $processStatistic->update();
                continue;
            }
            $gross_profit = $revenue - $total_cost; //毛利润
            if ($gross_profit != 0) $gross_profit_rate = $gross_profit / $revenue;  //毛利率;
            else $gross_profit_rate = 0;
            $processStatistic->total_cost = $total_cost;
            $processStatistic->gross_profit = $gross_profit;
            $processStatistic->gross_profit_rate = $gross_profit_rate;
            $processStatistic->update();
            app('LogService')->log(__METHOD__, "修改二次加工单统计单_" . __FUNCTION__, json_encode($processStatistic), Auth::user()['id']);
        }
    }

    public function test5(){
        ini_set('max_execution_time',2500);
        ini_set('memory_limit','1526M');
        //清理冗余条码
//        $this->cleanBarcode();

        while(true){
            $toDay = Carbon::now();
            $skus = DB::select(DB::raw('select sku from commodities group by sku,owner_id having count(*)>1 limit 500 '));
            $skus = array_column($skus,'sku');

            $commodities = Commodity::query()->with('barcodes')->whereNotNull('owner_id')->whereIn('sku',$skus)->get();


            if (count($commodities) < 1)return "SUCCESS";
            $commodityMap = [];
            $commodityDel = [];
            $commodityTag = [];
            $commodityBar = [];
            $createBarcodes = [];
            $logs = [];
            foreach ($commodities as $commodity){
                if ($commodityMap[$commodity->sku.'_'.$commodity->owner_id] ?? false){
                    $codes = $commodity->barcodes ? array_column($commodity->barcodes->toArray(),'code') : [];
                    $logs[] = [
                        'id' => $commodity->id,
                        'sku' => $commodity->sku,
                        'owner_id'=>$commodity->owner_id,
                        'code'=>$codes,
                    ];
                    $commodityDel[] = $commodity->id;
                    $commodityTag[$commodity->id] = $commodityMap[$commodity->sku.'_'.$commodity->owner_id];

                    $arr = array_diff($codes,$commodityBar[$commodity->sku.'_'.$commodity->owner_id]);
                    foreach ($arr as $code){
                        if (!$code)continue;
                        $createBarcodes[] = [
                            'code' => $code,
                            'commodity_id' => $commodityMap[$commodity->sku.'_'.$commodity->owner_id],
                            'created_at' => $toDay,
                        ];
                    }
                }else{
                    $commodityMap[$commodity->sku.'_'.$commodity->owner_id] = $commodity->id;
                    $commodityBar[$commodity->sku.'_'.$commodity->owner_id] = $commodity->barcodes ? array_column($commodity->barcodes->toArray(),'code') : [];
                }
            }
            dd($commodityMap,$commodityDel,$commodityTag);
            app('LogService')->log(__METHOD__,'清理商品',json_encode($logs,JSON_UNESCAPED_UNICODE));
            app('LogService')->log(__METHOD__,'重新分配商品',json_encode($commodityTag,JSON_UNESCAPED_UNICODE));

            app('InventoryAccountMissionService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新库存盘点任务
            app('InventoryCompareService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新库存对比
            app('InventoryDailyLogService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新库存每日记录
            app('ProcessesContentService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新二次加工内容单
            app('StoreCheckingReceiveItemService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新入库盘收一体
            app('OrderPackageCommoditiesService')->batchUpdateItself('commodity_id', $commodityTag);//批量更新订单商品

            app('LogService')->log(__METHOD__,'删除商品与对应条码',json_encode($commodityDel,JSON_UNESCAPED_UNICODE));
            CommodityBarcode::query()->whereIn('commodity_id',$commodityDel)->delete();
            Commodity::destroy($commodityDel);
        }
    }

    private function cleanBarcode(){

        $logCommodityBarcodes = CommodityBarcode::query()->where('code', "")->get();
        if (count($logCommodityBarcodes) > 0) app('LogService')->log(__METHOD__, "纠正商品-删除空条码", json_encode($logCommodityBarcodes, JSON_UNESCAPED_UNICODE));

        CommodityBarcode::query()->where('code', "")->delete();
        $barcodes = DB::select(DB::raw('select * from commodity_barcodes c
where (c.code,c.commodity_id) in (select code,commodity_id from commodity_barcodes group by code,commodity_id having count(*) > 1) order by commodity_id'));
        $barcodeMap = [];
        $barcodeDelete = [];
        foreach ($barcodes as $barcode) {
            if (isset($barcodeMap[$barcode->code . '_' . $barcode->commodity_id])) $barcodeDelete[] = $barcode->id;
            else $barcodeMap[$barcode->code . '_' . $barcode->commodity_id] = $barcode->id;
        }

        $logCommodityBarcodes = CommodityBarcode::query()->whereIn('id', $barcodeDelete)->get();
        if (count($logCommodityBarcodes) > 0) app('LogService')->log(__METHOD__, "纠正商品-删除重复条码", json_encode($logCommodityBarcodes, JSON_UNESCAPED_UNICODE));

        CommodityBarcode::destroy($barcodeDelete);
    }

    private function multiCodes(){

        $barcode='BG10B1014C002100';
        $commodity=Commodity::whereHas('barcodes', function (Builder $query)use($barcode){
            $query->where('code',$barcode);
        })->where('owner_id',4)->first();
        $codes = $commodity->barcodes->map(function ($barcode) {
            return $barcode->code??'';
        });
        foreach($codes as $code){
            $commodity=Commodity::whereHas('barcodes', function (Builder $query)use($barcode){
                $query->where('code',$barcode);
            })->where('owner_id',4)->get();
            dump($commodity);
        }
        die();
        $commodityBuilder=Commodity::query();
        $commodityBuilder->where('owner_id',4)->first();
            $commodityBuilder->whereHas('barcodes', function (Builder $query)use($barcode,$codes){
                foreach($codes as $code){
                    $query->orWhere('code',$code);
                }
            });
        dd($commodity, $codes,$commodityBuilder->get());
    }

    public function correctCommodity()
    {
        ini_set('max_execution_time', 2500);
        ini_set('memory_limit', '1526M');
        //清理冗余条码
        //$this->cleanBarcode();

        //获取重复条码
        $commodities = DB::select(DB::raw('select commodities.name,commodities.sku,commodities.owner_id,commodity_barcodes.id as barcode_id,commodity_barcodes.code as barcode_code,commodity_barcodes.commodity_id from commodities LEFT JOIN commodity_barcodes on commodities.id = commodity_barcodes.commodity_id
where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owner_id,commodity_barcodes.code from commodities LEFT JOIN commodity_barcodes on commodities.id = commodity_barcodes.commodity_id group by commodities.owner_id,commodity_barcodes.code having count(*) > 1) order by commodities.owner_id,commodity_barcodes.code'));

        //对比map池
        $commodityMap = [];
        //需要删除项
        $commodityDelete = [];
        foreach ($commodities as $index => $commodity) {
            $commodity->barcode_code = strtolower(trim($commodity->barcode_code));
            //货主+条码 为唯一key值 设想正常数据下同货主不应该有同条码
            $key = $commodity->owner_id . '_' . $commodity->barcode_code;
            //使用map池对比为重复数据
            if (isset($commodityMap[$key])) {
                //获取下标指针指向的源数据
                $c = $commodities[$commodityMap[$key]];
                //源数据不符合规范，当前数据替换掉它
                if (($c->sku == null || $c->sku == "") && ($commodity->sku != null && $commodity->sku != "")) {
                    $commodityDelete[] = $commodityMap[$key];
                    $commodityMap[$key] = $index;
                } else {
                    //当前数据比源数据更符合预期，替换掉
                    if (($c->sku == $commodity->sku) && (strlen($c->name) < strlen($commodity->name))) {
                        $commodityDelete[] = $commodityMap[$key];
                        $commodityMap[$key] = $index;
                    } else {
                        //扔进处理池
                        $commodityDelete[] = $index;
                    }
                }
                //第一次出现的新数据,val为下标，当作指针指向源数据
            } else $commodityMap[$key] = $index;
        }
        $createBarcodes = []; //批量生成条码
        $deleteCommodities = []; //批量删除商品及商品条码

        $updateCommodities = [];
        foreach ($commodityDelete as $index) {
            //获取到被处理数据 与 目标数据
            $del = $commodities[$index];
            $target = $commodities[$commodityMap[$del->owner_id . '_' . $del->barcode_code]];

            //记录ID删除商品与条码
            $deleteCommodities[] = $del->commodity_id;

            //有效条码合并
            $barcodes = DB::select(DB::raw("select * from
            (select * from commodity_barcodes where commodity_id = " . $del->commodity_id . ")a
            where (select count(1) as num from commodity_barcodes b
            where commodity_id = " . $target->commodity_id . " and b.code = a.code) = 0"));
            if (count($barcodes) > 0) {
                foreach ($barcodes as $barcode) {
                    $createBarcodes[] = ['code' => $barcode->code, 'commodity_id' => $target->commodity_id];
                }
            }
            $updateCommodities[$del->commodity_id] = $target->commodity_id;
        }
        if (count($updateCommodities) > 0){
            app('InventoryAccountMissionService')->batchUpdateItself('commodity_id', $updateCommodities);//批量更新库存盘点任务
            app('InventoryCompareService')->batchUpdateItself('commodity_id', $updateCommodities);//批量更新库存对比
            app('InventoryDailyLogService')->batchUpdateItself('commodity_id', $updateCommodities);//批量更新库存每日记录
            app('ProcessesContentService')->batchUpdateItself('commodity_id', $updateCommodities);//批量更新二次加工内容单
            app('StoreCheckingReceiveItemService')->batchUpdateItself('commodity_id', $updateCommodities);//批量更新入库盘收一体
            app('OrderPackageCommoditiesService')->batchUpdateItself('commodity_id', $updateCommodities);//批量更新订单商品
        }

        if (count($createBarcodes) > 0) app('LogService')->log(__METHOD__, "纠正商品-录入合并条码", json_encode(data_get($createBarcodes, '*.id'), JSON_UNESCAPED_UNICODE));

        CommodityBarcode::query()->insert($createBarcodes);
        $logCommodityBarcodes = CommodityBarcode::query()->whereIn('commodity_id', $deleteCommodities)->get();
        if (count($logCommodityBarcodes) > 0) app('LogService')->log(__METHOD__, "纠正商品-删除无用商品条码", json_encode(data_get($logCommodityBarcodes, '*.id'), JSON_UNESCAPED_UNICODE));

        CommodityBarcode::query()->whereIn('commodity_id', $deleteCommodities)->delete();

//        $logCommodities = Commodity::query()->whereIn('id',$deleteCommodities)->get();
        if (count($deleteCommodities) > 0) app('LogService')->log(__METHOD__, "纠正商品-删除无用商品", json_encode($deleteCommodities, JSON_UNESCAPED_UNICODE));

        Commodity::destroy($deleteCommodities);
    }

    /*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 test3()
    {
        /** @var OrderTrackingService $orderTrackingService */
        $orderTrackingService = app('OrderTrackingService');
        /** @var OrderService $orderService */
        $orderService = app(OrderService::class);
        $owners = app(OrderTrackingOwnerService::class)->getTrackingOrderOwner();
        $startDate = \Illuminate\Support\Carbon::parse('2020-10-28 00:00:00')->toDateTimeString();
        $orderHeaders = OracleDOCOrderHeader::query()->with(['oracleDOCOrderDetails', 'actAllocationDetails', 'oracleBASCode'])
            ->where('addTime', '>=', $startDate)
            ->whereIn('customerID', data_get($owners, '*.code'))
            ->get();
        $orderService->updateByWmsOrders($orderHeaders);
        $orderTrackingService->updateByWmsOrderHeaders($orderHeaders);
    }

    public function test11()
    {
        $rejectedBills = RejectedBill::query()
            ->where('created_at','>=','2020-11-10 18:00:22')
            ->where('created_at','<=','2020-11-11 00:00:00')
            ->get();
        $update = [['id','logistic_number']];
        $rejectedBills->each(function ($rejectedBill)use(&$update){
            if($rejectedBill->logistic_number == '原单退回'){
                $details = OracleActAllocationDetails::query()->with('oracleDocOrderHeader')->whereHas('oracleDocOrderHeader',function($query)use($rejectedBill){
                    $query->where('SOReference1',$rejectedBill->order_number);
                })->get()->groupBy('picktotraceid');
                if($details->count() == 1){
                    $update[] = ['id'=> $rejectedBill->id ,'logistic_number'=>$rejectedBill->logistic_number_return];
                }
            }
        });
        app('RejectedBillService')->batchUpdate($update);
    }

    public function output()
    {
        /** @var CacheService $cacheService */
        $cacheService = app('CacheService');
        $authorities=$cacheService->getOrExecute('userxx',function (){
            return Authority::with('roles')->get();
        });
        dd($authorities);
    }
    public function output2()
    {
        dump(Cache::get('aa'));
        Cache::put('aa', '2223', 5);
    }
    public function usage()
    {
        dd(Request::all());
    }
    public function relating()
    {
        dd(OrderIssue::query()->where('id',182)->paginate()->total());
    }

    public function updateOrdersWarehouse()
    {
        /**
         * @var DataHandlerService $dataHandlerService
         * @var OrderService $orderService
         */
        $dataHandlerService = app(DataHandlerService::class);
        $orderService = app(OrderService::class);
        $page = 500;
        $count = Order::query()->count();
        $warehouse = Warehouse::query()->get();
        $warehouse_map = $dataHandlerService->dataHeader(['code'], $warehouse);
        for ($i = 0; $i < $count; $i += $page) {
            $min = $i;$max = $i + $page;
            $orders = Order::query()->where('id', '>=', $min)->where('id', '<=', $max)->get();
            $orderNos = array_diff(array_unique(data_get($orders, '*.code')), ['', ' ', '*', null]);
            if (count($orderNos)==0) continue;
            /** @var Collection $orderHeaders */
            $orderHeaders = OracleDOCOrderHeader::query()->whereIn('orderno', $orderNos)->get();
            if ($orderHeaders->count() == 0) continue;
            $orderHeader_map = $dataHandlerService->dataHeader(['orderno'], $orderHeaders);
            $update_params = [];
            $update_params[] = ['id', 'warehouse_id'];
            foreach ($orders as $order) {
                $orderHeader = $dataHandlerService->getKeyValue(['orderno' => $order->code], $orderHeader_map);
                if ($orderHeader == null) continue;
                $warehouse = $dataHandlerService->getKeyValue(['code' => $orderHeader->warehouseid], $warehouse_map);
                if ($warehouse == null) continue;
                $update_params[] = [
                    'id' => $order->id,
                    'warehouse_id' => $warehouse->id
                ];
            }
            $orderService->batchUpdate($update_params);
            unset($orders, $orderHeaders, $update_params);
        }
        unset($warehouse);
    }

    public function syncSendOrder()
    {
        $order_issues = OrderIssue::query()->whereNotNull('second_client_no')->get();
        $client_nos = data_get($order_issues,'*.second_client_no');
        $orderHeaders = OracleDOCOrderHeader::query()->selectRaw(implode(',',OracleDOCOrderHeaderService::$columns))
            ->whereIn('SOReference1',$client_nos)
            ->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');
            },'oracleBASCode'=>function($query){
                $query->selectRaw('BAS_Codes.CodeID,BAS_Codes.CodeName_C,BAS_Codes.Code');
            }])
            ->get();
        $service = app('OrderIssueService');
        $service->updateByWmsOrders($orderHeaders);
    }
    public function testCollectMethod()
    {
        $startDate=Carbon::parse('2020-11-11 23:59:59')->subSeconds(65)->format('Y-m-d H:i:s');
        $asnHerders=app(OracleDocAsnHerderService::class)->getWmsAsnOnStartDateCreate($startDate);
        if ($asnHerders->isEmpty())return null;
        /**
         * @var OwnerService $ownerService
         * @var WarehouseService $wareHouseService
         */
        $ownerService = app(OwnerService::class);
        $owners=$ownerService->getByWmsOrders($asnHerders);
        $wareHouseService=app(WarehouseService::class);
        $warehouses=$wareHouseService->getByWms($asnHerders);
        foreach ($owners as $owner) {
            $owners_code_map[$owner->code] = $owner;
        }
        foreach ($warehouses as $warehouse) {
            $warehouses_code_map[$warehouse->code] = $warehouse;
        }
        var_dump('createStoreParam_start',Carbon::now());
        $params=app(StoreService::class)->getParamsByAsnHeader($asnHerders,$owners_code_map,$warehouses_code_map);
        var_dump('createStoreParam_end',Carbon::now());

        var_dump('insertStore_start',Carbon::now());
        if(count($params)> 0){
            //app(StoreService::class)->insertStore($params);
            DB::table('stores')->insert($params);
        }
        var_dump('insertStore_end',Carbon::now());
    }
    public function testMethodSecond(){
        $param=[
            "asn_code" => "ASN2011120516",
            "warehouse_id" => 2,
            "owner_id" => 35,
            "stored_method" => "退货入库",
            "status" => "订单创建",
            "remark" => null,
            "created_at" => "2020-11-12 14:12:42",
            "updated_at" => "2020-11-12 14:12:42",
            ];
        var_dump('start',Carbon::now());
        //Store::query()->insert($param);
        app(StoreService::class)->insertStore($param);
        var_dump('end',Carbon::now());
    }
    public  function  testSyncAsn(){
        $startDate=Carbon::parse('2020-11-12 17:48:00')->subSeconds(65)->format('Y-m-d H:i:s');
        app(StoreService::class)->syncWmsAsnData($startDate);
    }

    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 testOrderPackages(){
        $batch_number = 'W201114000104';
        $weight = 0.3;
        OrderPackage::createPackagesFromBatchCode($batch_number,$weight);
    }

    public function view(){
        return view('test');
    }
    public function tdel(){
        echo '223232323';
        return 'asdfsadfsdf';
    }
    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 orderTrackingImportTest(Request $request)
    {
        $file = $request->file('file');
        ini_set('max_execution_time',4000);
        ini_set('memory_limit', '1024M');
        $extension = $request->file()['file']->getClientOriginalExtension();
        $extension[0] = strtoupper($extension[0]);
        Excel::import(new OrderTrackingImport(), $request->file('file')->path(), null, $extension);
    }

    public function testImp()
    {
        $client_no = null;
        $items = null;
        $order=(new OrderTrackingImport())->getOrder($client_no,$items);
        if($order['id']) echo 'yes1';


        $order = Order::query()->create([
            'code'=>'null'.Str::uuid(),'client_code' => 'asdfdfdg','web_order_number' => 'sadfdsf'
        ]);
        dd($order);
//        $order=(new OrderTrackingImport())->getOrder('92024765871-SDO130000986796QX',$items);
//        if($order['id']) echo 'yes2';
    }

//    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 testSyncOrder()
     {
        $carbon =Carbon::now()->subHours(1);
        $date = '2020-05-18 18:13:50';
        $orderHeader = 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','>=',$startDate)
//            ->where('orderno','SO201112029795')
            ->where('DOC_Order_Header.addTime','>=',$carbon)
            ->get();
        /** @var OrderService $service */
        $service = app('OrderService');
        $service->syncOrder($orderHeader);
    }
}
