1 Commits

Author SHA1 Message Date
79cb2394f8 for mission and webservic harim 2026-02-18 14:01:07 +03:30
25 changed files with 393 additions and 259 deletions

View File

@@ -1,32 +1,58 @@
FROM dunglas/frankenphp:1.11.1-php8.2
FROM alpine:3.18
RUN apt-get update \
&& apt-get install -y --no-install-recommends default-mysql-client \
RUN apk update && apk add --no-cache\
bash \
wget \
curl \
nano \
unzip \
zip \
&& install-php-extensions pdo_mysql \
&& install-php-extensions zip \
&& install-php-extensions gd \
&& install-php-extensions pcntl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
libzip-dev \
libxml2 \
libxml2-dev \
git \
zlib-dev \
libpng-dev \
php81 \
php81-common \
php81-fpm \
php81-pdo \
php81-opcache \
php81-soap \
php81-zip \
php81-phar \
php81-iconv \
php81-cli \
php81-curl \
php81-openssl \
php81-mbstring \
php81-tokenizer \
php81-fileinfo \
php81-json \
php81-xml \
php81-xmlwriter \
php81-xmlreader \
php81-simplexml \
php81-dom \
php81-pdo_mysql \
php81-pdo_pgsql \
php81-pdo_sqlite \
php81-tokenizer \
php81-pecl-redis \
php81-gd
WORKDIR /var/www/rms
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy Laravel application
COPY . .
ENV COMPOSER_ALLOW_SUPERUSER=1
# Give permissions to storage and bootstrap/cache
RUN chmod -R 777 storage bootstrap/cache
ARG MOUNT_PATH
# Install Composer
COPY --from=docker.arvancloud.ir/composer:latest /usr/bin/composer /usr/bin/composer
COPY . /var/www/app
WORKDIR /var/www/app
# Optional: Run migrations/seeds if you want
# CMD php artisan migrate && php artisan db:seed && frankenphp run --config /etc/frankenphp/config.prod.yaml
CMD composer install;\
php artisan key:generate;\
php artisan migrate;\
php artisan db:seed;\
cd public;\
frankenphp php-server
# php artisan migrate ;\
# php artisan db:seed;\
# php artisan storege:link;\
php artisan serve --host=0.0.0.0

View File

@@ -46,7 +46,7 @@ class SendContractSmsNotification extends Command
foreach ($contractSubItems as $key => $value) {
$message = "سلام،\n پروژه راهداری با کد یکتای {$value->unique_code} با مسئولیت شما، به مدت بیشتر از یک ماه به روزرسانی نشده است. لطفا نسبت به روز رسانی دقیق پیشرفت پروژه در سامانه اقدام نمایید.\n rms.rmto.ir";
// self::sms_sender($value->operator_phone, $message);
self::sms_sender($value->operator_phone, $message);
}
}

View File

