add axis type to safety excel

This commit is contained in:
2025-04-08 11:11:26 +03:30
parent 6734eed822
commit 93d1775379
5 changed files with 65 additions and 9 deletions

View File

@@ -141,6 +141,7 @@ class SafetyAndPrivacyController extends Controller
'step_fa' => 'گام سوم (برخورد)',
'action_picture' => FileFacade::save($request->action_picture, "safety_and_privacy/{$safetyAndPrivacy->id}/action_picture"),
'action_picture_document_upload_date' => now(),
'action_date' => $request->action_date,
]);
$user->addActivityComplete(1136);
@@ -201,4 +202,25 @@ class SafetyAndPrivacyController extends Controller
->select('id', 'item', 'item_str', 'sub_item_str as name', 'sub_item_unit as unit', 'needs_image', 'needs_end_point', 'sub_item')
->get());
}
public function map(Request $request): JsonResponse
{
$province = $request->province_id;
$edare_shahri = $request->edare_shahri_id;
$step = $request->step;
$info_id = $request->info_id;
$fromDate = $request->from_date ? $request->from_date . ' 00:00:00' : now()->startOfDay()->toDateTimeString();
$toDate = $request->date_to ? $request->date_to . ' 23:59:59' : now()->endOfDay()->toDateTimeString();
$activities = SafetyAndPrivacy::query()
->when($province, fn ($query) => $query->where('province_id', '=', $province))
->when($edare_shahri, fn($query) => $query->where('edarate_shahri_id', '=', $edare_shahri))
->when($step, fn($query) => $query->where('step', '=', $step))
->when($info_id, fn($query) => $query->where('info_id', '=', $info_id))
->whereBetween('created_at', [$fromDate, $toDate])
->select('id', 'lat', 'lon', 'step')
->get();
return $this->successResponse($activities);
}
}

View File

@@ -23,6 +23,7 @@ class ThirdStepStoreRequest extends FormRequest
{
return [
'action_picture' => 'required|image',
'action_date' => 'required|date',
];
}
}

View File

@@ -20,7 +20,7 @@ class SafetyAndPrivacyTableService
$fields = ['id','lat','lon','province_id','province_fa','city_id','city_fa','edare_shahri_id','edare_shahri_name',
'recognize_picture','action_picture','operator_id','operator_name','way_id','created_at','updated_at','step',
'info_id','info_fa','activity_date_time', 'action_picture_document_upload_date', 'judiciary_document_upload_date',
'step_fa', 'axis_type_id', 'axis_type_name'
'step_fa', 'axis_type_id', 'axis_type_name', 'action_date'
];
if ($user->hasPermissionTo('show-safety-and-privacy-operator-cartable')) {

View File

@@ -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('safety_and_privacy', function (Blueprint $table) {
$table->dateTime('action_date')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('safety_and_privacy', function (Blueprint $table) {
$table->dropColumn('action_date');
});
}
};

View File

@@ -52,7 +52,15 @@
</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;">
@@ -60,20 +68,16 @@
</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>
@@ -84,6 +88,8 @@
<td style="border: 1px solid black;text-align: center;">{{ $item['province_fa'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['edare_shahri_name'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['info_fa'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['axis_type_name'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['created_at'] ? verta($item['created_at'])->format('Y/n/j H:i:s') : '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['activity_date_time'] ? verta($item['activity_date_time'])->format('Y/n/j H:i:s') : '-' }}</td>
<td style="border: 1px solid black;text-align: center;">
@@ -95,7 +101,6 @@
</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['step_fa'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['created_at'] ? verta($item['created_at'])->format('Y/n/j H:i:s') : '-' }}</td>
</tr>
@endforeach
</tbody>