快电新电途ing
This commit is contained in:
parent
8c873b1722
commit
d57c69feaa
@ -10,25 +10,30 @@ import java.util.Map;
|
|||||||
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@JsonPropertyOrder({
|
@JsonPropertyOrder({
|
||||||
"NationalStandard",
|
|
||||||
"ConnectorID",
|
"ConnectorID",
|
||||||
"ConnectorName",
|
"ConnectorName",
|
||||||
"ConnectorType",
|
"ConnectorType",
|
||||||
"VoltageUpperLimits",
|
"VoltageUpperLimits",
|
||||||
"VoltageLowerLimits",
|
"VoltageLowerLimits",
|
||||||
"Current",
|
"Current",
|
||||||
"Power"
|
"Power",
|
||||||
|
"ParkNo",
|
||||||
|
"NationalStandard"
|
||||||
})
|
})
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public class ConnectorInfo {
|
public class ConnectorInfo {
|
||||||
|
|
||||||
@JsonProperty("NationalStandard")
|
|
||||||
public Integer nationalStandard;
|
|
||||||
@JsonProperty("ConnectorID")
|
@JsonProperty("ConnectorID")
|
||||||
public String connectorID;
|
public String connectorID;
|
||||||
@JsonProperty("ConnectorName")
|
@JsonProperty("ConnectorName")
|
||||||
public String connectorName;
|
public String connectorName;
|
||||||
|
// 1:家用插座(模式 2)
|
||||||
|
// 2:交流接口插座(模式 3, 连接方式 B )
|
||||||
|
// 3:交流接口插头(带枪线, 模式 3,连接方式 C)
|
||||||
|
// 4:直流接口枪头(带枪线, 模式 4)
|
||||||
|
// 5:无线充电座
|
||||||
|
// 6:其他
|
||||||
@JsonProperty("ConnectorType")
|
@JsonProperty("ConnectorType")
|
||||||
public Integer connectorType;
|
public Integer connectorType;
|
||||||
@JsonProperty("VoltageUpperLimits")
|
@JsonProperty("VoltageUpperLimits")
|
||||||
@ -39,6 +44,10 @@ public class ConnectorInfo {
|
|||||||
public Integer current;
|
public Integer current;
|
||||||
@JsonProperty("Power")
|
@JsonProperty("Power")
|
||||||
public Double power;
|
public Double power;
|
||||||
|
@JsonProperty("ParkNo")
|
||||||
|
public String ParkNo;
|
||||||
|
@JsonProperty("NationalStandard")
|
||||||
|
public Integer nationalStandard;
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
|
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public class EquipmentInfo {
|
|||||||
@JsonProperty("Power")
|
@JsonProperty("Power")
|
||||||
public Double power;
|
public Double power;
|
||||||
@JsonProperty("ConnectorInfos")
|
@JsonProperty("ConnectorInfos")
|
||||||
public List<ConnectorStatusInfo> connectorStatusInfos;
|
public List<ConnectorInfo> connectorInfos;
|
||||||
@JsonProperty("EquipmentLng")
|
@JsonProperty("EquipmentLng")
|
||||||
public Double equipmentLng;
|
public Double equipmentLng;
|
||||||
@JsonProperty("EquipmentLat")
|
@JsonProperty("EquipmentLat")
|
||||||
@ -56,7 +56,7 @@ public class EquipmentInfo {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
||||||
return new ToStringBuilder(this).append("equipmentID", equipmentID).append("manufacturerID", manufacturerID).append(
|
return new ToStringBuilder(this).append("equipmentID", equipmentID).append("manufacturerID", manufacturerID).append(
|
||||||
"equipmentType", equipmentType).append("power", power).append("connectorInfos", connectorStatusInfos).append(
|
"equipmentType", equipmentType).append("power", power).append("connectorInfos", connectorInfos).append(
|
||||||
"equipmentLng", equipmentLng).append("equipmentLat", equipmentLat).append("additionalProperties",
|
"equipmentLng", equipmentLng).append("equipmentLat", equipmentLat).append("additionalProperties",
|
||||||
additionalProperties).toString();
|
additionalProperties).toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -148,32 +148,36 @@ public class StationsInfoController extends CoreDispatcher {
|
|||||||
equipmentInfo.setEquipmentID(pileNo);
|
equipmentInfo.setEquipmentID(pileNo);
|
||||||
equipmentInfo.setEquipmentType((Integer) cachePile.get("equipmentType"));
|
equipmentInfo.setEquipmentType((Integer) cachePile.get("equipmentType"));
|
||||||
equipmentInfo.setPower((Double) cachePile.get("power"));
|
equipmentInfo.setPower((Double) cachePile.get("power"));
|
||||||
equipmentInfo.setConnectorStatusInfos(getConnectorInfos(pileNo, cachePile));
|
equipmentInfo.setConnectorInfos(getConnectorInfos(pileNo, cachePile));
|
||||||
equipmentInfos.add(equipmentInfo);
|
equipmentInfos.add(equipmentInfo);
|
||||||
}
|
}
|
||||||
return equipmentInfos;
|
return equipmentInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ConnectorStatusInfo> getConnectorInfos(String pileNo, Map<String, Object> cachePile) {
|
private List<ConnectorInfo> getConnectorInfos(String pileNo, Map<String, Object> cachePile) {
|
||||||
|
|
||||||
List<ConnectorStatusInfo> connectorStatusInfoList = new ArrayList<>();
|
List<ConnectorInfo> connectorInfoList = new ArrayList<>();
|
||||||
Integer gunNumCache = (Integer) cachePile.get("gunNum");
|
Integer gunNumCache = (Integer) cachePile.get("gunNum");
|
||||||
gunNumCache = gunNumCache == null ? 1 : gunNumCache;
|
gunNumCache = gunNumCache == null ? 1 : gunNumCache;
|
||||||
for (int i = 1; i <= gunNumCache; i++) {
|
for (int i = 1; i <= gunNumCache; i++) {
|
||||||
String gunId = pileNo.concat(String.format("%02d", i));
|
String gunId = pileNo.concat(String.format("%02d", i));
|
||||||
ConnectorStatusInfo connectorInfo = new ConnectorStatusInfo();
|
ConnectorInfo connectorInfo = new ConnectorInfo();
|
||||||
connectorInfo.setConnectorID(gunId);
|
connectorInfo.setConnectorID(gunId);
|
||||||
Integer statusInt = REDIS.getCacheMapValue("gun:".concat(gunId), "statusInt");
|
Integer connectorType = (Integer) cachePile.get("connectorType");
|
||||||
connectorInfo.setStatus(statusInt == null ? 0 : statusInt);
|
connectorInfo.setConnectorType(connectorType == null ? 4 : connectorType);
|
||||||
// connectorInfo.setConnectorType((Integer) cachePile.get("connectorType"));
|
Integer voltageUpperLimits = (Integer) cachePile.get("voltageUpperLimits");
|
||||||
// connectorInfo.setVoltageUpperLimits((Integer) cachePile.get("voltageUpperLimits"));
|
connectorInfo.setVoltageUpperLimits(voltageUpperLimits == null ? 750 : voltageUpperLimits);
|
||||||
// connectorInfo.setVoltageLowerLimits((Integer) cachePile.get("voltageLowerLimits"));
|
Integer voltageLowerLimits = (Integer) cachePile.get("voltageLowerLimits");
|
||||||
// connectorInfo.setCurrent((Integer) cachePile.get("current"));
|
connectorInfo.setVoltageLowerLimits(voltageLowerLimits == null ? 300 : voltageLowerLimits);
|
||||||
// connectorInfo.setPower((Double) cachePile.get("power"));
|
Integer current = (Integer) cachePile.get("current");
|
||||||
// connectorInfo.setNationalStandard((Integer) cachePile.get("nationalStandard"));
|
connectorInfo.setCurrent(current == null ? 250 : current);
|
||||||
connectorStatusInfoList.add(connectorInfo);
|
Double power = (Double) cachePile.get("power");
|
||||||
|
connectorInfo.setPower(power == null ? 120.0 : power);
|
||||||
|
Integer nationalStandard = (Integer) cachePile.get("nationalStandard");
|
||||||
|
connectorInfo.setNationalStandard(nationalStandard == null ? 2015 : nationalStandard);
|
||||||
|
connectorInfoList.add(connectorInfo);
|
||||||
}
|
}
|
||||||
return connectorStatusInfoList;
|
return connectorInfoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user