diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java index 21c83f7d..8ffaab91 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java @@ -223,6 +223,8 @@ public class ChargingController { return R.fail("充电桩连接已断开,请稍后再试一次"); } try { + String pileKey = "pile:".concat(pileNo); + if (CacheDataUtils.hori(pileKey)) return R.fail("充电桩正在忙碌,请重试"); String gunkey = "gun:".concat(pileNo).concat(startChargingData.getGunId()); Map cacheGun = REDIS.getCacheMap(gunkey); String gunstatus = (String) cacheGun.get("status"); @@ -269,8 +271,9 @@ public class ChargingController { return R.fail("充电桩没有连接到上次注册的服务器,请稍后再试一次"); } try { + String pileKey = "pile:".concat(pileNo); + if (CacheDataUtils.hori(pileKey)) return R.fail("充电桩正在忙碌,请重试"); String gunkey = "gun:".concat(pileNo).concat(gunId); - if (CacheDataUtils.hori(gunkey)) return R.fail("充电桩正在忙碌,请稍后再试"); String skey = gunkey.concat(".seqhex"); String seq = seqHex(skey); byte[] msg = translateStop(pileNo, gunId, version, seq); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/utils/security/CacheDataUtils.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/utils/security/CacheDataUtils.java index 2a458fee..0b9069ad 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/utils/security/CacheDataUtils.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/utils/security/CacheDataUtils.java @@ -57,7 +57,7 @@ public class CacheDataUtils { if (HORI != null) { return true; } - REDIS.setCacheObject(hori, "protection film", 3000L, TimeUnit.MILLISECONDS); + REDIS.setCacheObject(hori, "protection film", 500L, TimeUnit.MILLISECONDS); return false; }