diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/dto/ChargingStationDto.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/dto/ChargingStationDto.java index c4c86aa8..a18abdda 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/dto/ChargingStationDto.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/dto/ChargingStationDto.java @@ -8,6 +8,7 @@ public class ChargingStationDto { private Long stationId; private Set piles; + private Set pilesSettingRateModel; private Long rateModelId; public Long getStationId() { @@ -30,6 +31,16 @@ public class ChargingStationDto { this.piles = piles; } + public Set getPilesSettingRateModel() { + + return pilesSettingRateModel; + } + + public void setPilesSettingRateModel(Set pilesSettingRateModel) { + + this.pilesSettingRateModel = pilesSettingRateModel; + } + public Long getRateModelId() { return rateModelId; diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java index 1dad93e3..26c34db1 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java @@ -30,8 +30,10 @@ public class PileController { Set stationPiles = cacheStation.getPiles(); if (stationPiles == null) { cacheStation.setPiles(pileNoSet); + cacheStation.setPilesSettingRateModel(pileNoSet); } else { - stationPiles.addAll(pileNoSet); + cacheStation.getPiles().addAll(pileNoSet); + cacheStation.getPilesSettingRateModel().addAll(pileNoSet); } REDIS.setCacheObject(stationKey, cacheStation); for (String pileNo : pileNoSet) { @@ -49,6 +51,11 @@ public class PileController { Set cacheWhitelist = REDIS.getCacheSet("PILE_WHITELIST"); cacheWhitelist.removeAll(pileNoSet); REDIS.setCacheSet("PILE_WHITELIST", cacheWhitelist); + String stationKey = "station:".concat(stationId.toString()); + ChargingStationDto cacheStation = REDIS.getCacheObject(stationKey); + cacheStation.getPiles().removeAll(pileNoSet); + cacheStation.getPilesSettingRateModel().removeAll(pileNoSet); + REDIS.setCacheObject(stationKey, cacheStation); return R.ok(); }