|
@ -53,8 +53,6 @@ import com.ouxuan.oxface.network.OrderVerificationResultHandler; |
|
|
import com.ouxuan.oxface.network.LeaveVerificationManager; |
|
|
import com.ouxuan.oxface.network.LeaveVerificationManager; |
|
|
import com.ouxuan.oxface.utils.VenueSceneUtils; |
|
|
import com.ouxuan.oxface.utils.VenueSceneUtils; |
|
|
import com.ouxuan.oxface.network.NetworkStatusIndicator; |
|
|
import com.ouxuan.oxface.network.NetworkStatusIndicator; |
|
|
import com.ouxuan.oxface.device.OxUDP; |
|
|
|
|
|
import com.ouxuan.oxface.device.OxUDPUsageExample; |
|
|
|
|
|
import com.ouxuan.oxface.abgate.GateUnavailableDialog; |
|
|
import com.ouxuan.oxface.abgate.GateUnavailableDialog; |
|
|
import com.ouxuan.oxface.abgate.ABGateManager; |
|
|
import com.ouxuan.oxface.abgate.ABGateManager; |
|
|
import com.ouxuan.oxface.device.GateABController; |
|
|
import com.ouxuan.oxface.device.GateABController; |
|
@ -196,10 +194,6 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
// 网络状态指示器 |
|
|
// 网络状态指示器 |
|
|
private NetworkStatusIndicator networkStatusIndicator; |
|
|
private NetworkStatusIndicator networkStatusIndicator; |
|
|
|
|
|
|
|
|
// UDP门禁控制 |
|
|
|
|
|
private OxUDPUsageExample udpExample; |
|
|
|
|
|
private boolean isUDPInitialized = false; |
|
|
|
|
|
|
|
|
|
|
|
// AB门禁不可用弹窗 |
|
|
// AB门禁不可用弹窗 |
|
|
private GateUnavailableDialog gateUnavailableDialog; |
|
|
private GateUnavailableDialog gateUnavailableDialog; |
|
|
private GateABController gateABController; |
|
|
private GateABController gateABController; |
|
@ -226,9 +220,6 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
|
|
|
|
|
|
initView(); |
|
|
initView(); |
|
|
|
|
|
|
|
|
// 初始化UDP门禁控制 |
|
|
|
|
|
initializeUDPGateControl(); |
|
|
|
|
|
|
|
|
|
|
|
// 初始化网络状态指示器 |
|
|
// 初始化网络状态指示器 |
|
|
initNetworkStatusIndicator(); |
|
|
initNetworkStatusIndicator(); |
|
|
|
|
|
|
|
@ -296,9 +287,9 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 离场校验成功后开启B门 |
|
|
// 离场校验成功后开启B门 |
|
|
if (isUDPInitialized && udpExample != null) { |
|
|
|
|
|
|
|
|
if (gateABController != null) { |
|
|
LogManager.logInfo(TAG, "离场校验成功,开启B门"); |
|
|
LogManager.logInfo(TAG, "离场校验成功,开启B门"); |
|
|
udpExample.handleFaceRecognitionSuccess(false); // 参数保留兼容性,实际都开B门 |
|
|
|
|
|
|
|
|
gateABController.handleFaceRecognitionSuccess(false); // 参数保留兼容性,实际都开B门 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -367,9 +358,9 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
@Override |
|
|
@Override |
|
|
public void onVerificationSuccess(com.ouxuan.oxface.network.api.PadApiService.CheckOrderResult data, int verificationType) { |
|
|
public void onVerificationSuccess(com.ouxuan.oxface.network.api.PadApiService.CheckOrderResult data, int verificationType) { |
|
|
// 订单核销成功后开启B门 |
|
|
// 订单核销成功后开启B门 |
|
|
if (isUDPInitialized && udpExample != null) { |
|
|
|
|
|
|
|
|
if (gateABController != null) { |
|
|
LogManager.logInfo(TAG, "订单核销成功,开启B门"); |
|
|
LogManager.logInfo(TAG, "订单核销成功,开启B门"); |
|
|
udpExample.handleFaceRecognitionSuccess(true); // 参数保留兼容性,实际都开B门 |
|
|
|
|
|
|
|
|
gateABController.handleFaceRecognitionSuccess(true); // 参数保留兼容性,实际都开B门 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 然后处理原有的页面跳转逻辑 |
|
|
// 然后处理原有的页面跳转逻辑 |
|
@ -623,28 +614,6 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 初始化UDP门禁控制 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void initializeUDPGateControl() { |
|
|
|
|
|
try { |
|
|
|
|
|
LogManager.logInfo(TAG, "开始初始化UDP门禁控制"); |
|
|
|
|
|
|
|
|
|
|
|
// 初始化UDP使用示例类 |
|
|
|
|
|
udpExample = new OxUDPUsageExample(this); |
|
|
|
|
|
|
|
|
|
|
|
// 初始化UDP门禁功能 |
|
|
|
|
|
udpExample.initializeInFaceActivity(); |
|
|
|
|
|
|
|
|
|
|
|
isUDPInitialized = true; |
|
|
|
|
|
LogManager.logInfo(TAG, "UDP门禁控制初始化成功"); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
LogManager.logError(TAG, "UDP门禁控制初始化失败", e); |
|
|
|
|
|
isUDPInitialized = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 初始化网络状态指示器 |
|
|
* 初始化网络状态指示器 |
|
|
*/ |
|
|
*/ |
|
|
private void initNetworkStatusIndicator() { |
|
|
private void initNetworkStatusIndicator() { |
|
@ -779,13 +748,13 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
// 人数异常弹窗关闭后,恢复正常的门禁监控状态 |
|
|
// 人数异常弹窗关闭后,恢复正常的门禁监控状态 |
|
|
try { |
|
|
try { |
|
|
// 检查UDP是否正常初始化,如果没有则重新初始化 |
|
|
// 检查UDP是否正常初始化,如果没有则重新初始化 |
|
|
if (udpExample != null && !udpExample.isUDPInitialized()) { |
|
|
|
|
|
|
|
|
if (gateABController != null && !gateABController.isUDPInitialized()) { |
|
|
LogManager.logInfo(TAG, "UDP未初始化,重新初始化UDP门禁控制"); |
|
|
LogManager.logInfo(TAG, "UDP未初始化,重新初始化UDP门禁控制"); |
|
|
udpExample.initializeInFaceActivity(); |
|
|
|
|
|
|
|
|
gateABController.reinitializeUDP(); |
|
|
// 稍等片刻后启动轮询,确保初始化完成 |
|
|
// 稍等片刻后启动轮询,确保初始化完成 |
|
|
new Handler(Looper.getMainLooper()).postDelayed(() -> { |
|
|
new Handler(Looper.getMainLooper()).postDelayed(() -> { |
|
|
if (udpExample != null) { |
|
|
|
|
|
udpExample.startGatePolling(); |
|
|
|
|
|
|
|
|
if (gateABController != null) { |
|
|
|
|
|
gateABController.startUDPPolling(); |
|
|
LogManager.logInfo(TAG, "UDP门禁状态轮询已重新启动"); |
|
|
LogManager.logInfo(TAG, "UDP门禁状态轮询已重新启动"); |
|
|
} |
|
|
} |
|
|
}, 500); |
|
|
}, 500); |
|
@ -893,8 +862,8 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 启动UDP门禁状态轮询 |
|
|
// 启动UDP门禁状态轮询 |
|
|
if (isUDPInitialized && udpExample != null) { |
|
|
|
|
|
udpExample.startGatePolling(); |
|
|
|
|
|
|
|
|
if (gateABController != null && gateABController.isUDPInitialized()) { |
|
|
|
|
|
gateABController.startUDPPolling(); |
|
|
LogManager.logInfo(TAG, "UDP门禁状态轮询已启动"); |
|
|
LogManager.logInfo(TAG, "UDP门禁状态轮询已启动"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1416,14 +1385,6 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
networkStatusIndicator = null; |
|
|
networkStatusIndicator = null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 清理UDP门禁控制资源 |
|
|
|
|
|
if (udpExample != null) { |
|
|
|
|
|
udpExample.cleanup(); |
|
|
|
|
|
udpExample = null; |
|
|
|
|
|
LogManager.logInfo(TAG, "UDP门禁控制资源已清理"); |
|
|
|
|
|
} |
|
|
|
|
|
isUDPInitialized = false; |
|
|
|
|
|
|
|
|
|
|
|
// 释放AB门禁管理和不可用弹窗资源 |
|
|
// 释放AB门禁管理和不可用弹窗资源 |
|
|
if (gateUnavailableDialog != null) { |
|
|
if (gateUnavailableDialog != null) { |
|
|
gateUnavailableDialog.release(); |
|
|
gateUnavailableDialog.release(); |
|
@ -1491,8 +1452,8 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 停止UDP门禁状态轮询 |
|
|
// 停止UDP门禁状态轮询 |
|
|
if (isUDPInitialized && udpExample != null) { |
|
|
|
|
|
udpExample.stopGatePolling(); |
|
|
|
|
|
|
|
|
if (gateABController != null) { |
|
|
|
|
|
gateABController.stopUDPPolling(); |
|
|
LogManager.logInfo(TAG, "UDP门禁状态轮询已停止"); |
|
|
LogManager.logInfo(TAG, "UDP门禁状态轮询已停止"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1717,9 +1678,9 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
hideLoadingStatus(); |
|
|
hideLoadingStatus(); |
|
|
|
|
|
|
|
|
// 直接开启B门 |
|
|
// 直接开启B门 |
|
|
if (isUDPInitialized && udpExample != null) { |
|
|
|
|
|
|
|
|
if (gateABController != null) { |
|
|
LogManager.logInfo(TAG, "gate_enter_open_enable为true,直接开启B门"); |
|
|
LogManager.logInfo(TAG, "gate_enter_open_enable为true,直接开启B门"); |
|
|
udpExample.handleFaceRecognitionSuccess(false); // 参数保留兼容性,实际都开B门 |
|
|
|
|
|
|
|
|
gateABController.handleFaceRecognitionSuccess(false); // 参数保留兼容性,实际都开B门 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, 2000); |
|
|
}, 2000); |
|
@ -1733,9 +1694,9 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
showLoadingStatus("网络不可用,直接开门"); |
|
|
showLoadingStatus("网络不可用,直接开门"); |
|
|
|
|
|
|
|
|
// 直接开启B门,防止用户卡在场内 |
|
|
// 直接开启B门,防止用户卡在场内 |
|
|
if (isUDPInitialized && udpExample != null) { |
|
|
|
|
|
|
|
|
if (gateABController != null) { |
|
|
LogManager.logInfo(TAG, "离场场景网络不可用,直接开启B门"); |
|
|
LogManager.logInfo(TAG, "离场场景网络不可用,直接开启B门"); |
|
|
udpExample.handleFaceRecognitionSuccess(false); // 开启B门 |
|
|
|
|
|
|
|
|
gateABController.handleFaceRecognitionSuccess(false); // 开启B门 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 3秒后隐藏提示 |
|
|
// 3秒后隐藏提示 |
|
|