千里聆职位发布、职位下架

This commit is contained in:
dxfeng 2023-10-10 09:28:13 +08:00
parent 82d4edb3e0
commit 0f69915b09
2 changed files with 22 additions and 10 deletions

View File

@ -2,6 +2,7 @@ package weaver.formmode.recruit.modeexpand.position;
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
import com.weaver.rpa.sdk.clients.core.ERPASDKClients;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.BaseBean;
@ -36,7 +37,14 @@ public class ClosePositionModeExpand extends AbstractModeExpandJavaCodeNew {
RecordSet rs = new RecordSet();
rs.executeQuery("select qllgwid from " + tableName + " where id = ?", billId);
if (rs.next()) {
long jobId = Long.parseLong(rs.getString("qllgwid"));
String qllgwid = rs.getString("qllgwid");
if (StringUtils.isBlank(qllgwid)) {
new BaseBean().writeLog("billId=" + billId + ",当前职位暂未发布,无需进行下架操作");
result.put("errmsg", "当前职位暂未发布,无需进行下架操作");
result.put("flag", "false");
return result;
}
long jobId = Long.parseLong(qllgwid);
ERPAResumeSDKClient client = ERPASDKClients.getResumeSDKClient();
client.start();
String userId = String.valueOf(user.getUID());

View File

@ -3,6 +3,7 @@ package weaver.formmode.recruit.modeexpand.position;
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.core.ERPASDKClients;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.recruit.modeexpand.util.RecruitPositionUtil;
@ -28,7 +29,7 @@ public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew {
public Map<String, String> doModeExpand(Map<String, Object> param) {
String tableName = "uf_jcl_zp_zpzw";
Map<String, String> result = new HashMap<>(16);
Map<String, String> resultMap = new HashMap<>(16);
try {
User user = (User) param.get("user");
int billId;
@ -42,7 +43,10 @@ public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew {
RecordSet rs = new RecordSet();
rs.executeQuery("select qllgwid from " + tableName + " where id = ?", billId);
if (rs.next()) {
jobId = Long.parseLong(rs.getString("qllgwid"));
String qllgwid = rs.getString("qllgwid");
if (StringUtils.isNotBlank(qllgwid)) {
jobId = Long.parseLong(qllgwid);
}
}
ERPAResumeSDKClient client = ERPASDKClients.getResumeSDKClient();
Map<String, Object> map = new HashMap<>(16);
@ -55,11 +59,11 @@ public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew {
// 发布千里聆职位
if (!RecruitPositionUtil.checkAvailable(client)) {
new BaseBean().writeLog("千里聆未开通简历应用。");
result.put("errmsg", "千里聆未开通简历应用。");
result.put("flag", "false");
resultMap.put("errmsg", "千里聆未开通简历应用。");
resultMap.put("flag", "false");
return resultMap;
}
String userId = String.valueOf(user.getUID());
// TODO 测试数据 userId = "26";
// 未创建职位则先创建职位
if (jobId == -1) {
// 创建千里聆职位
@ -69,7 +73,7 @@ public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew {
}
// 发布职位
client.setRobotAuthority(userId,userId,false);
client.setRobotAuthority(userId, userId, false);
client.start();
List<Integer> platformIds = resumeJobDto.getPlatformIds();
for (Integer platformId : platformIds) {
@ -81,10 +85,10 @@ public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew {
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", e.getMessage());
result.put("flag", "false");
resultMap.put("errmsg", e.getMessage());
resultMap.put("flag", "false");
}
return result;
return resultMap;
}
}