generated from dxfeng/secondev-chapanda-feishu
千里聆SDK,职位发布功能优化
This commit is contained in:
parent
8f5958e7b9
commit
99b45546fb
|
|
@ -144,7 +144,7 @@ public class RecruitPositionServiceImpl extends Service implements RecruitPositi
|
|||
private void getCityType(String selectValue, Map<String, Object> apidatas, ResumeJobDynamicField resumeJobDynamicField) {
|
||||
List<String> valueList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(selectValue)) {
|
||||
String[] split = selectValue.split("");
|
||||
String[] split = selectValue.split(",");
|
||||
valueList = Arrays.asList(split);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,9 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
throw new CustomizeRunTimeException("千里聆接口调用失败,响应结果为空");
|
||||
}
|
||||
|
||||
BaseBean baseBean = new BaseBean();
|
||||
JSONObject all = JSONObject.parseObject(response);
|
||||
baseBean.writeLog("千里聆相应数据:" + all);
|
||||
if (!all.getBoolean("isSuccess")) {
|
||||
throw new CustomizeRunTimeException("千里聆接口调用失败,接口不通");
|
||||
}
|
||||
|
|
@ -144,6 +146,7 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
throw new CustomizeRunTimeException("调用千里聆接口失败,失败原因:" + resultall.getString("info"));
|
||||
}
|
||||
JSONObject result = resultall.getJSONObject("result");
|
||||
baseBean.writeLog("千里聆OCR解析数据:" + result);
|
||||
Map<String, Object> dataMap = parseQllJsonToMap(result, isCard);
|
||||
returnMap.put("data", dataMap);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,6 +213,13 @@ public class SdkResumeSavedThread extends LocalRunnable {
|
|||
baseBean.writeLog("解析千里聆SDK原始简历,resumeFileId===" + resumeFileId);
|
||||
List<Integer> docIdList = new ArrayList<>();
|
||||
ERPAResumeSDKClient client = ERPASDKClients.getResumeSDKClient();
|
||||
// 在启动监听前需要配置好简历接收回调
|
||||
client.addResumeSavedListener(resumeMqMessage -> {
|
||||
// 处理获取到的简历信息
|
||||
baseBean.writeLog("【简历接收回调】:" + JSON.toJSONString(resumeMqMessage));
|
||||
Thread thread = new Thread(new SdkResumeSavedThread(resumeMqMessage));
|
||||
thread.start();
|
||||
});
|
||||
client.start();
|
||||
client.downloadResumeFile(resumeFileId, (fileName, stream) -> {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobDynamicFiel
|
|||
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobV2Dto;
|
||||
import com.weaver.rpa.sdk.utils.HttpClientUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -64,7 +63,7 @@ public class RecruitPositionUtil {
|
|||
// 招聘人数
|
||||
Integer zprs = Convert.toInt(map.get("zprs"), 1);
|
||||
// 职位类别
|
||||
String jobCategory = "不限";
|
||||
String jobCategory = Convert.toStr(map.get("zwlb"));
|
||||
|
||||
// 工作地点
|
||||
String gzdd = Convert.toStr(map.get("gzdd"));
|
||||
|
|
@ -118,8 +117,7 @@ public class RecruitPositionUtil {
|
|||
|
||||
// 招聘职位类型与特殊设置字段
|
||||
ResumeJobV2Dto resumeJobV2Dto = new ResumeJobV2Dto();
|
||||
if(StringUtils.isNotBlank(workPlaceShowName)){
|
||||
// TODO 设置工作地点
|
||||
if (StringUtils.isNotBlank(workPlaceShowName)) {
|
||||
resumeJobV2Dto.setJobArea(workPlaceShowName);
|
||||
}
|
||||
// (必填,默认社招)招聘类型 1:社招 2:校招 3:实习
|
||||
|
|
@ -149,10 +147,19 @@ public class RecruitPositionUtil {
|
|||
resumeJobV2Dto.setJobdesc(jobDescription);
|
||||
// 配置职位类别
|
||||
List<ResumeJobDynamicField.Item> items = new ArrayList<>();
|
||||
ResumeJobDynamicField.Item item = new ResumeJobDynamicField.Item();
|
||||
item.setLabel("0");
|
||||
item.setValue(jobCategory);
|
||||
// TODO items.add(item);
|
||||
String[] typeSplit = jobCategory.split("\n");
|
||||
for (String s : typeSplit) {
|
||||
String[] split1 = s.split(":");
|
||||
String platName = split1[0];
|
||||
String typeStr = split1[1];
|
||||
int platId = getPlatIdByName(platName);
|
||||
if (0 != platId) {
|
||||
ResumeJobDynamicField.Item item = new ResumeJobDynamicField.Item();
|
||||
item.setLabel(String.valueOf(platId));
|
||||
item.setValue(typeStr);
|
||||
items.add(item);
|
||||
}
|
||||
}
|
||||
resumeJobV2Dto.setJobType(items);
|
||||
|
||||
// 招聘职位条件
|
||||
|
|
@ -228,24 +235,30 @@ public class RecruitPositionUtil {
|
|||
/*
|
||||
* 前程无忧必填
|
||||
*/
|
||||
// TODO 发布城市
|
||||
List<String> cityList = new ArrayList<>();
|
||||
// 发布城市
|
||||
String fbcs = Util.null2String(map.get("fbcs"));
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select cityname from hrmcity where id = ?", fbcs);
|
||||
if (rs.next()) {
|
||||
String cityName = rs.getString("cityname");
|
||||
cityName = Util.formatMultiLang(cityName, Util.null2String(user.getLanguage()));
|
||||
cityList.add(cityName);
|
||||
if (StringUtils.isNotBlank(fbcs)) {
|
||||
String[] split = fbcs.split(",");
|
||||
resumeJobV2Dto.setFbcs(Arrays.asList(split));
|
||||
}
|
||||
// TODO resumeJobV2Dto.setFbcs(cityList);
|
||||
// 所属行业
|
||||
String sshy = Util.null2String(map.get("szhy"));
|
||||
List<String> sshyList = new ArrayList<>();
|
||||
List<List<String>> sshyList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(sshy)) {
|
||||
sshyList.addAll(Arrays.asList(sshy.split("、")));
|
||||
String[] split = sshy.split("\n");
|
||||
for (String s : split) {
|
||||
if (StringUtils.isNotBlank(s)) {
|
||||
String[] strings = s.split("-");
|
||||
if (strings.length == 2) {
|
||||
List<String> strings1 = new ArrayList<>();
|
||||
strings1.add(strings[0]);
|
||||
strings1.add(strings[1]);
|
||||
sshyList.add(strings1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
resumeJobV2Dto.setSshy(Collections.singletonList(sshyList));
|
||||
resumeJobV2Dto.setSshy(sshyList);
|
||||
|
||||
/*
|
||||
* 猎聘必填 智联必填
|
||||
|
|
@ -266,6 +279,48 @@ public class RecruitPositionUtil {
|
|||
}
|
||||
resumeJobV2Dto.setHyly(hylyList);
|
||||
|
||||
// 人才加分项
|
||||
String rcjfx = Util.null2String(map.get("rxjfx"));
|
||||
resumeJobV2Dto.setRcjfx(rcjfx);
|
||||
|
||||
// 简历接收邮箱
|
||||
String jljsyx = Util.null2String(map.get("jljsyx"));
|
||||
resumeJobV2Dto.setJsyx(jljsyx);
|
||||
|
||||
// 语言要求
|
||||
String yyyq = Util.null2String(map.get("yyyq"));
|
||||
resumeJobV2Dto.setYyyq(yyyq);
|
||||
|
||||
// 语言要求程度
|
||||
String yyyqcd = Util.null2String(map.get("yyyqcd"));
|
||||
if (StringUtils.isNotBlank(yyyqcd)) {
|
||||
switch (yyyqcd) {
|
||||
case "0":
|
||||
yyyqcd = "一般";
|
||||
break;
|
||||
case "1":
|
||||
yyyqcd = "良好";
|
||||
break;
|
||||
case "2":
|
||||
yyyqcd = "熟练";
|
||||
break;
|
||||
case "3":
|
||||
yyyqcd = "精通";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
resumeJobV2Dto.setYyyq_level(yyyqcd);
|
||||
|
||||
|
||||
// 职位福利
|
||||
String zwfl = Util.null2String(map.get("zwfl"));
|
||||
List<String> zwflList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(zwfl)) {
|
||||
zwflList.addAll(Arrays.asList(zwfl.split("、")));
|
||||
}
|
||||
resumeJobV2Dto.setZwfl(zwflList);
|
||||
|
||||
return resumeJobV2Dto;
|
||||
}
|
||||
|
|
@ -327,6 +382,31 @@ public class RecruitPositionUtil {
|
|||
return platformIdList;
|
||||
}
|
||||
|
||||
private static int getPlatIdByName(String platName) {
|
||||
int platId = 0;
|
||||
switch (platName) {
|
||||
case "BOSS直聘":
|
||||
platId = ResumePlatform.BOSSZHIPIN;
|
||||
break;
|
||||
case "智联":
|
||||
case "智联招聘":
|
||||
platId = ResumePlatform.ZHILIANZHAOPIN;
|
||||
break;
|
||||
case "前程无忧":
|
||||
platId = ResumePlatform.QIANCHENGWUYOU;
|
||||
break;
|
||||
case "拉勾":
|
||||
platId = ResumePlatform.LAGO;
|
||||
break;
|
||||
case "猎聘":
|
||||
platId = ResumePlatform.LIEPIN;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return platId;
|
||||
}
|
||||
|
||||
public static boolean checkAvailable(ERPAResumeSDKClient client) {
|
||||
HttpClientUtils.setTimeout(10000);//默认10秒
|
||||
if (client == null || !client.available()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue