|
|
@@ -3,6 +3,7 @@
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
use App\Authority;
|
|
|
+use App\Batch;
|
|
|
use App\Commodity;
|
|
|
use App\CommodityMaterialBoxModel;
|
|
|
use App\Components\AsyncResponse;
|
|
|
@@ -34,6 +35,7 @@ use App\OwnerPriceOperation;
|
|
|
use App\OrderPackageCountingRecord;
|
|
|
use App\ProcurementCheckSheet;
|
|
|
use App\RejectedBill;
|
|
|
+use App\Services\BatchService;
|
|
|
use App\Services\CacheShelfService;
|
|
|
use App\Services\ForeignHaiRoboticsService;
|
|
|
use App\Services\OrderPackageReceivedSyncService;
|
|
|
@@ -128,21 +130,128 @@ sql;
|
|
|
|
|
|
public function test()
|
|
|
{
|
|
|
- TaskTransaction::query()->where("id",">=","265")->delete();
|
|
|
- StationTaskMaterialBox::query()->whereIn("id",[85010,85011])->get();
|
|
|
- app("CacheShelfService")->_stationCacheLightOff("HAIB1-01-01");
|
|
|
- Station::query()->where("station_type_id",5)
|
|
|
- ->whereNotNull("parent_id")->where("id","!=",11)->update(["status"=>1]);
|
|
|
- TaskTransaction::query()->find(265)->update(["status"=>0,"material_box_id"=>4562]);
|
|
|
- StationTaskMaterialBox::query()->find(85010)->update(["status"=>"待处理","material_box_id"=>4562]);
|
|
|
Cache::forget("CACHE_SHELF_AVAILABLE");
|
|
|
- $task = StationTaskMaterialBox::query()->find(85010);
|
|
|
- //11 HAIB1-01-01
|
|
|
- $a = new ForeignHaiRoboticsService();
|
|
|
- $toLocation = collect(["HAIB1-01-01"]);
|
|
|
- $taskMaterialBoxes= collect([$task]);
|
|
|
- $a->
|
|
|
- fetchGroup_multiLocation($toLocation, $taskMaterialBoxes, '', '立架出至缓存架',20);
|
|
|
+ $station = ["HAIB1-01-01"];
|
|
|
+ $material = ["IDE0000751"];
|
|
|
+ Station::query()->whereIn("code",$station)->update(["status"=>0]);
|
|
|
+ $stations = Station::query()->whereIn("code",$station)->get();
|
|
|
+ $materials = MaterialBox::query()->whereIn("code",$material)->get();
|
|
|
+ $dateTime = date("Y-m-d H:i:s");
|
|
|
+ $task1 = StationTaskMaterialBox::query()->create([
|
|
|
+ 'station_id'=>$stations[0]->id,
|
|
|
+ 'material_box_id'=>$materials[0]->id,
|
|
|
+ 'station_task_batch_id'=>1,
|
|
|
+ 'status'=>'待处理'
|
|
|
+ ]);
|
|
|
+ TaskTransaction::query()->insert([[
|
|
|
+ "doc_code" => "test",
|
|
|
+ "bar_code" => "test",
|
|
|
+ "to_station_id" => $stations[0]->id,
|
|
|
+ "material_box_id" => $materials[0]->id,
|
|
|
+ "task_id" => $task1->id,
|
|
|
+ "commodity_id" => 505012,//XUNI03
|
|
|
+ "amount" => 1,
|
|
|
+ "type" => "出库",
|
|
|
+ "status" => 0,
|
|
|
+ "mark" => 2,
|
|
|
+ "bin_number"=>1,
|
|
|
+ "created_at"=>$dateTime,
|
|
|
+ "updated_at"=>$dateTime,
|
|
|
+ ]]);
|
|
|
+ $foreignHaiRoboticsService = new ForeignHaiRoboticsService();
|
|
|
+ $toLocation = collect($station);
|
|
|
+ $taskMaterialBoxes = collect([$task1]);
|
|
|
+ $foreignHaiRoboticsService->
|
|
|
+ fetchGroup_multiLocation($toLocation, $taskMaterialBoxes, '', '立架出至缓存架',20,false);
|
|
|
+ foreach ($toLocation as $value){
|
|
|
+ app("CacheShelfService")->lightUp($value,'3','0',["title"=>"机器人取箱中,禁止操作"]);
|
|
|
+ Cache::forever("CACHE_SHELF_OCCUPANCY_11",true);
|
|
|
+ }
|
|
|
+ app("StationService")->locationOccupyMulti($toLocation->toArray());
|
|
|
+ dd(1);
|
|
|
+ /*$batchService = new BatchService();
|
|
|
+ $batches = Batch::query()->where("id",171829)->get();
|
|
|
+ $batchService->assignTasks($batches);
|
|
|
+ dd();*/
|
|
|
+ /*TaskTransaction::query()->where("id",">=",277)->delete();
|
|
|
+ StationTaskMaterialBox::query()->whereIn("id",[89685,89686,89687])->delete();
|
|
|
+ app("CacheShelfService")->_stationCacheLightOff("HAIB1-01-01");//灭灯
|
|
|
+ app("CacheShelfService")->_stationCacheLightOff("HAIB1-02-01");//灭灯
|
|
|
+ dd(1);*/
|
|
|
+ Station::query()->find(16)->update(["status"=>1]);
|
|
|
+ Cache::forget("CACHE_SHELF_AVAILABLE");
|
|
|
+ $station = ["HAIB1-01-01","HAIB1-02-01"];
|
|
|
+ $material = ["IDE0001954","IDE0004030","IDE0002012"];
|
|
|
+ Station::query()->whereIn("code",$station)->update(["status"=>0]);
|
|
|
+ $stations = Station::query()->whereIn("code",$station)->get();
|
|
|
+ $materials = MaterialBox::query()->whereIn("code",$material)->get();
|
|
|
+ $dateTime = date("Y-m-d H:i:s");
|
|
|
+ $task1 = StationTaskMaterialBox::query()->create([
|
|
|
+ 'station_id'=>$stations[0]->id,
|
|
|
+ 'material_box_id'=>$materials[0]->id,
|
|
|
+ 'station_task_batch_id'=>1,
|
|
|
+ 'status'=>'待处理'
|
|
|
+ ]);
|
|
|
+ $task2=StationTaskMaterialBox::query()->create([
|
|
|
+ 'station_id'=>$stations[1]->id,
|
|
|
+ 'material_box_id'=>$materials[1]->id,
|
|
|
+ 'station_task_batch_id'=>1,
|
|
|
+ 'status'=>'待处理'
|
|
|
+ ]);
|
|
|
+ $task3=StationTaskMaterialBox::query()->create([
|
|
|
+ 'station_id'=>6,
|
|
|
+ 'material_box_id'=>$materials[2]->id,
|
|
|
+ 'station_task_batch_id'=>1,
|
|
|
+ 'status'=>'待处理'
|
|
|
+ ]);
|
|
|
+ TaskTransaction::query()->insert([[
|
|
|
+ "doc_code" => "test",
|
|
|
+ "bar_code" => "test",
|
|
|
+ "to_station_id" => $stations[0]->id,
|
|
|
+ "material_box_id" => $materials[0]->id,
|
|
|
+ "task_id" => $task1->id,
|
|
|
+ "commodity_id" => 505012,//XUNI03
|
|
|
+ "amount" => 1,
|
|
|
+ "type" => "出库",
|
|
|
+ "status" => 0,
|
|
|
+ "mark" => 2,
|
|
|
+ "bin_number"=>1,
|
|
|
+ "created_at"=>$dateTime,
|
|
|
+ "updated_at"=>$dateTime,
|
|
|
+ ],[
|
|
|
+ "doc_code" => "test",
|
|
|
+ "bar_code" => "test",
|
|
|
+ "to_station_id" => $stations[1]->id,
|
|
|
+ "material_box_id" => $materials[1]->id,
|
|
|
+ "task_id" => $task2->id,
|
|
|
+ "commodity_id" => 505012,//XUNI03
|
|
|
+ "amount" => 1,
|
|
|
+ "type" => "出库",
|
|
|
+ "status" => 0,
|
|
|
+ "mark" => 2,
|
|
|
+ "bin_number"=>1,
|
|
|
+ "created_at"=>$dateTime,
|
|
|
+ "updated_at"=>$dateTime,
|
|
|
+ ],[
|
|
|
+ "doc_code" => "test",
|
|
|
+ "bar_code" => "test",
|
|
|
+ "to_station_id" => 6,
|
|
|
+ "material_box_id" => $materials[2]->id,
|
|
|
+ "task_id" => $task3->id,
|
|
|
+ "commodity_id" => 505012,//XUNI03
|
|
|
+ "amount" => 1,
|
|
|
+ "type" => "出库",
|
|
|
+ "status" => 3,
|
|
|
+ "mark" => 2,
|
|
|
+ "bin_number"=>1,
|
|
|
+ "created_at"=>$dateTime,
|
|
|
+ "updated_at"=>$dateTime,
|
|
|
+ ]]);
|
|
|
+ $foreignHaiRoboticsService = new ForeignHaiRoboticsService();
|
|
|
+ $toLocation = collect($station);
|
|
|
+ $taskMaterialBoxes = collect([$task1,$task2]);
|
|
|
+ $foreignHaiRoboticsService->
|
|
|
+ fetchGroup_multiLocation($toLocation, $taskMaterialBoxes, '', '立架出至缓存架',20,false);
|
|
|
foreach ($toLocation as $value){
|
|
|
app("CacheShelfService")->lightUp($value,'3','0',["title"=>"机器人取箱中,禁止操作"]);
|
|
|
Cache::forever("CACHE_SHELF_OCCUPANCY_11",true);
|