From 323bddbdade5977e7e5e66399f54dc9291619df2 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Wed, 29 May 2024 15:07:39 +0800 Subject: [PATCH] =?UTF-8?q?BUG-OCR=E8=AF=86=E5=88=AB=EF=BC=8C=E6=80=A7?= =?UTF-8?q?=E5=88=AB=E3=80=81=E5=B9=B4=E9=BE=84=E3=80=81=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E5=8F=B7=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruit/entity/resume/OcrResumePo.java | 16 ++++---- .../impl/ResumeIdentifyServiceImpl.java | 37 +++++++++++++------ 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/com/engine/recruit/entity/resume/OcrResumePo.java b/src/com/engine/recruit/entity/resume/OcrResumePo.java index f1cbba6..7cb8e9c 100644 --- a/src/com/engine/recruit/entity/resume/OcrResumePo.java +++ b/src/com/engine/recruit/entity/resume/OcrResumePo.java @@ -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)) { diff --git a/src/com/engine/resumestorage/service/impl/ResumeIdentifyServiceImpl.java b/src/com/engine/resumestorage/service/impl/ResumeIdentifyServiceImpl.java index f7d7e01..b4db404 100644 --- a/src/com/engine/resumestorage/service/impl/ResumeIdentifyServiceImpl.java +++ b/src/com/engine/resumestorage/service/impl/ResumeIdentifyServiceImpl.java @@ -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 saveResume = this.parseJsonToMap(result); @@ -59,6 +57,7 @@ public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentify } } + @Override public int saveResumeInDB(Map 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 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) {