| | |
| | | Set<Integer> siteIds = new HashSet<>(); |
| | | if(0 == query.getSiteId()){ |
| | | SysUser sysUser = sysUserClient.getSysUser(SecurityUtils.getUserId()).getData(); |
| | | R<Integer> admin = sysUserClient.isAdmin(SecurityUtils.getUserId()); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | Integer objectId = sysUser.getObjectId(); |
| | | if(2 == roleType){ |
| | | siteIds = partnerService.authSite(objectId, SiteMenu.SITE_LIST); |
| | | }else{ |
| | | //非管理员需要根据角色和用户配置查询允许的站点数据 |
| | | if(!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | if(admin.getData()!=1){ |
| | | List<Integer> data = userSiteClient.getSiteIds(sysUser.getUserId()).getData(); |
| | | List<SysUserRoleVo> data2 = sysUserRoleClient.getRoleByUserId(sysUser.getUserId()).getData(); |
| | | List<Integer> data1 = roleSiteClient.getSiteIds(data2.get(0).getRoleId()).getData(); |
| | |
| | | chargingGunService.updateById(chargingGun1); |
| | | |
| | | //桩处于正常,桩所属的枪都处于非正常,修改桩状态为异常 |
| | | TChargingPile chargingPile = this.getById(chargingGun1.getChargingPileId()); |
| | | TChargingPile chargingPile = this.getById(chargingGun.getChargingPileId()); |
| | | List<TChargingGun> list1 = chargingGunService.list(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getChargingPileId, chargingPile.getId()).eq(TChargingGun::getDelFlag, 0)); |
| | | int size = list1.stream().filter(s -> s.getStatus() == 1 || s.getStatus() == 7).collect(Collectors.toList()).size(); |
| | | if(chargingPile.getStatus() == 1 && list1.size() == size){ |