Compare commits
21 Commits
39752fd5ba
...
feature/va
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0befa33b0f | ||
| 3708e2ebfb | |||
|
|
3fb1474b80 | ||
|
|
bab99f7f89 | ||
| 2aa9ae1455 | |||
| 80c4eeaefb | |||
| c9e779d726 | |||
| 72fa9d4ea3 | |||
|
|
d50749fd20 | ||
| ad01e4718d | |||
| 3dd49494f4 | |||
| 3045f60f1e | |||
| 2a6d44885c | |||
| 439f69af29 | |||
| 1be9315b73 | |||
| 92d806497d | |||
| 7ac07692a2 | |||
| ca51f65da4 | |||
| 0f65437bfa | |||
| 5edb061a24 | |||
| fc853d318e |
@@ -78,7 +78,7 @@ FMS_ERROR_RATE_URL=
|
||||
FMS_ERROR_RATE_PASSWORD=
|
||||
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_USERNAME=
|
||||
|
||||
@@ -106,7 +106,7 @@ BACKUP_PASSWORD=1qaz
|
||||
HARIM_ENCRYPTION_KEY="TestKey"
|
||||
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_USERNAME=
|
||||
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -19,3 +19,10 @@ yarn-error.log
|
||||
/.idea
|
||||
/.vscode
|
||||
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
|
||||
@@ -13,7 +13,7 @@ class EncodePolyLineCommand extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'app:encode-poly-line-command';
|
||||
protected $signature = 'polyline:encode';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
||||
@@ -65,7 +65,7 @@ class machineDriverReport implements FromView, ShouldAutoSize, WithDrawings, Wit
|
||||
$drawing2->setPath(public_path('/dist/141icon.png'));
|
||||
$drawing2->setWidth(50);
|
||||
$drawing2->setHeight(50);
|
||||
$drawing2->setOffsetX(5);
|
||||
$drawing2->setOffsetX(+90);
|
||||
$drawing2->setOffsetY(5);
|
||||
$drawing2->setCoordinates('D1');
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class machineReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
|
||||
|
||||
foreach ($this->data as $r) {
|
||||
$exportRows[] = [
|
||||
'machine_id' => $r->c_name ?? '',
|
||||
'machine_id' => $r->machine_id ?? '',
|
||||
'machine_code' => $r->machine_code ?? '',
|
||||
'car_name' => $r->car_name ?? '',
|
||||
'missions' => $r->missions ?? 0,
|
||||
@@ -66,7 +66,7 @@ class machineReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
|
||||
$drawing2->setPath(public_path('/dist/141icon.png'));
|
||||
$drawing2->setWidth(50);
|
||||
$drawing2->setHeight(50);
|
||||
$drawing2->setOffsetX(5);
|
||||
$drawing2->setOffsetX(+90);
|
||||
$drawing2->setOffsetY(5);
|
||||
$drawing2->setCoordinates('E1');
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class machineTypeReport implements FromView, ShouldAutoSize, WithDrawings, WithE
|
||||
$drawing2->setPath(public_path('/dist/141icon.png'));
|
||||
$drawing2->setWidth(50);
|
||||
$drawing2->setHeight(50);
|
||||
$drawing2->setOffsetX(5);
|
||||
$drawing2->setOffsetX(+90);
|
||||
$drawing2->setOffsetY(5);
|
||||
$drawing2->setCoordinates('C1');
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class ReportMachineController extends Controller
|
||||
public function countryMachineTypesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||
{
|
||||
$data = $reportMachineService->countryMachineTypesActivity($request);
|
||||
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||
$name = 'گزارش انوع ماشین'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||
|
||||
return Excel::download(new machineTypeReport($data), $name);
|
||||
}
|
||||
@@ -125,7 +125,7 @@ class ReportMachineController extends Controller
|
||||
public function provinceMachineTypesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||
{
|
||||
$data = $reportMachineService->provinceMachineTypesActivity($request);
|
||||
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||
$name = 'گزارش انوع ماشین'.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||
|
||||
return Excel::download(new machineTypeReport($data), $name);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Http\Controllers\V3\Dashboard\Mission;
|
||||
|
||||
use App\Enums\FMSResultCode;
|
||||
use App\Enums\MissionCategory;
|
||||
use App\Enums\MissionStates;
|
||||
use App\Enums\MissionTypes;
|
||||
@@ -10,7 +9,6 @@ use App\Enums\MissionViolationStatus;
|
||||
use App\Enums\MissionZones;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
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;
|
||||
@@ -23,7 +21,6 @@ use App\Models\Mission;
|
||||
use App\Models\MissionViolation;
|
||||
use App\Models\Rahdaran;
|
||||
use App\Models\RahdariPoint;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Services\Cartables\Mission\RequestPortalService;
|
||||
use App\Services\FMS\GetErrorRateService;
|
||||
use Carbon\Carbon;
|
||||
@@ -65,6 +62,8 @@ class RequestPortalController extends Controller
|
||||
$user = auth()->user();
|
||||
|
||||
$mission = Mission::query()->create([
|
||||
'item_id' => $request->item_id,
|
||||
'sub_item_id' => $request->sub_item_id,
|
||||
'user_id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'province_id' => $user->province_id,
|
||||
@@ -83,7 +82,6 @@ class RequestPortalController extends Controller
|
||||
'start_date' => $request->start_date,
|
||||
'end_date' => $request->end_date,
|
||||
'request_date' => now(),
|
||||
'description' => $request->description,
|
||||
'end_point' => $request->end_point,
|
||||
'encoded_route' => $request->encoded_route,
|
||||
'category_id' => $request->category_id,
|
||||
@@ -126,6 +124,7 @@ class RequestPortalController extends Controller
|
||||
'finish_time' => now(),
|
||||
'state_id' => MissionStates::END_MISSION->value,
|
||||
'state_name' => MissionStates::name(MissionStates::END_MISSION->value),
|
||||
'end_km' => $request->end_km,
|
||||
]);
|
||||
|
||||
// if ($mission->category_id == 2) {
|
||||
@@ -133,9 +132,11 @@ class RequestPortalController extends Controller
|
||||
// $rpc->store($mission);
|
||||
// }
|
||||
|
||||
$machine = CMMSMachine::query()->find($request->machine_id);
|
||||
$machine = CMMSMachine::query()->find($request->machine_id, ['id', 'machine_code', 'car_type']);
|
||||
|
||||
$newMission = Mission::query()->create([
|
||||
'item_id' => $request->item_id,
|
||||
'sub_item_id' => $request->sub_item_id,
|
||||
'user_id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'province_id' => $user->province_id,
|
||||
@@ -153,7 +154,6 @@ class RequestPortalController extends Controller
|
||||
'start_date' => now(),
|
||||
'end_date' => $request->end_date,
|
||||
'request_date' => now(),
|
||||
'description' => $request->description,
|
||||
'end_point' => $request->end_point,
|
||||
'encoded_route' => $request->encoded_route,
|
||||
'category_id' => $request->category_id,
|
||||
@@ -166,6 +166,8 @@ class RequestPortalController extends Controller
|
||||
'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);
|
||||
@@ -182,6 +184,8 @@ class RequestPortalController extends Controller
|
||||
DB::transaction(function () use ($mission, $request) {
|
||||
$state = MissionStates::REQUEST_CREATED->value;
|
||||
$mission->update([
|
||||
'item_id' => $request->item_id,
|
||||
'sub_item_id' => $request->sub_item_id,
|
||||
'state_id' => $state,
|
||||
'state_name' => MissionStates::name($state),
|
||||
'requested_machines' => json_encode($request->requested_machines),
|
||||
@@ -191,7 +195,6 @@ class RequestPortalController extends Controller
|
||||
'zone_fa' => MissionZones::name($request->zone),
|
||||
'start_date' => $request->start_date,
|
||||
'end_date' => $request->end_date,
|
||||
'description' => $request->description,
|
||||
'end_point' => $request->end_point,
|
||||
'encoded_route' => $request->encoded_route,
|
||||
'category_id' => $request->category_id,
|
||||
@@ -236,14 +239,16 @@ class RequestPortalController extends Controller
|
||||
{
|
||||
DB::transaction(function () use ($request, $violation) {
|
||||
|
||||
$start = Carbon::parse($violation->exit_station);
|
||||
$end = Carbon::parse($violation->enter_station);
|
||||
$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;
|
||||
$user = auth()->user();
|
||||
$zone = $request->zone;
|
||||
$machine = CMMSMachine::query()->where('machine_code', '=', $violation->machine_code)->first(['id', 'machine_code']);
|
||||
$machine = CMMSMachine::query()->where('machine_code', '=', $violation->machine_code)->first(['id', 'machine_code', 'car_type']);
|
||||
|
||||
$mission = Mission::query()->create([
|
||||
'item_id' => $request->item_id,
|
||||
'sub_item_id' => $request->sub_item_id,
|
||||
'user_id' => $user->id,
|
||||
'username' => $user->username,
|
||||
'province_id' => $user->province_id,
|
||||
@@ -257,31 +262,32 @@ class RequestPortalController extends Controller
|
||||
'encoded_route' => $request->encoded_route,
|
||||
'type' => $type,
|
||||
'type_fa' => MissionTypes::name($type),
|
||||
'start_date' => $violation->exit_station,
|
||||
'end_date' => $violation->enter_station,
|
||||
'start_date' => $violation->exit_time,
|
||||
'end_date' => $violation->enter_time,
|
||||
'end_point' => $request->end_point,
|
||||
'category_id' => $request->category_id,
|
||||
'category_name' => MissionCategory::name($request->category_id),
|
||||
'start_time' => $violation->exit_station,
|
||||
'finish_time' => $violation->enter_station,
|
||||
'mission_duration' => strtotime($violation->enter_station) - strtotime($violation->exit_station),
|
||||
'start_time' => $violation->exit_time,
|
||||
'finish_time' => $violation->enter_time,
|
||||
'mission_duration' => strtotime($violation->enter_time) - strtotime($violation->exit_time),
|
||||
'state_id' => MissionStates::END_MISSION->value,
|
||||
'state_name' => MissionStates::END_MISSION->label(),
|
||||
'explanation' => $request->explanation,
|
||||
'request_date' => now(),
|
||||
'machine_id' => $machine->id,
|
||||
'machine_code' => $machine->machine_code,
|
||||
'requested_machines' => $machine->car_type,
|
||||
'requested_machines' => json_encode($machine->car_type),
|
||||
'station_id' => $user->station_id,
|
||||
'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);
|
||||
|
||||
$violation->update(['status' => 1]);
|
||||
$violation->update(['status' => 1, 'mission_id' => $mission->id]);
|
||||
|
||||
// if ($mission->category_id == 2) {
|
||||
// $rpc = new OperatorController;
|
||||
|
||||
@@ -47,7 +47,7 @@ class TransportationUnitController extends Controller
|
||||
'state_name' => MissionStates::name($state),
|
||||
'machine_id' => $machine->id,
|
||||
'machine_code' => $machine->machine_code,
|
||||
'driver_id' => $request->driver_id,
|
||||
'driver_id' => $request->driver,
|
||||
'driver_name' => Rahdaran::query()->find($request->driver)->name,
|
||||
]);
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class ViolationManagementController extends Controller
|
||||
'city_name' => $user->city_fa,
|
||||
'station_id' => $user->station_id,
|
||||
'station_name' => RahdariPoint::query()->find($user->station_id)->name,
|
||||
'exit_station' => $request->exit_station,
|
||||
'exit_time' => $request->exit_time,
|
||||
]);
|
||||
|
||||
return $this->successResponse();
|
||||
@@ -68,8 +68,9 @@ class ViolationManagementController extends Controller
|
||||
public function update(UpdateRequest $request, MissionViolation $violation): JsonResponse
|
||||
{
|
||||
$violation->update([
|
||||
'enter_station' => $request->enter_station,
|
||||
'enter_time' => $request->enter_time,
|
||||
'status' => MissionViolationStatus::BEDON_EGHDAM->value,
|
||||
'end_km' => $request->end_km,
|
||||
]);
|
||||
|
||||
return $this->successResponse();
|
||||
|
||||
@@ -41,7 +41,7 @@ class FinishRequest extends FormRequest
|
||||
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
|
||||
);
|
||||
}
|
||||
if ($this->end_km < $mission->km) {
|
||||
if ($this->end_km <= $mission->km) {
|
||||
$validator->errors()->add(
|
||||
'end_km',
|
||||
'کیلومتر پایان باید بزرگتر از کیلومتر شروع باشد.'
|
||||
|
||||
@@ -25,6 +25,8 @@ class ClarifyUnauthorizedExitRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'item_id' => 'required|exists:info_items,item',
|
||||
'sub_item_id' => 'required|exists:info_items,id',
|
||||
'rahdaran' => 'array',
|
||||
'rahdaran.*' => 'exists:rahdaran,id',
|
||||
'driver' => 'required|integer|exists:rahdaran,id',
|
||||
|
||||
@@ -26,6 +26,8 @@ class ContinueMissionRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'item_id' => 'required|exists:info_items,item',
|
||||
'sub_item_id' => 'required|exists:info_items,id',
|
||||
'rahdaran' => 'array',
|
||||
'rahdaran.*' => 'exists:rahdaran,id',
|
||||
'machine_id' => 'required|integer|exists:cmms_machines,id',
|
||||
@@ -33,11 +35,11 @@ class ContinueMissionRequest extends FormRequest
|
||||
'type' => 'required|in:1,2',
|
||||
'zone' => 'required|in:1,2,3',
|
||||
'end_date' => 'required|date',
|
||||
'description' => 'string',
|
||||
'end_point' => 'required|string',
|
||||
'encoded_route' => 'required|string',
|
||||
'explanation' => 'required|string',
|
||||
'category_id' => 'required|in:1,2,3',
|
||||
'end_km'=> 'required|string',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -56,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
|
||||
{
|
||||
return [
|
||||
'item_id' => 'required|exists:info_items,item',
|
||||
'sub_item_id' => 'required|exists:info_items,id',
|
||||
'rahdaran' => 'array',
|
||||
'rahdaran.*' => 'exists:rahdaran,id',
|
||||
'requested_machines' => 'required|array',
|
||||
@@ -32,7 +34,6 @@ class StoreRequest extends FormRequest
|
||||
'zone' => 'required|in:1,2,3',
|
||||
'start_date' => 'required|date',
|
||||
'end_date' => 'required|date',
|
||||
'description' => 'string',
|
||||
'end_point' => 'required|string',
|
||||
'encoded_route' => 'required|string',
|
||||
'explanation' => 'required|string',
|
||||
|
||||
@@ -26,6 +26,8 @@ class UpdateRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'item_id' => 'required|exists:info_items,item',
|
||||
'sub_item_id' => 'required|exists:info_items,id',
|
||||
'rahdaran' => 'array',
|
||||
'rahdaran.*' => 'exists:rahdaran,id',
|
||||
'requested_machines' => 'required|array',
|
||||
@@ -33,7 +35,6 @@ class UpdateRequest extends FormRequest
|
||||
'zone' => 'required|in:1,2,3',
|
||||
'start_date' => 'required|date',
|
||||
'end_date' => 'required|date',
|
||||
'description' => 'string',
|
||||
'end_point' => 'required|string',
|
||||
'encoded_route' => 'required|string',
|
||||
'explanation' => 'required|string',
|
||||
|
||||
@@ -13,8 +13,8 @@ class DeallocateRequest extends FormRequest
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->mission->station_id == auth()->user()->station_id &&
|
||||
in_array($this->mission->state_id, [MissionStates::REQUEST_CREATED->value, MissionStates::PENDING_CONFIRMATION->value])
|
||||
return ($this->mission->station_id == auth()->user()->station_id &&
|
||||
in_array($this->mission->state_id, [MissionStates::REQUEST_CREATED->value, MissionStates::PENDING_CONFIRMATION->value]))
|
||||
|| auth()->user()->username === 'witel';
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class StoreRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'exit_station' => 'required|date',
|
||||
'exit_time' => 'required|date',
|
||||
'machine_code' => 'required',
|
||||
'km'=> 'string',
|
||||
];
|
||||
|
||||
@@ -26,7 +26,8 @@ class UpdateRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'enter_station' => 'required|date',
|
||||
'enter_time' => 'required|date',
|
||||
'end_km'=> 'required|string',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -34,12 +35,18 @@ class UpdateRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
function (Validator $validator) {
|
||||
if (strtotime($this->violation->exit_station) < strtotime($this->enter_station)) {
|
||||
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,7 +14,7 @@ class Mission extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = [];
|
||||
protected $guarded = ['id'];
|
||||
protected $hidden = ['pivot'];
|
||||
protected $casts = [
|
||||
'start_time' => 'datetime',
|
||||
|
||||
@@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
class MissionViolation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $guarded =[];
|
||||
protected $guarded =['id'];
|
||||
|
||||
public function mission(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ class ReportMachineService
|
||||
FROM missions m
|
||||
JOIN cmms_machines cm ON cm.id = m.machine_id
|
||||
WHERE m.state_id = 4 AND m.start_time >= :from AND m.finish_time <= :to
|
||||
GROUP BY machine_id;";
|
||||
GROUP BY machine_id ORDER BY missions DESC;";
|
||||
|
||||
return DB::select($sql, [
|
||||
'from' => $from,
|
||||
@@ -42,7 +42,7 @@ class ReportMachineService
|
||||
FROM missions m
|
||||
JOIN cmms_machines cm ON cm.id = m.machine_id
|
||||
WHERE m.state_id = 4 AND start_time >= :from AND finish_time <= :to AND m.province_id = :province_id
|
||||
GROUP BY machine_id;";
|
||||
GROUP BY machine_id ORDER BY missions DESC;";
|
||||
|
||||
return DB::select($sql, [
|
||||
'from' => $from,
|
||||
@@ -63,7 +63,7 @@ class ReportMachineService
|
||||
FROM missions m
|
||||
JOIN cmms_machines cm ON cm.id = m.machine_id
|
||||
WHERE m.state_id = 4 AND m.start_time >= :from AND m.finish_time <= :to
|
||||
GROUP BY cm.car_type;";
|
||||
GROUP BY cm.car_type ORDER BY missions DESC;";
|
||||
|
||||
return DB::select($sql, [
|
||||
'from' => $from,
|
||||
@@ -84,7 +84,7 @@ class ReportMachineService
|
||||
FROM missions m
|
||||
JOIN cmms_machines cm ON cm.id = m.machine_id
|
||||
WHERE m.state_id = 4 AND m.start_time >= :from AND m.finish_time <= :to AND m.province_id = :province_id
|
||||
GROUP BY cm.car_type;";
|
||||
GROUP BY cm.car_type ORDER BY missions DESC;";
|
||||
|
||||
return DB::select($sql, [
|
||||
'from' => $from,
|
||||
@@ -105,7 +105,7 @@ class ReportMachineService
|
||||
SUM(m.end_km - m.km) AS func
|
||||
FROM missions m
|
||||
WHERE m.state_id = 4 AND m.start_time >= :from AND m.finish_time <= :to
|
||||
GROUP BY m.driver_id;";
|
||||
GROUP BY m.driver_id ORDER BY missions DESC;";
|
||||
|
||||
return DB::select($sql, [
|
||||
'from' => $from,
|
||||
@@ -126,7 +126,7 @@ class ReportMachineService
|
||||
SUM(m.end_km - m.km) AS func
|
||||
FROM missions m
|
||||
WHERE m.state_id = 4 AND m.start_time >= :from AND m.finish_time <= :to AND province_id = :province_id
|
||||
GROUP BY m.driver_id;";
|
||||
GROUP BY m.driver_id ORDER BY missions DESC;";
|
||||
|
||||
return DB::select($sql, [
|
||||
'from' => $from,
|
||||
|
||||
@@ -34,7 +34,7 @@ class RequestPortalService
|
||||
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
|
||||
'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',
|
||||
'driver_id', 'driver_name'
|
||||
'driver_id', 'driver_name', 'machine_id', 'item_id', 'sub_item_id'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('mission_violations', function (Blueprint $table) {
|
||||
$table->dateTime('exit_station')->nullable();
|
||||
$table->dateTime('enter_station')->nullable();
|
||||
$table->unsignedInteger('station_id')->nullable();
|
||||
$table->string('station_name')->nullable();
|
||||
});
|
||||
@@ -25,7 +23,7 @@ return new class extends Migration
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('mission_violations', function (Blueprint $table) {
|
||||
$table->dropColumn(['exit_station', 'enter_station']);
|
||||
$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('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');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -27,18 +27,18 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4"
|
||||
<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="4"
|
||||
<th colspan="5"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4"
|
||||
<th colspan="5"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;font-size: 13px;">
|
||||
گزارش ماشین های ماموریت رفته
|
||||
</th>
|
||||
|
||||
@@ -46,7 +46,11 @@
|
||||
<tr>
|
||||
<th rowspan="1"
|
||||
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||
car_type
|
||||
کد یکتا
|
||||
</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;">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<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>
|
||||
<title>گزارش ترددهای انواع ماشین ها</title>
|
||||
|
||||
<style>
|
||||
table,
|
||||
@@ -27,20 +27,20 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4"
|
||||
<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="4"
|
||||
<th colspan="3"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4"
|
||||
<th colspan="3"
|
||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;font-size: 13px;">
|
||||
گزارش نوع ماشین های ماموریت رفته
|
||||
گزارش نوع ماشین هادرماموریت
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user