From 26911576aaee9b49d80fb5c972d701bc40e590da Mon Sep 17 00:00:00 2001 From: panshulin Date: Mon, 29 Nov 2021 16:10:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AF=BC=E5=85=A5=E7=94=B5?= =?UTF-8?q?=E6=A1=A9=E6=8E=A5=E5=8F=A3=E7=9A=84=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../station/controller/XhpcChargingPileController.java | 2 +- .../station/service/XhpcChargingStationServiceImpl.java | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java index 47eb5d4c..f8879ae8 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java @@ -112,7 +112,7 @@ public class XhpcChargingPileController extends BaseController { * @return * @throws Exception */ - @PostMapping("/import") + @PostMapping("/importData") public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { ExcelUtil util = new ExcelUtil(XhpcChargingPile.class); List pileList = util.importExcel(file.getInputStream()); 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 2453df16..d0674788 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 @@ -1144,11 +1144,14 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi for (String st:terminal) { Map cacheMap = redisService.getCacheMap("gun:" + st); if(!cacheMap.isEmpty()){ - if ("离线".equals(cacheMap.get("status").toString())){ + if (cacheMap.containsKey("status") && + "离线".equals(cacheMap.get("status").toString())){ offLine++; - }else if("故障".equals(cacheMap.get("status").toString())){ + }else if(cacheMap.containsKey("status") && + "故障".equals(cacheMap.get("status").toString())){ fault++; - }else if("空闲".equals(cacheMap.get("status").toString())){ + }else if(cacheMap.containsKey("status") && + "空闲".equals(cacheMap.get("status").toString())){ freeTime++; }else{ charge++;