From 21dbee73f1310f6c57efdc70982d58e354154183 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期四, 31 十月 2024 09:33:59 +0800 Subject: [PATCH] merge --- ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/service/impl/TChargingPileServiceImpl.java | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 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 c6dfd19..41f00fb 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 @@ -482,13 +482,14 @@ 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(); @@ -598,20 +599,18 @@ if(datas.size() > 0){ for (TChargingPile data : datas) { - if(data.getStatus() == 1){ - TFaultMessage faultMessage = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, data.getId()) - .eq(TFaultMessage::getStatus, 1).eq(TFaultMessage::getDelFlag, 0).isNull(TFaultMessage::getEndTime)); - if(null == faultMessage){ - faultMessage = new TFaultMessage(); - faultMessage.setSiteId(data.getSiteId()); - faultMessage.setChargingPileId(data.getId()); - faultMessage.setStatus(1); - faultMessage.setDownTime(LocalDateTime.now()); - faultMessage.setCreateTime(LocalDateTime.now()); - faultMessage.setDelFlag(false); - faultMessage.setContent("设备离线"); - faultMessageService.save(faultMessage); - } + TFaultMessage faultMessage = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, data.getId()) + .eq(TFaultMessage::getStatus, 1).eq(TFaultMessage::getDelFlag, 0).isNull(TFaultMessage::getEndTime)); + if(null == faultMessage){ + faultMessage = new TFaultMessage(); + faultMessage.setSiteId(data.getSiteId()); + faultMessage.setChargingPileId(data.getId()); + faultMessage.setStatus(1); + faultMessage.setDownTime(LocalDateTime.now()); + faultMessage.setCreateTime(LocalDateTime.now()); + faultMessage.setDelFlag(false); + faultMessage.setContent("设备离线"); + faultMessageService.save(faultMessage); } } this.updateBatchById(datas); -- Gitblit v1.7.1