generated from dxfeng/secondev-chapanda-feishu
parent
f08cc45bca
commit
ee5e58186d
|
|
@ -1,13 +1,17 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.conn.RecruitRecordSet;
|
||||
import com.engine.recruit.constant.RecruitConstant;
|
||||
import com.engine.recruit.service.RecruitInterviewService;
|
||||
import com.weaver.formmodel.data.model.Formfield;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -24,23 +28,29 @@ public class RecruitInterviewServiceImpl extends Service implements RecruitInter
|
|||
returnMap.put("message", "反馈失败");
|
||||
|
||||
if (StringUtils.isBlank(status) || StringUtils.isBlank(uuid)) {
|
||||
returnMap.put("description", "反馈失败,请直接点击邮件链接地址访问,请勿修改链接内容。");
|
||||
returnMap.put("description", "反馈失败,请直接点击邮件/短信中的链接地址访问,请勿修改链接内容。");
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select sfcj from uf_jcl_ms where modeuuid = ? ", uuid);
|
||||
rs.executeQuery("select * from uf_jcl_ms where modeuuid = ? ", uuid);
|
||||
Map<String, Object> mainDataMap = RecruitRecordSet.getSingleRecordMap(rs);
|
||||
String sfcj = "";
|
||||
if (rs.next()) {
|
||||
sfcj = rs.getString("sfcj");
|
||||
if (!mainDataMap.isEmpty()) {
|
||||
sfcj = Util.null2String(mainDataMap.get("sfcj"));
|
||||
} else {
|
||||
returnMap.put("description", "反馈失败,面试信息有误,请联系相应HR确认");
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
|
||||
if (StringUtils.isNotBlank(sfcj)) {
|
||||
returnMap.put("description", "您已成功反馈面试,请勿重复反馈。");
|
||||
return returnMap;
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
|
||||
List<Formfield> fieldList = RecruitModeUtil.getFieldList("uf_jcl_ms");
|
||||
Map<String, Formfield> fieldMap = fieldList.stream().collect(Collectors.toMap(Formfield::getFieldname, item -> item, (k1, k2) -> k1));
|
||||
// 参加
|
||||
if ("0".equals(status)) {
|
||||
returnMap.put("type", "success");
|
||||
|
|
@ -48,12 +58,30 @@ public class RecruitInterviewServiceImpl extends Service implements RecruitInter
|
|||
returnMap.put("description", "您已接受面试,感谢您的应聘,请按期准备面试,如有问题可以联系相应HR");
|
||||
|
||||
rs.executeUpdate("update uf_jcl_ms set sfcj = ? , zt = 0 where modeuuid = ? ", 0, uuid);
|
||||
|
||||
|
||||
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);
|
||||
} 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);
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
return returnMap;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ public class RecruitMessageUtils {
|
|||
}
|
||||
|
||||
public static boolean sendSMS(String receiver, String content) {
|
||||
// 去除短信内容中的html样式
|
||||
content = content.replaceAll("<[^>]*>| ", "").replaceAll("\\n+", "\n");
|
||||
return MessageUtil.sendSMS(receiver, content);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,15 +41,15 @@ public class InterviewMsgUtil {
|
|||
String msgContent = RecruitModeUtil.getReplaceContent(yjnr, fieldMapList, mainDataMap);
|
||||
String yx = Util.null2String(mainDataMap.get("dzyx"));
|
||||
String sjh = Util.null2String(mainDataMap.get("sjhm"));
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select modeuuid from uf_jcl_ms where id = ? ", billId);
|
||||
String uuid = "";
|
||||
if (rs.next()) {
|
||||
uuid = rs.getString("modeuuid");
|
||||
}
|
||||
String confirmUrl = RecruitConstant.INTERVIEW_FEEDBACK_URL + "?uuid=" + uuid;
|
||||
if (sendEmail) {
|
||||
if (needFeedback) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select modeuuid from uf_jcl_ms where id = ? ", billId);
|
||||
String uuid = "";
|
||||
if (rs.next()) {
|
||||
uuid = rs.getString("modeuuid");
|
||||
}
|
||||
String confirmUrl = RecruitConstant.INTERVIEW_FEEDBACK_URL + "?uuid=" + uuid;
|
||||
String emailContent = "<div style=\"border:3px solid silver;width:635px;height:55px;line-height:55px;font-family:'microsoft Yahei';font-size:18px;font-weight:bold;color:#333;padding-left:10px\">请您答复是否参加此次邀请? <a href=\"" + confirmUrl + "&status=0\" style=\"text-decoration:underline;color:#0000cc;margin-right:10px\">参加</a> <a href=\"" + confirmUrl + "&status=1\" style=\"text-decoration:underline;color:#0000cc;\">不参加</a></div>";
|
||||
// 邮件内容拼接确认信息
|
||||
emailContent = msgContent + emailContent;
|
||||
|
|
@ -59,8 +59,13 @@ public class InterviewMsgUtil {
|
|||
}
|
||||
}
|
||||
if (sendSms) {
|
||||
// TODO 参加反馈
|
||||
RecruitMessageUtils.sendSMS(sjh, msgContent);
|
||||
if (needFeedback) {
|
||||
String messageContent = "请您答复是否参加此次邀请?" + confirmUrl;
|
||||
messageContent = msgContent + messageContent;
|
||||
RecruitMessageUtils.sendSMS(sjh, messageContent);
|
||||
} else {
|
||||
RecruitMessageUtils.sendSMS(sjh, msgContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue