generated from dxfeng/secondev-chapanda-feishu
OCR SDK 数据创建人取值处理
This commit is contained in:
parent
1c5a4f7f2b
commit
f05f66bfad
|
|
@ -95,8 +95,8 @@ public class CheckRepeatResume {
|
|||
* @param param 数据集合
|
||||
* @return 新插入简历的ID
|
||||
*/
|
||||
public int insertResumeMainTable(Map<String, Object> param) {
|
||||
Map<String, Object> map = insertResumeAndReturn(param);
|
||||
public int insertResumeMainTable(int creator, Map<String, Object> param) {
|
||||
Map<String, Object> map = insertResumeAndReturn(creator, param);
|
||||
return Util.getIntValue(Util.null2String(map.get("mainId")));
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ public class CheckRepeatResume {
|
|||
* @param param 数据集合
|
||||
* @return 简历插入信息
|
||||
*/
|
||||
public synchronized Map<String, Object> insertResumeAndReturn(Map<String, Object> param) {
|
||||
public synchronized Map<String, Object> insertResumeAndReturn(int creator, Map<String, Object> param) {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
int mainId = -1;
|
||||
String sourceId;
|
||||
|
|
@ -163,7 +163,7 @@ public class CheckRepeatResume {
|
|||
List<Map<String, Object>> repeatResumeList = getRepeatResumeList(name, mobile);
|
||||
if (CollectionUtils.isEmpty(repeatResumeList)) {
|
||||
// 不存在重复数据,直接插入数据库
|
||||
mainId = insertData(param);
|
||||
mainId = insertData(creator, param);
|
||||
returnMap.put("mainId", mainId);
|
||||
return returnMap;
|
||||
}
|
||||
|
|
@ -175,14 +175,14 @@ public class CheckRepeatResume {
|
|||
// 当前存在待分配的简历
|
||||
sourceId = Util.null2String(sourceResume.get("id"));
|
||||
//取新简历有值的字段,更新已入库简历没有值的字段,已入库简历有值的字段不做更新,新简历入库并隐藏
|
||||
mainId = updateSourceResume(param, sourceResume);
|
||||
mainId = updateSourceResume(creator, param, sourceResume);
|
||||
returnMap.put("mainId", mainId);
|
||||
returnMap.put("sourceId", sourceId);
|
||||
returnMap.put("isUpdate", true);
|
||||
return returnMap;
|
||||
} else {
|
||||
// 直接入库,不做任何处理
|
||||
mainId = insertData(param);
|
||||
mainId = insertData(creator, param);
|
||||
returnMap.put("mainId", mainId);
|
||||
return returnMap;
|
||||
}
|
||||
|
|
@ -196,12 +196,12 @@ public class CheckRepeatResume {
|
|||
}
|
||||
if (hasSamePosition) {
|
||||
// 若有相同职位的数据,新简历直接入库并隐藏
|
||||
mainId = insertHideData(param);
|
||||
mainId = insertHideData(creator, param);
|
||||
returnMap.put("mainId", mainId);
|
||||
return returnMap;
|
||||
} else {
|
||||
// 没有相同职位的数据,新简历直接入库,不做任何处理
|
||||
mainId = insertData(param);
|
||||
mainId = insertData(creator, param);
|
||||
returnMap.put("mainId", mainId);
|
||||
return returnMap;
|
||||
}
|
||||
|
|
@ -216,14 +216,14 @@ public class CheckRepeatResume {
|
|||
* @param dataMap 数据集合
|
||||
* @return
|
||||
*/
|
||||
private int insertData(Map<String, Object> dataMap) {
|
||||
private int insertData(int creator, Map<String, Object> dataMap) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
dataMap.put("modeuuid", uuid);
|
||||
int formModeId = ApplicantCommonInfo.getModeIdByTableName("uf_jcl_yppc");
|
||||
dataMap.put("formmodeid", formModeId);
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, 1);
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, creator);
|
||||
RecruitRecordSet.insertData(dataMap, "uf_jcl_yppc");
|
||||
return RecruitRecordSet.refreshRight(uuid, "uf_jcl_yppc", formModeId, 1);
|
||||
return RecruitRecordSet.refreshRight(uuid, "uf_jcl_yppc", formModeId, creator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -232,11 +232,11 @@ public class CheckRepeatResume {
|
|||
* @param dataMap 数据集合
|
||||
* @return
|
||||
*/
|
||||
private int insertHideData(Map<String, Object> dataMap) {
|
||||
private int insertHideData(int creator, Map<String, Object> dataMap) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
dataMap.put("modeuuid", uuid);
|
||||
RecordSet rs = new RecordSet();
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, 1);
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, creator);
|
||||
RecruitRecordSet.insertData(dataMap, "uf_jcl_yppc");
|
||||
rs.executeQuery("select id from uf_jcl_yppc where modeuuid='" + uuid + "'");
|
||||
if (rs.next()) {
|
||||
|
|
@ -252,16 +252,16 @@ public class CheckRepeatResume {
|
|||
* @param sourceResume 源简历数据集合
|
||||
* @return
|
||||
*/
|
||||
private int updateSourceResume(Map<String, Object> param, Map<String, Object> sourceResume) {
|
||||
private int updateSourceResume(int creator, Map<String, Object> param, Map<String, Object> sourceResume) {
|
||||
replaceNullValues(param, sourceResume);
|
||||
// 更新投递时间为最新的 by zsy 20240704 待分配的投递时间要根据最新的去更新
|
||||
sourceResume.put("tdsj", DateUtil.getDateTime());
|
||||
// 处理操作人员、操作时间
|
||||
RecruitRecordSet.buildModeUpdateFields(sourceResume, 1);
|
||||
RecruitRecordSet.buildModeUpdateFields(sourceResume, creator);
|
||||
RecruitRecordSet.updateDataById(sourceResume, "uf_jcl_yppc");
|
||||
// 更新数据
|
||||
RecruitRecordSet.buildModeInsertFields(param, 1);
|
||||
return insertHideData(param);
|
||||
RecruitRecordSet.buildModeInsertFields(param, creator);
|
||||
return insertHideData(creator, param);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ public class QllResumePo {
|
|||
private String lyqd;
|
||||
private String gjrsjh;
|
||||
|
||||
private int userId;
|
||||
|
||||
|
||||
/**
|
||||
* 解析JSON数组,下载文件并入库
|
||||
|
|
@ -82,7 +84,7 @@ public class QllResumePo {
|
|||
if (StringUtils.isNotBlank(disposition)) {
|
||||
InputStream inputStream = response.bodyStream();
|
||||
int imageFileId = RecruitModeUtil.generateImageFileId(inputStream, name);
|
||||
int docId = RecruitModeUtil.createDocId(Convert.toInt(RecruitConstant.APPLICANTS_RESUMES_CATEGORY), imageFileId, new User(1));
|
||||
int docId = RecruitModeUtil.createDocId(Convert.toInt(RecruitConstant.APPLICANTS_RESUMES_CATEGORY), imageFileId, new User(userId));
|
||||
resumeId = String.valueOf(docId);
|
||||
} else {
|
||||
baseBean.writeLog("千里聆附件下载失败" + response.body());
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
|
||||
// 判断简历信息
|
||||
CheckRepeatResume instance = CheckRepeatResume.getInstance();
|
||||
Map<String, Object> map = instance.insertResumeAndReturn(resumeData);
|
||||
Map<String, Object> map = instance.insertResumeAndReturn(user.getUID(), resumeData);
|
||||
String mainId = Util.null2String(map.get("mainId"));
|
||||
String sourceId = Util.null2String(map.get("sourceId"));
|
||||
returnMap.put("mainId", mainId);
|
||||
|
|
@ -148,14 +148,13 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
if ("fail".equals(status)) {
|
||||
throw new CustomizeRunTimeException("调用千里聆接口失败,失败原因:" + resultall.getString("info"));
|
||||
}
|
||||
baseBean.writeLog("千里聆OCR解析数据:" + resultall);
|
||||
JSONObject result = resultall.getJSONObject("result");
|
||||
baseBean.writeLog("千里聆OCR解析数据:" + result);
|
||||
Map<String, Object> dataMap = parseQllJsonToMapV2(result, isCard);
|
||||
returnMap.put("data", dataMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 千里聆解析字段内容处理(V2)
|
||||
*
|
||||
|
|
@ -178,7 +177,7 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
dataMap.put("sjhm", sjhm);
|
||||
// 年龄
|
||||
String nl = personalInformation.getString("年龄");
|
||||
if(StringUtils.isNotBlank(nl)) {
|
||||
if (StringUtils.isNotBlank(nl) && !"0".equals(nl)) {
|
||||
dataMap.put("nl", nl);
|
||||
}
|
||||
// 出生日期
|
||||
|
|
@ -188,9 +187,9 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
String xb = personalInformation.getString("性别");
|
||||
if ("女".equals(xb)) {
|
||||
dataMap.put("xb", 1);
|
||||
} else if("男".equals(xb)){
|
||||
} else if ("男".equals(xb)) {
|
||||
dataMap.put("xb", 0);
|
||||
}else{
|
||||
} else {
|
||||
dataMap.put("xb", null);
|
||||
}
|
||||
// 体重(KG)
|
||||
|
|
@ -210,9 +209,6 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
dataMap.put("hyzk", hyzk.stream().map(item -> item.get("id")).collect(Collectors.joining(",")));
|
||||
}
|
||||
}
|
||||
// 当前所在地(字段类型不支持)
|
||||
String jdz = personalInformation.getString("现居住地");
|
||||
//dataMap.put("jzd", parseArray(obj.getJSONArray("现居住地")));
|
||||
// 政治面貌
|
||||
List<Map<String, String>> zzmm = getBrowserArray(personalInformation.getString("政治面貌"), ModeBrowserCommonInfo.TYPE_POLITICAL_LANDSCAPE);
|
||||
if (CollectionUtils.isNotEmpty(zzmm)) {
|
||||
|
|
@ -232,7 +228,7 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
|
||||
// 工作经验
|
||||
String gzjyStr = personalInformation.getString("工作经验");
|
||||
if(StringUtils.isNotBlank(gzjyStr)) {
|
||||
if (StringUtils.isNotBlank(gzjyStr)) {
|
||||
if (gzjyStr.contains("到")) {
|
||||
String[] split = gzjyStr.split("到");
|
||||
if (split.length == 2) {
|
||||
|
|
@ -337,8 +333,8 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
String startDate = getFormatDate(o.getString("开始时间"));
|
||||
String endDate = getFormatDate(o.getString("结束时间"));
|
||||
RecruitDataMap<Object> projectMap = new RecruitDataMap<>();
|
||||
projectMap.put("kssj",startDate);
|
||||
projectMap.put("jssj",endDate);
|
||||
projectMap.put("kssj", startDate);
|
||||
projectMap.put("jssj", endDate);
|
||||
projectMap.put("xmmc", o.getString("项目名称"));
|
||||
projectMap.put("drjs", o.getString("担任角色"));
|
||||
projectMap.put("xmms", o.getString("项目描述"));
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@ package com.engine.recruit.thread;
|
|||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.recruit.conn.ApplicantCommonInfo;
|
||||
import com.engine.recruit.conn.CheckRepeatResume;
|
||||
import com.engine.recruit.conn.PositionCommonInfo;
|
||||
import com.engine.recruit.conn.RecruitDataMap;
|
||||
import com.engine.recruit.conn.*;
|
||||
import com.engine.recruit.constant.RecruitConstant;
|
||||
import com.engine.recruit.entity.position.PositionSdkInstance;
|
||||
import com.engine.recruit.enums.ApplicationStatusEnum;
|
||||
|
|
@ -114,7 +111,7 @@ public class SdkResumeSavedThread extends LocalRunnable {
|
|||
|
||||
// 判断简历是否重复,插入主表
|
||||
CheckRepeatResume instance = CheckRepeatResume.getInstance();
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(params);
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(1, params);
|
||||
String mainId = Util.null2String(checkMap.get("mainId"));
|
||||
String sourceId = Util.null2String(checkMap.get("sourceId"));
|
||||
|
||||
|
|
|
|||
|
|
@ -39,12 +39,20 @@ public class ExtractQllResumeThread extends Thread {
|
|||
for (Map<String, Object> map : mapList) {
|
||||
QllResumePo qllResumePo = RecruitUtil.parseMap2Object(map, QllResumePo.class);
|
||||
try {
|
||||
String email = "";
|
||||
rs.executeQuery("select lyyx from uf_jcl_jlzjb where id = ? ", qllResumePo.getId());
|
||||
if (rs.next()) {
|
||||
email = rs.getString("lyyx");
|
||||
}
|
||||
int creator = getCreator(rs, qllResumePo.getGjrsjh(), email);
|
||||
qllResumePo.setUserId(creator);
|
||||
baseBean.writeLog("千里聆简历解析开始,中间表ID=【" + qllResumePo.getId() + "】");
|
||||
RecruitDataMap<Object> dataMap = buildApplicantMap(qllResumePo);
|
||||
baseBean.writeLog("千里聆简历主表数据解析完成==" + JSON.toJSONString(dataMap));
|
||||
// 校验简历信息、并插入
|
||||
CheckRepeatResume instance = CheckRepeatResume.getInstance();
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(dataMap);
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(creator, dataMap);
|
||||
|
||||
String mainId = Util.null2String(checkMap.get("mainId"));
|
||||
String sourceId = Util.null2String(checkMap.get("sourceId"));
|
||||
baseBean.writeLog("千里聆简历主表数据插入完成,mainId==【" + mainId + "】,sourceId==【" + sourceId + "】");
|
||||
|
|
@ -157,4 +165,23 @@ public class ExtractQllResumeThread extends Thread {
|
|||
}
|
||||
|
||||
|
||||
private int getCreator(RecordSet rs, String phone, String email) {
|
||||
int uid = 1;
|
||||
if (StringUtils.isNotBlank(phone)) {
|
||||
rs.executeQuery("select id from hrmresource where mobile = ?", phone);
|
||||
if (rs.next()) {
|
||||
uid = Math.max(uid, rs.getInt("id"));
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(email)) {
|
||||
rs.executeQuery("select id from hrmresource where email = ?", email);
|
||||
if (rs.next()) {
|
||||
uid = Math.max(uid, rs.getInt("id"));
|
||||
}
|
||||
}
|
||||
|
||||
return uid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue