index start from 0

This commit is contained in:
ZZ 2021-11-17 18:05:01 +08:00
parent ed929ce114
commit bac443fb27
2 changed files with 5 additions and 5 deletions

View File

@ -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());
//充电站省直辖区编码

View File

@ -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<ConnectorStatusInfoReq> 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());