generated from dxfeng/secondev-chapanda-feishu
ADD-简历解析,头像识别
This commit is contained in:
parent
4b6213130d
commit
298d22847b
|
|
@ -28,6 +28,7 @@ import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
|||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.security.MessageDigest;
|
||||
|
|
@ -154,12 +155,14 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
JSONObject result = resultall.getJSONObject("result");
|
||||
Map<String, Object> dataMap = parseQllJsonToMapV2(result, isCard);
|
||||
// 解析图片信息
|
||||
String faceId = resultall.getString("face_id");
|
||||
if (StringUtils.isNotBlank(faceId)) {
|
||||
String face_base64 = resultall.getString("face_base64");
|
||||
if (StringUtils.isNotBlank(face_base64)) {
|
||||
try {
|
||||
String faceUrl = RecruitConstant.OCR_URL.replace("/resume", "/common/get_image") + "?filename=" + faceId;
|
||||
// 请求接口
|
||||
getImageFile(faceUrl, faceId, dataMap);
|
||||
byte[] decodedBytes = Base64.getDecoder().decode(face_base64);
|
||||
InputStream inputStream = new ByteArrayInputStream(decodedBytes);
|
||||
int imageFileId = RecruitModeUtil.generateImageFileId(inputStream, dataMap.get("xm") + "-" + UUID.randomUUID() + ".png");
|
||||
int docId = RecruitModeUtil.createDocId(Convert.toInt(RecruitConstant.APPLICANTS_RESUMES_CATEGORY), imageFileId, user);
|
||||
dataMap.put("jlzp", docId);
|
||||
} catch (Exception e) {
|
||||
baseBean.writeLog("千里聆OCR简历照片解析失败:" + e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue