|
|
@@ -5,7 +5,6 @@ namespace App\Http\Controllers;
|
|
|
|
|
|
use App\Authority;
|
|
|
use App\Batch;
|
|
|
-use App\Carrier;
|
|
|
use App\Commodity;
|
|
|
use App\CommodityBarcode;
|
|
|
use App\Console\Commands\SyncWMSOrderTask;
|
|
|
@@ -37,11 +36,7 @@ use App\RejectedBillItem;
|
|
|
use App\Services\CacheService;
|
|
|
use App\Services\common\BatchUpdateService;
|
|
|
use App\Services\common\DataHandlerService;
|
|
|
-use App\Services\DocWaveHeaderService;
|
|
|
-use App\Services\FeatureService;
|
|
|
use App\Services\InventoryCompareService;
|
|
|
-use App\Services\LogisticService;
|
|
|
-use App\Services\LogService;
|
|
|
use App\Services\OracleDocAsnHerderService;
|
|
|
use App\Services\OracleDOCOrderHeaderService;
|
|
|
use App\Services\OrderPackageService;
|
|
|
@@ -49,14 +44,10 @@ use App\Services\OrderService;
|
|
|
use App\Services\OrderTrackingOwnerService;
|
|
|
use App\Services\OrderTrackingService;
|
|
|
use App\Services\OwnerService;
|
|
|
-use App\Services\ShopService;
|
|
|
use App\Services\StoreService;
|
|
|
use App\Services\WarehouseService;
|
|
|
-use App\StoreCheckingReceiveItem;
|
|
|
use App\User;
|
|
|
use App\Warehouse;
|
|
|
-use App\Waybill;
|
|
|
-use App\WaybillPriceModel;
|
|
|
use Carbon\Carbon;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
@@ -164,6 +155,20 @@ class TestController extends Controller
|
|
|
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);
|
|
|
@@ -286,6 +291,29 @@ class TestController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ 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);
|
|
|
@@ -1056,6 +1084,34 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
//
|
|
|
// }
|
|
|
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function OrderSync(){
|
|
|
+ $tack = new SyncWMSOrderTask();
|
|
|
+ $tack->handle();
|
|
|
+ dump(11);
|
|
|
+ }
|
|
|
public function reNewBatches3()
|
|
|
{
|
|
|
$batches=Batch::query()->where('id','>',324)->get('code');
|