diff --git a/WEB-INF/lib/rpa-sso-sdk-1.0.7-jar-with-dependencies.jar b/WEB-INF/lib/rpa-sso-sdk-1.0.7-jar-with-dependencies.jar deleted file mode 100644 index b4ddaad..0000000 Binary files a/WEB-INF/lib/rpa-sso-sdk-1.0.7-jar-with-dependencies.jar and /dev/null differ diff --git a/WEB-INF/lib/rpa-sso-sdk-1.1.9.develop.jar b/WEB-INF/lib/rpa-sso-sdk-1.1.9.develop.jar new file mode 100644 index 0000000..9474463 Binary files /dev/null and b/WEB-INF/lib/rpa-sso-sdk-1.1.9.develop.jar differ diff --git a/src/weaver/formmode/recruit/modeexpand/position/ReleasePositionModeExpand.java b/src/weaver/formmode/recruit/modeexpand/position/ReleasePositionModeExpand.java index c57daa9..a6692b2 100644 --- a/src/weaver/formmode/recruit/modeexpand/position/ReleasePositionModeExpand.java +++ b/src/weaver/formmode/recruit/modeexpand/position/ReleasePositionModeExpand.java @@ -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(jobDto, resumeJobDto); + new BaseBean().writeLog("职位更新后:" + JSON.toJSONString(jobDto)); + }); } // 在启动监听前需要配置好简历接收回调 @@ -93,7 +98,7 @@ public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew { client.start(); List platformIds; - platformIds = resumeJobDto.getPlatformIds(); + platformIds = resumeJobDto.getPlatformList(); String errorMsg = ""; for (Integer platformId : platformIds) { ResumeTaskResult result = client.releaseResumeJob(userId, jobId, platformId); diff --git a/src/weaver/formmode/recruit/modeexpand/util/RecruitPositionUtil.java b/src/weaver/formmode/recruit/modeexpand/util/RecruitPositionUtil.java index 2f93d8e..39c40f0 100644 --- a/src/weaver/formmode/recruit/modeexpand/util/RecruitPositionUtil.java +++ b/src/weaver/formmode/recruit/modeexpand/util/RecruitPositionUtil.java @@ -7,10 +7,12 @@ 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.general.BaseBean; +import weaver.general.Util; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -26,27 +28,43 @@ import java.util.*; public class RecruitPositionUtil { /** - * 将Map转换成ResumeJobDto对象 + * 将Map转换成ResumeJobV2Dto对象 * * @param map 数据集合 - * @return ResumeJobDto对象 + * @return ResumeJobV2Dto */ - public static ResumeJobDto convertMap2ResumeJobDto(Map 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 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 +80,8 @@ public class RecruitPositionUtil { } - int educationValue = -1; //不限 + //不限 + int educationValue = -1; if ("博士".equals(education)) { educationValue = 8; } else if ("MBA/EMBA".equals(education)) { @@ -81,7 +100,8 @@ public class RecruitPositionUtil { educationValue = 1; } - int resumeType = 1;// 兼职、全职 + // 社招(全职、兼职、其他) + int resumeType = 1; if ("实习".equals(positionNature)) { resumeType = 3; } else if ("校招".equals(positionNature)) { @@ -90,52 +110,111 @@ 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); + // TODO 配置职位类别 + List 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个月)薪资月份数(实习无此字段) 12~24 + // (必填)薪资范围开始 单位:(社招/校招: 千元/月 实习:元/日) + resumeJobV2Dto.setExpectSalaryStart(salaryMin); + // (必填)薪资范围截止 单位:(社招/校招: 千元/月 实习:元/日) + resumeJobV2Dto.setExpectSalaryStop(salaryMax); + // (必填,默认12个月)薪资月份数(实习无此字段) 12~24 + resumeJobV2Dto.setExpectSalaryMonth(xcyfs); // (必填)要发布的渠道(平台)Id List 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)); + // resumeJobDto.setMappingKeywordStr(Lists.newArrayList()); // 匹配关键词内容 + // (必填,默认任一命中)匹配模式 1:任一命中 2:全部命中 + resumeJobV2Dto.setMappingStatus(1); + resumeJobV2Dto.setBizVersion(1); - return resumeJobDto; + // 海外经历 ["海外工作经历", "海外教育背景"] + resumeJobV2Dto.setHwjl(null); + + /* + *BOSS直聘必填字段 + */ + // 毕业时间-开始 boss校招必填 + resumeJobV2Dto.setBysjStart(""); + // 毕业时间-结束 boss校招必填 + resumeJobV2Dto.setBysjEnd(""); + + /* + * 前程无忧必填 + */ + // 发布城市 + resumeJobV2Dto.setFbcs(null); + // 所属行业 + String sshy = Util.null2String(map.get("szhy")); + List sshyList = Collections.singletonList(sshy); + resumeJobV2Dto.setSshy(Collections.singletonList(sshyList)); + + /* + * 猎聘必填 智联必填 + */ + // 招聘人数 + resumeJobV2Dto.setZprs(zprs); + + /* + * 拉勾必填 + */ + // 职位亮点 + resumeJobV2Dto.setZwld(Util.null2String(map.get("zwld"))); + // 行业领域 + resumeJobV2Dto.setHyly(sshyList); + + + return resumeJobV2Dto; } /**