generated from dxfeng/secondev-chapanda-feishu
ADD-职位分渠道发布、下架、刷新
This commit is contained in:
parent
41322ccac8
commit
953e9ee346
|
|
@ -9,6 +9,7 @@ import weaver.hrm.User;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
|
|
@ -43,4 +44,40 @@ public class RecruitPositionController {
|
|||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitPositionWrapper(user)::getFormCondition, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/releaseResumeJob")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String releaseResumeJob(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitPositionWrapper(user)::releaseResumeJob, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/closeResumeJob")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String closeResumeJob(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitPositionWrapper(user)::closeResumeJob, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/refreshResumeJob")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String refreshResumeJob(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitPositionWrapper(user)::refreshResumeJob, param);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getReportList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getReportList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitPositionWrapper(user)::getReportList, param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
package com.engine.recruit.entity.position;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/06/12
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class PositionRelease {
|
||||
private Integer id;
|
||||
private String title;
|
||||
private String status;
|
||||
private String tips;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getTips() {
|
||||
return tips;
|
||||
}
|
||||
|
||||
public void setTips(String tips) {
|
||||
this.tips = tips;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.engine.recruit.enums;
|
||||
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/06/13
|
||||
* @version: 1.0
|
||||
*/
|
||||
public enum PositionReleaseStatusEnum {
|
||||
/**
|
||||
* 未发布
|
||||
*/
|
||||
UNPUBLISHED(0, "未发布"),
|
||||
/**
|
||||
* 已发布
|
||||
*/
|
||||
PUBLISHED(2, "已发布"),
|
||||
/**
|
||||
* 发布失败
|
||||
*/
|
||||
PUBLISHING_FAILED(3, "发布失败"),
|
||||
/**
|
||||
* 已下架
|
||||
*/
|
||||
CLOSED(5, "已下架"),
|
||||
;
|
||||
|
||||
PositionReleaseStatusEnum(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public static PositionReleaseStatusEnum getEnumByValue(Integer value) {
|
||||
for (PositionReleaseStatusEnum item : PositionReleaseStatusEnum.values()) {
|
||||
if (item.value.equals(value)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
throw new CustomizeRunTimeException("不支持的发布状态");
|
||||
}
|
||||
|
||||
private Integer value;
|
||||
private String label;
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.recruit.enums;
|
||||
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
import com.weaver.rpa.sdk.clients.application.resume.common.ResumePlatform;
|
||||
|
||||
/**
|
||||
* 发布渠道枚举类
|
||||
|
|
@ -13,19 +14,21 @@ public enum PositionThirdChannelEnum {
|
|||
/**
|
||||
* 发布渠道
|
||||
*/
|
||||
BOSSZHIPIN("0", "BOSS直聘"),
|
||||
ZHILIANZHAOPIN("1", "智联"),
|
||||
QIANCHENGWUYOU("2", "前程无忧"),
|
||||
LAGO("3", "拉勾"),
|
||||
LIEPIN("4", "猎聘");
|
||||
BOSSZHIPIN("0", "BOSS直聘", ResumePlatform.BOSSZHIPIN),
|
||||
ZHILIANZHAOPIN("1", "智联", ResumePlatform.ZHILIANZHAOPIN),
|
||||
QIANCHENGWUYOU("2", "前程无忧", ResumePlatform.QIANCHENGWUYOU),
|
||||
LAGO("3", "拉勾", ResumePlatform.LAGO),
|
||||
LIEPIN("4", "猎聘", ResumePlatform.LIEPIN);
|
||||
|
||||
PositionThirdChannelEnum(String value, String desc) {
|
||||
PositionThirdChannelEnum(String value, String desc, int resumePlatformId) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
this.resumePlatformId = resumePlatformId;
|
||||
}
|
||||
|
||||
private String value;
|
||||
private String desc;
|
||||
private int resumePlatformId;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
|
|
@ -43,7 +46,15 @@ public enum PositionThirdChannelEnum {
|
|||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static PositionThirdChannelEnum getEnum(String value) {
|
||||
public int getResumePlatformId() {
|
||||
return resumePlatformId;
|
||||
}
|
||||
|
||||
public void setResumePlatformId(int resumePlatformId) {
|
||||
resumePlatformId = resumePlatformId;
|
||||
}
|
||||
|
||||
public static PositionThirdChannelEnum getEnumByValue(String value) {
|
||||
for (PositionThirdChannelEnum item : PositionThirdChannelEnum.values()) {
|
||||
if (item.value.equalsIgnoreCase(value)) {
|
||||
return item;
|
||||
|
|
@ -51,4 +62,13 @@ public enum PositionThirdChannelEnum {
|
|||
}
|
||||
throw new CustomizeRunTimeException("不支持的发布渠道");
|
||||
}
|
||||
|
||||
public static PositionThirdChannelEnum getEnumByPlatformId(int resumePlatformId) {
|
||||
for (PositionThirdChannelEnum item : PositionThirdChannelEnum.values()) {
|
||||
if (item.resumePlatformId == resumePlatformId) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
throw new CustomizeRunTimeException("不支持的发布渠道");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,4 +25,36 @@ public interface RecruitPositionService {
|
|||
*/
|
||||
Map<String, Object> getFormCondition(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 发布职位
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> releaseResumeJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 下架职位
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> closeResumeJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 刷新职位
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> refreshResumeJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 获取发布状态
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getReportList(Map<String, Object> param);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,27 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.conn.ApplicantCommonInfo;
|
||||
import com.engine.recruit.conn.RecruitRecordSet;
|
||||
import com.engine.recruit.entity.position.PositionRelease;
|
||||
import com.engine.recruit.entity.position.PositionSdkInstance;
|
||||
import com.engine.recruit.entity.position.PositionSelectItem;
|
||||
import com.engine.recruit.enums.PositionReleaseStatusEnum;
|
||||
import com.engine.recruit.enums.PositionThirdChannelEnum;
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
import com.engine.recruit.service.RecruitPositionService;
|
||||
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
|
||||
import com.weaver.rpa.sdk.clients.application.resume.common.ResumeJobStatus;
|
||||
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobDynamicField;
|
||||
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobV2Dto;
|
||||
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;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitPositionUtil;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -84,6 +98,249 @@ public class RecruitPositionServiceImpl extends Service implements RecruitPositi
|
|||
return apidatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> releaseResumeJob(Map<String, Object> param) {
|
||||
try {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
String billId = Util.null2String(param.get("billId"));
|
||||
String platformIds = Util.null2String(param.get("platformIds"));
|
||||
if (StringUtils.isBlank(platformIds)) {
|
||||
throw new CustomizeRunTimeException("请选择要发布的平台");
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select * from uf_jcl_zp_zpzw where id = ?", billId);
|
||||
Map<String, Object> map = RecruitRecordSet.getSingleRecordMap(rs);
|
||||
boolean enableSdkClient = PositionSdkInstance.enableSdkClient();
|
||||
if (enableSdkClient) {
|
||||
long jobId = -1;
|
||||
String qllgwid = Util.null2String(map.get("qllgwid"));
|
||||
if (StringUtils.isNotBlank(qllgwid)) {
|
||||
jobId = Long.parseLong(qllgwid);
|
||||
}
|
||||
|
||||
ERPAResumeSDKClient client = PositionSdkInstance.getPositionSdkInstance().getResumeSDKClient();
|
||||
|
||||
ResumeJobV2Dto resumeJobDto = RecruitPositionUtil.convertMap2ResumeJobV2Dto(user, map);
|
||||
String userId = String.valueOf(user.getUID());
|
||||
// 未创建职位,则先创建职位
|
||||
if (jobId == -1) {
|
||||
rs.writeLog("【创建职位】,[id=" + billId + "],resumeJobDto=" + JSON.toJSONString(resumeJobDto));
|
||||
// 创建千里聆职位
|
||||
jobId = client.addResumeJobV2(userId, resumeJobDto);
|
||||
// 更新千里聆ID到建模表单
|
||||
rs.executeUpdate("update uf_jcl_zp_zpzw set qllgwid = ? where id = ?", jobId, billId);
|
||||
} else {
|
||||
rs.writeLog("【更新职位】,[id=" + billId + "],[qllgwid=" + jobId + "],resumeJobDto=" + JSON.toJSONString(resumeJobDto));
|
||||
// 已发布的职位,更新职位信息
|
||||
client.editResumeJobV2(userId, jobId, jobDto -> {
|
||||
BeanUtils.copyProperties(resumeJobDto, jobDto);
|
||||
});
|
||||
}
|
||||
|
||||
String errorMsg = "";
|
||||
int succ = 0;
|
||||
int fail = 0;
|
||||
String[] split = platformIds.split(",");
|
||||
for (String platformId : split) {
|
||||
PositionThirdChannelEnum positionThirdChannelEnum = PositionThirdChannelEnum.getEnumByValue(platformId);
|
||||
|
||||
ResumeTaskResult result = client.releaseResumeJob(userId, jobId, positionThirdChannelEnum.getResumePlatformId());
|
||||
// 直接查看结果,正在执行中会返回PENGING,成功后会返回SUCCEED,失败后会返回FAILED
|
||||
TaskResult current = result.getResult();
|
||||
rs.writeLog(current);
|
||||
// 使用回调函数获取成功或者失败时的消息
|
||||
result.onResult(() -> {
|
||||
rs.writeLog("执行成功回调");
|
||||
}, (reason) -> {
|
||||
rs.writeLog("执行失败回调,原因:" + reason);
|
||||
});
|
||||
|
||||
// 等待直到状态不再是PENDING
|
||||
TaskResult taskResult = result.waitResult();
|
||||
rs.writeLog(taskResult);
|
||||
Integer status;
|
||||
if (taskResult == TaskResult.SUCCEED) {
|
||||
rs.writeLog("执行成功");
|
||||
succ++;
|
||||
status = PositionReleaseStatusEnum.PUBLISHED.getValue();
|
||||
} else {
|
||||
errorMsg = "执行失败,原因:" + result.getFailReason();
|
||||
rs.writeLog(errorMsg);
|
||||
fail++;
|
||||
status = PositionReleaseStatusEnum.PUBLISHING_FAILED.getValue();
|
||||
}
|
||||
recordPublishingStatus(billId, platformId, status, errorMsg);
|
||||
}
|
||||
resultMap.put("msg", "成功发布" + succ + "个,失败" + fail + "个");
|
||||
} else {
|
||||
String msg = "未配置发布插件,第三方平台请至各招聘网站自行发布";
|
||||
resultMap.put("errmsg", msg);
|
||||
String[] splits = platformIds.split(",");
|
||||
for (String platformId : splits) {
|
||||
recordPublishingStatus(billId, platformId, PositionReleaseStatusEnum.PUBLISHED.getValue(), msg);
|
||||
}
|
||||
}
|
||||
// 更新状态为已发布
|
||||
//rs.executeUpdate("update uf_jcl_zp_zpzw set qdfbzt = ? where id = ?", 2, billId);
|
||||
return getReportList(param);
|
||||
} catch (InterruptedException e) {
|
||||
throw new CustomizeRunTimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> closeResumeJob(Map<String, Object> param) {
|
||||
try {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
String billId = Util.null2String(param.get("billId"));
|
||||
// 当前仅支持所有渠道一键下架
|
||||
//String platformIds = Util.null2String(param.get("platformIds"));
|
||||
//if (StringUtils.isBlank(platformIds)) {
|
||||
// throw new CustomizeRunTimeException("请选择要发布的平台");
|
||||
//}
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
// 查询已发布渠道的信息
|
||||
String platformIds = Util.null2String(param.get("platformIds"));
|
||||
rs.executeQuery("select inner_channel from uf_jcl_qdfb where position = ? and status = ? ", billId, PositionReleaseStatusEnum.PUBLISHED.getValue());
|
||||
if (rs.next()) {
|
||||
platformIds = rs.getString("inner_channel");
|
||||
}
|
||||
|
||||
// 判断是否配置千里聆,若未配置千里聆信息,则不执行下架职位操作,只更新状态
|
||||
boolean enableSdkClient = PositionSdkInstance.enableSdkClient();
|
||||
if (enableSdkClient) {
|
||||
rs.executeQuery("select qllgwid from uf_jcl_zp_zpzw where id = ?", billId);
|
||||
if (rs.next()) {
|
||||
String qllgwid = rs.getString("qllgwid");
|
||||
// 第三方渠道未发布,不调用千里聆执行职位下架操作
|
||||
if (StringUtils.isBlank(qllgwid)) {
|
||||
throw new CustomizeRunTimeException("billId=" + billId + ",当前职位暂未同步至千里聆发布,无需进行下架操作");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(platformIds)) {
|
||||
throw new CustomizeRunTimeException("当前职位暂未发布,无需进行下架操作");
|
||||
}
|
||||
|
||||
long jobId = Long.parseLong(qllgwid);
|
||||
ERPAResumeSDKClient client = PositionSdkInstance.getPositionSdkInstance().getResumeSDKClient();
|
||||
String userId = String.valueOf(user.getUID());
|
||||
ResumeTaskResult result = client.closeResumeJob(userId, jobId);
|
||||
String errorMsg = "";
|
||||
|
||||
TaskResult current = result.getResult();
|
||||
rs.writeLog(current);
|
||||
|
||||
// 使用回调函数获取成功或者失败时的消息
|
||||
result.onResult(() -> {
|
||||
rs.writeLog("执行成功回调");
|
||||
}, (reason) -> {
|
||||
rs.writeLog("执行失败回调,原因:" + reason);
|
||||
});
|
||||
|
||||
// 等待直到状态不再是PENDING
|
||||
TaskResult taskResult = result.waitResult();
|
||||
rs.writeLog(taskResult);
|
||||
if (taskResult == TaskResult.SUCCEED) {
|
||||
rs.writeLog("执行成功");
|
||||
syncResumePlatformStatus(billId, jobId, client);
|
||||
} else {
|
||||
errorMsg = "执行失败,原因:" + result.getFailReason();
|
||||
throw new CustomizeRunTimeException(errorMsg);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String msg = "未配置下架插件,第三方平台请至各招聘网站自行下架";
|
||||
resultMap.put("errmsg", msg);
|
||||
String[] splits = platformIds.split(",");
|
||||
for (String platformId : splits) {
|
||||
recordPublishingStatus(billId, platformId, PositionReleaseStatusEnum.PUBLISHED.getValue(), msg);
|
||||
}
|
||||
}
|
||||
//
|
||||
// 更新招聘状态为招聘结束
|
||||
//rs.executeUpdate("update uf_jcl_zp_zpzw set zpzt = ? where id = ?", 1, billId);
|
||||
|
||||
return getReportList(param);
|
||||
} catch (InterruptedException e) {
|
||||
throw new CustomizeRunTimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> refreshResumeJob(Map<String, Object> param) {
|
||||
String billId = Util.null2String(param.get("billId"));
|
||||
String platformIds = Util.null2String(param.get("platformIds"));
|
||||
if (StringUtils.isBlank(platformIds)) {
|
||||
throw new CustomizeRunTimeException("请选择要刷新的平台");
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
try {
|
||||
long jobId = -1;
|
||||
rs.executeQuery("select qllgwid from uf_jcl_zp_zpzw where id = ?", billId);
|
||||
if (rs.next()) {
|
||||
String qllgwid = rs.getString("qllgwid");
|
||||
// 第三方渠道未发布,不调用千里聆执行职位下架操作
|
||||
if (StringUtils.isBlank(qllgwid)) {
|
||||
throw new CustomizeRunTimeException("billId=" + billId + ",当前职位暂未同步至千里聆发布,无需进行下架操作");
|
||||
}
|
||||
jobId = Long.parseLong(qllgwid);
|
||||
}
|
||||
ERPAResumeSDKClient client = PositionSdkInstance.getPositionSdkInstance().getResumeSDKClient();
|
||||
ResumeTaskResult result = client.refreshResumeJob(String.valueOf(user.getUID()), jobId);
|
||||
String errorMsg = "";
|
||||
|
||||
TaskResult current = result.getResult();
|
||||
rs.writeLog(current);
|
||||
|
||||
// 使用回调函数获取成功或者失败时的消息
|
||||
result.onResult(() -> {
|
||||
rs.writeLog("刷新成功回调");
|
||||
}, (reason) -> {
|
||||
rs.writeLog("刷新失败回调,原因:" + reason);
|
||||
});
|
||||
|
||||
// 等待直到状态不再是PENDING
|
||||
TaskResult taskResult = result.waitResult();
|
||||
rs.writeLog(taskResult);
|
||||
if (taskResult == TaskResult.SUCCEED) {
|
||||
rs.writeLog("刷新成功");
|
||||
syncResumePlatformStatus(billId, jobId, client);
|
||||
} else {
|
||||
errorMsg = "刷新失败,原因:" + result.getFailReason();
|
||||
throw new CustomizeRunTimeException(errorMsg);
|
||||
}
|
||||
return getReportList(param);
|
||||
} catch (InterruptedException e) {
|
||||
throw new CustomizeRunTimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getReportList(Map<String, Object> param) {
|
||||
String billId = Util.null2String(param.get("billId"));
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select * from uf_jcl_qdfb where position = ?", billId);
|
||||
List<PositionRelease> list = new ArrayList<>();
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
while (rs.next()) {
|
||||
Integer status = Convert.toInt(rs.getString("status"), 0);
|
||||
PositionReleaseStatusEnum releaseStatusEnum = PositionReleaseStatusEnum.getEnumByValue(status);
|
||||
PositionRelease positionRelease = new PositionRelease();
|
||||
positionRelease.setId(rs.getInt("inner_channel"));
|
||||
positionRelease.setStatus(releaseStatusEnum.getLabel());
|
||||
String tips = rs.getString("tips");
|
||||
if (StringUtils.isNotBlank(tips)) {
|
||||
positionRelease.setTips(tips);
|
||||
}
|
||||
list.add(positionRelease);
|
||||
//returnMap.put(rs.getInt("inner_channel"), releaseStatusEnum.getLabel());
|
||||
}
|
||||
returnMap.put("list", list);
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取职位类别
|
||||
*
|
||||
|
|
@ -247,4 +504,54 @@ public class RecruitPositionServiceImpl extends Service implements RecruitPositi
|
|||
apidatas.put("boss_resident_time_2", PositionSelectItem.convertDynamicFieldItem(positionSdkInstance.getBoss_resident_time_2()));
|
||||
//apidatas.put("job51_city", PositionSelectItem.convertDynamicFieldItem(positionSdkInstance.getJob51_city()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 记录发布状态
|
||||
*
|
||||
* @param position
|
||||
* @param innerChannel
|
||||
* @param status
|
||||
* @param tips
|
||||
*/
|
||||
private void recordPublishingStatus(String position, String innerChannel, Integer status, String tips) {
|
||||
String tableName = "uf_jcl_qdfb";
|
||||
Map<String, Object> insertMap = new HashMap<>();
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
insertMap.put("modeuuid", uuid);
|
||||
int formModeId = ApplicantCommonInfo.getModeIdByTableName(tableName);
|
||||
insertMap.put("formmodeid", formModeId);
|
||||
RecruitRecordSet.buildModeInsertFields(insertMap, user.getUID());
|
||||
insertMap.put("position", position);
|
||||
insertMap.put("inner_channel", innerChannel);
|
||||
insertMap.put("status", status);
|
||||
if (StringUtils.isNotBlank(tips)) {
|
||||
insertMap.put("tips", tips);
|
||||
}
|
||||
RecruitRecordSet.insertData(insertMap, tableName);
|
||||
int id = RecruitRecordSet.refreshRight(uuid, tableName, formModeId, user.getUID());
|
||||
|
||||
// 删除原来该职位下,该渠道的数据
|
||||
String deleteSql = "delete from uf_jcl_qdfb where position = '" + position + "' and inner_channel = " + innerChannel + " and id != " + id;
|
||||
RecruitRecordSet.deleteData(deleteSql);
|
||||
}
|
||||
|
||||
|
||||
private void syncResumePlatformStatus(String billId, long jobId, ERPAResumeSDKClient client) {
|
||||
Map<Integer, ResumeJobStatus> integerResumeJobStatusMap = client.syncResumePlatformStatus(String.valueOf(user.getUID()), jobId);
|
||||
for (Map.Entry<Integer, ResumeJobStatus> entry : integerResumeJobStatusMap.entrySet()) {
|
||||
Integer key = entry.getKey();
|
||||
ResumeJobStatus value = entry.getValue();
|
||||
Integer status = PositionReleaseStatusEnum.UNPUBLISHED.getValue();
|
||||
if (null == value) {
|
||||
status = PositionReleaseStatusEnum.CLOSED.getValue();
|
||||
} else if (value.equals(ResumeJobStatus.RELEASED)) {
|
||||
status = PositionReleaseStatusEnum.PUBLISHED.getValue();
|
||||
} else if (value.equals(ResumeJobStatus.UNRELEASED)) {
|
||||
status = PositionReleaseStatusEnum.UNPUBLISHED.getValue();
|
||||
}
|
||||
PositionThirdChannelEnum positionThirdChannelEnum = PositionThirdChannelEnum.getEnumByPlatformId(key);
|
||||
recordPublishingStatus(billId, positionThirdChannelEnum.getValue(), status, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,4 +25,21 @@ public class RecruitPositionWrapper extends Service {
|
|||
public Map<String, Object> getFormCondition(Map<String, Object> param) {
|
||||
return getRecruitPositionService(user).getFormCondition(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> releaseResumeJob(Map<String, Object> param) {
|
||||
return getRecruitPositionService(user).releaseResumeJob(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> closeResumeJob(Map<String, Object> param) {
|
||||
return getRecruitPositionService(user).closeResumeJob(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> refreshResumeJob(Map<String, Object> param) {
|
||||
return getRecruitPositionService(user).refreshResumeJob(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> getReportList(Map<String, Object> param) {
|
||||
return getRecruitPositionService(user).getReportList(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -391,26 +391,8 @@ public class RecruitPositionUtil {
|
|||
if (platformId == null) {
|
||||
continue;
|
||||
}
|
||||
PositionThirdChannelEnum channelEnum = PositionThirdChannelEnum.getEnum(platformId);
|
||||
switch (channelEnum) {
|
||||
case BOSSZHIPIN:
|
||||
platformIdList.add(ResumePlatform.BOSSZHIPIN);
|
||||
break;
|
||||
case LIEPIN:
|
||||
platformIdList.add(ResumePlatform.LIEPIN);
|
||||
break;
|
||||
case LAGO:
|
||||
platformIdList.add(ResumePlatform.LAGO);
|
||||
break;
|
||||
case QIANCHENGWUYOU:
|
||||
platformIdList.add(ResumePlatform.QIANCHENGWUYOU);
|
||||
break;
|
||||
case ZHILIANZHAOPIN:
|
||||
platformIdList.add(ResumePlatform.ZHILIANZHAOPIN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
PositionThirdChannelEnum channelEnum = PositionThirdChannelEnum.getEnumByValue(platformId);
|
||||
platformIdList.add(channelEnum.getResumePlatformId());
|
||||
}
|
||||
return platformIdList;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue