generated from dxfeng/secondev-chapanda-feishu
千里聆推送数据,职位匹配功能开发
This commit is contained in:
parent
8ba68c866a
commit
60bd66a4c1
|
|
@ -1,8 +1,13 @@
|
|||
package com.engine.recruit.conn;
|
||||
|
||||
import com.engine.recruit.entity.position.PositionPo;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 招聘职位信息
|
||||
*
|
||||
|
|
@ -48,4 +53,58 @@ public class PositionCommonInfo {
|
|||
return recruitFlowId;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据职位名称,获取职位ID
|
||||
*
|
||||
* @param positionName 职位名称
|
||||
* @param mobile 职位跟进人手机号
|
||||
* @return
|
||||
*/
|
||||
public static String getPositionIdByName(String positionName, String mobile) {
|
||||
RecordSet rs = new RecordSet();
|
||||
// 根据职位名称、查询招聘中的数据
|
||||
rs.executeQuery("select id ,zpzwmc ,zpzt ,modedatacreater ,modedatacreatedate ,modedatacreatetime from uf_jcl_zp_zpzw where zpzt = 0 and zpzwmc = ? ", positionName);
|
||||
List<PositionPo> positionPoList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
PositionPo positionPo = PositionPo.builder()
|
||||
.id(rs.getString("id"))
|
||||
.name(rs.getString("zpzwmc"))
|
||||
.status(rs.getString("zpzt"))
|
||||
.creator(rs.getString("modedatacreater"))
|
||||
.createDate(rs.getString("modedatacreatedate"))
|
||||
.createTime(rs.getString("modedatacreatetime"))
|
||||
.build();
|
||||
positionPoList.add(positionPo);
|
||||
}
|
||||
|
||||
// 未查询到数据,返回空
|
||||
if (CollectionUtils.isEmpty(positionPoList)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 只有一条数据,直接返回当前数据,如果有多个,再添加其他条件过滤
|
||||
if (positionPoList.size() == 1) {
|
||||
return positionPoList.get(0).getId();
|
||||
}
|
||||
|
||||
// 根据手机号查询人员ID
|
||||
Set<String> userIds = new HashSet<>();
|
||||
rs.executeQuery("select id from hrmresource where mobile = ? ", mobile);
|
||||
while (rs.next()) {
|
||||
userIds.add(rs.getString("id"));
|
||||
}
|
||||
|
||||
// 筛选跟进人手机号匹配的职位数据,并按创建时间倒序排序
|
||||
List<PositionPo> filterList = positionPoList.stream().filter(item -> userIds.contains(item.getCreator())).sorted(Comparator.comparing(PositionPo::getCreationTime).reversed()).collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(filterList)) {
|
||||
// 跟进人手机号未获取到,选择最新的一条数据
|
||||
return positionPoList.get(0).getId();
|
||||
} else {
|
||||
// 再一样,就默认匹配到创建时间最新的职位
|
||||
return filterList.get(0).getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,14 +74,6 @@ public class ApplicantResumeController {
|
|||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::updateApplicantsInfo, params);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/fullOriginalResumeId")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String fullOriginalResumeId(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::fullOriginalResumeId, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/checkRepeatResume")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.recruit.entity.position;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/02/05
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PositionPo {
|
||||
private String id;
|
||||
private String name;
|
||||
private String status;
|
||||
private String creator;
|
||||
private String createDate;
|
||||
private String createTime;
|
||||
private String creationTime;
|
||||
|
||||
public String getCreationTime() {
|
||||
return createDate + " " + createTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -200,11 +200,6 @@ public class QllResumePo {
|
|||
return list;
|
||||
}
|
||||
|
||||
public String getYpzw() {
|
||||
// TODO 如果关联招聘职位
|
||||
//return ypzw;
|
||||
return null;
|
||||
}
|
||||
|
||||
private String formatStr(String str) {
|
||||
if (StringUtils.isBlank(str)) {
|
||||
|
|
|
|||
|
|
@ -55,13 +55,6 @@ public interface ApplicantResumeService {
|
|||
Map<String, Object> updateApplicantsInfo(Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* 完善OCR导入的简历,原始简历字段
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> fullOriginalResumeId(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 判断是否重复简历,是否可以新增
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.conn.*;
|
||||
import com.engine.recruit.constant.RecruitConstant;
|
||||
import com.engine.recruit.entity.record.ApplicantRecordPo;
|
||||
import com.engine.recruit.entity.resume.OcrResumePo;
|
||||
import com.engine.recruit.enums.ApplicantOperateEnum;
|
||||
|
|
@ -11,7 +9,6 @@ import com.engine.recruit.enums.ApplicationStatusEnum;
|
|||
import com.engine.recruit.enums.RecordOperateEnum;
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
import com.engine.recruit.service.ApplicantResumeService;
|
||||
import com.engine.recruit.util.RecruitUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
|
|
@ -316,38 +313,6 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
return returnMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> fullOriginalResumeId(Map<String, Object> params) {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
|
||||
int imageFileId = Convert.toInt(params.get("imageFileId"));
|
||||
int resumeId = Convert.toInt(params.get("resumeId"));
|
||||
int secCategory = Convert.toInt(RecruitConstant.APPLICANTS_RESUMES_CATEGORY);
|
||||
RecordSet rs = new RecordSet();
|
||||
try {
|
||||
int docId = RecruitModeUtil.createDocId(secCategory, imageFileId, user);
|
||||
// 更新原始简历信息
|
||||
rs.executeUpdate("update uf_jcl_jlzjb set jlfj=?,ocr=1 where id = ?", docId, resumeId);
|
||||
|
||||
// 简历入库,并返回展示的应聘者简历ID
|
||||
rs.executeQuery("select id,xm, xb, csrq, jg, yx, wx, qq, xjzd, ah, grys , jyjl , bysj , zgxl , zyjn , sxjl , yysp , zs, gzjl, ypzw, gzjy, xmjl, sjhm, nl, sfz, jlfj from uf_jcl_jlzjb where ocr = 1 and cqzt is null and id = ?", resumeId);
|
||||
Map<String, Object> recordMap = RecruitRecordSet.getSingleRecordMap(rs);
|
||||
OcrResumePo ocrResumePo = RecruitUtil.parseMap2Object(recordMap, OcrResumePo.class);
|
||||
RecruitDataMap<Object> dataMap = buildApplicantMap(ocrResumePo);
|
||||
// 校验简历信息、并插入
|
||||
Map<String, Object> map = CheckRepeatResume.getInstance().insertResumeAndReturn(dataMap);
|
||||
rs.executeUpdate("update uf_jcl_jlzjb set cqzt = 1 where id = ? ", ocrResumePo.getId());
|
||||
String mainId = Util.null2String(map.get("mainId"));
|
||||
String sourceId = Util.null2String(map.get("sourceId"));
|
||||
returnMap.put("mainId", StringUtils.isNotBlank(sourceId) ? sourceId : mainId);
|
||||
returnMap.put("sourceId", sourceId);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> checkRepeatResume(Map<String, Object> param) {
|
||||
|
|
|
|||
|
|
@ -38,9 +38,6 @@ public class ApplicantResumeWrapper extends Service {
|
|||
return getApplicantResumeService(user).updateApplicantsInfo(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> fullOriginalResumeId(Map<String, Object> params) {
|
||||
return getApplicantResumeService(user).fullOriginalResumeId(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> checkRepeatResume(Map<String, Object> params) {
|
||||
return getApplicantResumeService(user).checkRepeatResume(params);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package weaver.interfaces.recruit.thread;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.recruit.conn.*;
|
||||
import com.engine.recruit.entity.resume.QllResumePo;
|
||||
|
|
@ -21,6 +22,8 @@ import java.util.Map;
|
|||
* @version: 1.0
|
||||
*/
|
||||
public class ExtractQllResumeThread extends Thread {
|
||||
BaseBean baseBean = new BaseBean();
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
RecordSet rs = new RecordSet();
|
||||
|
|
@ -32,20 +35,26 @@ public class ExtractQllResumeThread extends Thread {
|
|||
for (Map<String, Object> map : mapList) {
|
||||
QllResumePo qllResumePo = RecruitUtil.parseMap2Object(map, QllResumePo.class);
|
||||
try {
|
||||
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);
|
||||
String mainId = Util.null2String(checkMap.get("mainId"));
|
||||
String sourceId = Util.null2String(checkMap.get("sourceId"));
|
||||
rs.executeUpdate("update uf_jcl_jlzjb set cqzt = 1 where id = ? ", qllResumePo.getId());
|
||||
baseBean.writeLog("千里聆简历主表数据插入完成,mainId==【" + mainId + "】,sourceId==【" + sourceId + "】");
|
||||
|
||||
// 数据写入完成后,更新抽取状态为新插入的数据ID
|
||||
rs.executeUpdate("update uf_jcl_jlzjb set cqzt = 1 ,mainid = ? ,sourceid = ? where id = ? ", Convert.toInt(mainId), Convert.toInt(sourceId), qllResumePo.getId());
|
||||
|
||||
// 插入明细表数据
|
||||
instance.insertResumeDetailTable(qllResumePo.getJyjl(), "uf_jcl_yppc_dt1", mainId, sourceId);
|
||||
instance.insertResumeDetailTable(qllResumePo.getGzjl(), "uf_jcl_yppc_dt2", mainId, sourceId);
|
||||
instance.insertResumeDetailTable(qllResumePo.getXmjl(), "uf_jcl_yppc_dt3", mainId, sourceId);
|
||||
baseBean.writeLog("千里聆简历解析完成,mainId==【" + mainId + "】,sourceId==【" + sourceId + "】");
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog("简历解析失败" + JSON.toJSONString(qllResumePo), e);
|
||||
baseBean.writeLog("简历解析失败" + JSON.toJSONString(qllResumePo), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -81,15 +90,19 @@ public class ExtractQllResumeThread extends Thread {
|
|||
insertMap.put("tdsj", DateUtil.getDateTime());
|
||||
// 原始简历
|
||||
insertMap.put("ysjl", qllResumePo.getJlfj());
|
||||
// 投递职位(第三方)
|
||||
insertMap.put("tdzwdsf", qllResumePo.getYpzw());
|
||||
|
||||
|
||||
String zt = ApplicationStatusEnum.DISTRIBUTION.getValue();
|
||||
// 应聘职位
|
||||
String ypzw = qllResumePo.getYpzw();
|
||||
String ypzw = PositionCommonInfo.getPositionIdByName(qllResumePo.getYpzw(), qllResumePo.getGjrsjh());
|
||||
baseBean.writeLog("投递职位==【" + qllResumePo.getYpzw() + "】,投递职位ID==【" + ypzw + "】");
|
||||
if (StringUtils.isNotBlank(ypzw)) {
|
||||
String flowId = PositionCommonInfo.getRecruitFlowId(ypzw);
|
||||
Map<String, String> initialStage = ApplicantCommonInfo.getInitialStage(flowId);
|
||||
if (null != initialStage) {
|
||||
baseBean.writeLog("initialStage===" + JSON.toJSONString(initialStage));
|
||||
String zpjd = initialStage.get("zpjd");
|
||||
String dqypjd = initialStage.get("jdlx");
|
||||
if (StringUtils.isNotBlank(zpjd) && StringUtils.isNotBlank(dqypjd)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue