Compare commits
77 Commits
feature/Fi
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| eedc24c625 | |||
|
|
89972b57f4 | ||
|
|
961e4c40c9 | ||
|
|
d58ca6b685 | ||
|
|
7a981ee421 | ||
|
|
da82c7841b | ||
|
|
aa468b592b | ||
| 0291ee6716 | |||
|
|
0befa33b0f | ||
| 3708e2ebfb | |||
|
|
3fb1474b80 | ||
|
|
bab99f7f89 | ||
| 2aa9ae1455 | |||
| 6fc073c7e8 | |||
| 8da1ae1d74 | |||
| 80c4eeaefb | |||
| c9e779d726 | |||
| 72fa9d4ea3 | |||
|
|
d50749fd20 | ||
| ad01e4718d | |||
| 3dd49494f4 | |||
| 3045f60f1e | |||
| 2a6d44885c | |||
| 439f69af29 | |||
| 1be9315b73 | |||
|
|
39752fd5ba | ||
|
|
ab9838c1bc | ||
| 92d806497d | |||
| 7ac07692a2 | |||
| ca51f65da4 | |||
| 0f65437bfa | |||
| 5edb061a24 | |||
|
|
75c649c48e | ||
|
|
5a2a477789 | ||
| fc853d318e | |||
|
|
a45b4955db | ||
| 0b7b22ff87 | |||
| ace0b018e7 | |||
| e7ced6267d | |||
| 17a6e903ae | |||
| 55c736ac3e | |||
| 5f2d214a56 | |||
| a8c71de069 | |||
| 1e106a0c87 | |||
| 1937f57dd3 | |||
| 72462e8016 | |||
| 55b40eb0cc | |||
| 6db1933046 | |||
| b5aa3371da | |||
| 5d2a6d045b | |||
| eeff2861e5 | |||
| 6ae3fd3d90 | |||
| 6b81075e40 | |||
| 235111ee57 | |||
| ccacb2f916 | |||
| aeb58ed27f | |||
| a8b99706d0 | |||
| 92cf157b29 | |||
| 5004b99d03 | |||
| 2f3ebf5808 | |||
| a0ee7cccd3 | |||
| 25e2883e9c | |||
| 23dd62550d | |||
| e3b49ebbb3 | |||
| 7d7507411d | |||
| e0edcf6db2 | |||
| 893edea5a9 | |||
| 57d59b79b4 | |||
| 9f394abc3e | |||
|
|
08db103f26 | ||
| a5cf79cd1b | |||
| ad70874bde | |||
|
|
6a1513a72f | ||
| f798d05a3c | |||
| 96960f5e8f | |||
| 3ca710228f | |||
| a1bca2d80f |
@@ -78,7 +78,7 @@ FMS_ERROR_RATE_URL=
|
|||||||
FMS_ERROR_RATE_PASSWORD=
|
FMS_ERROR_RATE_PASSWORD=
|
||||||
FMS_ERROR_RATE_USERNAME=
|
FMS_ERROR_RATE_USERNAME=
|
||||||
|
|
||||||
HARIM_NEED_ACCESS_URL='https://zamin.gov.ir/ow/api/ow/esb/response',
|
HARIM_NEED_ACCESS_URL='https://zamin.gov.ir/ow/api/ow/esb/response'
|
||||||
HARIM_NEED_ACCESS_PASSWORD=
|
HARIM_NEED_ACCESS_PASSWORD=
|
||||||
HARIM_NEED_ACCESS_USERNAME=
|
HARIM_NEED_ACCESS_USERNAME=
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ BACKUP_PASSWORD=1qaz
|
|||||||
HARIM_ENCRYPTION_KEY="TestKey"
|
HARIM_ENCRYPTION_KEY="TestKey"
|
||||||
HARIM_ENCRYPTION_IV="1111000011110101"
|
HARIM_ENCRYPTION_IV="1111000011110101"
|
||||||
|
|
||||||
CHECKE_LIST_MACHINES_ACTIVITY_URL='fms.141.ir:7030/api/RMS/GetMovingVehicles',
|
CHECKE_LIST_MACHINES_ACTIVITY_URL='fms.141.ir:7030/api/RMS/GetMovingVehicles'
|
||||||
CHECKE_LIST_MACHINES_ACTIVITY_PASSWORD=
|
CHECKE_LIST_MACHINES_ACTIVITY_PASSWORD=
|
||||||
CHECKE_LIST_MACHINES_ACTIVITY_USERNAME=
|
CHECKE_LIST_MACHINES_ACTIVITY_USERNAME=
|
||||||
|
|
||||||
|
|||||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -19,3 +19,10 @@ yarn-error.log
|
|||||||
/.idea
|
/.idea
|
||||||
/.vscode
|
/.vscode
|
||||||
archive.tgz
|
archive.tgz
|
||||||
|
storage/avatar/
|
||||||
|
storage/cities-geojson.json
|
||||||
|
storage/compress.php
|
||||||
|
storage/images/
|
||||||
|
storage/provinces-cities-geojson copy.js
|
||||||
|
storage/provinces-cities-geojson.js
|
||||||
|
storage/provinces-geojson.json
|
||||||
40
app/Console/Commands/EncodePolyLineCommand.php
Normal file
40
app/Console/Commands/EncodePolyLineCommand.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Mission;
|
||||||
|
use App\Services\PolylineEncoder;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class EncodePolyLineCommand extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'polyline:encode';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'encode all missions that have poly line';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*/
|
||||||
|
public function handle(PolylineEncoder $polylineEncoder): void
|
||||||
|
{
|
||||||
|
Mission::query()->whereNotNull('area')->each(function ($mission) use ($polylineEncoder) {
|
||||||
|
$area = json_decode($mission->area, true);
|
||||||
|
$encodedValue = $polylineEncoder->encodePolyLine($area['coordinates'], lng_lat_format:true);
|
||||||
|
$mission->update([
|
||||||
|
'encoded_route' => $encodedValue,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->info("updated successfully");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,7 +46,7 @@ class SendContractSmsNotification extends Command
|
|||||||
foreach ($contractSubItems as $key => $value) {
|
foreach ($contractSubItems as $key => $value) {
|
||||||
$message = "سلام،\n پروژه راهداری با کد یکتای {$value->unique_code} با مسئولیت شما، به مدت بیشتر از یک ماه به روزرسانی نشده است. لطفا نسبت به روز رسانی دقیق پیشرفت پروژه در سامانه اقدام نمایید.\n rms.rmto.ir";
|
$message = "سلام،\n پروژه راهداری با کد یکتای {$value->unique_code} با مسئولیت شما، به مدت بیشتر از یک ماه به روزرسانی نشده است. لطفا نسبت به روز رسانی دقیق پیشرفت پروژه در سامانه اقدام نمایید.\n rms.rmto.ir";
|
||||||
|
|
||||||
self::sms_sender($value->operator_phone, $message);
|
// self::sms_sender($value->operator_phone, $message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ enum CmmsMachineStatus: int
|
|||||||
self::AMADE => 'آماده',
|
self::AMADE => 'آماده',
|
||||||
self::RESERVE => 'رزرو',
|
self::RESERVE => 'رزرو',
|
||||||
self::DAR_MAMORIAT => 'در ماموریت',
|
self::DAR_MAMORIAT => 'در ماموریت',
|
||||||
self::KHAREGE_AZ_RADE => 'خارج از محدوده',
|
self::KHAREGE_AZ_RADE => 'خارج از رده',
|
||||||
self::DAR_TAMIR => 'در تعمیر',
|
self::DAR_TAMIR => 'در تعمیر',
|
||||||
self::FOROKHTEH_SHODE => ' فروخته شده',
|
self::FOROKHTEH_SHODE => ' فروخته شده',
|
||||||
self::NIZE_BE_TAMIR => 'نیاز به تعمیر',
|
self::NIZE_BE_TAMIR => 'نیاز به تعمیر',
|
||||||
|
|||||||
@@ -15,15 +15,28 @@ enum MissionStates: int
|
|||||||
public static function name(int $state): string
|
public static function name(int $state): string
|
||||||
{
|
{
|
||||||
$mapArray = [
|
$mapArray = [
|
||||||
1 => 'درخواست ایجاد شد و در حال بررسی توسط واحد نقلیه است',
|
1 => 'درخواست ایجاد شد و در حال بررسی توسط واحد تایید کننده است',
|
||||||
2 => 'خودرو اختصاص داده شد و درخواست توسط واحد کنترل در حال بررسی است',
|
2 => 'خودرو اختصاص داده شد و درخواست توسط واحد کنترل در حال بررسی است',
|
||||||
3 => 'درخواست توسط واحد کنترل تایید شد و ماموریت آغاز می شود',
|
3 => 'درخواست توسط واحد کنترل تایید شد و ماموریت آغاز می شود',
|
||||||
4 => 'اتمام ماموریت',
|
4 => 'اتمام ماموریت',
|
||||||
5 => 'عدم تخصیص خودرو توسط واحد نقلیه و بازگشت درخواست به کارتابل کاربر',
|
5 => 'عدم تخصیص خودرو توسط واحد تایید کننده و بازگشت درخواست به کارتابل کاربر',
|
||||||
6 => 'ماموریت لغو شد',
|
6 => 'ماموریت لغو شد',
|
||||||
7 => 'ماموریت بدون فرایند ثبت شد'
|
7 => 'ماموریت بدون فرایند ثبت شد'
|
||||||
];
|
];
|
||||||
|
|
||||||
return $mapArray[$state];
|
return $mapArray[$state];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function label(): string
|
||||||
|
{
|
||||||
|
return match ($this) {
|
||||||
|
self::REQUEST_CREATED => 'درخواست ایجاد شد و در حال بررسی توسط واحد تایید کننده است',
|
||||||
|
self::PENDING_CONFIRMATION => 'خودرو اختصاص داده شد و درخواست توسط واحد کنترل در حال بررسی است',
|
||||||
|
self::START_MISSION => 'درخواست توسط واحد کنترل تایید شد و ماموریت آغاز می شود',
|
||||||
|
self::END_MISSION => 'اتمام ماموریت',
|
||||||
|
self::REJECT_BY_TRANSPORTATION => 'عدم تخصیص خودرو توسط واحد تایید کننده و بازگشت درخواست به کارتابل کاربر',
|
||||||
|
self::CANCELLED => 'ماموریت لغو شد',
|
||||||
|
self::CREATED_NO_PROCESS => 'ماموریت بدون فرایند ثبت شد',
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,16 +2,20 @@
|
|||||||
|
|
||||||
namespace App\Enums;
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use function Symfony\Component\String\s;
|
||||||
|
|
||||||
enum MissionViolationStatus: int
|
enum MissionViolationStatus: int
|
||||||
{
|
{
|
||||||
case BEDON_EGHDAM = 0;
|
case BEDON_EGHDAM = 0;
|
||||||
case EGHDAM_SHODE = 1;
|
case EGHDAM_SHODE = 1;
|
||||||
|
case SABT_SHODE = 2;
|
||||||
|
|
||||||
public function label(): string
|
public function label(): string
|
||||||
{
|
{
|
||||||
return match ($this) {
|
return match ($this) {
|
||||||
self::BEDON_EGHDAM => "بدون اقدام",
|
self::BEDON_EGHDAM => "بدون اقدام",
|
||||||
self::EGHDAM_SHODE => "اقدام شده",
|
self::EGHDAM_SHODE => "اقدام شده",
|
||||||
|
self::SABT_SHODE => "ثبت شده توسط حراست"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\Mission\Report\Machine;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
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\Exception;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||||
|
|
||||||
|
class machineDetailsReport implements FromView, ShouldAutoSize, WithDrawings, WithEvents
|
||||||
|
{
|
||||||
|
public function __construct(private array $data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$exportRows = [];
|
||||||
|
|
||||||
|
foreach ($this->data as $r) {
|
||||||
|
$exportRows[] = [
|
||||||
|
'id' => $r->id,
|
||||||
|
'province_name' => $r->province_name,
|
||||||
|
'city_name' => $r->city_name,
|
||||||
|
'station_name' => $r->station_name ?? 0,
|
||||||
|
'driver_name' => $r->driver_name ?? '',
|
||||||
|
'km' => $r->km ?? '',
|
||||||
|
'end_km' => $r->end_km ?? '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.Mission.Report.Machine.ActivityDetailsReport', [
|
||||||
|
'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(+90);
|
||||||
|
$drawing2->setOffsetY(5);
|
||||||
|
$drawing2->setCoordinates('E1');
|
||||||
|
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\Mission\Report\Machine;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
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\Exception;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||||
|
|
||||||
|
class machineDriverDetailsReport implements FromView, ShouldAutoSize, WithDrawings, WithEvents
|
||||||
|
{
|
||||||
|
public function __construct(private array $data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$exportRows = [];
|
||||||
|
|
||||||
|
foreach ($this->data as $r) {
|
||||||
|
$exportRows[] = [
|
||||||
|
'id' => $r->id,
|
||||||
|
'province_name' => $r->province_name,
|
||||||
|
'city_name' => $r->city_name,
|
||||||
|
'station_name' => $r->station_name ?? 0,
|
||||||
|
'driver_name' => $r->driver_name ?? '',
|
||||||
|
'km' => $r->km ?? '',
|
||||||
|
'end_km' => $r->end_km ?? '',
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.Mission.Report.Machine.MachineDriverDetailsReport', [
|
||||||
|
'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(+90);
|
||||||
|
$drawing2->setOffsetY(5);
|
||||||
|
$drawing2->setCoordinates('D1');
|
||||||
|
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\Mission\Report\Machine;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
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\Exception;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||||
|
|
||||||
|
class machineDriverReport implements FromView, ShouldAutoSize, WithDrawings, WithEvents
|
||||||
|
{
|
||||||
|
public function __construct(private array $data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$exportRows = [];
|
||||||
|
|
||||||
|
foreach ($this->data as $r) {
|
||||||
|
$exportRows[] = [
|
||||||
|
'driver_id' => $r->driver_id ?? '',
|
||||||
|
'driver_name' => $r->driver_name ?? '',
|
||||||
|
'missions' => $r->missions ?? 0,
|
||||||
|
'func' => (int) ($r->func ?? 0),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.Mission.Report.Machine.MachineDriverReport', [
|
||||||
|
'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(+90);
|
||||||
|
$drawing2->setOffsetY(5);
|
||||||
|
$drawing2->setCoordinates('D1');
|
||||||
|
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
75
app/Exports/V3/Mission/Report/Machine/machineReport.php
Normal file
75
app/Exports/V3/Mission/Report/Machine/machineReport.php
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\Mission\Report\Machine;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
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\Exception;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||||
|
|
||||||
|
class machineReport implements FromView, ShouldAutoSize, WithDrawings, WithEvents
|
||||||
|
{
|
||||||
|
public function __construct(private array $data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$exportRows = [];
|
||||||
|
|
||||||
|
foreach ($this->data as $r) {
|
||||||
|
$exportRows[] = [
|
||||||
|
'machine_id' => $r->machine_id ?? '',
|
||||||
|
'machine_code' => $r->machine_code ?? '',
|
||||||
|
'car_name' => $r->car_name ?? '',
|
||||||
|
'missions' => $r->missions ?? 0,
|
||||||
|
'func' => (int) ($r->func ?? 0),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.Mission.Report.Machine.ActivityReport', [
|
||||||
|
'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(+90);
|
||||||
|
$drawing2->setOffsetY(5);
|
||||||
|
$drawing2->setCoordinates('E1');
|
||||||
|
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\Mission\Report\Machine;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
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\Exception;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||||
|
|
||||||
|
class machineTypeDetailsReport implements FromView, ShouldAutoSize, WithDrawings, WithEvents
|
||||||
|
{
|
||||||
|
public function __construct(private array $data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$exportRows = [];
|
||||||
|
|
||||||
|
foreach ($this->data as $r) {
|
||||||
|
$exportRows[] = [
|
||||||
|
'id' => $r->id,
|
||||||
|
'province_name' => $r->province_name,
|
||||||
|
'city_name' => $r->city_name,
|
||||||
|
'station_name' => $r->station_name ?? 0,
|
||||||
|
'driver_name' => $r->driver_name ?? '',
|
||||||
|
'km' => $r->km ?? '',
|
||||||
|
'end_km' => $r->end_km ?? '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.Mission.Report.Machine.MachineTypeDetailsReport', [
|
||||||
|
'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(+90);
|
||||||
|
$drawing2->setOffsetY(5);
|
||||||
|
$drawing2->setCoordinates('C1');
|
||||||
|
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
73
app/Exports/V3/Mission/Report/Machine/machineTypeReport.php
Normal file
73
app/Exports/V3/Mission/Report/Machine/machineTypeReport.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\Mission\Report\Machine;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
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\Exception;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||||
|
|
||||||
|
class machineTypeReport implements FromView, ShouldAutoSize, WithDrawings, WithEvents
|
||||||
|
{
|
||||||
|
public function __construct(private array $data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$exportRows = [];
|
||||||
|
|
||||||
|
foreach ($this->data as $r) {
|
||||||
|
$exportRows[] = [
|
||||||
|
'car_type' => $r->car_type ?? '',
|
||||||
|
'missions' => $r->missions ?? 0,
|
||||||
|
'func' => (int) ($r->func ?? 0),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.Mission.Report.Machine.MachineTypeReport', [
|
||||||
|
'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(+90);
|
||||||
|
$drawing2->setOffsetY(5);
|
||||||
|
$drawing2->setCoordinates('C1');
|
||||||
|
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,9 +29,9 @@ class CountryReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
|
|||||||
$national = [
|
$national = [
|
||||||
'province_name' => $name,
|
'province_name' => $name,
|
||||||
'total' => (int) ($r->total ?? 0),
|
'total' => (int) ($r->total ?? 0),
|
||||||
'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
|
|
||||||
'gps' => (int) ($r->gps ?? 0),
|
'gps' => (int) ($r->gps ?? 0),
|
||||||
'durations' => (int) ($r->durations ?? 0),
|
'durations' => (int) ($r->durations ?? 0),
|
||||||
|
'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
|
||||||
'bafarayand_saeti' => (int) ($r->far_h ?? 0),
|
'bafarayand_saeti' => (int) ($r->far_h ?? 0),
|
||||||
'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
|
'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
|
||||||
'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
|
'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
|
||||||
@@ -50,9 +50,9 @@ class CountryReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
$grid[$pid]['total'] = (int) ($r->total ?? 0);
|
$grid[$pid]['total'] = (int) ($r->total ?? 0);
|
||||||
$grid[$pid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
|
|
||||||
$grid[$pid]['gps'] = (int) ($r->gps ?? 0);
|
$grid[$pid]['gps'] = (int) ($r->gps ?? 0);
|
||||||
$grid[$pid]['durations'] = (int) ($r->durations ?? 0);
|
$grid[$pid]['durations'] = (int) ($r->durations ?? 0);
|
||||||
|
$grid[$pid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
|
||||||
$grid[$pid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
|
$grid[$pid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
|
||||||
$grid[$pid]['bafarayand_rozaneh'] = (int) ($r->far_d ?? 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_saeti'] = (int) ($r->un_far_h ?? 0);
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithDrawings, WithEven
|
|||||||
$province = [
|
$province = [
|
||||||
'city_name' => $name,
|
'city_name' => $name,
|
||||||
'total' => (int) ($r->total ?? 0),
|
'total' => (int) ($r->total ?? 0),
|
||||||
'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
|
|
||||||
'gps' => (int) ($r->gps ?? 0),
|
'gps' => (int) ($r->gps ?? 0),
|
||||||
'durations' => (int) ($r->durations ?? 0),
|
'durations' => (int) ($r->durations ?? 0),
|
||||||
|
'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
|
||||||
'bafarayand_saeti' => (int) ($r->far_h ?? 0),
|
'bafarayand_saeti' => (int) ($r->far_h ?? 0),
|
||||||
'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
|
'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
|
||||||
'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
|
'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
|
||||||
@@ -51,9 +51,9 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithDrawings, WithEven
|
|||||||
}
|
}
|
||||||
|
|
||||||
$grid[$cid]['total'] = (int) ($r->total ?? 0);
|
$grid[$cid]['total'] = (int) ($r->total ?? 0);
|
||||||
$grid[$cid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
|
|
||||||
$grid[$cid]['gps'] = (int) ($r->gps ?? 0);
|
$grid[$cid]['gps'] = (int) ($r->gps ?? 0);
|
||||||
$grid[$cid]['durations'] = (int) ($r->durations ?? 0);
|
$grid[$cid]['durations'] = (int) ($r->durations ?? 0);
|
||||||
|
$grid[$cid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
|
||||||
$grid[$cid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
|
$grid[$cid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
|
||||||
$grid[$cid]['bafarayand_rozaneh'] = (int) ($r->far_d ?? 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_saeti'] = (int) ($r->un_far_h ?? 0);
|
||||||
|
|||||||
@@ -12,28 +12,28 @@ class SmsClass
|
|||||||
{
|
{
|
||||||
public function sendSms($mobile, $msg)
|
public function sendSms($mobile, $msg)
|
||||||
{
|
{
|
||||||
if (App::environment('production')) {
|
// if (App::environment('production')) {
|
||||||
|
//
|
||||||
|
//
|
||||||
$client = new SoapClient("http://172.30.5.36/webservice/sms.asmx?WSDL");
|
// $client = new SoapClient("http://172.30.5.36/webservice/sms.asmx?WSDL");
|
||||||
$date = date('d-m-y h:i:s');
|
// $date = date('d-m-y h:i:s');
|
||||||
$date = str_replace(" ", "T", $date);
|
// $date = str_replace(" ", "T", $date);
|
||||||
$result = $client->Send(
|
// $result = $client->Send(
|
||||||
array(
|
// array(
|
||||||
'Username' => 'admin',
|
// 'Username' => 'admin',
|
||||||
'Password' => 'admin141',
|
// 'Password' => 'admin141',
|
||||||
'ShortCode' => '1000141',
|
// 'ShortCode' => '1000141',
|
||||||
'Cellphones' => $mobile,
|
// 'Cellphones' => $mobile,
|
||||||
'Message' => $msg,
|
// 'Message' => $msg,
|
||||||
'Farsi' => true,
|
// 'Farsi' => true,
|
||||||
// 'SendDate' => $date
|
// // 'SendDate' => $date
|
||||||
// 'uTopic' => false,
|
// // 'uTopic' => false,
|
||||||
// 'uFlash' => false
|
// // 'uFlash' => false
|
||||||
)
|
// )
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
return $result->SendResult;
|
// return $result->SendResult;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
// $client = new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
// $client = new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
||||||
|
|||||||
@@ -609,25 +609,25 @@ class ContractSubItemsController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sms_sender($mobile, $msg)
|
// public function sms_sender($mobile, $msg)
|
||||||
{
|
// {
|
||||||
$client=new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
// $client=new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
||||||
$result=$client->doSendSMS(
|
// $result=$client->doSendSMS(
|
||||||
array(
|
// array(
|
||||||
'uUsername' => 'rmto',
|
// 'uUsername' => 'rmto',
|
||||||
'uPassword' => 'Rahdari8
|
// 'uPassword' => 'Rahdari8
|
||||||
',
|
// ',
|
||||||
'uNumber' => '1000141',
|
// 'uNumber' => '1000141',
|
||||||
'uCellphones' => $mobile,
|
// 'uCellphones' => $mobile,
|
||||||
'uMessage' => $msg,
|
// 'uMessage' => $msg,
|
||||||
'uFarsi' => true,
|
// 'uFarsi' => true,
|
||||||
'uTopic' => false,
|
// 'uTopic' => false,
|
||||||
'uFlash' => false
|
// 'uFlash' => false
|
||||||
)
|
// )
|
||||||
);
|
// );
|
||||||
$x = $result->doSendSMSResult;
|
// $x = $result->doSendSMSResult;
|
||||||
return $x;
|
// return $x;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public function get_way_id_from_nominatim($lat, $lng)
|
public function get_way_id_from_nominatim($lat, $lng)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -434,6 +434,7 @@ class UserController extends Controller
|
|||||||
|
|
||||||
$user->password = Hash::make($request->password);
|
$user->password = Hash::make($request->password);
|
||||||
$user->national_code = $request->national_code;
|
$user->national_code = $request->national_code;
|
||||||
|
$user->station_id = $request->station_id;
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
if (auth()->user()) {
|
if (auth()->user()) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\V3;
|
|||||||
|
|
||||||
use App\Facades\DataTable\DataTableFacade;
|
use App\Facades\DataTable\DataTableFacade;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Requests\V3\CMMSMachine\UpdateRequest;
|
||||||
use App\Http\Traits\ApiResponse;
|
use App\Http\Traits\ApiResponse;
|
||||||
use App\Models\CMMSMachine;
|
use App\Models\CMMSMachine;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
@@ -22,7 +23,8 @@ class CMMSMachinesController extends Controller
|
|||||||
$request,
|
$request,
|
||||||
allowedFilters: ['*'],
|
allowedFilters: ['*'],
|
||||||
allowedSortings: ['*'],
|
allowedSortings: ['*'],
|
||||||
allowedSelects: ['machine_code', 'id', 'plak_number', 'car_name', 'car_type', 'status'],
|
allowedSelects: ['machine_code', 'id', 'plak_number', 'car_name', 'car_type', 'status',
|
||||||
|
'province_id', 'city_id', 'station_id', 'status','driver_name'],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,4 +50,16 @@ class CMMSMachinesController extends Controller
|
|||||||
->distinct()
|
->distinct()
|
||||||
->pluck('car_type');
|
->pluck('car_type');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function update(UpdateRequest $request , CMMSMachine $machine): JsonResponse
|
||||||
|
{
|
||||||
|
$machine->update([
|
||||||
|
'status' => $request->status,
|
||||||
|
'province_id' => $request->province_id,
|
||||||
|
'city_id' => $request->city_id,
|
||||||
|
'station_id' => $request->station_id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $this->successResponse();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
19
app/Http/Controllers/V3/CityController.php
Normal file
19
app/Http/Controllers/V3/CityController.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\V3;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Traits\ApiResponse;
|
||||||
|
use App\Models\City;
|
||||||
|
use App\Models\Province;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class CityController extends Controller
|
||||||
|
{
|
||||||
|
use ApiResponse;
|
||||||
|
|
||||||
|
public function list(Request $request)
|
||||||
|
{
|
||||||
|
return $this->successResponse(City::query()->where('cities.province_id', $request->query('province_id'))->get(['id', 'name_fa']));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
||||||
|
|
||||||
|
use App\Enums\CmmsMachineStatus;
|
||||||
use App\Enums\FMSResultCode;
|
use App\Enums\FMSResultCode;
|
||||||
use App\Enums\MissionStates;
|
use App\Enums\MissionStates;
|
||||||
use App\Events\V3\Dashboard\Mission\SendDataToFMSEvent;
|
use App\Events\V3\Dashboard\Mission\SendDataToFMSEvent;
|
||||||
@@ -33,16 +34,19 @@ class ControlUnitController extends Controller
|
|||||||
public function start(StartRequest $request, Mission $mission): JsonResponse
|
public function start(StartRequest $request, Mission $mission): JsonResponse
|
||||||
{
|
{
|
||||||
DB::transaction(function () use ($mission, $request) {
|
DB::transaction(function () use ($mission, $request) {
|
||||||
$mission->histories()->create([
|
// $mission->histories()->create([
|
||||||
'user_id' => auth()->user()->id,
|
// 'user_id' => auth()->user()->id,
|
||||||
'previous_state_id' => $mission->state_id,
|
// 'previous_state_id' => $mission->state_id,
|
||||||
'previous_state_name' => $mission->state_name,
|
// 'previous_state_name' => $mission->state_name,
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
$mission->machine()->update([
|
||||||
|
'status' => CmmsMachineStatus::DAR_MAMORIAT->value
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$state = MissionStates::START_MISSION->value;
|
|
||||||
$mission->update([
|
$mission->update([
|
||||||
'state_id' => $state,
|
'state_id' => MissionStates::START_MISSION->value,
|
||||||
'state_name' => MissionStates::name($state),
|
'state_name' => MissionStates::START_MISSION->label(),
|
||||||
'start_time' => $request->time,
|
'start_time' => $request->time,
|
||||||
'km' => $request->km,
|
'km' => $request->km,
|
||||||
]);
|
]);
|
||||||
@@ -57,38 +61,38 @@ class ControlUnitController extends Controller
|
|||||||
public function finish(FinishRequest $request, Mission $mission, GetErrorRateService $getErrorRateService): JsonResponse
|
public function finish(FinishRequest $request, Mission $mission, GetErrorRateService $getErrorRateService): JsonResponse
|
||||||
{
|
{
|
||||||
DB::transaction(function () use ($mission, $getErrorRateService, $request) {
|
DB::transaction(function () use ($mission, $getErrorRateService, $request) {
|
||||||
$mission->histories()->create([
|
// $mission->histories()->create([
|
||||||
'user_id' => auth()->user()->id,
|
// 'user_id' => auth()->user()->id,
|
||||||
'previous_state_id' => $mission->state_id,
|
// 'previous_state_id' => $mission->state_id,
|
||||||
'previous_state_name' => $mission->state_name,
|
// 'previous_state_name' => $mission->state_name,
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
$mission->machine()->update([
|
||||||
|
'status' => CmmsMachineStatus::AMADE->value
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$state = MissionStates::END_MISSION->value;
|
// $getErrorRateService->setInputParameters($mission);
|
||||||
|
// $responseData = $getErrorRateService->run();
|
||||||
|
|
||||||
$mission->update([
|
$mission->update([
|
||||||
'state_id' => $state,
|
// 'in_area_duration' => $responseData['timeInAreaSeconds'],
|
||||||
'state_name' => MissionStates::name($state),
|
// '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']),
|
||||||
|
'state_id' => MissionStates::END_MISSION->value,
|
||||||
|
'state_name' => MissionStates::END_MISSION->label(),
|
||||||
'finish_time' => $request->time,
|
'finish_time' => $request->time,
|
||||||
'mission_duration' => strtotime($request->time) - strtotime($mission->start_time),
|
'mission_duration' => strtotime($request->time) - strtotime($mission->start_time),
|
||||||
]);
|
'end_km' => $request->end_km,
|
||||||
|
|
||||||
$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) {
|
// if ($mission->category_id == 2) {
|
||||||
$rpc = new OperatorController;
|
// $rpc = new OperatorController;
|
||||||
$rpc->store($mission);
|
// $rpc->store($mission);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// SendDataToFMSEvent::dispatch($mission);
|
// SendDataToFMSEvent::dispatch($mission);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,134 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\V3\Dashboard\Mission\Report;
|
||||||
|
|
||||||
|
use App\Exports\V3\Mission\Report\Machine\machineDetailsReport;
|
||||||
|
use App\Exports\V3\Mission\Report\Machine\machineDriverDetailsReport;
|
||||||
|
use App\Exports\V3\Mission\Report\Machine\machineDriverReport;
|
||||||
|
use App\Exports\V3\Mission\Report\Machine\machineReport;
|
||||||
|
use App\Exports\V3\Mission\Report\Machine\machineTypeDetailsReport;
|
||||||
|
use App\Exports\V3\Mission\Report\Machine\machineTypeReport;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Traits\ApiResponse;
|
||||||
|
use App\Services\Cartables\Mission\Report\ReportMachineService;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Exception;
|
||||||
|
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||||
|
|
||||||
|
class ReportMachineController extends Controller
|
||||||
|
{
|
||||||
|
use ApiResponse;
|
||||||
|
|
||||||
|
public function machineDetailsReport(Request $request, ReportMachineService $reportMachineService,int $machine_id): JsonResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->machineDetailActivity($request,$machine_id);
|
||||||
|
|
||||||
|
return response()->json($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
|
*/
|
||||||
|
public function machineDetailsReportExcel(Request $request, int $machine_id, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->machineDetailActivity($request,$machine_id);
|
||||||
|
$name = 'گزارش عملکرد ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||||
|
|
||||||
|
return Excel::download(new machineDetailsReport($data['data']), $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function machinesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||||
|
{
|
||||||
|
return response()->json($reportMachineService->machinesActivity($request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function machinesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->machinesActivity($request);
|
||||||
|
$name = 'گزارش ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||||
|
|
||||||
|
return Excel::download(new machineReport($data), $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function machineTypeDetailsReport(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->machineTypeDetailActivity($request);
|
||||||
|
|
||||||
|
return response()->json($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
|
*/
|
||||||
|
public function machineTypeDetailsReportExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->machineTypeDetailActivity($request);
|
||||||
|
$name = 'گزارش عملکردیک نوع ماشین'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||||
|
|
||||||
|
return Excel::download(new machineTypeDetailsReport($data['data']), $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function machineTypesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||||
|
{
|
||||||
|
return response()->json($reportMachineService->machineTypesActivity($request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
|
*/
|
||||||
|
public function machineTypesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->machineTypesActivity($request);
|
||||||
|
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||||
|
|
||||||
|
return Excel::download(new machineTypeReport($data), $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function machineDriverDetailsReport(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->machineDriverDetailActivity($request);
|
||||||
|
|
||||||
|
return response()->json($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
|
*/
|
||||||
|
public function machineDriverDetailsReportExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->machineDriverDetailActivity($request);
|
||||||
|
$name = 'گزارش عملکرد راننده'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||||
|
|
||||||
|
return Excel::download(
|
||||||
|
new machineDriverDetailsReport($data['data']), $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function machineDriversActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||||
|
{
|
||||||
|
return response()->json($reportMachineService->machineDriversActivity($request));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
|
*/
|
||||||
|
public function machineDriversActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->machineDriversActivity($request);
|
||||||
|
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||||
|
|
||||||
|
return Excel::download(new machineDriverReport($data), $name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,13 +2,15 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
||||||
|
|
||||||
use App\Enums\FMSResultCode;
|
|
||||||
use App\Enums\MissionCategory;
|
use App\Enums\MissionCategory;
|
||||||
use App\Enums\MissionStates;
|
use App\Enums\MissionStates;
|
||||||
use App\Enums\MissionTypes;
|
use App\Enums\MissionTypes;
|
||||||
|
use App\Enums\MissionViolationStatus;
|
||||||
use App\Enums\MissionZones;
|
use App\Enums\MissionZones;
|
||||||
|
use App\Facades\DataTable\DataTableFacade;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\V3\Dashboard\RoadPatrol\OperatorController;
|
use App\Http\Requests\V3\Mission\RequestPortal\ChangeStateRequest;
|
||||||
|
use App\Http\Requests\V3\Mission\RequestPortal\ClarifyUnauthorizedExitRequest;
|
||||||
use App\Http\Requests\V3\Mission\RequestPortal\ContinueMissionRequest;
|
use App\Http\Requests\V3\Mission\RequestPortal\ContinueMissionRequest;
|
||||||
use App\Http\Requests\V3\Mission\RequestPortal\NoProcessRequest;
|
use App\Http\Requests\V3\Mission\RequestPortal\NoProcessRequest;
|
||||||
use App\Http\Requests\V3\Mission\RequestPortal\StoreRequest;
|
use App\Http\Requests\V3\Mission\RequestPortal\StoreRequest;
|
||||||
@@ -16,8 +18,9 @@ use App\Http\Requests\V3\Mission\RequestPortal\UpdateRequest;
|
|||||||
use App\Http\Traits\ApiResponse;
|
use App\Http\Traits\ApiResponse;
|
||||||
use App\Models\CMMSMachine;
|
use App\Models\CMMSMachine;
|
||||||
use App\Models\Mission;
|
use App\Models\Mission;
|
||||||
|
use App\Models\MissionViolation;
|
||||||
|
use App\Models\Rahdaran;
|
||||||
use App\Models\RahdariPoint;
|
use App\Models\RahdariPoint;
|
||||||
use App\Models\RoadObserved;
|
|
||||||
use App\Services\Cartables\Mission\RequestPortalService;
|
use App\Services\Cartables\Mission\RequestPortalService;
|
||||||
use App\Services\FMS\GetErrorRateService;
|
use App\Services\FMS\GetErrorRateService;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
@@ -35,6 +38,21 @@ class RequestPortalController extends Controller
|
|||||||
return response()->json($requestPortalService->datatable($request));
|
return response()->json($requestPortalService->datatable($request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function violations(Request $request): array
|
||||||
|
{
|
||||||
|
$query = MissionViolation::query()->where([
|
||||||
|
['status', '=', MissionViolationStatus::BEDON_EGHDAM->value],
|
||||||
|
['station_id', '=', auth()->user()->station_id]
|
||||||
|
]);
|
||||||
|
|
||||||
|
return DataTableFacade::run(
|
||||||
|
$query,
|
||||||
|
$request,
|
||||||
|
allowedFilters: ['*'],
|
||||||
|
allowedSortings: ['*'],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws Throwable
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
@@ -43,10 +61,9 @@ class RequestPortalController extends Controller
|
|||||||
DB::transaction(function () use ($request) {
|
DB::transaction(function () use ($request) {
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
$state = MissionStates::REQUEST_CREATED->value;
|
|
||||||
$category = $request->category_id;
|
|
||||||
|
|
||||||
$mission = Mission::query()->create([
|
$mission = Mission::query()->create([
|
||||||
|
'item_id' => $request->item_id,
|
||||||
|
'sub_item_id' => $request->sub_item_id,
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'username' => $user->username,
|
'username' => $user->username,
|
||||||
'province_id' => $user->province_id,
|
'province_id' => $user->province_id,
|
||||||
@@ -55,8 +72,8 @@ class RequestPortalController extends Controller
|
|||||||
'city_name' => $user->city_fa ?? null,
|
'city_name' => $user->city_fa ?? null,
|
||||||
'edare_shahri_id' => $user->edarate_shahri_id ?? null,
|
'edare_shahri_id' => $user->edarate_shahri_id ?? null,
|
||||||
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
||||||
'state_id' => $state,
|
'state_id' => MissionStates::REQUEST_CREATED->value,
|
||||||
'state_name' => MissionStates::name($state),
|
'state_name' => MissionStates::REQUEST_CREATED->label(),
|
||||||
'requested_machines' => json_encode($request->requested_machines),
|
'requested_machines' => json_encode($request->requested_machines),
|
||||||
'type' => $request->type,
|
'type' => $request->type,
|
||||||
'type_fa' => MissionTypes::name($request->type),
|
'type_fa' => MissionTypes::name($request->type),
|
||||||
@@ -65,15 +82,14 @@ class RequestPortalController extends Controller
|
|||||||
'start_date' => $request->start_date,
|
'start_date' => $request->start_date,
|
||||||
'end_date' => $request->end_date,
|
'end_date' => $request->end_date,
|
||||||
'request_date' => now(),
|
'request_date' => now(),
|
||||||
'description' => $request->description,
|
|
||||||
'end_point' => $request->end_point,
|
'end_point' => $request->end_point,
|
||||||
'area' => json_encode($request->area),
|
'encoded_route' => $request->encoded_route,
|
||||||
'category_id' => $category,
|
'category_id' => $request->category_id,
|
||||||
'category_name' => MissionCategory::name($category),
|
'category_name' => MissionCategory::name($request->category_id),
|
||||||
'explanation' => $request->explanation,
|
'explanation' => $request->explanation,
|
||||||
'code' => rand(100000, 999999),
|
'code' => rand(100000, 999999),
|
||||||
'station_id' => $user->station_id,
|
'station_id' => $user->station_id,
|
||||||
'station_name' => RahdariPoint::query()->find( $user->station_id)->name,
|
'station_name' => RahdariPoint::query()->find($user->station_id)->name,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$mission->rahdaran()->sync($request->rahdaran);
|
$mission->rahdaran()->sync($request->rahdaran);
|
||||||
@@ -95,22 +111,20 @@ class RequestPortalController extends Controller
|
|||||||
DB::transaction(function () use ($request, $mission, $getErrorRateService) {
|
DB::transaction(function () use ($request, $mission, $getErrorRateService) {
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
|
// $getErrorRateService->setInputParameters($mission);
|
||||||
|
// $responseData = $getErrorRateService->run();
|
||||||
|
|
||||||
$mission->update([
|
$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']),
|
||||||
'finish_time' => now(),
|
'finish_time' => now(),
|
||||||
'state_id' => MissionStates::END_MISSION->value,
|
'state_id' => MissionStates::END_MISSION->value,
|
||||||
'state_name' => MissionStates::name(MissionStates::END_MISSION->value),
|
'state_name' => MissionStates::name(MissionStates::END_MISSION->value),
|
||||||
]);
|
'end_km' => $request->end_km,
|
||||||
|
|
||||||
$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) {
|
// if ($mission->category_id == 2) {
|
||||||
@@ -118,11 +132,11 @@ class RequestPortalController extends Controller
|
|||||||
// $rpc->store($mission);
|
// $rpc->store($mission);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
$state = MissionStates::START_MISSION->value;
|
$machine = CMMSMachine::query()->find($request->machine_id, ['id', 'machine_code', 'car_type']);
|
||||||
$category = $request->category_id;
|
|
||||||
$machine = CMMSMachine::query()->find($request->machine_id);
|
|
||||||
|
|
||||||
$newMission = Mission::query()->create([
|
$newMission = Mission::query()->create([
|
||||||
|
'item_id' => $request->item_id,
|
||||||
|
'sub_item_id' => $request->sub_item_id,
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'username' => $user->username,
|
'username' => $user->username,
|
||||||
'province_id' => $user->province_id,
|
'province_id' => $user->province_id,
|
||||||
@@ -131,8 +145,8 @@ class RequestPortalController extends Controller
|
|||||||
'city_name' => $user->city_fa ?? null,
|
'city_name' => $user->city_fa ?? null,
|
||||||
'edare_shahri_id' => $user->edarate_shahri_id ?? null,
|
'edare_shahri_id' => $user->edarate_shahri_id ?? null,
|
||||||
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
||||||
'state_id' => $state,
|
'state_id' => MissionStates::START_MISSION->value,
|
||||||
'state_name' => MissionStates::name($state),
|
'state_name' => MissionStates::START_MISSION->label(),
|
||||||
'type' => $request->type,
|
'type' => $request->type,
|
||||||
'type_fa' => MissionTypes::name($request->type),
|
'type_fa' => MissionTypes::name($request->type),
|
||||||
'zone' => $request->zone,
|
'zone' => $request->zone,
|
||||||
@@ -140,21 +154,23 @@ class RequestPortalController extends Controller
|
|||||||
'start_date' => now(),
|
'start_date' => now(),
|
||||||
'end_date' => $request->end_date,
|
'end_date' => $request->end_date,
|
||||||
'request_date' => now(),
|
'request_date' => now(),
|
||||||
'description' => $request->description,
|
|
||||||
'end_point' => $request->end_point,
|
'end_point' => $request->end_point,
|
||||||
'area' => json_encode($request->area),
|
'encoded_route' => $request->encoded_route,
|
||||||
'category_id' => $category,
|
'category_id' => $request->category_id,
|
||||||
'category_name' => MissionCategory::name($category),
|
'category_name' => MissionCategory::name($request->category_id),
|
||||||
'explanation' => $request->explanation,
|
'explanation' => $request->explanation,
|
||||||
'start_time' => now(),
|
'start_time' => now(),
|
||||||
'machine_id' => $machine->id,
|
'machine_id' => $machine->id,
|
||||||
'machine_code' => $machine->machine_code,
|
'machine_code' => $machine->machine_code,
|
||||||
'station_id' => $user->station_id,
|
'station_id' => $user->station_id,
|
||||||
'station_name' => RahdariPoint::query()->find( $user->station_id)->name,
|
'station_name' => RahdariPoint::query()->find( $user->station_id)->name,
|
||||||
|
'driver_id' => $request->driver,
|
||||||
|
'driver_name' => Rahdaran::query()->find($request->driver)->name,
|
||||||
|
'km' => $request->end_km,
|
||||||
|
'requested_machines' => json_encode($machine->car_type),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$newMission->rahdaran()->sync($request->rahdaran);
|
$newMission->rahdaran()->sync($request->rahdaran);
|
||||||
$newMission->rahdaran()->attach($request->driver, ['is_driver' => true]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return $this->successResponse();
|
return $this->successResponse();
|
||||||
@@ -168,6 +184,8 @@ class RequestPortalController extends Controller
|
|||||||
DB::transaction(function () use ($mission, $request) {
|
DB::transaction(function () use ($mission, $request) {
|
||||||
$state = MissionStates::REQUEST_CREATED->value;
|
$state = MissionStates::REQUEST_CREATED->value;
|
||||||
$mission->update([
|
$mission->update([
|
||||||
|
'item_id' => $request->item_id,
|
||||||
|
'sub_item_id' => $request->sub_item_id,
|
||||||
'state_id' => $state,
|
'state_id' => $state,
|
||||||
'state_name' => MissionStates::name($state),
|
'state_name' => MissionStates::name($state),
|
||||||
'requested_machines' => json_encode($request->requested_machines),
|
'requested_machines' => json_encode($request->requested_machines),
|
||||||
@@ -177,9 +195,8 @@ class RequestPortalController extends Controller
|
|||||||
'zone_fa' => MissionZones::name($request->zone),
|
'zone_fa' => MissionZones::name($request->zone),
|
||||||
'start_date' => $request->start_date,
|
'start_date' => $request->start_date,
|
||||||
'end_date' => $request->end_date,
|
'end_date' => $request->end_date,
|
||||||
'description' => $request->description,
|
|
||||||
'end_point' => $request->end_point,
|
'end_point' => $request->end_point,
|
||||||
'area' => json_encode($request->area),
|
'encoded_route' => $request->encoded_route,
|
||||||
'category_id' => $request->category_id,
|
'category_id' => $request->category_id,
|
||||||
'category_name' => MissionCategory::name($request->category_id),
|
'category_name' => MissionCategory::name($request->category_id),
|
||||||
'explanation' => $request->explanation,
|
'explanation' => $request->explanation,
|
||||||
@@ -205,21 +222,33 @@ class RequestPortalController extends Controller
|
|||||||
return $this->successResponse();
|
return $this->successResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function changeState(ChangeStateRequest $request, Mission $mission): JsonResponse
|
||||||
|
{
|
||||||
|
$mission->update([
|
||||||
|
'state_id' => $request->state_id,
|
||||||
|
'state_name' => MissionStates::name($request->state_id),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $this->successResponse($mission);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws Throwable
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public function noProcess(NoProcessRequest $request, GetErrorRateService $getErrorRateService): JsonResponse
|
public function clarifyUnauthorizedExit(ClarifyUnauthorizedExitRequest $request, MissionViolation $violation): JsonResponse
|
||||||
{
|
{
|
||||||
DB::transaction(function () use ($request, $getErrorRateService) {
|
DB::transaction(function () use ($request, $violation) {
|
||||||
$start = Carbon::parse($request->start_date);
|
|
||||||
$end = Carbon::parse($request->end_date);
|
$start = Carbon::parse($violation->exit_time);
|
||||||
|
$end = Carbon::parse($violation->enter_time);
|
||||||
$type = $start->diffInMinutes($end) > 480 ? MissionTypes::NO_PROCESS_ROZANE->value : MissionTypes::NO_PROCESS_SAATY->value;
|
$type = $start->diffInMinutes($end) > 480 ? MissionTypes::NO_PROCESS_ROZANE->value : MissionTypes::NO_PROCESS_SAATY->value;
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
$zone = $request->zone;
|
$zone = $request->zone;
|
||||||
$state = MissionStates::END_MISSION->value;
|
$machine = CMMSMachine::query()->where('machine_code', '=', $violation->machine_code)->first(['id', 'machine_code', 'car_type']);
|
||||||
$machine = CMMSMachine::query()->where('machine_code', '=', $request->machine_code)->first(['id', 'machine_code']);
|
|
||||||
|
|
||||||
$mission = Mission::query()->create([
|
$mission = Mission::query()->create([
|
||||||
|
'item_id' => $request->item_id,
|
||||||
|
'sub_item_id' => $request->sub_item_id,
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'username' => $user->username,
|
'username' => $user->username,
|
||||||
'province_id' => $user->province_id,
|
'province_id' => $user->province_id,
|
||||||
@@ -230,40 +259,35 @@ class RequestPortalController extends Controller
|
|||||||
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
'edare_shahri_name' => $user->edarate_shahri_name ?? null,
|
||||||
'zone' => $zone,
|
'zone' => $zone,
|
||||||
'zone_fa' => MissionZones::name($zone),
|
'zone_fa' => MissionZones::name($zone),
|
||||||
|
'encoded_route' => $request->encoded_route,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'type_fa' => MissionTypes::name($type),
|
'type_fa' => MissionTypes::name($type),
|
||||||
'start_date' => $request->start_date,
|
'start_date' => $violation->exit_time,
|
||||||
'area' => json_encode($request->area),
|
'end_date' => $violation->enter_time,
|
||||||
'end_date' => $request->end_date,
|
|
||||||
'end_point' => $request->end_point,
|
'end_point' => $request->end_point,
|
||||||
'category_id' => $request->category_id,
|
'category_id' => $request->category_id,
|
||||||
'category_name' => MissionCategory::name($request->category_id),
|
'category_name' => MissionCategory::name($request->category_id),
|
||||||
'start_time' => $request->start_date,
|
'start_time' => $violation->exit_time,
|
||||||
'finish_time' => $request->end_date,
|
'finish_time' => $violation->enter_time,
|
||||||
'state_id' => $state,
|
'mission_duration' => strtotime($violation->enter_time) - strtotime($violation->exit_time),
|
||||||
'state_name' => MissionStates::name($state),
|
'state_id' => MissionStates::END_MISSION->value,
|
||||||
|
'state_name' => MissionStates::END_MISSION->label(),
|
||||||
'explanation' => $request->explanation,
|
'explanation' => $request->explanation,
|
||||||
'request_date' => now(),
|
'request_date' => now(),
|
||||||
'machine_id' => $machine->id,
|
'machine_id' => $machine->id,
|
||||||
'machine_code' => $machine->machine_code,
|
'machine_code' => $machine->machine_code,
|
||||||
|
'requested_machines' => json_encode($machine->car_type),
|
||||||
'station_id' => $user->station_id,
|
'station_id' => $user->station_id,
|
||||||
'station_name' => RahdariPoint::query()->find( $user->station_id)->name,
|
'station_name' => RahdariPoint::query()->find($user->station_id)->name,
|
||||||
|
'km' => $violation->km ?? null,
|
||||||
|
'end_km' => $violation->end_km ?? null,
|
||||||
|
'driver_id' => $request->driver,
|
||||||
|
'driver_name' => Rahdaran::query()->find($request->driver)->name,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$mission->rahdaran()->sync($request->rahdaran);
|
$mission->rahdaran()->sync($request->rahdaran);
|
||||||
$mission->rahdaran()->attach($request->driver, ['is_driver' => true]);
|
|
||||||
|
|
||||||
$getErrorRateService->setInputParameters($mission);
|
$violation->update(['status' => 1, 'mission_id' => $mission->id]);
|
||||||
$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) {
|
// if ($mission->category_id == 2) {
|
||||||
// $rpc = new OperatorController;
|
// $rpc = new OperatorController;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ use App\Http\Requests\V3\Mission\TransportaionUnit\DeallocateRequest;
|
|||||||
use App\Http\Traits\ApiResponse;
|
use App\Http\Traits\ApiResponse;
|
||||||
use App\Models\CMMSMachine;
|
use App\Models\CMMSMachine;
|
||||||
use App\Models\Mission;
|
use App\Models\Mission;
|
||||||
|
use App\Models\Rahdaran;
|
||||||
use App\Services\Cartables\Mission\TransportationUnitService;
|
use App\Services\Cartables\Mission\TransportationUnitService;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -31,13 +32,12 @@ class TransportationUnitController extends Controller
|
|||||||
public function allocate(AllocateRequest $request, Mission $mission): JsonResponse
|
public function allocate(AllocateRequest $request, Mission $mission): JsonResponse
|
||||||
{
|
{
|
||||||
DB::transaction(function () use ($request, $mission) {
|
DB::transaction(function () use ($request, $mission) {
|
||||||
$mission->rahdaran()->attach($request->driver, ['is_driver' => true]);
|
|
||||||
|
|
||||||
$mission->histories()->create([
|
// $mission->histories()->create([
|
||||||
'user_id' => auth()->user()->id,
|
// 'user_id' => auth()->user()->id,
|
||||||
'previous_state_id' => $mission->state_id,
|
// 'previous_state_id' => $mission->state_id,
|
||||||
'previous_state_name' => $mission->state_name,
|
// 'previous_state_name' => $mission->state_name,
|
||||||
]);
|
// ]);
|
||||||
|
|
||||||
$state = MissionStates::PENDING_CONFIRMATION->value;
|
$state = MissionStates::PENDING_CONFIRMATION->value;
|
||||||
$machine = CMMSMachine::query()->find($request->machine_id);
|
$machine = CMMSMachine::query()->find($request->machine_id);
|
||||||
@@ -47,6 +47,12 @@ class TransportationUnitController extends Controller
|
|||||||
'state_name' => MissionStates::name($state),
|
'state_name' => MissionStates::name($state),
|
||||||
'machine_id' => $machine->id,
|
'machine_id' => $machine->id,
|
||||||
'machine_code' => $machine->machine_code,
|
'machine_code' => $machine->machine_code,
|
||||||
|
'driver_id' => $request->driver,
|
||||||
|
'driver_name' => Rahdaran::query()->find($request->driver)->name,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$machine->update([
|
||||||
|
'status' => CmmsMachineStatus::RESERVE->value
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -59,23 +65,28 @@ class TransportationUnitController extends Controller
|
|||||||
public function deallocate(DeallocateRequest $request, Mission $mission): JsonResponse
|
public function deallocate(DeallocateRequest $request, Mission $mission): JsonResponse
|
||||||
{
|
{
|
||||||
DB::transaction(function () use ($request, $mission) {
|
DB::transaction(function () use ($request, $mission) {
|
||||||
$mission->rahdaran()->wherePivot('is_driver', '=', true)->detach();
|
|
||||||
|
|
||||||
$mission->histories()->create([
|
// $mission->histories()->create([
|
||||||
'user_id' => auth()->user()->id,
|
// 'user_id' => auth()->user()->id,
|
||||||
'previous_state_id' => $mission->state_id,
|
// 'previous_state_id' => $mission->state_id,
|
||||||
'previous_state_name' => $mission->state_name,
|
// 'previous_state_name' => $mission->state_name,
|
||||||
'user_description' => $request->description,
|
// 'user_description' => $request->description,
|
||||||
]);
|
// ]);
|
||||||
|
|
||||||
$state = MissionStates::REJECT_BY_TRANSPORTATION->value;
|
$state = MissionStates::REJECT_BY_TRANSPORTATION->value;
|
||||||
|
|
||||||
|
$mission->machine()->update([
|
||||||
|
'status' => CmmsMachineStatus::AMADE->value
|
||||||
|
]);
|
||||||
|
|
||||||
$mission->update([
|
$mission->update([
|
||||||
'state_id' => $state,
|
'state_id' => $state,
|
||||||
'state_name' => MissionStates::name($state),
|
'state_name' => MissionStates::name($state),
|
||||||
'description' => $request->description,
|
'description' => $request->description,
|
||||||
'machine_id' => null,
|
'machine_id' => null,
|
||||||
'machine_code' => null,
|
'machine_code' => null,
|
||||||
|
'driver_id' => null,
|
||||||
|
'driver_name' => null,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use App\Http\Traits\ApiResponse;
|
|||||||
use App\Models\CMMSMachine;
|
use App\Models\CMMSMachine;
|
||||||
use App\Models\Mission;
|
use App\Models\Mission;
|
||||||
use App\Models\MissionViolation;
|
use App\Models\MissionViolation;
|
||||||
|
use App\Models\Rahdaran;
|
||||||
use App\Models\RahdariPoint;
|
use App\Models\RahdariPoint;
|
||||||
use App\Services\Cartables\Mission\DailyMoveMachineService;
|
use App\Services\Cartables\Mission\DailyMoveMachineService;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
@@ -35,65 +36,6 @@ class ViolationManagementController extends Controller
|
|||||||
return response()->json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws Throwable
|
|
||||||
*/
|
|
||||||
public function noProcess(NoProcessRequest $request, MissionViolation $violation): JsonResponse
|
|
||||||
{
|
|
||||||
DB::transaction(function () use ($request, $violation) {
|
|
||||||
|
|
||||||
$start = Carbon::parse($request->start_date);
|
|
||||||
$end = Carbon::parse($request->end_date);
|
|
||||||
$type = $start->diffInMinutes($end) > 480 ? MissionTypes::NO_PROCESS_ROZANE->value : MissionTypes::NO_PROCESS_SAATY->value;
|
|
||||||
$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,//
|
|
||||||
'end_point' => $request->end_point,
|
|
||||||
'category_id' => $request->category_id,
|
|
||||||
'category_name' => MissionCategory::name($request->category_id),
|
|
||||||
'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,
|
|
||||||
'station_name' => RahdariPoint::query()->find( $user->station_id)->name,
|
|
||||||
'km' => $violation->km ?? null,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$mission->rahdaran()->sync($request->rahdaran);
|
|
||||||
$mission->rahdaran()->attach($request->driver, ['is_driver' => true]);
|
|
||||||
|
|
||||||
$violation->update(['status' => 1]);
|
|
||||||
|
|
||||||
// if ($mission->category_id == 2) {
|
|
||||||
// $rpc = new OperatorController;
|
|
||||||
// $rpc->store($mission);
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
|
|
||||||
return $this->successResponse();
|
|
||||||
}
|
|
||||||
public function store(StoreRequest $request): JsonResponse
|
public function store(StoreRequest $request): JsonResponse
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
@@ -102,7 +44,7 @@ class ViolationManagementController extends Controller
|
|||||||
'machine_id'=> CMMSMachine::query()->where('machine_code', '=', $request->machine_code)->value('id'),
|
'machine_id'=> CMMSMachine::query()->where('machine_code', '=', $request->machine_code)->value('id'),
|
||||||
'machine_code'=> $request->machine_code,
|
'machine_code'=> $request->machine_code,
|
||||||
'type'=> MissionViolationType::KHOROJ_BEDONE_MOGAVEZ->value,
|
'type'=> MissionViolationType::KHOROJ_BEDONE_MOGAVEZ->value,
|
||||||
'status' => MissionViolationStatus::BEDON_EGHDAM->value,
|
'status' => MissionViolationStatus::SABT_SHODE->value,
|
||||||
'request_date' => now(),
|
'request_date' => now(),
|
||||||
'km' => $request->km,
|
'km' => $request->km,
|
||||||
'gps' => 0,
|
'gps' => 0,
|
||||||
@@ -110,6 +52,9 @@ class ViolationManagementController extends Controller
|
|||||||
'province_name' => $user->province_fa,
|
'province_name' => $user->province_fa,
|
||||||
'city_id' => $user->city_id,
|
'city_id' => $user->city_id,
|
||||||
'city_name' => $user->city_fa,
|
'city_name' => $user->city_fa,
|
||||||
|
'station_id' => $user->station_id,
|
||||||
|
'station_name' => RahdariPoint::query()->find($user->station_id)->name,
|
||||||
|
'exit_time' => $request->exit_time,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->successResponse();
|
return $this->successResponse();
|
||||||
@@ -124,7 +69,8 @@ class ViolationManagementController extends Controller
|
|||||||
{
|
{
|
||||||
$violation->update([
|
$violation->update([
|
||||||
'enter_time' => $request->enter_time,
|
'enter_time' => $request->enter_time,
|
||||||
'exit_time' => $request->exit_time,
|
'status' => MissionViolationStatus::BEDON_EGHDAM->value,
|
||||||
|
'end_km' => $request->end_km,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->successResponse();
|
return $this->successResponse();
|
||||||
@@ -135,5 +81,4 @@ class ViolationManagementController extends Controller
|
|||||||
$violation->delete();
|
$violation->delete();
|
||||||
return $this->successResponse();
|
return $this->successResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,15 @@ class RoadMaintenanceStationController extends Controller
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function findByCity(Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$stations = RahdariPoint::query()
|
||||||
|
->where('city_id', $request->query('city_id'))
|
||||||
|
->get(['id', 'name']);
|
||||||
|
|
||||||
|
return $this->successResponse($stations);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -197,18 +197,67 @@ class NotificationController extends Controller
|
|||||||
'control' => 0,
|
'control' => 0,
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($user->hasPermissionTo('manage-transportation-unit')) {
|
if ($user->hasPermissionTo('manage-transportation-unit-station')) {
|
||||||
$missions['transportation'] = Mission::query()->where([
|
$missions['transportation'] = Mission::query()->where([
|
||||||
['state_id', '=', MissionStates::REQUEST_CREATED->value],
|
['state_id', '=', MissionStates::REQUEST_CREATED->value],
|
||||||
['edare_shahri_id', '=', $user->edarate_shahri_id],
|
['station_id', '=', $user->station_id],
|
||||||
])->count();
|
])->count();
|
||||||
}
|
}
|
||||||
if ($user->hasPermissionTo('manage-control-unit')) {
|
if ($user->hasPermissionTo('manage-transportation-unit-country')) {
|
||||||
$missions['control'] = Mission::query()->where([
|
$missions['transportation'] = Mission::query()->where([
|
||||||
['state_id', '=', MissionStates::PENDING_CONFIRMATION->value],
|
['state_id', '=', MissionStates::REQUEST_CREATED->value],
|
||||||
['edare_shahri_id', '=', $user->edarate_shahri_id],
|
|
||||||
])->count();
|
])->count();
|
||||||
}
|
}
|
||||||
|
if ($user->hasPermissionTo('manage-transportation-unit-province')) {
|
||||||
|
$missions['transportation'] = Mission::query()->where([
|
||||||
|
['state_id', '=', MissionStates::REQUEST_CREATED->value],
|
||||||
|
['province_id', '=', $user->province_id],
|
||||||
|
|
||||||
|
])->count();
|
||||||
|
}
|
||||||
|
if ($user->hasPermissionTo('manage-transportation-unit-city')) {
|
||||||
|
$missions['transportation'] = Mission::query()->where([
|
||||||
|
['state_id', '=', MissionStates::REQUEST_CREATED->value],
|
||||||
|
['city_id', '=', $user->city_id],
|
||||||
|
|
||||||
|
])->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($user->hasPermissionTo('manage-control-unit-station')) {
|
||||||
|
$missions['control'] = Mission::query()
|
||||||
|
->whereIn('state_id', [
|
||||||
|
MissionStates::PENDING_CONFIRMATION->value,
|
||||||
|
MissionStates::START_MISSION->value,
|
||||||
|
])
|
||||||
|
->where('station_id', $user->station_id)
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
if ($user->hasPermissionTo('manage-control-unit-country')) {
|
||||||
|
$missions['control'] = Mission::query()
|
||||||
|
->whereIn('state_id', [
|
||||||
|
MissionStates::PENDING_CONFIRMATION->value,
|
||||||
|
MissionStates::START_MISSION->value,
|
||||||
|
])->count();
|
||||||
|
}
|
||||||
|
if ($user->hasPermissionTo('manage-control-unit-province')) {
|
||||||
|
$missions['control'] = Mission::query()
|
||||||
|
->whereIn('state_id', [
|
||||||
|
MissionStates::PENDING_CONFIRMATION->value,
|
||||||
|
MissionStates::START_MISSION->value,
|
||||||
|
])
|
||||||
|
->where('province_id', '=', $user->province_id)
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
if ($user->hasPermissionTo('manage-control-unit-city')) {
|
||||||
|
$missions['control'] = Mission::query()
|
||||||
|
->whereIn('state_id', [
|
||||||
|
MissionStates::PENDING_CONFIRMATION->value,
|
||||||
|
MissionStates::START_MISSION->value,
|
||||||
|
])
|
||||||
|
->where('city_id', '=', $user->city_id
|
||||||
|
)->count();
|
||||||
|
}
|
||||||
|
|
||||||
$missions['total'] = $missions['request_portal'] + $missions['transportation'] + $missions['control'];
|
$missions['total'] = $missions['request_portal'] + $missions['transportation'] + $missions['control'];
|
||||||
|
|
||||||
|
|||||||
19
app/Http/Controllers/V3/ProvinceController.php
Normal file
19
app/Http/Controllers/V3/ProvinceController.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\V3;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Traits\ApiResponse;
|
||||||
|
use App\Models\City;
|
||||||
|
use App\Models\Province;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ProvinceController extends Controller
|
||||||
|
{
|
||||||
|
use ApiResponse;
|
||||||
|
|
||||||
|
public function list()
|
||||||
|
{
|
||||||
|
return $this->successResponse(Province::all(['id', 'name_fa']));
|
||||||
|
}
|
||||||
|
}
|
||||||
33
app/Http/Requests/V3/CMMSMachine/UpdateRequest.php
Normal file
33
app/Http/Requests/V3/CMMSMachine/UpdateRequest.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\V3\CMMSMachine;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
|
|
||||||
|
class UpdateRequest 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, ValidationRule|array|string>
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'status' => 'integer',
|
||||||
|
'province_id' => 'integer|exists:provinces,id',
|
||||||
|
'city_id' => 'integer|exists:cities,id',
|
||||||
|
'station_id' => 'integer|exists:rahdari_points,id',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,8 +3,10 @@
|
|||||||
namespace App\Http\Requests\V3\Mission\ControlUnit;
|
namespace App\Http\Requests\V3\Mission\ControlUnit;
|
||||||
|
|
||||||
use App\Enums\MissionStates;
|
use App\Enums\MissionStates;
|
||||||
|
use App\Models\CMMSMachine;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
class FinishRequest extends FormRequest
|
class FinishRequest extends FormRequest
|
||||||
{
|
{
|
||||||
@@ -13,7 +15,7 @@ class FinishRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function authorize(): bool
|
public function authorize(): bool
|
||||||
{
|
{
|
||||||
return $this->mission->state_id == MissionStates::START_MISSION->value;
|
return $this->mission->state_id === MissionStates::START_MISSION->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,6 +27,42 @@ class FinishRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'time' => 'required|date',
|
'time' => 'required|date',
|
||||||
|
'end_km' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function after(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
function (Validator $validator) {
|
||||||
|
|
||||||
|
$mission = $this->mission;
|
||||||
|
if (strtotime($this->time) < strtotime($mission->start_time)) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'time',
|
||||||
|
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->end_km <= $mission->km) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'end_km',
|
||||||
|
'کیلومتر پایان باید بزرگتر از کیلومتر شروع باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$machine = CMMSMachine::find($mission->machine_id);
|
||||||
|
|
||||||
|
$distance = $this->end_km - $mission->km;
|
||||||
|
|
||||||
|
if ($distance > $machine->max_mission_duration)
|
||||||
|
{
|
||||||
|
$validator->errors()->add(
|
||||||
|
'end_km',
|
||||||
|
'کیلومتر /ساعت کار از حد نصاب بیشتر هست.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\V3\Mission\RequestPortal;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
class ChangeStateRequest 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, ValidationRule|array|string>
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'state_id' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,17 +2,19 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\V3\Mission\RequestPortal;
|
namespace App\Http\Requests\V3\Mission\RequestPortal;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
class NoProcessRequest extends FormRequest
|
class ClarifyUnauthorizedExitRequest extends FormRequest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Determine if the user is authorized to make this request.
|
* Determine if the user is authorized to make this request.
|
||||||
*/
|
*/
|
||||||
public function authorize(): bool
|
public function authorize(): bool
|
||||||
{
|
{
|
||||||
return true;
|
return $this->violation->status === 0 && $this->violation->type === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,26 +25,16 @@ class NoProcessRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'item_id' => 'required|exists:info_items,item',
|
||||||
|
'sub_item_id' => 'required|exists:info_items,id',
|
||||||
'rahdaran' => 'array',
|
'rahdaran' => 'array',
|
||||||
'rahdaran.*' => 'exists:rahdaran,id',
|
'rahdaran.*' => 'exists:rahdaran,id',
|
||||||
'driver' => 'required|integer|exists:rahdaran,id',
|
'driver' => 'required|integer|exists:rahdaran,id',
|
||||||
'zone' => 'required|in:1,2,3',
|
'zone' => 'required|in:1,2,3',
|
||||||
'start_date' => 'required|date',
|
|
||||||
'end_date' => 'required|date|after:start_date|before:now',
|
|
||||||
'end_point' => 'required|string',
|
'end_point' => 'required|string',
|
||||||
'area' => 'array',
|
'encoded_route' => 'required|string',
|
||||||
'area.type' => 'string',
|
|
||||||
'area.coordinates' => 'array',
|
|
||||||
'category_id' => 'required|in:1,2,3',
|
'category_id' => 'required|in:1,2,3',
|
||||||
'explanation' => 'required|string',
|
'explanation' => 'required|string',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function messages(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'end_date.before' => 'تاریخ پایان باید قبل از زمان فعلی باشد.',
|
|
||||||
'end_date.after' => 'تاریخ پایان نباید قبل از تاریخ شروع باشد.',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,6 +26,8 @@ class ContinueMissionRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'item_id' => 'required|exists:info_items,item',
|
||||||
|
'sub_item_id' => 'required|exists:info_items,id',
|
||||||
'rahdaran' => 'array',
|
'rahdaran' => 'array',
|
||||||
'rahdaran.*' => 'exists:rahdaran,id',
|
'rahdaran.*' => 'exists:rahdaran,id',
|
||||||
'machine_id' => 'required|integer|exists:cmms_machines,id',
|
'machine_id' => 'required|integer|exists:cmms_machines,id',
|
||||||
@@ -33,14 +35,11 @@ class ContinueMissionRequest extends FormRequest
|
|||||||
'type' => 'required|in:1,2',
|
'type' => 'required|in:1,2',
|
||||||
'zone' => 'required|in:1,2,3',
|
'zone' => 'required|in:1,2,3',
|
||||||
'end_date' => 'required|date',
|
'end_date' => 'required|date',
|
||||||
'description' => 'string',
|
|
||||||
'end_point' => 'required|string',
|
'end_point' => 'required|string',
|
||||||
'area' => 'required|array',
|
'encoded_route' => 'required|string',
|
||||||
'area.type' => 'required|string',
|
|
||||||
'area.coordinates' => 'required|array',
|
|
||||||
'explanation' => 'required|string',
|
'explanation' => 'required|string',
|
||||||
'category_id' => 'required|in:1,2,3',
|
'category_id' => 'required|in:1,2,3',
|
||||||
'road_observed_id' => 'required_if:category_id,3|exists:road_observeds,id',
|
'end_km'=> 'required|string',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +58,18 @@ class ContinueMissionRequest extends FormRequest
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($this->end_km <= $this->mission->km) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'end_km',
|
||||||
|
'کیلومتر پایان باید بزرگتر از کیلومتر شروع باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (strtotime($this->end_date) < strtotime($this->mission->start_time)) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'time',
|
||||||
|
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ class StoreRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'item_id' => 'required|exists:info_items,item',
|
||||||
|
'sub_item_id' => 'required|exists:info_items,id',
|
||||||
'rahdaran' => 'array',
|
'rahdaran' => 'array',
|
||||||
'rahdaran.*' => 'exists:rahdaran,id',
|
'rahdaran.*' => 'exists:rahdaran,id',
|
||||||
'requested_machines' => 'required|array',
|
'requested_machines' => 'required|array',
|
||||||
@@ -32,14 +34,10 @@ class StoreRequest extends FormRequest
|
|||||||
'zone' => 'required|in:1,2,3',
|
'zone' => 'required|in:1,2,3',
|
||||||
'start_date' => 'required|date',
|
'start_date' => 'required|date',
|
||||||
'end_date' => 'required|date',
|
'end_date' => 'required|date',
|
||||||
'description' => 'string',
|
|
||||||
'end_point' => 'required|string',
|
'end_point' => 'required|string',
|
||||||
'area' => 'required|array',
|
'encoded_route' => 'required|string',
|
||||||
'area.type' => 'required|string',
|
|
||||||
'area.coordinates' => 'required|array',
|
|
||||||
'explanation' => 'required|string',
|
'explanation' => 'required|string',
|
||||||
'category_id' => 'required|in:1,2,3',
|
'category_id' => 'required|in:1,2,3',
|
||||||
'road_observed_id' => 'required_if:category_id,3|exists:road_observeds,id',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,6 +56,12 @@ class StoreRequest extends FormRequest
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (strtotime($this->end_date) < strtotime($this->start_date)) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'time',
|
||||||
|
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ class UpdateRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'item_id' => 'required|exists:info_items,item',
|
||||||
|
'sub_item_id' => 'required|exists:info_items,id',
|
||||||
'rahdaran' => 'array',
|
'rahdaran' => 'array',
|
||||||
'rahdaran.*' => 'exists:rahdaran,id',
|
'rahdaran.*' => 'exists:rahdaran,id',
|
||||||
'requested_machines' => 'required|array',
|
'requested_machines' => 'required|array',
|
||||||
@@ -33,14 +35,10 @@ class UpdateRequest extends FormRequest
|
|||||||
'zone' => 'required|in:1,2,3',
|
'zone' => 'required|in:1,2,3',
|
||||||
'start_date' => 'required|date',
|
'start_date' => 'required|date',
|
||||||
'end_date' => 'required|date',
|
'end_date' => 'required|date',
|
||||||
'description' => 'string',
|
|
||||||
'end_point' => 'required|string',
|
'end_point' => 'required|string',
|
||||||
'area' => 'required|array',
|
'encoded_route' => 'required|string',
|
||||||
'area.type' => 'required|string',
|
|
||||||
'area.coordinates' => 'required|array',
|
|
||||||
'explanation' => 'required|string',
|
'explanation' => 'required|string',
|
||||||
'category_id' => 'required|in:1,2,3',
|
'category_id' => 'required|in:1,2,3',
|
||||||
'road_observed_id' => 'required_if:category_id,3|exists:road_observeds,id',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +57,12 @@ class UpdateRequest extends FormRequest
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (strtotime($this->end_date) < strtotime($this->start_date)) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'time',
|
||||||
|
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ class AllocateRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function authorize(): bool
|
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->station_id == auth()->user()->station_id && $this->mission->state_id == MissionStates::REQUEST_CREATED->value)
|
||||||
|
|| auth()->user()->username === 'witel';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,8 +13,9 @@ class DeallocateRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function authorize(): bool
|
public function authorize(): bool
|
||||||
{
|
{
|
||||||
return $this->mission->edare_shahri_id == auth()->user()->edarate_shahri_id &&
|
return ($this->mission->station_id == auth()->user()->station_id &&
|
||||||
in_array($this->mission->state_id, [MissionStates::REQUEST_CREATED->value, MissionStates::PENDING_CONFIRMATION->value]);
|
in_array($this->mission->state_id, [MissionStates::REQUEST_CREATED->value, MissionStates::PENDING_CONFIRMATION->value]))
|
||||||
|
|| auth()->user()->username === 'witel';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\V3\Mission\Violation;
|
namespace App\Http\Requests\V3\Mission\Violation;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
class NoProcessRequest extends FormRequest
|
class NoProcessRequest extends FormRequest
|
||||||
{
|
{
|
||||||
@@ -27,22 +29,10 @@ class NoProcessRequest extends FormRequest
|
|||||||
'rahdaran.*' => 'exists:rahdaran,id',
|
'rahdaran.*' => 'exists:rahdaran,id',
|
||||||
'driver' => 'required|integer|exists:rahdaran,id',
|
'driver' => 'required|integer|exists:rahdaran,id',
|
||||||
'zone' => 'required|in:1,2,3',
|
'zone' => 'required|in:1,2,3',
|
||||||
'start_date' => 'required|date',
|
|
||||||
'end_date' => 'required|date|after:start_date|before:now',
|
|
||||||
'end_point' => 'required|string',
|
'end_point' => 'required|string',
|
||||||
'area' => 'array',
|
// 'encoded_route' => 'required|string',
|
||||||
'area.type' => 'string',
|
|
||||||
'area.coordinates' => 'array',
|
|
||||||
'category_id' => 'required|in:1,2,3',
|
'category_id' => 'required|in:1,2,3',
|
||||||
'explanation' => 'required|string',
|
'explanation' => 'required|string',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function messages(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'end_date.before' => 'تاریخ پایان باید قبل از زمان فعلی باشد.',
|
|
||||||
'end_date.after' => 'تاریخ پایان نباید قبل از تاریخ شروع باشد.',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ class StoreRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'machine_code' => 'required',
|
'exit_time' => 'required|date',
|
||||||
|
'machine_code' => 'required',
|
||||||
'km'=> 'string',
|
'km'=> 'string',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,28 @@ class UpdateRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'exit_time' => 'date',
|
'enter_time' => 'required|date',
|
||||||
'enter_time' => 'date',
|
'end_km'=> 'required|string',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function after(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
function (Validator $validator) {
|
||||||
|
if (strtotime($this->enter_time) < strtotime($this->violation->exit_time)) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'time',
|
||||||
|
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if ($this->end_km <= $this->violation->km) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'end_km',
|
||||||
|
'کیلومتر پایان باید بزرگتر از کیلومتر شروع باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class City extends Model
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
protected $guarded = ['id'];
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
'name_en',
|
'name_en',
|
||||||
'feature_id',
|
'feature_id',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Mission extends Model
|
|||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $guarded = [];
|
protected $guarded = ['id'];
|
||||||
protected $hidden = ['pivot'];
|
protected $hidden = ['pivot'];
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'start_time' => 'datetime',
|
'start_time' => 'datetime',
|
||||||
@@ -28,13 +28,6 @@ class Mission extends Model
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function area(): Attribute
|
|
||||||
{
|
|
||||||
return Attribute::make(
|
|
||||||
get: fn($value) => json_decode($value, true)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function histories(): HasMany
|
public function histories(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(MissionHistory::class);
|
return $this->hasMany(MissionHistory::class);
|
||||||
@@ -50,21 +43,6 @@ class Mission extends Model
|
|||||||
return $this->hasMany(RoadItemsProject::class);
|
return $this->hasMany(RoadItemsProject::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function roadObserveds(): MorphToMany
|
|
||||||
{
|
|
||||||
return $this->morphedByMany(RoadObserved::class, 'missionable');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function machines(): MorphToMany
|
|
||||||
{
|
|
||||||
return $this->morphToMany(CMMSMachine::class,
|
|
||||||
'machinable',
|
|
||||||
'machinables',
|
|
||||||
'machinable_id',
|
|
||||||
'machine_id'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function rahdaran(): MorphToMany
|
public function rahdaran(): MorphToMany
|
||||||
{
|
{
|
||||||
return $this->morphToMany(Rahdaran::class,
|
return $this->morphToMany(Rahdaran::class,
|
||||||
@@ -75,17 +53,6 @@ class Mission extends Model
|
|||||||
)->withPivot('is_driver');
|
)->withPivot('is_driver');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function roadObserved(): MorphToMany
|
|
||||||
{
|
|
||||||
return $this->morphedByMany(
|
|
||||||
RoadObserved::class,
|
|
||||||
'missionable',
|
|
||||||
'missionables',
|
|
||||||
'mission_id',
|
|
||||||
'missionable_id'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function machine(): BelongsTo
|
public function machine(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(CMMSMachine::class, 'machine_id');
|
return $this->belongsTo(CMMSMachine::class, 'machine_id');
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
|||||||
class MissionViolation extends Model
|
class MissionViolation extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
protected $guarded =[];
|
protected $guarded =['id'];
|
||||||
|
|
||||||
public function mission(): BelongsTo
|
public function mission(): BelongsTo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class Province extends Model
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
protected $guarded = ['id'];
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
'feature_id',
|
'feature_id',
|
||||||
//'center_lat',
|
//'center_lat',
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class ControlUnitService
|
|||||||
allowedSelects: [
|
allowedSelects: [
|
||||||
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
||||||
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
||||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa', 'start_time', 'finish_time',
|
'end_date', 'request_date', 'end_point', 'encoded_route', 'zone', 'zone_fa', 'start_time', 'finish_time',
|
||||||
'code', 'category_id', 'category_name', 'explanation', 'city_id', 'city_name', 'province_id', 'station_name',
|
'code', 'category_id', 'category_name', 'explanation', 'city_id', 'city_name', 'province_id', 'station_name',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Services\Cartables\Mission;
|
namespace App\Services\Cartables\Mission;
|
||||||
|
|
||||||
|
use App\Enums\MissionViolationStatus;
|
||||||
use App\Facades\DataTable\DataTableFacade;
|
use App\Facades\DataTable\DataTableFacade;
|
||||||
use App\Models\MissionViolation;
|
use App\Models\MissionViolation;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -13,7 +14,8 @@ class DailyMoveMachineService
|
|||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
|
|
||||||
$query = MissionViolation::query()->with('machine:id,car_name');
|
$query = MissionViolation::query()->with('machine:id,car_name')
|
||||||
|
->where('mission_violations.status', '=', MissionViolationStatus::SABT_SHODE->value);
|
||||||
|
|
||||||
if ($user->hasPermissionTo('manage-violation-station')) {
|
if ($user->hasPermissionTo('manage-violation-station')) {
|
||||||
$query->whereRelation('machine', 'station_id', '=', $user->station_id);
|
$query->whereRelation('machine', 'station_id', '=', $user->station_id);
|
||||||
|
|||||||
132
app/Services/Cartables/Mission/Report/ReportMachineService.php
Normal file
132
app/Services/Cartables/Mission/Report/ReportMachineService.php
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\Cartables\Mission\Report;
|
||||||
|
|
||||||
|
use App\Facades\DataTable\DataTableFacade;
|
||||||
|
use App\Models\CMMSMachine;
|
||||||
|
use App\Models\Mission;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ReportMachineService
|
||||||
|
{
|
||||||
|
public function machineDetailActivity(Request $request, int $machine_id): array
|
||||||
|
{
|
||||||
|
return DataTableFacade::run(
|
||||||
|
Mission::query()->where('machine_id', '=', $machine_id),
|
||||||
|
$request,
|
||||||
|
allowedFilters: ['*'],
|
||||||
|
allowedSortings: ['*'],
|
||||||
|
allowedSelects: [
|
||||||
|
'id', 'province_id', 'province_name', 'city_id', 'city_name',
|
||||||
|
'end_km', 'km', 'driver_name', 'state_id', 'station_name'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function machinesActivity(Request $request): array
|
||||||
|
{
|
||||||
|
$query = Mission::query()
|
||||||
|
->join('cmms_machines as cm', 'cm.id', '=', 'missions.machine_id')
|
||||||
|
->where('state_id', '=', 4)
|
||||||
|
->when($request->province_id, function ($q) use ($request) {
|
||||||
|
$q->where('missions.province_id', '=', $request->province_id);
|
||||||
|
})
|
||||||
|
->selectRaw(
|
||||||
|
'cm.car_name,
|
||||||
|
missions.machine_code,
|
||||||
|
missions.machine_id,
|
||||||
|
COUNT(*) as missions,
|
||||||
|
SUM(missions.end_km - missions.km) as func'
|
||||||
|
)
|
||||||
|
->groupBy('missions.machine_id');
|
||||||
|
|
||||||
|
$fields = ['machine_code','machine_id','cm.car_name','missions', 'func', 'start_time', 'finish_time', 'province_id'];
|
||||||
|
return DataTableFacade::run(
|
||||||
|
$query,
|
||||||
|
$request,
|
||||||
|
allowedFilters: $fields,
|
||||||
|
allowedSortings: $fields,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function machineTypeDetailActivity(Request $request): array
|
||||||
|
{
|
||||||
|
$machineIds = CMMSMachine::query()->where('car_type', '=', $request->query('car_type'))->pluck('id');
|
||||||
|
return DataTableFacade::run(
|
||||||
|
Mission::query()->whereIn('machine_id', $machineIds),
|
||||||
|
$request,
|
||||||
|
allowedFilters: ['*'],
|
||||||
|
allowedSortings: ['*'],
|
||||||
|
allowedSelects: [
|
||||||
|
'id', 'province_id', 'province_name', 'city_id', 'city_name',
|
||||||
|
'end_km', 'km', 'driver_name', 'state_name', 'station_name'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function machineTypesActivity(Request $request): array
|
||||||
|
{
|
||||||
|
$query = Mission::query()
|
||||||
|
->join('cmms_machines as cm', 'cm.id', '=', 'missions.machine_id')
|
||||||
|
->where('missions.state_id','=', 4)
|
||||||
|
->when($request->province_id, function ($q) use ($request) {
|
||||||
|
$q->where('missions.province_id', $request->province_id);
|
||||||
|
})
|
||||||
|
->selectRaw(
|
||||||
|
'cm.car_type,
|
||||||
|
COUNT(*) as missions,
|
||||||
|
SUM(missions.end_km - missions.km) as func'
|
||||||
|
)
|
||||||
|
->groupBy('cm.car_type')
|
||||||
|
->orderByRaw('COUNT(*) DESC');
|
||||||
|
|
||||||
|
$fields = ['car_type','missions', 'func', 'start_time', 'finish_time', 'province_id'];
|
||||||
|
|
||||||
|
return DataTableFacade::run(
|
||||||
|
$query,
|
||||||
|
$request,
|
||||||
|
allowedFilters: $fields,
|
||||||
|
allowedSortings: $fields,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function machineDriverDetailActivity(Request $request): array
|
||||||
|
{
|
||||||
|
return DataTableFacade::run(
|
||||||
|
Mission::query()->where('driver_id', '=', $request->query('driver_id')),
|
||||||
|
$request,
|
||||||
|
allowedFilters: ['*'],
|
||||||
|
allowedSortings: ['*'],
|
||||||
|
allowedSelects: [
|
||||||
|
'id', 'province_id', 'province_name', 'city_id', 'city_name',
|
||||||
|
'end_km', 'km', 'driver_name', 'state_id', 'station_name'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function machineDriversActivity(Request $request): array
|
||||||
|
{
|
||||||
|
$query = Mission::query()
|
||||||
|
->selectRaw(
|
||||||
|
'driver_id,
|
||||||
|
driver_name,
|
||||||
|
COUNT(*) as missions,
|
||||||
|
SUM(end_km - km) as func'
|
||||||
|
)
|
||||||
|
->where('state_id', '=', 4)
|
||||||
|
->when($request->province_id, function ($query) use ($request) {
|
||||||
|
$query->where('province_id', '=', $request->province_id);
|
||||||
|
})
|
||||||
|
->groupBy('driver_id')
|
||||||
|
->orderByRaw('COUNT(*) DESC');
|
||||||
|
|
||||||
|
$fields = ['driver_id','driver_name','missions', 'func', 'start_time', 'finish_time', 'province_id'];
|
||||||
|
|
||||||
|
return DataTableFacade::run(
|
||||||
|
$query,
|
||||||
|
$request,
|
||||||
|
allowedFilters: $fields,
|
||||||
|
allowedSortings: $fields,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ class ReportTradodService
|
|||||||
public function countryActivity(Request $request): array
|
public function countryActivity(Request $request): array
|
||||||
{
|
{
|
||||||
$from = $request->from_date ?? today()->startOfDay();
|
$from = $request->from_date ?? today()->startOfDay();
|
||||||
$to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay();
|
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT*
|
SELECT*
|
||||||
@@ -37,8 +37,8 @@ class ReportTradodService
|
|||||||
-1 AS province_id,
|
-1 AS province_id,
|
||||||
COUNT(m.id) AS total,
|
COUNT(m.id) AS total,
|
||||||
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
||||||
SEC_TO_TIME(COALESCE(SUM(m.in_area_duration), 0)) AS gps,
|
COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps,
|
||||||
SEC_TO_TIME(COALESCE(SUM(m.mission_duration), 0)) AS durations,
|
COALESCE(SUM(m.mission_duration)/3600, 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 = 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 = 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 = 3 THEN 1 ELSE 0 END), 0) AS un_far_h,
|
||||||
@@ -56,8 +56,8 @@ class ReportTradodService
|
|||||||
p.id AS province_id,
|
p.id AS province_id,
|
||||||
COUNT(m.id) AS total,
|
COUNT(m.id) AS total,
|
||||||
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
||||||
SEC_TO_TIME(COALESCE(SUM(m.in_area_duration), 0)) AS gps,
|
COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps,
|
||||||
SEC_TO_TIME(COALESCE(SUM(m.mission_duration), 0)) AS durations,
|
COALESCE(SUM(m.mission_duration)/3600, 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 = 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 = 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 = 3 THEN 1 ELSE 0 END), 0) AS un_far_h,
|
||||||
@@ -88,7 +88,7 @@ class ReportTradodService
|
|||||||
{
|
{
|
||||||
$provinceId = $request->province_id ?? auth()->user()->province_id;
|
$provinceId = $request->province_id ?? auth()->user()->province_id;
|
||||||
$from = $request->from_date ?? today()->startOfDay();
|
$from = $request->from_date ?? today()->startOfDay();
|
||||||
$to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay();
|
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT*
|
SELECT*
|
||||||
@@ -98,8 +98,8 @@ class ReportTradodService
|
|||||||
-1 AS city_id,
|
-1 AS city_id,
|
||||||
COUNT(m.id) AS total,
|
COUNT(m.id) AS total,
|
||||||
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
||||||
SEC_TO_TIME(COALESCE(SUM(m.in_area_duration), 0)) AS gps,
|
COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps,
|
||||||
SEC_TO_TIME(COALESCE(SUM(m.mission_duration), 0)) AS durations,
|
COALESCE(SUM(m.mission_duration)/3600, 0) AS durations,
|
||||||
COALESCE(SUM(m.type = 1), 0) AS far_h,
|
COALESCE(SUM(m.type = 1), 0) AS far_h,
|
||||||
COALESCE(SUM(m.type = 2), 0) AS far_d,
|
COALESCE(SUM(m.type = 2), 0) AS far_d,
|
||||||
COALESCE(SUM(m.type = 3), 0) AS un_far_h,
|
COALESCE(SUM(m.type = 3), 0) AS un_far_h,
|
||||||
@@ -118,8 +118,8 @@ class ReportTradodService
|
|||||||
c.id AS city_id,
|
c.id AS city_id,
|
||||||
COUNT(m.id) AS total,
|
COUNT(m.id) AS total,
|
||||||
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
||||||
SEC_TO_TIME(COALESCE(SUM(m.in_area_duration), 0)) AS gps,
|
COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps,
|
||||||
SEC_TO_TIME(COALESCE(SUM(m.mission_duration), 0)) AS durations,
|
COALESCE(SUM(m.mission_duration)/3600, 0) AS durations,
|
||||||
COALESCE(SUM(m.type = 1), 0) AS far_h,
|
COALESCE(SUM(m.type = 1), 0) AS far_h,
|
||||||
COALESCE(SUM(m.type = 2), 0) AS far_d,
|
COALESCE(SUM(m.type = 2), 0) AS far_d,
|
||||||
COALESCE(SUM(m.type = 3), 0) AS un_far_h,
|
COALESCE(SUM(m.type = 3), 0) AS un_far_h,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class ReportViolationService
|
|||||||
public function countryActivity(Request $request): array
|
public function countryActivity(Request $request): array
|
||||||
{
|
{
|
||||||
$from = $request->from_date ?? today()->startOfDay();
|
$from = $request->from_date ?? today()->startOfDay();
|
||||||
$to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay();
|
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT*
|
SELECT*
|
||||||
@@ -81,7 +81,7 @@ class ReportViolationService
|
|||||||
{
|
{
|
||||||
$provinceId = $request->province_id ?? auth()->user()->province_id;
|
$provinceId = $request->province_id ?? auth()->user()->province_id;
|
||||||
$from = $request->from_date ?? today()->startOfDay();
|
$from = $request->from_date ?? today()->startOfDay();
|
||||||
$to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay();
|
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT*
|
SELECT*
|
||||||
|
|||||||
@@ -32,8 +32,9 @@ class RequestPortalService
|
|||||||
allowedSelects: [
|
allowedSelects: [
|
||||||
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
||||||
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
||||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa', 'start_time', 'finish_time',
|
'end_date', 'request_date', 'end_point', 'encoded_route', 'zone', 'zone_fa', 'start_time', 'finish_time',
|
||||||
'code', 'category_id', 'category_name', 'explanation', 'city_id', 'city_name', 'province_id', 'station_name',
|
'code', 'category_id', 'category_name', 'explanation', 'city_id', 'city_name', 'province_id', 'station_name',
|
||||||
|
'driver_id', 'driver_name', 'machine_id', 'item_id', 'sub_item_id'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class TransportationUnitService
|
|||||||
allowedSelects: [
|
allowedSelects: [
|
||||||
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
'id', 'user_id', 'username', 'state_name', 'province_name', 'edare_shahri_name',
|
||||||
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
||||||
'end_date', 'request_date', 'end_point', 'area', 'zone', 'zone_fa', 'start_time', 'finish_time',
|
'end_date', 'request_date', 'end_point', 'encoded_route', 'zone', 'zone_fa', 'start_time', 'finish_time',
|
||||||
'code', 'category_id', 'category_name', 'explanation', 'km', 'city_id', 'city_name', 'province_id', 'station_name',
|
'code', 'category_id', 'category_name', 'explanation', 'km', 'city_id', 'city_name', 'province_id', 'station_name',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class PaymentService
|
|||||||
);
|
);
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, "http://payment.rmto.ir/acc/rest/payid/gen");
|
curl_setopt($ch, CURLOPT_URL, "https://payment.rmto.ir/acc/rest/payid/gen");
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
|
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
|
||||||
@@ -59,7 +59,7 @@ class PaymentService
|
|||||||
);
|
);
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, "http://payment.rmto.ir/acc/rest/payid/track2/" . env("PAYMENT_USERNAME") . "/" . env("PAYMENT_PASSWORD") . "/" . $bill_code);
|
curl_setopt($ch, CURLOPT_URL, "https://payment.rmto.ir/acc/rest/payid/track2/" . env("PAYMENT_USERNAME") . "/" . env("PAYMENT_PASSWORD") . "/" . $bill_code);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
// curl_setopt($ch, CURLOPT_POST, true);
|
// curl_setopt($ch, CURLOPT_POST, true);
|
||||||
// curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
|
// curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
|
||||||
|
|||||||
88
app/Services/PolylineEncoder.php
Normal file
88
app/Services/PolylineEncoder.php
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class PolylineEncoder
|
||||||
|
*
|
||||||
|
* Encodes a list of latitude/longitude coordinates into an encoded polyline string.
|
||||||
|
*
|
||||||
|
* This implementation is compatible with Google's Polyline Algorithm Format:
|
||||||
|
* https://developers.google.com/maps/documentation/utilities/polylinealgorithm
|
||||||
|
*
|
||||||
|
* Example input:
|
||||||
|
* [
|
||||||
|
* [lat, lng],
|
||||||
|
* [lat, lng]
|
||||||
|
* ]
|
||||||
|
*
|
||||||
|
* or if `$lng_lat_format = true`:
|
||||||
|
* [
|
||||||
|
* [lng, lat],
|
||||||
|
* [lng, lat]
|
||||||
|
* ]
|
||||||
|
*
|
||||||
|
* @package App\Services
|
||||||
|
*/
|
||||||
|
class PolylineEncoder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Encode an array of coordinates into a polyline string.
|
||||||
|
*
|
||||||
|
* Each coordinate is encoded as a delta from the previous point,
|
||||||
|
* scaled by the given precision factor.
|
||||||
|
*
|
||||||
|
* @param array $coords Array of coordinate pairs:
|
||||||
|
* - default: [lat, lng]
|
||||||
|
* - if $lng_lat_format = true: [lng, lat]
|
||||||
|
* @param int $precision Number of decimal places to preserve (default: 6)
|
||||||
|
* @param bool $lng_lat_format If true, input is treated as [lng, lat] instead of [lat, lng]
|
||||||
|
*
|
||||||
|
* @return string Encoded polyline string
|
||||||
|
*/
|
||||||
|
public function encodePolyline(array $coords, int $precision = 6, bool $lng_lat_format = false): string
|
||||||
|
{
|
||||||
|
$factor = 10 ** $precision;
|
||||||
|
$output = '';
|
||||||
|
$prevLat = 0;
|
||||||
|
$prevLng = 0;
|
||||||
|
|
||||||
|
foreach ($coords as [$a, $b]) {
|
||||||
|
[$lat, $lng] = $lng_lat_format ? [$b, $a] : [$a, $b];
|
||||||
|
|
||||||
|
$output .= $this->encodeValue((int)round($lat * $factor) - $prevLat);
|
||||||
|
$output .= $this->encodeValue((int)round($lng * $factor) - $prevLng);
|
||||||
|
|
||||||
|
$prevLat = (int)round($lat * $factor);
|
||||||
|
$prevLng = (int)round($lng * $factor);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encodes a single integer value using Google's polyline encoding algorithm.
|
||||||
|
*
|
||||||
|
* Steps:
|
||||||
|
* - Left shift the value
|
||||||
|
* - Invert bits if negative
|
||||||
|
* - Split into 5-bit chunks
|
||||||
|
* - Convert to ASCII characters
|
||||||
|
*
|
||||||
|
* @param int $value Signed integer delta to encode
|
||||||
|
*
|
||||||
|
* @return string Encoded character sequence
|
||||||
|
*/
|
||||||
|
public function encodeValue(int $value): string
|
||||||
|
{
|
||||||
|
$value = $value < 0 ? ~($value << 1) : ($value << 1);
|
||||||
|
$result = '';
|
||||||
|
|
||||||
|
while ($value >= 0x20) {
|
||||||
|
$result .= chr((0x20 | ($value & 0x1f)) + 63);
|
||||||
|
$value >>= 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result . chr($value + 63);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,7 +24,7 @@ return new class extends Migration
|
|||||||
$table->unsignedBigInteger('edare_shahri_id')->nullable();
|
$table->unsignedBigInteger('edare_shahri_id')->nullable();
|
||||||
$table->foreign('edare_shahri_id')->references('id')->on('edarate_shahri')->noActionOnDelete();
|
$table->foreign('edare_shahri_id')->references('id')->on('edarate_shahri')->noActionOnDelete();
|
||||||
$table->string('edare_shahri_name')->nullable();
|
$table->string('edare_shahri_name')->nullable();
|
||||||
$table->json('requested_machines');
|
$table->json('requested_machines')->nullable();
|
||||||
$table->string('type');
|
$table->string('type');
|
||||||
$table->dateTime('start_date');
|
$table->dateTime('start_date');
|
||||||
$table->dateTime('end_date');
|
$table->dateTime('end_date');
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ return new class extends Migration
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('missions', function (Blueprint $table) {
|
Schema::table('missions', function (Blueprint $table) {
|
||||||
$table->json('area');
|
$table->json('area')->nullable();
|
||||||
$table->integer('zone');
|
$table->integer('zone');
|
||||||
$table->string('zone_fa');
|
$table->string('zone_fa');
|
||||||
$table->string('type_fa');
|
$table->string('type_fa');
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?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->string('end_km')->nullable();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('missions', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('end_km');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?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->integer('driver_id')->nullable();
|
||||||
|
$table->string('driver_name')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('missions', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('driver_name','driver_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?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->unsignedInteger('station_id')->nullable();
|
||||||
|
$table->string('station_name')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('mission_violations', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['station_id', 'station_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('missions', function (Blueprint $table) {
|
||||||
|
$table->longText('encoded_route')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('missions', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('encoded_route');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -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->string('end_km')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('mission_violations', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('end_km');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?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->unsignedInteger('item_id')->nullable();
|
||||||
|
$table->unsignedInteger('sub_item_id')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('missions', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('item_id', 'sub_item_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -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->integer('max_mission_duration')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('cmms_machines', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('max_mission_duration');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -61,9 +61,6 @@ function errorHandler(error) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.error("Error trace object");
|
|
||||||
console.log("Error object:");
|
|
||||||
console.log(error);
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
icon: "error",
|
icon: "error",
|
||||||
title: "خطا",
|
title: "خطا",
|
||||||
@@ -417,6 +414,43 @@ function getCityByProvince(province_id, dom_id, selected_id = 0) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getTollhouseByCity(city_id, dom_id, selected_id = 0) {$.ajax({
|
||||||
|
url: `/api/v3/road_maintenance_station/search_by_city?city_id=${city_id}`,
|
||||||
|
type: "GET",
|
||||||
|
async: false,
|
||||||
|
beforeSend: function () {
|
||||||
|
$(`#${dom_id}`).empty();
|
||||||
|
showLoaderScreen()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
$(`#${dom_id}`).append('<option value="0"></option>');
|
||||||
|
cities = result.data;
|
||||||
|
|
||||||
|
for (let index = 0; index < cities.length; index++) {
|
||||||
|
|
||||||
|
$(`#${dom_id}`).append(
|
||||||
|
`<option value=${cities[index].id}>${cities[index].name}</option>`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selected_id == null) {
|
||||||
|
disableDOM(dom_id);
|
||||||
|
} else if (selected_id != 0) {
|
||||||
|
enableDOM(dom_id);
|
||||||
|
$(`#${dom_id} option[value="${selected_id}"]`).attr("selected", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
hideLoaderScreen();
|
||||||
|
},
|
||||||
|
error: function (error) {
|
||||||
|
errorHandler(error);
|
||||||
|
hideLoaderScreen();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function getCityOfficeByCity(city_id, dom_id, selected_id = 0) {
|
function getCityOfficeByCity(city_id, dom_id, selected_id = 0) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/public/contents/edarateShahri/" + city_id,
|
url: "/public/contents/edarateShahri/" + city_id,
|
||||||
@@ -923,7 +957,6 @@ $(document).on('click', '#report_btn', function () {
|
|||||||
var tr = $(this).closest("tr");
|
var tr = $(this).closest("tr");
|
||||||
var row = table.row(tr);
|
var row = table.row(tr);
|
||||||
$("#report_modal").modal('show');
|
$("#report_modal").modal('show');
|
||||||
console.log(row.data().id);
|
|
||||||
$("#selected_user_for_report").val(row.data().id);
|
$("#selected_user_for_report").val(row.data().id);
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -1003,7 +1036,6 @@ $(document).on('click', '#activity_report', function () {
|
|||||||
showLoaderScreen()
|
showLoaderScreen()
|
||||||
},
|
},
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
console.log(result);
|
|
||||||
|
|
||||||
$("#activity_time").text(result.activity_time);
|
$("#activity_time").text(result.activity_time);
|
||||||
$("#average_activity_time").text(result.average_activity_time);
|
$("#average_activity_time").text(result.average_activity_time);
|
||||||
@@ -1042,9 +1074,6 @@ $(document).on('click', '.permission-control', function () {
|
|||||||
modal.find('.permission-label').removeClass('text-muted')
|
modal.find('.permission-label').removeClass('text-muted')
|
||||||
modal.find('.all-permission-by-type').prop('checked', false)
|
modal.find('.all-permission-by-type').prop('checked', false)
|
||||||
modal.find('#user_id').val(row.data().id)
|
modal.find('#user_id').val(row.data().id)
|
||||||
|
|
||||||
console.log(row.data().province_id);
|
|
||||||
console.log(row.data().edarate_shahri_id);
|
|
||||||
modal.find('.permission-input').each((index, element) => {
|
modal.find('.permission-input').each((index, element) => {
|
||||||
if ($(element).data('needProvince') == 1) {
|
if ($(element).data('needProvince') == 1) {
|
||||||
if (row.data().province_id == null) {
|
if (row.data().province_id == null) {
|
||||||
@@ -1625,7 +1654,6 @@ $("table").on("click", "tbody tr", function () {
|
|||||||
|
|
||||||
|
|
||||||
$('#user_data_table').on('change', ".user-finder-all", function () {
|
$('#user_data_table').on('change', ".user-finder-all", function () {
|
||||||
console.log(checkedItemsId);
|
|
||||||
|
|
||||||
var thiz = $(this);
|
var thiz = $(this);
|
||||||
if (thiz.is(':checked')) {
|
if (thiz.is(':checked')) {
|
||||||
@@ -1642,7 +1670,6 @@ $('#user_data_table').on('change', ".user-finder-all", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#user_data_table').on('change', ".user-finder", function () {
|
$('#user_data_table').on('change', ".user-finder", function () {
|
||||||
console.log(checkedItemsId);
|
|
||||||
|
|
||||||
const checkedItemId = $(this).data("idUser");
|
const checkedItemId = $(this).data("idUser");
|
||||||
|
|
||||||
@@ -2104,7 +2131,6 @@ $("#edit_province_office").change(function () {
|
|||||||
|
|
||||||
|
|
||||||
$("#edit_city_office").change(function () {
|
$("#edit_city_office").change(function () {
|
||||||
console.log("this is ok");
|
|
||||||
setUserName("edit");
|
setUserName("edit");
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -2386,6 +2412,19 @@ $("#add_province_office").change(function () {
|
|||||||
setUserName();
|
setUserName();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$("#add_simple_city").change(function () {
|
||||||
|
|
||||||
|
if ($("#add_simple_city").val() == -1) {
|
||||||
|
|
||||||
|
disableDOM("add_simple_tollhouse")
|
||||||
|
$("#add_simple_tollhouse").empty();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
enableDOM("add_simple_tollhouse")
|
||||||
|
getTollhouseByCity($("#add_simple_city").val(), "add_simple_tollhouse")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// $("#edit_city").change(function () {
|
// $("#edit_city").change(function () {
|
||||||
|
|
||||||
// if ($(this).val() == 0) {
|
// if ($(this).val() == 0) {
|
||||||
@@ -2396,15 +2435,6 @@ $("#add_province_office").change(function () {
|
|||||||
// setUserName("edit");
|
// setUserName("edit");
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// $("#add_simple_city").change(function () {
|
|
||||||
|
|
||||||
// if ($(this).val() == 0) {
|
|
||||||
// $("#add_simple_city_office").empty();
|
|
||||||
// } else {
|
|
||||||
// getCityOfficeByCity($(this).val(), "add_simple_city_office")
|
|
||||||
// }
|
|
||||||
// setUserName();
|
|
||||||
// })
|
|
||||||
|
|
||||||
// $("#add_city").change(function () {
|
// $("#add_city").change(function () {
|
||||||
|
|
||||||
@@ -2581,6 +2611,9 @@ $('#add_simple_user_show_modal').on('click', function () {
|
|||||||
enableDOM("add_simple_city")
|
enableDOM("add_simple_city")
|
||||||
$("#add_simple_city").empty();
|
$("#add_simple_city").empty();
|
||||||
$("#add_simple_city").append('<option value="0" selected disabled>ابتدا استان را انتخاب کنید</option>');
|
$("#add_simple_city").append('<option value="0" selected disabled>ابتدا استان را انتخاب کنید</option>');
|
||||||
|
enableDOM("add_simple_tollhouse")
|
||||||
|
$("#add_simple_tollhouse").empty();
|
||||||
|
$("#add_simple_tollhouse").append('<option value="0" selected disabled>ابتدا شهر را انتخاب کنید</option>');
|
||||||
enableDOM("add_simple_city_office")
|
enableDOM("add_simple_city_office")
|
||||||
$("#add_simple_city_office").empty();
|
$("#add_simple_city_office").empty();
|
||||||
$("#add_simple_city_office").append('<option value="0" selected disabled></option>');
|
$("#add_simple_city_office").append('<option value="0" selected disabled></option>');
|
||||||
@@ -2594,8 +2627,10 @@ $("#add_simple_province").change(function () {
|
|||||||
|
|
||||||
disableDOM("add_simple_city")
|
disableDOM("add_simple_city")
|
||||||
disableDOM("add_simple_city_office")
|
disableDOM("add_simple_city_office")
|
||||||
|
disableDOM("add_simple_tollhouse")
|
||||||
$("#add_simple_city").empty();
|
$("#add_simple_city").empty();
|
||||||
$("#add_simple_city_office").empty();
|
$("#add_simple_city_office").empty();
|
||||||
|
$("#add_simple_tollhouse").empty();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ($("#add_simple_province_office").val() == 0) {
|
if ($("#add_simple_province_office").val() == 0) {
|
||||||
@@ -2622,8 +2657,10 @@ $("#add_simple_province_office").change(function () {
|
|||||||
|
|
||||||
disableDOM("add_simple_city")
|
disableDOM("add_simple_city")
|
||||||
disableDOM("add_simple_city_office")
|
disableDOM("add_simple_city_office")
|
||||||
|
disableDOM("add_simple_tollhouse")
|
||||||
$("#add_simple_city").empty();
|
$("#add_simple_city").empty();
|
||||||
$("#add_simple_city_office").empty();
|
$("#add_simple_city_office").empty();
|
||||||
|
$("#add_simple_tollhouse").empty();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ($("#add_simple_province").val() == 0 || $("#add_simple_province").val() == -1) {
|
if ($("#add_simple_province").val() == 0 || $("#add_simple_province").val() == -1) {
|
||||||
@@ -2657,6 +2694,7 @@ $("#add_simple_submit_form").on("click", function () {
|
|||||||
var edarate_shahri_id = $("#add_simple_city_office").children("option:selected").val();
|
var edarate_shahri_id = $("#add_simple_city_office").children("option:selected").val();
|
||||||
var national_code = $("#add_simple_national_code").val();
|
var national_code = $("#add_simple_national_code").val();
|
||||||
var city_id = $("#add_simple_city").children("option:selected").val();
|
var city_id = $("#add_simple_city").children("option:selected").val();
|
||||||
|
var tollhouse_id = $("#add_simple_tollhouse").children("option:selected").val();
|
||||||
|
|
||||||
|
|
||||||
if (edarate_ostani_id <= 0 && edarate_shahri_id <= 0) {
|
if (edarate_ostani_id <= 0 && edarate_shahri_id <= 0) {
|
||||||
@@ -2695,6 +2733,12 @@ $("#add_simple_submit_form").on("click", function () {
|
|||||||
} else {
|
} else {
|
||||||
$("#add_simple_city").removeClass("validity-checker");
|
$("#add_simple_city").removeClass("validity-checker");
|
||||||
}
|
}
|
||||||
|
if (tollhouse_id == 0) {
|
||||||
|
$("#add_simple_tollhouse").addClass("validity-checker");
|
||||||
|
form_validation_status = false;
|
||||||
|
} else {
|
||||||
|
$("#add_simple_tollhouse").removeClass("validity-checker");
|
||||||
|
}
|
||||||
|
|
||||||
if (province_id < 0) {
|
if (province_id < 0) {
|
||||||
$("#add_simple_province").addClass("validity-checker");
|
$("#add_simple_province").addClass("validity-checker");
|
||||||
@@ -2734,6 +2778,10 @@ $("#add_simple_submit_form").on("click", function () {
|
|||||||
formData.append("city_id", city_id);
|
formData.append("city_id", city_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tollhouse_id != undefined) {
|
||||||
|
formData.append("station_id", tollhouse_id);
|
||||||
|
}
|
||||||
|
|
||||||
formData.append("password_confirmation", repass);
|
formData.append("password_confirmation", repass);
|
||||||
if (edarate_ostani_id != 0) {
|
if (edarate_ostani_id != 0) {
|
||||||
formData.append("edarate_ostani_id", edarate_ostani_id);
|
formData.append("edarate_ostani_id", edarate_ostani_id);
|
||||||
|
|||||||
@@ -125,11 +125,13 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(".letter-body").find("#accident_date").text(moment(jsonServer.data.accident_date).format(
|
$(".letter-body").find("#accident_date").text(moment(jsonServer.data.accident_date).format(
|
||||||
"jYYYY/jMM/jDD"));
|
"jYYYY/jMM/jDD"));
|
||||||
const plaque = jsonServer.data.plaque.split("-");
|
const plaque = jsonServer?.data?.plaque?.split("-");
|
||||||
$("#plaque1").text(plaque[0]);
|
if (plaque) {
|
||||||
$("#plaque2").text(plaque[1]);
|
$("#plaque1").text(plaque[0]);
|
||||||
$("#plaque3").text(plaque[2]);
|
$("#plaque2").text(plaque[1]);
|
||||||
$("#plaque4").text(plaque[3]);
|
$("#plaque3").text(plaque[2]);
|
||||||
|
$("#plaque4").text(plaque[3]);
|
||||||
|
}
|
||||||
let row_counter;
|
let row_counter;
|
||||||
let i;
|
let i;
|
||||||
for (i = 0; i < damages.length; i++) {
|
for (i = 0; i < damages.length; i++) {
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<!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;">
|
||||||
|
@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
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="7"
|
||||||
|
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="7"
|
||||||
|
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="7"
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach ($rows as $item)
|
||||||
|
<tr>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['id'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['city_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['station_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['driver_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['km'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['end_km'] ?? '-' }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<!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;">
|
||||||
|
@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
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="5"
|
||||||
|
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="5"
|
||||||
|
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="5"
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach ($rows as $item)
|
||||||
|
<tr>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['machine_id'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['car_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['machine_code'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['func'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['missions'] ?? '-' }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<!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;">
|
||||||
|
@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
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="7"
|
||||||
|
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="7"
|
||||||
|
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="7"
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach ($rows as $item)
|
||||||
|
<tr>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['id'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['city_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['station_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['driver_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['km'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['end_km'] ?? '-' }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
<!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;">
|
||||||
|
@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
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="4"
|
||||||
|
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="4"
|
||||||
|
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="4"
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach ($rows as $item)
|
||||||
|
<tr>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['driver_id'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['driver_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['func'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['missions'] ?? '-' }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<!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;">
|
||||||
|
@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
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="7"
|
||||||
|
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="7"
|
||||||
|
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="7"
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach ($rows as $item)
|
||||||
|
<tr>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['id'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['city_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['station_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['driver_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['km'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['end_km'] ?? '-' }}</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;">
|
||||||
|
@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
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="3"
|
||||||
|
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="3"
|
||||||
|
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="3"
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach ($rows as $item)
|
||||||
|
<tr>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['car_type'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['func'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['missions'] ?? '-' }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -93,9 +93,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['total'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['total'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['khareg_mahdode'] ?? '-' }}</td>
|
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['gps'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['gps'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['durations'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['durations'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['khareg_mahdode'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_saeti'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_saeti'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_rozaneh'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_rozaneh'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bedon_bafarayand_saeti'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bedon_bafarayand_saeti'] ?? '-' }}</td>
|
||||||
|
|||||||
@@ -93,9 +93,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['city_name'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['city_name'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['total'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['total'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['khareg_mahdode'] ?? '-' }}</td>
|
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['gps'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['gps'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['durations'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['durations'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['khareg_mahdode'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_saeti'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_saeti'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_rozaneh'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_rozaneh'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bedon_bafarayand_saeti'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bedon_bafarayand_saeti'] ?? '-' }}</td>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<button id="add_patrol" class="positive-cta float-left my-2" disabled>ثبت گشت</button>
|
<button id="add_patrol" class="positive-cta float-left my-2" disabled>ثبت گشت</button>
|
||||||
<!-- all modals -->
|
<!-- all modals -->
|
||||||
<!-- otp token -->
|
<!-- otp token -->
|
||||||
<div class="modal fade" id="otpToken_modal" tabindex="-1" role="dialog">
|
{{-- <div class="modal fade" id="otpToken_modal" tabindex="-1" role="dialog">--}}
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header align-items-center">
|
<div class="modal-header align-items-center">
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{-- </div>--}}
|
||||||
<!-- end otp token -->
|
<!-- end otp token -->
|
||||||
<!-- user info -->
|
<!-- user info -->
|
||||||
<div class="modal fade" id="userInfo_modal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="userInfo_modal" tabindex="-1" role="dialog">
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-4 px-2 form-group">
|
<div class="col-12 col-md-4 px-2 form-group">
|
||||||
<label for="user_phone">شماره مامور:</label>
|
<label for="user_phone">شماره مامور:</label>
|
||||||
<input type="number" class="form-control clean-input value-important" readonly autocomplete="off" name="user-phone" id="user_phone">
|
<input type="number" class="form-control clean-input value-important" autocomplete="off" name="user-phone" id="user_phone">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-4 px-2 form-group">
|
<div class="col-12 col-md-4 px-2 form-group">
|
||||||
<label for="plaque-number">شماره انتظامی وسیله نقلیه</label>
|
<label for="plaque-number">شماره انتظامی وسیله نقلیه</label>
|
||||||
|
|||||||
@@ -675,6 +675,11 @@
|
|||||||
id="add_simple_city_office">
|
id="add_simple_city_office">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label>راهدارخانه</label>
|
||||||
|
<select class="form-control tollhouse" name="add_simple_tollhouse" id="add_simple_tollhouse">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label> نام کاربری</label>
|
<label> نام کاربری</label>
|
||||||
<span style="color: crimson">*</span>
|
<span style="color: crimson">*</span>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Http\Controllers\V3\Auth\LogoutController;
|
use App\Http\Controllers\V3\Auth\LogoutController;
|
||||||
|
use App\Http\Controllers\V3\CityController;
|
||||||
use App\Http\Controllers\V3\CMMSMachinesController;
|
use App\Http\Controllers\V3\CMMSMachinesController;
|
||||||
use App\Http\Controllers\V3\DamageManagementController;
|
use App\Http\Controllers\V3\DamageManagementController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Accident\AccidentReceiptController;
|
use App\Http\Controllers\V3\Dashboard\Accident\AccidentReceiptController;
|
||||||
@@ -15,6 +16,7 @@ use App\Http\Controllers\V3\Dashboard\Harim\TechnicalDeputyController;
|
|||||||
use App\Http\Controllers\V3\Dashboard\ItemsManagementController;
|
use App\Http\Controllers\V3\Dashboard\ItemsManagementController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Mission\ControlUnitController;
|
use App\Http\Controllers\V3\Dashboard\Mission\ControlUnitController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Mission\DetailController;
|
use App\Http\Controllers\V3\Dashboard\Mission\DetailController;
|
||||||
|
use App\Http\Controllers\V3\Dashboard\Mission\Report\ReportMachineController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Mission\Report\ReportTradodController;
|
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\Report\ReportViolationController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Mission\RequestPortalController;
|
use App\Http\Controllers\V3\Dashboard\Mission\RequestPortalController;
|
||||||
@@ -37,6 +39,7 @@ use App\Http\Controllers\V3\LogListManagementController;
|
|||||||
use App\Http\Controllers\V3\NotificationController;
|
use App\Http\Controllers\V3\NotificationController;
|
||||||
use App\Http\Controllers\V3\PermissionManagementController;
|
use App\Http\Controllers\V3\PermissionManagementController;
|
||||||
use App\Http\Controllers\V3\ProfileController;
|
use App\Http\Controllers\V3\ProfileController;
|
||||||
|
use App\Http\Controllers\V3\ProvinceController;
|
||||||
use App\Http\Controllers\V3\RahdaranController;
|
use App\Http\Controllers\V3\RahdaranController;
|
||||||
use App\Http\Controllers\V3\WebServices\RoadItemController;
|
use App\Http\Controllers\V3\WebServices\RoadItemController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
@@ -185,6 +188,7 @@ Route::prefix('cmms_machines')
|
|||||||
Route::get('/list', 'list')->name('list');
|
Route::get('/list', 'list')->name('list');
|
||||||
Route::get('/search', 'search')->name('search');
|
Route::get('/search', 'search')->name('search');
|
||||||
Route::get('/car_types', 'carTypes')->name('carTypes');
|
Route::get('/car_types', 'carTypes')->name('carTypes');
|
||||||
|
Route::post('/{machine}', 'update')->name('update')->middleware('permission:update-machine');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::prefix('rahdaran')
|
Route::prefix('rahdaran')
|
||||||
@@ -475,6 +479,7 @@ Route::prefix('road_maintenance_station')
|
|||||||
Route::get('/', 'index')->name('index')->middleware('permission:show-tollhouse|show-tollhouse-province');
|
Route::get('/', 'index')->name('index')->middleware('permission:show-tollhouse|show-tollhouse-province');
|
||||||
Route::post('/', 'store')->name('store');
|
Route::post('/', 'store')->name('store');
|
||||||
Route::get('/map', 'map')->name('map');
|
Route::get('/map', 'map')->name('map');
|
||||||
|
Route::get('/search_by_city', 'findByCity')->name('findByCity');
|
||||||
Route::get('/images/{rahdariPoint}', 'images')->name('images');
|
Route::get('/images/{rahdariPoint}', 'images')->name('images');
|
||||||
Route::get('/{rahdariPoint}', 'show')->name('show')->middleware('permission:show-tollhouse|show-tollhouse-province');
|
Route::get('/{rahdariPoint}', 'show')->name('show')->middleware('permission:show-tollhouse|show-tollhouse-province');
|
||||||
Route::post('/{rahdariPoint}', 'update')->name('update')->middleware('permission:edit-tollhouse|edit-tollhouse-province');
|
Route::post('/{rahdariPoint}', 'update')->name('update')->middleware('permission:edit-tollhouse|edit-tollhouse-province');
|
||||||
@@ -490,12 +495,14 @@ Route::prefix('missions')
|
|||||||
->controller(RequestPortalController::class)
|
->controller(RequestPortalController::class)
|
||||||
->group(function () {
|
->group(function () {
|
||||||
Route::get('/', 'index')->name('index');
|
Route::get('/', 'index')->name('index');
|
||||||
|
Route::get('/violations', 'violations')->name('violations');
|
||||||
Route::post('/', 'store')->name('store');
|
Route::post('/', 'store')->name('store');
|
||||||
Route::post('/no_process','noProcess')->name('noProcess');
|
Route::post('/clarify_unauthorized_exit/{violation}','clarifyUnauthorizedExit')->name('clarifyUnauthorizedExit');
|
||||||
Route::post('/continue/{mission}','continueMission')->name('continueMission');
|
Route::post('/continue/{mission}','continueMission')->name('continueMission');
|
||||||
Route::get('/{mission}', 'show')->name('show');
|
Route::get('/{mission}', 'show')->name('show');
|
||||||
Route::post('/{mission}', 'update')->name('update');
|
Route::post('/{mission}', 'update')->name('update');
|
||||||
Route::delete('/{mission}', 'destroy')->name('destroy');
|
Route::delete('/{mission}', 'destroy')->name('destroy');
|
||||||
|
Route::post('/change_state/{mission}', 'changeState')->name('changeState')->middleware('permission:mission-change-state');
|
||||||
});
|
});
|
||||||
Route::name('transportationUnit.')
|
Route::name('transportationUnit.')
|
||||||
->prefix('transportation_unit')
|
->prefix('transportation_unit')
|
||||||
@@ -530,14 +537,13 @@ Route::prefix('missions')
|
|||||||
->group(function () {
|
->group(function () {
|
||||||
Route::get('/', 'index')->name('index');
|
Route::get('/', 'index')->name('index');
|
||||||
Route::post('/', 'store')->name('store');
|
Route::post('/', 'store')->name('store');
|
||||||
Route::post('/no_process/{violation}','noProcess')->name('noProcess');
|
|
||||||
Route::get('/{violation}', 'show')->name('show');
|
Route::get('/{violation}', 'show')->name('show');
|
||||||
Route::post('/{violation}', 'update')->name('update');
|
Route::post('/{violation}', 'update')->name('update');
|
||||||
Route::delete('/{violation}', 'destroy')->name('destroy');
|
Route::delete('/{violation}', 'destroy')->name('destroy');
|
||||||
});
|
});
|
||||||
Route::prefix('report_violation')
|
Route::prefix('report_violation')
|
||||||
->name('reportsViolation.')
|
->name('reportsViolation.')
|
||||||
->middleware(['permission:mission-report-province', 'permission:mission-report-country'])
|
->middleware(['permission:mission-report-province|mission-report-country'])
|
||||||
->controller(ReportViolationController::class)
|
->controller(ReportViolationController::class)
|
||||||
->group(function () {
|
->group(function () {
|
||||||
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
||||||
@@ -547,7 +553,7 @@ Route::prefix('missions')
|
|||||||
});
|
});
|
||||||
Route::prefix('report_taradod')
|
Route::prefix('report_taradod')
|
||||||
->name('reportsTaradod.')
|
->name('reportsTaradod.')
|
||||||
->middleware(['permission:mission-report-province', 'permission:mission-report-country'])
|
->middleware(['permission:mission-report-province|mission-report-country'])
|
||||||
->controller(ReportTradodController::class)
|
->controller(ReportTradodController::class)
|
||||||
->group(function () {
|
->group(function () {
|
||||||
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
||||||
@@ -555,6 +561,25 @@ Route::prefix('missions')
|
|||||||
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
|
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
|
||||||
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
|
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
|
||||||
});
|
});
|
||||||
|
Route::prefix('report_machine')
|
||||||
|
->name('reportsMachine.')
|
||||||
|
->middleware(['permission:mission-report-province|mission-report-country'])
|
||||||
|
->controller(ReportMachineController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get('/machines_activity', 'machinesActivity')->name('machinesActivity');
|
||||||
|
Route::get('/machines_activity_excel', 'machinesActivityExcel')->name('machinesActivityExcel');
|
||||||
|
|
||||||
|
Route::get('/machine_types_activity', 'machineTypesActivity')->name('machineTypesActivity');
|
||||||
|
Route::get('/machine_types_activity_excel', 'machineTypesActivityExcel')->name('machineTypesActivityExcel');
|
||||||
|
Route::get('/machine_drivers_activity', 'machineDriversActivity')->name('machineDriversActivity');
|
||||||
|
Route::get('/machine_drivers_activity_excel', 'machineDriversActivityExcel')->name('machineDriversActivityExcel');
|
||||||
|
Route::get('/machine_details_report/{machine_id}', 'machineDetailsReport')->name('machineDetailsReport');
|
||||||
|
Route::get('/machine_details_report_excel/{machine_id}', 'machineDetailsReportExcel')->name('machineDetailsReportExcel');
|
||||||
|
Route::get('/machine_type_details_report', 'machineTypeDetailsReport')->name('machineTypeDetailsReport');
|
||||||
|
Route::get('/machine_type_details_report_excel', 'machineTypeDetailsReportExcel')->name('machineTypeDetailsReportExcel');
|
||||||
|
Route::get('/machine_driver_details_report', 'machineDriverDetailsReport')->name('machineDriverDetailsReport');
|
||||||
|
Route::get('/machine_driver_details_report_excel', 'machineDriverDetailsReportExcel')->name('machineDriverDetailsReportExcel');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::prefix('harim')
|
Route::prefix('harim')
|
||||||
@@ -666,4 +691,18 @@ Route::prefix('role')
|
|||||||
Route::get('/test', function () {
|
Route::get('/test', function () {
|
||||||
$csvExporter = new \Laracsv\Export();
|
$csvExporter = new \Laracsv\Export();
|
||||||
$csvExporter->build(\App\Models\User::all(), ['id' => 'کد یکتا', 'username' => 'نام کاربری'])->download();
|
$csvExporter->build(\App\Models\User::all(), ['id' => 'کد یکتا', 'username' => 'نام کاربری'])->download();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::prefix('provinces')
|
||||||
|
->name('provinces.')
|
||||||
|
->controller(ProvinceController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get('/list', 'list')->name('list');
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::prefix('cities')
|
||||||
|
->name('cities.')
|
||||||
|
->controller(CityController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get('/list', 'list')->name('list');
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user