|
@@ -0,0 +1,949 @@
|
|
|
|
+package com.hanghui.senic.baiduface.view;
|
|
|
|
+
|
|
|
|
+import android.content.Context;
|
|
|
|
+import android.graphics.Bitmap;
|
|
|
|
+import android.graphics.drawable.BitmapDrawable;
|
|
|
|
+import android.graphics.drawable.Drawable;
|
|
|
|
+import android.os.CountDownTimer;
|
|
|
|
+import android.os.Handler;
|
|
|
|
+import android.os.Looper;
|
|
|
|
+import android.text.TextUtils;
|
|
|
|
+import android.util.AttributeSet;
|
|
|
|
+import android.util.Log;
|
|
|
|
+import android.view.LayoutInflater;
|
|
|
|
+import android.view.View;
|
|
|
|
+import android.widget.FrameLayout;
|
|
|
|
+import android.widget.ImageView;
|
|
|
|
+import android.widget.LinearLayout;
|
|
|
|
+import android.widget.TextView;
|
|
|
|
+
|
|
|
|
+import androidx.annotation.Nullable;
|
|
|
|
+import androidx.core.content.ContextCompat;
|
|
|
|
+
|
|
|
|
+import com.baidu.idl.main.facesdk.model.BDFaceImageInstance;
|
|
|
|
+import com.baidu.idl.main.facesdk.model.SingleBaseConfig;
|
|
|
|
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
|
|
|
+import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
|
|
|
+import com.bumptech.glide.request.RequestOptions;
|
|
|
|
+import com.example.datalibrary.model.LivenessModel;
|
|
|
|
+import com.example.datalibrary.model.User;
|
|
|
|
+import com.example.datalibrary.utils.BitmapUtils;
|
|
|
|
+import com.hanghui.senic.R;
|
|
|
|
+import com.hanghui.senic.activity.view.BaiDuFaceView;
|
|
|
|
+import com.hanghui.senic.activity.view.ClickButtonFloatView;
|
|
|
|
+import com.hanghui.senic.baiduface.BaiDuFaceResultPageListener;
|
|
|
|
+import com.hanghui.senic.baiduface.BaiduFaceUtil;
|
|
|
|
+import com.hanghui.senic.bean.AuthenticationBean;
|
|
|
|
+import com.hanghui.senic.bean.FederatedPlatformsRequestBean;
|
|
|
|
+import com.hanghui.senic.bean.FederatedPlatformsResponseBean;
|
|
|
|
+import com.hanghui.senic.common.AppHandler;
|
|
|
|
+import com.hanghui.senic.common.CommonUtil;
|
|
|
|
+import com.hanghui.senic.common.Constants;
|
|
|
|
+import com.hanghui.senic.common.DataManager;
|
|
|
|
+import com.hanghui.senic.common.DataReturns;
|
|
|
|
+import com.hanghui.senic.common.DeviceExpireManager;
|
|
|
|
+import com.hanghui.senic.common.MTTSManager;
|
|
|
|
+import com.hanghui.senic.common.TaskStatus;
|
|
|
|
+import com.hanghui.senic.common.ThreadPoolManager;
|
|
|
|
+import com.hanghui.senic.common.UserInfoManager;
|
|
|
|
+import com.hanghui.senic.controller.BlacklistManager;
|
|
|
|
+import com.hanghui.senic.network.HttpRequest;
|
|
|
|
+import com.hanghui.senic.service.usbserialdemo.utile.ConfigManager;
|
|
|
|
+import com.hanghui.senic.service.usbserialdemo.utile.StringIsNull;
|
|
|
|
+import com.hanghui.senic.service.usbserialdemo.utile.StringUtils;
|
|
|
|
+import com.hanghui.senic.service.usbserialdemo.utile.X1.RelaysAndLedUtile;
|
|
|
|
+import com.hanghui.senic.service.usbserialdemo.utile.loacat.AppLogUtils;
|
|
|
|
+import com.hanghui.senic.utils.DoubClickUtils;
|
|
|
|
+import com.hanghui.senic.utils.ImageLoaderUtils;
|
|
|
|
+
|
|
|
|
+import java.util.concurrent.Future;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Description: $
|
|
|
|
+ *
|
|
|
|
+ * @author xwh
|
|
|
|
+ * time 2024/12/24
|
|
|
|
+ **/
|
|
|
|
+public class BaiduResultView extends LinearLayout {
|
|
|
|
+
|
|
|
|
+ private ImageView ivPhoto,iv_through,iv_top_bg;
|
|
|
|
+ private TextView tv_name,tv_card,tv_phone,tv_through;
|
|
|
|
+ private LinearLayout ll_outcome_masked;
|
|
|
|
+ private FrameLayout fl_user_info;
|
|
|
|
+ private Future future; //开门线程
|
|
|
|
+
|
|
|
|
+ private LinearLayout ll_count_down;
|
|
|
|
+ private TextView tv_count_down;
|
|
|
|
+ /**
|
|
|
|
+ * 清除同人脸间隔判断保存的userID
|
|
|
|
+ */
|
|
|
|
+ private Runnable userIdUniqueIdRunnable = new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ userIdUniqueId = "";
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ public BaiduResultView(Context context) {
|
|
|
|
+ super(context);
|
|
|
|
+ init(context);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public BaiduResultView(Context context, @Nullable AttributeSet attrs) {
|
|
|
|
+ super(context, attrs);
|
|
|
|
+ init(context);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public BaiduResultView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
|
|
|
+ super(context, attrs, defStyleAttr);
|
|
|
|
+ init(context);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public BaiduResultView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
|
|
|
+ super(context, attrs, defStyleAttr, defStyleRes);
|
|
|
|
+ init(context);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void init(Context context){
|
|
|
|
+ LayoutInflater.from(context).inflate(R.layout.layout_baidu_result_view, this);
|
|
|
|
+ ivPhoto=findViewById(R.id.iv_photo);
|
|
|
|
+ tv_name=findViewById(R.id.tv_name);
|
|
|
|
+ tv_card=findViewById(R.id.tv_card);
|
|
|
|
+ tv_phone=findViewById(R.id.tv_phone);
|
|
|
|
+ iv_through=findViewById(R.id.iv_through);
|
|
|
|
+ iv_top_bg=findViewById(R.id.iv_top_bg);
|
|
|
|
+ tv_through=findViewById(R.id.tv_through);
|
|
|
|
+ fl_user_info=findViewById(R.id.fl_user_info);
|
|
|
|
+ ll_outcome_masked=findViewById(R.id.ll_outcome_masked);
|
|
|
|
+ tv_count_down=findViewById(R.id.tv_count_down);
|
|
|
|
+ ll_count_down = findViewById(R.id.ll_count_down);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.mainactivity_aicon,iv_through);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.blue_background_gradient,iv_top_bg);
|
|
|
|
+ ll_count_down.setOnClickListener(new OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
+ if(DoubClickUtils.onDoubClick()){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ closePage();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void result(LivenessModel livenessModel,int featureCheckMode){
|
|
|
|
+
|
|
|
|
+ // 设备已过期,不做任何处理
|
|
|
|
+ if (DeviceExpireManager.getInstance().isDeviceExpire()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (featureCheckMode == 3 && ConfigManager.getAuthenticationBeanListBean().getOpenOneToN()) {
|
|
|
|
+ User user = livenessModel.getUser();
|
|
|
|
+ if (user == null) {
|
|
|
|
+ stranger(livenessModel);
|
|
|
|
+ }else{
|
|
|
|
+ startTime=0L;
|
|
|
|
+ if(future!=null&&!future.isDone()){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ future= ThreadPoolManager.getInstance().submit(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ doScanFaceResult_Success(livenessModel);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } else if (featureCheckMode == 4) {
|
|
|
|
+ doPersonCardResult(livenessModel);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ long currentTime = System.currentTimeMillis();//检测到刷脸数据返回后,记录当前事件
|
|
|
|
+ volatile long startTime = 0L;//将刷脸返回时的当前时间保存,用于下次比较
|
|
|
|
+ //陌生人
|
|
|
|
+ private void stranger(LivenessModel livenessModel){
|
|
|
|
+ if (ConfigManager.getAuthenticationBeanListBean().getOneToNFailShowTip()) {
|
|
|
|
+ currentTime = System.currentTimeMillis();
|
|
|
|
+ if (startTime == 0 || ((currentTime - startTime) > (ConfigManager.getAuthenticationBeanListBean().getOneToNContinueFailTime() * 1000) + 500)) {
|
|
|
|
+ startTime = currentTime;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ((currentTime - startTime) > (ConfigManager.getAuthenticationBeanListBean().getOneToNContinueFailTime() * 1000)) {
|
|
|
|
+
|
|
|
|
+ TaskStatus.setStatus(TaskStatus.TASK_STATUS_FACE);
|
|
|
|
+ TaskStatus.setCurrentTask(TaskStatus.CURRENT_TASSK_LOCAL_FACE);
|
|
|
|
+ if(callback!=null){
|
|
|
|
+ callback.invokeStopVerify();
|
|
|
|
+ }
|
|
|
|
+ //判断失败进出记录是否开启,且类型包含1:N刷脸失败类型
|
|
|
|
+ sendPushFailed(3,livenessModel.getBdFaceImageInstance());
|
|
|
|
+ String failText = "";
|
|
|
|
+ if (!StringIsNull.IsStringNull(ConfigManager.getAuthenticationBeanListBean().getFailText())) {
|
|
|
|
+ failText = ConfigManager.getAuthenticationBeanListBean().getFailText();
|
|
|
|
+ }
|
|
|
|
+ doPersonCardResult_fail(failText, ConfigManager.getAuthenticationBeanListBean().getFailVoice());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ volatile String userIdUniqueId = "";
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 纯刷脸成功后执行
|
|
|
|
+ *
|
|
|
|
+ * @param livenessModel
|
|
|
|
+ */
|
|
|
|
+ private void doScanFaceResult_Success(LivenessModel livenessModel) {
|
|
|
|
+ User user = livenessModel.getUser();
|
|
|
|
+ if (user == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ //同人脸判断是否在规定时间内
|
|
|
|
+ if (userIdUniqueId.equals(StringIsNull.ReturnString(user.getUserId()))){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(callback!=null){
|
|
|
|
+ callback.invokeStopVerify();
|
|
|
|
+ }
|
|
|
|
+ TaskStatus.setStatus(TaskStatus.TASK_STATUS_FACE);
|
|
|
|
+ TaskStatus.setCurrentTask(TaskStatus.CURRENT_TASSK_LOCAL_FACE);
|
|
|
|
+
|
|
|
|
+ String faceRequestParams = BaiduFaceUtil.getScanFaceRequestParams(user);
|
|
|
|
+
|
|
|
|
+ //setAuthCodeOrVid(jsonObject,extInfoJsonObject);
|
|
|
|
+ //重置现场照片、姓名、身份证号等用户信息
|
|
|
|
+ setUserInfoToUserInfoManager(livenessModel);
|
|
|
|
+
|
|
|
|
+ DataReturns.getInstance().clearData();
|
|
|
|
+ //判断用户是否在有效期内
|
|
|
|
+ if (ConfigManager.getAuthenticationBeanListBean().getValidTimeSwitch() && isUserExpire(user)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ //判断黑名单中是否存在该用户
|
|
|
|
+ if (BlacklistManager.getInstance().isInBlacklist(user.getIdNumber(), user.getPhone(), new BaiDuFaceResultPageListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void showUI(String msgStr,String voiceStr) {
|
|
|
|
+ showErrorUI(msgStr,voiceStr);
|
|
|
|
+ }})) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //判断年龄限制是否打开
|
|
|
|
+ if (ConfigManager.isAgeLimitOpen(user.getIdNumber(), user.getUserId(), new BaiDuFaceResultPageListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void showUI(String msgStr, String voiceStr) {
|
|
|
|
+ showErrorUI(msgStr,voiceStr);
|
|
|
|
+ }})) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ //判断1:N刷脸 同人脸间隔
|
|
|
|
+ if(ConfigManager.getAuthenticationBeanListBean().getSameFaceInterval() > 0){
|
|
|
|
+ userIdUniqueId = StringIsNull.ReturnString(user.getUserId());
|
|
|
|
+ //销毁延时器,重新计时
|
|
|
|
+ AppHandler.getHandler().removeCallbacks(userIdUniqueIdRunnable);
|
|
|
|
+ AppHandler.getHandler().postDelayed(userIdUniqueIdRunnable,
|
|
|
|
+ ConfigManager.getAuthenticationBeanListBean().getSameFaceInterval() * 1000);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Constants.IDCARD_TYPE = 0;
|
|
|
|
+
|
|
|
|
+ AuthenticationBean.DataDTO dataDTO= ConfigManager.getAuthenticationBean().getData().get(0);
|
|
|
|
+ RelaysAndLedUtile.getInstance().openDoor(dataDTO.getUseSerialPort(),dataDTO.getSignalNo());
|
|
|
|
+ ThreadPoolManager.getInstance().execute(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ String speak= ConfigManager.getAuthenticationBeanListBean().getSucVoice();
|
|
|
|
+ if(TextUtils.isEmpty(speak)){
|
|
|
|
+ speak ="请通行";
|
|
|
|
+ }
|
|
|
|
+ MTTSManager.getInstance().speak(speak);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ BDFaceImageInstance rgbImage = livenessModel.getBdFaceImageInstance();
|
|
|
|
+ if (rgbImage != null) {
|
|
|
|
+ final Bitmap bitmap = BitmapUtils.getInstaceBmp(rgbImage);
|
|
|
|
+ HttpRequest.getInstance().setEventRecords(TaskStatus.currentTask,
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getName(),
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getIdNumber(),
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getIdPhoto(), "",
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getMobile(), true,
|
|
|
|
+ 0,
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getCardIdEx(),
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getUserId(),bitmap);
|
|
|
|
+ RequestOptions options = new RequestOptions().bitmapTransform(new RoundedCorners(30));
|
|
|
|
+ options.diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true);
|
|
|
|
+
|
|
|
|
+ String name = UserInfoManager.getInstance().getUserInformationBean().getName();
|
|
|
|
+ String idCard = UserInfoManager.getInstance().getUserInformationBean().getIdNumber();
|
|
|
|
+ String phone = UserInfoManager.getInstance().getUserInformationBean().getMobile();
|
|
|
|
+ //姓名脱敏
|
|
|
|
+ if (!StringUtils.isEmpty(name) && StringUtils.isString(ConfigManager.getAuthenticationBean().getData()
|
|
|
|
+ .get(0).getSucText(), "姓名")) {
|
|
|
|
+ name = StringUtils.getString(name);
|
|
|
|
+ name = StringUtils.chineseName(name);
|
|
|
|
+ }
|
|
|
|
+ //身份证脱敏
|
|
|
|
+ if (!StringUtils.isEmpty(idCard) && StringUtils.isString(ConfigManager.getAuthenticationBean().getData()
|
|
|
|
+ .get(0).getSucText(), "身份证号")) {
|
|
|
|
+ idCard = StringUtils.getString(idCard);
|
|
|
|
+ idCard = StringUtils.getDesensitization(idCard);
|
|
|
|
+ }
|
|
|
|
+ //手机号脱敏
|
|
|
|
+ if (!StringUtils.isEmpty(phone) && StringUtils.isString(ConfigManager.getAuthenticationBean().getData()
|
|
|
|
+ .get(0).getSucText(), "手机号")) {
|
|
|
|
+ phone = StringUtils.getString(phone);
|
|
|
|
+ phone = StringUtils.mobilePhone(phone);
|
|
|
|
+ }
|
|
|
|
+ if (StringIsNull.IsStringNull(name)) {
|
|
|
|
+ name = "";
|
|
|
|
+ }
|
|
|
|
+ if (StringIsNull.IsStringNull(idCard)) {
|
|
|
|
+ idCard = "";
|
|
|
|
+ }
|
|
|
|
+ if (StringIsNull.IsStringNull(phone)) {
|
|
|
|
+ phone = "";
|
|
|
|
+ }
|
|
|
|
+ if (!phone.contains("*")) {
|
|
|
|
+ phone = StringUtils.defaultDesensitization(phone);
|
|
|
|
+ }
|
|
|
|
+ if (!idCard.contains("*")) {
|
|
|
|
+ idCard = StringUtils.defaultDesensitization(idCard);
|
|
|
|
+ }
|
|
|
|
+ if (!name.contains("*")) {
|
|
|
|
+ name = StringUtils.defaultDesensitization(name);
|
|
|
|
+ }
|
|
|
|
+ final String finalName = name ;
|
|
|
|
+ final String finalidCard=idCard;
|
|
|
|
+ final String finalPhone=phone;
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ setVisibility(View.VISIBLE);
|
|
|
|
+ fl_user_info.setVisibility(VISIBLE);
|
|
|
|
+ String sucText= ConfigManager.getAuthenticationBeanListBean().getSucText();
|
|
|
|
+ if(TextUtils.isEmpty(sucText)){
|
|
|
|
+ sucText="请通行";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ImageLoaderUtils.loadImage(bitmap,ivPhoto,options);
|
|
|
|
+ iv_through.setVisibility(VISIBLE);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.mainactivity_aicon,iv_through);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.blue_background_gradient,iv_top_bg);
|
|
|
|
+ ll_outcome_masked.setBackgroundResource(R.drawable.outcome_masked_blues);
|
|
|
|
+ tv_name.setText(finalName);
|
|
|
|
+ tv_card.setText(finalidCard);
|
|
|
|
+ tv_phone.setText(finalPhone);
|
|
|
|
+ tv_through.setText(sucText);
|
|
|
|
+ tv_through.setTextColor(ContextCompat.getColor(getContext(),R.color.f1677FF));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ int delay=dataDTO.getSuccessPageTime();
|
|
|
|
+ reset(delay);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Handler mHandler =new Handler(Looper.getMainLooper());
|
|
|
|
+
|
|
|
|
+ public Handler getmHandler() {
|
|
|
|
+ if(mHandler==null){
|
|
|
|
+ synchronized (BaiduResultView.class){
|
|
|
|
+ if(mHandler==null){
|
|
|
|
+ mHandler=new android.os.Handler(Looper.getMainLooper());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return mHandler;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private volatile CountDownTimer oneToOneCountDownTimer;
|
|
|
|
+ private void startOneToOneCountDownTimer(int delay){
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ try {
|
|
|
|
+
|
|
|
|
+ ll_count_down.setVisibility(VISIBLE);
|
|
|
|
+ tv_count_down.setText(delay + "s");
|
|
|
|
+ oneToOneCountDownTimer = new CountDownTimer(delay * 1000, 1000) {
|
|
|
|
+ public void onTick(long millisUntilFinished) {
|
|
|
|
+ // 每次间隔,这里更新UI,显示剩余时间
|
|
|
|
+ tv_count_down.setText(" "+(millisUntilFinished / 1000) + "s");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void onFinish() {
|
|
|
|
+ // 倒计时结束时的操作
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ // 开始倒计时
|
|
|
|
+ oneToOneCountDownTimer.start();
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ stopOneToOneCountDownTimer();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ private void stopOneToOneCountDownTimer(){
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ if (oneToOneCountDownTimer != null) {
|
|
|
|
+ oneToOneCountDownTimer.cancel();
|
|
|
|
+ oneToOneCountDownTimer=null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private volatile CountDownTimer closeResultPageCountDownTimer;
|
|
|
|
+ private volatile boolean isCountDowning=false;
|
|
|
|
+
|
|
|
|
+ private void startCountDownTimer(int delay){
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ try {
|
|
|
|
+ if (isCountDowning) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ isCountDowning = true;
|
|
|
|
+ ll_count_down.setVisibility(VISIBLE);
|
|
|
|
+ tv_count_down.setText(delay + "s");
|
|
|
|
+ closeResultPageCountDownTimer = new CountDownTimer(delay * 1000, 1000) {
|
|
|
|
+ public void onTick(long millisUntilFinished) {
|
|
|
|
+ // 每次间隔,这里更新UI,显示剩余时间
|
|
|
|
+ tv_count_down.setText(" "+(millisUntilFinished / 1000) + "s");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void onFinish() {
|
|
|
|
+ // 倒计时结束时的操作
|
|
|
|
+ closePage();
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ // 开始倒计时
|
|
|
|
+ closeResultPageCountDownTimer.start();
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ isCountDowning=false;
|
|
|
|
+ stopCountDownTimer();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private void closePage(){
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ isCountDowning = false;
|
|
|
|
+ ll_count_down.setVisibility(INVISIBLE);
|
|
|
|
+ ivPhoto.setImageResource(0);
|
|
|
|
+ ll_outcome_masked.setBackgroundResource(0);
|
|
|
|
+ tv_name.setText("");
|
|
|
|
+ tv_card.setText("");
|
|
|
|
+ tv_phone.setText("");
|
|
|
|
+ tv_through.setText("");
|
|
|
|
+ setVisibility(View.INVISIBLE);
|
|
|
|
+ fl_user_info.setVisibility(INVISIBLE);
|
|
|
|
+ iv_through.setVisibility(VISIBLE);
|
|
|
|
+ getmHandler().removeCallbacksAndMessages(null);
|
|
|
|
+ isCreatedRunnable = false;
|
|
|
|
+ isCountDowning=false;
|
|
|
|
+ startTime=0L;
|
|
|
|
+ TaskStatus.setInitState();
|
|
|
|
+ if (callback != null) {
|
|
|
|
+ callback.invokeResume();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * @author xwh
|
|
|
|
+ * Time 2024/9/3
|
|
|
|
+ * Description: 停止倒计时
|
|
|
|
+ *
|
|
|
|
+ **/
|
|
|
|
+ private void stopCountDownTimer(){
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ if (closeResultPageCountDownTimer != null) {
|
|
|
|
+ closeResultPageCountDownTimer.cancel();
|
|
|
|
+ closeResultPageCountDownTimer=null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void reset(int delay){
|
|
|
|
+ startCountDownTimer(delay);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private void showErrorUI(String msgStr,String voiceStr){
|
|
|
|
+ AuthenticationBean.DataDTO dataDTO= ConfigManager.getAuthenticationBean().getData().get(0);
|
|
|
|
+ ThreadPoolManager.getInstance().execute(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ String voice= voiceStr;
|
|
|
|
+ if(TextUtils.isEmpty(voiceStr)){
|
|
|
|
+ voice=ConfigManager.getAuthenticationBeanListBean().getFailVoice();
|
|
|
|
+ }
|
|
|
|
+ if(TextUtils.isEmpty(voice)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ MTTSManager.getInstance().speak(voice);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ setVisibility(View.VISIBLE);
|
|
|
|
+ fl_user_info.setVisibility(INVISIBLE);
|
|
|
|
+ String sucText= msgStr;
|
|
|
|
+ if(TextUtils.isEmpty(msgStr)){
|
|
|
|
+ sucText=ConfigManager.getAuthenticationBeanListBean().getFailText();
|
|
|
|
+ }
|
|
|
|
+ iv_through.setVisibility(VISIBLE);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.mainactivity_erroe,iv_through);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.red_background_gradient,iv_top_bg);
|
|
|
|
+ ll_outcome_masked.setBackgroundResource(R.drawable.outcome_masked_reds);
|
|
|
|
+ tv_through.setText(sucText);
|
|
|
|
+ tv_through.setTextColor(ContextCompat.getColor(getContext(),R.color.fEE4523));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ int delay=dataDTO.getFailPageTime();
|
|
|
|
+ reset(delay);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void showResultPageUI(boolean isSuccess,String msgStr,String voiceStr){
|
|
|
|
+ if(callback!=null){
|
|
|
|
+ callback.invokeStopVerify();
|
|
|
|
+ }
|
|
|
|
+ stopOneToOneCountDownTimer();
|
|
|
|
+ if(!isSuccess){
|
|
|
|
+
|
|
|
|
+ AuthenticationBean.DataDTO dataDTO= ConfigManager.getAuthenticationBean().getData().get(0);
|
|
|
|
+ ThreadPoolManager.getInstance().execute(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ String voice= voiceStr;
|
|
|
|
+ if(TextUtils.isEmpty(voiceStr)){
|
|
|
|
+ voice=ConfigManager.getAuthenticationBeanListBean().getFailVoice();
|
|
|
|
+ }
|
|
|
|
+ if(TextUtils.isEmpty(voice)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ MTTSManager.getInstance().speak(voice);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ getmHandler().removeCallbacksAndMessages(null);
|
|
|
|
+ setVisibility(View.VISIBLE);
|
|
|
|
+ fl_user_info.setVisibility(INVISIBLE);
|
|
|
|
+ String sucText= msgStr;
|
|
|
|
+ if(TextUtils.isEmpty(msgStr)){
|
|
|
|
+ sucText=ConfigManager.getAuthenticationBeanListBean().getFailText();
|
|
|
|
+ }
|
|
|
|
+ iv_through.setVisibility(VISIBLE);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.mainactivity_erroe,iv_through);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.red_background_gradient,iv_top_bg);
|
|
|
|
+ ll_outcome_masked.setBackgroundResource(R.drawable.outcome_masked_reds);
|
|
|
|
+ tv_through.setText(sucText);
|
|
|
|
+ tv_through.setTextColor(ContextCompat.getColor(getContext(),R.color.fEE4523));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ int delay=dataDTO.getFailPageTime();
|
|
|
|
+ reset(delay);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+
|
|
|
|
+ ThreadPoolManager.getInstance().execute(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ String voice= voiceStr;
|
|
|
|
+ if(TextUtils.isEmpty(voiceStr)){
|
|
|
|
+ voice=ConfigManager.getAuthenticationBeanListBean().getOneToOneVoice();
|
|
|
|
+ }
|
|
|
|
+ if(TextUtils.isEmpty(voice)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ MTTSManager.getInstance().speak(voice);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ setVisibility(View.VISIBLE);
|
|
|
|
+ fl_user_info.setVisibility(INVISIBLE);
|
|
|
|
+ String sucText= msgStr;
|
|
|
|
+ if(TextUtils.isEmpty(msgStr)){
|
|
|
|
+ sucText=ConfigManager.getAuthenticationBeanListBean().getOneToOneTips();
|
|
|
|
+ }
|
|
|
|
+ iv_through.setVisibility(GONE);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.mainactivity_aicon,iv_through);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.blue_background_gradient,iv_top_bg);
|
|
|
|
+ ll_outcome_masked.setBackgroundResource(R.drawable.outcome_masked_blues);
|
|
|
|
+ tv_through.setText(sucText);
|
|
|
|
+ tv_through.setTextColor(ContextCompat.getColor(getContext(),R.color.f1677FF));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ int delay=ConfigManager.getAuthenticationBean().getData().get(0).getOneToOneTimeout() ;
|
|
|
|
+ startOneToOneCountDownTimer(delay);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 判断用户是否过期
|
|
|
|
+ *
|
|
|
|
+ * @param user 用户
|
|
|
|
+ * @return 是否过期
|
|
|
|
+ */
|
|
|
|
+ private boolean isUserExpire(User user) {
|
|
|
|
+ if (user == null) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ long startTime = user.getStartTime();
|
|
|
|
+ long endTime = user.getEndTime();
|
|
|
|
+ long curTime = System.currentTimeMillis();
|
|
|
|
+ if (curTime <= startTime){
|
|
|
|
+ showErrorUI("未到有效时间","未到有效时间");
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ if (curTime >= endTime){
|
|
|
|
+ showErrorUI("已过期","已过期");
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+// //已过期
|
|
|
|
+// if (curTime <= startTime || curTime >= endTime) {
|
|
|
|
+//
|
|
|
|
+// FederatedPlatformsResponseBean federatedPlatformsResponseBean = DataManager.getInstance().getErrorOutcome("LocalError_B", "不在有效期", 500, "不在有效期");
|
|
|
|
+// BaiDuFaceView.getInstance().getPlatformsCod(federatedPlatformsResponseBean);
|
|
|
|
+//
|
|
|
|
+// return true;
|
|
|
|
+// }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ private void setUserInfoToUserInfoManager(LivenessModel livenessModel) {
|
|
|
|
+ if (livenessModel == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ User user = livenessModel.getUser();
|
|
|
|
+
|
|
|
|
+ if (user == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ String userName = user.getUserName();
|
|
|
|
+ String idNumber = user.getIdNumber();
|
|
|
|
+ String phone = user.getPhone();
|
|
|
|
+ String photo = user.getPhoto();
|
|
|
|
+ String cardIdEx = user.getCardIdEx();
|
|
|
|
+ String userId = user.getUserId();
|
|
|
|
+ String scenePhotoUrl = user.getPhoto();
|
|
|
|
+ UserInfoManager.getInstance().setUserInformationBean(userName, idNumber, "", photo, phone, cardIdEx, userId, livenessModel.getFeatureScore(), scenePhotoUrl);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ //判断1:1人脸连续未通过的runnable是否启动
|
|
|
|
+ volatile boolean isCreatedRunnable = false;
|
|
|
|
+ /**
|
|
|
|
+ * 刷脸失败
|
|
|
|
+ * @param msg
|
|
|
|
+ * @param openVoiceMsg
|
|
|
|
+ */
|
|
|
|
+ private void doPersonCardResult_fail(String msg, String openVoiceMsg) {
|
|
|
|
+ if(callback!=null){
|
|
|
|
+ callback.personCardinvokeStopVerify();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringIsNull.IsStringNull(openVoiceMsg)) {
|
|
|
|
+ openVoiceMsg = msg;
|
|
|
|
+ }
|
|
|
|
+ isCreatedRunnable = false;
|
|
|
|
+ startTime = 0L;
|
|
|
|
+ showErrorUI(msg,openVoiceMsg);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 1:N、1:1 刷脸失败进出记录推送
|
|
|
|
+ * @param type
|
|
|
|
+ */
|
|
|
|
+ private void sendPushFailed(int type, BDFaceImageInstance rgbImage) {
|
|
|
|
+ if (!ConfigManager.getAuthenticationBeanListBean().isPushFailedRecordSwitch()){
|
|
|
|
+ AppLogUtils.e(false,"刷脸失败记录推送","刷脸失败记录推送 - 检测到未开启失败记录推送,直接return");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (!ConfigManager.getAuthenticationBeanListBean().getPushFailedRecordType().contains(type)){
|
|
|
|
+ AppLogUtils.e(false,"刷脸失败记录推送","刷脸失败记录推送 - 检测到失败类型中不包含当前类型,直接return type = "+type);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ Bitmap bitmap = null;
|
|
|
|
+ if (rgbImage != null) {
|
|
|
|
+ bitmap = BitmapUtils.getInstaceBmp(rgbImage);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ HttpRequest.getInstance().setEventRecords(TaskStatus.currentTask,
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getName(),
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getIdNumber(),
|
|
|
|
+ "", "", UserInfoManager.getInstance().getUserInformationBean().getMobile(),
|
|
|
|
+ false, type, UserInfoManager.getInstance().getUserInformationBean().getCardIdEx(), "",bitmap);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 人证比对结果处理
|
|
|
|
+ *
|
|
|
|
+ * @param livenessModel
|
|
|
|
+ */
|
|
|
|
+ private void doPersonCardResult(LivenessModel livenessModel) {
|
|
|
|
+
|
|
|
|
+ if (livenessModel == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // 人脸识别阈值判断
|
|
|
|
+ // 比对分值,相似度分数
|
|
|
|
+ float compareScore = livenessModel.getScore();
|
|
|
|
+ float idThreshold = SingleBaseConfig.getBaseConfig().getIdThreshold();
|
|
|
|
+
|
|
|
|
+ if (!ConfigManager.getAuthenticationBeanListBean().getLivingControl()) { //活体检测未开启
|
|
|
|
+ doPersonCardComparison(compareScore, idThreshold, livenessModel);
|
|
|
|
+
|
|
|
|
+ } else { //活体检测开启
|
|
|
|
+ //活体阈值判断显示
|
|
|
|
+ float rgbLivenessScore = livenessModel.getRgbLivenessScore();
|
|
|
|
+ float rgbLivenessThreshold = SingleBaseConfig.getBaseConfig().getRgbLiveScore();//rgb活体阈值
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (rgbLivenessScore >= rgbLivenessThreshold) {
|
|
|
|
+ doPersonCardComparison(compareScore, idThreshold, livenessModel);
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void doPersonCardComparison(float compareScore, float idThreshold, LivenessModel livenessModel) {
|
|
|
|
+ if (compareScore >= idThreshold) {
|
|
|
|
+ UserInfoManager.getInstance().updateUserInformationBean_VerifyScore(compareScore);
|
|
|
|
+ doPersonCardResult_Success(livenessModel);
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ if (!isCreatedRunnable) {
|
|
|
|
+ isCreatedRunnable = true;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ getmHandler().removeCallbacksAndMessages(null);
|
|
|
|
+ getmHandler().postDelayed(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ ThreadPoolManager.getInstance().execute(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ //判断失败进出记录是否开启,且类型包含1:1刷脸失败类型
|
|
|
|
+ UserInfoManager.getInstance().updateUserInformationBean_VerifyScore(compareScore);
|
|
|
|
+ sendPushFailed(4,livenessModel.getBdFaceImageInstance());
|
|
|
|
+ String failText = "比对失败";
|
|
|
|
+ doPersonCardResult_fail(failText, failText);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }, ConfigManager.getAuthenticationBeanListBean().getOneToOneContinueFailTime() * 1000);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void doPersonCardResult_Success(LivenessModel livenessModel) {
|
|
|
|
+
|
|
|
|
+ if(callback!=null){
|
|
|
|
+ callback.personCardinvokeStopVerify();
|
|
|
|
+ }
|
|
|
|
+ getmHandler().removeCallbacksAndMessages(null);
|
|
|
|
+ AuthenticationBean.DataDTO dataDTO= ConfigManager.getAuthenticationBean().getData().get(0);
|
|
|
|
+ RelaysAndLedUtile.getInstance().openDoor(dataDTO.getUseSerialPort(),dataDTO.getSignalNo());
|
|
|
|
+ ThreadPoolManager.getInstance().execute(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ String speak= ConfigManager.getAuthenticationBeanListBean().getSucVoice();
|
|
|
|
+ if(TextUtils.isEmpty(speak)){
|
|
|
|
+ speak ="请通行";
|
|
|
|
+ }
|
|
|
|
+ MTTSManager.getInstance().speak(speak);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ BDFaceImageInstance rgbImage = livenessModel.getBdFaceImageInstance();
|
|
|
|
+ if (rgbImage != null) {
|
|
|
|
+ final Bitmap bitmap = BitmapUtils.getInstaceBmp(rgbImage);
|
|
|
|
+ HttpRequest.getInstance().setEventRecords(TaskStatus.currentTask,
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getName(),
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getIdNumber(),
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getIdPhoto(), "",
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getMobile(), true,
|
|
|
|
+ 0,
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getCardIdEx(),
|
|
|
|
+ UserInfoManager.getInstance().getUserInformationBean().getUserId(),bitmap);
|
|
|
|
+ RequestOptions options = new RequestOptions().bitmapTransform(new RoundedCorners(30));
|
|
|
|
+ options.diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true);
|
|
|
|
+
|
|
|
|
+ String name = UserInfoManager.getInstance().getUserInformationBean().getName();
|
|
|
|
+ String idCard = UserInfoManager.getInstance().getUserInformationBean().getIdNumber();
|
|
|
|
+ String phone = UserInfoManager.getInstance().getUserInformationBean().getMobile();
|
|
|
|
+ //姓名脱敏
|
|
|
|
+ if (!StringUtils.isEmpty(name) && StringUtils.isString(ConfigManager.getAuthenticationBean().getData()
|
|
|
|
+ .get(0).getSucText(), "姓名")) {
|
|
|
|
+ name = StringUtils.getString(name);
|
|
|
|
+ name = StringUtils.chineseName(name);
|
|
|
|
+ }
|
|
|
|
+ //身份证脱敏
|
|
|
|
+ if (!StringUtils.isEmpty(idCard) && StringUtils.isString(ConfigManager.getAuthenticationBean().getData()
|
|
|
|
+ .get(0).getSucText(), "身份证号")) {
|
|
|
|
+ idCard = StringUtils.getString(idCard);
|
|
|
|
+ idCard = StringUtils.getDesensitization(idCard);
|
|
|
|
+ }
|
|
|
|
+ //手机号脱敏
|
|
|
|
+ if (!StringUtils.isEmpty(phone) && StringUtils.isString(ConfigManager.getAuthenticationBean().getData()
|
|
|
|
+ .get(0).getSucText(), "手机号")) {
|
|
|
|
+ phone = StringUtils.getString(phone);
|
|
|
|
+ phone = StringUtils.mobilePhone(phone);
|
|
|
|
+ }
|
|
|
|
+ if (StringIsNull.IsStringNull(name)) {
|
|
|
|
+ name = "";
|
|
|
|
+ }
|
|
|
|
+ if (StringIsNull.IsStringNull(idCard)) {
|
|
|
|
+ idCard = "";
|
|
|
|
+ }
|
|
|
|
+ if (StringIsNull.IsStringNull(phone)) {
|
|
|
|
+ phone = "";
|
|
|
|
+ }
|
|
|
|
+ if (!phone.contains("*")) {
|
|
|
|
+ phone = StringUtils.defaultDesensitization(phone);
|
|
|
|
+ }
|
|
|
|
+ if (!idCard.contains("*")) {
|
|
|
|
+ idCard = StringUtils.defaultDesensitization(idCard);
|
|
|
|
+ }
|
|
|
|
+ if (!name.contains("*")) {
|
|
|
|
+ name = StringUtils.defaultDesensitization(name);
|
|
|
|
+ }
|
|
|
|
+ final String finalName = name ;
|
|
|
|
+ final String finalidCard=idCard;
|
|
|
|
+ final String finalPhone=phone;
|
|
|
|
+ AppHandler.getHandler().post(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ setVisibility(View.VISIBLE);
|
|
|
|
+ fl_user_info.setVisibility(VISIBLE);
|
|
|
|
+ String sucText= ConfigManager.getAuthenticationBeanListBean().getSucText();
|
|
|
|
+ if(TextUtils.isEmpty(sucText)){
|
|
|
|
+ sucText="请通行";
|
|
|
|
+ }
|
|
|
|
+ ImageLoaderUtils.loadImage(bitmap,ivPhoto,options);
|
|
|
|
+
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.mainactivity_aicon,iv_through);
|
|
|
|
+ ImageLoaderUtils.loadRes(R.mipmap.blue_background_gradient,iv_top_bg);
|
|
|
|
+ ll_outcome_masked.setBackgroundResource(R.drawable.outcome_masked_blues);
|
|
|
|
+ tv_name.setText(finalName);
|
|
|
|
+ tv_card.setText(finalidCard);
|
|
|
|
+ tv_phone.setText(finalPhone);
|
|
|
|
+ tv_through.setText(sucText);
|
|
|
|
+ tv_through.setTextColor(ContextCompat.getColor(getContext(),R.color.f1677FF));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ int delay=dataDTO.getSuccessPageTime();
|
|
|
|
+ reset(delay);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ BaiduFaceResultCallback callback;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public void setBaiduFaceResultCallback(BaiduFaceResultCallback callback) {
|
|
|
|
+ this.callback = callback;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public interface BaiduFaceResultCallback {
|
|
|
|
+
|
|
|
|
+ void personCardinvokeStopVerify();
|
|
|
|
+ void invokeStopVerify();
|
|
|
|
+
|
|
|
|
+ void invokeResume();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|