江苏新视云 千里聆SDK升级

This commit is contained in:
dxfeng 2024-04-01 17:01:02 +08:00
parent ba367cd5b3
commit c5ed862994
6 changed files with 208 additions and 78 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2,6 +2,7 @@ package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.conn.RecruitRecordSet;
import com.engine.recruit.exception.CustomizeRunTimeException;
import com.engine.recruit.service.RpaJclService;
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeEmailSetting;
@ -19,38 +20,42 @@ import java.util.Map;
public class RpaJclServiceImpl extends Service implements RpaJclService {
@Override
public Map<String, Object> setEmailSetting(Map<String, Object> param) {
String billId = Util.null2String(param.get("billId"));
RecordSet rs = new RecordSet();
rs.executeQuery("select * from uf_jcl_qllyxpz where id = ? ", billId);
Map<String, Object> dataMap = RecruitRecordSet.getSingleRecordMap(rs);
try {
String billId = Util.null2String(param.get("billId"));
RecordSet rs = new RecordSet();
rs.executeQuery("select * from uf_jcl_qllyxpz where id = ? ", billId);
Map<String, Object> dataMap = RecruitRecordSet.getSingleRecordMap(rs);
ERPAResumeSDKClient resumeSDKClient = ERPASDKClients.getResumeSDKClient();
String userId = Util.null2String(dataMap.get("szr"));
String status = Util.null2String(dataMap.get("zt"));
String server = Util.null2String(dataMap.get("yjjsfwq"));
String port = Util.null2String(dataMap.get("jsdk"));
String protocol = Util.null2String(dataMap.get("csxy"));
String site = Util.null2String(dataMap.get("yxdz"));
String login = Util.null2String(dataMap.get("yxzh"));
String password = Util.null2String(dataMap.get("yxsqmmm"));
ERPAResumeSDKClient resumeSDKClient = ERPASDKClients.getResumeSDKClient();
String userId = Util.null2String(dataMap.get("szr"));
String status = Util.null2String(dataMap.get("zt"));
String server = Util.null2String(dataMap.get("yjjsfwq"));
String port = Util.null2String(dataMap.get("jsdk"));
String protocol = Util.null2String(dataMap.get("csxy"));
String site = Util.null2String(dataMap.get("yxdz"));
String login = Util.null2String(dataMap.get("yxzh"));
String password = Util.null2String(dataMap.get("yxsqmmm"));
ResumeEmailSetting emailSetting = new ResumeEmailSetting();
ResumeEmailSetting emailSetting = new ResumeEmailSetting();
// 配置启用邮箱功能
emailSetting.setSEMAILSTATUS(status);
emailSetting.setSEMAILSERVER(server);
emailSetting.setSEMAILPORT(port);
emailSetting.setSEMAILPROTOCOL(protocol);
//emailSetting.setSISSEND(isSend);
emailSetting.setSEMAILSITE(site);
emailSetting.setSEMAILLOGIN(login);
emailSetting.setSEMAILPASSWORD(password);
// 配置启用邮箱功能
emailSetting.setSEMAILSTATUS(status);
emailSetting.setSEMAILSERVER(server);
emailSetting.setSEMAILPORT(port);
emailSetting.setSEMAILPROTOCOL(protocol);
//emailSetting.setSISSEND(isSend);
emailSetting.setSEMAILSITE(site);
emailSetting.setSEMAILLOGIN(login);
emailSetting.setSEMAILPASSWORD(password);
// 禁用邮箱功能(只需要传递Status为0)
// emailSetting.setSEMAILSTATUS("0");
// 禁用邮箱功能(只需要传递Status为0)
// emailSetting.setSEMAILSTATUS("0");
// 调用方法更新简历机器人采集设置在千里聆中会更新目标用户机器人配置
resumeSDKClient.setEmailSetting(userId, emailSetting);
// 调用方法更新简历机器人采集设置在千里聆中会更新目标用户机器人配置
resumeSDKClient.setEmailSetting(userId, emailSetting);
} catch (Exception e) {
throw new CustomizeRunTimeException(e);
}
return null;
}
}

View File

