From 69f6a205c32a03da7f4dc4c8c697f0c3875ba2b9 Mon Sep 17 00:00:00 2001 From: yuyang <2265829957@qq.com> Date: Fri, 12 Nov 2021 16:39:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=85=85=E7=94=B5=E4=B8=AD=E5=89=A9=E4=BD=99=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=BF=90=E8=90=A5=E5=95=86=E5=A4=8D=E5=88=B6=E6=9D=83=E9=99=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/system/XhpcUserPrivilegeMapper.xml | 2 +- .../XhpcChargingStationServiceImpl.java | 21 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/XhpcUserPrivilegeMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/XhpcUserPrivilegeMapper.xml index b62a0c33..dc5cbd6b 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/XhpcUserPrivilegeMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/XhpcUserPrivilegeMapper.xml @@ -45,7 +45,7 @@ JOIN xhpc_charging_station xcs on xcs.operator_id = xo.operator_id where xo.del_flag = 0 - operator_id in + and operator_id in #{item} diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index 98f984c3..5bc686f9 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -628,7 +628,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi //桩(空闲和使用从redis获取) Map map1 =new HashMap<>(); map1 = getTerminalStatusSum(map1, Long.valueOf(map.get("chargingStationId").toString()), 0); - if(map1 !=null && map1.get("free") !=null){ + if(map1 !=null && map1.get("freeTime") !=null){ map.put("free", map1.get("freeTime").toString()); }else{ map.put("free", 0); @@ -651,7 +651,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi Map map1 =new HashMap<>(); map1 = getTerminalStatusSum(map1, chargingStationId, 0); - if(map1 !=null && map1.get("free") !=null){ + if(map1 !=null && map1.get("freeTime") !=null){ map.put("free", map1.get("freeTime").toString()); }else{ map.put("free", 0); @@ -726,10 +726,10 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi }else{ int mins = number % 60; int hours = number / 60; - if(mins>0){ - map.put("remainingTime", mins+"小时"+hours+"分钟"); + if(hours>0){ + map.put("remainingTime", hours+"小时"+mins+"分钟"); }else{ - map.put("remainingTime", hours+"分钟"); + map.put("remainingTime", mins+"分钟"); } } }else{ @@ -1160,6 +1160,17 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi System.out.println("111????????????????"+i); i=i++; System.out.println("222????????????????"+i); + int number =23; + + int mins = number % 60; + int hours = number / 60; + if(hours>0){ + System.out.println("111"); + System.out.println(hours+"小时"+mins+"分钟"); + }else{ + System.out.println("222"); + System.out.println(mins+"分钟"); + } }