|
|
@@ -516,11 +516,11 @@ class TestController extends Controller
|
|
|
//$orderTrackingService->trackingWmsOrder($startDate);
|
|
|
$owners = app(OrderTrackingOwnerService::class)->getTrackingOrderOwner();
|
|
|
$startDate = \Illuminate\Support\Carbon::parse('2020-09-25 00:00:00')->toDateTimeString();
|
|
|
-// $endData = \Illuminate\Support\Carbon::parse('2020-09-26 00:00:00')->toDateTimeString();
|
|
|
+ $endData = \Illuminate\Support\Carbon::parse('2020-09-26 00:00:00')->toDateTimeString();
|
|
|
$orderHeaders = OracleDOCOrderHeader::query()
|
|
|
->with(['oracleDOCOrderDetails', 'actAllocationDetails','oracleBASCode'])
|
|
|
->where('addTime','>=',$startDate)
|
|
|
-// ->where('addTime','<=',$endData)
|
|
|
+ ->where('addTime','<=',$endData)
|
|
|
->whereIn('customerID',data_get($owners,'*.code'))
|
|
|
->get();
|
|
|
// $orderHeaders = app(OracleDOCOrderHeaderService::class)->getWmsOrderOnStartDateCreate($startData);
|
|
|
@@ -638,19 +638,22 @@ class TestController extends Controller
|
|
|
// $batchUpdateService->batchUpdate('order_trackings',$fillables);
|
|
|
// }
|
|
|
|
|
|
-// public function updateOrderTrackingLogistic(){
|
|
|
-// $orderTrackings = OrderTracking::query()->with('commodities.package.order')->get();
|
|
|
-// $order_nos = data_get($orderTrackings,'*.commodities.package.order.code');
|
|
|
-// $order_nos = array_unique($order_nos);
|
|
|
-// $orders = Order::query()->whereIn('code',$order_nos)->get();
|
|
|
-// $XJWL_logistic =Logistic::query()->where('code','XJWL')->first();
|
|
|
-// foreach ($orders as $order) {
|
|
|
-// $orderHeader = OracleDOCOrderHeader::query()->where('OrderNo',$order->code)->first();
|
|
|
-// $logistic =Logistic::query()->where('code',$orderHeader->userdefine1)->first();
|
|
|
-// if($orderHeader->userdefine1 == 'ZT'){$logistic = $XJWL_logistic;}
|
|
|
-// $order->update(['logistic_id'=>$logistic->id]);
|
|
|
-// }
|
|
|
-// }
|
|
|
+ public function updateOrderTrackingLogistic(){
|
|
|
+ $orderTrackings = OrderTracking::query()->with('commodities.package.order')->get();
|
|
|
+ $order_nos = data_get($orderTrackings,'*.commodities.package.order.code');
|
|
|
+ $order_nos = array_unique($order_nos);
|
|
|
+ $orders = Order::query()->whereIn('code',$order_nos)->get();
|
|
|
+ foreach ($orders as $order) {
|
|
|
+ $orderHeader = OracleDOCOrderHeader::query()->where('OrderNo',$order->code)->first();
|
|
|
+ $logistic =Logistic::query()->where('code',$orderHeader->userdefine1)->first();
|
|
|
+ if($order->logistic_id == 61)continue;
|
|
|
+ if($order->logistic_id !== $logistic->id){
|
|
|
+ Order::query()->where('id',$order->id)->update(['logistic_id'=>$logistic->id]);
|
|
|
+ dd($order->logistic_id,$logistic->id,$order);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function updateOrderTracking(){
|
|
|
$orderTrackings = OrderTracking::query()->with('commodities.package.order')->get();
|
|
|
foreach ($orderTrackings as $orderTracking) {
|
|
|
@@ -664,4 +667,6 @@ class TestController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
}
|