generated from dxfeng/secondev-chapanda-feishu
106 lines
2.7 KiB
Java
106 lines
2.7 KiB
Java
package com.engine.recruit.conn;
|
||
|
||
import com.engine.recruit.util.WeaBrowserUtil;
|
||
import org.apache.commons.lang3.StringUtils;
|
||
import weaver.conn.RecordSet;
|
||
import weaver.hrm.User;
|
||
|
||
/**
|
||
* @author:dxfeng
|
||
* @createTime: 2023/11/10
|
||
* @version: 1.0
|
||
*/
|
||
public class ModeBrowserCommonInfo {
|
||
|
||
|
||
/**
|
||
* 根据名称,获取简历来源ID
|
||
*
|
||
* @param name
|
||
* @return
|
||
*/
|
||
public static String getResumeSource(String name) {
|
||
return getBrowserId("2", name);
|
||
}
|
||
|
||
/**
|
||
* 根据名称,获取工作经验ID
|
||
*
|
||
* @param name
|
||
* @return
|
||
*/
|
||
public static String getWorkExperience(String name) {
|
||
return getBrowserId("10", name);
|
||
}
|
||
|
||
|
||
/**
|
||
* 获取学位ID
|
||
*
|
||
* @param name
|
||
* @return
|
||
*/
|
||
public static String getDegreeId(String name) {
|
||
return getBrowserId("12", name);
|
||
}
|
||
|
||
/**
|
||
* 获取学历ID
|
||
*
|
||
* @param name
|
||
* @return
|
||
*/
|
||
public static String getEducationLevelId(String name) {
|
||
if (StringUtils.isBlank(name)) {
|
||
return null;
|
||
}
|
||
String id = null;
|
||
RecordSet rs = new RecordSet();
|
||
rs.executeQuery("select id from hrmeducationlevel where name like '%" + name + "%'");
|
||
if (rs.next()) {
|
||
id = rs.getString("id");
|
||
}
|
||
return id;
|
||
}
|
||
|
||
public static String getWorkPlaceShowName(User user, String id) {
|
||
String placeName = "";
|
||
if (StringUtils.isBlank(id)) {
|
||
return placeName;
|
||
}
|
||
|
||
RecordSet rs = new RecordSet();
|
||
rs.executeQuery("select ssq,xxdz from uf_zpgzdd where id = ?", id);
|
||
if (rs.next()) {
|
||
String ssq = rs.getString("ssq");
|
||
String xxdz = rs.getString("xxdz");
|
||
// 区县浏览按钮类型:263
|
||
String areaName = WeaBrowserUtil.getBrowserShowNames(user, 263, ssq);
|
||
if (StringUtils.isNotBlank(areaName) && StringUtils.isNotBlank(xxdz)) {
|
||
String[] split = areaName.split("/");
|
||
if (split.length == 4) {
|
||
areaName = split[1] + "-" + split[2] + "-" + split[3];
|
||
placeName = areaName + "-" + xxdz;
|
||
}
|
||
} else {
|
||
rs.writeLog("id=" + id + ",ssq=" + ssq + ",xxdz=" + xxdz);
|
||
}
|
||
}
|
||
return placeName;
|
||
}
|
||
|
||
|
||
private static String getBrowserId(String zdlxmc, String xxnr) {
|
||
if (StringUtils.isBlank(xxnr)) {
|
||
return null;
|
||
}
|
||
String sourceId = null;
|
||
RecordSet rs = new RecordSet();
|
||
rs.executeQuery("select id from uf_sjzd where zdlxmc = ? and xxnr = ? ", zdlxmc, xxnr);
|
||
if (rs.next()) {
|
||
sourceId = rs.getString("id");
|
||
}
|
||
return sourceId;
|
||
}
|
||
}
|