修改--身份证识别性别定义为字符串

This commit is contained in:
tjxt 2024-07-29 17:30:35 +08:00
parent 4bfe2c5a5e
commit c4a8463e58
3 changed files with 4 additions and 3 deletions

View File

@ -23,7 +23,7 @@ public class AiIdcardrecognizeResult {
private String name;
/** 用户性别,'0' 表示男性,'1' 表示女性 */
private char sex;
private String sex;
/** 用户民族 */
private String enthnic;

View File

@ -12,7 +12,7 @@ public class IdCardVo {
private String issuingAuthority;
private String validTime;
private String name;
private char gender;
private String gender;
private String ethnicity;
private String dateOfBirth;
private String address;

View File

@ -124,7 +124,8 @@ public class OcrRecogServiceImpl implements IOcrRecogService {
// 解析转义字符
json = StringEscapeUtils.unescapeJava(json);
Gson gson = new Gson();
return gson.fromJson(json, IdCardVo.class);
IdCardVo idCardVo = gson.fromJson(json, IdCardVo.class);//此方法 如果里面为空 错误 解决
return idCardVo;
}
private void saveRecognitionResult(IdCardVo idCardVo, char ifComplete, String frontFileName, String backFileName,long startTime) {
String idNumber = idCardVo.getData().getIdNumber();