|
|
|
@ -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>
|
|
|
|
|
* 2、不需要背调、生成offer台账数据
|
|
|
|
|
*
|
|
|
|
|
* @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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|