From c5a96f35ff17e71a330fd391bc3866cead3d13b4 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 14 八月 2024 15:59:42 +0800 Subject: [PATCH] 充电桩权限管理 --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java index b783e3b..6d771f5 100644 --- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java +++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java @@ -26,6 +26,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -183,20 +184,22 @@ /** * 删除充电桩 - * @param id + * @param ids * @return */ @Override - public AjaxResult delChargingPile(Integer id) { + public AjaxResult delChargingPile(Integer[] ids) { //检查是否有关联数据 //接口 - long count = chargingGunService.count(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, id).eq(TChargingGun::getDelFlag, 0)); + long count = chargingGunService.count(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, Arrays.asList(ids)).eq(TChargingGun::getDelFlag, 0)); if(count > 0){ return AjaxResult.error("该充电桩有关联的接口数据,删除失败!"); } - TChargingPile chargingPile = this.getById(id); - chargingPile.setDelFlag(true); - this.updateById(chargingPile); + for (Integer id : ids) { + TChargingPile chargingPile = this.getById(id); + chargingPile.setDelFlag(true); + this.updateById(chargingPile); + } return AjaxResult.success(); } -- Gitblit v1.7.1