diff --git a/.env.example b/.env.example
index f9adb344..14720635 100644
--- a/.env.example
+++ b/.env.example
@@ -98,9 +98,9 @@ HARIM_NEED_GUARANTEE_LETTER_URL='https://zamin.gov.ir/ow/api/ow/esb/response'
HARIM_NEED_GUARANTEE_LETTER_PASSWORD=
HARIM_NEED_GUARANTEE_LETTER_USERNAME=
-BACKUP_TARGET_DIR=
+BACKUP_TARGET_DIR=/var
BACKUP_USER=
-BACKUP_PASSWORD=
+BACKUP_PASSWORD=1qaz
HARIM_ENCRYPTION_KEY="TestKey"
diff --git a/app/Console/Commands/DailyMovingMachineCommand.php b/app/Console/Commands/DailyMovingMachineCommand.php
index 8790c357..5155f57d 100644
--- a/app/Console/Commands/DailyMovingMachineCommand.php
+++ b/app/Console/Commands/DailyMovingMachineCommand.php
@@ -58,14 +58,20 @@ class DailyMovingMachineCommand extends Command
break;
}
+ $machine = CMMSMachine::query()->firstWhere('machine_code', '=', $code);
+
MissionViolation::query()->create([
'machine_code' => $code,
- 'machine_id' => CMMSMachine::query()->firstWhere('machine_code', '=', $code)->id,
+ 'machine_id' => $machine->id,
'type' => MissionViolationType::KHOROJ_BEDONE_MOGAVEZ->value,
'request_date' => $date,
'mileage' => $cmm['mileageKM'],
// 'exit_time' => $cmm['exit_time'],
// 'enter_time' => $cmm['enter_time'],
+ 'province_id' => $machine->province_id,
+// 'province_name' => $machine->province_fa,
+ 'city_id' => $machine->city_id,
+// 'city_name' => $machine->city_fa,
]);
}
diff --git a/app/Exports/V3/Mission/Report/Tradod/CountryReport.php b/app/Exports/V3/Mission/Report/Tradod/CountryReport.php
new file mode 100644
index 00000000..425879b5
--- /dev/null
+++ b/app/Exports/V3/Mission/Report/Tradod/CountryReport.php
@@ -0,0 +1,110 @@
+data as $r) {
+ $pid = (int) $r->province_id;
+ $name = $r->province_name;
+
+ if ($pid === -1) {
+ $national = [
+ 'province_name' => $name,
+ 'total' => (int) ($r->total ?? 0),
+ 'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
+ 'gps' => (int) ($r->gps ?? 0),
+ 'durations' => (int) ($r->durations ?? 0),
+ 'bafarayand_saeti' => (int) ($r->far_h ?? 0),
+ 'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
+ 'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
+ 'bedon_bafarayand_rozaneh' => (int) ($r->un_far_d ?? 0),
+ 'item' => (int) ($r->item ?? 0),
+ 'patrol' => (int) ($r->patrol ?? 0),
+ ];
+
+ continue;
+ }
+
+ if (! isset($grid[$pid])) {
+ $grid[$pid] = [
+ 'province_name' => $name,
+ ];
+ }
+
+ $grid[$pid]['total'] = (int) ($r->total ?? 0);
+ $grid[$pid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
+ $grid[$pid]['gps'] = (int) ($r->gps ?? 0);
+ $grid[$pid]['durations'] = (int) ($r->durations ?? 0);
+ $grid[$pid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
+ $grid[$pid]['bafarayand_rozaneh'] = (int) ($r->far_d ?? 0);
+ $grid[$pid]['bedon_bafarayand_saeti'] = (int) ($r->un_far_h ?? 0);
+ $grid[$pid]['bedon_bafarayand_rozaneh'] = (int) ($r->un_far_d ?? 0);
+ $grid[$pid]['item'] = (int) ($r->item ?? 0);
+ $grid[$pid]['patrol'] = (int) ($r->patrol ?? 0);
+ }
+
+ $exportRows = [];
+ if ($national) {
+ $exportRows[] = $national;
+ }
+ foreach ($grid as $row) {
+ $exportRows[] = $row;
+ }
+
+ return view('v3.Reports.Mission.Report.CountryActivityReport', [
+ 'rows' => $exportRows,
+ ]);
+ }
+
+ public function registerEvents(): array
+ {
+ return [
+ AfterSheet::class => function (AfterSheet $event) {
+ $event->sheet->getDelegate()->setRightToLeft(true);
+ },
+ ];
+ }
+
+ public function drawings(): array
+ {
+ $drawing = new Drawing();
+ $drawing->setName('Logo');
+ $drawing->setDescription('This is my logo');
+ $drawing->setPath(public_path('/dist/logo.png'));
+ $drawing->setWidth(50);
+ $drawing->setHeight(50);
+ $drawing->setOffsetX(5);
+ $drawing->setOffsetY(5);
+ $drawing->setCoordinates('A1');
+
+ $drawing2 = new Drawing();
+ $drawing2->setName('Logo');
+ $drawing2->setDescription('This is my logo');
+ $drawing2->setPath(public_path('/dist/141icon.png'));
+ $drawing2->setWidth(50);
+ $drawing2->setHeight(50);
+ $drawing2->setOffsetX(5);
+ $drawing2->setOffsetY(5);
+ $drawing2->setCoordinates('J1');
+
+ return [$drawing, $drawing2];
+ }
+}
diff --git a/app/Exports/V3/Mission/Report/Tradod/ProvinceReport.php b/app/Exports/V3/Mission/Report/Tradod/ProvinceReport.php
new file mode 100644
index 00000000..e56d6cef
--- /dev/null
+++ b/app/Exports/V3/Mission/Report/Tradod/ProvinceReport.php
@@ -0,0 +1,115 @@
+data as $r) {
+ $cid = (int) $r->city_id;
+ $name = $r->city_name;
+
+ if ($cid === -1) {
+ $province = [
+ 'city_name' => $name,
+ 'total' => (int) ($r->total ?? 0),
+ 'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
+ 'gps' => (int) ($r->gps ?? 0),
+ 'durations' => (int) ($r->durations ?? 0),
+ 'bafarayand_saeti' => (int) ($r->far_h ?? 0),
+ 'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
+ 'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
+ 'bedon_bafarayand_rozaneh' => (int) ($r->un_far_d ?? 0),
+ 'item' => (int) ($r->item ?? 0),
+ 'patrol' => (int) ($r->patrol ?? 0),
+ ];
+
+ continue;
+ }
+
+ if (! isset($grid[$cid])) {
+ $grid[$cid] = [
+ 'city_name' => $name,
+ ];
+ }
+
+ $grid[$cid]['total'] = (int) ($r->total ?? 0);
+ $grid[$cid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
+ $grid[$cid]['gps'] = (int) ($r->gps ?? 0);
+ $grid[$cid]['durations'] = (int) ($r->durations ?? 0);
+ $grid[$cid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
+ $grid[$cid]['bafarayand_rozaneh'] = (int) ($r->far_d ?? 0);
+ $grid[$cid]['bedon_bafarayand_saeti'] = (int) ($r->un_far_h ?? 0);
+ $grid[$cid]['bedon_bafarayand_rozaneh'] = (int) ($r->un_far_d ?? 0);
+ $grid[$cid]['item'] = (int) ($r->item ?? 0);
+ $grid[$cid]['patrol'] = (int) ($r->patrol ?? 0);
+
+ }
+
+ $exportRows = [];
+ if ($province) {
+ $exportRows[] = $province;
+ }
+ foreach ($grid as $row) {
+ $exportRows[] = $row;
+ }
+
+ return view('v3.Reports.Mission.Report.ProvinceActivityReport', [
+ 'rows' => $exportRows,
+ ]);
+ }
+
+ public function registerEvents(): array
+ {
+ return [
+ AfterSheet::class => function (AfterSheet $event) {
+ $event->sheet->getDelegate()->setRightToLeft(true);
+ },
+ ];
+ }
+
+ /**
+ * @throws Exception
+ */
+ public function drawings(): array
+ {
+ $drawing = new Drawing();
+ $drawing->setName('Logo');
+ $drawing->setDescription('This is my logo');
+ $drawing->setPath(public_path('/dist/logo.png'));
+ $drawing->setWidth(50);
+ $drawing->setHeight(50);
+ $drawing->setOffsetX(5);
+ $drawing->setOffsetY(5);
+ $drawing->setCoordinates('A1');
+
+ $drawing2 = new Drawing();
+ $drawing2->setName('Logo');
+ $drawing2->setDescription('This is my logo');
+ $drawing2->setPath(public_path('/dist/141icon.png'));
+ $drawing2->setWidth(50);
+ $drawing2->setHeight(50);
+ $drawing2->setOffsetX(5);
+ $drawing2->setOffsetY(5);
+ $drawing2->setCoordinates('J1');
+
+ return [$drawing, $drawing2];
+ }
+}
diff --git a/app/Exports/V3/Mission/Report/CountryReport.php b/app/Exports/V3/Mission/Report/Violation/CountryReport.php
similarity index 73%
rename from app/Exports/V3/Mission/Report/CountryReport.php
rename to app/Exports/V3/Mission/Report/Violation/CountryReport.php
index a7eae8f4..59eb65c7 100644
--- a/app/Exports/V3/Mission/Report/CountryReport.php
+++ b/app/Exports/V3/Mission/Report/Violation/CountryReport.php
@@ -1,6 +1,6 @@
$name,
- 'no_mission_count' => (int) ($r->no_mission_count ?? 0),
- 'out_of_area_count' => (int) ($r->out_of_area_count ?? 0),
+ 'total' => (int) ($r->total ?? 0),
+ 'egdam_shode' => (int) ($r->done ?? 0),
+ 'bedone_egdam' => (int) ($r->undon ?? 0),
+ 'sabt_gps' => (int) ($r->gps ?? 0),
+ 'sabt_herasat' => (int) ($r->herasat ?? 0),
+ 'mil_gps' => (int) ($r->mil_gps ?? 0),
];
continue;
@@ -40,10 +44,12 @@ class CountryReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
'province_name' => $name,
];
}
-
- $grid[$pid]['no_mission_count'] = (int) ($r->no_mission_count ?? 0);
- $grid[$pid]['out_of_area_count'] = (int) ($r->out_of_area_count ?? 0);
-
+ $grid[$pid]['total'] = (int) ($r->total ?? 0);
+ $grid[$pid]['egdam_shode'] = (int) ($r->done ?? 0);
+ $grid[$pid]['bedone_egdam'] = (int) ($r->undone ?? 0);
+ $grid[$pid]['sabt_gps'] = (int) ($r->gps ?? 0);
+ $grid[$pid]['sabt_herasat'] = (int) ($r->herasat ?? 0);
+ $grid[$pid]['mil_gps'] = (int) ($r->mil_gps ?? 0);
}
$exportRows = [];
@@ -88,7 +94,7 @@ class CountryReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
$drawing2->setHeight(50);
$drawing2->setOffsetX(5);
$drawing2->setOffsetY(5);
- $drawing2->setCoordinates('C1');
+ $drawing2->setCoordinates('E1');
return [$drawing, $drawing2];
}
diff --git a/app/Exports/V3/Mission/Report/ProvinceReport.php b/app/Exports/V3/Mission/Report/Violation/ProvinceReport.php
similarity index 74%
rename from app/Exports/V3/Mission/Report/ProvinceReport.php
rename to app/Exports/V3/Mission/Report/Violation/ProvinceReport.php
index 2069f4f9..a4251c64 100644
--- a/app/Exports/V3/Mission/Report/ProvinceReport.php
+++ b/app/Exports/V3/Mission/Report/Violation/ProvinceReport.php
@@ -1,6 +1,6 @@
$name,
- 'no_mission_count' => (int) ($r->no_mission_count ?? 0),
- 'out_of_area_count' => (int) ($r->out_of_area_count ?? 0),
+ 'total' => (int) ($r->total ?? 0),
+ 'egdam_shode' => (int) ($r->done ?? 0),
+ 'bedone_egdam' => (int) ($r->undon ?? 0),
+ 'sabt_gps' => (int) ($r->gps ?? 0),
+ 'sabt_herasat' => (int) ($r->herasat ?? 0),
+ 'mil_gps' => (int) ($r->mil_gps ?? 0),
];
continue;
@@ -41,10 +45,12 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithDrawings, WithEven
'city_name' => $name,
];
}
-
- $grid[$cid]['no_mission_count'] = (int) ($r->no_mission_count ?? 0);
- $grid[$cid]['out_of_area_count'] = (int) ($r->out_of_area_count ?? 0);
-
+ $grid[$cid]['total'] = (int) ($r->total ?? 0);
+ $grid[$cid]['egdam_shode'] = (int) ($r->done ?? 0);
+ $grid[$cid]['bedone_egdam'] = (int) ($r->undone ?? 0);
+ $grid[$cid]['sabt_gps'] = (int) ($r->gps ?? 0);
+ $grid[$cid]['sabt_herasat'] = (int) ($r->herasat ?? 0);
+ $grid[$cid]['mil_gps'] = (int) ($r->mil_gps ?? 0);
}
$exportRows = [];
@@ -92,7 +98,7 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithDrawings, WithEven
$drawing2->setHeight(50);
$drawing2->setOffsetX(5);
$drawing2->setOffsetY(5);
- $drawing2->setCoordinates('C1');
+ $drawing2->setCoordinates('E1');
return [$drawing, $drawing2];
}
diff --git a/app/Http/Controllers/V3/Dashboard/Mission/ControlUnitController.php b/app/Http/Controllers/V3/Dashboard/Mission/ControlUnitController.php
index 06a07c13..33e732b0 100644
--- a/app/Http/Controllers/V3/Dashboard/Mission/ControlUnitController.php
+++ b/app/Http/Controllers/V3/Dashboard/Mission/ControlUnitController.php
@@ -43,7 +43,7 @@ class ControlUnitController extends Controller
$mission->update([
'state_id' => $state,
'state_name' => MissionStates::name($state),
- 'start_time' => now(),
+ 'start_time' => $request->time,
'km' => $request->km,
]);
});
@@ -56,7 +56,7 @@ class ControlUnitController extends Controller
*/
public function finish(FinishRequest $request, Mission $mission, GetErrorRateService $getErrorRateService): JsonResponse
{
- DB::transaction(function () use ($mission, $getErrorRateService) {
+ DB::transaction(function () use ($mission, $getErrorRateService, $request) {
$mission->histories()->create([
'user_id' => auth()->user()->id,
'previous_state_id' => $mission->state_id,
@@ -68,8 +68,8 @@ class ControlUnitController extends Controller
$mission->update([
'state_id' => $state,
'state_name' => MissionStates::name($state),
- 'finish_time' => now(),
- 'mission_duration' => strtotime(now()) - strtotime($mission->start_time),
+ 'finish_time' => $request->time,
+ 'mission_duration' => strtotime($request->time) - strtotime($mission->start_time),
]);
$getErrorRateService->setInputParameters($mission);
diff --git a/app/Http/Controllers/V3/Dashboard/Mission/Report/ReportTradodController.php b/app/Http/Controllers/V3/Dashboard/Mission/Report/ReportTradodController.php
new file mode 100644
index 00000000..d5610e3a
--- /dev/null
+++ b/app/Http/Controllers/V3/Dashboard/Mission/Report/ReportTradodController.php
@@ -0,0 +1,61 @@
+successResponse([
+ 'activities' => $reportMissionService->countryActivity($request),
+ 'provinces' => Province::all(['id', 'name_fa']),
+ ]);
+ }
+
+ public function provinceActivity(Request $request, ReportTradodService $reportMissionService): JsonResponse
+ {
+ return $this->successResponse([
+ 'activities' =>$reportMissionService->provinceActivity($request),
+ 'city' => City::query()->where('province_id', $request->province_id)->get(['id', 'name_fa']),
+ ]);
+ }
+
+ /**
+ * @throws Exception
+ * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ */
+ public function countryExcelActivity(Request $request, ReportTradodService $reportMissionService): BinaryFileResponse
+ {
+ $data = $reportMissionService->countryActivity($request);
+ $name = 'گزارش کل تردد '.verta()->now()->format('Y-m-d H-i').'.xlsx';
+
+ return Excel::download(new CountryReport($data), $name);
+ }
+
+ /**
+ * @throws Exception
+ * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ */
+ public function provinceExcelActivity(Request $request, ReportTradodService $reportMissionService): BinaryFileResponse
+ {
+ $data = $reportMissionService->provinceActivity($request);
+ $name = 'گزارش کل تردد '.verta()->now()->format('Y-m-d H-i').'.xlsx';
+
+ return Excel::download(new ProvinceReport($data), $name);
+ }
+}
diff --git a/app/Http/Controllers/V3/Dashboard/Mission/ReportController.php b/app/Http/Controllers/V3/Dashboard/Mission/Report/ReportViolationController.php
similarity index 72%
rename from app/Http/Controllers/V3/Dashboard/Mission/ReportController.php
rename to app/Http/Controllers/V3/Dashboard/Mission/Report/ReportViolationController.php
index f4b04424..9be4b05b 100644
--- a/app/Http/Controllers/V3/Dashboard/Mission/ReportController.php
+++ b/app/Http/Controllers/V3/Dashboard/Mission/Report/ReportViolationController.php
@@ -1,25 +1,25 @@
successResponse([
'activities' => $reportService->countryActivity($request),
@@ -27,7 +27,7 @@ class ReportController extends Controller
]);
}
- public function provinceActivity(Request $request, ReportService $reportService): JsonResponse
+ public function provinceActivity(Request $request, ReportViolationService $reportService): JsonResponse
{
return $this->successResponse([
'activities' =>$reportService->provinceActivity($request),
@@ -39,7 +39,7 @@ class ReportController extends Controller
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
- public function countryExcelActivity(Request $request, ReportService $reportService): BinaryFileResponse
+ public function countryExcelActivity(Request $request, ReportViolationService $reportService): BinaryFileResponse
{
$data = $reportService->countryActivity($request);
$name = 'گزارش تخلفات ماموریت ها '.verta()->now()->format('Y-m-d H-i').'.xlsx';
@@ -51,7 +51,7 @@ class ReportController extends Controller
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
- public function provinceExcelActivity(Request $request, ReportService $reportService): BinaryFileResponse
+ public function provinceExcelActivity(Request $request, ReportViolationService $reportService): BinaryFileResponse
{
$data = $reportService->provinceActivity($request);
$name = 'گزارش تخلفات ماموریت ها '.verta()->now()->format('Y-m-d H-i').'.xlsx';
diff --git a/app/Http/Controllers/V3/Dashboard/Mission/ViolationManagementController.php b/app/Http/Controllers/V3/Dashboard/Mission/ViolationManagementController.php
index 400e8428..bb8b8365 100644
--- a/app/Http/Controllers/V3/Dashboard/Mission/ViolationManagementController.php
+++ b/app/Http/Controllers/V3/Dashboard/Mission/ViolationManagementController.php
@@ -96,6 +96,8 @@ class ViolationManagementController extends Controller
}
public function store(StoreRequest $request): JsonResponse
{
+ $user = auth()->user();
+
MissionViolation::query()->create([
'machine_id'=> CMMSMachine::query()->where('machine_code', '=', $request->machine_code)->value('id'),
'machine_code'=> $request->machine_code,
@@ -104,6 +106,10 @@ class ViolationManagementController extends Controller
'request_date' => now(),
'km' => $request->km,
'gps' => 0,
+ 'province_id' => $user->province_id,
+ 'province_name' => $user->province_fa,
+ 'city_id' => $user->city_id,
+ 'city_name' => $user->city_fa,
]);
return $this->successResponse();
diff --git a/app/Http/Requests/V3/Mission/ControlUnit/FinishRequest.php b/app/Http/Requests/V3/Mission/ControlUnit/FinishRequest.php
index c6b48b09..899b1bb0 100644
--- a/app/Http/Requests/V3/Mission/ControlUnit/FinishRequest.php
+++ b/app/Http/Requests/V3/Mission/ControlUnit/FinishRequest.php
@@ -24,7 +24,7 @@ class FinishRequest extends FormRequest
public function rules(): array
{
return [
- //
+ 'time' => 'required|date',
];
}
}
diff --git a/app/Http/Requests/V3/Mission/ControlUnit/StartRequest.php b/app/Http/Requests/V3/Mission/ControlUnit/StartRequest.php
index e5d24b77..63c98e04 100644
--- a/app/Http/Requests/V3/Mission/ControlUnit/StartRequest.php
+++ b/app/Http/Requests/V3/Mission/ControlUnit/StartRequest.php
@@ -27,6 +27,7 @@ class StartRequest extends FormRequest
return [
'code' => 'required|string',
'km' => 'required',
+ 'time' => 'required|date',
];
}
diff --git a/app/Services/Cartables/Mission/Report/ReportTradodService.php b/app/Services/Cartables/Mission/Report/ReportTradodService.php
new file mode 100644
index 00000000..f975662d
--- /dev/null
+++ b/app/Services/Cartables/Mission/Report/ReportTradodService.php
@@ -0,0 +1,193 @@
+user();
+
+ $query = MissionViolation::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 = Carbon::parse($request->to_date)->endOfDay() ?? today()->endOfDay();
+ $sql = "
+ SELECT*
+ FROM(
+ SELECT
+ 'کل کشور' AS province_name,
+ -1 AS province_id,
+ SUM(t.total) AS total,
+ SUM(t.khareg_mahdode) AS khareg_mahdode,
+ SUM(t.gps) AS gps,
+ SUM(t.durations) AS durations,
+ SUM(t.far_h) AS far_h,
+ SUM(t.far_d) AS far_d,
+ SUM(t.un_far_h) AS un_far_h,
+ SUM(t.un_far_d) AS un_far_d,
+ SUM(t.item) AS item,
+ SUM(t.patrol) AS patrol
+ FROM (
+ SELECT
+ p.id AS province_id,
+ COUNT(m.id) AS total,
+ COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
+ COALESCE(SUM(m.in_area_duration), 0) AS gps,
+ COALESCE(SUM(m.mission_duration), 0) AS durations,
+ COALESCE(SUM(CASE WHEN m.type = 1 THEN 1 ELSE 0 END), 0) AS far_h,
+ COALESCE(SUM(CASE WHEN m.type = 2 THEN 1 ELSE 0 END), 0) AS far_d,
+ COALESCE(SUM(CASE WHEN m.type = 3 THEN 1 ELSE 0 END), 0) AS un_far_h,
+ COALESCE(SUM(CASE WHEN m.type = 4 THEN 1 ELSE 0 END), 0) AS un_far_d,
+ COALESCE(SUM(CASE WHEN m.category_id = 1 THEN 1 ELSE 0 END), 0) AS item,
+ COALESCE(SUM(CASE WHEN m.category_id = 2 THEN 1 ELSE 0 END), 0) AS patrol
+ FROM provinces p
+ LEFT JOIN missions m
+ ON m.province_id = p.id
+ AND m.created_at >= :from_m
+ AND m.created_at <= :to_m
+ GROUP BY p.id
+ ) t
+
+ UNION ALL
+
+ SELECT
+ p.name_fa AS province_name,
+ p.id AS province_id,
+ COUNT(m.id) AS total,
+ COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
+ COALESCE(SUM(m.in_area_duration), 0) AS gps,
+ COALESCE(SUM(m.mission_duration), 0) AS durations,
+ COALESCE(SUM(CASE WHEN m.type = 1 THEN 1 ELSE 0 END), 0) AS far_h,
+ COALESCE(SUM(CASE WHEN m.type = 2 THEN 1 ELSE 0 END), 0) AS far_d,
+ COALESCE(SUM(CASE WHEN m.type = 3 THEN 1 ELSE 0 END), 0) AS un_far_h,
+ COALESCE(SUM(CASE WHEN m.type = 4 THEN 1 ELSE 0 END), 0) AS un_far_d,
+ COALESCE(SUM(CASE WHEN m.category_id = 1 THEN 1 ELSE 0 END), 0) AS item,
+ COALESCE(SUM(CASE WHEN m.category_id = 2 THEN 1 ELSE 0 END), 0) AS patrol
+ FROM provinces p
+ LEFT JOIN missions m
+ ON m.province_id = p.id
+ AND m.created_at >= :from_m
+ AND m.created_at <= :to_m
+ GROUP BY p.id, p.name_fa
+ )q
+ ORDER BY
+ CASE WHEN province_id = -1 THEN 0 ELSE 1 END,
+ province_name;
+
+ ";
+
+
+ return DB::select($sql, [
+ 'from_m' => $from,
+ 'to_m' => $to,
+ ]);
+ }
+
+ public function provinceActivity(Request $request): array
+ {
+ $provinceId = $request->province_id ?? auth()->user()->province_id;
+ $from = $request->from_date ?? today()->startOfDay();
+ $to = Carbon::parse($request->to_date)->endOfDay() ?? today()->endOfDay();
+
+ $sql = "
+ SELECT*
+ FROM(
+ SELECT
+ 'کل استان' AS city_name,
+ -1 AS city_id,
+ SUM(t.total) AS total,
+ SUM(t.khareg_mahdode) AS khareg_mahdode,
+ SUM(t.gps) AS gps,
+ SUM(t.durations) AS durations,
+ SUM(t.far_h) AS far_h,
+ SUM(t.far_d) AS far_d,
+ SUM(t.un_far_h) AS un_far_h,
+ SUM(t.un_far_d) AS un_far_d,
+ SUM(t.item) AS item,
+ SUM(t.patrol) AS patrol
+ FROM (
+ SELECT
+ c.id AS city_id,
+
+ COUNT(m.id) AS total,
+ COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
+ COALESCE(SUM(m.in_area_duration), 0) AS gps,
+ COALESCE(SUM(m.mission_duration), 0) AS durations,
+ COALESCE(SUM(m.type = 1), 0) AS far_h,
+ COALESCE(SUM(m.type = 2), 0) AS far_d,
+ COALESCE(SUM(m.type = 3), 0) AS un_far_h,
+ COALESCE(SUM(m.type = 4), 0) AS un_far_d,
+ COALESCE(SUM(m.category_id = 1), 0) AS item,
+ COALESCE(SUM(m.category_id = 2), 0) AS patrol
+ FROM cities c
+ LEFT JOIN missions m
+ ON m.city_id = c.id
+ AND m.created_at >= :from_m
+ AND m.created_at <= :to_m
+ WHERE c.province_id = :province_id
+ AND (
+ c.type_id = 1
+ OR c.name_fa IN ('اداره ماشينآلات', 'اداره نقلیه')
+ )
+ GROUP BY c.id
+ ) t
+
+ UNION ALL
+
+ SELECT
+ c.name_fa AS city_name,
+ c.id AS city_id,
+
+ COUNT(m.id) AS total,
+ COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
+ COALESCE(SUM(m.in_area_duration), 0) AS gps,
+ COALESCE(SUM(m.mission_duration), 0) AS durations,
+ COALESCE(SUM(m.type = 1), 0) AS far_h,
+ COALESCE(SUM(m.type = 2), 0) AS far_d,
+ COALESCE(SUM(m.type = 3), 0) AS un_far_h,
+ COALESCE(SUM(m.type = 4), 0) AS un_far_d,
+ COALESCE(SUM(m.category_id = 1), 0) AS item,
+ COALESCE(SUM(m.category_id = 2), 0) AS patrol
+
+ FROM cities c
+ LEFT JOIN missions m
+ ON m.city_id = c.id
+ AND m.created_at >= :from_m
+ AND m.created_at <= :to_m
+ WHERE c.province_id = :province_id
+ AND (
+ c.type_id = 1
+ OR c.name_fa IN ('اداره ماشينآلات', 'اداره نقلیه')
+ )
+ GROUP BY c.id, c.name_fa
+ ) q
+ ORDER BY
+ CASE WHEN q.city_id = -1 THEN 0 ELSE 1 END,
+ q.city_name;
+
+ ";
+
+ return DB::select($sql, [
+ 'province_id' => $provinceId,
+ 'from_m' => $from,
+ 'to_m' => $to,
+ ]);
+ }
+}
diff --git a/app/Services/Cartables/Mission/Report/ReportViolationService.php b/app/Services/Cartables/Mission/Report/ReportViolationService.php
new file mode 100644
index 00000000..278868fa
--- /dev/null
+++ b/app/Services/Cartables/Mission/Report/ReportViolationService.php
@@ -0,0 +1,171 @@
+user();
+
+ $query = MissionViolation::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 = Carbon::parse($request->to_date)->endOfDay() ?? today()->endOfDay();
+
+ $sql = "
+ SELECT*
+ FROM(
+ SELECT
+ 'کل کشور' AS province_name,
+ -1 AS province_id,
+ SUM(t.total) AS total,
+ SUM(t.done) AS done,
+ SUM(t.undone) AS undone,
+ SUM(t.gps) AS gps,
+ SUM(t.herasat) AS herasat,
+ SUM(t.mil_gps) AS mil_gps
+ FROM (
+ SELECT
+ p.id AS province_id,
+ COUNT(mv.id) AS total,
+ COALESCE(SUM(CASE WHEN mv.status = 1 THEN 1 ELSE 0 END), 0) as done,
+ COALESCE(SUM(CASE WHEN mv.status = 0 THEN 1 ELSE 0 END), 0) as undone,
+ COALESCE(SUM(CASE WHEN gps = 1 THEN 1 ELSE 0 END), 0) as gps,
+ COALESCE(SUM(CASE WHEN gps = 0 THEN 1 ELSE 0 END), 0) as herasat,
+ COALESCE(SUM(CASE WHEN gps = 1 THEN mileage ELSE 0 END),0) as mil_gps
+ FROM provinces p
+ LEFT JOIN mission_violations mv
+ ON mv.province_id = p.id
+ AND mv.type = 1
+ AND mv.created_at >= :from_mv
+ AND mv.created_at <= :to_mv
+ GROUP BY p.id
+ ) t
+
+ UNION ALL
+
+ SELECT
+ p.name_fa AS province_name,
+ p.id AS province_id,
+ COUNT(mv.id) AS total,
+ COALESCE(SUM(CASE WHEN mv.status = 1 THEN 1 ELSE 0 END), 0) as done,
+ COALESCE(SUM(CASE WHEN mv.status = 0 THEN 1 ELSE 0 END), 0) as undone,
+ COALESCE(SUM(CASE WHEN gps = 1 THEN 1 ELSE 0 END), 0) as gps,
+ COALESCE(SUM(CASE WHEN gps = 0 THEN 1 ELSE 0 END), 0) as herasat,
+ COALESCE(SUM(CASE WHEN gps = 1 THEN mileage ELSE 0 END),0) as mil_gps
+
+ FROM provinces p
+ LEFT JOIN mission_violations mv
+ ON mv.province_id = p.id
+ AND mv.type = 1
+ AND mv.created_at >= :from_mv
+ AND mv.created_at <= :to_mv
+ GROUP BY p.id, p.name_fa
+ )q
+ ORDER BY
+ CASE WHEN province_id = -1 THEN 0 ELSE 1 END,
+ province_name;
+
+ ";
+
+ return DB::select($sql, [
+ 'from_mv' => $from,
+ 'to_mv' => $to,
+ ]);
+ }
+
+ public function provinceActivity(Request $request): array
+ {
+ $provinceId = $request->province_id ?? auth()->user()->province_id;
+ $from = $request->from_date ?? today()->startOfDay();
+ $to = Carbon::parse($request->to_date)->endOfDay() ?? today()->endOfDay();
+
+ $sql = "
+ SELECT*
+ FROM(
+ SELECT
+ 'کل استان' AS city_name,
+ -1 AS city_id,
+ SUM(t.total) AS total,
+ SUM(t.done) AS done,
+ SUM(t.undone) AS undone,
+ SUM(t.gps) AS gps,
+ SUM(t.herasat) AS herasat,
+ SUM(t.mil_gps) AS mil_gps
+ FROM (
+ SELECT
+ c.id AS city_id,
+ COUNT(mv.id) AS total,
+ COALESCE(SUM(mv.status = 1), 0) AS done,
+ COALESCE(SUM(mv.status = 0), 0) AS undone,
+ COALESCE(SUM(mv.gps = 1), 0) AS gps,
+ COALESCE(SUM(mv.gps = 0), 0) AS herasat,
+ COALESCE(SUM(CASE WHEN mv.gps = 1 THEN mv.mileage ELSE 0 END), 0) AS mil_gps
+ FROM cities c
+ LEFT JOIN mission_violations mv
+ ON mv.city_id = c.id
+ AND mv.type = 1
+ AND mv.created_at >= :from_mv
+ AND mv.created_at <= :to_mv
+ WHERE c.province_id = :province_id
+ AND (
+ c.type_id = 1
+ OR c.name_fa IN ('اداره ماشينآلات', 'اداره نقلیه')
+ )
+ GROUP BY c.id
+ ) t
+
+ UNION ALL
+
+ SELECT
+ c.name_fa AS city_name,
+ c.id AS city_id,
+ COUNT(mv.id) AS total,
+ COALESCE(SUM(mv.status = 1), 0) AS done,
+ COALESCE(SUM(mv.status = 0), 0) AS undone,
+ COALESCE(SUM(mv.gps = 1), 0) AS gps,
+ COALESCE(SUM(mv.gps = 0), 0) AS herasat,
+ COALESCE(SUM(CASE WHEN mv.gps = 1 THEN mv.mileage ELSE 0 END), 0) AS mil_gps
+ FROM cities c
+ LEFT JOIN mission_violations mv
+ ON mv.city_id = c.id
+ AND mv.type = 1
+ AND mv.created_at >= :from_mv
+ AND mv.created_at <= :to_mv
+ WHERE c.province_id = :province_id
+ AND (
+ c.type_id = 1
+ OR c.name_fa IN ('اداره ماشينآلات', 'اداره نقلیه')
+ )
+ GROUP BY c.id, c.name_fa
+ ) q
+ ORDER BY
+ CASE WHEN q.city_id = -1 THEN 0 ELSE 1 END,
+ q.city_name;
+
+ ";
+
+ return DB::select($sql, [
+ 'province_id' => $provinceId,
+ 'from_mv' => $from,
+ 'to_mv' => $to,
+ ]);
+ }
+}
diff --git a/app/Services/Cartables/Mission/ReportService.php b/app/Services/Cartables/Mission/ReportService.php
deleted file mode 100644
index 902d100c..00000000
--- a/app/Services/Cartables/Mission/ReportService.php
+++ /dev/null
@@ -1,152 +0,0 @@
-user();
-
- $query = MissionViolation::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 = Carbon::parse($request->to_date)->endOfDay() ?? today()->endOfDay();
-
- $sql = "
- WITH r AS (
- SELECT
- p.id AS province_id,
- p.name_fa AS province_name,
-
- COUNT(DISTINCT mv.id) AS no_mission_count,
- COUNT(DISTINCT m.id) 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)
- AND mv.type = 1
- AND mv.created_at >= :from_mv
- AND mv.created_at <= :to_mv
-
- LEFT JOIN missions m
- ON m.province_id = p.id
- AND m.mission_duration != m.in_area_duration
- AND m.created_at >= :from_m
- AND m.created_at <= :to_m
-
- GROUP BY p.id, p.name_fa
- )
-
- SELECT
- -1 AS province_id,
- 'کل کشور' 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_id, province_name, no_mission_count, out_of_area_count
- FROM r
-
- ORDER BY
- CASE WHEN province_id = -1 THEN 0 ELSE 1 END,
- province_name
- ";
-
- return DB::select($sql, [
- 'from_mv' => $from,
- 'to_mv' => $to,
- 'from_m' => $from,
- 'to_m' => $to,
- ]);
- }
-
- public function provinceActivity(Request $request): array
- {
- $provinceId = $request->province_id ?? auth()->user()->province_id;
- $from = $request->from_date ?? today()->startOfDay();
- $to = Carbon::parse($request->to_date)->endOfDay() ?? today()->endOfDay();
-
- $sql = "
- WITH r AS (
- SELECT
- c.id AS city_id,
- c.name_fa AS city_name,
-
- COUNT(DISTINCT mv.id) AS no_mission_count,
- COUNT(DISTINCT m.id) AS out_of_area_count
-
- FROM cities c
- LEFT JOIN cmms_machines cm
- ON cm.city_id = c.id
-
- LEFT JOIN mission_violations mv
- ON TRIM(cm.machine_code) = TRIM(mv.machine_code)
- AND mv.type = 1
- AND mv.created_at >= :from_mv
- AND mv.created_at <= :to_mv
-
- LEFT JOIN missions m
- ON m.city_id = c.id
- AND m.mission_duration != m.in_area_duration
- AND m.created_at >= :from_m
- AND m.created_at <= :to_m
-
- WHERE c.province_id = :province_id
- AND (
- c.type_id = 1
- OR c.name_fa IN ('اداره ماشينآلات', 'اداره نقلیه')
- )
- GROUP BY c.id, c.name_fa
- )
-
- SELECT
- -1 AS city_id,
- 'کل استان' AS city_name,
- SUM(no_mission_count) AS no_mission_count,
- SUM(out_of_area_count) AS out_of_area_count
- FROM r
-
- UNION ALL
-
- SELECT
- city_id, city_name, no_mission_count, out_of_area_count
- FROM r
-
- ORDER BY
- CASE WHEN city_id = -1 THEN 0 ELSE 1 END,
- city_name
- ";
-
- return DB::select($sql, [
- 'province_id' => $provinceId,
- 'from_mv' => $from,
- 'to_mv' => $to,
- 'from_m' => $from,
- 'to_m' => $to,
- ]);
- }
-}
diff --git a/database/migrations/2026_01_25_153836_add_column_to_mission_violations_table.php b/database/migrations/2026_01_25_153836_add_column_to_mission_violations_table.php
new file mode 100644
index 00000000..4a39c901
--- /dev/null
+++ b/database/migrations/2026_01_25_153836_add_column_to_mission_violations_table.php
@@ -0,0 +1,31 @@
+unsignedTinyInteger('province_id')->nullable();
+ $table->string('province_name')->nullable();
+ $table->unsignedSmallInteger('city_id')->nullable();
+ $table->string('city_name')->nullable();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('mission_violations', function (Blueprint $table) {
+ $table->dropColumn(['province_id', 'province_name', 'city_id', 'city_name']);
+ });
+ }
+};
diff --git a/resources/views/v3/Reports/Mission/Report/CountryActivityReport.blade.php b/resources/views/v3/Reports/Mission/Report/CountryActivityReport.blade.php
index 1abf73da..2dbe9f08 100644
--- a/resources/views/v3/Reports/Mission/Report/CountryActivityReport.blade.php
+++ b/resources/views/v3/Reports/Mission/Report/CountryActivityReport.blade.php
@@ -50,11 +50,27 @@
-خروج بدون ماموریت |
+کل تخلفات
- خارج از محدوده
+ اقدام شده
+ |
+
+ اقدام نشده
+ |
+
+ ثبت GPS |
+
+
+ ثبت حراست
+ |
+
+ کیلومتر GPS
|
@@ -63,8 +79,12 @@
@foreach ($rows as $item)
| {{ $item['province_name'] ?? '-' }} |
- {{ $item['no_mission_count'] ?? '-' }} |
- {{ $item['out_of_area_count'] ?? '-' }} |
+ {{ $item['total_violations'] ?? '-' }} |
+ {{ $item['egdam_shode'] ?? '-' }} |
+ {{ $item['bedone_egdam'] ?? '-' }} |
+ {{ $item['sabt_gps'] ?? '-' }} |
+ {{ $item['sabt_herasat'] ?? '-' }} |
+ {{ $item['mil_gps'] ?? '-' }} |
@endforeach
diff --git a/resources/views/v3/Reports/Mission/Report/ProvinceActivityReport.blade.php b/resources/views/v3/Reports/Mission/Report/ProvinceActivityReport.blade.php
index be25c1e9..d62f37ed 100644
--- a/resources/views/v3/Reports/Mission/Report/ProvinceActivityReport.blade.php
+++ b/resources/views/v3/Reports/Mission/Report/ProvinceActivityReport.blade.php
@@ -50,14 +50,28 @@
-خروج بدون ماموریت |
+ کل تخلفات
- خارج از محدوده
+ اقدام شده
|
+
+ اقدام نشده
+ |
+
+ ثبت GPS |
-
+
+ ثبت حراست
+ |
+
+ مسافت ثبت شده GPS
+ |
@@ -65,8 +79,12 @@
@foreach ($rows as $item)
| {{ $item['city_name'] ?? '-' }} |
- {{ $item['no_mission_count'] ?? '-' }} |
- {{ $item['out_of_area_count'] ?? '-' }} |
+ {{ $item['total_violations'] ?? '-' }} |
+ {{ $item['egdam_shode'] ?? '-' }} |
+ {{ $item['bedone_egdam'] ?? '-' }} |
+ {{ $item['sabt_gps'] ?? '-' }} |
+ {{ $item['sabt_herasat'] ?? '-' }} |
+ {{ $item['mil_gps'] ?? '-' }} |
@endforeach
diff --git a/resources/views/v3/Reports/Mission/Report/Tradod /CountryActivityReport.blade.php b/resources/views/v3/Reports/Mission/Report/Tradod /CountryActivityReport.blade.php
new file mode 100644
index 00000000..cfb60ac5
--- /dev/null
+++ b/resources/views/v3/Reports/Mission/Report/Tradod /CountryActivityReport.blade.php
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+ گزارش کل کشور
+
+
+
+
+
+@php
+ // show a dot if key missing or value is 0/empty
+ function cell($row, $key) {
+ return array_key_exists($key, $row) ? ($row[$key] ?: '0') : '0';
+ }
+@endphp
+
+
+
+
+ |
+ تاریخ دریافت گزارش: {{ verta()->now()->format('Y/m/d H:i') }}
+ |
+
+
+ |
+ |
+
+
+ |
+ گزارش نخلف های صورت گرفته
+ |
+
+
+ |
+ استان
+ |
+
+ کل ماموریت |
+
+ جمع ساعات GPS
+ |
+
+ جمع ساعات ماموریت |
+
+ تردد خارج از محدوده
+ |
+
+ با فرآیند ساعتی
+ |
+
+ با فرآیند روزانه |
+
+
+ بدون فرآیند ساعتی
+ |
+
+ بدون فرآیند روزانه
+ |
+
+ فعالیت روزانه |
+
+ گشت راهداری
+ |
+
+
+
+
+ @foreach ($rows as $item)
+
+ | {{ $item['province_name'] ?? '-' }} |
+ {{ $item['total'] ?? '-' }} |
+ {{ $item['khareg_mahdode'] ?? '-' }} |
+ {{ $item['gps'] ?? '-' }} |
+ {{ $item['durations'] ?? '-' }} |
+ {{ $item['bafarayand_saeti'] ?? '-' }} |
+ {{ $item['bafarayand_rozaneh'] ?? '-' }} |
+ {{ $item['bedon_bafarayand_saeti'] ?? '-' }} |
+ {{ $item['bedon_bafarayand_rozaneh'] ?? '-' }} |
+ {{ $item['item'] ?? '-' }} |
+ {{ $item['patrol'] ?? '-' }} |
+
+ @endforeach
+
+
+
+
diff --git a/resources/views/v3/Reports/Mission/Report/Tradod /ProvinceActivityReport.blade.php b/resources/views/v3/Reports/Mission/Report/Tradod /ProvinceActivityReport.blade.php
new file mode 100644
index 00000000..a78d5b56
--- /dev/null
+++ b/resources/views/v3/Reports/Mission/Report/Tradod /ProvinceActivityReport.blade.php
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+ گزارش ادارات شهرستان
+
+
+
+
+
+@php
+ // show a dot if key missing or value is 0/empty
+ function cell($row, $key) {
+ return array_key_exists($key, $row) ? ($row[$key] ?: '0') : '0';
+ }
+@endphp
+
+
+
+
+ |
+ تاریخ دریافت گزارش: {{ verta()->now()->format('Y/m/d H:i') }}
+ |
+
+
+ |
+ |
+
+
+ |
+ گزارش نخلف های صورت گرفته
+ |
+
+
+ |
+ شهر
+ |
+
+ کل ماموریت |
+
+ جمع ساعات GPS
+ |
+
+ جمع ساعات ماموریت |
+
+ تردد خارج از محدوده
+ |
+
+ با فرآیند ساعتی
+ |
+
+ با فرآیند روزانه |
+
+
+ بدون فرآیند ساعتی
+ |
+
+ بدون فرآیند روزانه
+ |
+
+فعالیت روزانه |
+
+ گشت راهداری
+ |
+
+
+
+
+ @foreach ($rows as $item)
+
+ | {{ $item['city_name'] ?? '-' }} |
+ {{ $item['total'] ?? '-' }} |
+ {{ $item['khareg_mahdode'] ?? '-' }} |
+ {{ $item['gps'] ?? '-' }} |
+ {{ $item['durations'] ?? '-' }} |
+ {{ $item['bafarayand_saeti'] ?? '-' }} |
+ {{ $item['bafarayand_rozaneh'] ?? '-' }} |
+ {{ $item['bedon_bafarayand_saeti'] ?? '-' }} |
+ {{ $item['bedon_bafarayand_rozaneh'] ?? '-' }} |
+ {{ $item['item'] ?? '-' }} |
+ {{ $item['patrol'] ?? '-' }} |
+
+ @endforeach
+
+
+
+
diff --git a/routes/v3.php b/routes/v3.php
index d627201f..ce0d74ad 100644
--- a/routes/v3.php
+++ b/routes/v3.php
@@ -15,6 +15,8 @@ use App\Http\Controllers\V3\Dashboard\Harim\TechnicalDeputyController;
use App\Http\Controllers\V3\Dashboard\ItemsManagementController;
use App\Http\Controllers\V3\Dashboard\Mission\ControlUnitController;
use App\Http\Controllers\V3\Dashboard\Mission\DetailController;
+use App\Http\Controllers\V3\Dashboard\Mission\Report\ReportTradodController;
+use App\Http\Controllers\V3\Dashboard\Mission\Report\ReportViolationController;
use App\Http\Controllers\V3\Dashboard\Mission\RequestPortalController;
use App\Http\Controllers\V3\Dashboard\Mission\TransportationUnitController;
use App\Http\Controllers\V3\Dashboard\Mission\ViolationManagementController;
@@ -533,9 +535,9 @@ Route::prefix('missions')
Route::post('/{violation}', 'update')->name('update');
Route::delete('/{violation}', 'destroy')->name('destroy');
});
- Route::prefix('report')
- ->name('reports.')
- ->controller(\App\Http\Controllers\V3\Dashboard\Mission\ReportController::class)
+ Route::prefix('report_violation')
+ ->name('reportsViolation.')
+ ->controller(ReportViolationController::class)
->group(function () {
Route::get('/country_activity', 'countryActivity')->name('countryActivity')
->middleware('permission:mission-report-country');
@@ -544,6 +546,17 @@ Route::prefix('missions')
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
});
+ Route::prefix('report_tradod')
+ ->name('reportsTradod.')
+ ->controller(ReportTradodController::class)
+ ->group(function () {
+ Route::get('/country_activity', 'countryActivity')->name('countryActivity')
+ ->middleware('permission:mission-report-country');
+ Route::get('/province_activity', 'provinceActivity')->name('provinceActivity')
+ ->middleware('permission:mission-report-province');
+ Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
+ Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
+ });
});
Route::prefix('harim')