From bac443fb27b676cbba7ee4f948fc3a5d8186bdb7 Mon Sep 17 00:00:00 2001 From: ZZ Date: Wed, 17 Nov 2021 18:05:01 +0800 Subject: [PATCH] index start from 0 --- .../com/xhpc/evcs/api/QueryStationsInfoController.java | 2 +- .../evcs/notification/NotificationStationStatusTask.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationsInfoController.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationsInfoController.java index 12994b7b..14234d18 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationsInfoController.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/QueryStationsInfoController.java @@ -135,7 +135,7 @@ public class QueryStationsInfoController { //运营商id String operatorIdEvcs = xhpcChargingStation.getOperatorIdEvcs(); chargingStationDto.setOperatorId(operatorIdEvcs == null ? "MA6DFCTD5" - : operatorIdEvcs.length() == 9 ? operatorId : operatorIdEvcs.substring(9, 18)); + : operatorIdEvcs.length() == 9 ? operatorId : operatorIdEvcs.substring(8, 17)); //详细地址 chargingStationDto.setAddress(xhpcChargingStation.getAddress()); //充电站省直辖区编码 diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java index 87794498..1a11668d 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java @@ -56,13 +56,13 @@ public class NotificationStationStatusTask extends CoreDispatcher { if (xhpcStationInternetBlacklist != null) continue; String operatorId3rdptyEvcs = xhpcInternetUser.getOperatorIdEvcs(); operatorId3rdptyEvcs = operatorId3rdptyEvcs.length() == 9 ? operatorId3rdptyEvcs : - operatorId3rdptyEvcs.substring(9, 19); + operatorId3rdptyEvcs.substring(8, 17); AuthSecretToken authSecretTokenOut = authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenType(xhpcInternetUser.getOperatorIdEvcs(), SECRET_TOKEN_TYPE_OUT).orElse(null); operatorId = !operatorId3rdptyEvcs.equals("765367656") ? "MA6DFCTD5" : operatorId; if (authSecretTokenOut != null) { for (ConnectorStatusInfo statusInfo : changeStatus) { - notify(statusInfo, authSecretTokenOut); + notify(statusInfo, authSecretTokenOut, operatorId); } } } @@ -98,13 +98,13 @@ public class NotificationStationStatusTask extends CoreDispatcher { } } - public EvcsStatus notify(ConnectorStatusInfo connectorStatusInfo, AuthSecretToken authSecretTokenOut) throws IOException { + public EvcsStatus notify(ConnectorStatusInfo connectorStatusInfo, AuthSecretToken authSecretTokenOut, String operatorId) throws IOException { ConnectorStatusInfoReq connectorStatusInfoReq = new ConnectorStatusInfoReq(); connectorStatusInfoReq.setConnectorStatusInfo(connectorStatusInfo); String data = JSONUtil.toJSONString(connectorStatusInfoReq); CommonRequest commonRequest = new CommonRequest<>(); - commonRequest.setOperatorId(connectorStatusInfo.getOperatorID()); + commonRequest.setOperatorId(operatorId);//connectorStatusInfo.getOperatorID()); todo fig error commonRequest.setData(data); String responseBody = ok(commonRequest, "/notification_stationStatus", authSecretTokenOut, connectorStatusInfo.getOperatorID());