generated from dxfeng/secondev-chapanda-feishu
#3316180 简历识别录入查重功能开发
This commit is contained in:
parent
691db66a34
commit
ff7a3ba510
|
|
@ -1,16 +1,12 @@
|
||||||
package com.engine.recruit.conn;
|
package com.engine.recruit.conn;
|
||||||
|
|
||||||
import com.engine.recruit.enums.ApplicationStatusEnum;
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
import weaver.general.BaseBean;
|
import weaver.general.BaseBean;
|
||||||
import weaver.general.Util;
|
import weaver.general.Util;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author:dxfeng
|
* @author:dxfeng
|
||||||
|
|
@ -81,11 +77,26 @@ public class CheckRepeatResume {
|
||||||
* @param mobile 手机号
|
* @param mobile 手机号
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private List<Map<String, Object>> getRepeatResumeList(String name, String mobile) {
|
private List<String> getRepeatResumeListByNameAndPhone(String name, String mobile) {
|
||||||
RecordSet rs = new RecordSet();
|
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);
|
List<String> list = new ArrayList<>();
|
||||||
return RecruitRecordSet.getRecordMapList(rs);
|
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) {
|
public synchronized Map<String, Object> insertResumeAndReturn(Map<String, Object> param) {
|
||||||
Map<String, Object> returnMap = new HashMap<>();
|
Map<String, Object> returnMap = new HashMap<>();
|
||||||
int mainId = -1;
|
int mainId = -1;
|
||||||
String sourceId;
|
|
||||||
String name = Util.null2String(param.get("xm"));
|
String name = Util.null2String(param.get("xm"));
|
||||||
String mobile = Util.null2String(param.get("sjhm"));
|
String mobile = Util.null2String(param.get("sjhm"));
|
||||||
String status = Util.null2String(param.get("zt"));
|
String xb = Util.null2String(param.get("xb"));
|
||||||
String positionId = Util.null2String(param.get("ypzw"));
|
|
||||||
// 黑名单校验,黑名单人员不入库
|
// 黑名单校验,黑名单人员不入库
|
||||||
boolean joinBlackList = joinBlackList(name, mobile);
|
boolean joinBlackList = joinBlackList(name, mobile);
|
||||||
returnMap.put("joinBlackList", joinBlackList);
|
returnMap.put("joinBlackList", joinBlackList);
|
||||||
|
|
@ -158,53 +167,27 @@ public class CheckRepeatResume {
|
||||||
return returnMap;
|
return returnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String jlzfd = null;
|
||||||
// 按照姓名+手机号查询正常展示的简历数据
|
// 按照姓名+手机号查询正常展示的简历数据
|
||||||
List<Map<String, Object>> repeatResumeList = getRepeatResumeList(name, mobile);
|
List<String> repeatResumeList = getRepeatResumeListByNameOrPhone(name, mobile);
|
||||||
if (CollectionUtils.isEmpty(repeatResumeList)) {
|
if (CollectionUtils.isNotEmpty(repeatResumeList)) {
|
||||||
// 不存在重复数据,直接插入数据库
|
List<String> fullRepeatList = getRepeatResumeListByNameAndPhone(name, mobile);
|
||||||
mainId = insertData(param);
|
if (CollectionUtils.isNotEmpty(fullRepeatList)) {
|
||||||
returnMap.put("mainId", mainId);
|
jlzfd = "0";
|
||||||
return returnMap;
|
} else {
|
||||||
|
jlzfd = "1";
|
||||||
|
}
|
||||||
|
// 疑似重复简历
|
||||||
|
param.put("yszfjl", StringUtils.join(repeatResumeList, ","));
|
||||||
|
} else {
|
||||||
|
// 不重复
|
||||||
|
jlzfd = "2";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新接收的简历为待分配
|
param.put("jlzfd", jlzfd);
|
||||||
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);
|
mainId = insertData(param);
|
||||||
returnMap.put("mainId", mainId);
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return returnMap;
|
return returnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
rs.executeUpdate("update uf_jcl_offer set zt = ?, fksj = ? where id = ? and dzyx = ?", status, DateUtil.getDateTime(), billId, email);
|
||||||
|
|
||||||
|
// TODO 更新应聘简历表状态
|
||||||
|
|
||||||
|
|
||||||
// 记录应聘过程
|
// 记录应聘过程
|
||||||
ApplicantRecordPo recordPo = ApplicantRecordPo.builder()
|
ApplicantRecordPo recordPo = ApplicantRecordPo.builder()
|
||||||
.billId(String.valueOf(billId))
|
.billId(String.valueOf(billId))
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package weaver.formmode.recruit.modeexpand.applicant;
|
package weaver.formmode.recruit.modeexpand.applicant;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.engine.recruit.util.RecruitMessageUtils;
|
import com.engine.recruit.util.RecruitMessageUtils;
|
||||||
import com.weaver.formmodel.data.model.Formfield;
|
import com.weaver.formmodel.data.model.Formfield;
|
||||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||||
|
|
@ -39,15 +40,15 @@ public class SendInterviewEmailExpand extends AbstractModeExpandJavaCodeNew {
|
||||||
Map<String, String> result = new HashMap<>();
|
Map<String, String> result = new HashMap<>();
|
||||||
try {
|
try {
|
||||||
//数据id
|
//数据id
|
||||||
int billId;
|
String billId;
|
||||||
//模块id
|
//模块id
|
||||||
int modeId;
|
int modeId;
|
||||||
RequestInfo requestInfo = (RequestInfo) params.get("RequestInfo");
|
RequestInfo requestInfo = (RequestInfo) params.get("RequestInfo");
|
||||||
User user = (User) params.get("user");
|
User user = (User) params.get("user");
|
||||||
if (requestInfo != null) {
|
if (requestInfo != null) {
|
||||||
billId = Util.getIntValue(requestInfo.getRequestid());
|
billId = requestInfo.getRequestid();
|
||||||
modeId = Util.getIntValue(requestInfo.getWorkflowid());
|
modeId = Util.getIntValue(requestInfo.getWorkflowid());
|
||||||
if (billId > 0 && modeId > 0) {
|
if (Convert.toInt(billId, -1) > 0 && modeId > 0) {
|
||||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||||
Property[] properties = mainTableInfo.getProperty();
|
Property[] properties = mainTableInfo.getProperty();
|
||||||
Map<String, Object> mainDataMap = new HashMap<>(16);
|
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));
|
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getLabelName));
|
||||||
// 发送邮件
|
// 发送邮件
|
||||||
String msgContent = RecruitModeUtil.getReplaceContent(tznr, fieldMapList, mainDataMap);
|
String msgContent = RecruitModeUtil.getReplaceContent(tznr, fieldMapList, mainDataMap);
|
||||||
|
// 信息采集链接地址,替换应聘者,为当前表单的ID
|
||||||
|
msgContent.replace("{ypz}", billId);
|
||||||
String yx = Util.null2String(mainDataMap.get("dzyx"));
|
String yx = Util.null2String(mainDataMap.get("dzyx"));
|
||||||
String offerAttach = RecruitModeUtil.getImageFileIdsByDocIds(Util.null2String(mainDataMap.get("tjkjyprysqb")));
|
String offerAttach = RecruitModeUtil.getImageFileIdsByDocIds(Util.null2String(mainDataMap.get("tjkjyprysqb")));
|
||||||
RecruitMessageUtils.sendEmailWithFile(yx, emailTitle, msgContent, offerAttach);
|
RecruitMessageUtils.sendEmailWithFile(yx, emailTitle, msgContent, offerAttach);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue