diff --git a/app/Http/Controllers/V3/CMMSMachinesController.php b/app/Http/Controllers/V3/CMMSMachinesController.php index ffba9760..e575d179 100644 --- a/app/Http/Controllers/V3/CMMSMachinesController.php +++ b/app/Http/Controllers/V3/CMMSMachinesController.php @@ -14,7 +14,7 @@ class CMMSMachinesController extends Controller public function list(): JsonResponse { - $machinesList = CMMSMachine::query()->get(['machine_code', 'id']); + $machinesList = CMMSMachine::query()->get(['machine_code', 'id', 'plak_number', 'car_name']); return $this->successResponse($machinesList); } @@ -23,7 +23,7 @@ class CMMSMachinesController extends Controller { $matchedSearchedMachines = CMMSMachine::query() ->where('machine_code', 'LIKE', "%{$request->machine_code}%") - ->get(['machine_code', 'id']); + ->get(['machine_code', 'id', 'plak_number', 'car_name']); return $this->successResponse($matchedSearchedMachines); } diff --git a/app/Http/Controllers/V3/FMSVehicleManagementController.php b/app/Http/Controllers/V3/FMSVehicleManagementController.php new file mode 100644 index 00000000..f50221a7 --- /dev/null +++ b/app/Http/Controllers/V3/FMSVehicleManagementController.php @@ -0,0 +1,31 @@ +setInputParameters([ + "machineCode" => $request->machineCode, + "startDT" => $request->startDT, + "endDT" => $request->endDT, + "minStopDuration" => $request->minStopDuration + ]); + + $data = $getVehicleActivityService->run(); + return $this->successResponse($data); + } +} diff --git a/app/Http/Controllers/V3/RoadPatrolProjectController.php b/app/Http/Controllers/V3/RoadPatrolProjectController.php index 90519087..0ef03630 100644 --- a/app/Http/Controllers/V3/RoadPatrolProjectController.php +++ b/app/Http/Controllers/V3/RoadPatrolProjectController.php @@ -293,6 +293,9 @@ class RoadPatrolProjectController extends Controller 'message' => 'اقدام مربوطه قبلا رسیدگی شده است.' ], 400); } + + $road_item->rahdaran()->attach($request->rahdaran_id); + $road_item->cmmsMachines()->attach($request->machines_id); } } } diff --git a/routes/v3.php b/routes/v3.php index 46e28e75..cab2d0a7 100644 --- a/routes/v3.php +++ b/routes/v3.php @@ -5,6 +5,7 @@ use App\Http\Controllers\V3\Azmayesh\AzmayeshController; use App\Http\Controllers\V3\Azmayesh\AzmayeshSampleController; use App\Http\Controllers\V3\Azmayesh\AzmayeshTypeController; use App\Http\Controllers\V3\CMMSMachinesController; +use App\Http\Controllers\V3\FMSVehicleManagementController; use App\Http\Controllers\V3\Harim\DivarkeshiController; use App\Http\Controllers\V3\ProfileController; use App\Http\Controllers\V3\RahdaranController; @@ -170,3 +171,10 @@ Route::prefix('rahdaran') Route::get('/list', 'list')->name('list'); Route::get('/search', 'search')->name('search'); }); + +Route::prefix('fms_vehicle') + ->name('fmsVehicle.') + ->controller(FMSVehicleManagementController::class) + ->group(function () { + Route::get('/get_activity', 'getActivity')->name('getActivity'); + });