fix QueryStationsInfo

This commit is contained in:
ZZ 2021-11-16 15:21:17 +08:00
parent 356bdd7084
commit 3922ba713b
2 changed files with 17 additions and 3 deletions

View File

@ -46,7 +46,7 @@ public class XhpcChargingPile extends BaseEntity {
@Column(name = "serial_number", length = 30) @Column(name = "serial_number", length = 30)
private String serialNumber; private String serialNumber;
@Column(name = "type") @Column(name = "connector_type")
private Integer type; private Integer type;
@Column(name = "program_version", length = 20) @Column(name = "program_version", length = 20)
@ -88,9 +88,22 @@ public class XhpcChargingPile extends BaseEntity {
@Column(name = "connector_type") @Column(name = "connector_type")
private Integer connectorType; private Integer connectorType;
@Column(name = "equipment_type")
private Integer equipmentType;
@Column(name = "current") @Column(name = "current")
private Integer current; private Integer current;
public Integer getEquipmentType() {
return equipmentType;
}
public void setEquipmentType(Integer equipmentType) {
this.equipmentType = equipmentType;
}
public Integer getCurrent() { public Integer getCurrent() {
return current; return current;

View File

@ -249,13 +249,14 @@ public class QueryStationsInfoController {
Example<XhpcChargingPile> example = Example.of(pileExample); Example<XhpcChargingPile> example = Example.of(pileExample);
XhpcChargingPile xhpcChargingPile = xhpcChargingPileRepository.findOne(example).orElse(null); XhpcChargingPile xhpcChargingPile = xhpcChargingPileRepository.findOne(example).orElse(null);
if (xhpcChargingPile != null) { if (xhpcChargingPile != null) {
cachePile.put("connectorType", xhpcChargingPile.getType() == null ? 4 : xhpcChargingPile.getType()); cachePile.put("connectorType", xhpcChargingPile.getConnectorType() == null ? 4 :
xhpcChargingPile.getConnectorType());
cachePile.put("voltageUpperLimits", xhpcChargingPile.getMaxVoltage().intValue()); cachePile.put("voltageUpperLimits", xhpcChargingPile.getMaxVoltage().intValue());
cachePile.put("voltageLowerLimits", xhpcChargingPile.getMinVoltage().intValue()); cachePile.put("voltageLowerLimits", xhpcChargingPile.getMinVoltage().intValue());
cachePile.put("currentLimit", xhpcChargingPile.getCurrent()); cachePile.put("currentLimit", xhpcChargingPile.getCurrent());
cachePile.put("power", xhpcChargingPile.getPower()); cachePile.put("power", xhpcChargingPile.getPower());
cachePile.put("nationalStandard", xhpcChargingPile.getNationalStandard().equals("2011") ? 1 : 2); cachePile.put("nationalStandard", xhpcChargingPile.getNationalStandard().equals("2011") ? 1 : 2);
cachePile.put("equipmentType", xhpcChargingPile.getType()); cachePile.put("equipmentType", xhpcChargingPile.getEquipmentType());
REDIS.setCacheMap("pile:".concat(pileNo), cachePile); REDIS.setCacheMap("pile:".concat(pileNo), cachePile);
} }
} }