驾驶证ocr上传
This commit is contained in:
parent
97e0c5f629
commit
8bbae1cf92
@ -99,7 +99,7 @@ public class H5Activity extends AppCompatActivity {
|
||||
|
||||
back.setOnClickListener(v -> {
|
||||
if (isOk){
|
||||
finish();
|
||||
ActivityUtils.finishToActivity(MainActivity.class,false);
|
||||
return;
|
||||
}
|
||||
if (mWebView.canGoBack()) {
|
||||
@ -111,7 +111,7 @@ public class H5Activity extends AppCompatActivity {
|
||||
|
||||
close.setOnClickListener(v -> {
|
||||
if (isOk){
|
||||
finish();
|
||||
ActivityUtils.finishToActivity(MainActivity.class,false);
|
||||
return;
|
||||
}
|
||||
if (mWebView.canGoBack()) {
|
||||
|
@ -58,6 +58,42 @@ public class OCRDrivingLicenseBackBean {
|
||||
private int id;
|
||||
private String url;
|
||||
private String archivesName;
|
||||
private String fileNumber;
|
||||
private String record;
|
||||
private String name;
|
||||
private String issuingAuthority;
|
||||
|
||||
public String getFileNumber() {
|
||||
return fileNumber;
|
||||
}
|
||||
|
||||
public void setFileNumber(String fileNumber) {
|
||||
this.fileNumber = fileNumber;
|
||||
}
|
||||
|
||||
public String getRecord() {
|
||||
return record;
|
||||
}
|
||||
|
||||
public void setRecord(String record) {
|
||||
this.record = record;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
|
@ -16,8 +16,105 @@ public class LicenseInputBean {
|
||||
private int driverLicensePhoto;
|
||||
private String endTime;
|
||||
private String firstTime;
|
||||
private String address;
|
||||
private String quasiDriveType;
|
||||
private String beginDate;
|
||||
private String endDate;
|
||||
private String fileNumber;
|
||||
private String issuingAuthority;
|
||||
private String sex;
|
||||
private String name;
|
||||
private String idcard;
|
||||
private String organizationName;
|
||||
private String startTime;
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getOrganizationName() {
|
||||
return organizationName;
|
||||
}
|
||||
|
||||
public void setOrganizationName(String organizationName) {
|
||||
this.organizationName = organizationName;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getQuasiDriveType() {
|
||||
return quasiDriveType;
|
||||
}
|
||||
|
||||
public void setQuasiDriveType(String quasiDriveType) {
|
||||
this.quasiDriveType = quasiDriveType;
|
||||
}
|
||||
|
||||
public String getBeginDate() {
|
||||
return beginDate;
|
||||
}
|
||||
|
||||
public void setBeginDate(String beginDate) {
|
||||
this.beginDate = beginDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getFileNumber() {
|
||||
return fileNumber;
|
||||
}
|
||||
|
||||
public void setFileNumber(String fileNumber) {
|
||||
this.fileNumber = fileNumber;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIdcard() {
|
||||
return idcard;
|
||||
}
|
||||
|
||||
public void setIdcard(String idcard) {
|
||||
this.idcard = idcard;
|
||||
}
|
||||
|
||||
public String getAllowType() {
|
||||
return allowType;
|
||||
|
@ -112,7 +112,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
private String[] names_img3 = {"", "", "行驶证副页背面照片", "挂车行驶证副页背面照片"};
|
||||
private String[][] name = {
|
||||
{"姓名", "身份证号", "地址", "有效期至"},
|
||||
{"档案编号", "初次领证日期", "准驾车型", "有效期限(止)"},
|
||||
{"驾驶证号", "初次领证日期", "准驾车型", "有效期限(止)"},
|
||||
{"车牌号码", "车辆类型", "所有人", "车辆识别代码"},
|
||||
{"车牌号码", "车辆类型", "所有人", "车辆识别代码"}
|
||||
};
|
||||
@ -961,7 +961,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (odlb.getCode() == 200 && odlb.getData() != null) {
|
||||
Glide.with(con).load(path).into(img2);
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
// subimt();
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -974,6 +974,15 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[2]) != null) {
|
||||
Log.e("olb", CacheGroup.cacheList.get(TYPE_NAME[2]));
|
||||
olb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[2]), OCRVehicleLicenseBean.class);
|
||||
if (2==index&&olb.getData().getVclN().contains("挂")){
|
||||
Toast.makeText(con,"该证件为挂车,请上传行驶证证件",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (3==index&&!olb.getData().getVclN().contains("挂")){
|
||||
Toast.makeText(con,"未识别到挂车相关信息,请上传挂车行驶证证件",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (olb.getCode() == 200 && olb.getData() != null) {
|
||||
carExistCarId = "";
|
||||
value1.setEnabled(true);
|
||||
@ -1136,14 +1145,20 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
customDialog.show();
|
||||
Log.e("ocr", new Gson().toJson(odl));
|
||||
LicenseInputBean iib = new LicenseInputBean();
|
||||
iib.setArchivesName(str1);
|
||||
iib.setArchivesName(odlb.getData().getFileNumber());
|
||||
iib.setDriverLicenseName(value7.getText().toString());
|
||||
iib.setAllowType(str3);
|
||||
iib.setDriverLicense(odl.getData().getIdcard());
|
||||
iib.setDriverLicense(str1);
|
||||
iib.setDriverLicenseBackPhoto(backId);
|
||||
iib.setDriverLicensePhoto(fontId);
|
||||
iib.setEndTime("长期".equals(odl.getData().getEndDate()) ? "2999-12-31" : odl.getData().getEndDate());
|
||||
iib.setFirstTime(odl.getData().getFirstGetDocDate());
|
||||
|
||||
|
||||
// iib.setName(odl.getData().getName());
|
||||
iib.setOrganizationName(odl.getData().getIssuingAuthority());
|
||||
iib.setAddress(odl.getData().getAddress());
|
||||
iib.setStartTime(odl.getData().getBeginDate());
|
||||
new AuthRequest().driverAuthLicense(con, hd, iib);
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传资料", Toast.LENGTH_SHORT).show();
|
||||
|
@ -97,6 +97,7 @@ class MessageUtils {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.dismissOnTouchOutside(false)
|
||||
.asCustom(SimCenterPop(ctx, message,left,right).setOnMyItemClickListener(onMyItemClickListener))
|
||||
.show()
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util.img;
|
||||
|
||||
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.provider.Settings;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
@ -10,6 +15,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
@ -45,25 +51,37 @@ public class GetImageAlert {
|
||||
|
||||
btn_xiangce.setOnClickListener(v -> {
|
||||
PermissionX.init(act)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
PicturlUtil.selectPicter(act, new ArrayList<>(), 1);
|
||||
} else {
|
||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
act.startActivity(intent);
|
||||
});
|
||||
// Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
});
|
||||
btn_paizhao.setOnClickListener(v -> {
|
||||
|
||||
PermissionX.init(act)
|
||||
.permissions(Manifest.permission.CAMERA)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
file = ImageGetUtil.createImageFile(act);
|
||||
ImageGetUtil.cameraAlbumGetImage(act, file);
|
||||
} else {
|
||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
act.startActivity(intent);
|
||||
});
|
||||
// Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user