|
@@ -333,12 +333,18 @@ public class PersonInfoApiController {
|
|
|
|
|
|
JSONObject wordsResult = jsonObject.getJSONObject("words_result");
|
|
JSONObject wordsResult = jsonObject.getJSONObject("words_result");
|
|
|
|
|
|
- dataMap.put("address", wordsResult.getJSONObject("住址").getString("words"));
|
|
|
|
- dataMap.put("idCard", wordsResult.getJSONObject("公民身份号码").getString("words"));
|
|
|
|
- dataMap.put("birthday",wordsResult.getJSONObject("出生").getString("words"));
|
|
|
|
- dataMap.put("name",wordsResult.getJSONObject("姓名").getString("words"));
|
|
|
|
- dataMap.put("sex",wordsResult.getJSONObject("性别").getString("words"));
|
|
|
|
- dataMap.put("nation",wordsResult.getJSONObject("民族").getString("words"));
|
|
|
|
|
|
+ try{
|
|
|
|
+ dataMap.put("address", wordsResult.getJSONObject("住址").getString("words"));
|
|
|
|
+ dataMap.put("idCard", wordsResult.getJSONObject("公民身份号码").getString("words"));
|
|
|
|
+ dataMap.put("birthday",wordsResult.getJSONObject("出生").getString("words"));
|
|
|
|
+ dataMap.put("name",wordsResult.getJSONObject("姓名").getString("words"));
|
|
|
|
+ dataMap.put("sex",wordsResult.getJSONObject("性别").getString("words"));
|
|
|
|
+ dataMap.put("nation",wordsResult.getJSONObject("民族").getString("words"));
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ throw new Exception("身份证识别错误");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
JSONObject jsonObject = BaiduOCR.householdRegister(accessToken, imageBase64Data);
|
|
JSONObject jsonObject = BaiduOCR.householdRegister(accessToken, imageBase64Data);
|
|
|
|
|
|
@@ -355,12 +361,17 @@ public class PersonInfoApiController {
|
|
|
|
|
|
JSONObject wordsResult = jsonObject.getJSONObject("words_result");
|
|
JSONObject wordsResult = jsonObject.getJSONObject("words_result");
|
|
|
|
|
|
- dataMap.put("address", wordsResult.getJSONObject("BirthAddress").getString("words"));
|
|
|
|
- dataMap.put("idCard", wordsResult.getJSONObject("CardNo").getString("words"));
|
|
|
|
- dataMap.put("birthday",wordsResult.getJSONObject("Birthday").getString("words"));
|
|
|
|
- dataMap.put("name",wordsResult.getJSONObject("Name").getString("words"));
|
|
|
|
- dataMap.put("sex",wordsResult.getJSONObject("Sex").getString("words"));
|
|
|
|
- dataMap.put("nation",wordsResult.getJSONObject("Nation").getString("words"));
|
|
|
|
|
|
+ try{
|
|
|
|
+ dataMap.put("address", wordsResult.getJSONObject("BirthAddress").getString("words"));
|
|
|
|
+ dataMap.put("idCard", wordsResult.getJSONObject("CardNo").getString("words"));
|
|
|
|
+ dataMap.put("birthday",wordsResult.getJSONObject("Birthday").getString("words"));
|
|
|
|
+ dataMap.put("name",wordsResult.getJSONObject("Name").getString("words"));
|
|
|
|
+ dataMap.put("sex",wordsResult.getJSONObject("Sex").getString("words"));
|
|
|
|
+ dataMap.put("nation",wordsResult.getJSONObject("Nation").getString("words"));
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ throw new Exception("户口本识别错误");
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
if (dataMap.get("birthday")!=null){
|
|
if (dataMap.get("birthday")!=null){
|