BUG-OCR识别,性别、年龄、身份证号处理问题

This commit is contained in:
dxfeng 2024-05-29 15:07:39 +08:00
parent e055ca7b0d
commit 323bddbdad
2 changed files with 34 additions and 19 deletions

View File

@ -46,14 +46,14 @@ public class OcrResumePo {
private String sfz;
private String jlfj;
public String getXb() {
if ("".equals(xb)) {
return "0";
} else if ("".equals(xb)) {
return "1";
}
return null;
}
//public String getXb() {
// if ("".equals(xb)) {
// return "0";
// } else if ("".equals(xb)) {
// return "1";
// }
// return null;
//}
public Integer getNl() {
if (StringUtils.isNotBlank(nl)) {

View File

@ -8,11 +8,6 @@ import com.engine.core.impl.Service;
import com.engine.resumestorage.service.ResumeIdentifyService;
import com.engine.resumestorage.util.ParseResumeQliUtil;
import com.engine.resumestorage.util.Sql;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSetTrans;
import weaver.formmode.setup.ModeRightInfo;
@ -21,6 +16,8 @@ import weaver.general.Util;
import weaver.integration.logging.Logger;
import weaver.integration.logging.LoggerFactory;
import java.util.*;
public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentifyService {
private final Logger log = LoggerFactory.getLogger(ResumeIdentifyService.class);
BaseBean bb = new BaseBean();
@ -32,24 +29,25 @@ public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentify
this.sfsymr = this.bb.getPropValue("resume_qianliling", "sfsymr");
}
@Override
public int saveResumeByImageFileId(int imageFileId) throws Exception {
new HashMap();
String response = ParseResumeQliUtil.doParseHostPost(imageFileId);
this.log.info("千里聆接口返回值:" + response);
if (response.length() == 0) {
this.log.info("调用千里接口失败,返回值为空");
throw new Exception("调用千里接口失败,返回值为空");
this.log.info("调用千里接口失败,返回值为空");
throw new Exception("调用千里接口失败,返回值为空");
} else {
JSONObject all = JSONObject.parseObject(response);
if (!all.getBoolean("isSuccess")) {
this.log.info("调用千里接口失败,接口不通");
throw new Exception("调用千里接口失败,接口不通");
this.log.info("调用千里接口失败,接口不通");
throw new Exception("调用千里接口失败,接口不通");
} else {
JSONObject resultall = all.getJSONObject("data");
String status = resultall.getString("state");
if ("fail".equals(status)) {
this.log.info("调用千里接口失败,失败原因:" + resultall.getString("info"));
throw new Exception("调用千里接口失败,失败原因:" + resultall.getString("info"));
this.log.info("调用千里接口失败,失败原因:" + resultall.getString("info"));
throw new Exception("调用千里接口失败,失败原因:" + resultall.getString("info"));
} else {
JSONObject result = resultall.getJSONObject("result");
Map<String, String> saveResume = this.parseJsonToMap(result);
@ -59,6 +57,7 @@ public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentify
}
}
@Override
public int saveResumeInDB(Map<String, String> fields) throws Exception {
String tablename = "uf_jg_rmk";
if ("1".equals(this.sfsymr)) {
@ -108,6 +107,7 @@ public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentify
ModeRightInfo.editModeDataShare(1, Util.getIntValue(this.formmodeid_tmp), billId);
}
@Override
public Map<String, String> queryByDBId(String resumeid) throws Exception {
String tablename = "uf_jg_rmk";
if ("1".equals(this.sfsymr)) {
@ -118,6 +118,7 @@ public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentify
return Sql.querySingleRow(sql);
}
@Override
public boolean deleteById(String resumeid) throws Exception {
String tablename = "uf_jg_rmk";
if ("1".equals(this.sfsymr)) {
@ -156,6 +157,20 @@ public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentify
}
}
if (obj.containsKey("年龄")) {
v = this.bb.getPropValue("resume_qianliling", "nl");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "nl"), this.parseArray(obj.getJSONArray("年龄")));
}
}
if (obj.containsKey("身份证号")) {
v = this.bb.getPropValue("resume_qianliling", "sfz");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "sfz"), this.parseArray(obj.getJSONArray("身份证号")));
}
}
if (obj.containsKey("出生日期")) {
v = this.bb.getPropValue("resume_qianliling", "csrq");
if (v != null && v.length() > 0) {