<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
地址前缀：/apiLocal/
*/
Route::post('rejected/recoverSelected', 'RejectedController@apiRecoverSelected');
Route::post('rejectedBillItem/store', 'RejectedBillItemController@apiStore');
Route::post('rejectedBillItem/reviseOwner', 'RejectedBillItemController@apiReviseOwner');
Route::post('rejectedBillItem/update', 'RejectedBillItemController@apiUpdate');
Route::post('rejectedBillItem/apiGet', 'RejectedBillItemController@apiGet');
Route::post('rejectedBillItem/apiDelete', 'RejectedBillItemController@apiDelete');
Route::post('rejectedBillItem/packConfirm', 'RejectedBillItemController@apiPackConfirm');
Route::post('rejectedBillItem/packDestroy', 'RejectedBillItemController@apiPackDestroy');
Route::post('rejectedBill/store', 'RejectedBillController@apiStore');
Route::post('rejectedBill/update', 'RejectedBillController@apiUpdate');
Route::post('rejectedBill/apiGetRecent', 'RejectedBillController@apiGetRecent');
Route::post('rejectedBill/apiSetIsLoadedAll', 'RejectedBillController@apiSetIsLoadedAll');
Route::post('rejectedBill/apiConfirmBeStored', 'RejectedBillController@apiConfirmBeStored');
Route::post('rejectedBill/seekOrder','RejectedBillController@seekOrder');
Route::post('rejectedBill/importRejectedNumber','RejectedBillController@disposeImportApi');

Route::post('logistic/numberFeatures/computeLogisticByNumber', 'LogisticNumberFeatureController@apiComputeLogisticByNumber');
Route::post('logistic/logisticNumberReturnIsUnique', 'RejectedBillController@apiLogisticNumberReturnIsUnique');

Route::post('commodity/getCommodityByBarcode', 'CommodityController@apiGetCommodityByBarcode');

Route::post('rejectedBill/getRejectedByLogisticNumberReturn', 'RejectedController@apiGetRejectedByLogisticNumberReturn');

/** 运输管理 */
Route::group(['prefix' => 'transport'], function () {
    Route::post('waybill/recoverSelected', 'WaybillController@apiRestoreSelected');
    Route::post('waybill/changeFee', 'WaybillController@changeFee');
    Route::post('waybill/changeCharge', 'WaybillController@changeCharge');
});

/** 人事管理 */
Route::group(['prefix' => 'personnel'], function () {
    /** 卸货 */
    Route::group(['prefix' => 'discharge'], function () {
        /** 任务 */
        Route::group(['prefix' => 'task'], function () {
            Route::delete('delete', 'DischargeTaskController@destroyApi')->name('discharge.deleteApi');;
            Route::post('store', 'DischargeTaskController@storeApi')->name('discharge.storeApi');
            Route::put('update', 'DischargeTaskController@updateApi')->name('discharge.updateApi');
            Route::put('updateFacilitator', 'DischargeTaskController@updateTaskFacilitatorApi')->name('discharge.updateTaskFacilitatorApi');
            Route::put('updateColumn', 'DischargeTaskController@updateApi')->name('facilitator.updateColumnApi');
        });
    });
});

