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