diff --git a/app/Exports/ParkingSpaceRepairTemplateExport.php b/app/Exports/ParkingSpaceRepairTemplateExport.php new file mode 100644 index 0000000..20148d1 --- /dev/null +++ b/app/Exports/ParkingSpaceRepairTemplateExport.php @@ -0,0 +1,31 @@ +service = $service; + } + + /** + * @param Request $request + * @return JsonResponse + */ + public function index(Request $request): JsonResponse + { + try { + $query = ParkingSpaceRepair::query(); + + if ($request->has('parking_space_number')) { + $number = $request->input('parking_space_number'); + if ($number) { + $space_id = ParkingSpace::getValueId($number); + if ($space_id) { + $query->where('space_id', $space_id); + } else { + $query->where('id', 0); + } + } + } + + if ($request->has('parking_id')) { + $parking_id = $request->input('parking_id'); + $floor_id = $request->input('floor_id'); + if ($parking_id && !$floor_id) { + $floor_ids = AdminFloor::query()->where( + 'building_floor', + $parking_id + )->pluck('id')->toArray(); + if ($floor_ids) { + $space_ids = ParkingSpace::query()->whereIn( + 'floor_id', + $floor_ids + )->pluck('id')->toArray(); + if ($space_ids) { + $query->whereIn('space_id', $space_ids); + } else { + $query->where('id', 0); + } + } else { + $query->where('id', 0); + } + } + } + + if ($request->has('floor_id')) { + $floor_id = $request->input('floor_id'); + if ($floor_id) { + $space_ids = ParkingSpace::query()->where( + 'floor_id', + $floor_id + )->pluck('id')->toArray(); + if ($space_ids) { + $query->whereIn('space_id', $space_ids); + } else { + $query->where('id', 0); + } + } + } + + if ($request->has('start_date')) { + $start_date = $request->input('start_date'); + if ($start_date) { + $query->where('start_at', '>=', $start_date . ' 00:00:00'); + } + } + + if ($request->has('end_date')) { + $end_date = $request->input('end_date'); + if ($end_date) { + $query->where('end_at', '<=', $end_date . ' 23:59:59'); + } + } + + if ($request->has('admin_user')) { + $admin_user = $request->input('admin_user'); + if ($admin_user) { + $admin_user_ids = AdminUsers::getIds($admin_user); + if ($admin_user_ids) { + $query->whereIn('admin_user_id', $admin_user_ids); + } else { + $query->where('id', 0); + } + } + } + + // 分页 + $page = $request->input('page', 1); + $perPage = $request->input('per_page', 10); + + $total = $query->count(); + $items = $query->latest()->forPage($page, $perPage)->get()->each( + function ($item) { + return $this->service->getItem($item); + } + ); + + return $this->responseService->success([ + 'items' => $items, + 'total' => $total, + 'page' => $page, + 'per_page' => $perPage, + 'last_page' => ceil($total / $perPage), + ]); + } catch (Exception $e) { + $m_prefix = __('exception.exception_handler.resource'); + return $this->responseService->systemError( + $m_prefix . ':' . $e->getMessage() + ); + } + } + + /** + * 列表搜索数据 + * @return JsonResponse + */ + public function search(): JsonResponse + { + try { + $data = [ + 'parking_list' => Parking::getData(), + 'floor_list' => AdminFloor::getData() + ]; + return $this->responseService->success($data); + } catch (Exception $e) { + $m_prefix = __('exception.exception_handler.resource'); + return $this->responseService->systemError( + $m_prefix . ':' . $e->getMessage() + ); + } + } + + /** + * @return JsonResponse + */ + public function create(): JsonResponse + { + try { + $data = [ + 'parking_space_list' => ParkingSpace::getFloorData() + ]; + return $this->responseService->success($data); + } catch (Exception $e) { + return $this->responseService->systemError( + __('exception.get_data_failed') . ':' . $e->getMessage() + ); + } + } + + /** + * @param string $id + * @return JsonResponse + */ + public function edit(string $id): JsonResponse + { + try { + $this->validateId($id, ParkingSpaceRepair::class); + $data = [ + 'parking_space_list' => ParkingSpace::getFloorData(), + 'item' => ParkingSpaceRepair::query()->find($id, [ + 'id', + 'space_id', + 'start_at', + 'end_at' + ]) + ]; + $ParkingSpace = ParkingSpace::query()->find( + $data['item']['space_id'] + ); + $data['item']['parking_space_name'] = $ParkingSpace['number']; + $data['item']['floor'] = AdminFloor::getName( + $ParkingSpace['floor_id'] + ); + unset($data['item']['space_id']); + return $this->responseService->success($data); + } catch (Exception $e) { + return $this->responseService->systemError( + __('exception.get_data_failed') . ':' . $e->getMessage() + ); + } + } + + /** + * @param Request $request + * @param string $id + * @return JsonResponse + * @throws CustomException + * @throws ValidationException + */ + public function update(Request $request, string $id): JsonResponse + { + try { + $data = $request->all(); + $this->saveValidator($data); + $data['admin_user_id'] = $this->adminUserId; + $this->service->updateModel($data, $id); + return $this->responseService->success( + null, + __('admin.update_succeeded') + ); + } catch (ValidationException|CustomException $e) { + throw $e; + } catch (Exception $e) { + return $this->responseService->systemError( + __('admin.operation_failed') . ':' + . $e->getMessage() + ); + } + } + + /** + * @param array $data + * @param int $id + * @return void + * @throws CustomException + * @throws ValidationException + */ + protected function saveValidator(array $data, int $id = 0): void + { + $rules = [ + 'parking_space_name' => 'required', + 'start_at' => 'required', + 'end_at' => 'required' + ]; + $messages = [ + 'parking_space_name.required' => __validation( + 'parking_repair_list.psn_empty' + ), + 'start_at.required' => __validation( + 'parking_repair_list.s_empty' + ), + 'end_at.required' => __validation( + 'parking_repair_list.e_empty' + ) + ]; + if ($id) { + $this->validateId($id, ParkingSpaceRepair::class); + } + $validator = Validator::make($data, $rules, $messages); + + $start_at_times = strtotime($data['start_at']); + $end_at_times = strtotime($data['end_at']); + if ($start_at_times >= $end_at_times) { + throw new CustomException( + __validation('parking_repair_list.date_error') + ); + } + + if ($validator->fails()) { + throw new ValidationException($validator); + } + } + + /** + * @param string $id + * @return JsonResponse + * @throws CustomException + * @throws ValidationException + */ + public function destroy(string $id): JsonResponse + { + try { + $this->validateId($id, ParkingSpaceRepair::class); + $this->service->deleteModel($id); + return $this->responseService->success( + null, + __('admin.delete_succeeded') + ); + } catch (ValidationException|CustomException $e) { + throw $e; + } catch (Exception $e) { + return $this->responseService->systemError( + __('admin.operation_failed') . ':' + . $e->getMessage() + ); + } + } + + /** + * @param Request $request + * @return JsonResponse + * @throws CustomException + * @throws ValidationException + */ + public function batchDelete(Request $request): JsonResponse + { + try { + $data = $request->all(); + $rules = [ + 'ids' => 'required|array', + ]; + $messages = [ + 'ids.required' => __validation( + 'parking_repair_list.ids_empty' + ), + 'ids.array' => __validation( + 'parking_repair_list.ids_array' + ), + ]; + $validator = Validator::make($data, $rules, $messages); + + if ($validator->fails()) { + throw new ValidationException($validator); + } + $ids = $data['ids']; + $this->service->batchDeleteModel($ids); + return $this->responseService->success( + null, + __('admin.delete_succeeded') + ); + } catch (ValidationException|CustomException $e) { + throw $e; + } catch (Exception $e) { + return $this->responseService->systemError( + __('admin.operation_failed') . ':' + . $e->getMessage() + ); + } + } + + public function batchImport(Request $request) + { + try { + // 1. 验证上传的文件 + $data = $request->all(); + $validator = Validator::make($data, [ + 'file' => 'required|mimes:xlsx,xls,csv,txt|max:2048' + ], [ + 'file.required' => __validation('admin_list_vip.file_empty'), + 'file.mimes' => __validation('admin_list_vip.file_mimes'), + 'file.max' => __validation('admin_list_vip.file_max') + ]); + if ($validator->fails()) { + throw new ValidationException($validator); + } + + // 2. 获取上传的文件 + $file = $request->file('file'); + + // 3. 正确的做法:先存储文件,再获取绝对路径进行导入 + $path = $file->store('imports'); + + // 4. 执行导入(使用存储后的绝对路径) + // storage_path('app') 获取 storage/app 的绝对路径 + Excel::import( + new ParkingSpaceRepairImport($this->adminUserId), + storage_path('app/' . $path) + ); + + // 5. (可选)导入完成后删除临时文件 + Storage::delete($path); + + return $this->responseService->success( + __('controller.import.success') + ); + } catch (ValidationException $e) { + throw $e; + } catch (Exception $e) { + return $this->responseService->systemError( + __('exception.admin_vip_list.import_failed') . ':' + . $e->getMessage() + ); + } + } + + /** + * @param Request $request + * @return JsonResponse + * @throws CustomException + * @throws ValidationException + */ + public function store(Request $request): JsonResponse + { + try { + $data = $request->all(); + $this->saveValidator($data); + $data['admin_user_id'] = $this->adminUserId; + $this->service->createModel($data); + return $this->responseService->success( + null, + __('admin.save_succeeded') + ); + } catch (ValidationException|CustomException $e) { + throw $e; + } catch (Exception $e) { + return $this->responseService->systemError( + __('admin.operation_failed') . ':' + . $e->getMessage() + ); + } + } + + public function downloadTemplate() + { + return Excel::download( + new ParkingSpaceRepairTemplateExport(), + set_space_underline(__exports('parking_repair_list.list')) + . get_datetime('date_') + . '.xlsx' + ); + } + + /** + * @return JsonResponse + * @throws CustomException + * @throws ValidationException + */ + public function synchronizeList(): JsonResponse + { + try { + return $this->responseService->success( + null, + __('admin.operation_successful') + ); + } catch (ValidationException|CustomException $e) { + throw $e; + } catch (Exception $e) { + return $this->responseService->systemError( + __('admin.operation_failed') . ':' + . $e->getMessage() + ); + } + } +} diff --git a/app/Imports/ParkingSpaceRepairImport.php b/app/Imports/ParkingSpaceRepairImport.php new file mode 100644 index 0000000..ffd704c --- /dev/null +++ b/app/Imports/ParkingSpaceRepairImport.php @@ -0,0 +1,71 @@ +user_id = $admin_user_id; + } + + public function model(array $row) + { + if ($this->index == 1) { + $this->index += 1; + return; + } + $space_number = $row[1]; + if (empty($space_number)) { + return; + } + $floor_name = $row[2]; + if (empty($floor_name)) { + return; + } + $parking_name = $row[3]; + if (empty($parking_name)) { + return; + } + $start_at = $row[4]; + $start_times = strtotime($start_at); + if (empty($start_at) || !$start_times) { + return; + } + $end_at = $row[5]; + $end_times = strtotime($end_at); + if (empty($end_at) || !$end_times) { + return; + } + if ($start_times >= $end_times) { + return; + } + $space_id = ParkingSpace::getValueId($space_number); + if (empty($space_id)) { + return; + } + + $service = new ParkingSpaceRepairService(new OperationLogService()); + $service->createModel([ + 'admin_user_id' => $this->user_id, + 'parking_space_name' => $space_number, + 'start_at' => date("Y-m-d H:i:s", $start_times), + 'end_at' => date("Y-m-d H:i:s", $end_times) + ]); + } + + public function chunkSize(): int + { + return 1000; // 设置每次处理的行数,有助于避免内存问题并可能改善表头解析 + } +} diff --git a/app/Models/ParkingSpace.php b/app/Models/ParkingSpace.php index e17501f..0b65bac 100644 --- a/app/Models/ParkingSpace.php +++ b/app/Models/ParkingSpace.php @@ -76,6 +76,17 @@ class ParkingSpace extends Model )->get()->toArray(); } + public static function getFloorData() + { + return self::query()->orderBy('created_at', 'desc')->select( + ['id', 'number', 'floor_id'] + )->get()->each(function ($item) { + $item['floor'] = AdminFloor::getName($item['floor_id']); + unset($item['floor_id']); + return $item; + })->toArray(); + } + public static function getModeFloorCount($floor_id, $spaceIds, $status = '11', $type = '') { $model = self::query(); diff --git a/app/Models/ParkingSpaceRepair.php b/app/Models/ParkingSpaceRepair.php new file mode 100644 index 0000000..cd22799 --- /dev/null +++ b/app/Models/ParkingSpaceRepair.php @@ -0,0 +1,47 @@ +find($item['space_id']); + $item['parking_space_number'] = $ParkingSpace['number']; + $Floor = AdminFloor::query()->find($ParkingSpace['floor_id']); + $item['floor'] = $Floor['name']; + $item['parking'] = Parking::getName($Floor['building_floor']); + $item['admin_user'] = AdminUsers::getUsername($item['admin_user_id']); + $syncStatusArr = $this->getSyncStatus(); + $item['sync_status_str'] = $syncStatusArr[$item['sync_status']] ?? ''; + unset($item['admin_user_id'], $item['space_id']); + return $item; + } + + /** + * @return array|string[] + */ + public function getSyncStatus(): array + { + $syncStatusArr = $this->syncStatusArr; + foreach ($syncStatusArr as $key => $value) { + $syncStatusArr[$key] = __service($this->menuTitle . '.' . $value); + } + return $syncStatusArr; + } + + /** + * @param array $data + * @throws Exception + */ + public function createModel(array $data) + { + try { + DB::beginTransaction(); + $spaceNameArr = explode(',', $data['parking_space_name']); + foreach ($spaceNameArr as $parking_space_name) { + $space_id = ParkingSpace::getValueId($parking_space_name); + + $model = ParkingSpaceRepair::query()->create([ + 'space_id' => $space_id, + 'admin_user_id' => $data['admin_user_id'], + 'start_at' => $data['start_at'], + 'end_at' => $data['end_at'], + 'created_at' => get_datetime() + ]); + + $this->logService->logCreated( + $model, + $this->menuTitle . '.create' + ); + } + + DB::commit(); + return $model; + } catch (Exception $e) { + DB::rollBack(); + throw $e; + } + } + + /** + * @param array $data + * @param int $id + * @throws Exception + */ + public function updateModel(array $data, int $id) + { + try { + DB::beginTransaction(); + + $space_id = ParkingSpace::getValueId($data['parking_space_name']); + + // 更新 + $model = ParkingSpaceRepair::query()->findOrFail($id); + $oldValues = $model->toArray(); + + $model->update([ + 'space_id' => $space_id, + 'admin_user_id' => $data['admin_user_id'], + 'start_at' => $data['start_at'], + 'end_at' => $data['end_at'], + 'updated_at' => get_datetime() + ]); + + $this->logService->logUpdated( + $model, + $oldValues, + $this->menuTitle . '.update' + ); + + DB::commit(); + return $model; + } catch (Exception $e) { + DB::rollBack(); + throw $e; + } + } + + /** + * @param $id + * @return bool + * @throws Exception + */ + public function deleteModel($id): bool + { + try { + DB::beginTransaction(); + + $model = ParkingSpaceRepair::query()->findOrFail($id); + + $this->logService->logDeleted($model, $this->menuTitle . '.delete'); + + $model->delete(); + + DB::commit(); + return true; + } catch (Exception $e) { + DB::rollBack(); + throw $e; + } + } + + /** + * @param $ids + * @return bool + * @throws Exception + */ + public function batchDeleteModel($ids): bool + { + try { + DB::beginTransaction(); + + foreach ($ids as $id) { + $model = ParkingSpaceRepair::query()->findOrFail($id); + $this->logService->logDeleted( + $model, + $this->menuTitle . '.delete' + ); + $model->delete(); + } + + DB::commit(); + return true; + } catch (Exception $e) { + DB::rollBack(); + throw $e; + } + } +} diff --git a/database/migrations/2026_06_08_143449_create_parking_space_repair_table.php b/database/migrations/2026_06_08_143449_create_parking_space_repair_table.php new file mode 100644 index 0000000..38e2a64 --- /dev/null +++ b/database/migrations/2026_06_08_143449_create_parking_space_repair_table.php @@ -0,0 +1,36 @@ +id(); + $table->integer('space_id')->comment('车位'); + $table->integer('admin_user_id')->comment('操作员'); + $table->timestamp('start_at')->comment('维修开始时间'); + $table->timestamp('end_at')->nullable()->comment('维修结束时间'); + $table->tinyInteger('sync_status')->default(0)->comment('同步状态'); + $table->timestamp('sync_at')->nullable()->comment('维修结束时间'); + $table->timestamps(); + $table->softDeletes(); + $table->innoDb(); + $table->comment('车位维修'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('parking_space_repair'); + } +}; diff --git a/resources/lang/en/exports.php b/resources/lang/en/exports.php index 032f18c..2d929d1 100644 --- a/resources/lang/en/exports.php +++ b/resources/lang/en/exports.php @@ -90,5 +90,10 @@ return [ 'channel' => 'Access channel', 'reason' => 'Reason for passage', 'member_type' => 'Identity type' + ], + 'parking_repair_list' => [ + 'list' => 'Maintenance Parking Space Import Template', + 'start_at' => 'Maintenance start time', + 'end_at' => 'End time of maintenance' ] ]; diff --git a/resources/lang/en/log.php b/resources/lang/en/log.php index 1d8db2a..0df7020 100644 --- a/resources/lang/en/log.php +++ b/resources/lang/en/log.php @@ -138,5 +138,10 @@ return [ 'alarm_information' => [ 'allocation_user' => 'Assign handlers', 'edit_remark' => "Editor's note" + ], + 'parking_repair_list' => [ + 'create' => 'Create a maintenance parking space', + 'update' => 'Update and repair parking spaces', + 'delete' => 'Delete maintenance parking space' ] ]; diff --git a/resources/lang/en/service.php b/resources/lang/en/service.php index ca76a09..fc735d6 100644 --- a/resources/lang/en/service.php +++ b/resources/lang/en/service.php @@ -162,5 +162,9 @@ return [ 'handler2' => 'Operation duty B', 'handler3' => 'Engineering Maintenance Team', 'handler4' => 'Security patrol' + ], + 'parking_repair_list' => [ + 'not_synced' => 'Not synced', + 'synced' => 'Synchronized' ] ]; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index 90f731e..1c8f7b4 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -170,5 +170,13 @@ return [ 'n_empty' => 'The reason for passage cannot be empty', 'c_empty' => 'The passage cannot be empty', 'c_array' => 'The passage channel data must be an array', + ], + 'parking_repair_list' => [ + 'psn_empty' => '車位號碼不能為空', + 's_empty' => '維修開始時間不能為空', + 'e_empty' => '維修結束時間不能為空', + 'ids_empty' => '請選擇要删除的數據', + 'ids_array' => '所選數據必須是數組', + 'date_error' => '開始時間不能大於結束時間' ] ]; diff --git a/resources/lang/zh-CN/exports.php b/resources/lang/zh-CN/exports.php index 85ab45c..00d8d84 100644 --- a/resources/lang/zh-CN/exports.php +++ b/resources/lang/zh-CN/exports.php @@ -90,5 +90,10 @@ return [ 'channel' => '通行通道', 'reason' => '通行原因', 'member_type' => '身份类型' + ], + 'parking_repair_list' => [ + 'list' => '维修车位导入模板', + 'start_at' => '维修开始时间', + 'end_at' => '维修结束时间' ] ]; diff --git a/resources/lang/zh-CN/log.php b/resources/lang/zh-CN/log.php index 4abe13a..8c7e6f4 100644 --- a/resources/lang/zh-CN/log.php +++ b/resources/lang/zh-CN/log.php @@ -138,5 +138,10 @@ return [ 'alarm_information' => [ 'allocation_user' => '分配处理人', 'edit_remark' => '编辑备注' + ], + 'parking_repair_list' => [ + 'create' => '创建维修车位', + 'update' => '更新维修车位', + 'delete' => '删除维修车位' ] ]; diff --git a/resources/lang/zh-CN/service.php b/resources/lang/zh-CN/service.php index 4785dc2..8868b1b 100644 --- a/resources/lang/zh-CN/service.php +++ b/resources/lang/zh-CN/service.php @@ -162,5 +162,9 @@ return [ 'handler2' => '运营值班 B', 'handler3' => '工程维保组', 'handler4' => '安保巡逻' + ], + 'parking_repair_list' => [ + 'not_synced' => '未同步', + 'synced' => '已同步' ] ]; diff --git a/resources/lang/zh-CN/validation.php b/resources/lang/zh-CN/validation.php index 0d5d037..a779b8e 100644 --- a/resources/lang/zh-CN/validation.php +++ b/resources/lang/zh-CN/validation.php @@ -170,5 +170,13 @@ return [ 'n_empty' => '通行原因不能为空', 'c_empty' => '通行通道不能为空', 'c_array' => '通行通道数据必须是数组', + ], + 'parking_repair_list' => [ + 'psn_empty' => '车位号码不能为空', + 's_empty' => '维修开始时间不能为空', + 'e_empty' => '维修结束时间不能为空', + 'ids_empty' => '请选择要删除的数据', + 'ids_array' => '所选数据必须是数组', + 'date_error' => '开始时间不能大于结束时间' ] ]; diff --git a/resources/lang/zh-TW/exports.php b/resources/lang/zh-TW/exports.php index 1ce25ad..d13cb18 100644 --- a/resources/lang/zh-TW/exports.php +++ b/resources/lang/zh-TW/exports.php @@ -90,5 +90,10 @@ return [ 'channel' => '通行通道', 'reason' => '通行原因', 'member_type' => '身份類型' + ], + 'parking_repair_list' => [ + 'list' => '維修車位導入範本', + 'start_at' => '維修開始時間', + 'end_at' => '維修結束時間' ] ]; diff --git a/resources/lang/zh-TW/log.php b/resources/lang/zh-TW/log.php index 4fb1055..86fe102 100644 --- a/resources/lang/zh-TW/log.php +++ b/resources/lang/zh-TW/log.php @@ -138,5 +138,10 @@ return [ 'alarm_information' => [ 'allocation_user' => '分配處理人', 'edit_remark' => '編輯備註' + ], + 'parking_repair_list' => [ + 'create' => '創建維修車位', + 'update' => '更新維修車位', + 'delete' => '删除維修車位' ] ]; diff --git a/resources/lang/zh-TW/service.php b/resources/lang/zh-TW/service.php index 966370b..fcee6d5 100644 --- a/resources/lang/zh-TW/service.php +++ b/resources/lang/zh-TW/service.php @@ -162,5 +162,9 @@ return [ 'handler2' => '運營值班 B', 'handler3' => '工程維保組', 'handler4' => '安保巡邏' + ], + 'parking_repair_list' => [ + 'not_synced' => '未同步', + 'synced' => '已同步' ] ]; diff --git a/resources/lang/zh-TW/validation.php b/resources/lang/zh-TW/validation.php index 6b36b67..9b80af2 100644 --- a/resources/lang/zh-TW/validation.php +++ b/resources/lang/zh-TW/validation.php @@ -170,5 +170,13 @@ return [ 'n_empty' => '通行原因不能為空', 'c_empty' => '通行通道不能為空', 'c_array' => '通行通道數據必須是數組', + ], + 'parking_repair_list' => [ + 'psn_empty' => 'The parking number cannot be empty', + 's_empty' => 'The start time of maintenance cannot be empty', + 'e_empty' => 'The repair end time cannot be empty', + 'ids_empty' => 'Please select the data to be deleted', + 'ids_array' => 'The selected data must be an array', + 'date_error' => 'The start time cannot be greater than the end time' ] ]; diff --git a/routes/admin/api.php b/routes/admin/api.php index 22d0fd4..47dc5ef 100644 --- a/routes/admin/api.php +++ b/routes/admin/api.php @@ -39,6 +39,7 @@ use App\Http\Controllers\Admin\ParkingEquipmentController; use App\Http\Controllers\Admin\ParkingWhitelistController; use App\Http\Controllers\Admin\ParkingAbnormalController; use App\Http\Controllers\Admin\ParkingAlarmInformationController; +use App\Http\Controllers\Admin\ParkingSpaceRepairController; Route::group(['prefix' => 'admin'], function () { @@ -158,7 +159,19 @@ Route::group(['prefix' => 'admin'], function () { Route::post('/information', [ParkingInformationController::class, 'store']); Route::delete('/information/{id}', [ParkingInformationController::class, 'destroy']); Route::get('/information/clear', [ParkingInformationController::class, 'clear']); - Route::get('/information/rule', [ParkingInformationController::class, 'rule']); + Route::get('/information/rule', [ParkingInformationController::class, 'rule']);; + // 维修车位列表 + Route::get('/parkingRepair', [ParkingSpaceRepairController::class, 'index']); + Route::get('/parkingRepair/create', [ParkingSpaceRepairController::class, 'create']); + Route::post('/parkingRepair', [ParkingSpaceRepairController::class, 'store']); + Route::get('/parkingRepair/edit/{id}', [ParkingSpaceRepairController::class, 'edit']); + Route::put('/parkingRepair/{id}', [ParkingSpaceRepairController::class, 'update']); + Route::delete('/parkingRepair/{id}', [ParkingSpaceRepairController::class, 'destroy']); + Route::post('/parkingRepair/batchDelete', [ParkingSpaceRepairController::class, 'batchDelete']); + Route::post('/parkingRepair/batchParkingRepair', [ParkingSpaceRepairController::class, 'batchImport']); + Route::get('/parkingRepair/synchronizeList', [ParkingSpaceRepairController::class, 'synchronizeList']); + Route::get('/parkingRepair/search', [ParkingSpaceRepairController::class, 'search']); + Route::get('/parkingRepair/rule', [ParkingSpaceRepairController::class, 'rule']); // VIP名单 Route::get('/vipList', [VipListController::class, 'index']); @@ -344,4 +357,5 @@ Route::group(['prefix' => 'admin'], function () { Route::get('/licensePlateRecognition/export', [LicensePlateRecognitionController::class, 'export']); Route::get('/whitelist/downloadTemplate', [ParkingWhitelistController::class, 'downloadTemplate']); Route::get('/whitelist/export', [ParkingWhitelistController::class, 'export']); + Route::get('/parkingRepair/downloadTemplate', [ParkingSpaceRepairController::class, 'downloadTemplate']); });