面试安排反馈功能开发

This commit is contained in:
dxfeng 2023-12-11 13:28:27 +08:00
parent 2ca851bf5b
commit f00138f584
10 changed files with 604 additions and 56 deletions

View File

@ -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,14 @@ 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);
}
}

View File

@ -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);
}

View File

@ -61,7 +61,7 @@ public class InductionManageServiceImpl extends Service implements InductionMana
}
// 查询信息采集模板内容
rs.executeQuery("select yjnr,mbmc from uf_jcl_yjtzmb where mblx = 3");
rs.executeQuery("select yjnr,mbmc from uf_jcl_yjtzmb where mblx = 3 and zt = 0");
String yjnr = "";
String mbmc = "";
if (rs.next()) {
@ -127,7 +127,7 @@ public class InductionManageServiceImpl extends Service implements InductionMana
String mobile = Util.null2String(dataMap.get("sjh"));
String email = Util.null2String(dataMap.get("yx"));
String messageLink = RecruitModeUtil.getRecruitPropValue("COLLECT_MESSAGE_LINK");
String messageLink = RecruitModeUtil.HTTP_URL + RecruitModeUtil.getRecruitPropValue("COLLECT_MESSAGE_LINK");
//messageLink += "&billId=" + id;
yjnr = yjnr.replace("{链接地址}", messageLink);

View File

@ -0,0 +1,61 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitInterviewService;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import java.util.HashMap;
import java.util.Map;
/**
* @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)) {
returnMap.put("description", "反馈失败,请直接点击邮件链接地址访问,请勿修改链接内容。");
return returnMap;
}
RecordSet rs = new RecordSet();
rs.executeQuery("select sfcj from uf_jcl_ms where modeuuid = ? ", uuid);
String sfcj = "";
if (rs.next()) {
sfcj = rs.getString("sfcj");
}
if (StringUtils.isNotBlank(sfcj)) {
returnMap.put("description", "您已成功反馈面试,请勿重复反馈。");
return returnMap;
}
// 参加
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);
} 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);
}
return returnMap;
}
}

View File

@ -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);
}
}

View File

@ -0,0 +1,444 @@
package com.engine.resumestorage.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.engine.core.exception.ECException;
import com.engine.core.impl.Service;
import com.engine.resumestorage.service.ResumeIdentifyService;
import com.engine.resumestorage.util.ParseResumeQliUtil;
import com.engine.resumestorage.util.Sql;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSetTrans;
import weaver.formmode.setup.ModeRightInfo;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.integration.logging.Logger;
import weaver.integration.logging.LoggerFactory;
import java.util.*;
public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentifyService {
private final Logger log = LoggerFactory.getLogger(ResumeIdentifyService.class);
BaseBean bb = new BaseBean();
String formmodeid_tmp;
String sfsymr;
public ResumeIdentifyServiceImpl() {
this.formmodeid_tmp = this.bb.getPropValue("resume_qianliling", "model.id");
this.sfsymr = this.bb.getPropValue("resume_qianliling", "sfsymr");
}
public int saveResumeByImageFileId(int imageFileId) throws Exception {
new HashMap();
String response = ParseResumeQliUtil.doParseHostPost(imageFileId);
this.log.info("千里聆接口返回值:" + response);
if (response.length() == 0) {
this.log.info("调用千里零接口失败,返回值为空");
throw new Exception("调用千里零接口失败,返回值为空");
} else {
JSONObject all = JSONObject.parseObject(response);
if (!all.getBoolean("isSuccess")) {
this.log.info("调用千里零接口失败,接口不通");
throw new Exception("调用千里零接口失败,接口不通");
} else {
JSONObject resultall = all.getJSONObject("data");
String status = resultall.getString("state");
if ("fail".equals(status)) {
this.log.info("调用千里零接口失败,失败原因:" + resultall.getString("info"));
throw new Exception("调用千里零接口失败,失败原因:" + resultall.getString("info"));
} else {
JSONObject result = resultall.getJSONObject("result");
Map<String, String> saveResume = this.parseJsonToMap(result);
return this.saveResumeInDB(saveResume);
}
}
}
}
public int saveResumeInDB(Map<String, String> fields) throws Exception {
String tablename = "uf_jg_rmk";
if ("1".equals(this.sfsymr)) {
tablename = this.bb.getPropValue("resume_qianliling", "jlk.tablename");
}
RecordSetTrans rst = new RecordSetTrans();
rst.setAutoCommit(false);
List<String> field = new ArrayList();
List<String> value1 = new ArrayList();
List<String> value = new ArrayList();
fields.forEach((key, v) -> {
if (StringUtils.isNotEmpty(v)) {
field.add(key);
value.add(v);
value1.add("?");
}
});
String sql = "insert into " + tablename + "(" + String.join(",", field) + ") values(" + String.join(",", value1) + ")";
this.log.error("test--------------------");
this.log.error(sql);
this.log.error("test--------------------");
try {
boolean flag = rst.executeUpdate(sql, new Object[]{value});
rst.commit();
if (flag) {
String idSql = "SELECT max(id) as mid from " + tablename;
String id = Sql.querySingleField(idSql, "mid");
this.permissionReconstruction(Util.getIntValue(id));
return Integer.parseInt(id);
} else {
return -1;
}
} catch (Exception var11) {
var11.printStackTrace();
rst.rollback();
this.log.error(var11);
throw new ECException("简历更新失败");
}
}
private void permissionReconstruction(int billId) {
ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true);
ModeRightInfo.editModeDataShare(1, Util.getIntValue(this.formmodeid_tmp), billId);
}
public Map<String, String> queryByDBId(String resumeid) throws Exception {
String tablename = "uf_jg_rmk";
if ("1".equals(this.sfsymr)) {
tablename = this.bb.getPropValue("youyun", "tablename");
}
String sql = "select * from " + tablename + " where id=" + resumeid;
return Sql.querySingleRow(sql);
}
public boolean deleteById(String resumeid) throws Exception {
String tablename = "uf_jg_rmk";
if ("1".equals(this.sfsymr)) {
tablename = this.bb.getPropValue("youyun", "tablename");
}
String sql = "delete " + tablename + " where id=" + resumeid;
RecordSetTrans rst = new RecordSetTrans();
rst.setAutoCommit(false);
try {
rst.executeUpdate(sql, new Object[0]);
rst.commit();
return true;
} catch (Exception var6) {
rst.rollback();
throw new Exception(var6);
}
}
private Map<String, String> parseJsonToMap(JSONObject obj) {
Map<String, String> rs = new HashMap();
if ("1".equals(this.sfsymr)) {
String v;
if (obj.containsKey("姓名")) {
v = this.bb.getPropValue("resume_qianliling", "rmxm");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "rmxm"), this.parseArray(obj.getJSONArray("姓名")));
}
}
if (obj.containsKey("性别")) {
v = this.bb.getPropValue("resume_qianliling", "xb");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "xb"), this.parseArray(obj.getJSONArray("性别")).equals("") ? "0" : "1");
}
}
if (obj.containsKey("出生日期")) {
v = this.bb.getPropValue("resume_qianliling", "csrq");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "csrq"), this.parseArray(obj.getJSONArray("出生日期")));
}
}
if (obj.containsKey("籍贯")) {
v = this.bb.getPropValue("resume_qianliling", "jg");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "jg"), this.parseArray(obj.getJSONArray("籍贯")));
}
}
if (obj.containsKey("手机号")) {
v = this.bb.getPropValue("resume_qianliling", "sjhm");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "sjhm"), this.parseArray(obj.getJSONArray("手机号")));
}
}
if (obj.containsKey("电子邮箱")) {
v = this.bb.getPropValue("resume_qianliling", "email");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "email"), this.parseArray(obj.getJSONArray("电子邮箱")));
}
}
if (obj.containsKey("微信")) {
v = this.bb.getPropValue("resume_qianliling", "wx");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "wx"), this.parseArray(obj.getJSONArray("微信")));
}
}
if (obj.containsKey("QQ")) {
v = this.bb.getPropValue("resume_qianliling", "qq");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "qq"), this.parseArray(obj.getJSONArray("QQ")));
}
}
if (obj.containsKey("现居住地")) {
v = this.bb.getPropValue("resume_qianliling", "jzd");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "jzd"), this.parseArray(obj.getJSONArray("现居住地")));
}
}
if (obj.containsKey("爱好")) {
v = this.bb.getPropValue("resume_qianliling", "ah");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "ah"), this.parseArray(obj.getJSONArray("爱好")));
}
}
if (obj.containsKey("个人评价")) {
v = this.bb.getPropValue("resume_qianliling", "grpj");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "grpj"), this.parseArray(obj.getJSONArray("个人评价")));
}
}
if (obj.containsKey("学业信息")) {
v = this.bb.getPropValue("resume_qianliling", "xyxg");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "xyxg"), obj.getJSONArray("学业信息").toJSONString());
}
}
if (obj.containsKey("毕业时间")) {
v = this.bb.getPropValue("resume_qianliling", "bysj");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "bysj"), this.parseArray(obj.getJSONArray("毕业时间")));
}
}
if (obj.containsKey("最高学历")) {
v = this.bb.getPropValue("resume_qianliling", "zgxl");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "zgxl"), this.parseArray(obj.getJSONArray("最高学历")));
}
}
if (obj.containsKey("专业技能")) {
v = this.bb.getPropValue("resume_qianliling", "zyjn");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "zyjn"), this.parseArray(obj.getJSONArray("专业技能")));
}
}
if (obj.containsKey("实习经历")) {
v = this.bb.getPropValue("resume_qianliling", "sxjl");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "sxjl"), this.parseArray(obj.getJSONArray("实习经历")));
}
}
if (obj.containsKey("英语水平")) {
v = this.bb.getPropValue("resume_qianliling", "yysp");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "yysp"), this.parseArray(obj.getJSONArray("英语水平")));
}
}
if (obj.containsKey("技能证书")) {
v = this.bb.getPropValue("resume_qianliling", "jnzs");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "jnzs"), this.parseArray(obj.getJSONArray("技能证书")));
}
}
if (obj.containsKey("校园经历")) {
v = this.bb.getPropValue("resume_qianliling", "xyjl");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "xyjl"), this.parseArray(obj.getJSONArray("校园经历")));
}
}
if (obj.containsKey("工作信息")) {
v = this.bb.getPropValue("resume_qianliling", "gzxg");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "gzxg"), obj.getJSONArray("工作信息").toJSONString());
}
}
if (obj.containsKey("期望从事岗位")) {
v = this.bb.getPropValue("resume_qianliling", "qwcsgw");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "qwcsgw"), this.parseArray(obj.getJSONArray("期望从事岗位")));
}
}
if (obj.containsKey("工作经验")) {
v = this.bb.getPropValue("resume_qianliling", "gzjy1");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "gzjy1"), this.parseArray(obj.getJSONArray("工作经验")));
}
}
if (obj.containsKey("期望薪资")) {
v = this.bb.getPropValue("resume_qianliling", "qwxz");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "qwxz"), this.parseArray(obj.getJSONArray("期望薪资")));
}
}
if (obj.containsKey("期望工作地点")) {
v = this.bb.getPropValue("resume_qianliling", "qwgzdd");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "qwgzdd"), this.parseArray(obj.getJSONArray("期望工作地点")));
}
}
if (obj.containsKey("项目经历")) {
v = this.bb.getPropValue("resume_qianliling", "xmjl");
if (v != null && v.length() > 0) {
rs.put(this.bb.getPropValue("resume_qianliling", "xmjl"), this.parseArray(obj.getJSONArray("项目经历")));
}
}
} else {
if (obj.containsKey("姓名")) {
rs.put("rmxm", this.parseArray(obj.getJSONArray("姓名")));
}
if (obj.containsKey("性别")) {
rs.put("xb", this.parseArray(obj.getJSONArray("性别")).equals("") ? "0" : "1");
}
if (obj.containsKey("出生日期")) {
rs.put("csrq", this.parseArray(obj.getJSONArray("出生日期")));
}
if (obj.containsKey("籍贯")) {
rs.put("jg", this.parseArray(obj.getJSONArray("籍贯")));
}
if (obj.containsKey("手机号")) {
rs.put("sjhm", this.parseArray(obj.getJSONArray("手机号")));
}
if (obj.containsKey("电子邮箱")) {
rs.put("email", this.parseArray(obj.getJSONArray("电子邮箱")));
}
if (obj.containsKey("微信")) {
rs.put("wx", this.parseArray(obj.getJSONArray("微信")));
}
if (obj.containsKey("QQ")) {
rs.put("qq", this.parseArray(obj.getJSONArray("QQ")));
}
if (obj.containsKey("现居住地")) {
rs.put("jzd", this.parseArray(obj.getJSONArray("现居住地")));
}
if (obj.containsKey("爱好")) {
rs.put("ah", this.parseArray(obj.getJSONArray("爱好")));
}
if (obj.containsKey("个人评价")) {
rs.put("grpj", this.parseArray(obj.getJSONArray("个人评价")));
}
if (obj.containsKey("学业信息")) {
rs.put("xyxg", obj.getJSONArray("学业信息").toJSONString());
}
if (obj.containsKey("毕业时间")) {
rs.put("bysj", this.parseArray(obj.getJSONArray("毕业时间")));
}
if (obj.containsKey("最高学历")) {
rs.put("zgxlwb", this.parseArray(obj.getJSONArray("最高学历")));
}
if (obj.containsKey("最高学位")) {
rs.put("zgxw", this.parseArray(obj.getJSONArray("最高学位")));
}
if (obj.containsKey("专业技能")) {
rs.put("zyjn", this.parseArray(obj.getJSONArray("专业技能")));
}
if (obj.containsKey("实习经历")) {
rs.put("sxjl", this.parseArray(obj.getJSONArray("实习经历")));
}
if (obj.containsKey("英语水平")) {
rs.put("yysp", this.parseArray(obj.getJSONArray("英语水平")));
}
if (obj.containsKey("技能证书")) {
rs.put("jnzs", this.parseArray(obj.getJSONArray("技能证书")));
}
if (obj.containsKey("校园经历")) {
rs.put("xyjl", this.parseArray(obj.getJSONArray("校园经历")));
}
if (obj.containsKey("工作信息")) {
rs.put("gzxg", obj.getJSONArray("工作信息").toJSONString());
}
if (obj.containsKey("期望从事岗位")) {
rs.put("qwcsgw", this.parseArray(obj.getJSONArray("期望从事岗位")));
}
if (obj.containsKey("工作经验")) {
rs.put("gzjy1", this.parseArray(obj.getJSONArray("工作经验")));
}
if (obj.containsKey("期望薪资")) {
rs.put("qwxz", this.parseArray(obj.getJSONArray("期望薪资")));
}
if (obj.containsKey("期望工作地点")) {
rs.put("qwgzdd", this.parseArray(obj.getJSONArray("期望工作地点")));
}
if (obj.containsKey("项目经历")) {
rs.put("xmjl", this.parseArray(obj.getJSONArray("项目经历")));
}
}
rs.put("formmodeid", this.formmodeid_tmp);
rs.put("modedatacreater", "1");
rs.put("modedatacreatertype", "0");
rs.put("modedatacreatedate", DateUtil.today());
rs.put("modedatacreatetime", DateUtil.formatTime(new Date()));
return rs;
}
private String parseArray(JSONArray ar) {
String rs = "";
if (ar != null && ar.size() > 0) {
for(int i = 0; i < ar.size(); ++i) {
if (i == ar.size() - 1) {
rs = rs + ar.get(i);
} else {
rs = rs + ar.get(i) + ",";
}
}
}
return rs;
}
}

View File

@ -67,6 +67,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);
@ -127,7 +131,15 @@ public class BatchAddInterviewResultModeExpand extends AbstractModeExpandJavaCod
String yx = Util.null2String(detailDataMap.get("dzyx"));
String sjh = Util.null2String(detailDataMap.get("sjhm"));
if (sendEmail) {
RecruitMessageUtils.sendEmail(yx, emailTitle, msgContent);
if (needFeedback) {
String confirmUrl = RecruitModeUtil.HTTP_URL + "/spa/custom/static/index.html#/main/cs/app/9277c228302347dc88a958b69ee96234_Interview?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;
RecruitMessageUtils.sendEmail(yx, emailTitle, emailContent);
} else {
RecruitMessageUtils.sendEmail(yx, emailTitle, msgContent);
}
}
if (sendSms) {

View File

@ -1,16 +1,18 @@
package weaver.formmode.recruit.modeexpand.interview;
import com.engine.recruit.conn.ApplicantCommonInfo;
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 com.engine.recruit.conn.ApplicantCommonInfo;
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.*;
import weaver.soa.workflow.request.MainTableInfo;
import weaver.soa.workflow.request.Property;
import weaver.soa.workflow.request.RequestInfo;
import java.util.*;
import java.util.stream.Collectors;
@ -35,8 +37,6 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
*/
private String title;
private final RecordSet recordSet = new RecordSet();
@Override
public Map<String, String> doModeExpand(Map<String, Object> params) {
Map<String, String> result = new HashMap<>();
@ -58,6 +58,9 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
mainDataMap.put(property.getName(), property.getValue());
}
// 需要应聘者反馈
boolean needFeedback = "1".equals(Util.null2String(mainDataMap.get("sfxyfk")));
String operateType = Util.null2String(params.get("operateType"));
if (StringUtils.isBlank(operateType)) {
operateType = InterviewOperateTypeEnum.ARRANGE.getOperateType();
@ -66,7 +69,9 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
if (operateTypeEnum == InterviewOperateTypeEnum.ARRANGE) {
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_ADD_MESSAGE_TITLE");
// 消息提醒
arrangeInterview(user, mainDataMap);
String tzypz = Util.null2String(mainDataMap.get("tzypz"));
String yjnr = Util.null2String(mainDataMap.get("yjnr"));
String yjtzmb = Util.null2String(mainDataMap.get("yjtzmb"));
@ -82,8 +87,21 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
String yx = Util.null2String(mainDataMap.get("dzyx"));
String sjh = Util.null2String(mainDataMap.get("sjhm"));
if (sendEmail) {
RecruitMessageUtils.sendEmail(yx, emailTitle, msgContent);
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 = RecruitModeUtil.HTTP_URL + "/spa/custom/static/index.html#/main/cs/app/9277c228302347dc88a958b69ee96234_Interview?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;
RecruitMessageUtils.sendEmail(yx, emailTitle, emailContent);
} else {
RecruitMessageUtils.sendEmail(yx, emailTitle, msgContent);
}
}
if (sendSms) {
RecruitMessageUtils.sendSMS(sjh, msgContent);

View File

@ -59,7 +59,7 @@ public class CreateOfferModeExpand extends AbstractModeExpandJavaCodeNew {
List<Formfield> fieldList = RecruitModeUtil.getFieldList("uf_jcl_offer");
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getLabelName));
// 发送邮件
String offerMobileUrl = RecruitModeUtil.getRecruitPropValue("OFFER_MOBILE_URL");
String offerMobileUrl = RecruitModeUtil.HTTP_URL + RecruitModeUtil.getRecruitPropValue("OFFER_MOBILE_URL");
offerMobileUrl += "&billid=" + billId + "&dzyx=" + yx;
String mobileLink = "<span color='red'><a href='" + offerMobileUrl + "' target='_blank'>录用通知函</a></span>";
tznr = tznr.replace("{录用通知函}", mobileLink);

View File

@ -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
@ -38,6 +37,8 @@ import java.util.stream.Collectors;
public class RecruitModeUtil {
private static final Pattern MSG_PATTERN = Pattern.compile(Pattern.quote("{") + "(.*?)" + Pattern.quote("}"));
public static final String HTTP_URL = getRecruitPropValue("HTTP_URL");
/**
* 消息推送
*
@ -266,51 +267,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=?";
}
/**
* 获取邮件模板主题
*