generated from dxfeng/secondev-chapanda-feishu
面试、offer操作,添加是否需要反馈
This commit is contained in:
parent
592f51f751
commit
0ff2e00a41
|
|
@ -5,6 +5,7 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.recruit.util.ResponseResult;
|
||||
import com.engine.recruit.wrapper.InductionManageWrapper;
|
||||
import com.engine.recruit.wrapper.OfferWrapper;
|
||||
import com.engine.recruit.wrapper.RecruitInterviewWrapper;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -29,6 +30,10 @@ public class RecruitMobileModeController {
|
|||
return ServiceUtil.getService(InductionManageWrapper.class, user);
|
||||
}
|
||||
|
||||
public RecruitInterviewWrapper getRecruitInterviewWrapper(User user) {
|
||||
return ServiceUtil.getService(RecruitInterviewWrapper.class, user);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/getOfferContent")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
@ -63,4 +68,13 @@ public class RecruitMobileModeController {
|
|||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, Map<String, Object>>(user).run(getInductionManageWrapper(user)::infoSubmit, id);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/updateInterviewStatus")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String updateInterviewStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitInterviewWrapper(user)::updateInterviewStatus, param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,8 +324,8 @@ public enum RecordOperateEnum implements RecordOperateAdapter {
|
|||
xm = rs.getString("xm");
|
||||
zt = rs.getString("zt");
|
||||
}
|
||||
int modeId = ApplicantCommonInfo.getModeIdByTableName("uf_jcl_offer");
|
||||
String selectName = ApplicantCommonInfo.getSelectName(String.valueOf(modeId), "zt", zt);
|
||||
int formId = ApplicantCommonInfo.getFormIdByTableName("uf_jcl_offer");
|
||||
String selectName = ApplicantCommonInfo.getSelectName(String.valueOf(formId), "zt", zt);
|
||||
|
||||
String content = "offer反馈:" + selectName;
|
||||
recordPo.setContent(content);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.engine.recruit.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/28
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface RecruitInterviewService {
|
||||
/**
|
||||
* 更新面试状态
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> updateInterviewStatus(Map<String, Object> param);
|
||||
}
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.conn.RecruitRecordSet;
|
||||
import com.engine.recruit.entity.record.ApplicantRecordPo;
|
||||
import com.engine.recruit.enums.RecordOperateEnum;
|
||||
import com.engine.recruit.service.RecruitInterviewService;
|
||||
import com.weaver.formmodel.data.model.Formfield;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @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"));
|
||||
String type = Util.null2String(param.get("type"));
|
||||
if ("offer".equals(type)) {
|
||||
return updateOfferStatus(status, uuid);
|
||||
}
|
||||
returnMap.put("type", "error");
|
||||
returnMap.put("message", "反馈失败");
|
||||
|
||||
if (StringUtils.isBlank(status) || StringUtils.isBlank(uuid)) {
|
||||
returnMap.put("description", "反馈失败,请直接点击邮件/短信中的链接地址访问,请勿修改链接内容。");
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select * from uf_jcl_ms where modeuuid = ? ", uuid);
|
||||
Map<String, Object> mainDataMap = RecruitRecordSet.getSingleRecordMap(rs);
|
||||
String 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;
|
||||
}
|
||||
|
||||
List<Formfield> fieldList = RecruitModeUtil.getFieldList("uf_jcl_ms");
|
||||
Map<String, Formfield> fieldMap = fieldList.stream().collect(Collectors.toMap(Formfield::getFieldname, item -> item, (k1, k2) -> k1));
|
||||
String interviewMessageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
|
||||
// 参加
|
||||
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);
|
||||
|
||||
|
||||
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(interviewMessageType, "面试反馈通知", 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(interviewMessageType, "面试反馈通知", msgContent, userIdSet, 1);
|
||||
}
|
||||
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
public Map<String, Object> updateOfferStatus(String status, String uuid) {
|
||||
Map<String, Object> returnMap = new HashMap<>(3);
|
||||
returnMap.put("type", "error");
|
||||
returnMap.put("message", "反馈失败");
|
||||
|
||||
if (StringUtils.isBlank(status) || StringUtils.isBlank(uuid)) {
|
||||
returnMap.put("description", "反馈失败,请直接点击邮件/短信中的链接地址访问,请勿修改链接内容。");
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select * from uf_jcl_offer where modeuuid = ? ", uuid);
|
||||
Map<String, Object> mainDataMap = RecruitRecordSet.getSingleRecordMap(rs);
|
||||
String sxrq = "";
|
||||
String zt = "";
|
||||
String billId = "";
|
||||
if (!mainDataMap.isEmpty()) {
|
||||
sxrq = Util.null2String(mainDataMap.get("sxrq"));
|
||||
zt = Util.null2String(mainDataMap.get("zt"));
|
||||
billId = Util.null2String(mainDataMap.get("billId"));
|
||||
} else {
|
||||
returnMap.put("description", "反馈失败,offer信息有误,请联系相应HR确认");
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
// 判断当前offer是否失效
|
||||
String currentDate = DateUtil.getCurrentDate();
|
||||
int compDate = DateUtil.compDate(currentDate, sxrq);
|
||||
// 当前日期>失效日期,更新状态为逾期未回复
|
||||
if (compDate < 0) {
|
||||
returnMap.put("description", "offer已失效");
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
if ("2".equals(zt) || "3".equals(zt)) {
|
||||
returnMap.put("description", "此反馈已提交,请勿重复提交");
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
// 参加
|
||||
if ("0".equals(status)) {
|
||||
returnMap.put("type", "success");
|
||||
returnMap.put("message", "已确认接受offer");
|
||||
returnMap.put("description", "您已接受offer,感谢您的应聘,如有问题可以联系相应HR");
|
||||
|
||||
rs.executeUpdate("update uf_jcl_offer set fksj = ? , zt = 3 where modeuuid = ? ", DateUtil.getDateTime(), uuid);
|
||||
} else if ("1".equals(status)) {
|
||||
returnMap.put("type", "info");
|
||||
returnMap.put("message", "已确认拒绝offer");
|
||||
returnMap.put("description", "您已拒绝offer,感谢您的应聘。希望您能够找到真正适合自己的工作。");
|
||||
// 更新反馈状态、反馈时间
|
||||
rs.executeUpdate("update uf_jcl_offer set fksj = ? , zt = 2 where modeuuid = ? ", DateUtil.getDateTime(), uuid);
|
||||
}
|
||||
// 记录应聘过程
|
||||
ApplicantRecordPo recordPo = ApplicantRecordPo.builder()
|
||||
.billId(String.valueOf(billId))
|
||||
.operateTime(DateUtil.getDateTime())
|
||||
.user(user)
|
||||
.recordOperateType(RecordOperateEnum.OFFER_FEEDBACK)
|
||||
.build();
|
||||
recordPo.execute();
|
||||
|
||||
return returnMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.recruit.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.service.RecruitInterviewService;
|
||||
import com.engine.recruit.service.impl.RecruitInterviewServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/28
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitInterviewWrapper extends Service {
|
||||
private RecruitInterviewService getRecruitInterviewService(User user) {
|
||||
return ServiceUtil.getService(RecruitInterviewServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public Map<String, Object> updateInterviewStatus(Map<String, Object> param) {
|
||||
return getRecruitInterviewService(user).updateInterviewStatus(param);
|
||||
}
|
||||
}
|
||||
|
|
@ -40,12 +40,14 @@ public class BatchAddInterviewResultModeExpand extends AbstractModeExpandJavaCod
|
|||
private final String title;
|
||||
|
||||
private final String infoCollectUrl;
|
||||
private final String INTERVIEW_FEEDBACK_URL;
|
||||
|
||||
public BatchAddInterviewResultModeExpand() {
|
||||
super();
|
||||
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
|
||||
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_ADD_MESSAGE_TITLE");
|
||||
infoCollectUrl = RecruitModeUtil.getRecruitPropValue("INTERVIEW_INFO_COLLECT_URL");
|
||||
INTERVIEW_FEEDBACK_URL = RecruitModeUtil.getRecruitPropValue("INTERVIEW_FEEDBACK_URL");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -62,6 +64,10 @@ public class BatchAddInterviewResultModeExpand extends AbstractModeExpandJavaCod
|
|||
for (Property property : properties) {
|
||||
mainDataMap.put(property.getName(), RecruitModeUtil.parseBlankToNull(property.getValue()));
|
||||
}
|
||||
|
||||
// 需要应聘者反馈
|
||||
boolean needFeedback = "1".equals(Util.null2String(mainDataMap.get("sfxyfk")));
|
||||
|
||||
User user = (User) param.get("user");
|
||||
// 填充建模数据基本信息
|
||||
mainDataMap.put("formmodeid", formModeId);
|
||||
|
|
@ -123,15 +129,20 @@ public class BatchAddInterviewResultModeExpand extends AbstractModeExpandJavaCod
|
|||
String yx = Util.null2String(detailDataMap.get("dzyx"));
|
||||
String sjh = Util.null2String(detailDataMap.get("sjhm"));
|
||||
if (sendEmail) {
|
||||
String emailContent = msgContent;
|
||||
boolean needCollectInfo = "1".equals(Util.null2String(mainDataMap.get("sfsjxx")));
|
||||
if (needCollectInfo) {
|
||||
Object ypz = detailDataMap.get("ypz");
|
||||
String collectUrl = infoCollectUrl + "?interviewId=" + bid + "&candidateId=" + ypz + "&";
|
||||
String collectLink = "<span color='red'><a href='" + collectUrl + "' target='_blank'>{应聘登记表}</a></span>";
|
||||
msgContent = msgContent.replace("{应聘登记表}", collectLink);
|
||||
emailContent = emailContent.replace("{应聘登记表}", collectLink);
|
||||
}
|
||||
RecruitMessageUtils.sendEmail(yx, emailTitle, msgContent);
|
||||
|
||||
if (needFeedback) {
|
||||
String confirmUrl = INTERVIEW_FEEDBACK_URL + "?type=interview&uuid=" + uuid;
|
||||
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>";
|
||||
// 邮件内容拼接确认信息
|
||||
}
|
||||
RecruitMessageUtils.sendEmail(yx, emailTitle, emailContent);
|
||||
}
|
||||
if (sendSms) {
|
||||
RecruitMessageUtils.sendSMS(sjh, msgContent);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.engine.recruit.enums.InterviewOperateTypeEnum;
|
|||
import com.engine.recruit.util.RecruitMessageUtils;
|
||||
import com.weaver.formmodel.data.model.Formfield;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
import weaver.general.BaseBean;
|
||||
|
|
@ -39,6 +40,8 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
|
||||
private String infoCollectUrl;
|
||||
|
||||
private String interviewFeedbackUrl;
|
||||
|
||||
@Override
|
||||
public Map<String, String> doModeExpand(Map<String, Object> params) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
|
|
@ -69,37 +72,15 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
|
||||
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_ADD_MESSAGE_TITLE");
|
||||
infoCollectUrl = RecruitModeUtil.getRecruitPropValue("INTERVIEW_INFO_COLLECT_URL");
|
||||
interviewFeedbackUrl = RecruitModeUtil.getRecruitPropValue("INTERVIEW_FEEDBACK_URL");
|
||||
// 消息提醒
|
||||
arrangeInterview(user, mainDataMap);
|
||||
String tzypz = Util.null2String(mainDataMap.get("tzypz"));
|
||||
String yjnr = Util.null2String(mainDataMap.get("yjnr"));
|
||||
String yjtzmb = Util.null2String(mainDataMap.get("yjtzmb"));
|
||||
List<String> sendTypeList = Arrays.asList(tzypz.split(","));
|
||||
boolean sendEmail = sendTypeList.contains("0");
|
||||
boolean sendSms = sendTypeList.contains("1");
|
||||
String emailTitle = RecruitModeUtil.getEmailTitle(yjtzmb);
|
||||
|
||||
List<Formfield> fieldList = RecruitModeUtil.getFieldList("uf_jcl_ms");
|
||||
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getLabelName));
|
||||
// 发送邮件
|
||||
String msgContent = RecruitModeUtil.getReplaceContent(yjnr, fieldMapList, mainDataMap);
|
||||
String yx = Util.null2String(mainDataMap.get("dzyx"));
|
||||
String sjh = Util.null2String(mainDataMap.get("sjhm"));
|
||||
if (sendEmail) {
|
||||
boolean needCollectInfo = "1".equals(Util.null2String(mainDataMap.get("sfsjxx")));
|
||||
if(needCollectInfo) {
|
||||
Object ypz = mainDataMap.get("ypz");
|
||||
String collectUrl = infoCollectUrl + "?interviewId=" + billId + "&candidateId=" + ypz + "&";
|
||||
String collectLink = "<span color='red'><a href='" + collectUrl + "' target='_blank'>{应聘登记表}</a></span>";
|
||||
msgContent = msgContent.replace("{应聘登记表}", collectLink);
|
||||
}
|
||||
RecruitMessageUtils.sendEmail(yx, emailTitle, msgContent);
|
||||
|
||||
}
|
||||
if (sendSms) {
|
||||
RecruitMessageUtils.sendSMS(sjh, msgContent);
|
||||
}
|
||||
// 需要应聘者反馈
|
||||
boolean needFeedback = "1".equals(Util.null2String(mainDataMap.get("sfxyfk")));
|
||||
boolean needCollectInfo = "1".equals(Util.null2String(mainDataMap.get("sfsjxx")));
|
||||
// 发送邮件、短信
|
||||
sendEmailAndMsg(mainDataMap, billId, needFeedback, needCollectInfo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
@ -141,4 +122,56 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
RecruitModeUtil.messagePush(messageType, title, msgBuilder.toString(), userIdSet, user.getUID());
|
||||
|
||||
}
|
||||
|
||||
private void sendEmailAndMsg(Map<String, Object> mainDataMap, int billId, boolean needFeedback, boolean needCollectInfo) {
|
||||
String tzypz = Util.null2String(mainDataMap.get("tzypz"));
|
||||
String yjnr = Util.null2String(mainDataMap.get("yjnr"));
|
||||
String yjtzmb = Util.null2String(mainDataMap.get("yjtzmb"));
|
||||
List<String> sendTypeList = Arrays.asList(tzypz.split(","));
|
||||
boolean sendEmail = sendTypeList.contains("0");
|
||||
boolean sendSms = sendTypeList.contains("1");
|
||||
String emailTitle = RecruitModeUtil.getEmailTitle(yjtzmb);
|
||||
|
||||
List<Formfield> fieldList = RecruitModeUtil.getFieldList("uf_jcl_ms");
|
||||
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getLabelName));
|
||||
// 发送邮件
|
||||
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 = interviewFeedbackUrl + "?type=interview&uuid=" + uuid;
|
||||
|
||||
if (needCollectInfo) {
|
||||
Object ypz = mainDataMap.get("ypz");
|
||||
String collectUrl = infoCollectUrl + "?interviewId=" + billId + "&candidateId=" + ypz + "&";
|
||||
String collectLink = "<span color='red'><a href='" + collectUrl + "' target='_blank'>{应聘登记表}</a></span>";
|
||||
msgContent = msgContent.replace("{应聘登记表}", collectLink);
|
||||
}
|
||||
if (sendEmail) {
|
||||
if (needFeedback) {
|
||||
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;
|
||||
RecruitMessageUtils.sendEmail(yx, emailTitle, emailContent);
|
||||
// 勾选了需要反馈,则需要将是否参加置空,且需要可以再次反馈
|
||||
rs.executeUpdate("update uf_jcl_ms set sfcj = null,zt = null where id = ? ", billId);
|
||||
} else {
|
||||
RecruitMessageUtils.sendEmail(yx, emailTitle, msgContent);
|
||||
}
|
||||
}
|
||||
if (sendSms) {
|
||||
if (needFeedback) {
|
||||
String messageContent = "请您答复是否参加此次邀请?" + confirmUrl;
|
||||
messageContent = msgContent + messageContent;
|
||||
RecruitMessageUtils.sendSMS(sjh, messageContent);
|
||||
} else {
|
||||
RecruitMessageUtils.sendSMS(sjh, msgContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,20 @@ public class CreateOfferModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
|
||||
if (sendEmail) {
|
||||
String offerAttach = RecruitModeUtil.getImageFileIdsByDocIds(Util.null2String(mainDataMap.get("offerfj")));
|
||||
boolean needFeedback = "1".equals(Util.null2String(mainDataMap.get("sfxyfk")));
|
||||
if(needFeedback){
|
||||
String uuid = "";
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select modeuuid from uf_jcl_offer where id = ? ", billId);
|
||||
if (rs.next()) {
|
||||
uuid = rs.getString("modeuuid");
|
||||
}
|
||||
String confirmUrl = RecruitModeUtil.getRecruitPropValue("INTERVIEW_FEEDBACK_URL") + "?type=offer&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\">请您答复是否接接受此offer? <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>";
|
||||
// 邮件内容拼接确认信息
|
||||
msgContent = msgContent + emailContent;
|
||||
}
|
||||
|
||||
RecruitMessageUtils.sendEmailWithFile(yx, emailTitle, msgContent, offerAttach);
|
||||
}
|
||||
if (sendSms) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -36,7 +35,15 @@ import java.util.stream.Collectors;
|
|||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitModeUtil {
|
||||
private static final Pattern MSG_PATTERN = Pattern.compile(Pattern.quote("{") + "(.*?)" + Pattern.quote("}"));
|
||||
/**
|
||||
* 邮件、短信发送,替换内容正则表达式
|
||||
*/
|
||||
private static final Pattern EMAIL_PATTERN = Pattern.compile(Pattern.quote("{") + "(.*?)" + Pattern.quote("}"));
|
||||
/**
|
||||
* 消息中心,替换内容正则表达式
|
||||
*/
|
||||
private static final Pattern MSG_PATTERN = Pattern.compile(Pattern.quote("$") + "(.*?)" + Pattern.quote("$"));
|
||||
|
||||
|
||||
/**
|
||||
* 消息推送
|
||||
|
|
@ -146,13 +153,13 @@ public class RecruitModeUtil {
|
|||
return FormInfoManager.getInstance().getAllField(formId);
|
||||
}
|
||||
|
||||
public static String getFieldShowName(Formfield formfield, String fieldName) {
|
||||
public static String getFieldShowName(Formfield formfield, String fieldValue) {
|
||||
User user = new User(1);
|
||||
return FieldHandler.getFieldValue(fieldName, formfield, true, user);
|
||||
return FieldHandler.getFieldValue(fieldValue, formfield, true, user);
|
||||
}
|
||||
|
||||
public static String getReplaceContent(String content, Map<String, List<Formfield>> fieldMapList, Map<String, Object> paramsData) {
|
||||
Matcher matcher = MSG_PATTERN.matcher(content);
|
||||
Matcher matcher = EMAIL_PATTERN.matcher(content);
|
||||
// 指定要匹配的字符串
|
||||
StringBuffer sb = new StringBuffer();
|
||||
while (matcher.find()) {
|
||||
|
|
@ -172,6 +179,30 @@ public class RecruitModeUtil {
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息中心,替换消息内容
|
||||
*
|
||||
* @param content
|
||||
* @param fieldMap
|
||||
* @param paramsData
|
||||
* @return
|
||||
*/
|
||||
public static String getMsgReplaceStr(String content, Map<String, Formfield> fieldMap, Map<String, Object> paramsData) {
|
||||
Matcher matcher = MSG_PATTERN.matcher(content);
|
||||
// 指定要匹配的字符串
|
||||
StringBuffer sb = new StringBuffer();
|
||||
while (matcher.find()) {
|
||||
String replace = matcher.group(1);
|
||||
|
||||
Formfield formfield = fieldMap.get(replace);
|
||||
String replaceValue = Util.null2String(paramsData.get(formfield.getFieldname().toLowerCase()));
|
||||
String fieldShowName = RecruitModeUtil.getFieldShowName(formfield, replaceValue).replaceAll("<[^>]*>", "");
|
||||
matcher.appendReplacement(sb, Util.null2String(fieldShowName));
|
||||
}
|
||||
matcher.appendTail(sb);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件imageFieldId生成docId
|
||||
*
|
||||
|
|
@ -266,51 +297,6 @@ public class RecruitModeUtil {
|
|||
return StringUtils.join(imageFileIds, ",");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Author ml
|
||||
* @Date 2023/10/23 18:21
|
||||
* @Description 根据建模表名称获取列名称
|
||||
* @Param [tableName]
|
||||
* @Return Map<Object, List < Map < String, Object>>>
|
||||
*/
|
||||
public static Map<String, Object> getModeColumns(String tableName) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<Map<String, String>> mapList = new ArrayList<>();
|
||||
Map<String, String> tmpMap = new HashMap<>(16);
|
||||
rs.executeQuery("select b.FIELDNAME,b.VIEWTYPE from workflow_bill a left join workflow_billfield b on a.id = b.BILLID where a.TABLENAME = ?", tableName);
|
||||
while (rs.next()) {
|
||||
tmpMap.put("fieldname", rs.getString("FIELDNAME"));
|
||||
tmpMap.put("viewtype", rs.getString("VIEWTYPE"));
|
||||
mapList.add(tmpMap);
|
||||
}
|
||||
Map<String, List<Map<String, String>>> dataMap = mapList.stream().collect(Collectors.groupingBy(item -> item.get("viewtype")));
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
for (String key : dataMap.keySet()) {
|
||||
resMap.put(key, dataMap.get(key).stream().map(Map -> Map.get("fieldname")).collect(Collectors.toList()));
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
|
||||
|
||||
public static String getQuerySql(String tableName) {
|
||||
Map<String, Object> params = getModeColumns(tableName);
|
||||
String fieldSql = "";
|
||||
StringBuilder whereSql = new StringBuilder();
|
||||
whereSql.append(tableName).append(" t0");
|
||||
for (String key : params.keySet()) {
|
||||
List<String> oldlist = (List<String>) params.get(key);
|
||||
List<String> list = new ArrayList<>();
|
||||
oldlist.forEach(field -> list.add("t" + key + "." + field));
|
||||
fieldSql = StringUtils.join(list, ",");
|
||||
if ("0".equals(key)) {
|
||||
continue;
|
||||
}
|
||||
whereSql.append(" left join ").append(tableName).append("_dt").append(key).append(" ").append("t").append(key).append(" on t0.id=").append("t").append(key).append(".mainid");
|
||||
}
|
||||
return "select " + fieldSql + " from " + whereSql + " where t0.id=?";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取邮件模板主题
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue