#3316180 简历识别录入查重功能开发

This commit is contained in:
dxfeng 2024-11-11 16:22:42 +08:00
parent 691db66a34
commit ff7a3ba510
3 changed files with 47 additions and 58 deletions

View File

@ -1,16 +1,12 @@
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.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Util;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
/**
* @author:dxfeng
@ -81,11 +77,26 @@ public class CheckRepeatResume {
* @param mobile 手机号
* @return
*/
private List<Map<String, Object>> getRepeatResumeList(String name, String mobile) {
private List<String> getRepeatResumeListByNameAndPhone(String name, String mobile) {
RecordSet rs = new RecordSet();
// 查询状态为待分配候选中的且未隐藏的数据
rs.executeQuery("select * from uf_jcl_yppc where formmodeid is not null and zt != 2 and zt != 3 and xm = ? and sjhm =? order by zt", name, mobile);
return RecruitRecordSet.getRecordMapList(rs);
List<String> list = new ArrayList<>();
rs.executeQuery("select id from uf_jcl_yppc where formmodeid is not null and xm = ? and sjhm = ? ", name, mobile);
while (rs.next()) {
list.add(rs.getString("id"));
}
return list;
}
private List<String> getRepeatResumeListByNameOrPhone(String name, String mobile) {
RecordSet rs = new RecordSet();
// 查询状态为待分配候选中的且未隐藏的数据
List<String> list = new ArrayList<>();
rs.executeQuery("select id from uf_jcl_yppc where formmodeid is not null and (xm = ? or sjhm = ? )", name, mobile);
while (rs.next()) {
list.add(rs.getString("id"));
}
return list;
}
/**
@ -144,11 +155,9 @@ public class CheckRepeatResume {
public synchronized Map<String, Object> insertResumeAndReturn(Map<String, Object> param) {
Map<String, Object> returnMap = new HashMap<>();
int mainId = -1;
String sourceId;
String name = Util.null2String(param.get("xm"));
String mobile = Util.null2String(param.get("sjhm"));
String status = Util.null2String(param.get("zt"));
String positionId = Util.null2String(param.get("ypzw"));
String xb = Util.null2String(param.get("xb"));
// 黑名单校验黑名单人员不入库
boolean joinBlackList = joinBlackList(name, mobile);
returnMap.put("joinBlackList", joinBlackList);
@ -158,53 +167,27 @@ public class CheckRepeatResume {
return returnMap;
}
String jlzfd = null;
// 按照姓名+手机号查询正常展示的简历数据
List<Map<String, Object>> repeatResumeList = getRepeatResumeList(name, mobile);
if (CollectionUtils.isEmpty(repeatResumeList)) {
// 不存在重复数据直接插入数据库
mainId = insertData(param);
returnMap.put("mainId", mainId);
return returnMap;
List<String> repeatResumeList = getRepeatResumeListByNameOrPhone(name, mobile);
if (CollectionUtils.isNotEmpty(repeatResumeList)) {
List<String> fullRepeatList = getRepeatResumeListByNameAndPhone(name, mobile);
if (CollectionUtils.isNotEmpty(fullRepeatList)) {
jlzfd = "0";
} else {
jlzfd = "1";
}
// 疑似重复简历
param.put("yszfjl", StringUtils.join(repeatResumeList, ","));
} else {
// 不重复
jlzfd = "2";
}
// 新接收的简历为待分配
if (ApplicationStatusEnum.DISTRIBUTION.getValue().equals(status)) {
Map<String, Object> sourceResume = repeatResumeList.get(0);
if (ApplicationStatusEnum.DISTRIBUTION.getValue().equals(Util.null2String(sourceResume.get("zt")))) {
// 当前存在待分配的简历
sourceId = Util.null2String(sourceResume.get("id"));
//取新简历有值的字段更新已入库简历没有值的字段已入库简历有值的字段不做更新新简历入库并隐藏
mainId = updateSourceResume(param, sourceResume);
returnMap.put("mainId", mainId);
returnMap.put("sourceId", sourceId);
returnMap.put("isUpdate", true);
return returnMap;
} else {
// 直接入库不做任何处理
mainId = insertData(param);
returnMap.put("mainId", mainId);
return returnMap;
}
} else if (ApplicationStatusEnum.CANDIDATE.getValue().equals(status)) {
// 新简历为候选中
boolean hasSamePosition = false;
for (Map<String, Object> sourceResume : repeatResumeList) {
if (positionId.equals(Util.null2String(sourceResume.get("ypzw")))) {
hasSamePosition = true;
}
}
if (hasSamePosition) {
// 若有相同职位的数据新简历直接入库并隐藏
mainId = insertHideData(param);
returnMap.put("mainId", mainId);
return returnMap;
} else {
// 没有相同职位的数据新简历直接入库不做任何处理
mainId = insertData(param);
returnMap.put("mainId", mainId);
return returnMap;
}
}
param.put("jlzfd", jlzfd);
mainId = insertData(param);
returnMap.put("mainId", mainId);
return returnMap;
}

View File

@ -72,6 +72,9 @@ public class OfferServiceImpl extends Service implements OfferService {
// 更新反馈状态反馈时间
rs.executeUpdate("update uf_jcl_offer set zt = ?, fksj = ? where id = ? and dzyx = ?", status, DateUtil.getDateTime(), billId, email);
// TODO 更新应聘简历表状态
// 记录应聘过程
ApplicantRecordPo recordPo = ApplicantRecordPo.builder()
.billId(String.valueOf(billId))

View File

@ -1,5 +1,6 @@
package weaver.formmode.recruit.modeexpand.applicant;
import cn.hutool.core.convert.Convert;
import com.engine.recruit.util.RecruitMessageUtils;
import com.weaver.formmodel.data.model.Formfield;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
@ -39,15 +40,15 @@ public class SendInterviewEmailExpand extends AbstractModeExpandJavaCodeNew {
Map<String, String> result = new HashMap<>();
try {
//数据id
int billId;
String billId;
//模块id
int modeId;
RequestInfo requestInfo = (RequestInfo) params.get("RequestInfo");
User user = (User) params.get("user");
if (requestInfo != null) {
billId = Util.getIntValue(requestInfo.getRequestid());
billId = requestInfo.getRequestid();
modeId = Util.getIntValue(requestInfo.getWorkflowid());
if (billId > 0 && modeId > 0) {
if (Convert.toInt(billId, -1) > 0 && modeId > 0) {
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
Map<String, Object> mainDataMap = new HashMap<>(16);
@ -68,6 +69,8 @@ public class SendInterviewEmailExpand extends AbstractModeExpandJavaCodeNew {
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getLabelName));
// 发送邮件
String msgContent = RecruitModeUtil.getReplaceContent(tznr, fieldMapList, mainDataMap);
// 信息采集链接地址,替换应聘者为当前表单的ID
msgContent.replace("{ypz}", billId);
String yx = Util.null2String(mainDataMap.get("dzyx"));
String offerAttach = RecruitModeUtil.getImageFileIdsByDocIds(Util.null2String(mainDataMap.get("tjkjyprysqb")));
RecruitMessageUtils.sendEmailWithFile(yx, emailTitle, msgContent, offerAttach);