Merge pull request 'use polyline encoder for command' (#18) from feature/MissionMachinesReport into develop
Reviewed-on: #18
This commit was merged in pull request #18.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Mission;
|
||||||
use App\Services\PolylineEncoder;
|
use App\Services\PolylineEncoder;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
@@ -24,8 +25,15 @@ class EncodePolyLineCommand extends Command
|
|||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*/
|
*/
|
||||||
public function handle(PolylineEncoder $polylineEncoder)
|
public function handle(PolylineEncoder $polylineEncoder): void
|
||||||
{
|
{
|
||||||
|
Mission::query()->whereNotNull('area')->each(function ($mission) use ($polylineEncoder) {
|
||||||
|
$encodedValue = $polylineEncoder->encodePolyLine($mission, lng_lat_format:true);
|
||||||
|
$mission->update([
|
||||||
|
'encoded_route' => $encodedValue,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->info("updated successfully");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class ReportMachineController extends Controller
|
|||||||
allowedSortings: ['*'],
|
allowedSortings: ['*'],
|
||||||
allowedSelects: [
|
allowedSelects: [
|
||||||
'id', 'province_id', 'province_name', 'city_id', 'city_name',
|
'id', 'province_id', 'province_name', 'city_id', 'city_name',
|
||||||
'end_km', 'km', 'driver_name', 'state_name',
|
'end_km', 'km', 'driver_name', 'state_name', 'station_name'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class RequestPortalController extends Controller
|
|||||||
return response()->json($requestPortalService->datatable($request));
|
return response()->json($requestPortalService->datatable($request));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function violations(Request $request): JsonResponse
|
public function violations(Request $request): array
|
||||||
{
|
{
|
||||||
$query = MissionViolation::query()->where([
|
$query = MissionViolation::query()->where([
|
||||||
['status', '=', MissionViolationStatus::BEDON_EGHDAM->value],
|
['status', '=', MissionViolationStatus::BEDON_EGHDAM->value],
|
||||||
|
|||||||
@@ -497,7 +497,7 @@ Route::prefix('missions')
|
|||||||
Route::get('/', 'index')->name('index');
|
Route::get('/', 'index')->name('index');
|
||||||
Route::get('/violations', 'violations')->name('violations');
|
Route::get('/violations', 'violations')->name('violations');
|
||||||
Route::post('/', 'store')->name('store');
|
Route::post('/', 'store')->name('store');
|
||||||
Route::post('/clarifyUnauthorizedExit/{violation}','clarifyUnauthorizedExit')->name('clarifyUnauthorizedExit');
|
Route::post('/clarify_unauthorized_exit/{violation}','clarifyUnauthorizedExit')->name('clarifyUnauthorizedExit');
|
||||||
Route::post('/continue/{mission}','continueMission')->name('continueMission');
|
Route::post('/continue/{mission}','continueMission')->name('continueMission');
|
||||||
Route::get('/{mission}', 'show')->name('show');
|
Route::get('/{mission}', 'show')->name('show');
|
||||||
Route::post('/{mission}', 'update')->name('update');
|
Route::post('/{mission}', 'update')->name('update');
|
||||||
|
|||||||
Reference in New Issue
Block a user