|
|
@@ -129,7 +129,7 @@ class TestController extends Controller
|
|
|
INSERT INTO TSK_TASKLISTS({$columns}) VALUES({$values})
|
|
|
sql;
|
|
|
dd($sql);
|
|
|
- }catch (\Exception $e){
|
|
|
+ } catch (\Exception $e) {
|
|
|
dd($e);
|
|
|
}
|
|
|
}
|
|
|
@@ -159,31 +159,31 @@ sql;
|
|
|
app("CacheShelfService")->_stationCacheLightOff("HAIB1-01-01");//灭灯
|
|
|
app("CacheShelfService")->_stationCacheLightOff("HAIB1-02-01");//灭灯
|
|
|
dd(1);*/
|
|
|
- Station::query()->where("station_type_id",5)->update(["status"=>1]);
|
|
|
+ Station::query()->where("station_type_id", 5)->update(["status" => 1]);
|
|
|
Cache::forget("CACHE_SHELF_AVAILABLE");
|
|
|
- $station = ["HAIB1-01-01","HAIB1-02-01"];
|
|
|
- $material = ["IDE0001824","IDE0001740","IDE0002710"];
|
|
|
- Station::query()->whereIn("code",$station)->update(["status"=>0]);
|
|
|
- $stations = Station::query()->whereIn("code",$station)->get();
|
|
|
- $materials = MaterialBox::query()->whereIn("code",$material)->get();
|
|
|
+ $station = ["HAIB1-01-01", "HAIB1-02-01"];
|
|
|
+ $material = ["IDE0001824", "IDE0001740", "IDE0002710"];
|
|
|
+ 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'=>'待处理'
|
|
|
+ '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'=>'待处理'
|
|
|
+ $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'=>'待处理'
|
|
|
+ $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",
|
|
|
@@ -196,10 +196,10 @@ sql;
|
|
|
"type" => "出库",
|
|
|
"status" => 0,
|
|
|
"mark" => 2,
|
|
|
- "bin_number"=>1,
|
|
|
- "created_at"=>$dateTime,
|
|
|
- "updated_at"=>$dateTime,
|
|
|
- ],[
|
|
|
+ "bin_number" => 1,
|
|
|
+ "created_at" => $dateTime,
|
|
|
+ "updated_at" => $dateTime,
|
|
|
+ ], [
|
|
|
"doc_code" => "test",
|
|
|
"bar_code" => "test",
|
|
|
"to_station_id" => $stations[1]->id,
|
|
|
@@ -210,10 +210,10 @@ sql;
|
|
|
"type" => "出库",
|
|
|
"status" => 0,
|
|
|
"mark" => 2,
|
|
|
- "bin_number"=>1,
|
|
|
- "created_at"=>$dateTime,
|
|
|
- "updated_at"=>$dateTime,
|
|
|
- ],[
|
|
|
+ "bin_number" => 1,
|
|
|
+ "created_at" => $dateTime,
|
|
|
+ "updated_at" => $dateTime,
|
|
|
+ ], [
|
|
|
"doc_code" => "test",
|
|
|
"bar_code" => "test",
|
|
|
"to_station_id" => 6,
|
|
|
@@ -224,18 +224,18 @@ sql;
|
|
|
"type" => "出库",
|
|
|
"status" => 3,
|
|
|
"mark" => 2,
|
|
|
- "bin_number"=>1,
|
|
|
- "created_at"=>$dateTime,
|
|
|
- "updated_at"=>$dateTime,
|
|
|
+ "bin_number" => 1,
|
|
|
+ "created_at" => $dateTime,
|
|
|
+ "updated_at" => $dateTime,
|
|
|
]]);
|
|
|
$foreignHaiRoboticsService = new ForeignHaiRoboticsService();
|
|
|
$toLocation = collect($station);
|
|
|
- $taskMaterialBoxes = collect([$task1,$task2]);
|
|
|
+ $taskMaterialBoxes = collect([$task1, $task2]);
|
|
|
$foreignHaiRoboticsService->
|
|
|
- fetchGroup_multiLocation($toLocation, $taskMaterialBoxes, '', '立架出至缓存架',20,false);
|
|
|
- foreach ($toLocation as $index=>$value){
|
|
|
- app("CacheShelfService")->lightUp($value,'3','0',["title"=>"机器人取箱中,禁止操作"]);
|
|
|
- Cache::forever("CACHE_SHELF_OCCUPANCY_{$stations[$index]->id}",true);
|
|
|
+ fetchGroup_multiLocation($toLocation, $taskMaterialBoxes, '', '立架出至缓存架', 20, false);
|
|
|
+ foreach ($toLocation as $index => $value) {
|
|
|
+ app("CacheShelfService")->lightUp($value, '3', '0', ["title" => "机器人取箱中,禁止操作"]);
|
|
|
+ Cache::forever("CACHE_SHELF_OCCUPANCY_{$stations[$index]->id}", true);
|
|
|
}
|
|
|
app("StationService")->locationOccupyMulti($toLocation->toArray());
|
|
|
}
|
|
|
@@ -259,11 +259,12 @@ sql;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function updateWorkOrder(){
|
|
|
+ public function updateWorkOrder()
|
|
|
+ {
|
|
|
$items = WorkOrder::query()->with('order.owner')->get();
|
|
|
$params = [];
|
|
|
- $items->each(function($item)use(&$params){
|
|
|
- if ($item->order){
|
|
|
+ $items->each(function ($item) use (&$params) {
|
|
|
+ if ($item->order) {
|
|
|
$owner_id = $item->order->owner_id;
|
|
|
|
|
|
$params[] = [
|
|
|
@@ -278,7 +279,6 @@ sql;
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public function testUpdateInv()
|
|
|
{
|
|
|
ini_set('max_execution_time', 0);
|
|
|
@@ -351,4 +351,25 @@ sql;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 重置15天内的数据
|
|
|
+ */
|
|
|
+ public function order_packages_init()
|
|
|
+ {
|
|
|
+ OrderPackage::query()
|
|
|
+ ->whereBetween('created_at', [now()->subDays(15), now()])
|
|
|
+ ->update([
|
|
|
+ 'is_delay_deliver' => 0,
|
|
|
+ 'sync_routes_flag' => 0,
|
|
|
+ 'status' => 1,
|
|
|
+ 'exception_status' => 0,
|
|
|
+ ]);
|
|
|
+ OrderPackage::query()
|
|
|
+ ->whereBetween('created_at', [now()->subDays(15), now()])
|
|
|
+ ->whereNotNull('received_at')
|
|
|
+ ->update([
|
|
|
+ 'status' => 7,
|
|
|
+ ]);
|
|
|
+ }
|
|
|
}
|