package com.engine.recruit.conn; import org.apache.commons.lang3.StringUtils; import weaver.conn.RecordSet; import weaver.formmode.setup.ModeRightInfo; import weaver.general.Util; import java.util.ArrayList; import java.util.List; /** * @author:dxfeng * @createTime: 2023/09/27 * @version: 1.0 */ public class ApplicantCommonInfo { /** * 获取应聘者姓名 * * @param applicantId 应聘者ID * @return 应聘者姓名 */ public static String getApplicantName(String applicantId) { RecordSet rs = new RecordSet(); rs.executeQuery("select xm from uf_jcl_yppc where id = ?", applicantId); if (rs.next()) { return rs.getString("xm"); } return ""; } /** * 获取应聘职位名称 * * @param positionId 职位ID * @return 职位名称 */ public static String getApplicantPosition(String positionId) { RecordSet rs = new RecordSet(); rs.executeQuery("select zpzwmc from uf_jcl_zp_zpzw where id = ?", positionId); if (rs.next()) { return rs.getString("zpzwmc"); } return ""; } /** * 获取表单下拉框展示文本 * * @param formId 表单ID * @param fieldName 字段明湖曾 * @param value 下拉框值 * @return */ public static String getSelectName(String formId, String fieldName, String value) { String cancelReason = ""; RecordSet rs = new RecordSet(); rs.executeQuery("select selectname from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? ) and selectvalue = ?", formId, fieldName, value); if (rs.next()) { cancelReason = rs.getString("selectname"); } return cancelReason; } /** * 获取招聘通用浏览按钮展示内容 * * @param id 浏览按钮ID * @return 浏览按钮展示文本 */ public static String getRecruitCommonBrowserValue(String id) { if (StringUtils.isBlank(id)) { return ""; } List value = new ArrayList<>(); RecordSet rs = new RecordSet(); String[] split = id.split(","); for (String s : split) { rs.executeQuery("select xxnr from uf_sjzd where id = ?", id); if (rs.next()) { value.add(rs.getString("xxnr")); } } return StringUtils.join(value, ","); } /** * 根据建模表名,获取建模ID * * @param modeTable * @return */ public static int getModeIdByTableName(String modeTable) { int formModeId = -1; RecordSet rs = new RecordSet(); rs.executeQuery("select id from modeinfo where formid =( select id from workflow_bill where tablename = ? )", modeTable); if (rs.next()) { formModeId = rs.getInt("id"); } return formModeId; } /** * 建模表数据权限重构 * * @param rs * @param uuid * @param modeTable * @param formModeId */ public static int refreshRight(RecordSet rs, String uuid, String modeTable, int formModeId) { rs.executeQuery("select id from " + modeTable + " where modeuuid='" + uuid + "'"); if (rs.next()) { //建模数据的id int bid = Util.getIntValue(rs.getString("id")); ModeRightInfo modeRightInfo = new ModeRightInfo(); modeRightInfo.setNewRight(true); //新建的时候添加共享 modeRightInfo.editModeDataShare(1, formModeId, bid); return bid; } return -1; } }