面试归档接口动作

美之高
dxfeng 9 months ago
parent f2798f8c1f
commit 40660cc55b

@ -80,4 +80,24 @@ public class RecruitCommon {
}
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;
}
}

@ -26,8 +26,8 @@ public class RecruitRecordSet {
* @param rs RecordSet
* @return
*/
public static Map<String, Object> getSingleRecordMap(RecordSet rs) {
Map<String, Object> dataMap = new IgnoreCaseHashMap<>();
public static IgnoreCaseHashMap<String, Object> getSingleRecordMap(RecordSet rs) {
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
if (rs.next()) {
String[] columnNames = rs.getColumnName();
for (String columnName : columnNames) {

@ -0,0 +1,138 @@
package weaver.interfaces.mzg.action.interview;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.conn.RecruitRecordSet;
import com.engine.mzg.exception.CustomizeRunTimeException;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.MainTableInfo;
import weaver.soa.workflow.request.Property;
import weaver.soa.workflow.request.RequestInfo;
import java.util.UUID;
/**
* 1
* <p>
* 2offer
*
* @author:dxfeng
* @createTime: 2024/09/14
* @version: 1.0
*/
public class InterviewCompletedAction implements Action {
@Override
public String execute(RequestInfo requestInfo) {
RecordSet rs = new RecordSet();
try {
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
int billId = requestInfo.getRequestManager().getBillid();
String billTableName = requestInfo.getRequestManager().getBillTableName();
int formId = requestInfo.getRequestManager().getFormid();
User user = requestInfo.getRequestManager().getUser();
int requestId = requestInfo.getRequestManager().getRequestid();
String msId = "";
rs.executeQuery("select id from uf_recruit_ms where mslcid = ?", requestId);
if (rs.next()) {
msId = rs.getString("id");
}
if (StringUtils.isBlank(msId)) {
throw new CustomizeRunTimeException("未获取到面试数据,请联系管理员");
}
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
Property[] propertyArray = mainTableInfo.getProperty();
for (Property property : propertyArray) {
mainDataMap.put(property.getName(), property.getValue());
}
String sfxybd = Util.null2String(mainDataMap.get("sfxybd"));
if ("0".equals(sfxybd)) {
// 创建背调
String tableName = "uf_recruit_bd";
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
String uuid = UUID.randomUUID().toString();
dataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName(tableName);
dataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
RecruitRecordSet.buildModeInsertFields(dataMap, user.getUID());
// 负责人
dataMap.put("fzr", user.getUID());
// 负责人岗位
dataMap.put("fzrgw", user.getJobtitle());
// 负责人部门
dataMap.put("fzrbm", user.getUserDepartment());
// 被背调人
dataMap.put("bbdr", msId);
// 插入数据
RecruitRecordSet.insertData(dataMap, tableName);
RecruitRecordSet.refreshRight(uuid, tableName, formModeId, user.getUID());
} else {
String sqzw = Util.null2String(mainDataMap.get("sqzw"));
if (StringUtils.isBlank(sqzw)) {
throw new CustomizeRunTimeException("请检查面试流程中申请职位字段");
}
rs.executeQuery("select * from uf_recruit_zpxqglb where id = ? ", sqzw);
IgnoreCaseHashMap<String, Object> recordMap = RecruitRecordSet.getSingleRecordMap(rs);
if (recordMap.isEmpty()) {
throw new CustomizeRunTimeException("未获取到招聘职位数据");
}
String xqgw = Util.null2String(recordMap.get("xqgw"));
String gzdd = Util.null2String(recordMap.get("gzdd"));
String qtgzdd = Util.null2String(recordMap.get("qtgzdd"));
int zpxqFormId = RecruitCommon.getModeIdByTableName("uf_recruit_zpxqglb");
String gzddStr = RecruitCommon.getSelectName(String.valueOf(zpxqFormId), "gzdd", gzdd);
if (StringUtils.isNotBlank(qtgzdd)) {
gzddStr = qtgzdd;
}
// 创建offer
String tableName = "uf_recruit_lytzs";
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
String uuid = UUID.randomUUID().toString();
dataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName(tableName);
dataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
RecruitRecordSet.buildModeInsertFields(dataMap, user.getUID());
// 姓名
dataMap.put("xm", msId);
// 岗位
dataMap.put("gw", xqgw);
// 工作地点
dataMap.put("gzdd", gzddStr);
//// 试用期税前
//dataMap.put("syqsq", "");
//// 转正税前
//dataMap.put("zzsq", "");
//// 年限
//dataMap.put("nx", "");
//// 试用期期限
//dataMap.put("syqqx", "");
//// 工作时间
//dataMap.put("gzsj", "");
//// 报道日期
//dataMap.put("bdrq", "");
// 插入数据
RecruitRecordSet.insertData(dataMap, tableName);
RecruitRecordSet.refreshRight(uuid, tableName, formModeId, user.getUID());
}
return SUCCESS;
} catch (Exception e) {
rs.writeLog("InterviewCompletedAction error: ", e);
requestInfo.getRequestManager().setMessagecontent(e.getMessage());
return FAILURE_AND_CONTINUE;
}
}
}
Loading…
Cancel
Save