2023-12-11 13:28:27 +08:00
|
|
|
|
package com.engine.recruit.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.engine.core.impl.Service;
|
2024-09-27 18:55:19 +08:00
|
|
|
|
import com.engine.recruit.conn.ApplicantCommonInfo;
|
2024-03-07 13:40:15 +08:00
|
|
|
|
import com.engine.recruit.conn.RecruitRecordSet;
|
|
|
|
|
|
import com.engine.recruit.constant.RecruitConstant;
|
2024-09-27 18:55:19 +08:00
|
|
|
|
import com.engine.recruit.exception.CustomizeRunTimeException;
|
2023-12-11 13:28:27 +08:00
|
|
|
|
import com.engine.recruit.service.RecruitInterviewService;
|
2024-03-07 13:40:15 +08:00
|
|
|
|
import com.weaver.formmodel.data.model.Formfield;
|
2023-12-11 13:28:27 +08:00
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
import weaver.conn.RecordSet;
|
2024-03-07 13:40:15 +08:00
|
|
|
|
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
2023-12-11 13:28:27 +08:00
|
|
|
|
import weaver.general.Util;
|
2024-09-27 18:55:19 +08:00
|
|
|
|
import weaver.hrm.resource.ResourceComInfo;
|
2023-12-11 13:28:27 +08:00
|
|
|
|
|
2024-03-07 13:40:15 +08:00
|
|
|
|
import java.util.*;
|
|
|
|
|
|
import java.util.stream.Collectors;
|
2023-12-11 13:28:27 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @author:dxfeng
|
|
|
|
|
|
* @createTime: 2023/11/28
|
|
|
|
|
|
* @version: 1.0
|
|
|
|
|
|
*/
|
|
|
|
|
|
public class RecruitInterviewServiceImpl extends Service implements RecruitInterviewService {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> updateInterviewStatus(Map<String, Object> param) {
|
|
|
|
|
|
Map<String, Object> returnMap = new HashMap<>(3);
|
|
|
|
|
|
String status = Util.null2String(param.get("status"));
|
|
|
|
|
|
String uuid = Util.null2String(param.get("uuid"));
|
|
|
|
|
|
returnMap.put("type", "error");
|
|
|
|
|
|
returnMap.put("message", "反馈失败");
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(status) || StringUtils.isBlank(uuid)) {
|
2024-03-07 13:40:15 +08:00
|
|
|
|
returnMap.put("description", "反馈失败,请直接点击邮件/短信中的链接地址访问,请勿修改链接内容。");
|
2023-12-11 13:28:27 +08:00
|
|
|
|
return returnMap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
2024-03-07 13:40:15 +08:00
|
|
|
|
rs.executeQuery("select * from uf_jcl_ms where modeuuid = ? ", uuid);
|
|
|
|
|
|
Map<String, Object> mainDataMap = RecruitRecordSet.getSingleRecordMap(rs);
|
2023-12-11 13:28:27 +08:00
|
|
|
|
String sfcj = "";
|
2025-01-20 09:31:57 +08:00
|
|
|
|
String id = "";
|
2024-03-07 13:40:15 +08:00
|
|
|
|
if (!mainDataMap.isEmpty()) {
|
|
|
|
|
|
sfcj = Util.null2String(mainDataMap.get("sfcj"));
|
2025-01-20 09:31:57 +08:00
|
|
|
|
id = Util.null2String(mainDataMap.get("id"));
|
2024-03-07 13:40:15 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
returnMap.put("description", "反馈失败,面试信息有误,请联系相应HR确认");
|
|
|
|
|
|
return returnMap;
|
2023-12-11 13:28:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-03-07 13:40:15 +08:00
|
|
|
|
|
2023-12-11 13:28:27 +08:00
|
|
|
|
if (StringUtils.isNotBlank(sfcj)) {
|
|
|
|
|
|
returnMap.put("description", "您已成功反馈面试,请勿重复反馈。");
|
2024-03-07 13:40:15 +08:00
|
|
|
|
return returnMap;
|
2023-12-11 13:28:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-20 09:31:57 +08:00
|
|
|
|
int formId = ApplicantCommonInfo.getFormIdByTableName("uf_jcl_ms");
|
|
|
|
|
|
int modeId = ApplicantCommonInfo.getModeIdByTableName("uf_jcl_ms");
|
|
|
|
|
|
|
|
|
|
|
|
List<Formfield> fieldList = RecruitModeUtil.getFieldList(formId);
|
2024-03-07 13:40:15 +08:00
|
|
|
|
Map<String, Formfield> fieldMap = fieldList.stream().collect(Collectors.toMap(Formfield::getFieldname, item -> item, (k1, k2) -> k1));
|
2023-12-11 13:28:27 +08:00
|
|
|
|
// 参加
|
|
|
|
|
|
if ("0".equals(status)) {
|
|
|
|
|
|
returnMap.put("type", "success");
|
|
|
|
|
|
returnMap.put("message", "已确认参加面试");
|
|
|
|
|
|
returnMap.put("description", "您已接受面试,感谢您的应聘,请按期准备面试,如有问题可以联系相应HR");
|
|
|
|
|
|
|
|
|
|
|
|
rs.executeUpdate("update uf_jcl_ms set sfcj = ? , zt = 0 where modeuuid = ? ", 0, uuid);
|
2024-03-07 13:40:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String msgContent = "应聘者:$ypz$,确认参加面试,请知悉。<br/>" +
|
|
|
|
|
|
"面试时间:$msrq$;面试官:$msg$";
|
2025-01-20 09:31:57 +08:00
|
|
|
|
sendMsg(rs, mainDataMap, id, formId, modeId, fieldMap, msgContent);
|
2023-12-11 13:28:27 +08:00
|
|
|
|
} else if ("1".equals(status)) {
|
|
|
|
|
|
returnMap.put("type", "info");
|
|
|
|
|
|
returnMap.put("message", "已取消参加面试");
|
|
|
|
|
|
returnMap.put("description", "您已取消参加面试,感谢您的应聘。希望您能够找到真正适合自己的工作。");
|
|
|
|
|
|
|
|
|
|
|
|
rs.executeUpdate("update uf_jcl_ms set sfcj = ? , qxyy = 2 , zt = 4 where modeuuid = ? ", 1, uuid);
|
2024-03-07 13:40:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String msgContent = "应聘者:$ypz$,反馈不参加面试,面试已取消,请知悉。<br/>" +
|
|
|
|
|
|
"面试时间:$msrq$;面试官:$msg$";
|
2025-01-20 09:31:57 +08:00
|
|
|
|
sendMsg(rs, mainDataMap, id, formId, modeId, fieldMap, msgContent);
|
2023-12-11 13:28:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return returnMap;
|
|
|
|
|
|
}
|
2024-09-27 18:55:19 +08:00
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getInterviewEvaluateStatus(Map<String, Object> param) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
String id = Util.null2String(param.get("id"));
|
|
|
|
|
|
String msg = Util.null2String(param.get("msg"));
|
|
|
|
|
|
if (StringUtils.isBlank(msg)) {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
|
int formId = ApplicantCommonInfo.getFormIdByTableName("uf_jcl_mspjfk");
|
|
|
|
|
|
String[] split = msg.split(",");
|
|
|
|
|
|
List<String> spanList = new ArrayList<>();
|
|
|
|
|
|
ResourceComInfo resourceComInfo = new ResourceComInfo();
|
|
|
|
|
|
for (String s : split) {
|
2024-10-14 18:47:42 +08:00
|
|
|
|
rs.executeQuery("select jg,zt from uf_jcl_mspjfk where msid = ? and msg = ?", id, s);
|
|
|
|
|
|
String jg = "";
|
|
|
|
|
|
String zt = "";
|
2024-09-27 18:55:19 +08:00
|
|
|
|
if (rs.next()) {
|
2024-10-14 18:47:42 +08:00
|
|
|
|
jg = Util.null2String(rs.getString("jg"));
|
|
|
|
|
|
zt = Util.null2String(rs.getString("zt"));
|
2024-09-27 18:55:19 +08:00
|
|
|
|
}
|
2024-10-14 18:47:42 +08:00
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(jg)) {
|
|
|
|
|
|
jg = ApplicantCommonInfo.getSelectName(String.valueOf(formId), "jg", jg);
|
|
|
|
|
|
spanList.add("<a href=javaScript:openhrm(" + s + ") onclick=pointerXY(event)>" + resourceComInfo.getLastname(s) + "(" + jg + ")</a>");
|
2024-09-27 18:55:19 +08:00
|
|
|
|
} else {
|
2024-10-14 18:47:42 +08:00
|
|
|
|
String span = "<a href=javaScript:openhrm(" + s + ") onclick=pointerXY(event)>" + resourceComInfo.getLastname(s);
|
|
|
|
|
|
if (StringUtils.isNotBlank(zt)) {
|
|
|
|
|
|
zt = ApplicantCommonInfo.getSelectName(String.valueOf(formId), "zt", zt);
|
|
|
|
|
|
span += "(" + zt + ")";
|
|
|
|
|
|
}
|
|
|
|
|
|
span += "</a>";
|
|
|
|
|
|
spanList.add(span);
|
2024-09-27 18:55:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return StringUtils.join(spanList, "<br/>");
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
throw new CustomizeRunTimeException(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-01-20 09:31:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 发送消息提醒
|
|
|
|
|
|
* @param rs
|
|
|
|
|
|
* @param mainDataMap
|
|
|
|
|
|
* @param id
|
|
|
|
|
|
* @param formId
|
|
|
|
|
|
* @param modeId
|
|
|
|
|
|
* @param fieldMap
|
|
|
|
|
|
* @param msgContent
|
|
|
|
|
|
*/
|
|
|
|
|
|
private void sendMsg(RecordSet rs, Map<String, Object> mainDataMap, String id, int formId, int modeId, Map<String, Formfield> fieldMap, String msgContent) {
|
|
|
|
|
|
msgContent = RecruitModeUtil.getMsgReplaceStr(msgContent, fieldMap, mainDataMap);
|
|
|
|
|
|
String msg = Util.null2String(mainDataMap.get("msg"));
|
|
|
|
|
|
Set<String> userIdSet = new HashSet<>();
|
|
|
|
|
|
userIdSet.add(Util.null2String(mainDataMap.get("modedatacreater")));
|
|
|
|
|
|
userIdSet.addAll(Arrays.asList(msg.split(",")));
|
|
|
|
|
|
String showCardLink = RecruitModeUtil.getShowCardLink(String.valueOf(modeId), String.valueOf(formId), id);
|
|
|
|
|
|
rs.writeLog("showCardLink=="+showCardLink);
|
|
|
|
|
|
RecruitModeUtil.messagePush(RecruitConstant.INTERVIEW_MESSAGE_TYPE, "面试反馈通知", msgContent, userIdSet, 1, showCardLink, "");
|
|
|
|
|
|
}
|
2023-12-11 13:28:27 +08:00
|
|
|
|
}
|