Merge branch 'feature/roadObservationSupervisorCartable' into 'develop'
update versionv2-v3for road observation See merge request witelgroup/rms_v2!78
This commit is contained in:
67
app/Exports/V3/RoadObservation/ComplaintsReport.php
Normal file
67
app/Exports/V3/RoadObservation/ComplaintsReport.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\V3\RoadObservation;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithDrawings;
|
||||
use Maatwebsite\Excel\Concerns\WithEvents;
|
||||
use Maatwebsite\Excel\Events\AfterSheet;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||
|
||||
class ComplaintsReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||
{
|
||||
public function __construct(private Collection $data){}
|
||||
|
||||
public function view(): View
|
||||
{
|
||||
return view('v3.Reports.RoadObservation.ComplaintsReport', [
|
||||
'data' => $this->data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function registerEvents(): array
|
||||
{
|
||||
return [
|
||||
AfterSheet::class => function (AfterSheet $event) {
|
||||
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||
$event->sheet->getDelegate()->getStyle('A:U')->getFont()->setName('Arial');
|
||||
$event->sheet->getDelegate()->getStyle('A:U')
|
||||
->getAlignment()
|
||||
->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
|
||||
$event->sheet->getDelegate()->getStyle('A:U')
|
||||
->getAlignment()
|
||||
->setVertical(Alignment::VERTICAL_CENTER);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
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('q1');
|
||||
return [$drawing, $drawing2];
|
||||
}
|
||||
}
|
||||
70
app/Exports/V3/RoadObservation/OperatorCartableReport.php
Normal file
70
app/Exports/V3/RoadObservation/OperatorCartableReport.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\V3\RoadObservation;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithDrawings;
|
||||
use Maatwebsite\Excel\Concerns\WithEvents;
|
||||
use Maatwebsite\Excel\Events\AfterSheet;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||
|
||||
|
||||
|
||||
class OperatorCartableReport implements FromView, ShouldAutoSize, WithEvents, WithDrawings
|
||||
{
|
||||
public function __construct(private Collection $data){}
|
||||
|
||||
public function view(): View
|
||||
{
|
||||
return view('v3.Reports.RoadObservation.OperatorCartableReport', [
|
||||
'data' => $this->data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function registerEvents(): array
|
||||
{
|
||||
return [
|
||||
AfterSheet::class => function (AfterSheet $event) {
|
||||
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||
$event->sheet->getDelegate()->getStyle('A:U')->getFont()->setName('Arial');
|
||||
$event->sheet->getDelegate()->getStyle('A:U')
|
||||
->getAlignment()
|
||||
->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
|
||||
$event->sheet->getDelegate()->getStyle('A:U')
|
||||
->getAlignment()
|
||||
->setVertical(Alignment::VERTICAL_CENTER);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
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('K1');
|
||||
return [$drawing, $drawing2];
|
||||
}
|
||||
|
||||
}
|
||||
69
app/Exports/V3/RoadObservation/SupervisorCartableReport.php
Normal file
69
app/Exports/V3/RoadObservation/SupervisorCartableReport.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\V3\RoadObservation;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithDrawings;
|
||||
use Maatwebsite\Excel\Concerns\WithEvents;
|
||||
use Maatwebsite\Excel\Events\AfterSheet;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||
|
||||
class SupervisorCartableReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||
{
|
||||
public function __construct(private Collection $data){}
|
||||
|
||||
public function view(): View
|
||||
{
|
||||
$data = $this->data;
|
||||
|
||||
return view('v3.Reports.RoadObservation.SupervisorCartableReport', [
|
||||
'data' => $this->data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function registerEvents(): array
|
||||
{
|
||||
return [
|
||||
AfterSheet::class => function (AfterSheet $event) {
|
||||
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||
$event->sheet->getDelegate()->getStyle('A:U')->getFont()->setName('Arial');
|
||||
$event->sheet->getDelegate()->getStyle('A:U')
|
||||
->getAlignment()
|
||||
->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
|
||||
$event->sheet->getDelegate()->getStyle('A:U')
|
||||
->getAlignment()
|
||||
->setVertical(Alignment::VERTICAL_CENTER);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
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('K1');
|
||||
return [$drawing, $drawing2];
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ class AccidentReceiptController extends Controller
|
||||
FileFacade::delete($accident->police_file, true);
|
||||
}
|
||||
|
||||
if (!$request->report_base) {
|
||||
if (!$request->report_base && $request->has('police_file')) {
|
||||
FileFacade::delete($accident->police_file, true);
|
||||
$accidentData['police_file'] = FileFacade::save($request->file('police_file'), "receipts_files/{$accident->id}/");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\V3\Dashboard\Reports;
|
||||
|
||||
use App\Exports\V2\RoadObservation\ReportComplaintsExport;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Services\Cartables\RoadObservationTableService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
class RoadObservationReportController extends Controller
|
||||
{
|
||||
public function index(Request $request, RoadObservationTableService $roadObservationTableService): JsonResponse
|
||||
{
|
||||
$data = $roadObservationTableService->reportIndex($request);
|
||||
return response()->json($data['data']);
|
||||
}
|
||||
|
||||
public function excelReport(Request $request, RoadObservationTableService $roadObservationTableService): BinaryFileResponse
|
||||
{
|
||||
$name = 'گزارش رسیدگی به شکایات واکنش سریع ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadObservationTableService->reportIndex($request);
|
||||
return Excel::download(new ReportComplaintsExport($data), $name);
|
||||
}
|
||||
}
|
||||
223
app/Http/Controllers/V3/Dashboard/RoadObservationController.php
Normal file
223
app/Http/Controllers/V3/Dashboard/RoadObservationController.php
Normal file
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\V3\Dashboard;
|
||||
use App\Exports\V3\RoadObservation\ComplaintsReport;
|
||||
use App\Exports\V3\RoadObservation\OperatorCartableReport;
|
||||
use App\Exports\V3\RoadObservation\SupervisorCartableReport;
|
||||
use App\Facades\File\FileFacade;
|
||||
use App\Facades\Sms\Sms;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\V3\RoadObservation\ReferRequest;
|
||||
use App\Http\Requests\V3\RoadObservation\RestoreRequest;
|
||||
use App\Http\Requests\V3\RoadObservation\VerifyBySupervisorRequest;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\EdarateShahri;
|
||||
use App\Models\Province;
|
||||
use App\Models\RoadObservationHistory;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Models\User;
|
||||
use App\Services\NikarayanService;
|
||||
use Carbon\Carbon;
|
||||
use Hekmatinasser\Verta\Verta;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Services\Cartables\RoadObservationTableService;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use SoapFault;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
class RoadObservationController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function supervisorIndex(Request $request,RoadObservationTableService $roadObservationTableService ): JsonResponse
|
||||
{
|
||||
return response()->json($roadObservationTableService->supervisorCartableIndex($request));
|
||||
}
|
||||
|
||||
public function verifyBySupervisor(VerifyBySupervisorRequest $request, RoadObserved $roadObserved): JsonResponse
|
||||
{
|
||||
$statusFa = $request->verify == 1 ? 'تایید شده' : 'عدم تایید';
|
||||
|
||||
$roadObserved->update([
|
||||
'status' => $request->verify,
|
||||
'status_fa' => $statusFa,
|
||||
'supervisor_id' => auth()->user()->id,
|
||||
'supervisor_name' => auth()->user()->name,
|
||||
'supervisor_description' => $request->description,
|
||||
'supervising_time' => now(),
|
||||
]);
|
||||
|
||||
auth()->user()->addActivityComplete(1138);
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function supervisorCartableReport(Request $request, RoadObservationTableService $roadObservationTableService): BinaryFileResponse
|
||||
{
|
||||
$name = 'گزارش از کارتابل ارزیابی واکنش سریع '. verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadObservationTableService->supervisorCartableIndex($request);
|
||||
|
||||
return Excel::download(new SupervisorCartableReport($data['data']), $name);
|
||||
}
|
||||
|
||||
public function operatorIndex(Request $request, RoadObservationTableService $roadObservationTableService): JsonResponse
|
||||
{
|
||||
return response()->json($roadObservationTableService->operatorCartableIndex($request));
|
||||
}
|
||||
|
||||
public function operatorCartableReport(Request $request, RoadObservationTableService $roadObservationTableService): BinaryFileResponse
|
||||
{
|
||||
$name = 'گزارش از کارتابل عملیات واکنش سریع ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadObservationTableService->operatorCartableIndex($request);
|
||||
return Excel::download(new OperatorCartableReport($data['data']), $name);
|
||||
}
|
||||
|
||||
public function complaintsIndex(Request $request, RoadObservationTableService $roadObservationTableService): JsonResponse
|
||||
{
|
||||
return response()->json($roadObservationTableService->complaintsIndex($request));
|
||||
}
|
||||
|
||||
public function complaintsReport(Request $request, RoadObservationTableService $roadObservationTableService): BinaryFileResponse
|
||||
{
|
||||
$name = 'گزارش از رسیدگی به شکایات واکنش سریع ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadObservationTableService->complaintsIndex($request);
|
||||
return Excel::download(new ComplaintsReport($data['data']), $name);
|
||||
}
|
||||
|
||||
public function register(Request $request, RoadObserved $roadObserved, NikarayanService $nikarayanService): JsonResponse
|
||||
{
|
||||
$roadObservedData = [
|
||||
'status' => 0,
|
||||
'status_fa' => 'در حال بررسی',
|
||||
'rms_status' => $request->rms_status ?? $roadObserved->rms_status,
|
||||
'rms_description' => $request->description?? $roadObserved->rms_description,
|
||||
];
|
||||
|
||||
$roadObservedHistoryData = [
|
||||
'user_id' => auth()->user()->id,
|
||||
'previous_rms_status' => $roadObserved->rms_status,
|
||||
'previous_rms_start_latlng' => $roadObserved->rms_start_latlng,
|
||||
'previous_rms_end_latlng' => $roadObserved->rms_end_latlng,
|
||||
'previous_rms_description' => $roadObserved->rms_description,
|
||||
'new_files' => []
|
||||
];
|
||||
|
||||
if ($request->rms_status == 1) {
|
||||
|
||||
$files_path = [];
|
||||
|
||||
$roadObserved->files()->where('path', 'like', '%_image_before%')->delete();
|
||||
$roadObserved->files()->where('path', 'like', '%_image_after%')->delete();
|
||||
|
||||
$image_before = FileFacade::save($request->image_before, "road_observeds/{$roadObserved->id}/");
|
||||
$image_after = FileFacade::save($request->image_after, "road_observeds/{$roadObserved->id}/");
|
||||
|
||||
$files_path[0]['path'] = $image_before;
|
||||
$files_path[1]['path'] = $image_after;
|
||||
|
||||
$files = json_encode($files_path);
|
||||
$now_date_time = Carbon::now();
|
||||
|
||||
$roadObservedData['image_before'] = $image_before;
|
||||
$roadObservedData['image_after'] = $image_after;
|
||||
$roadObservedData['rms_start_latlng'] = explode(',', $request->start_point);
|
||||
$roadObservedData['updated_at_fa'] = Verta::instance($now_date_time);
|
||||
$roadObservedData['rms_last_activity_fa'] = Verta::instance($now_date_time);
|
||||
$roadObservedData['rms_last_activity'] = $now_date_time;
|
||||
$roadObservedHistoryData['new_files'] = $files;
|
||||
}
|
||||
|
||||
$roadObserved->problemHistories()->create($roadObservedHistoryData);
|
||||
$roadObserved->update($roadObservedData);
|
||||
|
||||
auth()->user()->addActivityComplete(1142);
|
||||
|
||||
try {
|
||||
$nikarayanService->updateRoadObservedInfoByNikarayan($request, $roadObserved, json_encode($roadObservedHistoryData['new_files']));
|
||||
}
|
||||
catch (SoapFault $e) {
|
||||
|
||||
$msg = "error in send to nikarayan at" . date("Y-m-d H:i:s") . "\n";
|
||||
$msg .= $e->getMessage();
|
||||
Sms::sendSms(env('RMS_CTO_PHONE_NUMBER'), $msg);
|
||||
}
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function refer(ReferRequest $request, RoadObserved $roadObserved): JsonResponse
|
||||
{
|
||||
RoadObservationHistory::query()->create([
|
||||
'id' => $roadObserved->id,
|
||||
'user_id' => auth()->user()->id,
|
||||
'action' => 'refer',
|
||||
'description' => $request->refer_description,
|
||||
'from_edareh' => $roadObserved->edarate_shahri_id,
|
||||
'to_edareh' => $request->edarate_shahri_id,
|
||||
'from_province' => $roadObserved->province_id,
|
||||
'to_province' => $request->province_id
|
||||
]);
|
||||
|
||||
$roadObserved->update([
|
||||
'edarate_shahri_id' => $request->edarate_shahri_id,
|
||||
'province_id' => $request->province_id,
|
||||
]);
|
||||
|
||||
auth()->user()->addActivityComplete(1037);
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function referList(RoadObserved $roadObserved): JsonResponse
|
||||
{
|
||||
$referList = [];
|
||||
$data = RoadObservationHistory::query()
|
||||
->where('road_observation_histories.id', $roadObserved->id)
|
||||
->where('action', '=', 'refer')->get();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$referList[$key]['from_edareh'] = EdarateShahri::query()->find($value->from_edareh)->name_fa;
|
||||
$referList[$key]['to_edareh'] = EdarateShahri::query()->find($value->to_edareh)->name_fa;
|
||||
$referList[$key]['from_province'] = Province::query()->find($value->from_province)->name_fa;
|
||||
$referList[$key]['to_province'] = Province::query()->find($value->to_province)->name_fa;
|
||||
$user = User::query()->find($value->user_id);
|
||||
$referList[$key]['user'] = $user->first_name . ' ' . $user->last_name;
|
||||
}
|
||||
return $this->successResponse($referList);
|
||||
}
|
||||
|
||||
public function restore(RestoreRequest $request, RoadObserved $roadObserved): JsonResponse
|
||||
{
|
||||
if ($roadObserved->image_before) {
|
||||
FileFacade::delete($roadObserved->image_before);
|
||||
}
|
||||
|
||||
if ($roadObserved->image_after) {
|
||||
FileFacade::delete($roadObserved->image_after);
|
||||
}
|
||||
|
||||
$roadObserved->update([
|
||||
'image_before' => null,
|
||||
'image_after' => null,
|
||||
'rms_last_activity' => null,
|
||||
'rms_last_activity_fa' => null,
|
||||
'updated_at_fa' => null,
|
||||
'updated_at' => null,
|
||||
'rms_status' => 0,
|
||||
'status' => null,
|
||||
'status_fa' => null,
|
||||
]);
|
||||
|
||||
RoadObservationHistory::query()->create([
|
||||
'id' => $roadObserved->id,
|
||||
'user_id' => auth()->user()->id,
|
||||
'action' => 'restore',
|
||||
'description' => $request->restore_description,
|
||||
]);
|
||||
|
||||
auth()->user()->addActivityComplete(1141);
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
}
|
||||
@@ -35,11 +35,11 @@ class UpdateRequest extends FormRequest
|
||||
'accident_date' => 'required|date',
|
||||
'accident_time' => 'required|string',
|
||||
'report_base' => 'required|in:0,1',
|
||||
'police_file' => 'required_if:report_base,0|file|mimes:pdf,jpg,jpeg,png',
|
||||
'police_file' => 'file|mimes:pdf,jpg,jpeg,png',
|
||||
'police_serial' => 'required_if:report_base,0|string',
|
||||
'police_file_date' => 'required_if:report_base,0|date',
|
||||
'damage_picture1' => 'required|file|mimes:pdf,jpg,jpeg,png',
|
||||
'damage_picture2' => 'required|file|mimes:pdf,jpg,jpeg,png',
|
||||
'damage_picture1' => 'file|mimes:pdf,jpg,jpeg,png',
|
||||
'damage_picture2' => 'file|mimes:pdf,jpg,jpeg,png',
|
||||
'damage_items' => 'required|array',
|
||||
'damage_items.*.value' => 'required',
|
||||
'damage_items.*.amount' => 'required',
|
||||
|
||||
30
app/Http/Requests/V3/RoadObservation/ReferRequest.php
Normal file
30
app/Http/Requests/V3/RoadObservation/ReferRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\RoadObservation;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReferRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->roadObserved->rms_status == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'edarate_shahri_id' => 'required|exists:edarate_shahri,id',
|
||||
'province_id' => 'required|exists:provinces,id',
|
||||
'refer_description' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
28
app/Http/Requests/V3/RoadObservation/RestoreRequest.php
Normal file
28
app/Http/Requests/V3/RoadObservation/RestoreRequest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\RoadObservation;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RestoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'restore_description' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V3\RoadObservation;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class VerifyBySupervisorRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return Gate::allows('gate-supervise-road-observed',$this->roadObserved);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{return [
|
||||
'verify' => ['required', 'in:1,2'],
|
||||
'description' => ['string'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class RoadObserved extends Model
|
||||
{
|
||||
@@ -99,4 +101,18 @@ class RoadObserved extends Model
|
||||
{
|
||||
return $this->belongsTo('App\Models\EdarateShahri', 'edarate_shahri_id');
|
||||
}
|
||||
|
||||
protected function imageAfter(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => $value == null ? null : Storage::disk('public')->url($value)
|
||||
);
|
||||
}
|
||||
|
||||
protected function imageBefore(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => $value == null ? null : Storage::disk('public')->url($value)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class RoadItemTableService
|
||||
|
||||
if ($user->hasPermissionTo('show-road-item-supervise-cartable')) {
|
||||
$query = RoadItemsProject::query()
|
||||
->select(['id', 'province_fa', 'edarat_name', 'item_fa', 'sub_item_fa', 'sub_item_data', 'unit_fa', 'start_lat', 'start_lng',
|
||||
->select(['id', 'province_fa', 'edarat_name', 'item', 'item_fa', 'sub_item', 'sub_item_fa', 'sub_item_data', 'unit_fa', 'start_lat', 'start_lng',
|
||||
'end_lat', 'end_lng', 'activity_date_time', 'created_at', 'status_fa', 'status'])
|
||||
->where('is_new', 1)
|
||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||
@@ -31,7 +31,7 @@ class RoadItemTableService
|
||||
return $this->errorResponse('استانی برای شما در سامانه ثبت نشده است!');
|
||||
}
|
||||
$query = RoadItemsProject::query()
|
||||
->select(['id', 'province_fa', 'edarat_name', 'item_fa', 'sub_item_fa', 'sub_item_data', 'unit_fa', 'start_lat', 'start_lng',
|
||||
->select(['id', 'province_fa', 'edarat_name', 'item', 'item_fa', 'sub_item', 'sub_item_fa', 'sub_item_data', 'unit_fa', 'start_lat', 'start_lng',
|
||||
'end_lat', 'end_lng', 'activity_date_time', 'created_at', 'status_fa', 'status'])
|
||||
->where('is_new', 1)
|
||||
->where('province_id', auth()->user()->province_id)
|
||||
@@ -53,7 +53,7 @@ class RoadItemTableService
|
||||
$allowedSortings = ['*'];
|
||||
|
||||
$query = RoadItemsProject::query()
|
||||
->select(['id', 'supervisor_description', 'item_fa', 'sub_item_fa', 'sub_item_data', 'unit_fa', 'start_lat', 'start_lng',
|
||||
->select(['id', 'supervisor_description', 'item', 'item_fa', 'sub_item', 'sub_item_fa', 'sub_item_data', 'unit_fa', 'start_lat', 'start_lng',
|
||||
'end_lat', 'end_lng', 'activity_date_time', 'created_at', 'status_fa', 'status'])
|
||||
->where('is_new', 1)
|
||||
->where('user_id', auth()->user()->id)
|
||||
|
||||
179
app/Services/Cartables/RoadObservationTableService.php
Normal file
179
app/Services/Cartables/RoadObservationTableService.php
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Cartables;
|
||||
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\RoadObserved;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RoadObservationTableService
|
||||
{
|
||||
use ApiResponse;
|
||||
public function supervisorCartableIndex(Request $request)
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
$fields = [
|
||||
'fk_RegisteredEventMessage', 'road_observeds.id', 'Title', 'road_observeds.created_at',
|
||||
'lat', 'lng', 'FeatureTypeTitle', 'Description', 'MobileForSendEventSms',
|
||||
'rms_description', 'rms_status', 'rms_last_activity_fa', 'rms_last_activity',
|
||||
'road_observeds.province_id', 'province_fa', 'city_id', 'city_fa', 'edarate_shahri.name_fa',
|
||||
'status', 'status_fa', 'supervisor_description', 'supervising_time', 'image_after', 'image_before'
|
||||
];
|
||||
|
||||
|
||||
if ($user->hasPermissionTo('show-fast-react')) {
|
||||
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->whereNotNull('road_observeds.status')
|
||||
->select($fields);
|
||||
}
|
||||
elseif ($user->hasPermissionTo('show-fast-react-province'))
|
||||
{
|
||||
if (is_null($user->province_id))
|
||||
{
|
||||
return $this->errorResponse('استانی برای شما در سامانه ثبت نشده است!');
|
||||
}
|
||||
|
||||
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->where('road_observeds.province_id', $user->province_id)
|
||||
->whereNotNull('road_observeds.status')
|
||||
->select($fields);
|
||||
}
|
||||
|
||||
return DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*']);
|
||||
}
|
||||
|
||||
public function operatorCartableIndex(Request $request)
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
if (is_null($user->edarate_shahri_id)) {
|
||||
return $this->errorResponse('ادارهای برای شما در سامانه ثبت نشده است!');
|
||||
}
|
||||
|
||||
$fields = [
|
||||
'fk_RegisteredEventMessage', 'road_observeds.id', 'Title', 'road_observeds.created_at',
|
||||
'lat', 'lng', 'FeatureTypeTitle', 'Description', 'MobileForSendEventSms',
|
||||
'rms_description', 'rms_status', 'rms_start_latlng', 'rms_last_activity_fa', 'image_after', 'image_before',
|
||||
'rms_last_activity', 'road_observeds.province_id', 'province_fa', 'city_id', 'city_fa',
|
||||
'edarate_shahri.name_fa', 'status', 'status_fa', 'supervisor_description', 'supervising_time'
|
||||
];
|
||||
|
||||
$query = RoadObserved::query()
|
||||
->where('rms_status', '<>', 0)
|
||||
->whereNotNull('road_observeds.province_id')
|
||||
->whereNotNull('status')
|
||||
->leftJoin('edarate_shahri', 'road_observeds.edarate_shahri_id', '=', 'edarate_shahri.id')
|
||||
->where('edarate_shahri_id', $user->edarate_shahri_id)
|
||||
->select($fields);
|
||||
|
||||
return DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*']);
|
||||
}
|
||||
|
||||
public function complaintsIndex(Request $request)
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
if ($user->hasPermissionTo('show-fast-react')) {
|
||||
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->where('rms_status', '=', 0)
|
||||
->whereNotNull('edarate_shahri_id')
|
||||
->selectRaw('fk_RegisteredEventMessage, road_observeds.id, Title, FeatureTypeTitle, MobileForSendEventSms,
|
||||
road_observeds.created_at, rms_last_activity, rms_last_activity_fa, status,
|
||||
status_fa, supervisor_description, rms_description, province_fa, city_id, city_fa, Description, edarate_shahri.name_fa as edarate_shahri_name_fa, lat, lng'
|
||||
);
|
||||
}
|
||||
elseif ($user->hasPermissionTo('show-fast-react-province')) {
|
||||
|
||||
if (is_null($user->province_id)) {
|
||||
return $this->errorResponse('استانی برای شما در سامانه ثبت نشده است!');
|
||||
}
|
||||
|
||||
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->where('rms_status', '=', 0)
|
||||
->whereNotNull('road_observeds.province_id')
|
||||
->where('road_observeds.province_id', '=', $user->province_id)
|
||||
->selectRaw('fk_RegisteredEventMessage, road_observeds.id, Title, FeatureTypeTitle, MobileForSendEventSms,
|
||||
road_observeds.created_at, rms_last_activity, rms_last_activity_fa, status,
|
||||
status_fa, supervisor_description, rms_description, province_fa, city_id, city_fa, Description, edarate_shahri.name_fa as edarate_shahri_name_fa, lat, lng'
|
||||
);
|
||||
|
||||
}
|
||||
elseif ($user->hasPermissionTo('show-fast-react-edarate-shahri')) {
|
||||
|
||||
if (is_null($user->edarate_shahri_id)) {
|
||||
return $this->errorResponse('اداره ای برای شما در سامانه ثبت نشده است!');
|
||||
}
|
||||
|
||||
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->where('rms_status', '=', 0)
|
||||
->whereNotNull('edarate_shahri_id')
|
||||
->where('edarate_shahri_id', '=', $user->edarate_shahri_id)
|
||||
->selectRaw('fk_RegisteredEventMessage, road_observeds.id, Title, FeatureTypeTitle, MobileForSendEventSms,
|
||||
road_observeds.created_at, rms_last_activity, rms_last_activity_fa, status,
|
||||
status_fa, supervisor_description, rms_description, province_fa, city_id, city_fa, Description, edarate_shahri.name_fa as edarate_shahri_name_fa, lat, lng'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
return DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*']
|
||||
);
|
||||
}
|
||||
|
||||
public function reportIndex(Request $request)
|
||||
{
|
||||
$fromDate = $request->from_date . ' 00:00:00';
|
||||
$toDate = $request->date_to . ' 23:59:59';
|
||||
|
||||
$fields = [
|
||||
'fk_RegisteredEventMessage',
|
||||
'road_observeds.id',
|
||||
'Title',
|
||||
'road_observeds.created_at',
|
||||
'lat',
|
||||
'lng',
|
||||
'FeatureTypeTitle',
|
||||
'Description',
|
||||
'MobileForSendEventSms',
|
||||
'road_observeds.province_id',
|
||||
'province_fa',
|
||||
'city_fa',
|
||||
'edarate_shahri.name_fa',
|
||||
'rms_last_activity_fa',
|
||||
'rms_description'
|
||||
];
|
||||
|
||||
$query = RoadObserved::leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->where('rms_status', "<>", 0)
|
||||
->whereNotNull('edarate_shahri_id')
|
||||
->whereBetween('road_observeds.created_at', [$fromDate, $toDate])
|
||||
->select($fields);
|
||||
|
||||
$data = DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*']
|
||||
);
|
||||
|
||||
return [
|
||||
'data' => $data,
|
||||
'fromDate' => $fromDate,
|
||||
'toDate' => $toDate,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ class RoadPatrolTableService
|
||||
$query = RoadPatrol::query()
|
||||
->select([
|
||||
'province_fa', 'province_id', 'id', 'edare_id', 'edare_name', 'start_time', 'end_time', 'created_at', 'description',
|
||||
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points,'
|
||||
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points'
|
||||
])
|
||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class RoadPatrolTableService
|
||||
$query = RoadPatrol::query()
|
||||
->select([
|
||||
'province_fa', 'province_id', 'id', 'edare_id', 'edare_name', 'start_time', 'end_time', 'created_at', 'description',
|
||||
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points,'
|
||||
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points'
|
||||
])
|
||||
->where('province_id', '=', $user->province_id)
|
||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||
@@ -55,7 +55,7 @@ class RoadPatrolTableService
|
||||
$query = RoadPatrol::query()
|
||||
->select([
|
||||
'province_fa', 'province_id', 'id', 'edare_id', 'edare_name', 'start_time', 'end_time', 'created_at', 'description',
|
||||
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points,'
|
||||
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points'
|
||||
])
|
||||
->where('operator_id', '=', auth()->user()->id)
|
||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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('road_observation_histories', function (Blueprint $table) {
|
||||
$table->string('from_province')->nullable();
|
||||
$table->string('to_province')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('road_observation_histories', function (Blueprint $table) {
|
||||
$table->dropColumn('from_province');
|
||||
$table->dropColumn('to_province');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>گزارش واکنش سریع</title>
|
||||
|
||||
<style>
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body dir="rtl" style="text-align: center;">
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="9"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right: 1px solid black;font-weight:bolder;">
|
||||
تاریخ دریافت گزارش: {{ verta()->now()->format('Y/m/d H:i') }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="9"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="9"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;font-size: 13px;">
|
||||
گزارش رسیدگی به شکایات واکنش سریع
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">کد
|
||||
سوانح</th>
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||
استان
|
||||
</th>
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||
ادارات شهری
|
||||
</th>
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||
موضوع گزارش
|
||||
</th>
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||
نوع گزارش</th>
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||
توضیح گزارش</th>
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||
موقعیت مکانی</th>
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||
شماره تماس گیرنده</th>
|
||||
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||
تاریخ ثبت گزارش</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($data as $item)
|
||||
<tr>
|
||||
<td style="border: 1px solid black;text-align: center;">{{ $item['fk_RegisteredEventMessage'] ?? '-' }}</td>
|
||||
<td style="border: 1px solid black;text-align: center;">{{ $item['province_fa'] ?? '-' }}</td>
|
||||
<td style="border: 1px solid black;text-align: center;">{{ $item['edarate_shahri_name_fa'] ?? '-' }}</td>
|
||||
<td style="border: 1px solid black;text-align: center;">{{ $item['Title'] ?? '-' }}</td>
|
||||
<td style="border: 1px solid black;text-align: center;">{{ $item['FeatureTypeTitle'] ?? '-' }}</td>
|
||||
<td style="border: 1px solid black;text-align: center;">{{ $item['Description'] ?? '-' }}</td>
|
||||
<td style="border: 1px solid black;text-align: center;">{{ isset($item['lat']) && isset($item['lng']) ? $item['lat'] . ' ' . $item['lng'] : '-' }}</td>
|
||||
<td style="border: 1px solid black;text-align: center;">{{ $item['MobileForSendEventSms'] ?? '-' }}</td>
|
||||
<td style="border: 1px solid black;text-align: center;">{{ $item['created_at'] ? verta($item['created_at'])->format('Y/n/j H:i:s') : '-' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>گزارش واکنش سریع</title>
|
||||
|
||||
<style>
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body dir="rtl" style="text-align: center;">
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="11"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right: 1px solid black;font-weight:bolder;">
|
||||
تاریخ دریافت گزارش: {{ verta()->now()->format('Y/m/d H:i') }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="11"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="11"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;font-size: 13;">
|
||||
گزارش کارتابل عملیات واکنش سریع
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>کد یکتا</th>
|
||||
<th>کد سوانح</th>
|
||||
<th>استان</th>
|
||||
<th>ادارات شهری</th>
|
||||
<th>موضوع گزارش</th>
|
||||
<th>نوع گزارش</th>
|
||||
<th>شماره تماس گیرنده</th>
|
||||
<th>وضعیت</th>
|
||||
<th>تاریخ اقدام</th>
|
||||
<th>توضیحات</th>
|
||||
<th>توضیحات کارشناس</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($data as $item)
|
||||
<tr>
|
||||
<td>{{ $item['id'] ?? '-' }}</td>
|
||||
<td>{{ $item['fk_RegisteredEventMessage'] ?? '-' }}</td>
|
||||
<td>{{ $item['province_fa'] ?? '-' }}</td>
|
||||
<td>{{ $item['edarate_shahri_name_fa'] ?? '-' }}</td>
|
||||
<td>{{ $item['Title'] ?? '-' }}</td>
|
||||
<td>{{ $item['FeatureTypeTitle'] ?? '-' }}</td>
|
||||
<td>{{ $item['MobileForSendEventSms'] ?? '-' }}</td>
|
||||
<td>{{ $item['status_fa'] ?? '-' }}</td>
|
||||
<td>{{ $item['rms_last_activity_fa'] ?? '-' }}</td>
|
||||
<td>{{ $item['rms_description'] ?? '-' }}</td>
|
||||
<td>{{ $item['supervisor_description'] ?? '-' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>گزارش واکنش سریع</title>
|
||||
|
||||
<style>
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body dir="rtl" style="text-align: center;">
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="11"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right: 1px solid black;font-weight:bolder;">
|
||||
تاریخ دریافت گزارش: {{ verta()->now()->format('Y/m/d H:i') }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="11"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="11"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;font-size: 13;">
|
||||
گزارش کارتابل ارزیابی واکنش سریع
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>کد یکتا</th>
|
||||
<th>کد پیگیری</th>
|
||||
<th>استان</th>
|
||||
<th>ادارات شهری</th>
|
||||
<th>موضوع گزارش</th>
|
||||
<th>نوع گزارش</th>
|
||||
<th>شماره تماس گیرنده</th>
|
||||
<th>وضعیت</th>
|
||||
<th>تاریخ اقدام</th>
|
||||
<th>توضیحات</th>
|
||||
<th>توضیحات کارشناس</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($data as $item)
|
||||
<tr>
|
||||
<td>{{ $item['id'] ?? '-' }}</td>
|
||||
<td>{{ $item['fk_RegisteredEventMessage'] ?? '-' }}</td>
|
||||
<td>{{ $item['province_fa'] ?? '-' }}</td>
|
||||
<td>{{ $item['edarate_shahri_name_fa'] ?? '-' }}</td>
|
||||
<td>{{ $item['Title'] ?? '-' }}</td>
|
||||
<td>{{ $item['FeatureTypeTitle'] ?? '-' }}</td>
|
||||
<td>{{ $item['MobileForSendEventSms'] ?? '-' }}</td>
|
||||
<td>{{ $item['status_fa'] ?? '-' }}</td>
|
||||
<td>{{ $item['rms_last_activity_fa'] ?? '-' }}</td>
|
||||
<td>{{ $item['rms_description'] ?? '-' }}</td>
|
||||
<td>{{ $item['supervisor_description'] ?? '-' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -12,6 +12,7 @@ use App\Http\Controllers\V3\Dashboard\Reports\AccidentReceiptReportController;
|
||||
use App\Http\Controllers\V3\Dashboard\Reports\RoadItemsReportController;
|
||||
use App\Http\Controllers\V3\Dashboard\Reports\RoadPatrolReportController;
|
||||
use App\Http\Controllers\V3\Dashboard\RoadItemsProjectController;
|
||||
use App\Http\Controllers\V3\Dashboard\RoadObservationController;
|
||||
use App\Http\Controllers\V3\Dashboard\RoadPatrolProjectController;
|
||||
use App\Http\Controllers\V3\FMSVehicleManagementController;
|
||||
use App\Http\Controllers\V3\Harim\DivarkeshiController;
|
||||
@@ -275,3 +276,34 @@ Route::prefix('receipt_reports')
|
||||
Route::get('/country_excel_report', 'countryExcelReport')->name('countryExcelReport');
|
||||
Route::get('/province_excel_report', 'provinceExcelReport')->name('provinceExcelReport');
|
||||
});
|
||||
|
||||
Route::prefix('road_observations')
|
||||
->name('roadObservations.')
|
||||
->controller(RoadObservationController::class)
|
||||
->group(function () {
|
||||
Route::get('/supervisor_index', 'supervisorIndex')->name('supervisorIndex')->middleware('permission:show-fast-react-province|show-fast-react');
|
||||
Route::post('/verify/{road_observed}', 'verifyBySupervisor')->name('verifyBySupervisor');
|
||||
Route::get('/supervisor_report', 'supervisorCartableReport')->name('supervisorCartableReport')->middleware('permission:show-fast-react-province|show-fast-react');
|
||||
Route::get('/operator_index','operatorIndex')->name('operatorIndex')->middleware('permission:show-fast-react-edarate-shahri');
|
||||
Route::get('/operator_report','operatorCartableReport')->name('operatorCartableReport')->middleware('permission:show-fast-react-edarate-shahri');
|
||||
Route::get('/complaints_index', 'complaintsIndex')
|
||||
->middleware('permission:show-fast-react-edarate-shahri|show-fast-react-province|show-fast-react')
|
||||
->name('complaintsIndex');
|
||||
Route::post('/register/{roadObserved}', 'register')
|
||||
->middleware('permission:show-fast-react-edarate-shahri')
|
||||
->name('register');
|
||||
Route::post('/refer/{roadObserved}', 'refer')
|
||||
->middleware('permission:show-fast-react-edarate-shahri|show-fast-react-province|show-fast-react')
|
||||
->name('refer');
|
||||
|
||||
Route::get('/refer_list/{roadObserved}', 'referList')
|
||||
->middleware('permission:show-fast-react-edarate-shahri|show-fast-react-province|show-fast-react')
|
||||
->name('referList');
|
||||
|
||||
Route::post('/restore/{roadObserved}', 'restore')
|
||||
->middleware('permission:restore-fast-react')
|
||||
->name('restore');
|
||||
|
||||
Route::get('/complaints_report', 'complaintsReport')->name('complaintsReport')
|
||||
->middleware('permission:show-fast-react-edarate-shahri|show-fast-react-province|show-fast-react');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user