generated from dxfeng/secondev-chapanda-feishu
ADD——千里聆同步的简历简历按名称匹配职位
This commit is contained in:
parent
0881577d5d
commit
df5cd2d948
|
|
@ -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,57 @@ 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.stream().sorted(Comparator.comparing(PositionPo::getCreationTime).reversed()).collect(Collectors.toList()).get(0).getId();
|
||||
} else {
|
||||
// 再一样,就默认匹配到创建时间最新的职位
|
||||
return filterList.get(0).getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -199,11 +199,6 @@ public class QllResumePo {
|
|||
return list;
|
||||
}
|
||||
|
||||
public String getYpzw() {
|
||||
// TODO 如果关联招聘职位
|
||||
//return ypzw;
|
||||
return null;
|
||||
}
|
||||
|
||||
private String formatStr(String str) {
|
||||
if (StringUtils.isBlank(str)) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public class ExtractQllResumeThread extends Thread {
|
|||
|
||||
String zt = ApplicationStatusEnum.DISTRIBUTION.getValue();
|
||||
// 应聘职位
|
||||
String ypzw = qllResumePo.getYpzw();
|
||||
String ypzw = PositionCommonInfo.getPositionIdByName(qllResumePo.getYpzw(), qllResumePo.getGjrsjh());
|
||||
if (StringUtils.isNotBlank(ypzw)) {
|
||||
String flowId = PositionCommonInfo.getRecruitFlowId(ypzw);
|
||||
Map<String, String> initialStage = ApplicantCommonInfo.getInitialStage(flowId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue