|
@@ -1,6 +1,5 @@
|
|
|
package com.sunwin.visitorapp.activity;
|
|
|
|
|
|
-import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
|
import android.text.TextUtils;
|
|
@@ -8,11 +7,8 @@ import android.view.View;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
-import androidx.appcompat.app.AlertDialog;
|
|
|
-
|
|
|
import com.sunwin.visitorapp.BaseActivity;
|
|
|
import com.sunwin.visitorapp.BaseApplication;
|
|
|
-import com.sunwin.visitorapp.LoginActivity;
|
|
|
import com.sunwin.visitorapp.R;
|
|
|
import com.sunwin.visitorapp.db.DatabaseManager;
|
|
|
import com.sunwin.visitorapp.db.UserInfoModel;
|
|
@@ -30,7 +26,6 @@ import com.sunwin.visitorapp.utils.BitmapUtils;
|
|
|
import com.sunwin.visitorapp.utils.Constant;
|
|
|
import com.sunwin.visitorapp.utils.FileUtil;
|
|
|
import com.sunwin.visitorapp.utils.LogUtil;
|
|
|
-import com.sunwin.visitorapp.utils.SharePrefenceUtils;
|
|
|
import com.sunwin.visitorapp.utils.TimeUtils;
|
|
|
import com.sunwin.visitorapp.utils.ToastUtils;
|
|
|
import com.sunwin.visitorapp.view.FaceDetecterView;
|
|
@@ -98,8 +93,9 @@ public class VisitSignActivity extends BaseActivity implements IdCardReadCallbac
|
|
|
* 读取身份证回调
|
|
|
*/
|
|
|
@Override
|
|
|
- public void onIdNumRead(String idNum) {
|
|
|
+ public void onIdNumRead(String idNum, String idCardPath) {
|
|
|
LogUtil.e(TAG, "idNum = " + idNum);
|
|
|
+ this.idCardPath = idCardPath;
|
|
|
updataUserInfoByIdNum(idNum, 5);
|
|
|
}
|
|
|
|
|
@@ -129,6 +125,10 @@ public class VisitSignActivity extends BaseActivity implements IdCardReadCallbac
|
|
|
requsetModel.setImgCode(BitmapUtils.scaleBitmap(currentFace));
|
|
|
requsetModel.setImgUrl(currentFace);
|
|
|
requsetModel.setThreshold(similarity + "");
|
|
|
+ } else {
|
|
|
+ requsetModel.setImgCode(BitmapUtils.scaleBitmap(idCardPath));
|
|
|
+ requsetModel.setImgUrl(idCardPath);
|
|
|
+ requsetModel.setThreshold(similarity + "");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -150,7 +150,11 @@ public class VisitSignActivity extends BaseActivity implements IdCardReadCallbac
|
|
|
//删除图片
|
|
|
if (!TextUtils.isEmpty(currentFace)) {
|
|
|
boolean b = FileUtil.deleteFile(currentFace);
|
|
|
- LogUtil.e(TAG, "delete File=" + b);
|
|
|
+ LogUtil.e(TAG, "delete currentFace=" + b);
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(idCardPath)) {
|
|
|
+ boolean b = FileUtil.deleteFile(idCardPath);
|
|
|
+ LogUtil.e(TAG, "delete idCardPath=" + b);
|
|
|
}
|
|
|
ToastUtils.showToast("保存成功");
|
|
|
} else {
|
|
@@ -188,6 +192,7 @@ public class VisitSignActivity extends BaseActivity implements IdCardReadCallbac
|
|
|
}
|
|
|
|
|
|
private String currentFace;
|
|
|
+ private String idCardPath;
|
|
|
private double similarity;
|
|
|
|
|
|
@Override
|
|
@@ -197,7 +202,7 @@ public class VisitSignActivity extends BaseActivity implements IdCardReadCallbac
|
|
|
String idNum = openDoorByFaceNetResultInfo.getIdNum();
|
|
|
currentFace = openDoorByFaceNetResultInfo.getCurrentFace();
|
|
|
similarity = openDoorByFaceNetResultInfo.getSimilarity();
|
|
|
- similarity = AppUtil.retains3decimal(similarity);
|
|
|
+ similarity = AppUtil.retains3decimal(similarity);
|
|
|
updataUserInfoByIdNum(idNum, 1);
|
|
|
}
|
|
|
|