| | |
| | | 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("该合作商已关联站点不可删除!"); |
| | | } |
| | | //充电桩 |
| | | 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("该合作商已关联充电桩不可删除!"); |
| | | } |
| | |
| | | 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); |