简历中心发送邮件、测评、应聘登记提交事件
parent
8c57c92434
commit
f127eef41b
@ -0,0 +1,12 @@
|
||||
package com.api.mzg.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/09/05
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/jcl/mzg/mobile")
|
||||
public class RecruitMobileController extends com.engine.mzg.web.RecruitMobileController{
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
package com.engine.mzg.conn;
|
||||
|
||||
import com.engine.mzg.exception.CustomizeRunTimeException;
|
||||
import com.engine.mzg.util.RecruitUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.IgnoreCaseHashMap;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/10/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitRecordSet {
|
||||
|
||||
/**
|
||||
* 获取单个记录映射
|
||||
*
|
||||
* @param rs RecordSet
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, Object> getSingleRecordMap(RecordSet rs) {
|
||||
Map<String, Object> dataMap = new IgnoreCaseHashMap<>();
|
||||
if (rs.next()) {
|
||||
String[] columnNames = rs.getColumnName();
|
||||
for (String columnName : columnNames) {
|
||||
dataMap.put(columnName, RecruitUtil.parseBlankToNull(rs.getString(columnName)));
|
||||
}
|
||||
}
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> getRecordMapList(RecordSet rs) {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
String[] columnNames = rs.getColumnName();
|
||||
Map<String, Object> dataMap = new IgnoreCaseHashMap<>();
|
||||
for (String columnName : columnNames) {
|
||||
dataMap.put(columnName.toLowerCase(), RecruitUtil.parseBlankToNull(rs.getString(columnName)));
|
||||
}
|
||||
list.add(dataMap);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param dataMap 数据集合
|
||||
* @param tableName 表名
|
||||
*/
|
||||
public static void insertData(Map<String, Object> dataMap, String tableName) {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<String> dataList = new ArrayList<>();
|
||||
List<String> paramList = new ArrayList<>();
|
||||
|
||||
dataMap.forEach((key, value) -> {
|
||||
if (null != value) {
|
||||
String valueStr = String.valueOf(value);
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
fieldList.add(key);
|
||||
dataList.add(valueStr);
|
||||
paramList.add("?");
|
||||
}
|
||||
}
|
||||
});
|
||||
String insertSql = " insert into " + tableName + "(" + StringUtils.join(fieldList, ",") + ") values (" + StringUtils.join(paramList, ",") + ")";
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate(insertSql, dataList);
|
||||
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
|
||||
throw new CustomizeRunTimeException(rs.getExceptionMsg());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID更新数据
|
||||
*
|
||||
* @param dataMap
|
||||
* @param tableName
|
||||
*/
|
||||
public static void updateDataById(Map<String, Object> dataMap, String tableName) {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<Object> dataList = new ArrayList<>();
|
||||
String id = Util.null2String(dataMap.get("id"));
|
||||
dataMap.remove("id");
|
||||
|
||||
dataMap.forEach((key, value) -> {
|
||||
fieldList.add(key + " = ? ");
|
||||
dataList.add(value);
|
||||
});
|
||||
dataList.add(id);
|
||||
String updateSql = "update " + tableName + " set " + StringUtils.join(fieldList, ",") + " where id = ? ";
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate(updateSql, dataList);
|
||||
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
|
||||
throw new CustomizeRunTimeException(rs.getExceptionMsg());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param deleteSql
|
||||
*/
|
||||
public static void deleteData(String deleteSql) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate(deleteSql);
|
||||
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
|
||||
throw new CustomizeRunTimeException(rs.getExceptionMsg());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建建模表基本数据
|
||||
*
|
||||
* @param mainDataMap 参数集合
|
||||
*/
|
||||
public static void buildModeInsertFields(Map<String, Object> mainDataMap, int userId) {
|
||||
String dateTime = DateUtil.getFullDate();
|
||||
String[] dateSplit = dateTime.split(" ");
|
||||
mainDataMap.put("modedatacreater", userId);
|
||||
mainDataMap.put("modedatacreatedate", dateSplit[0]);
|
||||
mainDataMap.put("modedatacreatetime", dateSplit[1]);
|
||||
mainDataMap.put("modedatacreatertype", "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建建模表基本数据
|
||||
*
|
||||
* @param mainDataMap 参数集合
|
||||
*/
|
||||
public static void buildModeUpdateFields(Map<String, Object> mainDataMap, int userId) {
|
||||
String dateTime = DateUtil.getFullDate();
|
||||
mainDataMap.put("modedatamodifier", userId);
|
||||
mainDataMap.put("modedatamodifydatetime", dateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 建模表数据权限重构
|
||||
*
|
||||
* @param uuid
|
||||
* @param modeTable
|
||||
* @param formModeId
|
||||
*/
|
||||
public static int refreshRight(String uuid, String modeTable, int formModeId, int creator) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from " + modeTable + " where modeuuid='" + uuid + "'");
|
||||
if (rs.next()) {
|
||||
//建模数据的id
|
||||
int bid = Util.getIntValue(rs.getString("id"));
|
||||
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||||
modeRightInfo.setNewRight(true);
|
||||
//新建的时候添加共享
|
||||
modeRightInfo.editModeDataShare(creator, formModeId, bid);
|
||||
return bid;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.engine.mzg.enums;
|
||||
|
||||
/**
|
||||
* 邮件模板类型
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/09/13
|
||||
* @version: 1.0
|
||||
*/
|
||||
public enum EmailTemplateEnum {
|
||||
/**
|
||||
* 性格测评
|
||||
*/
|
||||
DISC(0, "性格测评"),
|
||||
/**
|
||||
* 应聘登记
|
||||
*/
|
||||
REGIST(1, "应聘登记"),
|
||||
/**
|
||||
* 面试
|
||||
*/
|
||||
INTERVIEW(2, "面试"),
|
||||
/**
|
||||
* offer
|
||||
*/
|
||||
OFFER(3, "offer");
|
||||
|
||||
EmailTemplateEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
|
||||
private Integer value;
|
||||
|
||||
|
||||
private String desc;
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.engine.mzg.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.mzg.service.RecruitMobileService;
|
||||
import com.engine.mzg.service.impl.RecruitMobileServiceImpl;
|
||||
import com.engine.mzg.util.ResponseResult;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/09/05
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitMobileController {
|
||||
|
||||
public RecruitMobileService getService(User user) {
|
||||
return ServiceUtil.getService(RecruitMobileServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/submitDiscTest")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String submitDiscTest(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::submitDiscTest, params);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package weaver.formmode.mzg.modeexpand.disc;
|
||||
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/09/02
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class AddDiscExpand extends AbstractModeExpandJavaCodeNew {
|
||||
public static final Pattern PATTERN = Pattern.compile("^q([1-9]|[1-3][0-9]|40)$");
|
||||
|
||||
@Override
|
||||
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
try {
|
||||
int billId;
|
||||
int modeId;
|
||||
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
|
||||
if (requestInfo != null) {
|
||||
billId = Util.getIntValue(requestInfo.getRequestid());
|
||||
modeId = Util.getIntValue(requestInfo.getWorkflowid());
|
||||
if (billId > 0 && modeId > 0) {
|
||||
// 计算各个选项的值
|
||||
int countD = 0;
|
||||
int countI = 0;
|
||||
int countS = 0;
|
||||
int countC = 0;
|
||||
RecordSet rs = new RecordSet();
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
String name = property.getName();
|
||||
Matcher matcher = PATTERN.matcher(name);
|
||||
if (!matcher.matches()) {
|
||||
continue;
|
||||
}
|
||||
if ("0".equals(property.getValue())) {
|
||||
countD++;
|
||||
} else if ("1".equals(property.getValue())) {
|
||||
countI++;
|
||||
} else if ("2".equals(property.getValue())) {
|
||||
countS++;
|
||||
} else if ("3".equals(property.getValue())) {
|
||||
countC++;
|
||||
}
|
||||
}
|
||||
|
||||
// 更新各个选项的个数
|
||||
rs.executeUpdate("update uf_recruit_disc set dxhj = ? ,ixhj = ?, sxhj = ?, cxhj = ? where id = ? ", countD, countI, countS, countC, billId);
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
result.put("errmsg", "DISC数据统计异常");
|
||||
result.put("flag", "false");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package weaver.formmode.mzg.modeexpand.resume;
|
||||
|
||||
import com.engine.mzg.conn.RecruitCommon;
|
||||
import com.engine.mzg.conn.RecruitRecordSet;
|
||||
import com.engine.mzg.enums.EmailTemplateEnum;
|
||||
import com.engine.mzg.exception.CustomizeRunTimeException;
|
||||
import com.engine.mzg.util.RecruitUtil;
|
||||
import com.weaver.formmodel.data.model.Formfield;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.IgnoreCaseHashMap;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 发送DISC性格测评
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/09/05
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class SendDiscExpand extends AbstractModeExpandJavaCodeNew {
|
||||
@Override
|
||||
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
try {
|
||||
int billId;
|
||||
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
|
||||
if (requestInfo != null) {
|
||||
billId = Util.getIntValue(requestInfo.getRequestid());
|
||||
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
mainDataMap.put(property.getName(), property.getValue());
|
||||
}
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
String mobileAppidDisc = RecruitCommon.getSettingValue("MOBILE_APPID_DISC");
|
||||
String mobileUrlDisc = RecruitCommon.getSettingValue("MOBILE_URL_DISC");
|
||||
String httpUrl = RecruitCommon.getSettingValue("HTTP_URL");
|
||||
rs.executeQuery("select noLoginUser from mobileappbaseinfo where id = ?", mobileAppidDisc);
|
||||
int creator = -1;
|
||||
if (rs.next()) {
|
||||
creator = rs.getInt("noLoginUser");
|
||||
}
|
||||
if (-1 == creator) {
|
||||
throw new CustomizeRunTimeException("未配置免登陆访问用户,请检查移动建模应用配置");
|
||||
}
|
||||
|
||||
String sendTo = Util.null2String(mainDataMap.get("dzyx"));
|
||||
if (StringUtils.isBlank(sendTo)) {
|
||||
throw new CustomizeRunTimeException("电子邮箱为空,邮件发送失败");
|
||||
}
|
||||
String emailTitle = "";
|
||||
String emailContent = "";
|
||||
rs.executeQuery("select yjzt ,yjnr from uf_recruit_email where mblx =? ", EmailTemplateEnum.DISC.getValue());
|
||||
if (rs.next()) {
|
||||
emailTitle = rs.getString("yjzt");
|
||||
emailContent = rs.getString("yjnr");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(emailTitle) || StringUtils.isBlank(emailContent)) {
|
||||
throw new CustomizeRunTimeException("请检查邮件模板设置");
|
||||
}
|
||||
|
||||
|
||||
// 插入DISC测评表数据
|
||||
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
dataMap.put("modeuuid", uuid);
|
||||
int formModeId = RecruitCommon.getModeIdByTableName("uf_recruit_disc");
|
||||
dataMap.put("formmodeid", formModeId);
|
||||
// 构建建模表基本数据
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, creator);
|
||||
dataMap.put("xm", billId);
|
||||
dataMap.put("sqzw", mainDataMap.get("sqzw"));
|
||||
dataMap.put("lxfs", mainDataMap.get("lxfs"));
|
||||
|
||||
dataMap.put("modedatastatus", "0");
|
||||
// 插入数据
|
||||
RecruitRecordSet.insertData(dataMap, "uf_recruit_disc");
|
||||
|
||||
int id = RecruitRecordSet.refreshRight(uuid, "uf_recruit_disc", formModeId, creator);
|
||||
|
||||
// 测评ID反写简历中心表,更新状态
|
||||
rs.executeUpdate("update uf_recruit_resume set cpzt = ? ,cpglid = ? where id = ? ", 1, id, billId);
|
||||
|
||||
// 发送邮件
|
||||
// 查询字段信息
|
||||
List<Formfield> fieldList = RecruitUtil.getFieldList("uf_recruit_resume");
|
||||
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getFieldname));
|
||||
String url = httpUrl + mobileUrlDisc + "&billid=" + id;
|
||||
if (StringUtils.isNotBlank(url)) {
|
||||
url = "<span><a href='" + url + "' target='_blank'>链接地址</a></span>";
|
||||
}
|
||||
emailContent = emailContent.replace("{链接地址}", url);
|
||||
emailContent = RecruitUtil.getReplaceContent(emailContent, fieldMapList, mainDataMap);
|
||||
RecruitUtil.sendEmail(sendTo, emailTitle, emailContent);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
result.put("errmsg", e.getMessage());
|
||||
result.put("flag", "false");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
package weaver.formmode.mzg.modeexpand.resume;
|
||||
|
||||
import com.engine.mzg.conn.RecruitCommon;
|
||||
import com.engine.mzg.conn.RecruitRecordSet;
|
||||
import com.engine.mzg.enums.EmailTemplateEnum;
|
||||
import com.engine.mzg.exception.CustomizeRunTimeException;
|
||||
import com.engine.mzg.util.RecruitUtil;
|
||||
import com.weaver.formmodel.data.model.Formfield;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.IgnoreCaseHashMap;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 发送应聘登记
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/09/05
|
||||
* @version: 1.0
|
||||
*/
|
||||
|
||||
public class SendRegistExpand extends AbstractModeExpandJavaCodeNew {
|
||||
@Override
|
||||
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
try {
|
||||
int billId;
|
||||
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
|
||||
if (requestInfo != null) {
|
||||
billId = Util.getIntValue(requestInfo.getRequestid());
|
||||
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
mainDataMap.put(property.getName(), property.getValue());
|
||||
}
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
String mobileAppidRegist = RecruitCommon.getSettingValue("MOBILE_APPID_REGIST");
|
||||
String mobileUrlRegist = RecruitCommon.getSettingValue("MOBILE_URL_REGIST");
|
||||
String httpUrl = RecruitCommon.getSettingValue("HTTP_URL");
|
||||
rs.executeQuery("select noLoginUser from mobileappbaseinfo where id = ?", mobileAppidRegist);
|
||||
int creator = -1;
|
||||
if (rs.next()) {
|
||||
creator = rs.getInt("noLoginUser");
|
||||
}
|
||||
if (-1 == creator) {
|
||||
throw new CustomizeRunTimeException("未配置免登陆访问用户,请检查移动建模应用配置");
|
||||
}
|
||||
|
||||
String sendTo = Util.null2String(mainDataMap.get("dzyx"));
|
||||
if (StringUtils.isBlank(sendTo)) {
|
||||
throw new CustomizeRunTimeException("电子邮箱为空,邮件发送失败");
|
||||
}
|
||||
String emailTitle = "";
|
||||
String emailContent = "";
|
||||
rs.executeQuery("select yjzt ,yjnr from uf_recruit_email where mblx =? ", EmailTemplateEnum.REGIST.getValue());
|
||||
if (rs.next()) {
|
||||
emailTitle = rs.getString("yjzt");
|
||||
emailContent = rs.getString("yjnr");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(emailTitle) || StringUtils.isBlank(emailContent)) {
|
||||
throw new CustomizeRunTimeException("请检查邮件模板设置");
|
||||
}
|
||||
|
||||
|
||||
// 插入应聘登记数据
|
||||
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
dataMap.put("modeuuid", uuid);
|
||||
int formModeId = RecruitCommon.getModeIdByTableName("uf_recruit_regist");
|
||||
dataMap.put("formmodeid", formModeId);
|
||||
// 构建建模表基本数据
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, creator);
|
||||
dataMap.put("xmzw", mainDataMap.get("xm"));
|
||||
dataMap.put("sqzw", mainDataMap.get("sqzw"));
|
||||
dataMap.put("lldh", mainDataMap.get("lxfs"));
|
||||
|
||||
//dataMap.put("modedatastatus", "0");
|
||||
// 插入数据
|
||||
RecruitRecordSet.insertData(dataMap, "uf_recruit_regist");
|
||||
|
||||
int id = RecruitRecordSet.refreshRight(uuid, "uf_recruit_regist", formModeId, creator);
|
||||
|
||||
// 测评ID反写简历中心表,更新状态
|
||||
rs.executeUpdate("update uf_recruit_resume set xxcjzt = ? ,ypdjid = ? where id = ? ", 1, id, billId);
|
||||
|
||||
// 发送邮件
|
||||
// 查询字段信息
|
||||
List<Formfield> fieldList = RecruitUtil.getFieldList("uf_recruit_resume");
|
||||
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getFieldname));
|
||||
String url = httpUrl + mobileUrlRegist + "&billid=" + id;
|
||||
if (StringUtils.isNotBlank(url)) {
|
||||
url = "<span><a href='" + url + "' target='_blank'>链接地址</a></span>";
|
||||
}
|
||||
emailContent = emailContent.replace("{链接地址}", url);
|
||||
emailContent = RecruitUtil.getReplaceContent(emailContent, fieldMapList, mainDataMap);
|
||||
RecruitUtil.sendEmail(sendTo, emailTitle, emailContent);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
result.put("errmsg", e.getMessage());
|
||||
result.put("flag", "false");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue