package com.engine.mzg.conn; import com.engine.mzg.util.RecruitUtil; import com.weaver.formmodel.data.model.Formfield; import org.apache.commons.lang3.StringUtils; import weaver.conn.RecordSet; import java.util.Map; /** * @author:dxfeng * @createTime: 2024/09/05 * @version: 1.0 */ public class RecruitCommon { /** * 获取配置 * * @param key * @return */ public static String getSettingValue(String key) { RecordSet rs = new RecordSet(); rs.executeQuery("select pzz from uf_recruit_setting where pzx = ? ", key); if (rs.next()) { return rs.getString("pzz"); } return ""; } /** * 获取配置 * * @param key * @return */ public static String getSettingValue(String key, Map fieldMap, Map paramsData) { RecordSet rs = new RecordSet(); rs.executeQuery("select pzz from uf_recruit_setting where pzx = ? ", key); String content= ""; if (rs.next()) { content = rs.getString("pzz"); } if(StringUtils.isNotBlank(content)){ content = RecruitUtil.getMsgReplaceStr(content, fieldMap, paramsData); } return content; } /** * 根据表名,获取表单ID * * @param modeTable * @return */ public static int getFormIdByTableName(String modeTable) { int formId = -1; RecordSet rs = new RecordSet(); rs.executeQuery("select id from workflow_bill where tablename = ? ", modeTable); if (rs.next()) { formId = rs.getInt("id"); } return formId; } /** * 根据建模表名,获取建模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 = ? ) and isdelete = 0 order by id", modeTable); if (rs.next()) { formModeId = rs.getInt("id"); } return formModeId; } }