@@ -50,6 +50,13 @@ PAYMENT_USERNAME=
|
||||
PAYMENT_PASSWORD=
|
||||
PAYMENT_LINK=
|
||||
|
||||
HARIM_PAYMENT_USERNAME=
|
||||
HARIM_PAYMENT_PASSWORD=
|
||||
HARIM_PAYMENT_URL=
|
||||
HARIM_PAYMENT_SERIAL=
|
||||
HARIM_PAYMENT_INSTANCE_ID=
|
||||
|
||||
|
||||
RMS_VERSION=3.0
|
||||
RMS_CTO_PHONE_NUMBER=
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ class GetMachinesInfoListCommand extends Command
|
||||
'province_id' => $entry['UnitGroupCode'] ?? null,
|
||||
'city_id' => $entry['UnitCode'] ?? null,
|
||||
'station_id' => $entry['Layer3Code'] ?? null,
|
||||
'driver_name' => $entry['DriverName'] ?? null,
|
||||
]);
|
||||
|
||||
++$updatedRows;
|
||||
|
||||
@@ -7,6 +7,10 @@ enum CmmsMachineStatus: int
|
||||
case AMADE= 1;
|
||||
case RESERVE = 2;
|
||||
case DAR_MAMORIAT = 3;
|
||||
case KHAREGE_AZ_RADE = 4;
|
||||
case DAR_TAMIR = 5 ;
|
||||
case FOROKHTEH_SHODE = 6;
|
||||
case NIZE_BE_TAMIR =7 ;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
@@ -14,6 +18,10 @@ enum CmmsMachineStatus: int
|
||||
self::AMADE => 'آماده',
|
||||
self::RESERVE => 'رزرو',
|
||||
self::DAR_MAMORIAT => 'در ماموریت',
|
||||
self::KHAREGE_AZ_RADE => 'خارج از محدوده',
|
||||
self::DAR_TAMIR => 'در تعمیر',
|
||||
self::FOROKHTEH_SHODE => ' فروخته شده',
|
||||
self::NIZE_BE_TAMIR => 'نیاز به تعمیر',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ enum FMSResultCode: string
|
||||
"-1" => "نام ﮐﺎرﺑﺮي ﯾﺎ ﮐﻠﻤﻪ ﻋﺒﻮر ﺻﺤﯿﺢ ﻧﯿﺴﺖ.",
|
||||
"-2" => "خودرو با کد مورد نظر وجود ندارد یا دستگاه ردیاب به آن متصل نیست.",
|
||||
"-3" => "کاربر به خودرو مورد نظر دسترسی ندارد.",
|
||||
"-4" => "ﺗﻌﺪاد دﻓﻌﺎت ﺟﺮاي ﺗﺎﺑﻊ ﺑﯿﺶ از ﺣﺪ ﻣﺠﺎز اﺳﺖ(اﯾﻦ ﺳﺮوﯾﺲ را در ﻫﺮ ثاﻧﯿﻪ ﻓﻘﻂ ﯾﮏ ﺑﺎر ﻣﯽﺗﻮان اﺟﺮاﮐﺮد)",
|
||||
"-4" => "ﺗﻌﺪاد دﻓﻌﺎت اﺟﺮاي ﺗﺎﺑﻊ ﺑﯿﺶ از ﺣﺪ ﻣﺠﺎز اﺳﺖ(اﯾﻦ ﺳﺮوﯾﺲ را در ﻫﺮ ثاﻧﯿﻪ ﻓﻘﻂ ﯾﮏ ﺑﺎر ﻣﯽﺗﻮان اﺟﺮاﮐﺮد)",
|
||||
"-5" => "پارامتر های داده شده صحیح نیستند",
|
||||
];
|
||||
|
||||
|
||||
@@ -21,6 +21,10 @@ enum HarimStates: int
|
||||
case BARESI_ARSE_VA_AYAN_ERSAL_SHODE_TAVASOT_MODIR_KOL = 15;
|
||||
case MOKHALEFAT_BA_DASTGAH = 16;
|
||||
case ETMAM_FARAYAND = 17;
|
||||
case SODOR_FACTOR = 18;
|
||||
case PARDAKHT_FACTOR = 19;
|
||||
case SABT_FISH = 20;
|
||||
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
@@ -42,6 +46,9 @@ enum HarimStates: int
|
||||
self::BARESI_ARSE_VA_AYAN_ERSAL_SHODE_TAVASOT_MODIR_KOL => "تائید عرصه و اعیان ارسال شده توسط مدیر",
|
||||
self::MOKHALEFAT_BA_DASTGAH => "مخالفت با درخواست",
|
||||
self::ETMAM_FARAYAND => "اتمام فرایند",
|
||||
self::SODOR_FACTOR => "صدور فاکتور",
|
||||
self::PARDAKHT_FACTOR => "پرداخت فاکتور",
|
||||
self::SABT_FISH => "ثبت فیش",
|
||||
};
|
||||
}
|
||||
}
|
||||
17
app/Enums/MissionViolationStatus.php
Normal file
17
app/Enums/MissionViolationStatus.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum MissionViolationStatus: int
|
||||
{
|
||||
case BEDON_EGHDAM = 0;
|
||||
case EGHDAM_SHODE = 1;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::BEDON_EGHDAM => "بدون اقدام",
|
||||
self::EGHDAM_SHODE => "اقدام شده",
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ enum MissionViolationType: int
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::KHOROJ_BEDONE_MOGAVEZ => "خروج بدون مجوز ",
|
||||
self::KHOROJ_BEDONE_MOGAVEZ => "خروج بدون مجوز",
|
||||
self::ADAM_TAHAROK => "عدم تحرک",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,12 +2,18 @@
|
||||
|
||||
namespace App\Http\Controllers\V3\Dashboard\Harim;
|
||||
|
||||
use App\Facades\Sms\Sms;
|
||||
use App\Enums\HarimStates;
|
||||
use App\Exceptions\ProhibitedAction;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\V3\Dashboard\Harim\Detail\HarimSubmitInvoiceRequest;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\Harim;
|
||||
use App\Models\HarimState;
|
||||
use App\Services\Cartables\Harim\HarimPaymentService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
class DetailController extends Controller
|
||||
@@ -30,4 +36,58 @@ class DetailController extends Controller
|
||||
->orderBy('id', 'desc')
|
||||
->get(['id', 'expert_description', 'action_name', 'previous_state_name']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Throwable
|
||||
* @throws ProhibitedAction
|
||||
*/
|
||||
public function submitInvoice(Harim $harim, HarimPaymentService $harimpaymentService, HarimSubmitInvoiceRequest $request): JsonResponse
|
||||
{
|
||||
$lock = Cache::lock("harimPayment-{$harim->id}", 10);
|
||||
throw_if(! $lock->get(), new ProhibitedAction('امکان درخواست مجدد تا 10 ثانیه دیگر وجود ندارد'));
|
||||
|
||||
$payment_amount = $harim->payment_amount;
|
||||
|
||||
$bill_code = $harimpaymentService->invoiceBillApi($harim->national_id, $payment_amount);
|
||||
|
||||
DB::transaction(function () use ($bill_code, $harim) {
|
||||
|
||||
$harim->histories()->update([
|
||||
// 'bill_code' => $bill_code,
|
||||
'status' => HarimStates::SODOR_FACTOR->value,
|
||||
'status_fa' => HarimStates::SODOR_FACTOR->label(),
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
$msg = "فاکتور با شناسه پرداخت \n" . explode("/", $harim->bill_code)[0]. "\n برای پرداخت از لینک زیر اقدام نمایید.\n\n"
|
||||
. config('harim_web_services.Harim_Payment.LINK')."/#/pay/".explode("/", $harim->bill_code)[0]."/$payment_amount";
|
||||
|
||||
Sms::sendSms($harim->phone_number, $msg);
|
||||
|
||||
$lock->release();
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function checkPaymentStatus(Harim $harim, HarimPaymentService $harimpaymentService): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($harim, $harimpaymentService) {
|
||||
|
||||
$response = json_decode($harimpaymentService->callPaymentStatusBillApi(explode('/', $harim->bill_code)[0]));
|
||||
|
||||
throw_if(! $response->isPayed, new ProhibitedAction('پرداخت انجام نشده است'));
|
||||
|
||||
$harim->histories()->update([
|
||||
'status' => HarimStates::PARDAKHT_FACTOR->value,
|
||||
'status_fa' => HarimStates::PARDAKHT_FACTOR->label(),
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
return $this->successResponse($harim);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
||||
|
||||
use App\Enums\FMSResultCode;
|
||||
use App\Enums\MissionStates;
|
||||
use App\Events\V3\Dashboard\Mission\SendDataToFMSEvent;
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -11,6 +12,7 @@ use App\Http\Requests\V3\Mission\ControlUnit\StartRequest;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\Mission;
|
||||
use App\Services\Cartables\Mission\ControlUnitService;
|
||||
use App\Services\FMS\GetErrorRateService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -52,9 +54,9 @@ class ControlUnitController extends Controller
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function finish(FinishRequest $request, Mission $mission): JsonResponse
|
||||
public function finish(FinishRequest $request, Mission $mission, GetErrorRateService $getErrorRateService): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($mission) {
|
||||
DB::transaction(function () use ($mission, $getErrorRateService) {
|
||||
$mission->histories()->create([
|
||||
'user_id' => auth()->user()->id,
|
||||
'previous_state_id' => $mission->state_id,
|
||||
@@ -69,6 +71,18 @@ class ControlUnitController extends Controller
|
||||
'finish_time' => now(),
|
||||
'mission_duration' => strtotime(now()) - strtotime($mission->start_time),
|
||||
]);
|
||||
|
||||
$getErrorRateService->setInputParameters($mission);
|
||||
$responseData = $getErrorRateService->run();
|
||||
|
||||
$mission->update([
|
||||
'in_area_duration' => $responseData['timeInAreaSeconds'],
|
||||
'first_enter' => $responseData['firstEnter'],
|
||||
'last_exit' => $responseData['lastExit'],
|
||||
'point_number_sent' => $responseData['noOfPointsInMission'],
|
||||
'fms_result_code' => $responseData['resultCode'],
|
||||
'fms_result_message' => FMSResultCode::name($responseData['resultCode']),
|
||||
]);
|
||||
});
|
||||
|
||||
if ($mission->category_id == 2) {
|
||||
@@ -76,7 +90,7 @@ class ControlUnitController extends Controller
|
||||
$rpc->store($mission);
|
||||
}
|
||||
|
||||
SendDataToFMSEvent::dispatch($mission);
|
||||
// SendDataToFMSEvent::dispatch($mission);
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\Mission;
|
||||
use App\Models\Province;
|
||||
use App\Services\Cartables\Mission\ReportService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ReportController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function countryActivity(Request $request, ReportService $reportrService): JsonResponse
|
||||
{
|
||||
|
||||
return $this->successResponse([
|
||||
'activities' => $reportrService->countryActivity($request),
|
||||
'provinces' => Province::all(['id', 'name_fa']),
|
||||
]);
|
||||
}
|
||||
|
||||
// public function provinceActivity(Request $request, OperatorService $operatorService): JsonResponse
|
||||
// {
|
||||
//
|
||||
// $data = $operatorService->provinceActivity(
|
||||
// $request,
|
||||
// 90,
|
||||
// );
|
||||
//
|
||||
// return $this->successResponse([
|
||||
// 'activities' => $data,
|
||||
// 'edarateShahri' => EdarateShahri::where('province_id', $request->province_id)->get(['id', 'name_fa']),
|
||||
// ]);
|
||||
// }
|
||||
//
|
||||
// public function countryExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
||||
// {
|
||||
// $data = $operatorService->countryActivity(90, $request);
|
||||
// $name = 'گزارش نگهداری حریم راه برای راه دسترسی غیر مجاز '.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||
//
|
||||
// return Excel::download(new ExcelReport($data), $name);
|
||||
// }
|
||||
//
|
||||
// public function provinceExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
||||
// {
|
||||
// $data = $operatorService->provinceActivity(
|
||||
// $request,
|
||||
// 90,
|
||||
// );
|
||||
// $name = 'گزارش نگهداری حریم راه برای راه دسترسی غیر مجاز '.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||
//
|
||||
// return Excel::download(new AccessRoadReport($data, $request), $name);
|
||||
// }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
||||
|
||||
use App\Enums\FMSResultCode;
|
||||
use App\Enums\MissionCategory;
|
||||
use App\Enums\MissionStates;
|
||||
use App\Enums\MissionTypes;
|
||||
@@ -17,6 +18,7 @@ use App\Models\CMMSMachine;
|
||||
use App\Models\Mission;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Services\Cartables\Mission\RequestPortalService;
|
||||
use App\Services\FMS\GetErrorRateService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -48,6 +50,8 @@ class RequestPortalController extends Controller
|
||||
'username' => $user->username,
|
||||
'province_id' => $user->province_id,
|
||||
'province_name' => $user->province_fa,
|
||||
'city_id' => $user->city_id ?? null,
|
||||
'city_name' => $user->city_fa ?? null,
|
||||
'edare_shahri_id' => $user->edarate_shahri_id ?? null,
|
||||
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
||||
'state_id' => $state,
|
||||
@@ -67,6 +71,7 @@ class RequestPortalController extends Controller
|
||||
'category_name' => MissionCategory::name($category),
|
||||
'explanation' => $request->explanation,
|
||||
'code' => rand(100000, 999999),
|
||||
'station_id' => $user->station_id
|
||||
]);
|
||||
|
||||
$mission->rahdaran()->sync($request->rahdaran);
|
||||
@@ -83,9 +88,9 @@ class RequestPortalController extends Controller
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function continueMission(ContinueMissionRequest $request, Mission $mission): JsonResponse
|
||||
public function continueMission(ContinueMissionRequest $request, Mission $mission, GetErrorRateService $getErrorRateService): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($request, $mission) {
|
||||
DB::transaction(function () use ($request, $mission, $getErrorRateService) {
|
||||
$user = auth()->user();
|
||||
|
||||
$mission->update([
|
||||
@@ -94,6 +99,23 @@ class RequestPortalController extends Controller
|
||||
'state_name' => MissionStates::name(MissionStates::END_MISSION->value),
|
||||
]);
|
||||
|
||||
$getErrorRateService->setInputParameters($mission);
|
||||
$responseData = $getErrorRateService->run();
|
||||
|
||||
$mission->update([
|
||||
'in_area_duration' => $responseData['timeInAreaSeconds'],
|
||||
'first_enter' => $responseData['firstEnter'],
|
||||
'last_exit' => $responseData['lastExit'],
|
||||
'point_number_sent' => $responseData['noOfPointsInMission'],
|
||||
'fms_result_code' => $responseData['resultCode'],
|
||||
'fms_result_message' => FMSResultCode::name($responseData['resultCode']),
|
||||
]);
|
||||
|
||||
// if ($mission->category_id == 2) {
|
||||
// $rpc = new OperatorController;
|
||||
// $rpc->store($mission);
|
||||
// }
|
||||
|
||||
$state = MissionStates::START_MISSION->value;
|
||||
$category = $request->category_id;
|
||||
$machine = CMMSMachine::query()->find($request->machine_id);
|
||||
@@ -103,6 +125,8 @@ class RequestPortalController extends Controller
|
||||
'username' => $user->username,
|
||||
'province_id' => $user->province_id,
|
||||
'province_name' => $user->province_fa,
|
||||
'city_id' => $user->city_id ?? null,
|
||||
'city_name' => $user->city_fa ?? null,
|
||||
'edare_shahri_id' => $user->edarate_shahri_id ?? null,
|
||||
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
||||
'state_id' => $state,
|
||||
@@ -123,6 +147,7 @@ class RequestPortalController extends Controller
|
||||
'start_time' => now(),
|
||||
'machine_id' => $machine->id,
|
||||
'machine_code' => $machine->machine_code,
|
||||
'station_id' => $user->station_id
|
||||
]);
|
||||
|
||||
$newMission->rahdaran()->sync($request->rahdaran);
|
||||
@@ -188,12 +213,15 @@ class RequestPortalController extends Controller
|
||||
$user = auth()->user();
|
||||
$zone = $request->zone;
|
||||
$state = MissionStates::END_MISSION->value;
|
||||
$machine = CMMSMachine::query()->where('id', '=', $request->machine_id)->first(['id', 'machine_code']);
|
||||
|
||||
$mission = Mission::query()->create([
|
||||
'user_id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'province_id' => $user->province_id,
|
||||
'province_name' => $user->province_fa,
|
||||
'city_id' => $user->city_id ?? null,
|
||||
'city_name' => $user->city_fa ?? null,
|
||||
'edare_shahri_id' => $user->edarate_shahri_id ?? null,
|
||||
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
||||
'zone' => $zone,
|
||||
@@ -203,7 +231,6 @@ class RequestPortalController extends Controller
|
||||
'start_date' => $request->start_date,
|
||||
'end_date' => $request->end_date,
|
||||
'end_point' => $request->end_point,
|
||||
'area' => json_encode($request->area),
|
||||
'category_id' => $request->category_id,
|
||||
'category_name' => MissionCategory::name($request->category_id),
|
||||
'start_time' => $request->start_date,
|
||||
@@ -212,16 +239,18 @@ class RequestPortalController extends Controller
|
||||
'state_name' => MissionStates::name($state),
|
||||
'explanation' => $request->explanation,
|
||||
'request_date' => now(),
|
||||
'machine_id' => $machine->id,
|
||||
'machine_code' => $machine->machine_code,
|
||||
'station_id' => $user->station_id
|
||||
]);
|
||||
|
||||
$mission->rahdaran()->sync($request->rahdaran);
|
||||
$mission->machines()->attach($request->machines);
|
||||
$mission->rahdaran()->attach($request->driver, ['is_driver' => true]);
|
||||
|
||||
if ($mission->category_id == 2) {
|
||||
$rpc = new OperatorController;
|
||||
$rpc->store($mission);
|
||||
}
|
||||
// if ($mission->category_id == 2) {
|
||||
// $rpc = new OperatorController;
|
||||
// $rpc->store($mission);
|
||||
// }
|
||||
});
|
||||
|
||||
return $this->successResponse();
|
||||
|
||||
@@ -10,12 +10,15 @@ use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\V3\Dashboard\RoadPatrol\OperatorController;
|
||||
use App\Http\Requests\V3\Mission\RequestPortal\NoProcessRequest;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\CMMSMachine;
|
||||
use App\Models\Mission;
|
||||
use App\Models\MissionViolation;
|
||||
use App\Services\Cartables\Mission\DailyMoveMachineService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
class ViolationManagementController extends Controller
|
||||
{
|
||||
@@ -28,9 +31,12 @@ class ViolationManagementController extends Controller
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function noProcess(NoProcessRequest $request): JsonResponse
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function noProcess(NoProcessRequest $request, MissionViolation $violation): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($request) {
|
||||
DB::transaction(function () use ($request, $violation) {
|
||||
|
||||
$start = Carbon::parse($request->start_date);
|
||||
$end = Carbon::parse($request->end_date);
|
||||
@@ -38,40 +44,46 @@ class ViolationManagementController extends Controller
|
||||
$user = auth()->user();
|
||||
$zone = $request->zone;
|
||||
$state = MissionStates::END_MISSION->value;
|
||||
$machine = CMMSMachine::query()->where('machine_code', '=', $violation->machine_code)->first(['id', 'machine_code']);
|
||||
|
||||
$mission = Mission::query()->create([
|
||||
'user_id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'province_id' => $user->province_id,
|
||||
'province_name' => $user->province_fa,
|
||||
'city_id' => $user->city_id ?? null,
|
||||
'city_name' => $user->city_fa ?? null,
|
||||
'edare_shahri_id' => $user->edarate_shahri_id ?? null,
|
||||
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
||||
'zone' => $zone,
|
||||
'zone_fa' => MissionZones::name($zone),
|
||||
'type' => $type,
|
||||
'type_fa' => MissionTypes::name($type),
|
||||
'start_date' => $request->start_date,
|
||||
'end_date' => $request->end_date,
|
||||
'start_date' => $request->start_date,//
|
||||
'end_date' => $request->end_date,//
|
||||
'end_point' => $request->end_point,
|
||||
'area' => json_encode($request->area),
|
||||
'category_id' => $request->category_id,
|
||||
'category_name' => MissionCategory::name($request->category_id),
|
||||
'start_time' => $request->start_date,
|
||||
'finish_time' => $request->end_date,
|
||||
'start_time' => $request->start_date,//
|
||||
'finish_time' => $request->end_date,//
|
||||
'state_id' => $state,
|
||||
'state_name' => MissionStates::name($state),
|
||||
'explanation' => $request->explanation,
|
||||
'request_date' => now(),
|
||||
'machine_id' => $machine->id,//
|
||||
'machine_code' => $machine->machine_code,//
|
||||
'station_id' => $user->station_id
|
||||
]);
|
||||
|
||||
$mission->rahdaran()->sync($request->rahdaran);
|
||||
$mission->machines()->attach($request->machines);
|
||||
$mission->rahdaran()->attach($request->driver, ['is_driver' => true]);
|
||||
|
||||
if ($mission->category_id == 2) {
|
||||
$rpc = new OperatorController;
|
||||
$rpc->store($mission);
|
||||
}
|
||||
$violation->update(['status' => 1]);
|
||||
|
||||
// if ($mission->category_id == 2) {
|
||||
// $rpc = new OperatorController;
|
||||
// $rpc->store($mission);
|
||||
// }
|
||||
});
|
||||
|
||||
return $this->successResponse();
|
||||
|
||||
@@ -31,6 +31,7 @@ class ProfileController extends Controller
|
||||
'degree' => $user->degree,
|
||||
'mobile' => $user->mobile,
|
||||
'province_id' => $user->province_id,
|
||||
'city_id' => $user->city_id,
|
||||
'avatar' => $user->avatarUrl(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\Dashboard\Harim\Detail;
|
||||
|
||||
use App\Enums\HarimStates;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class HarimSubmitInvoiceRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->harim->state_id == HarimStates::SABT_FISH->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, ValidationRule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ class NoProcessRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
return $this->violation->status === 0 && $this->violation->type === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,16 +25,14 @@ class NoProcessRequest extends FormRequest
|
||||
return [
|
||||
'rahdaran' => 'array',
|
||||
'rahdaran.*' => 'exists:rahdaran,id',
|
||||
'machines' => 'required|array',
|
||||
'machines.*' => 'required|integer|exists:cmms_machines,id',
|
||||
'driver' => 'required|integer|exists:rahdaran,id',
|
||||
'zone' => 'required|in:1,2,3',
|
||||
'start_date' => 'required|date',
|
||||
'end_date' => 'required|date|after:start_date|before:now',
|
||||
'end_point' => 'required|string',
|
||||
'area' => 'required|array',
|
||||
'area.type' => 'required|string',
|
||||
'area.coordinates' => 'required|array',
|
||||
// 'area' => 'required|array',
|
||||
// 'area.type' => 'required|string',
|
||||
// 'area.coordinates' => 'required|array',
|
||||
'category_id' => 'required|in:1,2,3',
|
||||
'explanation' => 'required|string',
|
||||
];
|
||||
|
||||
@@ -26,7 +26,7 @@ class UpdateRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'rahdaran' => 'required|array',
|
||||
'rahdaran' => 'array',
|
||||
'rahdaran.*' => 'exists:rahdaran,id',
|
||||
'requested_machines' => 'required|array',
|
||||
'type' => 'required|in:1,2',
|
||||
|
||||
@@ -36,13 +36,13 @@ class AllocateRequest extends FormRequest
|
||||
return [
|
||||
function (Validator $validator) {
|
||||
$duplicateMission = Mission::query()->where('machine_id', '=', $this->machine_id)
|
||||
->whereBetween('start_date', [$this->mission->start_date, $this->mission->end_date])
|
||||
->orWhereBetween('end_date', [$this->mission->start_date, $this->mission->end_date])
|
||||
->where('start_date', '<=', $this->mission->end_date)
|
||||
->where('end_date', '>=', $this->mission->start_date)
|
||||
->exists();
|
||||
|
||||
if ($duplicateMission) {
|
||||
$validator->errors()->add(
|
||||
'machine',
|
||||
'machine_id',
|
||||
'خودروی مورد نظر در این زمان رزرو می باشد'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ class DeallocateRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->mission->edare_shahri_id == auth()->user()->edarate_shahri_id && $this->mission->state_id == MissionStates::REQUEST_CREATED->value;
|
||||
return $this->mission->edare_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||
in_array($this->mission->state_id, [MissionStates::REQUEST_CREATED->value, MissionStates::PENDING_CONFIRMATION->value]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,15 +28,7 @@ class SendDataToFMSListener implements ShouldQueue
|
||||
{
|
||||
$mission = $event->mission;
|
||||
|
||||
$this->getErrorRateService->setInputParameters([
|
||||
'username' => config('fms_web_services.Error_Rate.username'),
|
||||
'password' => config('fms_web_services.Error_Rate.password'),
|
||||
'missionArea' => $mission->getMissionAreaForFms(),
|
||||
'missionStartDT' => $mission->start_time->format('Y-m-d\TH:i:s'),
|
||||
'missionEndDT' => $mission->finish_time->format('Y-m-d\TH:i:s'),
|
||||
'machineCode' => $mission->machine_code,
|
||||
'areaType' => $mission->area['type'] === 'polygon' ? 1 : 2,
|
||||
]);
|
||||
$this->getErrorRateService->setInputParameters($mission);
|
||||
|
||||
$responseData = $this->getErrorRateService->run();
|
||||
|
||||
|
||||
67
app/Services/Cartables/Harim/HarimPaymentService.php
Normal file
67
app/Services/Cartables/Harim/HarimPaymentService.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Cartables\Harim;
|
||||
|
||||
use App\Exceptions\ProhibitedAction;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class HarimPaymentService
|
||||
{
|
||||
/**
|
||||
* @throws ProhibitedAction
|
||||
*/
|
||||
public function invoiceBillApi($national_id, $payment_amount): int|string
|
||||
{
|
||||
if (App::isProduction())
|
||||
{
|
||||
try {
|
||||
$payload = array(
|
||||
'username' => config('harim_web_services.Harim_Payment.username'),
|
||||
'password' => config('harim_web_services.Harim_Payment.PASSWORD'),
|
||||
'amount' => $payment_amount,
|
||||
'serial' => config('harim_web_services.Harim_Payment.serial'),
|
||||
'type' => 1,
|
||||
'instanceid' => config('harim_web_services.Harim_Payment.instanceid'),
|
||||
'ownerid' => $national_id,
|
||||
'calculationBox' => "{\"rows\":[{\"amount\":" . $payment_amount . ",\"code\":\"7070011026200593\"}]}"
|
||||
);
|
||||
|
||||
$response = Http::withBody(http_build_query($payload))
|
||||
->throw()
|
||||
->withoutVerifying()
|
||||
->post(config('harim_web_services.Harim_Payment.url'));
|
||||
|
||||
return $response->body();
|
||||
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
throw new ProhibitedAction('خطا در ارتباط با سرویس پرداخت');
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function callPaymentStatusBillApi($bill_code)
|
||||
{
|
||||
if (App::isProduction())
|
||||
{
|
||||
try {
|
||||
$username = config('harim_web_services.Harim_Payment.username');
|
||||
$password = config('harim_web_services.Harim_Payment.PASSWORD');
|
||||
$url = config('harim_web_services.Harim_Payment.url');
|
||||
|
||||
$result = "{$url}/{$username}/{$password}/{$bill_code}";
|
||||
|
||||
return Http::get($result)
|
||||
->throw()
|
||||
->body();
|
||||
|
||||
}catch (\Throwable $th) {
|
||||
throw new ProhibitedAction('خطا در دریافت');
|
||||
}
|
||||
}
|
||||
return json_encode(['isPayed' => 1]);
|
||||
}
|
||||
}
|
||||
@@ -16,11 +16,21 @@ class ControlUnitService
|
||||
|
||||
public function dataTable(Request $request)
|
||||
{
|
||||
$query = Mission::query()
|
||||
->whereIn('state_id', [
|
||||
$user = Auth::user();
|
||||
|
||||
$query = Mission::query()->whereIn('state_id', [
|
||||
MissionStates::PENDING_CONFIRMATION->value, MissionStates::START_MISSION->value
|
||||
])
|
||||
->where('edare_shahri_id', '=', Auth::user()->edarate_shahri_id);
|
||||
]);
|
||||
|
||||
if ($user->hasPermissionTo('manage-control-unit-station')) {
|
||||
$query->where('station_id', '=', $user->station_id);
|
||||
}
|
||||
elseif ($user->hasPermissionTo('manage-control-unit-city')) {
|
||||
$query->where('city_id', '=', $user->city_id);
|
||||
}
|
||||
elseif ($user->hasPermissionTo('manage-control-unit-province')) {
|
||||
$query->where('province_id', '=', $user->province_id);
|
||||
}
|
||||
|
||||
return DataTableFacade::run(
|
||||
$query,
|
||||
|
||||
@@ -15,7 +15,7 @@ class DailyMoveMachineService
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
allowedSelects: ['id', 'mission_id', 'machine_code', 'request_date', 'type', 'exit_time', 'enter_time']
|
||||
allowedSelects: ['id', 'mission_id', 'machine_code', 'request_date', 'type', 'exit_time', 'enter_time', 'status']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
90
app/Services/Cartables/Mission/ReportService.php
Normal file
90
app/Services/Cartables/Mission/ReportService.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Cartables\Mission;
|
||||
|
||||
use App\Exceptions\ProhibitedAction;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Models\Mission;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ReportService
|
||||
{
|
||||
public function dataTable(Request $request)
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
throw_if(is_null($user->edarate_shahri_id), new ProhibitedAction('اداره ای برای شما در سامانه ثبت نشده است!'));
|
||||
|
||||
$query = Mission::query()->where('edare_shahri_id', '=', $user->edarate_shahri_id);
|
||||
|
||||
return DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
);
|
||||
}
|
||||
|
||||
public function countryActivity(Request $request): array
|
||||
{
|
||||
$from = $request->from_date ?? today()->startOfDay();
|
||||
$to = $request->to_date ?? today()->endOfDay();
|
||||
|
||||
$sql = "
|
||||
WITH r AS (
|
||||
SELECT
|
||||
p.id,
|
||||
p.name_fa AS province_name,
|
||||
|
||||
COUNT(DISTINCT CASE
|
||||
WHEN mv.type = 1
|
||||
AND mv.created_at BETWEEN :from AND :to
|
||||
THEN mv.id
|
||||
END) AS no_mission_count,
|
||||
|
||||
COUNT(DISTINCT CASE
|
||||
WHEN m.mission_duration != m.in_area_duration
|
||||
AND m.created_at BETWEEN :from AND :to
|
||||
THEN m.id
|
||||
END) AS out_of_area_count
|
||||
|
||||
FROM provinces p
|
||||
LEFT JOIN cmms_machines cm
|
||||
ON cm.province_id = p.id
|
||||
LEFT JOIN mission_violations mv
|
||||
ON TRIM(cm.machine_code) = TRIM(mv.machine_code)
|
||||
LEFT JOIN missions m
|
||||
ON m.province_id = p.id
|
||||
|
||||
GROUP BY p.id, p.name_fa
|
||||
)
|
||||
|
||||
SELECT
|
||||
'کل کشور' AS province_name,
|
||||
SUM(no_mission_count) AS no_mission_count,
|
||||
SUM(out_of_area_count) AS out_of_area_count
|
||||
FROM r
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
province_name, no_mission_count, out_of_area_count
|
||||
FROM r
|
||||
|
||||
ORDER BY
|
||||
CASE WHEN province_name = 'کل کشور' THEN 0 ELSE 1 END,
|
||||
province_name
|
||||
";
|
||||
|
||||
return DB::select($sql, [
|
||||
'from' => $from,
|
||||
'to' => $to,
|
||||
]);
|
||||
}
|
||||
|
||||
public function provinceActivity(Request $request, int $info_id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,11 @@ class RequestPortalService
|
||||
$user = auth()->user();
|
||||
$query = Mission::query();
|
||||
|
||||
if ($user->hasPermissionTo('manage-request-portal-city')) {
|
||||
$query->where('edare_shahri_id', '=', $user->edarate_shahri_id);
|
||||
if ($user->hasPermissionTo('manage-request-portal-station')) {
|
||||
$query->where('station_id', '=', $user->station_id);
|
||||
}
|
||||
elseif ($user->hasPermissionTo('manage-request-portal-city')) {
|
||||
$query->where('city_id', '=', $user->city_id);
|
||||
}
|
||||
elseif ($user->hasPermissionTo('manage-request-portal-province')) {
|
||||
$query->where('province_id', '=', $user->province_id);
|
||||
|
||||
@@ -12,9 +12,19 @@ class TransportationUnitService
|
||||
{
|
||||
public function dataTable(Request $request)
|
||||
{
|
||||
$query = Mission::query()
|
||||
->whereIn('state_id', [MissionStates::REQUEST_CREATED->value, MissionStates::PENDING_CONFIRMATION->value])
|
||||
->where('edare_shahri_id', '=', Auth::user()->edarate_shahri_id);
|
||||
$user = Auth::user();
|
||||
|
||||
$query = Mission::query()->whereIn('state_id', [MissionStates::REQUEST_CREATED->value, MissionStates::PENDING_CONFIRMATION->value]);
|
||||
|
||||
if ($user->hasPermissionTo('manage-transportation-unit-station')) {
|
||||
$query->where('station_id', '=', $user->station_id);
|
||||
}
|
||||
elseif ($user->hasPermissionTo('manage-transportation-unit-city')) {
|
||||
$query->where('city_id', '=', $user->city_id);
|
||||
}
|
||||
elseif ($user->hasPermissionTo('manage-transportation-unit-province')) {
|
||||
$query->where('province_id', '=', $user->province_id);
|
||||
}
|
||||
|
||||
return DataTableFacade::run(
|
||||
$query,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services\FMS;
|
||||
|
||||
use App\Models\Mission;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -18,9 +19,17 @@ class GetErrorRateService
|
||||
$this->channelName = 'fms_error_rate';
|
||||
}
|
||||
|
||||
public function setInputParameters(array $inputs): void
|
||||
public function setInputParameters(Mission $mission): void
|
||||
{
|
||||
$this->inputParameters = $inputs;
|
||||
$this->inputParameters = [
|
||||
'username' => config('fms_web_services.Error_Rate.username'),
|
||||
'password' => config('fms_web_services.Error_Rate.password'),
|
||||
'missionArea' => $mission->getMissionAreaForFms(),
|
||||
'missionStartDT' => $mission->start_time->format('Y-m-d\TH:i:s'),
|
||||
'missionEndDT' => $mission->finish_time->format('Y-m-d\TH:i:s'),
|
||||
'machineCode' => $mission->machine_code,
|
||||
'areaType' => $mission->area['type'] === 'polygon' ? 1 : 2,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,5 +38,10 @@ return [
|
||||
|
||||
'Harim_Payment' => [
|
||||
'fee' => env('HARIM_AMOUNT_FEE'),
|
||||
'username' => env('HARIM_ENCRYPTION_USERNAME'),
|
||||
'password' => env('HARIM_ENCRYPTION_PASSWORD'),
|
||||
'url' => env('HARIM_ENCRYPTION_URL'),
|
||||
'serial' => env('HARIM_ENCRYPTION_SERIAL'),
|
||||
'instanceid' => env('HARIM_ENCRYPTION_INSTANCE_ID'),
|
||||
]
|
||||
];
|
||||
|
||||
@@ -14,7 +14,7 @@ return new class extends Migration
|
||||
Schema::create('rahdaran', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('code');
|
||||
$table->string('code')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('cmms_machines', function (Blueprint $table) {
|
||||
$table->string('driver_name')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('cmms_machines', function (Blueprint $table) {
|
||||
$table->dropColumn('driver_name');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('mission_violations', function (Blueprint $table) {
|
||||
$table->smallInteger('status')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('mission_violations', function (Blueprint $table) {
|
||||
$table->dropColumn('status');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('missions', function (Blueprint $table) {
|
||||
$table->unsignedSmallInteger('station_id')->nullable();
|
||||
$table->unsignedSmallInteger('city_id')->nullable();
|
||||
$table->string('station_name')->nullable();
|
||||
$table->string('city_name')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('missions', function (Blueprint $table) {
|
||||
$table->dropColumn(['station_id', 'city_id', 'station_name', 'city_name']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->unsignedSmallInteger('station_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('station_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -19,7 +19,7 @@
|
||||
<a href="{{ route('v2.road_observations.pending_view') }}" class="btn btn-default btn-block my-2">رسیدگی به شکایات واکنش سریع</a>
|
||||
@endcan
|
||||
@can('add-safety-and-privacy')
|
||||
<a href="{{ route('v2.safety_and_privacy.operator.create') }}" class="btn btn-default btn-block my-2">ثبت نگهداری حریم راه</a>
|
||||
<a href="/v3/dashboard/road-safety/operator" class="btn btn-default btn-block my-2">ثبت نگهداری حریم راه</a>
|
||||
@endcan
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -484,7 +484,7 @@ Route::prefix('missions')
|
||||
->group(function () {
|
||||
Route::name('requestPortal.')
|
||||
->prefix('request_portal')
|
||||
->middleware('permission:manage-request-portal-city|manage-request-portal-province|manage-request-portal-country')
|
||||
->middleware('permission:manage-request-portal-city|manage-request-portal-province|manage-request-portal-country|manage-request-portal-station')
|
||||
->controller(RequestPortalController::class)
|
||||
->group(function () {
|
||||
Route::get('/', 'index')->name('index');
|
||||
@@ -497,7 +497,7 @@ Route::prefix('missions')
|
||||
});
|
||||
Route::name('transportationUnit.')
|
||||
->prefix('transportation_unit')
|
||||
->middleware('permission:manage-transportation-unit')
|
||||
->middleware('permission:manage-transportation-unit-city|manage-transportation-unit-province|manage-transportation-unit-country|manage-transportation-unit-station')
|
||||
->controller(TransportationUnitController::class)
|
||||
->group(function () {
|
||||
Route::get('/', 'index')->name('index');
|
||||
@@ -507,7 +507,7 @@ Route::prefix('missions')
|
||||
});
|
||||
Route::name('controlUnit.')
|
||||
->prefix('control_unit')
|
||||
->middleware('permission:manage-control-unit')
|
||||
->middleware('permission:manage-control-unit-city|manage-control-unit-province|manage-control-unit-country|manage-control-unit-station')
|
||||
->controller(ControlUnitController::class)
|
||||
->group(function () {
|
||||
Route::get('/', 'index')->name('index');
|
||||
@@ -526,6 +526,16 @@ Route::prefix('missions')
|
||||
->controller(ViolationManagementController::class)
|
||||
->group(function () {
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::post('/no_process/{violation}','noProcess')->name('noProcess');
|
||||
});
|
||||
Route::prefix('report')
|
||||
->name('reports.')
|
||||
->controller(\App\Http\Controllers\V3\Dashboard\Mission\ReportController::class)
|
||||
->group(function () {
|
||||
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
||||
Route::get('/province_activity', 'provinceActivity')->name('provinceActivity');
|
||||
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
|
||||
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user