xuhy
2025-08-26 f221182c97f52bc7121b042b7ab16bf13813f851
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TChargingPileController.java
@@ -18,7 +18,8 @@
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 com.ruoyi.common.security.service.TokenService;
import com.ruoyi.system.api.domain.SysUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -48,14 +49,16 @@
    private final TChargingPileService chargingPileService;
    private final TChargingGunService chargingGunService;
    private final TokenService tokenService;
   @Resource
   private RedisTemplate redisTemplate;
    @Autowired
    public TChargingPileController(TChargingPileService chargingPileService, TChargingGunService chargingGunService) {
    public TChargingPileController(TChargingPileService chargingPileService, TChargingGunService chargingGunService, TokenService tokenService) {
        this.chargingPileService = chargingPileService;
        this.chargingGunService = chargingGunService;
        this.tokenService = tokenService;
    }
    /**
@@ -100,17 +103,17 @@
   
   
   
   @RequiresPermissions(value = {"/chargingPile", "/chargingGun"}, logical = Logical.OR)
   @ResponseBody
   @GetMapping("/pageChargingPileList")
   @ApiOperation(value = "获取充电桩列表数据", tags = {"管理后台-充电桩信息"})
   public AjaxResult<PageInfo<PageChargingPileListDTO>> pageChargingPileList(PageChargingPileList page){
      PageInfo<PageChargingPileListDTO> list = chargingPileService.pageChargingPileList(page);
      SysUser sysUser = tokenService.getLoginUser().getSysUser();
      Integer siteId = sysUser.getSiteId();
      PageInfo<PageChargingPileListDTO> list = chargingPileService.pageChargingPileList(page,siteId);
      return AjaxResult.success(list);
   }
   
   
   @RequiresPermissions(value = {"/chargingPile/add"}, logical = Logical.OR)
   @ResponseBody
   @Log(title = "【充电桩信息】添加充电桩数据", businessType = BusinessType.INSERT,operatorType = OperatorType.MANAGE)
   @PostMapping("/addChargingPile")
@@ -120,7 +123,6 @@
   }
   
   
   @RequiresPermissions(value = {"/chargingPile/select", "/chargingPile/update"}, logical = Logical.OR)
   @ResponseBody
   @GetMapping("/getChargingPile/{id}")
   @ApiOperation(value = "获取充电桩详情数据", tags = {"管理后台-充电桩信息"})
@@ -130,7 +132,6 @@
   }
   
   
   @RequiresPermissions(value = {"/chargingPile/update"}, logical = Logical.OR)
   @ResponseBody
   @Log(title = "【充电桩信息】编辑充电桩数据", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE)
   @PostMapping("/editChargingPile")
@@ -141,7 +142,6 @@
   
   
   
   @RequiresPermissions(value = {"/chargingPile/del", "/chargingPile/batch_del"}, logical = Logical.OR)
   @ResponseBody
   @DeleteMapping("/delChargingPile")
   @Log(title = "【充电桩信息】删除充电桩", businessType = BusinessType.DELETE,operatorType = OperatorType.MANAGE)
@@ -154,7 +154,6 @@
   }
   
   
   @RequiresPermissions(value = {"/chargingPile/accountingStrategy"}, logical = Logical.OR)
   @ResponseBody
   @Log(title = "【充电桩信息】批量设置计费策略", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE)
   @PostMapping("/batchSetAccountingStrategy")