#3298328 聚才林信息采集功能二开

This commit is contained in:
dxfeng 2024-10-30 17:45:48 +08:00
parent bb6c7a6c05
commit 552853f0ce
1 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,85 @@
package weaver.formmode.recruit.modeexpand.applicant;
import com.engine.recruit.util.RecruitMessageUtils;
import com.weaver.formmodel.data.model.Formfield;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
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.stream.Collectors;
/**
* @author:dxfeng
* @createTime: 2024/10/30
* @version: 1.0
*/
public class SendInterviewEmailExpand extends AbstractModeExpandJavaCodeNew {
/**
* 消息来源ID
*/
private String messageType;
/**
* 消息提醒标题
*/
private String title;
@Override
public Map<String, String> doModeExpand(Map<String, Object> params) {
{
Map<String, String> result = new HashMap<>();
try {
//数据id
int billId;
//模块id
int modeId;
RequestInfo requestInfo = (RequestInfo) params.get("RequestInfo");
User user = (User) params.get("user");
if (requestInfo != null) {
billId = Util.getIntValue(requestInfo.getRequestid());
modeId = Util.getIntValue(requestInfo.getWorkflowid());
if (billId > 0 && modeId > 0) {
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
Map<String, Object> mainDataMap = new HashMap<>(16);
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_ADD_MESSAGE_TITLE");
String tzypz = Util.null2String(mainDataMap.get("tzypz"));
String tznr = Util.null2String(mainDataMap.get("tznr"));
String yjtzmb = Util.null2String(mainDataMap.get("yjtzmb"));
String emailTitle = RecruitModeUtil.getEmailTitle(yjtzmb);
List<Formfield> fieldList = RecruitModeUtil.getFieldList("uf_jcl_yppc");
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getLabelName));
// 发送邮件
String msgContent = RecruitModeUtil.getReplaceContent(tznr, fieldMapList, mainDataMap);
String yx = Util.null2String(mainDataMap.get("dzyx"));
String offerAttach = RecruitModeUtil.getImageFileIdsByDocIds(Util.null2String(mainDataMap.get("tjkjyprysqb")));
RecruitMessageUtils.sendEmailWithFile(yx, emailTitle, msgContent, offerAttach);
}
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
}
}