diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java index dcf7e2ce..e80b096f 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java @@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; +import java.util.Set; + import static com.xhpc.pp.server.ChargingPileServer.REDIS; @RestController @@ -24,7 +26,10 @@ public class StationController { String rkey = "rateModel:".concat(rateModelId.toString()); REDIS.setCacheObject(rkey, rateModel); String rmskey = "rateModelStation:".concat(stationId.toString()); - REDIS.setCacheSet(rmskey, cacheStation.getPiles()); + Set piles = cacheStation.getPiles(); + if (piles!=null) { + REDIS.setCacheSet(rmskey, piles); + } return R.ok(); }