|
@@ -179,22 +179,41 @@ class TestController extends Controller
|
|
|
public function test1(\Closure $c,string $a){
|
|
public function test1(\Closure $c,string $a){
|
|
|
dd($c($a));
|
|
dd($c($a));
|
|
|
}
|
|
}
|
|
|
- public function test(Request $request)
|
|
|
|
|
|
|
+ private function paramDefault(&$waybill):array
|
|
|
{
|
|
{
|
|
|
- foreach (Batch::query()->where("created_at",">=","2021-12-18 00:00:00")->get() as $bat){
|
|
|
|
|
- $this->assignBatch($bat->code);
|
|
|
|
|
|
|
+ $update = [];
|
|
|
|
|
+ if (!$waybill->order_type){
|
|
|
|
|
+ $update["order_type"] = $waybill->order_type = Waybill::ORDER_TYPE_DEFAULT;
|
|
|
}
|
|
}
|
|
|
- dd("OK");
|
|
|
|
|
- $user = User::query()->where("name","yanyuanmin")->first();
|
|
|
|
|
- dd($user->id);
|
|
|
|
|
- dd($codes = app('OwnerService')->getQuery($user->id)->select("code")->pluck("code"));
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- $ownerIds=app('UserService')->getPermittingOwnerIds($user);
|
|
|
|
|
- $owners = Owner::query()->select("id","name","code")->whereIn('id', $ownerIds)->whereNull('deleted_at')->get();
|
|
|
|
|
- $codes = array_column($owners->toArray(), 'code');
|
|
|
|
|
- dd($codes);
|
|
|
|
|
- dd(Order::class);
|
|
|
|
|
|
|
+ if (!$waybill->transport_type){
|
|
|
|
|
+ $update["transport_type"] = $waybill->transport_type = "JZKH";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!$waybill->cargo_name){
|
|
|
|
|
+ $update["cargo_name"] = $waybill->cargo_name = "补货";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!$waybill->total_number){
|
|
|
|
|
+ $update["total_number"] = $waybill->total_number = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!$waybill->total_weight){
|
|
|
|
|
+ $update["total_weight"] = $waybill->total_weight = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!$waybill->package_service){
|
|
|
|
|
+ $update["package_service"] = $waybill->package_service = '托膜';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!$waybill->deliveryType){
|
|
|
|
|
+ $update["deliveryType_id"] = $waybill->deliveryType_id = 3;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!$waybill->pay_type){
|
|
|
|
|
+ $update["pay_type"] = $waybill->pay_type = Waybill::PAY_TYPE_DEFAULT;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!$waybill->back_sign_bill){
|
|
|
|
|
+ $update["back_sign_bill"] = $waybill->back_sign_bill = Waybill::BACK_SIGN_BILL_DEFAULT;
|
|
|
|
|
+ }
|
|
|
|
|
+ return $update;
|
|
|
|
|
+ }
|
|
|
|
|
+ public function test(Request $request)
|
|
|
|
|
+ {
|
|
|
|
|
+ dd(1);
|
|
|
$c = "test";
|
|
$c = "test";
|
|
|
$a = function ($b)use($c){
|
|
$a = function ($b)use($c){
|
|
|
return $b.$c;
|
|
return $b.$c;
|
|
@@ -239,31 +258,6 @@ class TestController extends Controller
|
|
|
$service->syncWorkOrder($rejected_bill);
|
|
$service->syncWorkOrder($rejected_bill);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function changeWorkOrder(){
|
|
|
|
|
- $type = OrderIssueType::query()->where('name' ,'拦截')->first();
|
|
|
|
|
-
|
|
|
|
|
- WorkOrder::query()->where('order_issue_type_id',$type->id)
|
|
|
|
|
- ->where('status',[4,5])
|
|
|
|
|
- ->where('process_progress','拦截成功')
|
|
|
|
|
- ->update(['process_progress' => '成功已退回,不赔偿']);
|
|
|
|
|
-
|
|
|
|
|
- WorkOrder::query()->where('order_issue_type_id',$type->id)
|
|
|
|
|
- ->whereIn('status',[4,5])
|
|
|
|
|
- ->where('process_progress','拦截失败')
|
|
|
|
|
- ->update(['process_progress' => '无法拦截']);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- WorkOrderDetail::query()->where('order_issue_type_id',$type->id)
|
|
|
|
|
- ->where('status',[4,5])
|
|
|
|
|
- ->where('process_progress','拦截成功')
|
|
|
|
|
- ->update(['process_progress' => '成功已退回,不赔偿']);
|
|
|
|
|
-
|
|
|
|
|
- WorkOrderDetail::query()->where('order_issue_type_id',$type->id)
|
|
|
|
|
- ->whereIn('status',[4,5])
|
|
|
|
|
- ->where('process_progress','拦截失败')
|
|
|
|
|
- ->update(['process_progress' => '无法拦截']);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
public function assignBatch($code)
|
|
public function assignBatch($code)
|
|
|
{
|
|
{
|
|
@@ -309,45 +303,6 @@ class TestController extends Controller
|
|
|
app("BatchService")->assignTasks($batches);
|
|
app("BatchService")->assignTasks($batches);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function inventory()
|
|
|
|
|
- {
|
|
|
|
|
- $location='B15-01-01';
|
|
|
|
|
- $taskId=950;
|
|
|
|
|
- $barcode='Fxdsc';
|
|
|
|
|
- $start=microtime(true);
|
|
|
|
|
-// $inventoryAccountMission=InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])
|
|
|
|
|
-// ->whereHas('commodity',function($query)use($barcode){
|
|
|
|
|
-// $query->whereHas('barcodes',function($sql)use($barcode){
|
|
|
|
|
-// $sql->where('code','=',$barcode);
|
|
|
|
|
-// });
|
|
|
|
|
-// })->where('location',$location)->where('inventory_account_id',$taskId)->first();
|
|
|
|
|
-//
|
|
|
|
|
-
|
|
|
|
|
-// $inventoryAccountMission=InventoryAccountMission::with(['commodity.barcodes','stockInventoryPersons'])
|
|
|
|
|
-// ->whereIn('commodity_id',function($query)use($barcode){
|
|
|
|
|
-// $query->from('commodity_barcodes')->select('commodity_id')->where('code',$barcode);
|
|
|
|
|
-// })->where('location',$location)
|
|
|
|
|
-// ->where('inventory_account_id',$taskId)
|
|
|
|
|
-// ->where('checked','否')
|
|
|
|
|
-// ->first();
|
|
|
|
|
- $stock_status=InventoryAccount::query()->where('id',$taskId)->value('status');
|
|
|
|
|
- $end=microtime(true);
|
|
|
|
|
- dump(round($end-$start,3),$stock_status);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public function testZC()
|
|
|
|
|
- {
|
|
|
|
|
-// $batches=Batch::query()->where('id',1)->get();
|
|
|
|
|
-// BroadcastBatchToZhengCangJob::dispatch($batches); //在这里为波次注册队列任务!
|
|
|
|
|
- $taskId=792;
|
|
|
|
|
- $location='H05-35-04';
|
|
|
|
|
- $barcode='6931481255587';
|
|
|
|
|
- /** @var AndroidInventoryService $service */
|
|
|
|
|
- $service=app('AndroidInventoryService');
|
|
|
|
|
- $inventoryAccountMission=$service->getInventoryDetail($taskId,$location,$barcode);
|
|
|
|
|
- dd($inventoryAccountMission->stockInventoryPersons);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|