充电桩500ms响应保护
This commit is contained in:
parent
2423204e12
commit
c34091f8cf
@ -223,6 +223,8 @@ public class ChargingController {
|
|||||||
return R.fail("充电桩连接已断开,请稍后再试一次");
|
return R.fail("充电桩连接已断开,请稍后再试一次");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
String pileKey = "pile:".concat(pileNo);
|
||||||
|
if (CacheDataUtils.hori(pileKey)) return R.fail("充电桩正在忙碌,请重试");
|
||||||
String gunkey = "gun:".concat(pileNo).concat(startChargingData.getGunId());
|
String gunkey = "gun:".concat(pileNo).concat(startChargingData.getGunId());
|
||||||
Map<String, Object> cacheGun = REDIS.getCacheMap(gunkey);
|
Map<String, Object> cacheGun = REDIS.getCacheMap(gunkey);
|
||||||
String gunstatus = (String) cacheGun.get("status");
|
String gunstatus = (String) cacheGun.get("status");
|
||||||
@ -269,8 +271,9 @@ public class ChargingController {
|
|||||||
return R.fail("充电桩没有连接到上次注册的服务器,请稍后再试一次");
|
return R.fail("充电桩没有连接到上次注册的服务器,请稍后再试一次");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
String pileKey = "pile:".concat(pileNo);
|
||||||
|
if (CacheDataUtils.hori(pileKey)) return R.fail("充电桩正在忙碌,请重试");
|
||||||
String gunkey = "gun:".concat(pileNo).concat(gunId);
|
String gunkey = "gun:".concat(pileNo).concat(gunId);
|
||||||
if (CacheDataUtils.hori(gunkey)) return R.fail("充电桩正在忙碌,请稍后再试");
|
|
||||||
String skey = gunkey.concat(".seqhex");
|
String skey = gunkey.concat(".seqhex");
|
||||||
String seq = seqHex(skey);
|
String seq = seqHex(skey);
|
||||||
byte[] msg = translateStop(pileNo, gunId, version, seq);
|
byte[] msg = translateStop(pileNo, gunId, version, seq);
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public class CacheDataUtils {
|
|||||||
if (HORI != null) {
|
if (HORI != null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
REDIS.setCacheObject(hori, "protection film", 3000L, TimeUnit.MILLISECONDS);
|
REDIS.setCacheObject(hori, "protection film", 500L, TimeUnit.MILLISECONDS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user