@@ -15,11 +15,11 @@ enum MissionStates: int
public static function name(int $state): string
{
$mapArray = [
1 => 'درخواست ایجاد شد و در حال بررسی توسط واحد تایید کننده است',
1 => 'درخواست ایجاد شد و در حال بررسی توسط واحد نقلیه است',
2 => 'خودرو اختصاص داده شد و درخواست توسط واحد کنترل در حال بررسی است',
3 => 'درخواست توسط واحد کنترل تایید شد و ماموریت آغاز می شود',
4 => 'اتمام ماموریت',
5 => 'عدم تخصیص خودرو توسط واحد تایید کننده و بازگشت درخواست به کارتابل کاربر',
5 => 'عدم تخصیص خودرو توسط واحد نقلیه و بازگشت درخواست به کارتابل کاربر',
6 => 'ماموریت لغو شد',
7 => 'ماموریت بدون فرایند ثبت شد'
];

View File

@@ -12,28 +12,28 @@ class SmsClass
{
public function sendSms($mobile, $msg)
{
// if (App::environment('production')) {
//
//
// $client = new SoapClient("http://172.30.5.36/webservice/sms.asmx?WSDL");
// $date = date('d-m-y h:i:s');
// $date = str_replace(" ", "T", $date);
// $result = $client->Send(
// array(
// 'Username' => 'admin',
// 'Password' => 'admin141',
// 'ShortCode' => '1000141',
// 'Cellphones' => $mobile,
// 'Message' => $msg,
// 'Farsi' => true,
// // 'SendDate' => $date
// // 'uTopic' => false,
// // 'uFlash' => false
// )
// );
//
// return $result->SendResult;
// }
if (App::environment('production')) {
$client = new SoapClient("http://172.30.5.36/webservice/sms.asmx?WSDL");
$date = date('d-m-y h:i:s');
$date = str_replace(" ", "T", $date);
$result = $client->Send(
array(
'Username' => 'admin',
'Password' => 'admin141',
'ShortCode' => '1000141',
'Cellphones' => $mobile,
'Message' => $msg,
'Farsi' => true,
// 'SendDate' => $date
// 'uTopic' => false,
// 'uFlash' => false
)
);
return $result->SendResult;
}
// $client = new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");

View File

@@ -609,25 +609,25 @@ class ContractSubItemsController extends Controller
]);
}
// public function sms_sender($mobile, $msg)
// {
// $client=new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
// $result=$client->doSendSMS(
// array(
// 'uUsername' => 'rmto',
// 'uPassword' => 'Rahdari8
// ',
// 'uNumber' => '1000141',
// 'uCellphones' => $mobile,
// 'uMessage' => $msg,
// 'uFarsi' => true,
// 'uTopic' => false,
// 'uFlash' => false
// )
// );
// $x = $result->doSendSMSResult;
// return $x;
// }
public function sms_sender($mobile, $msg)
{
$client=new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
$result=$client->doSendSMS(
array(
'uUsername' => 'rmto',
'uPassword' => 'Rahdari8
',
'uNumber' => '1000141',
'uCellphones' => $mobile,
'uMessage' => $msg,
'uFarsi' => true,
'uTopic' => false,
'uFlash' => false
)
);
$x = $result->doSendSMSResult;
return $x;
}
public function get_way_id_from_nominatim($lat, $lng)
{

View File

@@ -434,7 +434,6 @@ class UserController extends Controller
$user->password = Hash::make($request->password);
$user->national_code = $request->national_code;
$user->station_id = $request->station_id;
$user->save();
if (auth()->user()) {

View File

@@ -70,20 +70,19 @@ class ControlUnitController extends Controller
'state_name' => MissionStates::name($state),
'finish_time' => $request->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']),
// ]);
$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) {

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Http\Controllers\V3\Dashboard\Mission\Report;
use App\Exports\V3\Mission\Report\Tradod\CountryReport;
use App\Exports\V3\Mission\Report\Tradod\ProvinceReport;
use App\Http\Controllers\Controller;
use App\Http\Traits\ApiResponse;
use App\Models\City;
use App\Models\Province;
use App\Services\Cartables\Mission\Report\ReportTradodService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use PhpOffice\PhpSpreadsheet\Exception;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class MachineMissionController extends Controller
{
use ApiResponse;
public function Activity(Request $request, ReportTradodService $reportMissionService): JsonResponse
{
return $this->successResponse([
'activities' => $reportMissionService->countryActivity($request),
'provinces' => Province::all(['id', 'name_fa']),
]);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function countryExcelActivity(Request $request, ReportTradodService $reportMissionService): BinaryFileResponse
{
$data = $reportMissionService->countryActivity($request);
$name = 'گزارش کل تردد '.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new CountryReport($data), $name);
}
}

View File

@@ -38,15 +38,6 @@ class RoadMaintenanceStationController extends Controller
));
}
public function findByCity(Request $request): JsonResponse
{
$stations = RahdariPoint::query()
->where('city_id', $request->query('city_id'))
->get();
return $this->successResponse($stations);
}
/**
* Store a newly created resource in storage.
*/

View File

