luodangjia
2024-10-21 0cffe10d0563f7e2c98b4eca1467699244051b07
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/PartnerServiceImpl.java
@@ -284,12 +284,12 @@
   public AjaxResult delPartner(List<Integer> ids) {
      //查询有无关联数据
      //站点
      long count = siteService.count(new LambdaQueryWrapper<Site>().in(Site::getPartnerId, Arrays.asList(ids)).eq(Site::getDelFlag, 0));
      long count = siteService.count(new LambdaQueryWrapper<Site>().in(Site::getPartnerId, ids).eq(Site::getDelFlag, 0));
      if(count > 0){
         return AjaxResult.error("该合作商已关联站点不可删除!");
         return AjaxResult.error("该合作商已关联站点不可删除");
      }
      //充电桩
      long count1 = chargingPileService.count(new LambdaQueryWrapper<TChargingPile>().in(TChargingPile::getPartnerId, Arrays.asList(ids)).eq(TChargingPile::getDelFlag, 0));
      long count1 = chargingPileService.count(new LambdaQueryWrapper<TChargingPile>().in(TChargingPile::getPartnerId, ids).eq(TChargingPile::getDelFlag, 0));
      if(count1 > 0){
         return AjaxResult.error("该合作商已关联充电桩不可删除!");
      }
@@ -298,7 +298,7 @@
         if(null == partner){
            return AjaxResult.error("删除失败");
         }
         this.removeById(partner);
         this.removeById(id);
         SysUser user = sysUserClient.queryUserByUserName(partner.getAccount()).getData();
         user.setDelFlag("2");
         sysUserClient.updateUser(user);
@@ -338,6 +338,9 @@
   @Override
   public GetPermissionConfigurationDTO getPermissionConfiguration(Integer siteId, Integer partnerId) {
      Partner partner = this.getById(partnerId);
      if(null == partner){
         throw new RuntimeException("该站点合作商无效");
      }
      GetPermissionConfigurationDTO dto = new GetPermissionConfigurationDTO();
      dto.setPermissionRemarks(partner.getPermissionRemarks());
      List<TPartnerSite> list = partnerSiteService.list(new LambdaQueryWrapper<TPartnerSite>()