generated from dxfeng/secondev-chapanda-feishu
parent
ffe8dd9770
commit
fc87fa55b2
|
|
@ -103,6 +103,28 @@ public class RecruitRecordSet {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据
|
||||
*
|
||||
* @param dataMap
|
||||
* @param tableName
|
||||
* @param whereSql
|
||||
*/
|
||||
public static void updateData(Map<String, Object> dataMap, String tableName, String whereSql) {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<Object> dataList = new ArrayList<>();
|
||||
dataMap.forEach((key, value) -> {
|
||||
fieldList.add(key + " = ? ");
|
||||
dataList.add(value);
|
||||
});
|
||||
String updateSql = "update " + tableName + " set " + StringUtils.join(fieldList, ",") + whereSql;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate(updateSql, dataList);
|
||||
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
|
||||
throw new CustomizeRunTimeException(rs.getExceptionMsg());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ public class BatchAddInterviewResultModeExpand extends AbstractModeExpandJavaCod
|
|||
modeRightInfo.editModeDataShare(user.getUID(), formModeId, bid);
|
||||
getApplicantsInfo(msgBuilder, Util.null2String(detailDataMap.get("ypz")), Util.null2String(detailDataMap.get("ypzw")));
|
||||
}
|
||||
// 创建面试评价反馈数据
|
||||
InterviewEvaluate.createEvaluate(detailDataMap, formModeId, user);
|
||||
|
||||
// 发送邮件
|
||||
String msgContent = RecruitModeUtil.getReplaceContent(yjnr, fieldMapList, detailDataMap);
|
||||
|
|
@ -145,7 +147,7 @@ public class BatchAddInterviewResultModeExpand extends AbstractModeExpandJavaCod
|
|||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
result.put("errmsg", "自定义出错信息");
|
||||
result.put("errmsg", e.getMessage());
|
||||
result.put("flag", "false");
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
*/
|
||||
private String title;
|
||||
|
||||
private final BaseBean baseBean = new BaseBean();
|
||||
|
||||
@Override
|
||||
public Map<String, String> doModeExpand(Map<String, Object> params) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
|
|
@ -63,6 +65,8 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
}
|
||||
InterviewOperateTypeEnum operateTypeEnum = InterviewOperateTypeEnum.getOperateType(operateType);
|
||||
if (operateTypeEnum == InterviewOperateTypeEnum.ARRANGE) {
|
||||
// 创建面试评价反馈数据
|
||||
InterviewEvaluate.createEvaluate(mainDataMap, billId, user);
|
||||
messageType = RecruitConstant.INTERVIEW_MESSAGE_TYPE;
|
||||
title = RecruitConstant.INTERVIEW_ADD_MESSAGE_TITLE;
|
||||
// 消息提醒
|
||||
|
|
@ -76,8 +80,8 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
result.put("errmsg", "自定义出错信息");
|
||||
baseBean.writeLog(e);
|
||||
result.put("errmsg", e.getMessage());
|
||||
result.put("flag", "false");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,163 @@
|
|||
package weaver.formmode.recruit.modeexpand.interview;
|
||||
|
||||
import com.engine.recruit.conn.ApplicantCommonInfo;
|
||||
import com.engine.recruit.conn.RecruitDataMap;
|
||||
import com.engine.recruit.conn.RecruitRecordSet;
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/09/23
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class InterviewEvaluate {
|
||||
private static final String TABLE_NAME = "uf_jcl_mspjfk";
|
||||
|
||||
/**
|
||||
* 创建面试,针对面试官创建面试反馈记录,同步批次ID,面试ID
|
||||
*
|
||||
* @param mainDataMap
|
||||
* @param msId
|
||||
* @param user
|
||||
*/
|
||||
public static void createEvaluate(Map<String, Object> mainDataMap, int msId, User user) {
|
||||
int formModeId = ApplicantCommonInfo.getModeIdByTableName(TABLE_NAME);
|
||||
if (formModeId < 0) {
|
||||
new BaseBean().writeLog("uf_jcl_mspjfk,未查询到对应模板");
|
||||
}
|
||||
String msg = Util.null2String(mainDataMap.get("msg"));
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
throw new CustomizeRunTimeException("面试官为空,请检查面试官设置");
|
||||
}
|
||||
String[] split = msg.split(",");
|
||||
for (String msgId : split) {
|
||||
insertData(mainDataMap, msId, user, TABLE_NAME, formModeId, msgId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 调整面试,同步调整面试反馈记录,若删除面试官则删除对应的面试反馈记录,若增加面试官,则创建增加面试的面试反馈记录
|
||||
*
|
||||
* @param mainDataMap
|
||||
* @param msId
|
||||
* @param user
|
||||
*/
|
||||
public static void updateEvaluate(Map<String, Object> mainDataMap, int msId, User user) {
|
||||
RecordSet rs = new RecordSet();
|
||||
int formModeId = ApplicantCommonInfo.getModeIdByTableName(TABLE_NAME);
|
||||
if (formModeId < 0) {
|
||||
rs.writeLog("uf_jcl_mspjfk,未查询到对应模板");
|
||||
}
|
||||
String msg = Util.null2String(mainDataMap.get("msg"));
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
throw new CustomizeRunTimeException("面试官为空,请检查面试官设置");
|
||||
}
|
||||
|
||||
// 删除非面试官数据
|
||||
rs.executeUpdate("delete from " + TABLE_NAME + " where msid=" + msId + " and msg not in (" + msg + ")");
|
||||
|
||||
String[] split = msg.split(",");
|
||||
String selectSql = "select id from " + TABLE_NAME + " where msid = ? and msg = ?";
|
||||
for (String msgId : split) {
|
||||
String billId = "";
|
||||
rs.executeQuery(selectSql, msId, msgId);
|
||||
if (rs.next()) {
|
||||
billId = rs.getString("id");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(billId)) {
|
||||
// 新增数据
|
||||
insertData(mainDataMap, msId, user, TABLE_NAME, formModeId, msgId);
|
||||
} else {
|
||||
// 更新数据
|
||||
RecruitDataMap<Object> dataMap = new RecruitDataMap<>();
|
||||
// id
|
||||
dataMap.put("id", billId);
|
||||
// 应聘者
|
||||
dataMap.put("ypz", mainDataMap.get("ypz"));
|
||||
// 应聘职位
|
||||
dataMap.put("ypzw", mainDataMap.get("ypzw"));
|
||||
// 面试方式
|
||||
dataMap.put("msfs", mainDataMap.get("msfs"));
|
||||
// 面试环节
|
||||
dataMap.put("mshj", mainDataMap.get("mshj"));
|
||||
// 面试轮次
|
||||
dataMap.put("msc", mainDataMap.get("msc"));
|
||||
// 面试日期
|
||||
dataMap.put("msrq", mainDataMap.get("msrq"));
|
||||
// 面试地址
|
||||
dataMap.put("msdd", mainDataMap.get("msdd"));
|
||||
|
||||
// 更新数据
|
||||
RecruitRecordSet.updateDataById(dataMap, TABLE_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消面试,同步取消对应的面试反馈记录的面试状态为已取消
|
||||
*
|
||||
* @param msId
|
||||
*/
|
||||
public static void cancelEvaluate(int msId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate("update " + TABLE_NAME + " set fkzt = 3 where msid=" + msId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入面试评价数据
|
||||
*
|
||||
* @param mainDataMap
|
||||
* @param msId
|
||||
* @param user
|
||||
* @param tableName
|
||||
* @param formModeId
|
||||
* @param msgId
|
||||
*/
|
||||
private static void insertData(Map<String, Object> mainDataMap, int msId, User user, String tableName, int formModeId, String msgId) {
|
||||
RecruitDataMap<Object> dataMap = new RecruitDataMap<>();
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
dataMap.put("modeuuid", uuid);
|
||||
dataMap.put("formmodeid", formModeId);
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, user.getUID());
|
||||
// 反馈状态(设置为待反馈)
|
||||
dataMap.put("fkzt", "0");
|
||||
// 批次ID
|
||||
dataMap.put("pcid", mainDataMap.get("pcid"));
|
||||
// 面试ID
|
||||
dataMap.put("msid", msId);
|
||||
// 应聘者
|
||||
dataMap.put("ypz", mainDataMap.get("ypz"));
|
||||
// 应聘职位
|
||||
dataMap.put("ypzw", mainDataMap.get("ypzw"));
|
||||
// 面试方式
|
||||
dataMap.put("msfs", mainDataMap.get("msfs"));
|
||||
// 面试环节
|
||||
dataMap.put("mshj", mainDataMap.get("mshj"));
|
||||
// 面试轮次
|
||||
dataMap.put("msc", mainDataMap.get("msc"));
|
||||
// 面试日期
|
||||
dataMap.put("msrq", mainDataMap.get("msrq"));
|
||||
// 面试地址
|
||||
dataMap.put("msdd", mainDataMap.get("msdd"));
|
||||
// 面试官
|
||||
dataMap.put("msg", msgId);
|
||||
|
||||
// 创建数据
|
||||
RecruitRecordSet.insertData(dataMap, tableName);
|
||||
// 刷新权限
|
||||
RecruitRecordSet.refreshRight(uuid, tableName, formModeId, user.getUID());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -76,10 +76,15 @@ public class UpdateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
messageType = RecruitConstant.INTERVIEW_MESSAGE_TYPE;
|
||||
title = RecruitConstant.INTERVIEW_CANCEL_MESSAGE_TITLE;
|
||||
cancelInterView(params, requestInfo, billId, mainDataMap);
|
||||
// 更新面试评价状态为已取消
|
||||
InterviewEvaluate.cancelEvaluate(billId);
|
||||
// 发送邮件
|
||||
InterviewMsgUtil.sendEmailAndMsg(mainDataMap, billId, false);
|
||||
break;
|
||||
case ADJUSTMENT:
|
||||
// 更新面试评价
|
||||
InterviewEvaluate.updateEvaluate(mainDataMap, billId, user);
|
||||
|
||||
messageType = RecruitConstant.INTERVIEW_MESSAGE_TYPE;
|
||||
title = RecruitConstant.INTERVIEW_ADJUSTMENT_MESSAGE_TITLE;
|
||||
// 发送消息提醒
|
||||
|
|
|
|||
Loading…
Reference in New Issue