|
|
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<String, Formfield> fieldMap, Map<String, Object> 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;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取表单下拉框展示文本
|
|
|
*
|
|
|
* @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;
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|