|
|
@ -1054,6 +1054,22 @@ public class GateABController { |
|
|
|
notifyGateStateListener(true, false); // 处理弹窗显示 |
|
|
|
}, 100); |
|
|
|
} |
|
|
|
// 新增逻辑:当检测到A门或B门开启时,如果没有不可用弹窗显示,则需要显示不可用弹窗 |
|
|
|
else if ((currentGateState.gateAOpen || currentGateState.gateBOpen) && !shouldShowDialog) { |
|
|
|
LogManager.logInfo(TAG, "检测到A门或B门开启,当前没有不可用弹窗,需要显示不可用弹窗"); |
|
|
|
// 检查是否有监听器并且是GateUnavailableListener类型 |
|
|
|
if (gateStateListener instanceof GateUnavailableListener) { |
|
|
|
final String reason = currentGateState.getUnavailableReason(); |
|
|
|
|
|
|
|
syncHandler.post(() -> { |
|
|
|
GateUnavailableListener unavailableListener = (GateUnavailableListener) gateStateListener; |
|
|
|
// 触发门禁不可用回调 |
|
|
|
unavailableListener.onGateUnavailable(reason); |
|
|
|
// 同时更新门状态显示 |
|
|
|
unavailableListener.onGateStatusUpdate(gateAOpen, gateBOpen, udpConnected); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 处理其他状态变化(非弹窗显示场景) |
|
|
|
if (stateChanged && gateStateListener != null && !shouldShowDialog) { |
|
|
|