@@ -25,7 +25,6 @@ class FinishRequest extends FormRequest
{
return [
'time' => 'required|date',
'end_km' => 'required',
];
}
}

View File

@@ -2,10 +2,14 @@
namespace App\Listeners\V3\Dashboard\Harim;
use App\Enums\HarimStates;
use App\Events\V3\Dashboard\Harim\RejectRequestEvent;
use App\Services\PanjarehVahed\SendAccessRoadStatusService;
use Exception;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\DB;
use Throwable;
class RejectRequestListener implements ShouldQueue
{
@@ -15,20 +19,28 @@ class RejectRequestListener implements ShouldQueue
* @var string|null
*/
public ?string $queue = 'harim';
public int $tries = 2;
public function backoff(): array
{
return [10, 30];
}
public function __construct(){}
public function __construct(
private SendAccessRoadStatusService $sendAccessRoadStatusService
){}
/**
* @throws Exception
*/
public function handle(RejectRequestEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
public function handle(RejectRequestEvent $event): void
{
$arrayData = json_decode($event->harim->data, true);
$sendAccessRoadStatusService->makeInputParameters([
$this->sendAccessRoadStatusService->makeInputParameters([
'data' => [
'actionId' => $arrayData['actionId'],
'actionId' => 470,
'ruleId' => $arrayData['ruleId'],
'activityId' => $arrayData['activityId'],
'requestId' => $arrayData['requestId'],
@@ -41,6 +53,119 @@ class RejectRequestListener implements ShouldQueue
'token' => $arrayData['token'],
]);
$sendAccessRoadStatusService->run();
$this->sendAccessRoadStatusService->run();
}
public function failed(RejectRequestEvent $event, Throwable $e): void
{
$harim = $event->harim->fresh();
DB::transaction(function () use ($harim, $e) {
if ((int)$harim->state_id === HarimStates::EMKAN_PAZIR_NEMEBASHAD->value) {
$harim->update([
'state_id' => HarimStates::BARESI_TAVASOT_MODIR_KOL->value, // همون 4
'state_name' => HarimStates::BARESI_TAVASOT_MODIR_KOL->label(),
]);
}
});
}
}
//
//namespace App\Listeners\V3\Dashboard\Harim;
//
//use App\Enums\HarimStates;
//use App\Events\V3\Dashboard\Harim\RejectRequestEvent;
//use App\Services\PanjarehVahed\SendAccessRoadStatusService;
//use Illuminate\Contracts\Queue\ShouldQueue;
//use Illuminate\Support\Facades\DB;
//use Illuminate\Support\Facades\Log;
//
//class RejectRequestListener implements ShouldQueue
//{
// public ?string $queue = 'harim';
//
// public function __construct(
// private readonly SendAccessRoadStatusService $sendAccessRoadStatusService
// )
// {
// }
//
// public function handle(RejectRequestEvent $event): void
// {
// $harim = $event->harim;
//
// $raw = $harim->data;
//
// // ✅ اگر data خالی/Null یا غیر string بود => 500 نده، فقط revert و خارج شو
// if (!is_string($raw) || trim($raw) === '') {
// $this->revertHarim($harim->id, 'harim.data is empty or not string');
// return;
// }
//
// $arrayData = json_decode($raw, true);
//
// // ✅ اگر json خراب بود => 500 نده، فقط revert و خارج شو
// if (!is_array($arrayData) || json_last_error() !== JSON_ERROR_NONE) {
// $this->revertHarim($harim->id, 'Invalid harim.data JSON: ' . json_last_error_msg());
// return;
// }
//
// $payload = [
// 'data' => [
// 'actionId' => $arrayData['actionId'] ?? 470,
// 'ruleId' => $arrayData['ruleId'] ?? null,
// 'activityId' => $arrayData['activityId'] ?? null,
// 'requestId' => $arrayData['requestId'] ?? null,
// 'taskId' => $arrayData['taskId'] ?? null,
// 'code' => $harim->id,
// 'resultStatus' => 3,
// 'Description' => $harim->last_description,
// ],
// 'token' => $arrayData['token'] ?? null,
// ];
//
// // ✅ اگر فیلد حیاتی نبود => revert و خارج شو
// if (empty($payload['token']) || empty($payload['data']['requestId'])) {
// $this->revertHarim($harim->id, 'Missing token/requestId for external service');
// return;
// }
//
// // ✅ اگر سرویس بیرونی fail شد => 500 نده، revert کن و خارج شو
// try {
// $this->sendAccessRoadStatusService->makeInputParameters($payload);
// $this->sendAccessRoadStatusService->run();
//
// Log::info('RejectRequest external call succeeded', ['harim_id' => $harim->id]);
//
// } catch (\Throwable $e) {
// $this->revertHarim($harim->id, 'External call failed: ' . $e->getMessage());
// return;
// }
// }
//
// private function revertHarim(int $harimId): void
// {
// DB::transaction(function () use ($harimId) {
// $harim = \App\Models\Harim::query()->lockForUpdate()->find($harimId);
//
// if (!$harim) {
// Log::error('Revert failed: harim not found', ['harim_id' => $harimId]);
// return;
// }
//
// if ((int)$harim->state_id === HarimStates::EMKAN_PAZIR_NEMEBASHAD->value) {
// $harim->update([
// 'state_id' => HarimStates::BARESI_TAVASOT_MODIR_KOL->value,
// 'state_name' => HarimStates::BARESI_TAVASOT_MODIR_KOL->label(),
// ]);
// }
//
// Log::warning('RejectRequest reverted harim state (sync mode)', [
// 'harim_id' => $harimId,
// ]);
// });
// }
//}

View File

@@ -0,0 +1,59 @@
<?php
namespace App\Services\Cartables\Mission\Report;
use App\Facades\DataTable\DataTableFacade;
use App\Models\MissionViolation;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class MachinMissionService
{
public function Activity(Request $request): array
{
$provinceId = $request->province_id ?? auth()->user()->province_id;
$from = $request->from_date ?? today()->startOfDay();
$to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay();
$sql = "
SELECT
cm.machine_code,
cm.car_name,
COALESCE(c.name_fa, '---') AS city_name,
COUNT(m.id) AS missions_count,
COALESCE(SUM(m.in_area_duration), 0) AS gps,
COALESCE(SUM(m.mission_duration), 0) AS durations
FROM cmms_machines cm
LEFT JOIN missions m
ON m.machine_code = cm.machine_code
AND m.created_at >= :from
AND m.created_at <= :to
LEFT JOIN cities c
ON c.id = cm.city_id
WHERE (:car_group IS NULL OR cm.car_group = :car_group)
AND (:province_id IS NULL OR cm.province_id = :province_id)
GROUP BY
cm.machine_code,
cm.car_name,
c.name_fa
ORDER BY
missions_count DESC,
durations DESC,
cm.machine_code;
";
return DB::select($sql, [
'province_id' => $provinceId,
'from' => $from,
'to' => $to,
]);
}
}

View File

@@ -27,7 +27,7 @@ class ReportTradodService
public function countryActivity(Request $request): array
{
$from = $request->from_date ?? today()->startOfDay();
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
$to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay();
$sql = "
SELECT*
@@ -37,8 +37,8 @@ class ReportTradodService
-1 AS province_id,
COUNT(m.id) AS total,
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps,
COALESCE(SUM(m.mission_duration)/3600, 0) AS durations,
COALESCE(SUM(m.in_area_duration), 0) AS gps,
COALESCE(SUM(m.mission_duration), 0) AS durations,
COALESCE(SUM(CASE WHEN m.type = 1 THEN 1 ELSE 0 END), 0) AS far_h,
COALESCE(SUM(CASE WHEN m.type = 2 THEN 1 ELSE 0 END), 0) AS far_d,
COALESCE(SUM(CASE WHEN m.type = 3 THEN 1 ELSE 0 END), 0) AS un_far_h,
@@ -56,8 +56,8 @@ class ReportTradodService
p.id AS province_id,
COUNT(m.id) AS total,
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps,
COALESCE(SUM(m.mission_duration)/3600, 0) AS durations,
COALESCE(SUM(m.in_area_duration), 0) AS gps,
COALESCE(SUM(m.mission_duration), 0) AS durations,
COALESCE(SUM(CASE WHEN m.type = 1 THEN 1 ELSE 0 END), 0) AS far_h,
COALESCE(SUM(CASE WHEN m.type = 2 THEN 1 ELSE 0 END), 0) AS far_d,
COALESCE(SUM(CASE WHEN m.type = 3 THEN 1 ELSE 0 END), 0) AS un_far_h,
@@ -88,7 +88,7 @@ class ReportTradodService
{
$provinceId = $request->province_id ?? auth()->user()->province_id;
$from = $request->from_date ?? today()->startOfDay();
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
$to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay();
$sql = "
SELECT*
@@ -98,8 +98,8 @@ class ReportTradodService
-1 AS city_id,
COUNT(m.id) AS total,
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps,
COALESCE(SUM(m.mission_duration)/3600, 0) AS durations,
COALESCE(SUM(m.in_area_duration), 0) AS gps,
COALESCE(SUM(m.mission_duration), 0) AS durations,
COALESCE(SUM(m.type = 1), 0) AS far_h,
COALESCE(SUM(m.type = 2), 0) AS far_d,
COALESCE(SUM(m.type = 3), 0) AS un_far_h,
@@ -118,8 +118,8 @@ class ReportTradodService
c.id AS city_id,
COUNT(m.id) AS total,
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps,
COALESCE(SUM(m.mission_duration)/3600, 0) AS durations,
COALESCE(SUM(m.in_area_duration), 0) AS gps,
COALESCE(SUM(m.mission_duration), 0) AS durations,
COALESCE(SUM(m.type = 1), 0) AS far_h,
COALESCE(SUM(m.type = 2), 0) AS far_d,
COALESCE(SUM(m.type = 3), 0) AS un_far_h,

View File

@@ -27,7 +27,7 @@ class ReportViolationService
public function countryActivity(Request $request): array
{
$from = $request->from_date ?? today()->startOfDay();
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
$to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay();
$sql = "
SELECT*
@@ -81,7 +81,7 @@ class ReportViolationService
{
$provinceId = $request->province_id ?? auth()->user()->province_id;
$from = $request->from_date ?? today()->startOfDay();
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
$to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay();
$sql = "
SELECT*

View File

@@ -15,7 +15,7 @@ class SendAccessRoadStatusService
public function __construct()
{
$this->url = config('harim_web_services.Reject.url');
$this->channelName = '';
$this->channelName = 'send_access_road';
}
/**

View File

@@ -15,7 +15,7 @@ class SendPaymentInfoService
public function __construct()
{
$this->url = config('harim_web_services.Reject.url');
$this->channelName = '';
$this->channelName = 'send_payment_info';
}
/**

View File

@@ -27,7 +27,7 @@ class PaymentService
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://payment.rmto.ir/acc/rest/payid/gen");
curl_setopt($ch, CURLOPT_URL, "http://payment.rmto.ir/acc/rest/payid/gen");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
@@ -59,7 +59,7 @@ class PaymentService
);
$ch = curl_init();
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_URL, "http://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_POST, true);
// curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));

View File

@@ -152,5 +152,15 @@ return [
'path' => storage_path('logs/cmms/daily_moving_machine_service.log'),
'level' => 'info',
],
'send_access_road' => [
'driver' => 'single',
'path' => storage_path('logs/harim/send_access_road_service.log'),
'level' => 'info',
],
'send_payment_info' => [
'driver' => 'single',
'path' => storage_path('logs/harim/send_payment_info_service.log'),
'level' => 'info',
],
],
];

View File

@@ -1,29 +0,0 @@
<?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');
});
}
};

View File

@@ -1,33 +0,0 @@
services:
mariadb:
image: mariadb:10.11.8
container_name: rms-mariadb
ports:
- "3307:3306"
environment:
MARIADB_DATABASE: ${DB_DATABASE}
MARIADB_USER: ${DB_USERNAME}
MARIADB_PASSWORD: ${DB_PASSWORD}
MARIADB_ROOT_PASSWORD: ${DB_PASSWORD}
volumes:
- /var/www/rmsdb:/var/lib/mysql
networks:
- rms
backend:
build:
context: .
dockerfile: Dockerfile
container_name: rms
ports:
- "8003:80"
volumes:
- ./:/var/www/rms
depends_on:
- mariadb
networks:
- rms
networks:
rms:
driver: bridge

View File

@@ -61,6 +61,9 @@ function errorHandler(error) {
break;
default:
console.error("Error trace object");
console.log("Error object:");
console.log(error);
Swal.fire({
icon: "error",
title: "خطا",
@@ -414,43 +417,6 @@ 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) {
$.ajax({
url: "/public/contents/edarateShahri/" + city_id,
@@ -957,6 +923,7 @@ $(document).on('click', '#report_btn', function () {
var tr = $(this).closest("tr");
var row = table.row(tr);
$("#report_modal").modal('show');
console.log(row.data().id);
$("#selected_user_for_report").val(row.data().id);
})
@@ -1036,6 +1003,7 @@ $(document).on('click', '#activity_report', function () {
showLoaderScreen()
},
success: function (result) {
console.log(result);
$("#activity_time").text(result.activity_time);
$("#average_activity_time").text(result.average_activity_time);
@@ -1074,6 +1042,9 @@ $(document).on('click', '.permission-control', function () {
modal.find('.permission-label').removeClass('text-muted')
modal.find('.all-permission-by-type').prop('checked', false)
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) => {
if ($(element).data('needProvince') == 1) {
if (row.data().province_id == null) {
@@ -1654,6 +1625,7 @@ $("table").on("click", "tbody tr", function () {
$('#user_data_table').on('change', ".user-finder-all", function () {
console.log(checkedItemsId);
var thiz = $(this);
if (thiz.is(':checked')) {
@@ -1670,6 +1642,7 @@ $('#user_data_table').on('change', ".user-finder-all", function () {
});
$('#user_data_table').on('change', ".user-finder", function () {
console.log(checkedItemsId);
const checkedItemId = $(this).data("idUser");
@@ -2131,6 +2104,7 @@ $("#edit_province_office").change(function () {
$("#edit_city_office").change(function () {
console.log("this is ok");
setUserName("edit");
})
@@ -2412,19 +2386,6 @@ $("#add_province_office").change(function () {
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 () {
// if ($(this).val() == 0) {
@@ -2435,6 +2396,15 @@ $("#add_simple_city").change(function () {
// 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 () {
@@ -2611,9 +2581,6 @@ $('#add_simple_user_show_modal').on('click', function () {
enableDOM("add_simple_city")
$("#add_simple_city").empty();
$("#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")
$("#add_simple_city_office").empty();
$("#add_simple_city_office").append('<option value="0" selected disabled></option>');
@@ -2627,10 +2594,8 @@ $("#add_simple_province").change(function () {
disableDOM("add_simple_city")
disableDOM("add_simple_city_office")
disableDOM("add_simple_tollhouse")
$("#add_simple_city").empty();
$("#add_simple_city_office").empty();
$("#add_simple_tollhouse").empty();
} else {
if ($("#add_simple_province_office").val() == 0) {
@@ -2657,10 +2622,8 @@ $("#add_simple_province_office").change(function () {
disableDOM("add_simple_city")
disableDOM("add_simple_city_office")
disableDOM("add_simple_tollhouse")
$("#add_simple_city").empty();
$("#add_simple_city_office").empty();
$("#add_simple_tollhouse").empty();
} else {
if ($("#add_simple_province").val() == 0 || $("#add_simple_province").val() == -1) {
@@ -2694,7 +2657,6 @@ $("#add_simple_submit_form").on("click", function () {
var edarate_shahri_id = $("#add_simple_city_office").children("option:selected").val();
var national_code = $("#add_simple_national_code").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) {
@@ -2733,12 +2695,6 @@ $("#add_simple_submit_form").on("click", function () {
} else {
$("#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) {
$("#add_simple_province").addClass("validity-checker");
@@ -2778,10 +2734,6 @@ $("#add_simple_submit_form").on("click", function () {
formData.append("city_id", city_id);
}
if (tollhouse_id != undefined) {
formData.append("station_id", tollhouse_id);
}
formData.append("password_confirmation", repass);
if (edarate_ostani_id != 0) {
formData.append("edarate_ostani_id", edarate_ostani_id);

View File

@@ -125,13 +125,11 @@
$(document).ready(function() {
$(".letter-body").find("#accident_date").text(moment(jsonServer.data.accident_date).format(
"jYYYY/jMM/jDD"));
const plaque = jsonServer?.data?.plaque?.split("-");
if (plaque) {
$("#plaque1").text(plaque[0]);
$("#plaque2").text(plaque[1]);
$("#plaque3").text(plaque[2]);
$("#plaque4").text(plaque[3]);
}
const plaque = jsonServer.data.plaque.split("-");
$("#plaque1").text(plaque[0]);
$("#plaque2").text(plaque[1]);
$("#plaque3").text(plaque[2]);
$("#plaque4").text(plaque[3]);
let row_counter;
let i;
for (i = 0; i < damages.length; i++) {

View File

@@ -38,7 +38,7 @@
<button id="add_patrol" class="positive-cta float-left my-2" disabled>ثبت گشت</button>
<!-- all modals -->
<!-- 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-content">
<div class="modal-header align-items-center">
@@ -69,7 +69,7 @@
</div>
</div>
</div>
{{-- </div>--}}
</div>
<!-- end otp token -->
<!-- user info -->
<div class="modal fade" id="userInfo_modal" tabindex="-1" role="dialog">
@@ -86,7 +86,7 @@
</div>
<div class="col-12 col-md-4 px-2 form-group">
<label for="user_phone">شماره مامور:</label>
<input type="number" class="form-control clean-input value-important" autocomplete="off" name="user-phone" id="user_phone">
<input type="number" class="form-control clean-input value-important" readonly autocomplete="off" name="user-phone" id="user_phone">
</div>
<div class="col-12 col-md-4 px-2 form-group">
<label for="plaque-number">شماره انتظامی وسیله نقلیه</label>

View File

@@ -675,11 +675,6 @@
id="add_simple_city_office">
</select>
</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">
<label> نام کاربری</label>
<span style="color: crimson">*</span>

View File

@@ -475,7 +475,6 @@ Route::prefix('road_maintenance_station')
Route::get('/', 'index')->name('index')->middleware('permission:show-tollhouse|show-tollhouse-province');
Route::post('/', 'store')->name('store');
Route::get('/map', 'map')->name('map');
Route::get('/search_by_city', 'findByCity')->name('findByCity');
Route::get('/images/{rahdariPoint}', 'images')->name('images');
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');
@@ -538,7 +537,7 @@ Route::prefix('missions')
});
Route::prefix('report_violation')
->name('reportsViolation.')
->middleware(['permission:mission-report-province|mission-report-country'])
->middleware(['permission:mission-report-province', 'permission:mission-report-country'])
->controller(ReportViolationController::class)
->group(function () {
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
@@ -548,7 +547,7 @@ Route::prefix('missions')
});
Route::prefix('report_taradod')
->name('reportsTaradod.')
->middleware(['permission:mission-report-province|mission-report-country'])
->middleware(['permission:mission-report-province', 'permission:mission-report-country'])
->controller(ReportTradodController::class)
->group(function () {
Route::get('/country_activity', 'countryActivity')->name('countryActivity');