From caaf2bbc928eb395e69da2b7d8dfb4b7c73fbbc2 Mon Sep 17 00:00:00 2001 From: yuyang Date: Fri, 30 Sep 2022 10:27:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xhpc/auth/service/SysLoginService.java | 4 ++-- .../station/mapper/XhpcPileEditionMapper.java | 2 +- .../station/service/XhpcPileEditionServiceImpl.java | 13 +++++++++---- .../resources/mapper/XhpcEquipmenMonitorMapper.xml | 1 + .../main/resources/mapper/XhpcPileEditionMapper.xml | 9 ++++++--- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ruoyi-auth/src/main/java/com/xhpc/auth/service/SysLoginService.java b/ruoyi-auth/src/main/java/com/xhpc/auth/service/SysLoginService.java index c071b50d..e6787278 100644 --- a/ruoyi-auth/src/main/java/com/xhpc/auth/service/SysLoginService.java +++ b/ruoyi-auth/src/main/java/com/xhpc/auth/service/SysLoginService.java @@ -88,14 +88,14 @@ public class SysLoginService if(type==0){ if(user.getDataPowerType()!=0){ remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "登陆地址错误"); - throw new BaseException("登陆地址错误,请在管理员界面登陆"); + throw new BaseException("登陆地址错误,请在运营商界面登陆"); } }else{ if(user.getDataPowerType()==1 ||user.getDataPowerType()==2){ }else{ remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "登陆地址错误"); - throw new BaseException("登陆地址错误,请在运营商界面登陆"); + throw new BaseException("登陆地址错误,请在管理员界面登陆"); } } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcPileEditionMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcPileEditionMapper.java index c23b138d..512647f7 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcPileEditionMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcPileEditionMapper.java @@ -12,7 +12,7 @@ import java.util.Map; */ public interface XhpcPileEditionMapper { - List> list(@Param("chargingStationId")Long chargingStationId, @Param("chargingPileIds") String chargingPileIds,@Param("logOperatorId")Long logOperatorId, @Param("type")Integer type, @Param("tenantId")String tenantId); + List> list(@Param("chargingStationId")Long chargingStationId,@Param("chargingPileIds") List chargingPileIds,@Param("logOperatorId")Long logOperatorId, @Param("type")Integer type, @Param("tenantId")String tenantId); /** * diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcPileEditionServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcPileEditionServiceImpl.java index c0b431fe..1baee1ff 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcPileEditionServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcPileEditionServiceImpl.java @@ -44,24 +44,29 @@ public class XhpcPileEditionServiceImpl extends BaseService implements IXhpcPil Long sysUserId = sysUser.getUserId(); String tenantId =loginUser.getTenantId(); //判断登录人的权限 + List listPileIds = new ArrayList(); + if(chargingPileIds !=null && !"".equals(chargingPileIds)){ + String[] split = chargingPileIds.split(","); + listPileIds = Arrays.asList(split); + } List> list =new ArrayList<>(); if(UserTypeUtil.SYS_USER_TYPE_FOUR.equals(sysUser.getUserType())){ //运维人员权限 - list = xhpcPileEditionMapper.list(chargingStationId,chargingPileIds,sysUserId,3,tenantId); + list = xhpcPileEditionMapper.list(chargingStationId,listPileIds,sysUserId,3,tenantId); }else{ if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){ // startPage(); if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){ Long logOperatorId = sysUser.getOperatorId(); //运营商看自己的场站 - list = xhpcPileEditionMapper.list(chargingStationId,chargingPileIds,logOperatorId,1,tenantId); + list = xhpcPileEditionMapper.list(chargingStationId,listPileIds,logOperatorId,1,tenantId); }else{ //查询赋值的场站 - list = xhpcPileEditionMapper.list(chargingStationId,chargingPileIds,sysUserId,2,tenantId); + list = xhpcPileEditionMapper.list(chargingStationId,listPileIds,sysUserId,2,tenantId); } }else{ // startPage(); - list = xhpcPileEditionMapper.list(chargingStationId,chargingPileIds,sysUserId,0,tenantId); + list = xhpcPileEditionMapper.list(chargingStationId,listPileIds,sysUserId,0,tenantId); } } return list; diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcEquipmenMonitorMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcEquipmenMonitorMapper.xml index 2e664717..e20aac56 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcEquipmenMonitorMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcEquipmenMonitorMapper.xml @@ -28,6 +28,7 @@ xem.equipmen_name as equipmenName, xem.equipmen_number as equipmenNumber, st.name as chargingStationName, + st.charging_station_id as chargingStationId, xem.create_time as createTime from xhpc_equipmen_monitor as xem left join xhpc_charging_station as st on st.charging_station_id =xem.charging_station_id diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcPileEditionMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcPileEditionMapper.xml index 68bdd45c..5f921006 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcPileEditionMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcPileEditionMapper.xml @@ -37,9 +37,6 @@ and xpe.charging_station_id = #{chargingStationId} - - and find_in_set(xpe.charging_pile_ids, #{chargingPileIds}) - and xpe.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{logOperatorId}) @@ -49,6 +46,12 @@ and find_in_set (xpe.charging_station_id,(select station_ids from xhpc_work_user where work_user_id=#{logOperatorId})) + + and + + find_in_set(#{pileId},xpe.charging_pile_ids) + + and xpe.tenant_id=#{tenantId}