generated from dxfeng/secondev-chapanda-feishu
OCR SDK 数据创建人取值处理
This commit is contained in:
parent
9ce8b74b32
commit
5b60b3cac0
|
|
@ -3,6 +3,7 @@ package com.engine.recruit.conn;
|
|||
import com.engine.recruit.enums.ApplicationStatusEnum;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
|
|
@ -94,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")));
|
||||
}
|
||||
|
||||
|
|
@ -141,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;
|
||||
|
|
@ -162,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;
|
||||
}
|
||||
|
|
@ -174,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;
|
||||
}
|
||||
|
|
@ -195,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;
|
||||
}
|
||||
|
|
@ -215,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -231,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()) {
|
||||
|
|
@ -251,14 +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数组,下载文件并入库
|
||||
|
|
@ -69,28 +71,29 @@ public class QllResumePo {
|
|||
return null;
|
||||
}
|
||||
String resumeId = null;
|
||||
BaseBean baseBean = new BaseBean();
|
||||
try {
|
||||
JSONArray jsonArray = JSON.parseArray(jlfj);
|
||||
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
|
||||
String name = jsonObject.getString("name");
|
||||
String content = jsonObject.getString("content");
|
||||
new BaseBean().writeLog("千里聆简历附件解析,id=" + id + ",jslf=" + jlfj);
|
||||
baseBean.writeLog("千里聆简历附件解析,id=" + id + ",jslf=" + jlfj);
|
||||
HttpResponse response = HttpRequest.get(content).execute();
|
||||
if (response.isOk()) {
|
||||
String disposition = response.header("Content-Disposition");
|
||||
if (StringUtils.isNotBlank(disposition)) {
|
||||
InputStream inputStream = response.bodyStream();
|
||||
int imageFileId = RecruitModeUtil.generateImageFileId(inputStream, name);
|
||||
int docId = RecruitModeUtil.createDocId(SEC_CATEGORY, imageFileId, new User(1));
|
||||
int docId = RecruitModeUtil.createDocId(SEC_CATEGORY, imageFileId, new User(userId));
|
||||
resumeId = String.valueOf(docId);
|
||||
} else {
|
||||
new BaseBean().writeLog("千里聆附件下载失败,Content-Disposition为空===" + response.body());
|
||||
baseBean.writeLog("千里聆附件下载失败" + response.body());
|
||||
}
|
||||
} else {
|
||||
new BaseBean().writeLog("千里聆附件下载失败,URL响应失败");
|
||||
baseBean.writeLog("千里聆附件下载失败,URL响应失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog("千里聆附件下载失败", e);
|
||||
baseBean.writeLog("千里聆附件下载失败", e);
|
||||
}
|
||||
return resumeId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ public class SdkResumeSavedThread extends LocalRunnable {
|
|||
params.put("ysjl", convertStreamToE9DocId(resumeMqMessage.getResumeInfoDto().getResumeFileId(), user));
|
||||
// 千里聆简历ID
|
||||
params.put("qlljl", resumeId);
|
||||
params.put("tdsj", DateUtil.getDateTime());
|
||||
// 判断是否有发布职位信息,如有发布职位信息,完善招聘流程信息,并指定为待分配状态
|
||||
String positionId = PositionCommonInfo.getPositionIdByQll(resumeInfoDto.getJobId());
|
||||
String zt = ApplicationStatusEnum.DISTRIBUTION.getValue();
|
||||
|
|
@ -112,7 +113,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"));
|
||||
|
||||
|
|
@ -218,7 +219,12 @@ public class SdkResumeSavedThread extends LocalRunnable {
|
|||
baseBean.writeLog("解析千里聆SDK原始简历,fileName===" + fileName);
|
||||
int imageFileId = RecruitModeUtil.generateImageFileId(stream, fileName);
|
||||
baseBean.writeLog("解析千里聆SDK原始简历,imageFileId===" + imageFileId);
|
||||
docIdList.add(RecruitModeUtil.createDocId(SEC_CATEGORY, imageFileId, user));
|
||||
if (imageFileId > 0) {
|
||||
int docId = RecruitModeUtil.createDocId(SEC_CATEGORY, imageFileId, user);
|
||||
if (docId > 0) {
|
||||
docIdList.add(docId);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
baseBean.writeLog("解析千里聆SDK原始简历失败", e);
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentify
|
|||
new BaseBean().writeLog("resumeData="+ JSON.toJSONString(resumeData));
|
||||
// 判断简历信息
|
||||
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"));
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class ExtractQllResumeThread extends Thread {
|
|||
baseBean.writeLog("千里聆简历主表数据解析完成==" + JSON.toJSONString(dataMap));
|
||||
// 校验简历信息、并插入
|
||||
CheckRepeatResume instance = CheckRepeatResume.getInstance();
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(dataMap);
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(1,dataMap);
|
||||
String mainId = Util.null2String(checkMap.get("mainId"));
|
||||
String sourceId = Util.null2String(checkMap.get("sourceId"));
|
||||
baseBean.writeLog("千里聆简历主表数据插入完成,mainId==【" + mainId + "】,sourceId==【" + sourceId + "】");
|
||||
|
|
|
|||
Loading…
Reference in New Issue