Route::group(['prefix' => 'order'], function () {
    Route::group(['prefix'=>'issue'],function(){
        Route::post('orderIssueHasClientCode', 'OrderIssueController@apiOrderIssueHasClientCode');
        Route::post('orderIssueHasLogisticNumberReturn', 'OrderIssueController@apiOrderIssueHasLogisticNumberReturn');
        Route::post('update', 'OrderIssueController@updateApi');
        Route::post('updateColumn','OrderIssueController@updateColumnApi');
        Route::post('destroy', 'OrderIssueController@apiDestroy');
        Route::post('batchDestroy', 'OrderIssueController@batchDestroyApi');
        Route::any('orderIssueTag', 'OrderIssueController@apiOrderIssueTag');
        Route::post('disposeOrderIssue', 'OrderIssueController@apiDisposeOrderIssue');
        Route::post('endOrderIssue', 'OrderIssueController@apiEndOrderIssue');
        Route::post('getOrderInfoByClientNo', 'OrderIssueController@apiGetOrderInfoByClientNo');
        Route::post('isExistByOrderNo','OrderIssueController@isExistByOrderNoApi');
        Route::post('editSecondClientNo','OrderIssueController@editSecondClientNoApi');
        Route::post('endOrderIssues','OrderIssueController@endOrderIssuesApi');
        Route::post('editSecondLogisticNumber','OrderIssueController@editSecondLogisticNumberApi');
        Route::post('importPasteData','OrderIssueController@importPasteDataApi');
        Route::post('archiveOrderIssue','OrderIssueController@archiveOrderIssueApi');
        Route::post('destroySecondLogisticNumber','OrderIssueController@destroySecondLogisticNumberApi');

        Route::match(['get','post'],'disposeImport','OrderIssueController@disposeImportApi');
        Route::post('financeConfirm','OrderIssueController@financeConfirmApi');

        Route::group(['prefix'=>'rejectedBill'],function(){
            Route::post('join','OrderIssueRejectedBillController@joinRejectedBillApi');
            Route::post('unJoin','OrderIssueRejectedBillController@unJoinRejectedBillApi');
            Route::post('reviseJoin','OrderIssueRejectedBillController@reviseJoinRejectedBillApi');
        });

         Route::group(['prefix'=>'onTop'],function(){
            Route::post('/store', 'OrderIssueOnTopController@apiStore');
            Route::post('/cancelTop', 'OrderIssueOnTopController@apiDestroy');
        });

        Route::group(['prefix'=>'log'],function(){
            Route::post('store', 'OrderIssueProcessLogController@apiStore');
            Route::post('destroy', 'OrderIssueProcessLogController@destroyApi')->name('order.issue.log.destroyApi');
            Route::post('batchStore','OrderIssueProcessLogController@batchStoreApi');
        });
        Route::group(['prefix'=>'recycle'],function(){
            Route::post('recover','OrderIssueController@recoverOrderIssueApi');
        });
        Route::post('userWorkgroups/add','OrderIssueController@addUserWorkgroup');
        Route::post('userWorkgroups/delete','OrderIssueController@destroyUserWorkgroup');
        Route::post('batchOthers','OrderIssueController@batchOthers');
    });

    Route::group(['prefix'=>'tracking'],function (){
        Route::get('update','OrderTrackingController@updateApi');
        Route::any('logisticUpdate','OrderTrackingController@logisticUpdateApi');
        Route::any('warehouseUpdate','OrderTrackingController@warehouseUpdateApi');
        Route::post('updateLogisticId','OrderTrackingController@updateLogisticIdApi');
    });

    Route::group(['prefix'=>'trackingOwner'],function (){
        Route::any('all','OrderTrackingOwnerController@getAllApi');
        Route::any('updateStatus','OrderTrackingOwnerController@updateStatusApi');
    });

});

Route::group(['prefix'=>'maintenance'],function (){
    Route::group(['prefix'=>'owner'],function (){
        Route::post('getOwners','OwnerController@getOwners');
    });
});

/** 控制台 */
Route::group(['prefix'=>'control'],function () {
    Route::post('panel/menu/orderCountingRecordApi','ControlPanelController@orderCountingRecordsApi') ;
    Route::post('panel/menu/logisticsCountingRecordsApi','ControlPanelController@logisticsCountingRecordsApi');
    Route::post('panel/menu/warehouseCountingRecordsApi','ControlPanelController@warehouseCountingRecordsApi');
    Route::post('panel/menu/laborReportsCountingRecordApi','ControlPanelController@laborReportsCountingRecordApi');
    Route::post('panel/menu/laborReportsUserGroupsCountApi','ControlPanelController@laborReportsUserGroupsCountApi');
    Route::post('panel/menu/weightApi','ControlPanelController@weightApi');
    Route::post('panel/menu/exceptionTypeApi','ControlPanelController@exceptionTypeApi');
});

/** 耗材 */
Route::group(['prefix' => 'material'],function(){
    Route::post('store','MaterialController@storeApi')->name('material.storeApi');
    Route::post('update','MaterialController@updateApi')->name('material.updateApi');
    Route::delete('destroy/{id}','MaterialController@destroyApi')->name('material.destroyApi');
});

/** 项目耗材 */
Route::group(['prefix' => 'ownerMaterial'],function(){
    Route::post('store','OwnerMaterialController@storeApi')->name('ownerMaterial.storeApi');
    Route::post('update','OwnerMaterialController@updateApi')->name('ownerMaterial.updateApi');
    Route::delete('{id}','OwnerMaterialController@destroyApi')->name('ownerMaterial.destroyApi');
    Route::post('uploadFile','OwnerMaterialController@fileApi')->name('ownerMaterial.uploadFile');
});

/** 供应商 */
Route::group(['prefix' => 'supplier'], function () {
    Route::post('store', 'SupplierController@storeApi')->name('supplier.storeApi');
    Route::post('update', 'SupplierController@updateApi')->name('supplier.updateApi');
    Route::delete('{id}', 'SupplierController@destroyApi')->name('supplier.destroyApi');
});
/** 系统配置 */
Route::group(['prefix' => 'configuration'],function(){
    Route::post('store','ConfigurationController@storeApi')->name('configuration.storeApi');
    Route::post('update','ConfigurationController@updateApi')->name('configuration.updateApi');
    Route::delete('{id}','ConfigurationController@destroyApi')->name('configuration.destroyApi');
});

/** 装卸队 */
Route::group(['prefix' => 'facilitator'], function () {
    Route::post('store', 'FacilitatorController@storeApi')->name('facilitator.storeApi');
    Route::put('update', 'FacilitatorController@updateApi')->name('facilitator.updateApi');
    Route::delete('destroy', 'FacilitatorController@destroyApi')->name('facilitator.destroyApi');
    Route::post('gainStatement', 'FacilitatorController@gainStatementApi')->name('facilitator.gainStatementApi');
});

/** 需求管理 */
Route::group(['prefix'=>'demand'],function(){
    Route::post('store','DemandController@storeApi')->name('demand.storeApi');
    Route::post('update','DemandController@updateApi')->name('demand.updateApi');
    Route::post('uploadFile','DemandController@uploadFileApi')->name('demand.uploadFileApi');
    Route::delete('destroy','DemandController@destroyApi')->name('demand.destroyApi');
    Route::delete('destroyFile','DemandController@destroyFileApi')->name('demand.destroyFileApi');
    Route::post('finish','DemandController@finishApi')->name('demand.finishApi');
    Route::post('claim','DemandController@claimApi')->name('demand.claimApi');
    Route::get('unClaimDemandRatio','DemandController@getUnClaimDemandRatioApi')->name('demand.getUnClaimDemandRatioApi');
    Route::group(['prefix'=>'process'],function (){
        Route::post('store','DemandProcessController@storeApi')->name('demand.process.storeApi');
        Route::delete('destroy','DemandProcessController@destroyApi')->name('demand.process.destroyApi');
    });
});

Route::get('/authority/get','AuthorityController@getAuthoritiesApi')->name('authority.getAuthoritiesApi');

/** 栈管理 */
Route::group(['prefix' => 'station'],function(){
    /** 缓存架 */
    Route::group(['prefix'=>'cacheShelf'],function(){
        Route::post('pushTask','CacheShelfController@pushTaskApi')->name('station.cacheShelf.pushTaskApi');
        Route::post('clearTask','CacheShelfController@clearTaskApi')->name('station.cacheShelf.clearTaskApi');
        Route::post('lightOn','CacheShelfController@lightOnApi')->name('station.cacheShelf.lightOnApi');
        Route::get('getTasks/{id}','CacheShelfController@getTasksApi')->name('station.cacheShelf.getTasksApi');
    });

    /** 栈规则 */
    Route::group(['prefix'=>'rule'],function(){
        Route::post('store','StationRuleBatchController@storeApi')->name('station.rule.storeApi');
        Route::put('update','StationRuleBatchController@updateApi')->name('station.rule.updateApi');
        Route::delete('destroy','StationRuleBatchController@destroyApi')->name('station.rule.destroyApi');
    });
});


/** 包裹 */
Route::group(['prefix' => 'package'], function () {
    Route::put('logistic', 'OrderPackageController@update')->name('orderPackage.update');
});
