新增 相机主动发送订阅消息处理方法

This commit is contained in:
Lemon
2024-02-28 15:28:53 +08:00
parent a7f31a23d2
commit b60642d466
4 changed files with 59 additions and 17 deletions

View File

@@ -73,16 +73,16 @@ public class CameraService {
public void receiveIdentifyResults(JSONObject jsonObject) throws InterruptedException {
// 区分入场和出场
Integer parking_state = jsonObject.getJSONObject("parking").getInteger("parking_state");
if (parking_state == 1) {
if (parking_state == Constants.one) {
// 入场
String parkingState = "ENTRY";
String result = vehicleEntry(jsonObject, parkingState);
logger.info("车辆入场处理 result:{}", result);
}
if (parking_state == 2) {
if (parking_state == Constants.two) {
// 在场
}
if (parking_state == 4) {
if (parking_state == Constants.four) {
// 出场
vehicleLeave(jsonObject);
}
@@ -346,13 +346,13 @@ public class CameraService {
// 判断降锁是否成功
// 将此降锁指令存入缓存, 在 nettyServer 收到新消息时判断是否是此消息的回复
String redisKey = "plate_number_occupy_order:" + msgId;
String redisKey = CacheConstants.SEND_DROP_LOCK_COMMOND + msgId;
redisCache.setCacheObject(redisKey, command, 5, TimeUnit.MINUTES);
// 延时 3 秒钟, 再查询缓存中是否有此降锁信息的回复
Thread.sleep(3);
String responseRedisKey = "plate_number_occupy_order_response:" + msgId;
String responseRedisKey = CacheConstants.GROUND_LOCK_DEVICE_REPORT + msgId;
Object cacheObject = redisCache.getCacheObject(responseRedisKey);
return cacheObject;
}