|
|
@@ -28,13 +28,18 @@ import com.kingdee.eas.custom.recuritment.utils.InitialValueUtils;
|
|
|
import com.kingdee.eas.hr.base.IRelation;
|
|
|
import com.kingdee.eas.hr.base.RelationCollection;
|
|
|
import com.kingdee.eas.hr.base.RelationFactory;
|
|
|
+import com.kingdee.shr.base.syssetting.app.osf.OSFAppUtil;
|
|
|
+import com.kingdee.shr.base.syssetting.exception.SHRWebException;
|
|
|
import com.kingdee.shr.recuritment.*;
|
|
|
+import com.kingdee.shr.recuritment.service.SelectNextStageService;
|
|
|
import com.kingdee.util.StringUtils;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.log4j.Logger;
|
|
|
import org.apache.logging.log4j.util.TriConsumer;
|
|
|
|
|
|
+import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
+import java.io.InputStreamReader;
|
|
|
import java.text.ParseException;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
@@ -49,6 +54,26 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
// private static final ZoneId BEIJING_ZONE = ZoneId.of("Asia/Shanghai");
|
|
|
|
|
|
private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Map<String, String> configMap = new HashMap<>();
|
|
|
+ private Properties propt = new Properties();//共用参数
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ public RecuritmentFacadeControllerBean() throws IOException {
|
|
|
+ String filePath = System.getProperty("EAS_HOME") + "/server/properties/beisen/beisenConfig.properties";
|
|
|
+ try (InputStreamReader reader = new InputStreamReader(new FileInputStream(filePath), "UTF-8")) {
|
|
|
+ this.propt.load(reader);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ logger.error("未找到" + filePath + "配置文件。");
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
+ Set<Map.Entry<Object, Object>> set = this.propt.entrySet();
|
|
|
+ for (Map.Entry<Object, Object> entry : set) {
|
|
|
+ configMap.put((String) entry.getKey(), (String) entry.getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 同步北森简历和附件
|
|
|
@@ -61,6 +86,8 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
@Override
|
|
|
protected void _syncBeisenResume(Context ctx, String billId) throws BOSException, EASBizException {
|
|
|
super._syncBeisenResume(ctx, billId);
|
|
|
+ IResumeBaseRec iResumeBaseRec = ResumeBaseRecFactory.getLocalInstance(ctx);
|
|
|
+
|
|
|
logger.error("billId" + billId);
|
|
|
//北森应聘者
|
|
|
IApplicantBeisen iApplicantBeisen = ApplicantBeisenFactory.getLocalInstance(ctx);
|
|
|
@@ -84,16 +111,20 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
//应聘者id
|
|
|
String candidateId = applicantBeisenInfo.getCandidateId();
|
|
|
try {
|
|
|
- IResumeBaseRec iResumeBaseRec = ResumeBaseRecFactory.getLocalInstance(ctx);
|
|
|
ResumeBaseRecCollection collection = iResumeBaseRec.getResumeBaseRecCollection("select * ,resumeState.number where applyId = '" + applyId + "'");
|
|
|
// 1. 获取简历基础信息
|
|
|
- ResumeBaseRecInfo resumeInfo = collection.get(0);
|
|
|
- if (resumeInfo == null) {
|
|
|
+ //ResumeBaseRecInfo resumeInfo = collection.get(0);
|
|
|
+ ResumeBaseRecInfo resumeInfo = null;
|
|
|
+ if (!collection.isEmpty()) {
|
|
|
+ resumeInfo = collection.get(0);
|
|
|
+ if (!"0001".equals(resumeInfo.getResumeState().getNumber())) {
|
|
|
+ // 非待筛选不同步
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
resumeInfo = new ResumeBaseRecInfo();
|
|
|
resumeInfo.put("applyId", applyId);
|
|
|
resumeInfo.put("candidateId", candidateId);
|
|
|
- } else if (!"0001".equals(resumeInfo.getResumeState().getNumber())) {
|
|
|
- continue;
|
|
|
}
|
|
|
//通过申请ID获取招聘需求
|
|
|
RecuritmentDemandInfo recuritmentDemandInfo = getRecuritmentByApplyId(ctx, applyId);
|
|
|
@@ -105,6 +136,8 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
resumeInfo.setRecuritPosition(recuritmentDemandInfo.getRecuritPosition());
|
|
|
//北森应聘者-需求管理
|
|
|
applicantBeisenInfo.setRecuritment(recuritmentDemandInfo);
|
|
|
+ //招聘需求名称
|
|
|
+ //applicantBeisenInfo.setRecuritmentName(recuritmentDemandInfo.getPositionName());
|
|
|
// 2. 获取 标准简历数据
|
|
|
JSONObject resumeJson = getResumeByApplyId(applyId);
|
|
|
logger.error("resumeJson--" + resumeJson);
|
|
|
@@ -112,16 +145,38 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
if (200 == code) {
|
|
|
JSONObject data = resumeJson.getJSONObject("data");
|
|
|
// 3. 处理简历各部分数据
|
|
|
- processResumeSections(ctx, data, resumeInfo);
|
|
|
+ Map<String, String> mapData = processResumeSections(ctx, data, resumeInfo);
|
|
|
+ //北森应聘者--应聘者名称
|
|
|
+ applicantBeisenInfo.setCandidateName(mapData.get("name"));
|
|
|
//删除附件信息
|
|
|
- AttachmentUtils.deleteAttachment(ctx, resumeInfo.getId().toString());
|
|
|
+ String where = "where boid = '" + resumeInfo.getId().toString() + "' and (attachment.name like '%标准简历%' or attachment.name like '%面试评价%' or attachment.name like '%原始简历%' )";
|
|
|
+ AttachmentUtils.deleteAttachment(ctx, where);
|
|
|
// 根据申请Id获取并处理简历文件
|
|
|
processResumeFile(applyId, ctx, resumeInfo, "标准简历");
|
|
|
// 获取并处理面试评价文件
|
|
|
processResumeFile(applyId, ctx, resumeInfo, "面试评价");
|
|
|
- applicantBeisenInfo.setSyncResult("同步成功!");
|
|
|
- applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.SUCCESS);
|
|
|
- successSize++;
|
|
|
+ // 获取并处理原始简历文件
|
|
|
+ processResumeFile(applyId, ctx, resumeInfo, "原始简历");
|
|
|
+ // 获取并处理背调信息文件
|
|
|
+ processResumeFile(applyId, ctx, resumeInfo, "背调信息");
|
|
|
+ //生成录用报批
|
|
|
+ //String errorMsg = saveRecApproval(ctx, mapData);
|
|
|
+ String serviceName = "generateHireApprovalService";
|
|
|
+ Map param = new HashMap();
|
|
|
+ param.put("resumeBaseRecId", mapData.get("resumeBaseRecId").toString());
|
|
|
+ String errorMsg = (String) OSFAppUtil.callService(ctx, serviceName, param);
|
|
|
+ //String errorMsg = null;
|
|
|
+ if (com.kingdee.bos.rabbitmq.util.StringUtils.isEmpty(errorMsg)) {
|
|
|
+ //修改录用报批数据
|
|
|
+ updateApproval(ctx, mapData);
|
|
|
+ //修复简历数据
|
|
|
+ updateResumeBaseRe(ctx, iResumeBaseRec, mapData.get("resumeBaseRecId").toString());
|
|
|
+ applicantBeisenInfo.setSyncResult("同步成功!");
|
|
|
+ applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.SUCCESS);
|
|
|
+ successSize++;
|
|
|
+ } else {
|
|
|
+ throw new BOSException(errorMsg.toString());
|
|
|
+ }
|
|
|
} else {
|
|
|
throw new BOSException(resumeJson.getString("message"));
|
|
|
}
|
|
|
@@ -133,11 +188,104 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
iApplicantBeisen.save(applicantBeisenInfo);
|
|
|
errorSize++;
|
|
|
logger.error("简历处理失败: " + e.getMessage(), e);
|
|
|
+ msgMap.put("error", e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
logger.error("成功条数" + successSize);
|
|
|
logger.error("失败条数" + errorSize);
|
|
|
+ msgMap.put("successSize", successSize);
|
|
|
+ msgMap.put("errorSize", errorSize);
|
|
|
+ //return msgMap;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修复简历数据
|
|
|
+ *
|
|
|
+ * @param ctx
|
|
|
+ * @param iResumeBaseRec
|
|
|
+ * @param resumeBaseRecId
|
|
|
+ * @throws BOSException
|
|
|
+ * @throws EASBizException
|
|
|
+ */
|
|
|
+ public void updateResumeBaseRe(Context ctx, IResumeBaseRec iResumeBaseRec, String resumeBaseRecId) throws BOSException, EASBizException {
|
|
|
+ ResumeBaseRecInfo resumeBaseRecInfo = iResumeBaseRec.getResumeBaseRecInfo(new ObjectUuidPK(resumeBaseRecId));
|
|
|
+ IWorkingExp iWorkingExp = WorkingExpFactory.getLocalInstance(ctx);
|
|
|
+ WorkingExpCollection workingExpColl = iWorkingExp.getWorkingExpCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "' order by dateEnd desc");
|
|
|
+ if (!workingExpColl.isEmpty()) {
|
|
|
+ WorkingExpInfo workingExpInfo = workingExpColl.get(0);
|
|
|
+ //职位
|
|
|
+ resumeBaseRecInfo.setLastJob(workingExpInfo.getPosition());
|
|
|
+ //公司
|
|
|
+ resumeBaseRecInfo.setLastCompany(workingExpInfo.getCompany());
|
|
|
+ //行业
|
|
|
+ resumeBaseRecInfo.setLastIndustry(workingExpInfo.getIndustry());
|
|
|
+ }
|
|
|
+ SelectorItemCollection sic = new SelectorItemCollection();
|
|
|
+ sic.add("lastJob");
|
|
|
+ sic.add("lastCompany");
|
|
|
+ sic.add("lastIndustry");
|
|
|
+ iResumeBaseRec.updatePartial(resumeBaseRecInfo, sic);
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改录用报批数据
|
|
|
+ *
|
|
|
+ * @param ctx
|
|
|
+ * @param mapData
|
|
|
+ */
|
|
|
+ public void updateApproval(Context ctx, Map<String, String> mapData) throws BOSException, EASBizException {
|
|
|
+ logger.error("updateApproval--");
|
|
|
+ //简历ID
|
|
|
+ String resumeBaseRecId = mapData.get("resumeBaseRecId");
|
|
|
+ logger.error("简历ID" + resumeBaseRecId);
|
|
|
+ //获取录用报批 通过结束日期排序 获取最高学历
|
|
|
+ IRecApproval iRecApproval = RecApprovalFactory.getLocalInstance(ctx);
|
|
|
+ RecApprovalCollection recApprovalCollection = iRecApproval.getRecApprovalCollection("where resumeBaseRec = '" + resumeBaseRecId + "'");
|
|
|
+ if (recApprovalCollection.isEmpty()) {
|
|
|
+ throw new BOSException("未查询到录用报批数据!");
|
|
|
+ }
|
|
|
+ RecApprovalInfo recApprovalInfo = recApprovalCollection.get(0);
|
|
|
+ //查询简历-教育经历数据
|
|
|
+ IEducationExpREC iEducationExpREC = EducationExpRECFactory.getLocalInstance(ctx);
|
|
|
+ EducationExpRECCollection educationExpRECCollection = iEducationExpREC.getEducationExpRECCollection("where resumeBase = '" + resumeBaseRecId + "' order by dateEnd desc");
|
|
|
+ if (!educationExpRECCollection.isEmpty()) {
|
|
|
+ EducationExpRECInfo educationExpRECInfo = educationExpRECCollection.get(0);
|
|
|
+ //第一学历
|
|
|
+ recApprovalInfo.put("firsteducation", educationExpRECInfo.getDegreeF7().getId());
|
|
|
+ //专业
|
|
|
+ recApprovalInfo.put("firstspeciality", educationExpRECInfo.getMajor());
|
|
|
+ //毕业院校
|
|
|
+ recApprovalInfo.put("firstschool", educationExpRECInfo.getSchool());
|
|
|
+ SelectorItemCollection sic = new SelectorItemCollection();
|
|
|
+ sic.add("firsteducation");
|
|
|
+ sic.add("firstspeciality");
|
|
|
+ sic.add("firstschool");
|
|
|
+ iRecApproval.updatePartial(recApprovalInfo, sic);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 自动生成录用报批
|
|
|
+ * 第二次调整新增代码
|
|
|
+ *
|
|
|
+ * @param ctx
|
|
|
+ * @param mapData
|
|
|
+ * @return
|
|
|
+ * @throws SHRWebException
|
|
|
+ * @throws BOSException
|
|
|
+ * @throws EASBizException
|
|
|
+ */
|
|
|
+ public String saveRecApproval(Context ctx, Map mapData) throws SHRWebException, BOSException, EASBizException {
|
|
|
+ IResumeState iResumeState = ResumeStateFactory.getLocalInstance(ctx);
|
|
|
+ //"0009" 待报批 录用报批状态
|
|
|
+ ResumeStateInfo resumeStateInfo = iResumeState.getResumeStateInfo("where number = '0009'");
|
|
|
+ String resumeBaseRecId = mapData.get("resumeBaseRecId").toString();
|
|
|
+ String resumeStateId = resumeStateInfo.getId().toString();
|
|
|
+ String errorMsg = SelectNextStageService.getInstance().dealNext(ctx, resumeBaseRecId, resumeStateId, "resumeList");
|
|
|
+ //String errorMsg = SelectNextStageUtils.getInstance().dealNext(ctx, resumeBaseRecId, resumeStateId, "resumeList");
|
|
|
+ logger.error("errorMsg--" + errorMsg);
|
|
|
+ return errorMsg;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -181,21 +329,71 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
throw new BOSException("未查询到需求IDRecruitRequirementIds");
|
|
|
}
|
|
|
String recruitRequirementId = recruit.getString("value");
|
|
|
- //招聘需求
|
|
|
- IRecuritmentDemand iRecuritmentDemand = RecuritmentDemandFactory.getLocalInstance(ctx);
|
|
|
- if (StringUtils.isEmpty(recruitRequirementId)) {
|
|
|
+ //未查询到北森的该人员招聘需求
|
|
|
+ if (com.kingdee.bos.rabbitmq.util.StringUtils.isEmpty(recruitRequirementId)) {
|
|
|
throw new BOSException("通过applyId[" + applyId + "]未查询到招聘需求!");
|
|
|
}
|
|
|
logger.error("requirementId--" + recruitRequirementId);
|
|
|
+ //根据需求ID获取招聘需求
|
|
|
+ JSONArray items = new JSONArray();
|
|
|
+ items.add(recruitRequirementId);
|
|
|
+ JSONObject requirements = beisenApiClient.callApi(BeisenParam.GET_REQUIREMENTS, items);
|
|
|
+ logger.error("requirements--" + requirements);
|
|
|
+ if (200 != requirements.getInteger("code")) {
|
|
|
+ throw new BOSException("根据需求ID获取招聘需求失败,原因:" + entity.get("message"));
|
|
|
+ }
|
|
|
+ JSONArray data = requirements.getJSONArray("data");
|
|
|
+ JSONObject dataJson = data.getJSONObject(0);
|
|
|
+ //招聘需求
|
|
|
+ IRecuritmentDemand iRecuritmentDemand = RecuritmentDemandFactory.getLocalInstance(ctx);
|
|
|
//招聘需求
|
|
|
RecuritmentDemandCollection recuritmentDemandCollection = iRecuritmentDemand.getRecuritmentDemandCollection("where requirementId='" + recruitRequirementId + "'");
|
|
|
+ //shr未查询到对应的招聘需求
|
|
|
if (recuritmentDemandCollection.isEmpty()) {
|
|
|
- throw new BOSException("sHR未查询到对应的招聘需求,北森需求ID:" + recruitRequirementId);
|
|
|
+ //String message = "sHR未查询到对应的招聘需求,北森需求ID:" + recruitRequirementId + ",需求名称:" + dataJson.getString("name");;
|
|
|
+ // 推送未查询到招聘需求消息至北森
|
|
|
+ pushMessageToBeisen(applyId, configMap.get("syncToBsErrorMsg"));
|
|
|
+ //pushMessageToBeisen(applyId, "显示匹配不上金蝶原始需求单据");
|
|
|
+ throw new BOSException("sHR未查询到对应的招聘需求,需求名称::" + dataJson.getString("name") + ",北森需求ID" + recruitRequirementId);
|
|
|
}
|
|
|
+ //成功則修改北森字段为空
|
|
|
+ pushMessageToBeisen(applyId, "");
|
|
|
return recuritmentDemandCollection.get(0);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 推送消息至北森
|
|
|
+ *
|
|
|
+ * @param applyId 申请ID
|
|
|
+ * @param message 消息
|
|
|
+ */
|
|
|
+ public void pushMessageToBeisen(String applyId, String message) throws IOException {
|
|
|
+ try {
|
|
|
+
|
|
|
+ BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
|
|
|
+ //POST_UPDATEAPPLYLIST 更新申请信息
|
|
|
+ JSONObject pamas = new JSONObject();
|
|
|
+ JSONArray applyList = new JSONArray();
|
|
|
+ JSONObject pama = new JSONObject();
|
|
|
+ JSONObject fieldValues = new JSONObject();
|
|
|
+ //测试环境:extjianlitongbujieguo_433899_1252390002
|
|
|
+ //正式环境:extjianlitongbujieguo_614492_1252390002
|
|
|
+ fieldValues.put(configMap.get("syncToErrorBS"), message);//是否同步成功
|
|
|
+ pama.put("fieldValues", fieldValues);
|
|
|
+ pama.put("applyId", applyId);
|
|
|
+ applyList.add(pama);
|
|
|
+ pamas.put("applyList", applyList);
|
|
|
+ logger.error("pushMessageToBeisen--pamas--" + pamas);
|
|
|
+ JSONObject result = beisenApiClient.callApi(BeisenParam.POST_UPDATEAPPLYLIST, pamas);
|
|
|
+ logger.error("pushMessageToBeisen--result--" + result);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 处理简历文件或面试评价文件
|
|
|
*
|
|
|
@@ -206,38 +404,93 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
*/
|
|
|
private void processResumeFile(String applyId, Context ctx, ResumeBaseRecInfo resumeInfo, String fileType) {
|
|
|
logger.error("processResumeFile--");
|
|
|
+ //是否是背景信息
|
|
|
+ boolean isOrigin = false;
|
|
|
try {
|
|
|
// 根据文件类型获取对应的文件信息
|
|
|
- JSONObject fileInfo = "标准简历".equals(fileType) ? getStandardResumeFileUrlByApplyId(applyId) : getInterviewEvaluationFile(applyId);
|
|
|
+ //JSONObject fileInfo = "标准简历".equals(fileType) ? getStandardResumeFileUrlByApplyId(applyId) : getInterviewEvaluationFile(applyId);
|
|
|
+ JSONObject fileInfo = null;
|
|
|
+ String param = "?applyId=" + applyId;
|
|
|
+ BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
|
|
|
+ if ("标准简历".equals(fileType)) {
|
|
|
+ //fileInfo = getStandardResumeFileUrlByApplyId(applyId);
|
|
|
+ fileInfo = beisenApiClient.callGetApi(BeisenParam.GET_STANDERDRESUMEFILURLBYAPPLYID + param, new JSONObject());
|
|
|
+ } else if ("面试评价".equals(fileType)) {
|
|
|
+ //fileInfo = getInterviewEvaluationFile(applyId);
|
|
|
+ fileInfo = beisenApiClient.callGetApi(BeisenParam.GET_INTERVIEWEVALUATIONFILE + param, new JSONObject());
|
|
|
+ } else if ("原始简历".equals(fileType)) {
|
|
|
+ fileInfo = beisenApiClient.callGetApi(BeisenParam.GET_ORIGINRESUMEBYAPPLYID + param, new JSONObject());
|
|
|
+ } else if ("背调信息".equals(fileType)) {
|
|
|
+ param = "?applyId=" + applyId + "&supportManualCreate=true";
|
|
|
+ String GET_BACKGROUNDINVESTIGATIONBYAPPLYID = "https://openapi.italent.cn/RecruitV6/api/v1/Investigation/GetBackgroundInvestigationByApplyId";
|
|
|
+ //背景调查附件单独处理
|
|
|
+ //fileInfo = beisenApiClient.callGetApi(BeisenParam.GET_BACKGROUNDINVESTIGATIONBYAPPLYID + param, new JSONObject());
|
|
|
+ fileInfo = beisenApiClient.callGetApi(GET_BACKGROUNDINVESTIGATIONBYAPPLYID + param, new JSONObject());
|
|
|
+ logger.error("背调信息--" + fileInfo);
|
|
|
+ //originResume
|
|
|
+ isOrigin = true;
|
|
|
+ }
|
|
|
logger.error("fileInfo--" + fileInfo);
|
|
|
if (fileInfo == null) {
|
|
|
throw new BOSException("获取{}文件信息失败: 返回结果为null" + fileType);
|
|
|
}
|
|
|
Integer code = fileInfo.getInteger("code");
|
|
|
if (!Integer.valueOf(200).equals(code)) {
|
|
|
- throw new BOSException("获取{" + fileType + "}文件失败: 返回code={" + code + "}");
|
|
|
- }
|
|
|
- JSONObject data = fileInfo.getJSONObject("data");
|
|
|
- if (data == null) {
|
|
|
- throw new BOSException("获取{" + fileType + "}文件失败: data字段为空");
|
|
|
- }
|
|
|
- String downloadUrl = data.getString("downloadUrl");
|
|
|
- String dfsPath = data.getString("dfsPath");
|
|
|
- if (com.kingdee.bos.rabbitmq.util.StringUtils.isBlank(downloadUrl) || com.kingdee.bos.rabbitmq.util.StringUtils.isBlank(dfsPath)) {
|
|
|
- throw new BOSException("获取{" + fileType + "}文件失败: downloadUrl或dfsPath为空");
|
|
|
+ //未获取到简历不执行
|
|
|
+ logger.error("获取{" + fileType + "}文件失败: 返回code={" + code + "}");
|
|
|
+ return;
|
|
|
+ //throw new BOSException("获取{" + fileType + "}文件失败: 返回code={" + code + "}");
|
|
|
+ }
|
|
|
+ logger.error("isOrigin--" + isOrigin);
|
|
|
+ //背景调查附件单独处理
|
|
|
+ if (isOrigin) {
|
|
|
+ JSONArray data = fileInfo.getJSONArray("data");
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
+ JSONObject dataJson = data.getJSONObject(i);
|
|
|
+ //fileDetails-背调报告文件详情列表
|
|
|
+ JSONArray fileDetails = dataJson.getJSONArray("fileDetails");
|
|
|
+ for (int j = 0; j < fileDetails.size(); j++) {
|
|
|
+ JSONObject file = fileDetails.getJSONObject(j);
|
|
|
+ String fileName = file.getString("fileName");
|
|
|
+ String fileExtension = AttachmentUtils.extractFileExtension(fileName);
|
|
|
+ String customFileName = "北森" + (fileType + (j + 1)) + "." + fileExtension;
|
|
|
+ //删除之前的附件
|
|
|
+ String where = "where boid = '" + resumeInfo.getId().toString() + "' and name like '%" + fileName + "%'";
|
|
|
+ logger.error("where--" + where);
|
|
|
+ AttachmentUtils.deleteAttachment(ctx, where);
|
|
|
+ String downloadUrl = file.getString("downloadUrl");
|
|
|
+ // 获取文件内容并保存
|
|
|
+ byte[] fileData = AttachmentUtils.getBytesByNetURL("https:" + downloadUrl);
|
|
|
+ if (fileData == null || fileData.length == 0) {
|
|
|
+ throw new BOSException("获取{" + fileType + "}文件内容失败: 下载内容为空");
|
|
|
+ }
|
|
|
+ AttachmentUtils.insertAttachment(ctx, customFileName, resumeInfo, fileData, fileName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ JSONObject data = fileInfo.getJSONObject("data");
|
|
|
+ if (data == null) {
|
|
|
+ throw new BOSException("获取{" + fileType + "}文件失败: data字段为空");
|
|
|
+ }
|
|
|
+ String downloadUrl = data.getString("downloadUrl");
|
|
|
+ String dfsPath = data.getString("dfsPath");
|
|
|
+ if (com.kingdee.bos.rabbitmq.util.StringUtils.isBlank(downloadUrl) || com.kingdee.bos.rabbitmq.util.StringUtils.isBlank(dfsPath)) {
|
|
|
+ throw new BOSException("获取{" + fileType + "}文件失败: downloadUrl或dfsPath为空");
|
|
|
+ }
|
|
|
+ // 处理文件名
|
|
|
+ String fileName = AttachmentUtils.extractFileNameFromPath(dfsPath);
|
|
|
+ String fileExtension = AttachmentUtils.extractFileExtension(fileName);
|
|
|
+ String customFileName = "北森" + fileType + "." + fileExtension;
|
|
|
+ // 获取文件内容并保存
|
|
|
+ byte[] fileData = AttachmentUtils.getBytesByNetURL("https:" + downloadUrl);
|
|
|
+ if (fileData == null || fileData.length == 0) {
|
|
|
+ throw new BOSException("获取{" + fileType + "}文件内容失败: 下载内容为空");
|
|
|
+ }
|
|
|
+ AttachmentUtils.insertAttachment(ctx, customFileName, resumeInfo, fileData, fileName);
|
|
|
+ logger.error("{" + fileType + "}文件处理成功: {" + customFileName + "}");
|
|
|
}
|
|
|
- // 处理文件名
|
|
|
- String fileName = AttachmentUtils.extractFileNameFromPath(dfsPath);
|
|
|
- String fileExtension = AttachmentUtils.extractFileExtension(fileName);
|
|
|
- String customFileName = "北森" + fileType + "." + fileExtension;
|
|
|
|
|
|
- // 获取文件内容并保存
|
|
|
- byte[] fileData = AttachmentUtils.getBytesByNetURL("https:" + downloadUrl);
|
|
|
- if (fileData == null || fileData.length == 0) {
|
|
|
- throw new BOSException("获取{" + fileType + "}文件内容失败: 下载内容为空");
|
|
|
- }
|
|
|
- AttachmentUtils.insertAttachment(ctx, customFileName, resumeInfo, fileData);
|
|
|
- logger.info("{" + fileType + "}文件处理成功: {" + customFileName + "}");
|
|
|
+ //}
|
|
|
} catch (Exception e) {
|
|
|
logger.error("处理" + fileType + "文件时发生异常", e);
|
|
|
}
|
|
|
@@ -247,9 +500,10 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
/**
|
|
|
* 处理简历各部分数据
|
|
|
*/
|
|
|
- private void processResumeSections(Context ctx, JSONObject resumeJson, ResumeBaseRecInfo resumeInfo) throws BOSException, EASBizException, ParseException, IOException {
|
|
|
+ private Map processResumeSections(Context ctx, JSONObject resumeJson, ResumeBaseRecInfo resumeInfo) throws BOSException, EASBizException, ParseException, IOException {
|
|
|
+ Map mapData = new HashMap();
|
|
|
JSONArray personProfile = resumeJson.getJSONArray("personProfile");
|
|
|
- saveResumeBaseRec(ctx, personProfile, resumeInfo);
|
|
|
+ saveResumeBaseRec(ctx, personProfile, resumeInfo, mapData);
|
|
|
JSONArray education = resumeJson.getJSONArray("education");
|
|
|
saveEducationExpRE(ctx, education, resumeInfo);
|
|
|
// 使用Map定义简历部分与处理方法的对应关系
|
|
|
@@ -275,33 +529,34 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ return mapData;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 根据申请Id获取标准简历文件
|
|
|
- *
|
|
|
- * @param applyId
|
|
|
- * @return
|
|
|
- */
|
|
|
- public JSONObject getStandardResumeFileUrlByApplyId(String applyId) throws IOException {
|
|
|
- String param = "?applyId=" + applyId;
|
|
|
- BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
|
|
|
- JSONObject jsonObject = beisenApiClient.callGetApi(BeisenParam.GET_STANDERDRESUMEFILURLBYAPPLYID + param, new JSONObject());
|
|
|
- return jsonObject;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据申请Id获取标准简历文件
|
|
|
- *
|
|
|
- * @param applyId
|
|
|
- * @return
|
|
|
- */
|
|
|
- public JSONObject getInterviewEvaluationFile(String applyId) throws IOException {
|
|
|
- String param = "?applyId=" + applyId;
|
|
|
- BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
|
|
|
- JSONObject jsonObject = beisenApiClient.callGetApi(BeisenParam.GET_INTERVIEWEVALUATIONFILE + param, new JSONObject());
|
|
|
- return jsonObject;
|
|
|
- }
|
|
|
+ ///**
|
|
|
+ // * 根据申请Id获取标准简历文件
|
|
|
+ // *
|
|
|
+ // * @param applyId
|
|
|
+ // * @return
|
|
|
+ // */
|
|
|
+ //public JSONObject getStandardResumeFileUrlByApplyId(String applyId) throws IOException {
|
|
|
+ // String param = "?applyId=" + applyId;
|
|
|
+ // BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
|
|
|
+ // JSONObject jsonObject = beisenApiClient.callGetApi(BeisenParam.GET_STANDERDRESUMEFILURLBYAPPLYID + param, new JSONObject());
|
|
|
+ // return jsonObject;
|
|
|
+ //}
|
|
|
+ //
|
|
|
+ ///**
|
|
|
+ // * 根据申请Id获取标准简历文件
|
|
|
+ // *
|
|
|
+ // * @param applyId
|
|
|
+ // * @return
|
|
|
+ // */
|
|
|
+ //public JSONObject getInterviewEvaluationFile(String applyId) throws IOException {
|
|
|
+ // String param = "?applyId=" + applyId;
|
|
|
+ // BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
|
|
|
+ // JSONObject jsonObject = beisenApiClient.callGetApi(BeisenParam.GET_INTERVIEWEVALUATIONFILE + param, new JSONObject());
|
|
|
+ // return jsonObject;
|
|
|
+ //}
|
|
|
|
|
|
/**
|
|
|
* 根据申请Id获取标准简历
|
|
|
@@ -322,7 +577,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
*
|
|
|
* @param personProfile
|
|
|
*/
|
|
|
- public void saveResumeBaseRec(Context ctx, JSONArray personProfile, ResumeBaseRecInfo resumeBaseRecInfo) throws BOSException, EASBizException, ParseException, IOException {
|
|
|
+ public void saveResumeBaseRec(Context ctx, JSONArray personProfile, ResumeBaseRecInfo resumeBaseRecInfo, Map mapData) throws BOSException, EASBizException, ParseException, IOException {
|
|
|
logger.error("personProfile--" + personProfile);
|
|
|
BeisenParamByProperties beisenParamByProperties = new BeisenParamByProperties();
|
|
|
Map<String, String> config = beisenParamByProperties.getConfig();
|
|
|
@@ -368,7 +623,11 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
resumeBaseRecInfo.setWorkDate(DateTimeUtils.parseDate(text, "yyyy/MM/dd"));
|
|
|
}
|
|
|
//参加工作年限 workSeniority
|
|
|
- if ("YearsOfWork".equals(name)) {
|
|
|
+ if ("YearsOfWork".equals(name) && !com.kingdee.util.StringUtils.isEmpty(text)) {
|
|
|
+ resumeBaseRecInfo.setWorkSeniority(text);
|
|
|
+ }
|
|
|
+ //工作年限 YearsOfWork
|
|
|
+ if ("YearsOfWork".equals(name) && !com.kingdee.util.StringUtils.isEmpty(text)) {
|
|
|
resumeBaseRecInfo.setWorkSeniority(text);
|
|
|
}
|
|
|
//身份证号码 identityCardNo
|
|
|
@@ -488,7 +747,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
}
|
|
|
//毕业学校 school
|
|
|
if ("LastSchool".equals(name)) {
|
|
|
- if (StringUtils.isEmpty(text)) {
|
|
|
+ if (com.kingdee.util.StringUtils.isEmpty(text)) {
|
|
|
throw new BOSException("毕业学校不能为空!");
|
|
|
}
|
|
|
resumeBaseRecInfo.setName(text);
|
|
|
@@ -558,21 +817,21 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
}
|
|
|
}
|
|
|
String errorMsg = ",身份证号码、手机号为必填数据,请在北森维护数据后再次同步!";
|
|
|
- if (StringUtils.isEmpty(resumeBaseRecInfo.getIdentityCardNo()) && StringUtils.isEmpty(resumeBaseRecInfo.getPassportNo())) {
|
|
|
+ if (com.kingdee.util.StringUtils.isEmpty(resumeBaseRecInfo.getIdentityCardNo()) && com.kingdee.util.StringUtils.isEmpty(resumeBaseRecInfo.getPassportNo())) {
|
|
|
throw new BOSException("身份证号码不能为空" + errorMsg);
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(resumeBaseRecInfo.getMobilePhone())) {
|
|
|
+ if (com.kingdee.util.StringUtils.isEmpty(resumeBaseRecInfo.getMobilePhone())) {
|
|
|
throw new BOSException("手机号码不能为空" + errorMsg);
|
|
|
}
|
|
|
IResumeBaseRec iResumeBaseRec = ResumeBaseRecFactory.getLocalInstance(ctx);
|
|
|
IObjectPK save = iResumeBaseRec.save(resumeBaseRecInfo);
|
|
|
logger.error("resumeBaseRecId--" + save);
|
|
|
+ mapData.put("resumeBaseRecId", save.toString());
|
|
|
+ mapData.put("name", resumeBaseRecInfo.getName());
|
|
|
// } catch (Exception e) {
|
|
|
// logger.error("简历基本信息报错信息:" + e.getMessage());
|
|
|
// throw new RuntimeException(e);
|
|
|
// }
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -744,10 +1003,10 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
if (dateStart == null) {
|
|
|
throw new BOSException("教育经历:入学时间不能为空" + errorMsg);
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(educationExpRECInfo.getMajor())) {
|
|
|
+ if (com.kingdee.util.StringUtils.isEmpty(educationExpRECInfo.getMajor())) {
|
|
|
throw new BOSException("教育经历:专业不能为空" + errorMsg);
|
|
|
}
|
|
|
- if (StringUtils.isEmpty(educationExpRECInfo.getSchool())) {
|
|
|
+ if (com.kingdee.util.StringUtils.isEmpty(educationExpRECInfo.getSchool())) {
|
|
|
throw new BOSException("教育经历:毕业院校不能为空" + errorMsg);
|
|
|
}
|
|
|
if (educationExpRECInfo.getDegreeF7() == null) {
|
|
|
@@ -1130,7 +1389,6 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
|
|
|
logger.error("社会关系保存失败!" + e.getMessage());
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|