diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationStatusController.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationStatusController.java index 46181882..cba28ffb 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationStatusController.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationStatusController.java @@ -22,7 +22,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java index 179ac956..66ec3bb1 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java @@ -76,6 +76,11 @@ public class NotificationChargeOrderInfo4BonusTask extends CoreDispatcher { if (operatorIdEvcs == null) { Long chargingStationId = xhpcHistoryOrder.getChargingStationId(); XhpcChargingStation station = chargingStationRepo.findById(chargingStationId).orElse(null); + if(station == null){ + logger.error("station[{}] is not exits", chargingStationId); + return false; + } + String stationOperatorIdEvcs = station.getOperatorIdEvcs(); if (stationOperatorIdEvcs == null) { logger.error("station[{}] operator id evcs not set", chargingStationId); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java index 0ba116cc..470f7d7f 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java @@ -45,7 +45,13 @@ public class NotificationChargeOrderInfoTask extends CoreDispatcher { Collection orderKeys = REDIS.keys("order:*"); Instant now = Instant.now(); for (String okey : orderKeys) { - Date otime = DateUtil.orderNo2Date(okey.substring(6)); + String orderNo = okey.substring(6); + if(orderNo.length() < 32){ + logger.error("orderNo[{}] is error", orderNo); + continue; + } + + Date otime = DateUtil.orderNo2Date(orderNo); if (Duration.between(otime.toInstant(), now).toHours() > 24 * 3) { REDIS.deleteObject(okey); REDIS.deleteObject(okey.replace("order", "pushOrder"));