From c80c0184b6e560d41d5aa5691874e07b681fa18f Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 17 一月 2025 18:41:24 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TCarportController.java |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TCarportController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TCarportController.java
index 86d307b..66a452d 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TCarportController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TCarportController.java
@@ -12,11 +12,14 @@
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.log.enums.OperatorType;
+import com.ruoyi.common.security.annotation.Logical;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -44,6 +47,7 @@
     /**
      * 通过停车场id查询车库及车道信息
      */
+    @RequiresPermissions(value = {"/parkingLot"}, logical = Logical.OR)
     @ApiOperation(tags = {"后台-车库"},value = "通过停车场id查询车库及车道信息")
     @GetMapping(value = "/queryCarportByParkId")
     public AjaxResult<List<TCarportVO>> queryCarportByParkId(@RequestParam(value = "parkingLotId", required = true) Integer parkingLotId) {
@@ -54,7 +58,8 @@
     /**
      * 添加车库管理
      */
-    @Log(title = "添加车库", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE)
+    @RequiresPermissions(value = {"/parkingLot/add_garage"}, logical = Logical.OR)
+    @Log(title = "【车库】添加车库", businessType = BusinessType.INSERT)
     @ApiOperation(tags = {"后台-车库"},value = "添加车库")
     @PostMapping(value = "/add")
     public AjaxResult<Boolean> add(@RequestBody TCarport dto) {
@@ -64,7 +69,8 @@
     /**
      * 修改车库
      */
-    @Log(title = "修改车库", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE)
+    @RequiresPermissions(value = {"/parkingLot/update_garage"}, logical = Logical.OR)
+    @Log(title = "【车库】修改车库", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE)
     @ApiOperation(tags = {"后台-车库"},value = "修改车库")
     @PostMapping(value = "/update")
     public AjaxResult<Boolean> update(@RequestBody TCarport dto) {
@@ -74,6 +80,7 @@
     /**
      * 查看车库详情
      */
+    @RequiresPermissions(value = {"/parkingLot/update_garage"}, logical = Logical.OR)
     @ApiOperation(tags = {"后台-车库"},value = "查看车库详情")
     @GetMapping(value = "/getDetailById")
     public AjaxResult<TCarport> getDetailById(@RequestParam("id") Integer id) {
@@ -83,7 +90,8 @@
     /**
      * 删除车库
      */
-    @Log(title = "删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
+    @RequiresPermissions(value = {"/parkingLot/del_garage"}, logical = Logical.OR)
+    @Log(title = "【车库】删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
     @ApiOperation(tags = {"后台-车库"},value = "删除车库")
     @DeleteMapping(value = "/deleteById")
     public AjaxResult<Boolean> deleteById(@RequestParam("id") Integer id) {
@@ -96,14 +104,16 @@
     /**
      * 批量删除车库
      */
-    @Log(title = "批量删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
+    @RequiresPermissions(value = {"/parkingLot/del_garage"}, logical = Logical.OR)
+    @Log(title = "【车库】批量删除车库", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
     @ApiOperation(tags = {"后台-车库"},value = "批量删除车库")
     @DeleteMapping(value = "/deleteByIds")
-    public AjaxResult<Boolean> deleteByIds(@RequestBody BaseDelete baseDelete) {
+    public AjaxResult<Boolean> deleteByIds(@RequestParam String ids) {
+        String[] split = ids.split(",");
         // 刪除车道信息
         vehicleRampService.remove(Wrappers.lambdaQuery(TVehicleRamp.class)
-                .in(TVehicleRamp::getCarportId, baseDelete.getIds()));
-        return AjaxResult.ok(carportService.removeByIds(baseDelete.getIds()));
+                .in(TVehicleRamp::getCarportId, Arrays.asList(split)));
+        return AjaxResult.ok(carportService.removeByIds(Arrays.asList(split)));
     }
     
 }

--
Gitblit v1.7.1