|
|
|
@ -0,0 +1,123 @@
|
|
|
|
|
package weaver.formmode.mzg.modeexpand.back;
|
|
|
|
|
|
|
|
|
|
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.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
import weaver.soa.workflow.request.MainTableInfo;
|
|
|
|
|
import weaver.soa.workflow.request.Property;
|
|
|
|
|
import weaver.soa.workflow.request.RequestInfo;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 背调结果为“通过”,生成offer台账数据
|
|
|
|
|
* <p>
|
|
|
|
|
* 背调结果为“不通过”,招聘终止(逻辑同面试招聘终止)
|
|
|
|
|
*
|
|
|
|
|
* @author:dxfeng
|
|
|
|
|
* @createTime: 2024/09/19
|
|
|
|
|
* @version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
public class FeedbackExpand extends AbstractModeExpandJavaCodeNew {
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
|
|
|
|
Map<String, String> result = new HashMap<>();
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
try {
|
|
|
|
|
String recruitType = Util.null2String(param.get("recruitType"));
|
|
|
|
|
if (!"feedback".equals(recruitType)) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
|
|
|
|
|
if (requestInfo != null) {
|
|
|
|
|
User user = (User) param.get("user");
|
|
|
|
|
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
|
|
|
|
|
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
|
|
|
|
Property[] properties = mainTableInfo.getProperty();
|
|
|
|
|
for (Property property : properties) {
|
|
|
|
|
mainDataMap.put(property.getName(), property.getValue());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String bbdr = Util.null2String(mainDataMap.get("bbdr"));
|
|
|
|
|
String bdjg = Util.null2String(mainDataMap.get("bdjg"));
|
|
|
|
|
if (StringUtils.isBlank(bdjg)) {
|
|
|
|
|
result.put("errmsg", "背调结果为空");
|
|
|
|
|
result.put("flag", "false");
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
rs.executeQuery("select id,mslcid ,sqzw from uf_recruit_ms where id = ?", bbdr);
|
|
|
|
|
String msId = "";
|
|
|
|
|
String sqzw = "";
|
|
|
|
|
String mslcid = "";
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
msId = rs.getString("id");
|
|
|
|
|
sqzw = rs.getString("sqzw");
|
|
|
|
|
mslcid = rs.getString("mslcid");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isAnyBlank(msId, sqzw, mslcid)) {
|
|
|
|
|
throw new CustomizeRunTimeException("面试数据异常,请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ("0".equals(bdjg)) {
|
|
|
|
|
// 背调结果为“通过”,生成offer台账数据
|
|
|
|
|
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", bbdr);
|
|
|
|
|
// 岗位
|
|
|
|
|
dataMap.put("gw", xqgw);
|
|
|
|
|
// 工作地点
|
|
|
|
|
dataMap.put("gzdd", gzddStr);
|
|
|
|
|
|
|
|
|
|
// 插入数据
|
|
|
|
|
RecruitRecordSet.insertData(dataMap, tableName);
|
|
|
|
|
RecruitRecordSet.refreshRight(uuid, tableName, formModeId, user.getUID());
|
|
|
|
|
} else {
|
|
|
|
|
// 背调结果为“不通过”,招聘终止(逻辑同面试招聘终止)
|
|
|
|
|
// 更新流程、建模状态
|
|
|
|
|
rs.executeUpdate("update uf_recruit_ms set mszt = ? where id = ?", "2", msId);
|
|
|
|
|
// 获取流程表名
|
|
|
|
|
String flowTableInterview = RecruitCommon.getSettingValue("FLOW_TABLE_INTERVIEW");
|
|
|
|
|
rs.executeUpdate("update " + flowTableInterview + " set mszt = ? where requestId = ? ", "2", mslcid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
rs.writeLog(e);
|
|
|
|
|
result.put("errmsg", e.getMessage());
|
|
|
|
|
result.put("flag", "false");
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|