generated from dxfeng/secondev-chapanda-feishu
笔试安排保存发送信息邮件
This commit is contained in:
parent
55aa4b1fc1
commit
6ae9794495
|
|
@ -68,6 +68,7 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
messageType = RecruitModeUtil.getRecruitPropValue("RECRUIT_MESSAGE_TYPE");
|
||||
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_ADD_MESSAGE_TITLE");
|
||||
arrangeInterview(user, mainDataMap);
|
||||
sendMessage(billId);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,119 @@
|
|||
package weaver.formmode.recruit.modeexpand.written;
|
||||
|
||||
import com.engine.recruit.enums.InterviewOperateTypeEnum;
|
||||
import com.engine.recruit.util.RecruitMessageUtils;
|
||||
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.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.Map;
|
||||
|
||||
/**
|
||||
* @Author ml
|
||||
* @Date 2023/10/20 15:36
|
||||
* @Description 笔试保存按钮拓展接口
|
||||
* @Since version-1.0
|
||||
*/
|
||||
public class CreateWrittenModeExpand extends AbstractModeExpandJavaCodeNew {
|
||||
/**
|
||||
* 消息来源ID
|
||||
*/
|
||||
private String messageType;
|
||||
|
||||
/**
|
||||
* 消息提醒标题
|
||||
*/
|
||||
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<>();
|
||||
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());
|
||||
}
|
||||
// 发送信息
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
result.put("errmsg", "自定义出错信息");
|
||||
result.put("flag", "false");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private void sendMessage(int billId) {
|
||||
String querySql = "select sjhm,dzyx,tzypz,yjnr from uf_jcl_apbs a left join uf_jcl_apbs_dt1 b on a.id = b.mainid where id = ?";
|
||||
recordSet.executeQuery(querySql,billId);
|
||||
String tzypz = "";
|
||||
String sjhm = "";
|
||||
String yjnr = "";
|
||||
String dzyx = "";
|
||||
String yjtzmb = "";
|
||||
while (recordSet.next()) {
|
||||
tzypz = Util.null2String(recordSet.getString("tzypz"));
|
||||
sjhm = Util.null2String(recordSet.getString("sjhm"));
|
||||
yjnr = Util.null2String(recordSet.getString("yjnr"));
|
||||
dzyx = Util.null2String(recordSet.getString("dzyx"));
|
||||
yjtzmb = Util.null2String(recordSet.getString("yjtzmb"));
|
||||
}
|
||||
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
switch (tzypz) {
|
||||
case "0":
|
||||
// 邮件
|
||||
params.put("sendTo",dzyx);
|
||||
params.put("emailTitle",getEmailTitle(yjtzmb));
|
||||
params.put("emailContent",yjnr);
|
||||
RecruitMessageUtils.SendEmail(params);
|
||||
break;
|
||||
case "1":
|
||||
// 短信
|
||||
params.put("receiver",sjhm);
|
||||
params.put("content",yjnr);
|
||||
RecruitMessageUtils.sendSMS(params);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取邮件模板主题
|
||||
* @param id
|
||||
*/
|
||||
private String getEmailTitle (String id) {
|
||||
String emailTitle = "";
|
||||
recordSet.executeQuery("select yjzt from uf_jcl_yjtzmb where id = "+ id);
|
||||
if (recordSet.next()) {
|
||||
emailTitle = recordSet.getString("yjzt");
|
||||
}
|
||||
return emailTitle;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue