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+"分钟"); + } }