generated from dxfeng/secondev-chapanda-feishu
MODIFY-职位发布功能调整
This commit is contained in:
parent
c692dd0841
commit
26c59fbdbe
|
|
@ -18,6 +18,8 @@ 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.common.ResumeJobStatus;
|
||||||
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobDynamicField;
|
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.clients.application.resume.entity.ResumeJobV2Dto;
|
||||||
|
import com.weaver.rpa.sdk.clients.application.resume.exception.RpaResumeException;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
|
|
@ -181,8 +183,8 @@ public class RecruitPositionServiceImpl extends Service implements RecruitPositi
|
||||||
Map<String, Object> reportList = getReportList(param);
|
Map<String, Object> reportList = getReportList(param);
|
||||||
reportList.put("msg", msg);
|
reportList.put("msg", msg);
|
||||||
return reportList;
|
return reportList;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException | RpaResumeException e) {
|
||||||
throw new CustomizeRunTimeException(e);
|
throw new CustomizeRunTimeException(e.getMessage(),e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -199,9 +201,10 @@ public class RecruitPositionServiceImpl extends Service implements RecruitPositi
|
||||||
|
|
||||||
// 查询已发布渠道的信息
|
// 查询已发布渠道的信息
|
||||||
String platformIds = Util.null2String(param.get("platformIds"));
|
String platformIds = Util.null2String(param.get("platformIds"));
|
||||||
|
List<String> platformList = new ArrayList<>();
|
||||||
rs.executeQuery("select inner_channel from uf_jcl_qdfb where position = ? and status = ? ", billId, PositionReleaseStatusEnum.PUBLISHED.getValue());
|
rs.executeQuery("select inner_channel from uf_jcl_qdfb where position = ? and status = ? ", billId, PositionReleaseStatusEnum.PUBLISHED.getValue());
|
||||||
if (rs.next()) {
|
while (rs.next()) {
|
||||||
platformIds = rs.getString("inner_channel");
|
platformList.add(rs.getString("inner_channel"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断是否配置千里聆,若未配置千里聆信息,则不执行下架职位操作,只更新状态
|
// 判断是否配置千里聆,若未配置千里聆信息,则不执行下架职位操作,只更新状态
|
||||||
|
|
@ -216,7 +219,7 @@ public class RecruitPositionServiceImpl extends Service implements RecruitPositi
|
||||||
throw new CustomizeRunTimeException("billId=" + billId + ",当前职位暂未同步至千里聆发布,无需进行下架操作");
|
throw new CustomizeRunTimeException("billId=" + billId + ",当前职位暂未同步至千里聆发布,无需进行下架操作");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isBlank(platformIds)) {
|
if (CollectionUtils.isEmpty(platformList)) {
|
||||||
throw new CustomizeRunTimeException("当前职位暂未发布,无需进行下架操作");
|
throw new CustomizeRunTimeException("当前职位暂未发布,无需进行下架操作");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -247,16 +250,15 @@ public class RecruitPositionServiceImpl extends Service implements RecruitPositi
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg = "未配置下架插件,第三方平台请至各招聘网站自行下架";
|
msg = "未配置下架插件,第三方平台请至各招聘网站自行下架";
|
||||||
String[] splits = platformIds.split(",");
|
for (String platformId : platformList) {
|
||||||
for (String platformId : splits) {
|
|
||||||
recordPublishingStatus(billId, platformId, PositionReleaseStatusEnum.PUBLISHED.getValue(), msg);
|
recordPublishingStatus(billId, platformId, PositionReleaseStatusEnum.PUBLISHED.getValue(), msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Map<String, Object> reportList = getReportList(param);
|
Map<String, Object> reportList = getReportList(param);
|
||||||
reportList.put("msg", msg);
|
reportList.put("msg", msg);
|
||||||
return reportList;
|
return reportList;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException | RpaResumeException e) {
|
||||||
throw new CustomizeRunTimeException(e);
|
throw new CustomizeRunTimeException(e.getMessage(),e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -301,8 +303,8 @@ public class RecruitPositionServiceImpl extends Service implements RecruitPositi
|
||||||
Map<String, Object> reportList = getReportList(param);
|
Map<String, Object> reportList = getReportList(param);
|
||||||
reportList.put("msg", msg);
|
reportList.put("msg", msg);
|
||||||
return reportList;
|
return reportList;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException | RpaResumeException e) {
|
||||||
throw new CustomizeRunTimeException(e);
|
throw new CustomizeRunTimeException(e.getMessage(),e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
package weaver.formmode.recruit.modeexpand.position;
|
package weaver.formmode.recruit.modeexpand.position;
|
||||||
|
|
||||||
import com.engine.recruit.entity.position.PositionSdkInstance;
|
import com.engine.recruit.entity.position.PositionSdkInstance;
|
||||||
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
|
import com.engine.recruit.enums.PositionReleaseStatusEnum;
|
||||||
import com.weaver.rpa.sdk.clients.core.entity.SDKCore;
|
import com.weaver.rpa.sdk.clients.core.entity.SDKCore;
|
||||||
import com.weaver.rpa.sdk.clients.core.utils.ERPASDKInitUtils;
|
import com.weaver.rpa.sdk.clients.core.utils.ERPASDKInitUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import weaver.conn.RecordSet;
|
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.customjavacode.AbstractModeExpandJavaCodeNew;
|
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||||
import weaver.general.BaseBean;
|
import weaver.general.BaseBean;
|
||||||
import weaver.general.Util;
|
import weaver.general.Util;
|
||||||
import weaver.hrm.User;
|
import weaver.hrm.User;
|
||||||
import weaver.soa.workflow.request.RequestInfo;
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -43,56 +43,19 @@ public class ClosePositionModeExpand extends AbstractModeExpandJavaCodeNew {
|
||||||
// 判断是否配置千里聆,若未配置千里聆信息,则不执行下架职位操作,只更新状态
|
// 判断是否配置千里聆,若未配置千里聆信息,则不执行下架职位操作,只更新状态
|
||||||
boolean enableSdkClient = PositionSdkInstance.enableSdkClient();
|
boolean enableSdkClient = PositionSdkInstance.enableSdkClient();
|
||||||
if (enableSdkClient) {
|
if (enableSdkClient) {
|
||||||
rs.executeQuery("select qllgwid,qdfbzt from " + tableName + " where id = ?", billId);
|
List<String> platformList = new ArrayList<>();
|
||||||
if (rs.next()) {
|
rs.executeQuery("select inner_channel from uf_jcl_qdfb where position = ? and status = ? ", billId, PositionReleaseStatusEnum.PUBLISHED.getValue());
|
||||||
String qllgwid = rs.getString("qllgwid");
|
while (rs.next()) {
|
||||||
String qdfbzt = rs.getString("qdfbzt");
|
platformList.add(rs.getString("inner_channel"));
|
||||||
// 第三方渠道未发布,不调用千里聆执行职位下架操作
|
|
||||||
if (StringUtils.isNotBlank(qdfbzt) && !"0".equals(qdfbzt)) {
|
|
||||||
if (StringUtils.isBlank(qllgwid)) {
|
|
||||||
baseBean.writeLog("billId=" + billId + ",当前职位暂未发布,无需进行下架操作");
|
|
||||||
resultMap.put("errmsg", "当前职位暂未发布,无需进行下架操作");
|
|
||||||
resultMap.put("flag", "false");
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
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();
|
|
||||||
baseBean.writeLog(current);
|
|
||||||
|
|
||||||
// 使用回调函数获取成功或者失败时的消息
|
|
||||||
result.onResult(() -> {
|
|
||||||
baseBean.writeLog("执行成功回调");
|
|
||||||
}, (reason) -> {
|
|
||||||
baseBean.writeLog("执行失败回调,原因:" + reason);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 等待直到状态不再是PENDING
|
|
||||||
TaskResult taskResult = result.waitResult();
|
|
||||||
baseBean.writeLog(taskResult);
|
|
||||||
if (taskResult == TaskResult.SUCCEED) {
|
|
||||||
baseBean.writeLog("执行成功");
|
|
||||||
} else {
|
|
||||||
errorMsg = "执行失败,原因:" + result.getFailReason();
|
|
||||||
baseBean.writeLog("执行失败,原因:" + result.getFailReason());
|
|
||||||
}
|
|
||||||
if (StringUtils.isBlank(errorMsg)) {
|
|
||||||
rs.executeUpdate("update " + tableName + " set qdfbzt = ? where id = ?", 5, billId);
|
|
||||||
} else {
|
|
||||||
resultMap.put("errmsg", errorMsg);
|
|
||||||
resultMap.put("flag", "false");
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
resultMap.put("errmsg", "未配置下架插件,第三方平台请至各招聘网站自行下架");
|
if (CollectionUtils.isNotEmpty(platformList)) {
|
||||||
|
resultMap.put("errmsg", "该职位第三方渠道仍有发布中状态,请先执行下架操作");
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新招聘状态为招聘结束
|
// 更新招聘状态为招聘结束
|
||||||
rs.executeUpdate("update " + tableName + " set zpzt = ? where id = ?", 1, billId);
|
rs.executeUpdate("update " + tableName + " set zpzt = ? where id = ?", 1, billId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue