兼容未知字段
This commit is contained in:
parent
24fb0c36ea
commit
b3b5344209
@ -32,7 +32,7 @@ public class DTOJsonHelper {
|
|||||||
try {
|
try {
|
||||||
CommonResponse commonResponse = JSONUtil.readParams(responseBody, CommonResponse.class);
|
CommonResponse commonResponse = JSONUtil.readParams(responseBody, CommonResponse.class);
|
||||||
String data = (String) commonResponse.getData();
|
String data = (String) commonResponse.getData();
|
||||||
if (authSecretToken != null) {
|
if (authSecretToken != null && !data.isEmpty()) {
|
||||||
data = Aes128Cbc.decryptString(data, authSecretToken.getDataSecret(), authSecretToken.getDataSecretIV());
|
data = Aes128Cbc.decryptString(data, authSecretToken.getDataSecret(), authSecretToken.getDataSecretIV());
|
||||||
}
|
}
|
||||||
if (!data.isEmpty()) {
|
if (!data.isEmpty()) {
|
||||||
|
|||||||
@ -2,15 +2,11 @@ package com.xhpc.evcs.dto;
|
|||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.*;
|
import com.fasterxml.jackson.annotation.*;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Getter
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
@Setter
|
|
||||||
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE,
|
|
||||||
setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE)
|
|
||||||
public class StartChargeRequest {
|
public class StartChargeRequest {
|
||||||
|
|
||||||
@JsonProperty("StartChargeSeq")
|
@JsonProperty("StartChargeSeq")
|
||||||
@ -38,7 +34,7 @@ public class StartChargeRequest {
|
|||||||
String userId3rdpty;
|
String userId3rdpty;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private Map<String, Object> additionalProperties;
|
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
|
||||||
|
|
||||||
@JsonAnyGetter
|
@JsonAnyGetter
|
||||||
public Map<String, Object> getAdditionalProperties() {
|
public Map<String, Object> getAdditionalProperties() {
|
||||||
@ -52,4 +48,100 @@ public class StartChargeRequest {
|
|||||||
this.additionalProperties.put(name, value);
|
this.additionalProperties.put(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonProperty("StartChargeSeq")
|
||||||
|
public String getStartChargeSeq() {
|
||||||
|
|
||||||
|
return startChargeSeq;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("StartChargeSeq")
|
||||||
|
public void setStartChargeSeq(String startChargeSeq) {
|
||||||
|
|
||||||
|
this.startChargeSeq = startChargeSeq;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("ConnectorID")
|
||||||
|
public String getConnectorId() {
|
||||||
|
|
||||||
|
return connectorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("ConnectorID")
|
||||||
|
public void setConnectorId(String connectorId) {
|
||||||
|
|
||||||
|
this.connectorId = connectorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("QRCode")
|
||||||
|
public String getqRCode() {
|
||||||
|
|
||||||
|
return qRCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("QRCode")
|
||||||
|
public void setqRCode(String qRCode) {
|
||||||
|
|
||||||
|
this.qRCode = qRCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("PlateNum")
|
||||||
|
public String getPlateNum() {
|
||||||
|
|
||||||
|
return plateNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("PlateNum")
|
||||||
|
public void setPlateNum(String plateNum) {
|
||||||
|
|
||||||
|
this.plateNum = plateNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("CarPlateNo")
|
||||||
|
public String getPlateNum2() {
|
||||||
|
|
||||||
|
return plateNum2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("CarPlateNo")
|
||||||
|
public void setPlateNum2(String plateNum2) {
|
||||||
|
|
||||||
|
this.plateNum2 = plateNum2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("ChargingAmt")
|
||||||
|
public Integer getChargingAmt() {
|
||||||
|
|
||||||
|
return chargingAmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("ChargingAmt")
|
||||||
|
public void setChargingAmt(Integer chargingAmt) {
|
||||||
|
|
||||||
|
this.chargingAmt = chargingAmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("driverId")
|
||||||
|
public String getDriverId() {
|
||||||
|
|
||||||
|
return driverId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("driverId")
|
||||||
|
public void setDriverId(String driverId) {
|
||||||
|
|
||||||
|
this.driverId = driverId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("UserId")
|
||||||
|
public String getUserId3rdpty() {
|
||||||
|
|
||||||
|
return userId3rdpty;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty("UserId")
|
||||||
|
public void setUserId3rdpty(String userId3rdpty) {
|
||||||
|
|
||||||
|
this.userId3rdpty = userId3rdpty;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,8 +61,9 @@ public class Aes128Cbc {
|
|||||||
NoSuchAlgorithmException, IllegalBlockSizeException, UnsupportedEncodingException, NoSuchPaddingException,
|
NoSuchAlgorithmException, IllegalBlockSizeException, UnsupportedEncodingException, NoSuchPaddingException,
|
||||||
InvalidKeyException {
|
InvalidKeyException {
|
||||||
|
|
||||||
System.out.println(decryptString("L+FOSPaN073SDRBNMqKBAQ==",
|
System.out.println(decryptString("gbmqQAsXVr/c1cvxNkxog7GXLZMMLEp9vGV3O/aW60ZkWNzFsLkwMd0tqb7nU6SKR0QrNL9n" +
|
||||||
"ojs67l46z3f7rhok", "tet9swfkyojkhaos"
|
"+ayJRaL0LTjPRA==",
|
||||||
|
"8LpncubmWiPCzY3V", "av6A8QdnRaVRMXu6"
|
||||||
));
|
));
|
||||||
//ujNoGsWRo5MyPKYOxeofKwgPEng3xF+yhM8DDjwtwHo=
|
//ujNoGsWRo5MyPKYOxeofKwgPEng3xF+yhM8DDjwtwHo=
|
||||||
System.out.println(encrypt("{\"StationIDs\":[\"1\"]}", "8LpncubmWiPCzY3V", "av6A8QdnRaVRMXu6"));
|
System.out.println(encrypt("{\"StationIDs\":[\"1\"]}", "8LpncubmWiPCzY3V", "av6A8QdnRaVRMXu6"));
|
||||||
|
|||||||
@ -110,7 +110,7 @@ public class NotificationStationStatusTask extends CoreDispatcher {
|
|||||||
connectorStatusInfo.getOperatorID());
|
connectorStatusInfo.getOperatorID());
|
||||||
EvcsStatus status = DTOJsonHelper.parseResponseData(responseBody, EvcsStatus.class, authSecretTokenOut);
|
EvcsStatus status = DTOJsonHelper.parseResponseData(responseBody, EvcsStatus.class, authSecretTokenOut);
|
||||||
if (status == null || status.getStatus() != 0) {
|
if (status == null || status.getStatus() != 0) {
|
||||||
log.error(String.format("push CD notification connector[%s] failed: %s",
|
log.error(String.format("push station status connector[%s] failed: %s",
|
||||||
connectorStatusInfo.getConnectorID(), responseBody));
|
connectorStatusInfo.getConnectorID(), responseBody));
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -62,12 +63,12 @@ public class RegisterLogic implements ServiceLogic {
|
|||||||
REDIS.setCacheMap(gunkey, cacheGun);
|
REDIS.setCacheMap(gunkey, cacheGun);
|
||||||
String svcSrvKeyNew = "svcSrvGuns:".concat(getLocalIPAndPort());
|
String svcSrvKeyNew = "svcSrvGuns:".concat(getLocalIPAndPort());
|
||||||
cachePileGunSvcSrv(gunkey, svcSrvKeyNew);
|
cachePileGunSvcSrv(gunkey, svcSrvKeyNew);
|
||||||
// final Collection<String> cacheSvcSrvKeys = REDIS.keys("svcSrvGuns:*");
|
final Collection<String> cacheSvcSrvKeys = REDIS.keys("svcSrvGuns:*");
|
||||||
// for (String svcSrvKey : cacheSvcSrvKeys) {
|
for (String svcSrvKey : cacheSvcSrvKeys) {
|
||||||
// if (!svcSrvKey.equals(svcSrvKeyNew)) {
|
if (!svcSrvKey.equals(svcSrvKeyNew)) {
|
||||||
// REDIS.deleteSetVal(svcSrvKey, gunkey);
|
REDIS.deleteSetVal(svcSrvKey, gunkey);
|
||||||
// }
|
}
|
||||||
// } todo ucat
|
}
|
||||||
}
|
}
|
||||||
log.info("pile (re)registered ({}) ", pileNo);
|
log.info("pile (re)registered ({}) ", pileNo);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user