diff --git a/src/weaver/formmode/recruit/modeexpand/position/ClosePositionModeExpand.java b/src/weaver/formmode/recruit/modeexpand/position/ClosePositionModeExpand.java index 64660ad..cd0baf2 100644 --- a/src/weaver/formmode/recruit/modeexpand/position/ClosePositionModeExpand.java +++ b/src/weaver/formmode/recruit/modeexpand/position/ClosePositionModeExpand.java @@ -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()); diff --git a/src/weaver/formmode/recruit/modeexpand/position/ReleasePositionModeExpand.java b/src/weaver/formmode/recruit/modeexpand/position/ReleasePositionModeExpand.java index d370b42..a574f76 100644 --- a/src/weaver/formmode/recruit/modeexpand/position/ReleasePositionModeExpand.java +++ b/src/weaver/formmode/recruit/modeexpand/position/ReleasePositionModeExpand.java @@ -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 doModeExpand(Map param) { String tableName = "uf_jcl_zp_zpzw"; - Map result = new HashMap<>(16); + Map 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 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 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; } } \ No newline at end of file