|
@@ -20,7 +20,6 @@ use App\OracleDOCWaveDetails;
|
|
|
use App\Order;
|
|
use App\Order;
|
|
|
use App\OrderIssue;
|
|
use App\OrderIssue;
|
|
|
use App\OrderPackage;
|
|
use App\OrderPackage;
|
|
|
-use App\OrderPackageCommodities;
|
|
|
|
|
use App\OrderTracking;
|
|
use App\OrderTracking;
|
|
|
use App\OrderTrackingOwner;
|
|
use App\OrderTrackingOwner;
|
|
|
use App\Owner;
|
|
use App\Owner;
|
|
@@ -30,20 +29,15 @@ use App\ProcessDaily;
|
|
|
use App\ProcessStatistic;
|
|
use App\ProcessStatistic;
|
|
|
use App\RejectedBill;
|
|
use App\RejectedBill;
|
|
|
use App\RejectedBillItem;
|
|
use App\RejectedBillItem;
|
|
|
-use App\Services\CommodityService;
|
|
|
|
|
use App\Services\common\BatchUpdateService;
|
|
use App\Services\common\BatchUpdateService;
|
|
|
use App\Services\common\DataHandlerService;
|
|
use App\Services\common\DataHandlerService;
|
|
|
use App\Services\InventoryCompareService;
|
|
use App\Services\InventoryCompareService;
|
|
|
-use App\Services\LogisticService;
|
|
|
|
|
use App\Services\LogService;
|
|
use App\Services\LogService;
|
|
|
use App\Services\OracleDOCOrderHeaderService;
|
|
use App\Services\OracleDOCOrderHeaderService;
|
|
|
use App\Services\OrderIssueService;
|
|
use App\Services\OrderIssueService;
|
|
|
-use App\Services\OrderPackageCommoditiesService;
|
|
|
|
|
use App\Services\OrderPackageService;
|
|
use App\Services\OrderPackageService;
|
|
|
use App\Services\OrderService;
|
|
use App\Services\OrderService;
|
|
|
-use App\Services\OrderTrackingOwnerService;
|
|
|
|
|
use App\Services\OrderTrackingService;
|
|
use App\Services\OrderTrackingService;
|
|
|
-use App\Services\OwnerService;
|
|
|
|
|
use App\Unit;
|
|
use App\Unit;
|
|
|
use App\User;
|
|
use App\User;
|
|
|
use App\Waybill;
|
|
use App\Waybill;
|
|
@@ -255,7 +249,7 @@ class TestController extends Controller
|
|
|
'measuring_machine_id'=>$package->measuring_machine_id,
|
|
'measuring_machine_id'=>$package->measuring_machine_id,
|
|
|
'weighed_at'=>$package->weighed_at,
|
|
'weighed_at'=>$package->weighed_at,
|
|
|
'status'=>$package->status]);
|
|
'status'=>$package->status]);
|
|
|
- if (!$orderPackage)array_push($error,$package->id);
|
|
|
|
|
|
|
+ if (!$orderPackage)array_push($error,$package->id);
|
|
|
}
|
|
}
|
|
|
LogService::log(__METHOD__,"同步时WMS中未找到这些订单",json_encode($error));
|
|
LogService::log(__METHOD__,"同步时WMS中未找到这些订单",json_encode($error));
|
|
|
$id = $packages[count($packages)-1]->id;
|
|
$id = $packages[count($packages)-1]->id;
|
|
@@ -419,8 +413,11 @@ class TestController extends Controller
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function test2(){
|
|
public function test2(){
|
|
|
- $c = Commodity::find(325434);
|
|
|
|
|
- dd($c['name']);
|
|
|
|
|
|
|
+ $depository = app('depositoryService')->firstOrCreate(["code"=>"TEST"],[
|
|
|
|
|
+ "name"=>"TEST",
|
|
|
|
|
+ "code"=>"TEST",
|
|
|
|
|
+ ]);
|
|
|
|
|
+ dd($depository);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*1*/
|
|
/*1*/
|
|
@@ -480,23 +477,11 @@ class TestController extends Controller
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public function divide()
|
|
|
|
|
- {
|
|
|
|
|
- $trackings = OrderTracking::query()->with('commodities.package')->get();
|
|
|
|
|
- $trackings->each(function ($tracking){
|
|
|
|
|
- $package = $tracking->commodities->package;
|
|
|
|
|
- $bulk = $package->bulk;
|
|
|
|
|
- if($bulk>=1000000){
|
|
|
|
|
- $bulk = bcdiv($bulk,1000000000,3);
|
|
|
|
|
- OrderPackage::query()->where('id',$package->id)->update(['bulk'=>$bulk]);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public function test3(){
|
|
|
|
|
|
|
|
- public function test3()
|
|
|
|
|
- {
|
|
|
|
|
/** @var DataHandlerService $dataHandlerService */
|
|
/** @var DataHandlerService $dataHandlerService */
|
|
|
- $dataHandlerService = app(DataHandlerService::class);
|
|
|
|
|
|
|
+ $dataHandlerService = app('dataHandlerService');
|
|
|
|
|
+ $startDate = \Illuminate\Support\Carbon::parse('2020-05-06 13:16:51')->toDateTimeString();
|
|
|
/** @var OrderTrackingService $orderTrackingService */
|
|
/** @var OrderTrackingService $orderTrackingService */
|
|
|
$orderTrackingService = app('orderTrackingService');
|
|
$orderTrackingService = app('orderTrackingService');
|
|
|
/** @var OrderService $orderSerivce */
|
|
/** @var OrderService $orderSerivce */
|
|
@@ -524,8 +509,41 @@ class TestController extends Controller
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function doctype(){
|
|
|
|
|
+
|
|
|
|
|
+ $a=\Doctrine\DBAL\Types\Type::getTypesMap();
|
|
|
|
|
+ dd($a);
|
|
|
|
|
+ }
|
|
|
|
|
+ public function orderTrckingOwnerAll(){
|
|
|
|
|
+ $owners = Owner::all();
|
|
|
|
|
+ foreach ($owners as $owner) {
|
|
|
|
|
+ $orderTrackingOwner = OrderTrackingOwner::query()->where('owner_id',$owner->id)->first();
|
|
|
|
|
+ if($orderTrackingOwner == null){
|
|
|
|
|
+ OrderTrackingOwner::query()->create(['owner_id'=>$owner->id,'status'=>'启用']);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if($orderTrackingOwner->status == '禁用'){
|
|
|
|
|
+ $orderTrackingOwner->status = '启用';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function updateOrderTracking(){
|
|
|
|
|
+ $orderTrackings = OrderTracking::query()->with('commodities.package.order')
|
|
|
|
|
+ ->whereHas('commodities.package.order',function($query){
|
|
|
|
|
+ $query->where('client_code','O2009027827');
|
|
|
|
|
+ })
|
|
|
|
|
+ ->where('created_at','>','2020-09-28 00:07:06')->first();
|
|
|
|
|
+ $order = $orderTrackings->commodities->package->order;
|
|
|
|
|
+ $client_code = $order->client_code;
|
|
|
|
|
+ if(preg_match('/^O[\d]/',$client_code ?? '') > 0){
|
|
|
|
|
+ OrderTracking::query()->where('id',$orderTrackings->id)->update(['web_order_number'=>$client_code]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function updateOrderTrackingGrossWeightAndBulk(){
|
|
public function updateOrderTrackingGrossWeightAndBulk(){
|
|
|
- $orderTrackings = OrderTracking::query()->with('commodities.package.order.owner','commodities.commodity')->get();
|
|
|
|
|
|
|
+ $orderTrackings = OrderTracking::query()->with('commodities.package.order.owner','commodities.commodity')
|
|
|
|
|
+ ->where('created_at','>','2020-09-28 00:07:06')->get();
|
|
|
foreach ($orderTrackings as $orderTracking) {
|
|
foreach ($orderTrackings as $orderTracking) {
|
|
|
$code = $orderTracking->commodities->package->order->owner->code ?? false;
|
|
$code = $orderTracking->commodities->package->order->owner->code ?? false;
|
|
|
$amount = $orderTracking->commodities->amount;
|
|
$amount = $orderTracking->commodities->amount;
|
|
@@ -536,9 +554,9 @@ class TestController extends Controller
|
|
|
$bulk = null;
|
|
$bulk = null;
|
|
|
$gross_weight = round($basSku->cube * $amount,3);
|
|
$gross_weight = round($basSku->cube * $amount,3);
|
|
|
$bulk = round($basSku->grossweight * $amount,3);
|
|
$bulk = round($basSku->grossweight * $amount,3);
|
|
|
- if($orderTracking->gross_weight!= $gross_weight ||$orderTracking->bulk!= $bulk ){
|
|
|
|
|
|
|
+ if($orderTracking->gross_weight!= $gross_weight ||$orderTracking->bulk!= $bulk ){
|
|
|
OrderTracking::query()->where('id',$orderTracking->id)->update(['gross_weight'=>$gross_weight,'bulk'=>$bulk]);
|
|
OrderTracking::query()->where('id',$orderTracking->id)->update(['gross_weight'=>$gross_weight,'bulk'=>$bulk]);
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|