@ -3,9 +3,10 @@ package weaver.formmode.recruit.modeexpand.position;
import com.alibaba.fastjson.JSON;
import com.engine.recruit.thread.SdkResumeSavedThread;
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobDto;
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobV2Dto;
import com.weaver.rpa.sdk.clients.core.ERPASDKClients;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import weaver.conn.RecordSet;
import weaver.erpa.apps.entity.application.resume.dto.ResumeTaskResult;
import weaver.erpa.apps.entity.application.resume.enums.TaskResult;
@ -60,7 +61,7 @@ public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew {
for (Property property : properties) {
map.put(property.getName(), property.getValue());
}
ResumeJobDto resumeJobDto = RecruitPositionUtil.convertMap2ResumeJobDto(map);
ResumeJobV2Dto resumeJobDto = RecruitPositionUtil.convertMap2ResumeJobV2Dto(map);
// 发布千里聆职位
if (!RecruitPositionUtil.checkAvailable(client)) {
baseBean.writeLog("千里聆未开通简历应用。");
@ -73,13 +74,17 @@ public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew {
if (jobId == -1) {
baseBean.writeLog("【创建职位】,[id=" + billId + "],resumeJobDto=" + JSON.toJSONString(resumeJobDto));
// 创建千里聆职位
jobId = client.addResumeJob(userId, resumeJobDto);
jobId = client.addResumeJobV2(userId, resumeJobDto);
// 更新千里聆ID到建模表单
rs.executeUpdate("update " + tableName + " set qllgwid = ? where id = ?", jobId, billId);
} else {
//baseBean.writeLog("【更新职位】,[id=" + billId + "],[qllgwid=" + jobId + "],resumeJobDto=" + JSON.toJSONString(resumeJobDto));
//// 已发布的职位更新职位信息
//client.editResumeJob(userId, jobId, (jobDto) -> resumeJobDto);
baseBean.writeLog("【更新职位】,[id=" + billId + "],[qllgwid=" + jobId + "],resumeJobDto=" + JSON.toJSONString(resumeJobDto));
// 已发布的职位更新职位信息
client.editResumeJobV2(userId, jobId, jobDto -> {
new BaseBean().writeLog("职位更新前:" + JSON.toJSONString(jobDto));
BeanUtils.copyProperties(resumeJobDto,jobDto);
new BaseBean().writeLog("职位更新后:" + JSON.toJSONString(jobDto));
});
}
// 在启动监听前需要配置好简历接收回调
@ -93,7 +98,7 @@ public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew {
client.start();
List<Integer> platformIds;
platformIds = resumeJobDto.getPlatformIds();
platformIds = resumeJobDto.getPlatformList();
String errorMsg = "";
for (Integer platformId : platformIds) {
ResumeTaskResult result = client.releaseResumeJob(userId, jobId, platformId);

View File

@ -7,10 +7,13 @@ import com.engine.recruit.enums.PositionThirdChannelEnum;
import com.engine.recruit.exception.CustomizeRunTimeException;
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
import com.weaver.rpa.sdk.clients.application.resume.common.ResumePlatform;
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobDto;
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobDynamicField;
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 java.text.ParseException;
import java.text.SimpleDateFormat;
@ -26,27 +29,43 @@ import java.util.*;
public class RecruitPositionUtil {
/**
* 将Map转换成ResumeJobDto对象
* 将Map转换成ResumeJobV2Dto对象
*
* @param map 数据集合
* @return ResumeJobDto对象
* @return ResumeJobV2Dto
*/
public static ResumeJobDto convertMap2ResumeJobDto(Map<String, Object> map) {
String positionName = Convert.toStr(map.get("zpzwmc"));//职位名称
String positionDuty = Convert.toStr(map.get("gwzz"));//职位职责
String jobRequirements = Convert.toStr(map.get("rzyq"));//任职要求
String finishTime = Convert.toStr(map.get("zpjzrq"));//完成时间
String education = ApplicantCommonInfo.getRecruitCommonBrowserValue(Convert.toStr(map.get("zdxlyq")));//学历要求
String workYears = ApplicantCommonInfo.getRecruitCommonBrowserValue(Convert.toStr(map.get("gznx")));//工作年限
String positionNature = ApplicantCommonInfo.getRecruitCommonBrowserValue(Convert.toStr(map.get("zwxz")));//职位性质
Integer salaryMin = Convert.toInt(map.get("zdxzk"), 0);//最低薪酬
Integer salaryMax = Convert.toInt(map.get("zgxzk"), 0);// 最高薪酬
Integer xcyfs = Convert.toInt(map.get("xzyfs"), 12);// 薪酬月份数
Integer workingDays = Convert.toInt(map.get("sxmzdgts"), 1);// 实习每周到岗天数
Integer internshipDuration = Convert.toInt(map.get("sxscy"), 1);// 实习时长
String jobCategory = "不限";//职位类别
public static ResumeJobV2Dto convertMap2ResumeJobV2Dto(Map<String, Object> map) {
// 职位名称
String positionName = Convert.toStr(map.get("zpzwmc"));
// 职位职责
String positionDuty = Convert.toStr(map.get("gwzz"));
// 任职要求
String jobRequirements = Convert.toStr(map.get("rzyq"));
// 完成时间
String finishTime = Convert.toStr(map.get("zpjzrq"));
// 学历要求
String education = ApplicantCommonInfo.getRecruitCommonBrowserValue(Convert.toStr(map.get("zdxlyq")));
// 工作年限
String workYears = ApplicantCommonInfo.getRecruitCommonBrowserValue(Convert.toStr(map.get("gznx")));
// 职位性质
String positionNature = ApplicantCommonInfo.getRecruitCommonBrowserValue(Convert.toStr(map.get("zwxz")));
// 最低薪酬
Integer salaryMin = Convert.toInt(map.get("zdxzk"), 0);
// 最高薪酬
Integer salaryMax = Convert.toInt(map.get("zgxzk"), 0);
// 薪酬月份数
Integer xcyfs = Convert.toInt(map.get("xzyfs"), 12);
// 实习每周到岗天数
Integer workingDays = Convert.toInt(map.get("sxmzdgts"), 1);
// 实习时长
Integer internshipDuration = Convert.toInt(map.get("sxscy"), 1);
// 招聘人数
Integer zprs = Convert.toInt(map.get("zprs"), 1);
// 职位类别
String jobCategory = "不限";
int experienceValue = -1;//不限
//不限
int experienceValue = -1;
if ("应届毕业生".equals(workYears)) {
experienceValue = 1;
} else if ("一年以内".equals(workYears)) {
@ -62,7 +81,8 @@ public class RecruitPositionUtil {
}
int educationValue = -1; //不限
//不限
int educationValue = -1;
if ("博士".equals(education)) {
educationValue = 8;
} else if ("MBA/EMBA".equals(education)) {
@ -81,7 +101,8 @@ public class RecruitPositionUtil {
educationValue = 1;
}
int resumeType = 1;// 兼职全职
// 社招全职兼职其他
int resumeType = 1;
if ("实习".equals(positionNature)) {
resumeType = 3;
} else if ("校招".equals(positionNature)) {
@ -90,52 +111,151 @@ public class RecruitPositionUtil {
// 招聘职位类型与特殊设置字段
ResumeJobDto resumeJobDto = new ResumeJobDto();
resumeJobDto.setResumeType(resumeType); // (必填,默认社招)招聘类型 1:社招 2:校招 3:实习
ResumeJobV2Dto resumeJobV2Dto = new ResumeJobV2Dto();
// (必填,默认社招)招聘类型 1:社招 2:校招 3:实习
resumeJobV2Dto.setResumeType(resumeType);
if (2 == resumeType && StringUtils.isBlank(finishTime)) {
throw new CustomizeRunTimeException("校招招聘截止时间必填");
}
resumeJobDto.setStopReumeTimeLong(stringTurnLong(finishTime));// (校招必填)仅校招: 招聘截止时间(时间戳)
resumeJobDto.setRequirementsTime(internshipDuration); // (实习必填,默认1个月)仅实习: 实习时长 1~12 单位:()
resumeJobDto.setWorkDate(workingDays); // (实习必填,默认1天)仅实习: 每周到岗天数 1~7 单位:()
// (校招必填)仅校招: 招聘截止时间(时间戳)
resumeJobV2Dto.setStopReumeTimeLong(stringTurnLong(finishTime));
// (实习必填,默认1个月)仅实习: 实习时长 1~12 单位:()
resumeJobV2Dto.setRequirementsTime(internshipDuration);
// (实习必填,默认1天)仅实习: 每周到岗天数 1~7 单位:()
resumeJobV2Dto.setWorkDate(workingDays);
// 招聘职位基本描述
resumeJobDto.setJobname(positionName); // 配置职位名称
// 配置职位名称
resumeJobV2Dto.setJobname(positionName);
String jobDescription = "";
if (StringUtils.isNotBlank(positionDuty)) {
jobDescription += "职位职责:\n" + positionDuty +"\n\n";
jobDescription += "职位职责:\n" + positionDuty + "\n\n";
}
if (StringUtils.isNotBlank(jobRequirements)) {
jobDescription += "任职要求:\n" + jobRequirements;
}
resumeJobDto.setJobdesc(jobDescription); // 配置职位描述
resumeJobDto.setJobType(jobCategory); // 配置职位类别
// 配置职位描述
resumeJobV2Dto.setJobdesc(jobDescription);
// 配置职位类别
List<ResumeJobDynamicField.Item> items = new ArrayList<>();
ResumeJobDynamicField.Item item = new ResumeJobDynamicField.Item();
item.setLabel("0");
item.setValue(jobCategory);
resumeJobV2Dto.setJobType(items);
// 招聘职位条件
//resumeJobDto.setKeywordStr(Lists.newArrayList("java")); // 职位关键词
resumeJobDto.setExperience(experienceValue); // (必填,默认不限)经验要求(实习无此字段) -1:不限 1:一年以下 2:1~3年 3:3~5年 5:5~10年 6:10年以上
resumeJobDto.setEducation(educationValue); // (必填,默认不限)学历要求 -1:不限 1:初中及以下 2:高中 3:中专/中技 4:大专 5:本科 6:硕士 7:MBA/EMBA 8:博士
// (必填,默认不限)经验要求(实习无此字段) -1:不限 1:一年以下 2:1~3年 3:3~5年 5:5~10年 6:10年以上
resumeJobV2Dto.setExperience(experienceValue);
// (必填,默认不限)学历要求 -1:不限 1:初中及以下 2:高中 3:中专/中技 4:大专 5:本科 6:硕士 7:MBA/EMBA 8:博士
resumeJobV2Dto.setEducation(educationValue);
//薪资福利
resumeJobDto.setExpectSalaryStart(salaryMin); // (必填)薪资范围开始 单位:(社招/校招: 千元/ 实习:/)
resumeJobDto.setExpectSalaryStop(salaryMax); // (必填)薪资范围截止 单位:(社招/校招: 千元/ 实习:/)
resumeJobDto.setExpectSalaryMonth(xcyfs); // (必填,默认12个月)薪资月份数(实习无此字段) 1224
// (必填)薪资范围开始 单位:(社招/校招: 千元/ 实习:/)
resumeJobV2Dto.setExpectSalaryStart(salaryMin);
// (必填)薪资范围截止 单位:(社招/校招: 千元/ 实习:/)
resumeJobV2Dto.setExpectSalaryStop(salaryMax);
// (必填,默认12个月)薪资月份数(实习无此字段) 1224
resumeJobV2Dto.setExpectSalaryMonth(xcyfs);
// (必填)要发布的渠道平台Id
List<Integer> platformIds = matchPlatform(Convert.toStr(map.get("dsfqd")));
resumeJobDto.setPlatformIds(platformIds);
resumeJobV2Dto.setPlatformList(platformIds);
// 简历匹配度设置
resumeJobDto.setMappingageStart(-1); // (必填,默认不限)匹配年龄age开始 -1:不限
resumeJobDto.setMappingageStop(-1);// (必填,默认不限)匹配年龄age开始 -1:不限
resumeJobDto.setMappingSex(-1);// (必填,默认不限)匹配性别 -1:不限 0: 1:
resumeJobDto.setMappingeducationStr(Collections.singletonList(-1));// (必填,默认不限)匹配学历 -1:不限 1:初中及以下 2:高中 3:中专/中技 4:大专 5:本科 6:硕士 7:MBA/EMBA 8:博士
resumeJobDto.setMappingexperienceStr(Collections.singletonList(-1));// (必填,默认不限)匹配经验 -1:不限 1:1年内 2:1~3年 3:3~5年 4:5~10年 5:10年以上
// resumeJobDto.setMappingKeywordStr(Lists.newArrayList()); // 匹配关键词内容
resumeJobDto.setMappingStatus(1); // (必填,默认任一命中)匹配模式 1:任一命中 2:全部命中
// (必填,默认不限)匹配年龄age开始 -1:不限
resumeJobV2Dto.setMappingageStart(-1);
// (必填,默认不限)匹配年龄age开始 -1:不限
resumeJobV2Dto.setMappingageStop(-1);
// (必填,默认不限)匹配性别 -1:不限 0: 1:
resumeJobV2Dto.setMappingSex(-1);
// (必填,默认不限)匹配学历 -1:不限 1:初中及以下 2:高中 3:中专/中技 4:大专 5:本科 6:硕士 7:MBA/EMBA 8:博士
resumeJobV2Dto.setMappingeducationStr(Collections.singletonList(-1));
// (必填,默认不限)匹配经验 -1:不限 1:1年内 2:1~3年 3:3~5年 4:5~10年 5:10年以上
resumeJobV2Dto.setMappingexperienceStr(Collections.singletonList(-1));
return resumeJobDto;
String zwgjc = Util.null2String(map.get("zwgjc"));
List<String> zwgjcList = new ArrayList<>();
if (StringUtils.isNotBlank(zwgjc)) {
zwgjcList.addAll(Arrays.asList(zwgjc.split("")));
}
// 匹配关键词内容
resumeJobV2Dto.setMappingKeywordStr(zwgjcList);
// 职位关键词
resumeJobV2Dto.setKeywordStr(zwgjcList);
// (必填,默认任一命中)匹配模式 1:任一命中 2:全部命中
resumeJobV2Dto.setMappingStatus(1);
resumeJobV2Dto.setBizVersion(1);
// 海外经历 ["海外工作经历", "海外教育背景"]
List<String> hwjlList = new ArrayList<>();
String hwjl = Util.null2String(map.get("hwjl"));
if (StringUtils.isNotBlank(hwjl)) {
String[] split = hwjl.split(",");
List<String> strings = Arrays.asList(split);
if (strings.contains("0")) {
hwjlList.add("海外工作经历");
}
if (strings.contains("1")) {
hwjlList.add("海外教育背景");
}
}
resumeJobV2Dto.setHwjl(hwjlList);
/*
*BOSS直聘必填字段
*/
// 毕业时间-开始 boss校招必填
String bysjks = Util.null2String(map.get("bysjks"));
resumeJobV2Dto.setBysjStart(bysjks);
// 毕业时间-结束 boss校招必填
String bysjjs = Util.null2String(map.get("bysjjs"));
resumeJobV2Dto.setBysjEnd(bysjjs);
/*
* 前程无忧必填
*/
// 发布城市
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");
cityList.add(cityName);
}
resumeJobV2Dto.setFbcs(cityList);
// 所属行业
String sshy = Util.null2String(map.get("szhy"));
List<String> sshyList = new ArrayList<>();
if (StringUtils.isNotBlank(sshy)) {
sshyList.addAll(Arrays.asList(sshy.split("")));
}
resumeJobV2Dto.setSshy(Collections.singletonList(sshyList));
/*
* 猎聘必填 智联必填
*/
// 招聘人数
resumeJobV2Dto.setZprs(zprs);
/*
* 拉勾必填
*/
// 职位亮点
resumeJobV2Dto.setZwld(Util.null2String(map.get("zwld")));
// 行业领域
String hyly = Util.null2String(map.get("hyly"));
List<String> hylyList = new ArrayList<>();
if (StringUtils.isNotBlank(hyly)) {
hylyList.addAll(Arrays.asList(hyly.split("")));
}
resumeJobV2Dto.setHyly(hylyList);
return resumeJobV2Dto;
}
/**