Merge remote-tracking branch 'origin/master'

This commit is contained in:
jiangtd 2026-05-19 15:00:11 +08:00
commit 12ba7d8ff4
4 changed files with 29 additions and 4 deletions

View File

@ -27,7 +27,6 @@ import java.util.Map;
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/driving/license") @RequestMapping("/driving/license")
@NotIntercept
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public class RecognizeDrivingLicenseController extends BaseController { public class RecognizeDrivingLicenseController extends BaseController {
@ -44,7 +43,7 @@ public class RecognizeDrivingLicenseController extends BaseController {
} }
Map<String, Object> data = requestBaidu(getContent(bVehicleLicenseRequest)); Map<String, Object> data = requestBaidu(getContent(bVehicleLicenseRequest));
if (data == null) { if (data == null) {
return R.error("识别失败"); return R.error("行驶证识别失败");
} }
R<Object> result = R.ok(); R<Object> result = R.ok();
@ -72,7 +71,7 @@ public class RecognizeDrivingLicenseController extends BaseController {
return "detectDirection 必须传 " + ApiConstants.trueOrFalse + ",false不进行图像方向自动矫正, true: 开启图像方向自动矫正功能,可对旋转 90/180/270 度的图片进行自动矫正并识别"; return "detectDirection 必须传 " + ApiConstants.trueOrFalse + ",false不进行图像方向自动矫正, true: 开启图像方向自动矫正功能,可对旋转 90/180/270 度的图片进行自动矫正并识别";
} }
if (checkNotFrontBack(request.getVehicleLicenseSide())) { if (checkNotFrontBack(request.getVehicleLicenseSide())) {
return "vehicleLicenseSide 必须传 " + ApiConstants.frontOrback + ",front正向 back反面"; return "front 必须传 " + ApiConstants.frontOrback + ",front正向 back反面";
} }
if (checkNotTrueFalse(request.getUnified())) { if (checkNotTrueFalse(request.getUnified())) {
return "unified必须为 " + ApiConstants.trueOrFalse + ", false 不进行归一化处理, rue对输出字段进行归一化处理将新/老版行驶证的“注册登记日期/注册日期”统一为”注册日期“进行输出"; return "unified必须为 " + ApiConstants.trueOrFalse + ", false 不进行归一化处理, rue对输出字段进行归一化处理将新/老版行驶证的“注册登记日期/注册日期”统一为”注册日期“进行输出";
@ -137,6 +136,7 @@ public class RecognizeDrivingLicenseController extends BaseController {
private RecognizeDrivingLicenseFaceResp toFaceResp(Map<String, Object> data) { private RecognizeDrivingLicenseFaceResp toFaceResp(Map<String, Object> data) {
RecognizeDrivingLicenseFaceResp faceResp = new RecognizeDrivingLicenseFaceResp(); RecognizeDrivingLicenseFaceResp faceResp = new RecognizeDrivingLicenseFaceResp();
faceResp.setIssueDate(MapUtils.getByExpr(data, "words_result.发证日期.words")); faceResp.setIssueDate(MapUtils.getByExpr(data, "words_result.发证日期.words"));
faceResp.setIssueAuthority(MapUtils.getByExpr(data, "words_result.发证单位.words"));
faceResp.setModel(MapUtils.getByExpr(data, "words_result.品牌型号.words")); faceResp.setModel(MapUtils.getByExpr(data, "words_result.品牌型号.words"));
faceResp.setVehicleType(MapUtils.getByExpr(data, "words_result.车辆类型.words")); faceResp.setVehicleType(MapUtils.getByExpr(data, "words_result.车辆类型.words"));
faceResp.setOwner(MapUtils.getByExpr(data, "words_result.所有人.words")); faceResp.setOwner(MapUtils.getByExpr(data, "words_result.所有人.words"));
@ -161,6 +161,8 @@ public class RecognizeDrivingLicenseController extends BaseController {
backResp.setApprovedPassengerCapacity(MapUtils.getByExpr(data, "words_result.核定载人数.words")); backResp.setApprovedPassengerCapacity(MapUtils.getByExpr(data, "words_result.核定载人数.words"));
backResp.setEnergyType(MapUtils.getByExpr(data, "words_result.燃油类型.words")); backResp.setEnergyType(MapUtils.getByExpr(data, "words_result.燃油类型.words"));
backResp.setApprovedLoad(MapUtils.getByExpr(data, "words_result.核定载质量.words")); backResp.setApprovedLoad(MapUtils.getByExpr(data, "words_result.核定载质量.words"));
backResp.setRemark(MapUtils.getByExpr(data, "words_result.备注.words"));
backResp.setCertificateNumber(MapUtils.getByExpr(data, "words_result.证芯编号.words"));
return backResp; return backResp;
} }

View File

@ -36,7 +36,7 @@ public class VehicleLicenseRequest {
* - front默认值识别行驶证主页 * - front默认值识别行驶证主页
* - back识别行驶证副页 * - back识别行驶证副页
*/ */
private String side; private String side = "front";

View File

@ -97,6 +97,22 @@ public class RecognizeDrivingLicenseBackResp extends BaseResp {
*/ */
private String approvedLoad; private String approvedLoad;
/**
* 备注
*
* 示例值:
* 2033-10-25
*/
private String remark;
/**
* 证芯编号
*
* 示例值:
* 50027372380230106
*/
private String certificateNumber;
} }

View File

@ -35,6 +35,13 @@ public class RecognizeDrivingLicenseFaceResp extends BaseResp {
*/ */
public String issueDate; public String issueDate;
/**
* 发证单位
*
* 示例值:
* 北京市公安局公安交通管理局
*/
public String issueAuthority;
/*** /***
* 品牌型号 * 品牌型号