道路运输证ocr中交
This commit is contained in:
parent
5bc0a041de
commit
51075e72c8
@ -0,0 +1,177 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
/**
|
||||
* @ClassName OCRRoadBean
|
||||
* @Author john
|
||||
* @Date 2024/11/19 17:05
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OCRRoadBean {
|
||||
|
||||
|
||||
private int code;
|
||||
private DataDTO data;
|
||||
private String msg;
|
||||
private String remark;
|
||||
private int res;
|
||||
private boolean success;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataDTO getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataDTO data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public int getRes() {
|
||||
return res;
|
||||
}
|
||||
|
||||
public void setRes(int res) {
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public static class DataDTO {
|
||||
private String vehicleWeight;
|
||||
private String issuingAuthority;
|
||||
private String ownerName;
|
||||
private String businessCertificate;
|
||||
private String economicType;
|
||||
private String businessScope;
|
||||
private String vehicleNumber;
|
||||
private String licenseNumber;
|
||||
private String vehicleSize;
|
||||
private String ownerAddress;
|
||||
private String issueDate;
|
||||
private String vehicleType;
|
||||
|
||||
public String getVehicleWeight() {
|
||||
return vehicleWeight;
|
||||
}
|
||||
|
||||
public void setVehicleWeight(String vehicleWeight) {
|
||||
this.vehicleWeight = vehicleWeight;
|
||||
}
|
||||
|
||||
public String getIssuingAuthority() {
|
||||
return issuingAuthority;
|
||||
}
|
||||
|
||||
public void setIssuingAuthority(String issuingAuthority) {
|
||||
this.issuingAuthority = issuingAuthority;
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getBusinessCertificate() {
|
||||
return businessCertificate;
|
||||
}
|
||||
|
||||
public void setBusinessCertificate(String businessCertificate) {
|
||||
this.businessCertificate = businessCertificate;
|
||||
}
|
||||
|
||||
public String getEconomicType() {
|
||||
return economicType;
|
||||
}
|
||||
|
||||
public void setEconomicType(String economicType) {
|
||||
this.economicType = economicType;
|
||||
}
|
||||
|
||||
public String getBusinessScope() {
|
||||
return businessScope;
|
||||
}
|
||||
|
||||
public void setBusinessScope(String businessScope) {
|
||||
this.businessScope = businessScope;
|
||||
}
|
||||
|
||||
public String getVehicleNumber() {
|
||||
return vehicleNumber;
|
||||
}
|
||||
|
||||
public void setVehicleNumber(String vehicleNumber) {
|
||||
this.vehicleNumber = vehicleNumber;
|
||||
}
|
||||
|
||||
public String getLicenseNumber() {
|
||||
return licenseNumber;
|
||||
}
|
||||
|
||||
public void setLicenseNumber(String licenseNumber) {
|
||||
this.licenseNumber = licenseNumber;
|
||||
}
|
||||
|
||||
public String getVehicleSize() {
|
||||
return vehicleSize;
|
||||
}
|
||||
|
||||
public void setVehicleSize(String vehicleSize) {
|
||||
this.vehicleSize = vehicleSize;
|
||||
}
|
||||
|
||||
public String getOwnerAddress() {
|
||||
return ownerAddress;
|
||||
}
|
||||
|
||||
public void setOwnerAddress(String ownerAddress) {
|
||||
this.ownerAddress = ownerAddress;
|
||||
}
|
||||
|
||||
public String getIssueDate() {
|
||||
return issueDate;
|
||||
}
|
||||
|
||||
public void setIssueDate(String issueDate) {
|
||||
this.issueDate = issueDate;
|
||||
}
|
||||
|
||||
public String getVehicleType() {
|
||||
return vehicleType;
|
||||
}
|
||||
|
||||
public void setVehicleType(String vehicleType) {
|
||||
this.vehicleType = vehicleType;
|
||||
}
|
||||
}
|
||||
}
|
@ -1119,29 +1119,29 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
// map.put("licenseId", olb.getData().isCarExist() ? olb.getData().getExistCarInfo().getLicenseId() : oblb.getData().getLicenseId());
|
||||
map.put("carNum", str1);
|
||||
map.put("type", str2);
|
||||
map.put("owner", str3);
|
||||
map.put("vehicleNumber", str4);//车辆识别代号
|
||||
map.put("carType", str2);
|
||||
map.put("carOwner", str3);
|
||||
// map.put("vehicleNumber", str4);//车辆识别代号
|
||||
|
||||
|
||||
map.put("registerDate", olb.getData().getRegTime());//注册日期
|
||||
map.put("dateIssue", olb.getData().getLicensedateOfissue());//发证日期
|
||||
map.put("nature", olb.getData().getNatureOfUsage());//使用性质
|
||||
map.put("model", olb.getData().getVclBrand());//品牌型号
|
||||
map.put("organizationName", olb.getData().getIssuingAuthority());//发证机关
|
||||
map.put("engineNumber", olb.getData().getEngine());//发动机号
|
||||
map.put("drivingLicenseRegisterDate", olb.getData().getRegTime());//注册日期
|
||||
map.put("drivingLicenseIssueDate", olb.getData().getLicensedateOfissue());//发证日期
|
||||
map.put("carUseCharacter", olb.getData().getNatureOfUsage());//使用性质
|
||||
// map.put("model", olb.getData().getVclBrand());//品牌型号
|
||||
map.put("carIssuingOrg", olb.getData().getIssuingAuthority());//发证机关
|
||||
map.put("engineNo", olb.getData().getEngine());//发动机号
|
||||
|
||||
|
||||
map.put("frontImage", url1);
|
||||
map.put("backImage", url2);
|
||||
map.put("size", oblb.getData().getOverallDimen());//车辆尺寸
|
||||
map.put("allCapacity", oblb.getData().getEnTn());//整备质量
|
||||
map.put("approvedCapacity", oblb.getData().getLoadTon());//核定载质量
|
||||
map.put("allAuality", oblb.getData().getApproveTon());//总质量
|
||||
map.put("drivingLicensePhoto", url1);
|
||||
map.put("drivingLicenseBackPhoto", url2);
|
||||
map.put("outsideSizeName", oblb.getData().getOverallDimen());//车辆尺寸
|
||||
// map.put("allCapacity", oblb.getData().getEnTn());//整备质量
|
||||
map.put("approvedLoad", oblb.getData().getLoadTon());//核定载质量
|
||||
map.put("totalWeight", oblb.getData().getApproveTon());//总质量
|
||||
|
||||
map.put("personCapacity", oblb.getData().getPassengers());//核定载人数
|
||||
map.put("fileNumber", oblb.getData().getRecordId());//档案编号
|
||||
map.put("towAuality", oblb.getData().getVclDrwTn());//准牵引总质量
|
||||
// map.put("personCapacity", oblb.getData().getPassengers());//核定载人数
|
||||
// map.put("fileNumber", oblb.getData().getRecordId());//档案编号
|
||||
// map.put("towAuality", oblb.getData().getVclDrwTn());//准牵引总质量
|
||||
// if (olb.getData().isCarExist()) {
|
||||
// map.put("carId", olb.getData().getCarId());
|
||||
// }
|
||||
|
@ -21,6 +21,7 @@ import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarDelBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.IsAuthDriverAuthQualificationBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.OCRBankBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.OCRRoadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
@ -35,6 +36,7 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dahe.mylibrary.utils.PatternUtils;
|
||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
||||
import com.google.gson.Gson;
|
||||
@ -108,14 +110,13 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("ORCRoadLicZj") != null) {
|
||||
OCRBankBean ib = new Gson().fromJson(CacheGroup.cacheList.get("ORCRoadLicZj"), OCRBankBean.class);
|
||||
OCRRoadBean ib = new Gson().fromJson(CacheGroup.cacheList.get("ORCRoadLicZj"), OCRRoadBean.class);
|
||||
customDialog.dismiss();
|
||||
// if (ib.getCode() == 200&&ib.getData()!=null) {
|
||||
// initView(null);
|
||||
// WalletFragment.isInsBank = true;
|
||||
// } else {
|
||||
// Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
if (ib.getCode() == 200 && ib.getData() != null) {
|
||||
value1.setText(PatternUtils.getNumByStr(ib.getData().getLicenseNumber()));
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove("ORCRoadLicZj");
|
||||
}
|
||||
|
||||
@ -135,22 +136,27 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
case 3:
|
||||
//道路运输证ocr识别
|
||||
new OCRRequest().ORCRoadLicZj(con, hd, ub.getData().getUrl());
|
||||
// new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 2);
|
||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 2);
|
||||
break;
|
||||
case 4:
|
||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 7);
|
||||
break;
|
||||
default:
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
break;
|
||||
}
|
||||
url = ub.getData().getUrl();
|
||||
// Glide.with(con).load(url).into(img);
|
||||
Glide.with(con).load(path).into(img);
|
||||
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
|
||||
CacheGroup.cacheList.remove("upload");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("saveCarImg") != null) {
|
||||
if (customDialog != null && customDialog.isShowing())
|
||||
customDialog.dismiss();
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("saveCarImg"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
switch (type) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.dahe.mylibrary.utils;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class PatternUtils {
|
||||
@ -25,4 +26,13 @@ public class PatternUtils {
|
||||
public static boolean isLetter(String password){
|
||||
return Pattern.matches(REGEX_WORD, password);
|
||||
}
|
||||
|
||||
public static String getNumByStr(String str){
|
||||
Pattern compile = Pattern.compile("\\d+");
|
||||
Matcher matcher = compile.matcher(str);
|
||||
while (matcher.find()) {
|
||||
return matcher.group();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user