优化简历卡片,面试过程数据获取和展示逻辑

This commit is contained in:
dxfeng 2024-11-29 10:27:10 +08:00
parent 0e5b8a768f
commit b419963703
2 changed files with 79 additions and 52 deletions

View File

@ -1,9 +1,13 @@
package com.engine.recruit.entity.card.process;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.general.BaseBean;
import weaver.hrm.resource.ResourceComInfo;
import java.util.ArrayList;
import java.util.List;
/**
* @author:dxfeng
* @createTime: 2024/08/07
@ -15,9 +19,7 @@ public class InterviewProcess {
private String zt;
private String msrq;
private String msg;
private String ptmsg;
private String jg;
List<InterviewDetail> interviewDetails = new ArrayList<>();
public String getZt() {
@ -41,56 +43,69 @@ public class InterviewProcess {
this.msrq = msrq;
}
public String getMsg() {
try {
String lastnames = new ResourceComInfo().getLastnames(msg);
if (StringUtils.isNotBlank(lastnames)) {
return "面试官:" + lastnames;
}
} catch (Exception e) {
new BaseBean().writeLog("人员姓名转换失败", e);
}
return "";
public List<InterviewDetail> getInterviewDetails() {
return interviewDetails;
}
public void setMsg(String msg) {
this.msg = msg;
public void addInterviewDetail(String msg, String msjg) {
interviewDetails.add(new InterviewDetail(msg, msjg));
}
public String getPtmsg() {
try {
String lastnames = new ResourceComInfo().getLastnames(ptmsg);
if (StringUtils.isNotBlank(lastnames)) {
return "陪同面试官:" + lastnames;
}
} catch (Exception e) {
new BaseBean().writeLog("人员姓名转换失败", e);
}
return "";
}
public void setPtmsg(String ptmsg) {
this.ptmsg = ptmsg;
}
public String getJg() {
if ("0".equals(jg)) {
return "通过";
} else if ("1".equals(jg)) {
return "不通过";
}
return "待定";
}
public void setJg(String jg) {
this.jg = jg;
}
@Override
public String toString() {
if ("0".equals(zt)) {
return getMsrq() + " " + getZt() + " (" + getMsg() + ")";
StringBuilder toString = new StringBuilder(getMsrq());
if(CollectionUtils.isNotEmpty(interviewDetails)) {
toString.append(" ").append("面试官:");
for (InterviewDetail interviewDetail : interviewDetails) {
toString.append(" ").append(interviewDetail.toString());
}
}
return toString.toString();
}
public static class InterviewDetail{
private final String msg;
private final String msjg;
InterviewDetail(String msg,String msjg) {
this.msg = msg;
this.msjg = msjg;
}
public String getMsg() {
try {
String lastnames = new ResourceComInfo().getLastnames(msg);
if (StringUtils.isNotBlank(lastnames)) {
return lastnames;
}
} catch (Exception e) {
new BaseBean().writeLog("人员姓名转换失败", e);
}
return "";
}
public String getMsjg() {
if (StringUtils.isBlank(msjg)) {
return "未反馈";
} else if ("0".equals(msjg)) {
return "通过";
} else if ("1".equals(msjg)) {
return "不通过";
} else {
return "待定";
}
}
@Override
public String toString() {
String msgName = getMsg();
if (StringUtils.isNotBlank(msgName)) {
return msgName + " (" + getMsjg()+")";
}
return "";
}
return getMsrq() + " " + getJg() + " (" + getMsg() + ")";
}
}

View File

@ -598,7 +598,7 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
* @param recruitProcessList
*/
private void buildInterviewProcess(String id, RecordSet rs, List<RecruitProcess> recruitProcessList) {
rs.executeQuery("select zt, msrq, msg, ptmsg, jg, modedatacreatedate, modedatacreatetime from uf_jcl_ms where ypz = ? order by msrq desc", id);
rs.executeQuery("select id,zt, msrq, msg, ptmsg, jg, modedatacreatedate, modedatacreatetime from uf_jcl_ms where ypz = ? order by msrq desc", id);
if (rs.next()) {
// 面试状态
String zt = rs.getString("zt");
@ -606,8 +606,6 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
String msrq = rs.getString("msrq");
// 面试官
String msg = rs.getString("msg");
// 陪同面试官
String ptmsg = rs.getString("ptmsg");
// 结果
String jg = rs.getString("jg");
String date = rs.getString("modedatacreatedate");
@ -616,9 +614,23 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
InterviewProcess interviewProcess = new InterviewProcess();
interviewProcess.setZt(zt);
interviewProcess.setMsrq(msrq);
interviewProcess.setMsg(msg);
interviewProcess.setPtmsg(ptmsg);
interviewProcess.setJg(jg);
String msId = rs.getString("id");
// 查询面试评价
rs.executeQuery("select msg,jg from uf_jcl_mspjfk where msid = ?", msId);
while(rs.next()){
interviewProcess.addInterviewDetail(rs.getString("msg"), rs.getString("jg"));
}
List<InterviewProcess.InterviewDetail> interviewDetails = interviewProcess.getInterviewDetails();
if(CollectionUtils.isEmpty(interviewDetails)){
if(StringUtils.isNotBlank(msg)){
String[] split = msg.split(",");
for (String s : split) {
interviewProcess.addInterviewDetail(s, jg);
}
}
}
RecruitProcess process = new RecruitProcess();
process.setTitle(InterviewProcess.TITLE);