智联招聘校招对接

main
howec 2 years ago
parent b690938746
commit c0bc040bd3

@ -103,7 +103,10 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
//1更新字典
if("1".equals(operate_flag)) {
log.error("定时更新字典启动:>>>>>>>>>>>>>>>>>>>>>>");
updateRefreshDict(params,jdbcTemplate,"0000");
Thread t = new Thread(() -> {
updateRefreshDict(params,jdbcTemplate,"0000");
});
t.start();
return SxjgUtil.ok();
}
//2 岗位新增,编辑,删除
@ -113,7 +116,7 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
return SxjgUtil.ok();
}catch (Exception e){
e.printStackTrace();
return SxjgUtil.err(e.getMessage());
throw new RuntimeException(e.getMessage());
}
}
//3 简历获取
@ -132,7 +135,7 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
publishjob(params,jdbcTemplate);
return SxjgUtil.ok();
}catch (Exception e){
return SxjgUtil.err(e.getMessage());
throw new RuntimeException(e.getMessage());
}
}
//refresh token 定时
@ -146,10 +149,10 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
downjob(params,jdbcTemplate);
return SxjgUtil.ok();
}catch (Exception e){
return SxjgUtil.err(e.getMessage());
throw new RuntimeException(e.getMessage());
}
} else {
return SxjgUtil.err("配置不正确请检查参数operate_flag");
throw new RuntimeException("配置不对,请联系管理员");
}
}
@ -290,15 +293,21 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
if(city.contains("市")) {
city= city.split("市")[0];
}
String salary_type = (String)params.get("salary_type");//薪酬范围
String jobAddress = (String)params.get("jobAddress");//工作地址
boolean salaryNegotiable = false;
if("面议".equals(salary_type)) {
salaryNegotiable = true;
}else {
salaryNegotiable = false;
}
BigDecimal maxSalary = new BigDecimal("2");
BigDecimal minSalary = new BigDecimal("1.5");
boolean salaryNegotiable = false;
try{
maxSalary = new BigDecimal((String)params.get("maxSalary"));//最大月薪
minSalary = new BigDecimal((String)params.get("minSalary"));//最小月薪
}catch (Exception e){
salaryNegotiable = true;
}
String quantity1 = (String)params.get("quantity");//招聘人数
int quantity = Double.valueOf(quantity1).intValue();
@ -307,7 +316,10 @@ public class EsbRpcPositionZhilian implements EsbRpcRemoteInterface {
String jobDescription = (String)params.get("jobDescription");//职位描述
//转换智联
int jobNature1 = "实习".equals(jobNature) ? 4 : 2;
long cityId = SxjgUtil.getCityId(jdbcTemplate,city);
Map<String,Long> cityall = SxjgUtil.getCityId(jdbcTemplate,city);
long cityId = cityall.get("code");
long shengid = cityall.get("parentCode");
long maxSalary1 =maxSalary.multiply(new BigDecimal(1000)).longValue();
long minSalary1 =minSalary.multiply(new BigDecimal(1000)).longValue();
if((minSalary1*2) < maxSalary1) {

@ -87,8 +87,7 @@ public class EsbRpcPositionZhilianSz implements EsbRpcRemoteInterface {
jobAdd(params,jdbcTemplate);
return SxjgUtil.ok();
}catch (Exception e){
e.printStackTrace();
return SxjgUtil.err(e.getMessage());
throw new RuntimeException(e.getMessage());
}
}
//3 发布同步下线删除
@ -97,7 +96,7 @@ public class EsbRpcPositionZhilianSz implements EsbRpcRemoteInterface {
updateJob(params,jdbcTemplate);
return SxjgUtil.ok();
}catch (Exception e){
return SxjgUtil.err(e.getMessage());
throw new RuntimeException(e.getMessage());
}
}
//4 简历获取
@ -504,17 +503,26 @@ public class EsbRpcPositionZhilianSz implements EsbRpcRemoteInterface {
}
log.error("职位所属公司code对应智联code"+companyId);
log.error("发布渠道:"+qudao);
String salary_type = (String)params.get("salary_type");//薪酬范围
log.error("薪酬范围:"+salary_type);
boolean isSalaryView;
if("面议".equals(salary_type)) {
isSalaryView = true;
}else {
isSalaryView = false;
}
String jobTitle = (String)params.get("jobTitle");//职位名称
String quantity1 = (String)params.get("quantity");//招聘人数
int quantity = Double.valueOf(quantity1).intValue();
String education = (String)params.get("education");//最低学历
int education1 = SxjgUtil.getEducodesz(education);
String city = (String)params.get("city");//工作城市
String aname=(String)params.get("aname");//工作省
if(city.contains("市")) {
city= city.split("市")[0];
}
long cityId = SxjgUtil.getCityIdsz(jdbcTemplate,city);
long shengid = SxjgUtil.getPrivinceIdsz(jdbcTemplate,aname);
String jobAddress = (String)params.get("jobAddress");//工作地址
String jobType = SxjgUtil.getTypeList((String)params.get("jobType"),"/");
String workAge = (String)params.get("workAge");//工作年限
@ -522,20 +530,27 @@ public class EsbRpcPositionZhilianSz implements EsbRpcRemoteInterface {
String jobNature = (String)params.get("jobNature");//职位属性
//转换智联
int jobNature1 = "实习".equals(jobNature) ? 4 : 2;
boolean salaryNegotiable = false;
BigDecimal maxSalary = new BigDecimal("8");
BigDecimal maxSalary = new BigDecimal("3");
BigDecimal minSalary = new BigDecimal("5");
String monthsalary1 = "";
if(params.get("monthsalary")!=null) {
monthsalary1 = (String)params.get("monthsalary");//月数
if(monthsalary1.length()==0) {
monthsalary1 = "12";
}
}
try{
maxSalary = new BigDecimal((String)params.get("maxSalary"));//最大月薪
minSalary = new BigDecimal((String)params.get("minSalary"));//最小月薪
}catch (Exception e){
salaryNegotiable = true;
maxSalary = new BigDecimal("15");
minSalary = new BigDecimal("10");
}
long maxSalary1 =maxSalary.multiply(new BigDecimal(1000)).longValue();
long minSalary1 =minSalary.multiply(new BigDecimal(1000)).longValue();
maxSalary1 = maxSalary1>210000l ? 210000l :maxSalary1;
minSalary1 = minSalary1>210000l ? 210000l :minSalary1;
String monthsalary1 = (String)params.get("monthsalary");//招聘人数
int monthsalary = Double.valueOf(monthsalary1).intValue();
monthsalary = monthsalary >22 ? 22 : monthsalary;
monthsalary = monthsalary <12 ? 12 : monthsalary;
@ -549,13 +564,14 @@ public class EsbRpcPositionZhilianSz implements EsbRpcRemoteInterface {
jsonObject.put("cityCode",cityId);
jsonObject.put("address",jobAddress);
jsonObject.put("positionType",jobType);
jsonObject.put("salaryNegotiable",salaryNegotiable);
jsonObject.put("workYear",workAge1);
jsonObject.put("employmentType",jobNature1);
jsonObject.put("salaryMin",minSalary1);
jsonObject.put("salaryMax",maxSalary1);
jsonObject.put("salaryMonth",monthsalary);
jsonObject.put("jobDescription",jobDescription);
jsonObject.put("provinceCode",shengid);
jsonObject.put("isSalaryView",isSalaryView);
String rs = SxjgUtil.doJsonPostSz(this.getJobaddurl(),this.getAppid(),this.getAppReferer(),this.getToken(),jsonObject.toJSONString(),jdbcTemplate);
if(SxjgUtil.isSuccessSz(rs)) {
if(isAdd) {

@ -139,18 +139,23 @@ public class SxjgUtil {
*
* code
*/
public static long getCityId(JdbcTemplate jdbcTemplate,String name){
public static Map<String,Long> getCityId(JdbcTemplate jdbcTemplate,String name){
Map<String,Long> rs = new HashMap<>();
String sql = "select count(id) as sums from zhilian_zidian where cnName like '%"+name+"%' and type='REGIONS' and attribute in ('CITY','DISTRICT')";
Map map = jdbcTemplate.queryForMap(sql);
long sums = (long)map.get("sums");
if(sums==0l) {
return 512l;//其他
rs.put("code",512l);
rs.put("parentCode",0l);
return rs;//其他
}
sql = "select code from zhilian_zidian where cnName like '%"+name+"%' and type = 'REGIONS' and attribute in ('CITY','DISTRICT') limit 1";
sql = "select code,parentCode from zhilian_zidian where cnName like '%"+name+"%' and type = 'REGIONS' and attribute in ('CITY','DISTRICT') limit 1";
map = jdbcTemplate.queryForMap(sql);
String code = (String)map.get("code");
long code1 = Long.parseLong(code);
return code1;
String parentCode = (String)map.get("parentCode");
rs.put("code",Long.parseLong(code));
rs.put("parentCode",Long.parseLong(parentCode));
return rs;
}
/**
@ -171,6 +176,18 @@ public class SxjgUtil {
return code1;
}
/**
*
* code
*/
public static long getPrivinceIdsz(JdbcTemplate jdbcTemplate,String name1){
String sql = "select code from zhilian_zidiansz where name like '%"+name1+"%' and is_delete = '0' and type = 'province' limit 1";
Map map = jdbcTemplate.queryForMap(sql);
String code = (String)map.get("code");
long code1 = Long.parseLong(code);
return code1;
}
public static void updateToken(String at1,String rt1,JdbcTemplate jdbcTemplate,String orgCodes){
String sql = "select id from zhilian_token where orgcode = '"+orgCodes+"' limit 1";
Map map = jdbcTemplate.queryForMap(sql);
@ -368,27 +385,27 @@ public class SxjgUtil {
*/
public static int getWordExpCode(String name){
if("不限".equals(name)) {
return 0000;
return 0;
}
if("应届毕业生".equals(name)) {
return 0000;
return 0;
}
if("一年以内".equals(name)) {
return 0001;
return 1;
}
if("1~3年".equals(name)) {
return 0103;
return 103;
}
if("3~5年".equals(name)) {
return 0305;
return 305;
}
if("5~10年".equals(name)) {
return 0510;
return 510;
}
if("10年以上".equals(name)) {
return 1099;
}
return 0000;
return 0;
}
public static Map<String, Object> ok() {

Loading…
Cancel
Save