|
|
@ -1712,68 +1712,6 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 新增:离场场景下gate_open_enable为true时直接开门 |
|
|
|
if (isLeaveScene) { |
|
|
|
VenueSceneUtils.GateConfig gateConfig = VenueSceneUtils.getGateConfig(this); |
|
|
|
// gate_enter_open_enable |
|
|
|
if (gateConfig != null && gateConfig.gateEnterOpenEnable) { |
|
|
|
LogManager.logInfo(TAG, "检测到离场场景且gate_open_enable为true,直接执行openGateAB开门"); |
|
|
|
|
|
|
|
// 直接执行AB门开门操作 |
|
|
|
if (gateABController != null) { |
|
|
|
// 暂停摄像头预览10秒后再恢复,避免频繁执行开门操作 |
|
|
|
pauseCamera(); |
|
|
|
LogManager.logInfo(TAG, "暂停摄像头预览10秒,避免频繁执行开门操作"); |
|
|
|
|
|
|
|
// 10秒后恢复摄像头预览 |
|
|
|
new Handler().postDelayed(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
resumeCamera(); |
|
|
|
LogManager.logInfo(TAG, "10秒后恢复摄像头预览"); |
|
|
|
} |
|
|
|
}, 10000); |
|
|
|
|
|
|
|
gateABController.openGateAB(new GateABController.GateControlCallback() { |
|
|
|
@Override |
|
|
|
public void onSuccess(String message) { |
|
|
|
LogManager.logInfo(TAG, "离场场景gate_open_enable直接开门成功: " + message); |
|
|
|
|
|
|
|
// 显示简单的成功提示 |
|
|
|
runOnUiThread(() -> { |
|
|
|
showLoadingStatus("开门成功"); |
|
|
|
|
|
|
|
// 5秒后隐藏提示 |
|
|
|
new Handler().postDelayed(() -> { |
|
|
|
hideLoadingStatus(); |
|
|
|
}, 5000); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onError(String errorMessage) { |
|
|
|
LogManager.logError(TAG, "离场场景gate_open_enable直接开门失败: " + errorMessage); |
|
|
|
|
|
|
|
// 显示错误提示 |
|
|
|
runOnUiThread(() -> { |
|
|
|
showLoadingStatus("开门失败: " + errorMessage); |
|
|
|
|
|
|
|
// 5秒后隐藏提示 |
|
|
|
new Handler().postDelayed(() -> { |
|
|
|
hideLoadingStatus(); |
|
|
|
}, 5000); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
LogManager.logError(TAG, "gateABController为空,无法执行开门操作"); |
|
|
|
} |
|
|
|
|
|
|
|
// 直接返回,不再继续执行后续逻辑 |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
LogManager.logInfo(TAG, "继续执行正常的人脸识别流程 - 场景: " + (isLeaveScene ? "离场" : "进场") + ", 网络: " + (isNetworkAvailable ? "可用" : "不可用")); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
@ -1867,7 +1805,7 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 处理人脸识别流程(从 checkResultOnline 中抽取出来) |
|
|
|
*/ |
|
|
@ -1887,8 +1825,9 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
|
if (VenueSceneUtils.isLeaveScene(OXFaceOnlineActivity.this)) { |
|
|
|
// 离场场景:检查gate_enter_open_enable配置 |
|
|
|
VenueSceneUtils.GateConfig gateConfig = VenueSceneUtils.getGateConfig(OXFaceOnlineActivity.this); |
|
|
|
if (gateConfig != null && gateConfig.gateEnterOpenEnable) { |
|
|
|
// 如果 gate_enter_open_enable 为 true,直接开门不进行网络核销 |
|
|
|
// gateOpenEnable |
|
|
|
if (gateConfig != null && gateConfig.gateOpenEnable) { |
|
|
|
// 如果 gate_open_enable 为 true,直接开门不进行网络核销 |
|
|
|
LogManager.logInfo(TAG, "检测到离场场景,gate_enter_open_enable为true,直接开启B门"); |
|
|
|
showLoadingStatus("离场验证成功"); |
|
|
|
|
|
|
@ -1910,7 +1849,8 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
|
if (isNetworkAvailable()) { |
|
|
|
LogManager.logInfo(TAG, "检测到离场场景,网络可用,执行离场校验"); |
|
|
|
performLeaveVerification(base64img); |
|
|
|
} else { |
|
|
|
} |
|
|
|
else { |
|
|
|
LogManager.logWarning(TAG, "检测到离场场景,但网络不可用,直接开启B门"); |
|
|
|
showLoadingStatus("网络不可用,直接开门"); |
|
|
|
|
|
|
|