修改设置费率模型的桩号集合
This commit is contained in:
parent
134abf9d48
commit
dc8773fc85
@ -8,6 +8,7 @@ public class ChargingStationDto {
|
|||||||
|
|
||||||
private Long stationId;
|
private Long stationId;
|
||||||
private Set<String> piles;
|
private Set<String> piles;
|
||||||
|
private Set<String> pilesSettingRateModel;
|
||||||
private Long rateModelId;
|
private Long rateModelId;
|
||||||
|
|
||||||
public Long getStationId() {
|
public Long getStationId() {
|
||||||
@ -30,6 +31,16 @@ public class ChargingStationDto {
|
|||||||
this.piles = piles;
|
this.piles = piles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<String> getPilesSettingRateModel() {
|
||||||
|
|
||||||
|
return pilesSettingRateModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPilesSettingRateModel(Set<String> pilesSettingRateModel) {
|
||||||
|
|
||||||
|
this.pilesSettingRateModel = pilesSettingRateModel;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getRateModelId() {
|
public Long getRateModelId() {
|
||||||
|
|
||||||
return rateModelId;
|
return rateModelId;
|
||||||
|
|||||||
@ -30,8 +30,10 @@ public class PileController {
|
|||||||
Set<String> stationPiles = cacheStation.getPiles();
|
Set<String> stationPiles = cacheStation.getPiles();
|
||||||
if (stationPiles == null) {
|
if (stationPiles == null) {
|
||||||
cacheStation.setPiles(pileNoSet);
|
cacheStation.setPiles(pileNoSet);
|
||||||
|
cacheStation.setPilesSettingRateModel(pileNoSet);
|
||||||
} else {
|
} else {
|
||||||
stationPiles.addAll(pileNoSet);
|
cacheStation.getPiles().addAll(pileNoSet);
|
||||||
|
cacheStation.getPilesSettingRateModel().addAll(pileNoSet);
|
||||||
}
|
}
|
||||||
REDIS.setCacheObject(stationKey, cacheStation);
|
REDIS.setCacheObject(stationKey, cacheStation);
|
||||||
for (String pileNo : pileNoSet) {
|
for (String pileNo : pileNoSet) {
|
||||||
@ -49,6 +51,11 @@ public class PileController {
|
|||||||
Set<String> cacheWhitelist = REDIS.getCacheSet("PILE_WHITELIST");
|
Set<String> cacheWhitelist = REDIS.getCacheSet("PILE_WHITELIST");
|
||||||
cacheWhitelist.removeAll(pileNoSet);
|
cacheWhitelist.removeAll(pileNoSet);
|
||||||
REDIS.setCacheSet("PILE_WHITELIST", cacheWhitelist);
|
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();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user