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 = "";
|
2024-03-07 13:40:15 +08:00
|
|
|
|
if (!mainDataMap.isEmpty()) {
|
|
|
|
|
|
sfcj = Util.null2String(mainDataMap.get("sfcj"));
|
|
|
|
|
|
} 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
|
|
|
|
}
|
|
|
|
|
|
|
2024-03-07 13:40:15 +08:00
|
|
|
|
List<Formfield> fieldList = RecruitModeUtil.getFieldList("uf_jcl_ms");
|
|
|
|
|
|
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$";
|
|
|
|
|
|
msgContent = RecruitModeUtil.getMsgReplaceStr(msgContent, fieldMap, mainDataMap);
|
|
|
|
|
|
Set<String> userIdSet = new HashSet<>();
|
|
|
|
|
|
userIdSet.add(Util.null2String(mainDataMap.get("modedatacreater")));
|
|
|
|
|
|
RecruitModeUtil.messagePush(RecruitConstant.INTERVIEW_MESSAGE_TYPE, "面试反馈通知", msgContent, userIdSet, 1);
|
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$";
|
|
|
|
|
|
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(",")));
|
|
|
|
|
|
RecruitModeUtil.messagePush(RecruitConstant.INTERVIEW_MESSAGE_TYPE, "面试反馈通知", msgContent, userIdSet, 1);
|
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) {
|
|
|
|
|
|
rs.executeQuery("select fkzt from uf_jcl_mspjfk where msid = ? and msg = ?", id, s);
|
|
|
|
|
|
String fkzt = "";
|
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
|
fkzt = Util.null2String(rs.getString("fkzt"));
|
|
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(fkzt)) {
|
2024-10-12 14:30:27 +08:00
|
|
|
|
fkzt = ApplicantCommonInfo.getSelectName(String.valueOf(formId), "fkzt", fkzt);
|
2024-09-27 18:55:19 +08:00
|
|
|
|
spanList.add("<a href=javaScript:openhrm(" + s + ") onclick=pointerXY(event)>" + resourceComInfo.getLastname(s) + "(" + fkzt + ")</a>");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
spanList.add("<a href=javaScript:openhrm(" + s + ") onclick=pointerXY(event)>" + resourceComInfo.getLastname(s) + "</a>");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return StringUtils.join(spanList, "<br/>");
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
throw new CustomizeRunTimeException(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-11 13:28:27 +08:00
|
|
|
|
}
|