Browse Source

Merge branch 'master' of http://47.92.104.23:3000/project/guyitang

9060 3 tuần trước cách đây
mục cha
commit
e296351b72

+ 968 - 7
src/com/kingdee/eas/custom/recuritment/task/RecuritmentFacadeControllerBean.java

@@ -1,22 +1,41 @@
 package com.kingdee.eas.custom.recuritment.task;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
+import com.kingdee.bos.dao.IObjectPK;
 import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
 import com.kingdee.bos.metadata.entity.*;
 import com.kingdee.bos.metadata.query.util.CompareType;
+import com.kingdee.bos.util.BOSUuid;
+import com.kingdee.eas.basedata.hraux.*;
+import com.kingdee.eas.basedata.org.HROrgUnitInfo;
+import com.kingdee.eas.basedata.person.BloodType;
+import com.kingdee.eas.basedata.person.Genders;
 import com.kingdee.eas.common.EASBizException;
-import com.kingdee.shr.recuritment.IRecuritmentDemand;
-import com.kingdee.shr.recuritment.RecuritmentDemandCollection;
-import com.kingdee.shr.recuritment.RecuritmentDemandFactory;
-import com.kingdee.shr.recuritment.RecuritmentDemandInfo;
+import com.kingdee.eas.csinterface.agent.service.base.util.DateTimeUtils;
+import com.kingdee.eas.custom.beisen.utils.BeisenApiClient;
+import com.kingdee.eas.custom.beisen.utils.BeisenParam;
+import com.kingdee.eas.custom.beisen.utils.BeisenParamByProperties;
+import com.kingdee.eas.custom.recuritment.ApplicantBeisenCollection;
+import com.kingdee.eas.custom.recuritment.ApplicantBeisenFactory;
+import com.kingdee.eas.custom.recuritment.ApplicantBeisenInfo;
+import com.kingdee.eas.custom.recuritment.IApplicantBeisen;
+import com.kingdee.eas.custom.recuritment.bizEnum.ExecuteResultEnum;
+import com.kingdee.eas.custom.recuritment.utils.AttachmentUtils;
+import com.kingdee.eas.custom.recuritment.utils.InitialValueUtils;
+import com.kingdee.shr.recuritment.*;
 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.IOException;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.*;
 
 public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeControllerBean {
     private static Logger logger =
@@ -32,15 +51,957 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
      * 同步北森简历和附件
      *
      * @param ctx
-     * @param applyId
+     * @param billId 单据ID
      * @throws BOSException
      * @throws EASBizException
      */
     @Override
-    protected void _syncBeisenResume(Context ctx, String applyId) throws BOSException, EASBizException {
-        super._syncBeisenResume(ctx, applyId);
+    protected void _syncBeisenResume(Context ctx, String billId) throws BOSException, EASBizException {
+        super._syncBeisenResume(ctx, billId);
+        //北森应聘者
+        IApplicantBeisen iApplicantBeisen = ApplicantBeisenFactory.getLocalInstance(ctx);
+        FilterInfo filterInfo = new FilterInfo();
+        FilterItemCollection filterItems = filterInfo.getFilterItems();
+        if (!StringUtils.isEmpty(billId)) {
+            filterItems.add(new FilterItemInfo("id", billId));
+        } else {
+            filterItems.add(new FilterItemInfo("syncStatus", "0"));
+        }
+        EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, null);
+        ApplicantBeisenCollection applicantBeisenCollection = iApplicantBeisen.getApplicantBeisenCollection(entityViewInfo);
+        //同步结果
+        int errorSize = 0;
+        int successSize = 0;
+        Map msgMap = new HashMap();
+        for (int i = 0; i < applicantBeisenCollection.size(); i++) {
+            ApplicantBeisenInfo applicantBeisenInfo = applicantBeisenCollection.get(i);
+            //申请id
+            String applyId = applicantBeisenInfo.getApplyId();
+            //应聘者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) {
+                    resumeInfo = new ResumeBaseRecInfo();
+                    resumeInfo.put("applyId", applyId);
+                    resumeInfo.put("candidateId", candidateId);
+                } else if (!"00001".equals(resumeInfo.getResumeState().getNumber())) {
+                    continue;
+                }
+                //通过申请ID获取招聘需求
+                RecuritmentDemandInfo recuritmentDemandInfo = getRecuritmentByApplyId(ctx, applyId);
+                //招聘需求
+                resumeInfo.setRecuritmentDemand(recuritmentDemandInfo);
+                //招聘职位
+                resumeInfo.setDepartment(recuritmentDemandInfo.getDepartment());
+                //招聘部门
+                resumeInfo.setRecuritPosition(recuritmentDemandInfo.getRecuritPosition());
+                //北森应聘者-需求管理
+                applicantBeisenInfo.setRecuritment(recuritmentDemandInfo);
+                // 2. 获取  标准简历数据
+                JSONObject resumeJson = getResumeByApplyId(applyId);
+                Integer code = resumeJson.getInteger("code");
+                if (200 == code) {
+                    logger.error("resumeJson--" + resumeJson);
+                    JSONObject data = resumeJson.getJSONObject("data");
+                    // 3. 处理简历各部分数据
+                    processResumeSections(ctx, data, resumeInfo);
+                    //保存附件
+//                    saveAttachment(ctx, applyId, resumeInfo);
+                    //删除附件信息
+                    AttachmentUtils.deleteAttachment(ctx, resumeInfo.getId().toString());
+                    // 根据申请Id获取并处理简历文件
+                    processResumeFile(applyId, ctx, resumeInfo, "标准简历");
+                    // 获取并处理面试评价文件
+                    processResumeFile(applyId, ctx, resumeInfo, "面试评价");
+                    applicantBeisenInfo.setSyncResult("同步成功!");
+                    applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.SUCCESS);
+                    successSize++;
+                } else {
+                    throw new BOSException(resumeJson.getString("message"));
+                }
+            } catch (Exception e) {
+                applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.ERROR);
+                applicantBeisenInfo.setSyncResult("简历处理失败: " + e.getMessage());
+                iApplicantBeisen.save(applicantBeisenInfo);
+                errorSize++;
+                logger.error("简历处理失败: " + e.getMessage());
+            }
+            iApplicantBeisen.save(applicantBeisenInfo);
+        }
+        msgMap.put("成功条数", successSize);
+        msgMap.put("失败条数", errorSize);
+        logger.error("msgMap" + msgMap);
+
+    }
+
+    /**
+     * 通过申请ID获取需求管理
+     *
+     * @param applyId
+     */
+    public RecuritmentDemandInfo getRecuritmentByApplyId(Context ctx, String applyId) throws IOException, BOSException {
+        BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
+        JSONObject pamas = new JSONObject();
+        JSONArray applyIds = new JSONArray();
+        applyIds.add(applyId);
+        pamas.put("applyIds", applyIds);
+        String jobId = "";
+        //根据申请ID获取申请信息
+        JSONObject applyJson = beisenApiClient.callApi(BeisenParam.GET_APPLYLIST_APPLYID, pamas);
+        logger.error("applyJson--" + applyJson);
+        if (200 == applyJson.getInteger("code")) {
+            JSONArray data = applyJson.getJSONArray("data");
+            JSONObject applyData = data.getJSONObject(0);
+            //职位ID
+            jobId = applyData.getString("jobId");
+        } else {
+            throw new BOSException("根据申请ID获取申请信息失败,原因:" + applyJson.get("message"));
+        }
+        logger.error("jobId--" + jobId);
+        //根据ID获取获取数据单条
+        JSONObject entityPamas = new JSONObject();
+        entityPamas.put("id", jobId);
+        entityPamas.put("metaObjectName", "Recruitment.Job");
+        JSONObject entity = beisenApiClient.callApi(BeisenParam.GET_ENTITY, entityPamas);
+        logger.error("entity--" + entity);
+        if (200 != applyJson.getInteger("code")) {
+            throw new BOSException("根据ID获取获取数据单条失败,原因:" + entity.get("message"));
+        }
+        JSONObject entityData = entity.getJSONObject("data");
+        //根据招聘需求ID获取招聘需求
+        JSONObject columns = entityData.getJSONObject("columns");
+        JSONObject recruit = columns.getJSONObject("RecruitRequirementIds");
+        if (recruit == null) {
+            throw new BOSException("未查询到需求IDRecruitRequirementIds");
+        }
+        String recruitRequirementId = recruit.getString("value");
+        //招聘需求
+        IRecuritmentDemand iRecuritmentDemand = RecuritmentDemandFactory.getLocalInstance(ctx);
+        if (StringUtils.isEmpty(recruitRequirementId)) {
+            throw new BOSException("通过applyId[" + applyId + "]未查询到招聘需求!");
+        }
+        logger.error("requirementId--" + recruitRequirementId);
+        //招聘需求
+        RecuritmentDemandCollection recuritmentDemandCollection =
+                iRecuritmentDemand.getRecuritmentDemandCollection("where requirementId='" + recruitRequirementId + "'");
+        if (recuritmentDemandCollection.isEmpty()) {
+            throw new BOSException("sHR未查询到对应的招聘需求,北森需求ID:" + recruitRequirementId);
+        }
+        return recuritmentDemandCollection.get(0);
+    }
+
+    /**
+     * 处理简历文件或面试评价文件
+     *
+     * @param applyId    申请ID
+     * @param ctx        上下文
+     * @param resumeInfo 简历信息
+     * @param fileType   文件类型("标准简历"或"面试评价")
+     */
+    private void processResumeFile(String applyId, Context ctx, ResumeBaseRecInfo resumeInfo, String fileType) {
+        logger.error("processResumeFile--");
+        try {
+            // 根据文件类型获取对应的文件信息
+            JSONObject fileInfo = "标准简历".equals(fileType)
+                    ? getStandardResumeFileUrlByApplyId(applyId)
+                    : getInterviewEvaluationFile(applyId);
+            logger.error("fileInfo--" + fileInfo);
+            if (fileInfo == null) {
+                throw new BOSException("获取{}文件信息失败: 返回结果为null" + fileType);
+            }
+            Integer code = fileInfo.getInteger("code");
+            if (code == null || !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为空");
+            }
+            // 处理文件名
+            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);
+        }
+    }
+
+
+    /**
+     * 处理简历各部分数据
+     */
+    private void processResumeSections(Context ctx, JSONObject resumeJson, ResumeBaseRecInfo resumeInfo) {
+
+        // 使用Map定义简历部分与处理方法的对应关系
+        Map<String, TriConsumer<Context, JSONArray, ResumeBaseRecInfo>> sectionHandlers = new LinkedHashMap<>();
+        sectionHandlers.put("personProfile", this::saveResumeBaseRec);
+        sectionHandlers.put("workExperience", this::saveWorkingExp);
+        sectionHandlers.put("education", this::saveEducationExpRE);
+        sectionHandlers.put("project", this::saveProjectExp);
+        sectionHandlers.put("train", this::saveTrainingExp);
+        sectionHandlers.put("certificate", this::saveCredential);
+        sectionHandlers.put("lang", this::saveLanguageAbility);
+        sectionHandlers.put("skill", this::saveProfessionalSkills);
+        sectionHandlers.put("awards", this::saveResumeRewardPunish);
+        // 遍历处理所有简历部分
+        sectionHandlers.forEach((sectionKey, handler) -> {
+            //判断是否存key
+            if (resumeJson.containsKey(sectionKey)) {
+                JSONArray sectionData = resumeJson.getJSONArray(sectionKey);
+                if (sectionData != null && !sectionData.isEmpty()) {
+                    handler.accept(ctx, sectionData, resumeInfo);
+                }
+            }
+        });
+    }
+
+    /**
+     * 根据申请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 getResumeByApplyId(String applyId) throws IOException {
+        String param = "?applyId=" + applyId;
+        BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
+        JSONObject jsonObject = beisenApiClient.callGetApi(BeisenParam.GET_RESUMEBYAPPLYID + param, new JSONObject());
+        return jsonObject;
+    }
+
+
+    /**
+     * 招聘管理简历基本信息
+     *
+     * @param personProfile
+     */
+    public void saveResumeBaseRec(Context ctx, JSONArray personProfile, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("personProfile--" + personProfile);
+        try {
+            BeisenParamByProperties beisenParamByProperties = new BeisenParamByProperties();
+            Map<String, String> config = beisenParamByProperties.getConfig();
+            //招聘业务组织
+            HROrgUnitInfo hrOrgUnitInfo = new HROrgUnitInfo();
+            hrOrgUnitInfo.setId(BOSUuid.read("00000000-0000-0000-0000-000000000000CCE7AED4"));
+            resumeBaseRecInfo.setHrOrgUnit(hrOrgUnitInfo);
+            //来源方式 INTEGRATESYSTEM=集成系统
+            resumeBaseRecInfo.setSourceMethod(ResumeSourceMethod.INTEGRATESYSTEM);
+            //招聘状态  WAITING 待筛选
+            resumeBaseRecInfo.setResumeStatus(ResumeStatusEnum.WAITING);
+            //招聘状态  0001 待筛选
+            IResumeState iResumeState = ResumeStateFactory.getLocalInstance(ctx);
+            ResumeStateInfo resumeStateInfo = iResumeState.getResumeStateInfo("where number = '0001'");
+            resumeBaseRecInfo.setResumeState(resumeStateInfo);
+            //入库时间
+            resumeBaseRecInfo.setWarehouseEntry(new Date());
+            //国籍
+            INationality iNationality = NationalityFactory.getLocalInstance(ctx);
+            //学历
+            IDiploma iDiploma = DiplomaFactory.getLocalInstance(ctx);
+            //政治面貌
+            IPoliticalFace iPoliticalFace = PoliticalFaceFactory.getLocalInstance(ctx);
+            //民族
+            IFolk iFolk = FolkFactory.getLocalInstance(ctx);
+            //婚姻状况
+            IWed iWed = WedFactory.getLocalInstance(ctx);
+            //血型
+            Map<String, String> bloodTypeMap = InitialValueUtils.bloodTypeMap;
+            Map<String, String> getbloodTypeMap = InitialValueUtils.getBloodTypeMap();
+
+            String carType = "";//证件类型
+            String carno = "";//证件号
+            for (int i = 0; i < personProfile.size(); i++) {
+                JSONObject data = personProfile.getJSONObject(i);
+                String name = data.getString("name");
+                String value = data.getString("value");
+                String text = data.getString("text");
+                //姓名
+                if ("Name".equals(name)) {
+                    resumeBaseRecInfo.setName(text);
+                }
+                //参加工作时间
+                if ("WorkStartTime".equals(name)) {
+                    resumeBaseRecInfo.setWorkDate(DateTimeUtils.parseDate(text, "yyyy/MM/dd"));
+                }
+                //参加工作年限     workSeniority
+                if ("YearsOfWork".equals(name)) {
+                    resumeBaseRecInfo.setWorkSeniority(text);
+                }
+                //身份证号码    identityCardNo
+                if ("CertificateNumber".equals(name)) {
+                    carno = text;
+                    if ("身份证".equals(carType)) {
+                        resumeBaseRecInfo.setIdentityCardNo(carno);
+                        resumeBaseRecInfo.setPassportNo("");
+                    } else {
+                        resumeBaseRecInfo.setPassportNo(carno);
+                    }
+                }
+                //证件类型
+                if ("CertificateType".equals(name)) {
+                    carType = text;
+                    if ("身份证".equals(text)) {
+                        resumeBaseRecInfo.setIdentityCardNo(carno);
+                        resumeBaseRecInfo.setPassportNo("");
+                    } else {
+                        resumeBaseRecInfo.setPassportNo(carno);
+                    }
+                }
+                //出生年月    birthday
+                if ("Birthday".equals(name)) {
+                    resumeBaseRecInfo.setBirthday(DateTimeUtils.parseDate(text, "yyyy/MM/dd"));
+                }
+                //户口所在地    domicilePlace
+                if ("AccountArea".equals(name)) {
+                    resumeBaseRecInfo.setDomicilePlace(text);
+                }
+                //QQ    QQ
+                if ("QQ".equals(name)) {
+                    resumeBaseRecInfo.setQQ(text);
+                }
+                //身高    stature
+                if ("Height".equals(name)) {
+                    resumeBaseRecInfo.setStature(text);
+                }
+                //现居住地    nowResidence
+                if ("LivingArea".equals(name)) {
+                    resumeBaseRecInfo.setNowResidence(text);
+                }
+                //手机号    mobilePhone
+                if ("Mobile".equals(name)) {
+                    resumeBaseRecInfo.setMobilePhone(text);
+                }
+                //家庭电话    fixedPhone
+                if ("Telephone".equals(name)) {
+                    resumeBaseRecInfo.setFixedPhone(text);
+                }
+                //邮件    email
+                if ("Email".equals(name)) {
+                    resumeBaseRecInfo.setEmail(text);
+                }
+                //目前年薪    annualPay
+                if ("Salary".equals(name)) {
+                    resumeBaseRecInfo.setAnnualPay(text);
+                }
+                //目前工作状态    currentWorkingStatus
+                if ("JobHunting".equals(name)) {
+                    resumeBaseRecInfo.setCurrentWorkingStatus(CurrentWorkingStatusEnum.getEnum(Integer.parseInt(value) - 1));
+                }
+                //期望年薪    expectantPay
+                if ("ExpectSalary".equals(name)) {
+                    resumeBaseRecInfo.setExpectantPay(Integer.parseInt(text));
+                }
+                //职业目标    careerGoal
+                if ("CareerGoals".equals(name)) {
+                    resumeBaseRecInfo.setCareerGoal(text);
+                }
+                //自我评价    selfEvaluation
+                if ("Evaluation".equals(name)) {
+                    resumeBaseRecInfo.setSelfEvaluation(text);
+                }
+                //国籍    national
+                if ("Nationality".equals(name)) {
+                    NationalityCollection nationalityCollection = iNationality.getNationalityCollection("where name like '%" + text + "%'");
+                    if (nationalityCollection.size() > 0) {
+                        resumeBaseRecInfo.setNational(nationalityCollection.get(0));
+                    }
+                }
+                //籍贯  nativePlace
+                if ("NativeArea".equals(name)) {
+                    resumeBaseRecInfo.setNativePlace(text);
+                }
+                //年龄  age
+                if ("OceanAge".equals(name)) {
+                    resumeBaseRecInfo.setAge(Integer.parseInt(text));
+                }
+                //最高学历  hDegree
+                if ("EducationLevel".equals(name)) {
+                    DiplomaCollection diplomaCollection = iDiploma.getDiplomaCollection("where beisenVal = '" + value + "'");
+                    if (!diplomaCollection.isEmpty()) {
+                        resumeBaseRecInfo.setHDegree(diplomaCollection.get(0));
+                    }
+                }
+                //政治面貌  politicalFace
+                if ("Polity".equals(name)) {
+                    PoliticalFaceCollection politicalFaceCollection = iPoliticalFace.getPoliticalFaceCollection("where beisenVal = '" + value + "'");
+                    if (!politicalFaceCollection.isEmpty()) {
+                        resumeBaseRecInfo.setPoliticalFace(politicalFaceCollection.get(0));
+                    }
+                }
+                //婚姻状况  wed  北森已停用字段
+                if (config.get("WedState").equals(name)) {
+                    WedCollection wedCollection = iWed.getWedCollection("where beisenVal = '" + value + "'");
+                    if (!wedCollection.isEmpty()) {
+                        resumeBaseRecInfo.setWed(wedCollection.get(0));
+                    }
+                }
+                //民族  folk
+                if ("Nation".equals(name)) {
+                    FolkCollection folkCollection = iFolk.getFolkCollection("where beisenVal = '" + value + "'");
+                    if (!folkCollection.isEmpty()) {
+                        resumeBaseRecInfo.setFolk(folkCollection.get(0));
+                    }
+                }
+                //毕业学校 school
+                if ("LastSchool".equals(name)) {
+                    resumeBaseRecInfo.setName(text);
+                }
+                //血型 bloodType
+                if ("BloodType".equals(name)) {
+                    String hDegree = bloodTypeMap.getOrDefault(value, "90");
+                    resumeBaseRecInfo.setBloodType(BloodType.getEnum(hDegree));
+                }
+                //紧急联系人 emergencyContact
+                if ("EmergencyContact".equals(name)) {
+                    resumeBaseRecInfo.setEmergencyContact(text);
+                }
+                //紧急联系人电话 emergencyContactPhone
+                if ("EmergencyPhone".equals(name)) {
+                    resumeBaseRecInfo.setEmergencyContactPhone(text);
+                }
+                //期望月薪  expectantPayStr
+                if ("ExpectSalary".equals(name)) {
+                    resumeBaseRecInfo.setExpectantPayStr(text);
+                }
+                //最近工作单位  lastCompany
+                if ("LastCompany".equals(name)) {
+                    resumeBaseRecInfo.setLastCompany(text);
+                }
+                //最近工作行业  lastIndustry
+                if ("LastIndustry".equals(name)) {
+                    resumeBaseRecInfo.setLastIndustry(text);
+                }
+                //专业  major
+                if ("LastDiscipline".equals(name)) {
+                    resumeBaseRecInfo.setMajor(text);
+                }
+                //性别  gender
+                if ("Gender".equals(name)) {
+                    if ("1".equals(value) || "0".equals(value)) {
+                        resumeBaseRecInfo.setGender(Genders.getEnum(Integer.parseInt(value) + 1));
+                    }
+                }
+                //更新简历时间  updateResumeDate
+                if ("ResumeUpdateTime".equals(name)) {
+                    resumeBaseRecInfo.setUpdateResumeDate(DateTimeUtils.parseDate(text, "yyyy/MM/dd"));
+                }
+                //签发机关  idCardIssueOrg
+                if ("CertificateGrantUnit".equals(name)) {
+                    resumeBaseRecInfo.setIdentityCardNo(text);
+                }
+                //证件有效期-开始时间 idCardBeginDate
+                if ("CertificateValidityDate".equals(name)) {
+                    resumeBaseRecInfo.setIdCardBeginDate(DateTimeUtils.parseDate(text, "yyyy/MM/dd"));
+                }
+                //证件有效期-结束时间 idCardEndDate
+                if ("CertificateValidityOverDate".equals(name)) {
+                    resumeBaseRecInfo.setIdCardEndDate(DateTimeUtils.parseDate(text, "yyyy/MM/dd"));
+                }
+                //到岗时间 arrivalTime
+                if ("AvailableDate".equals(name)) {
+                    resumeBaseRecInfo.setArrivalTime(DateTimeUtils.parseDate(text, "yyyy/MM/dd"));
+                }
+                //英文名 EnglishName
+                if ("NameEn".equals(name)) {
+                    resumeBaseRecInfo.setEnglishName(text);
+                }
+                //户籍地址 domicileAddress
+                if ("Address".equals(name)) {
+                    resumeBaseRecInfo.setDomicileAddress(text);
+                }
+
+            }
+            IResumeBaseRec iResumeBaseRec = ResumeBaseRecFactory.getLocalInstance(ctx);
+            IObjectPK save = iResumeBaseRec.save(resumeBaseRecInfo);
+            logger.error("resumeBaseRecId--" + save);
+        } catch (Exception e) {
+            logger.error("简历基本信息报错信息:" + e.getMessage());
+            throw new RuntimeException(e);
+        }
+
+
     }
 
+    /**
+     * 简历-工作经历
+     *
+     * @param workExperience
+     */
+    public void saveWorkingExp(Context ctx, JSONArray workExperience, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("workExperience--" + workExperience);
+        try {
+            IWorkingExp iWorkingExp = WorkingExpFactory.getLocalInstance(ctx);
+            WorkingExpCollection workingExpColl = iWorkingExp.getWorkingExpCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            WorkingExpInfo workingExpInfo = workingExpColl.isEmpty() ? new WorkingExpInfo() : workingExpColl.get(0);
+            //简历基本信息
+            workingExpInfo.setResumeBase(resumeBaseRecInfo);
+            for (int i = 0; i < workExperience.size(); i++) {
+                JSONArray array = workExperience.getJSONArray(i);
+                for (int j = 0; j < array.size(); j++) {
+                    JSONObject data = array.getJSONObject(j);
+                    String name = data.getString("name");
+                    String value = data.getString("value");
+                    String text = data.getString("text");
+                    //dateStart	开始时间
+                    if ("StartDate".equals(name)) {
+                        workingExpInfo.setDateStart(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //dateEnd	结束时间
+                    if ("EndDate".equals(name)) {
+                        if ("至今".equals(text)) {
+                            text = "2199/12";
+                        }
+                        workingExpInfo.setDateEnd(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //company	公司名称
+                    if ("CompanyName".equals(name)) {
+                        workingExpInfo.setCompany(text);
+                    }
+                    //department	任职部门
+                    if ("Department".equals(name)) {
+                        workingExpInfo.setDepartment(text);
+                    }
+                    //jobCategory	职位类别
+                    if ("OgJobLevel".equals(name)) {
+                        workingExpInfo.setJobCategory(text);
+                    }
+                    //industry	所属行业
+                    if ("Industry".equals(name)) {
+                        workingExpInfo.setIndustry(text);
+                    }
+                    //position	职位名称
+                    if ("JobTitle".equals(name)) {
+                        workingExpInfo.setPosition(text);
+                    }
+                    //underlingNumber	下属人数
+                    if ("SubordinateNumber".equals(name)) {
+                        workingExpInfo.setUnderlingNumber(Integer.parseInt(text));
+                    }
+                    //monthPay	税前月薪
+                    if ("Salary".equals(name)) {
+                        workingExpInfo.setMonthPay(Integer.parseInt(text));
+                    }
+                    //certifier	证明人
+                    if ("ReferenceName".equals(name)) {
+                        workingExpInfo.setCertifier(text);
+                    }
+                    //leavingReason	离职原因
+                    if ("ReasonOfLeaving".equals(name)) {
+                        workingExpInfo.setLeavingReason(text);
+                    }
+                    //certifierPhone	证明人电话
+                    if ("ReferenceContact".equals(name)) {
+                        workingExpInfo.setCertifierPhone(text);
+                    }
+                    //monthPayStr	税前月薪
+                    if ("Salary".equals(name)) {
+                        workingExpInfo.setMonthPayStr(text);
+                    }
+                    //unitAddress	工作地点  OgJobArea
+                    if ("JobArea".equals(name)) {
+                        workingExpInfo.setUnitAddress(text);
+                    }
+                    iWorkingExp.save(workingExpInfo);
+                }
+            }
+        } catch (Exception e) {
+            logger.error("简历-工作经历保存失败!" + e.getMessage());
+        }
+    }
+
+    /**
+     * 简历-教育经历
+     *
+     * @param education
+     */
+    public void saveEducationExpRE(Context ctx, JSONArray education, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("education--" + education);
+        try {
+            IEducationExpREC iEducationExpREC = EducationExpRECFactory.getLocalInstance(ctx);
+            EducationExpRECCollection educationExpRECCollection = iEducationExpREC.getEducationExpRECCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            EducationExpRECInfo educationExpRECInfo = educationExpRECCollection.isEmpty() ? new EducationExpRECInfo() : educationExpRECCollection.get(0);
+            //学历
+            IDiploma iDiploma = DiplomaFactory.getLocalInstance(ctx);
+            //学位
+            IDegree iDegree = DegreeFactory.getLocalInstance(ctx);
+            //简历基本信息
+            educationExpRECInfo.setResumeBase(resumeBaseRecInfo);
+            //学院类型
+            Map<String, String> bchoolTypeMap = InitialValueUtils.getBchoolTypeMap();
+            for (int i = 0; i < education.size(); i++) {
+                JSONArray array = education.getJSONArray(i);
+                for (int j = 0; j < array.size(); j++) {
+                    JSONObject data = array.getJSONObject(j);
+                    String name = data.getString("name");
+                    String value = data.getString("value");
+                    String text = data.getString("text");
+                    //dateStart	开始时间
+                    if ("StartDate".equals(name)) {
+                        educationExpRECInfo.setDateStart(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //dateEnd	结束时间
+                    if ("EndDate".equals(name)) {
+                        if ("至今".equals(text)) {
+                            text = "2199/12";
+                        }
+                        educationExpRECInfo.setDateEnd(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //school	毕业学校
+                    if ("SchoolName".equals(name)) {
+                        educationExpRECInfo.setSchool(text);
+                    }
+                    //academicDiplomasF7	学位
+                    if ("Degree".equals(name)) {
+                        DegreeCollection degreeCollection = iDegree.getDegreeCollection("where beisenVal = '" + value + "'");
+                        if (!degreeCollection.isEmpty()) {
+                            educationExpRECInfo.setAcademicDiplomasF7(degreeCollection.get(0));
+                        }
+                    }
+                    //major	专业
+                    if ("MajorName".equals(name)) {
+                        educationExpRECInfo.setMajor(text);
+                    }
+                    //degreeF7	学历
+                    if ("EducationLevel".equals(name)) {
+                        DiplomaCollection diplomaCollection = iDiploma.getDiplomaCollection("where beisenVal = '" + value + "'");
+                        if (!diplomaCollection.isEmpty()) {
+                            educationExpRECInfo.setDegreeF7(diplomaCollection.get(0));
+                        }
+                    }
+                    //schoolType	学院类型
+                    if ("SchoolType".equals(name)) {
+                        if (bchoolTypeMap.containsKey(value)) {
+                            educationExpRECInfo.setSchoolType(SchoolTypeEnum.getEnum(bchoolTypeMap.get(value)));
+                        }
+                    }
+                    iEducationExpREC.save(educationExpRECInfo);
+                }
+            }
+        } catch (Exception e) {
+            logger.error("简历-教育经历保存失败!" + e.getMessage());
+            throw new RuntimeException(e);
+        }
+
+    }
+
+    /**
+     * 简历-获奖经历
+     *
+     * @param awards
+     */
+    public void saveResumeRewardPunish(Context ctx, JSONArray awards, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("awards--" + awards);
+        try {
+            IResumeRewardPunish iResumeRewardPunish = ResumeRewardPunishFactory.getLocalInstance(ctx);
+            ResumeRewardPunishCollection ResumeRewardPunishCollection =
+                    iResumeRewardPunish.getResumeRewardPunishCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            ResumeRewardPunishInfo ResumeRewardPunishInfo = ResumeRewardPunishCollection.isEmpty() ? new ResumeRewardPunishInfo() : ResumeRewardPunishCollection.get(0);
+            //简历基本信息
+            ResumeRewardPunishInfo.setResumeBase(resumeBaseRecInfo);
+            for (int i = 0; i < awards.size(); i++) {
+                JSONArray array = awards.getJSONArray(i);
+                for (int j = 0; j < array.size(); j++) {
+                    JSONObject data = array.getJSONObject(j);
+                    String name = data.getString("name");
+                    String value = data.getString("value");
+                    String text = data.getString("text");
+                    //occurDate	获奖时间
+                    if ("AwardTime".equals(name)) {
+                        ResumeRewardPunishInfo.setOccurDate(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //title	获奖名称
+                    if ("AwardName".equals(name)) {
+                        ResumeRewardPunishInfo.setTitle(text);
+                        ResumeRewardPunishInfo.setName(text);
+                    }
+                    //description	描述
+                    if ("AwardDescription".equals(name)) {
+                        ResumeRewardPunishInfo.setDescription(text);
+                    }
+                    iResumeRewardPunish.save(ResumeRewardPunishInfo);
+                }
+            }
+        } catch (Exception e) {
+            logger.error("简历-获奖经历保存失败!" + e.getMessage());
+        }
+
+    }
+
+    /**
+     * 简历-项目经历
+     *
+     * @param project
+     */
+    public void saveProjectExp(Context ctx, JSONArray project, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("project--" + project);
+        try {
+            IProjectExp iProjectExp = ProjectExpFactory.getLocalInstance(ctx);
+            ProjectExpCollection ProjectExpCollection =
+                    iProjectExp.getProjectExpCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            ProjectExpInfo ProjectExpInfo = ProjectExpCollection.isEmpty() ? new ProjectExpInfo() : ProjectExpCollection.get(0);
+            //简历基本信息
+            ProjectExpInfo.setResumeBase(resumeBaseRecInfo);
+            for (int i = 0; i < project.size(); i++) {
+                JSONArray array = project.getJSONArray(i);
+                for (int j = 0; j < array.size(); j++) {
+                    JSONObject data = array.getJSONObject(j);
+                    String name = data.getString("name");
+                    String value = data.getString("value");
+                    String text = data.getString("text");
+                    //dateStart	开始时间
+                    if ("StartDate".equals(name)) {
+                        ProjectExpInfo.setDateStart(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //dateEnd	结束时间
+                    if ("EndDate".equals(name)) {
+                        if ("至今".equals(text)) {
+                            text = "2199/12";
+                        }
+                        ProjectExpInfo.setDateEnd(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //customer	项目名称
+                    if ("ProjectName".equals(name)) {
+                        ProjectExpInfo.setCustomer(text);
+                    }
+                    //projectDescription	项目描述
+                    if ("ProjectInfo".equals(name)) {
+                        ProjectExpInfo.setProjectDescription(text);
+                    }
+                    iProjectExp.save(ProjectExpInfo);
+                }
+            }
+        } catch (Exception e) {
+            logger.error("简历-项目经历保存失败!" + e.getMessage());
+        }
+
+    }
+
+    /**
+     * 简历-培训经历
+     *
+     * @param train
+     */
+    public void saveTrainingExp(Context ctx, JSONArray train, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("train--" + train);
+        try {
+            ITrainingExp iTrainingExp = TrainingExpFactory.getLocalInstance(ctx);
+            TrainingExpCollection TrainingExpCollection =
+                    iTrainingExp.getTrainingExpCollection("where resumeBaseInfo = '" + resumeBaseRecInfo.getId().toString() + "'");
+            TrainingExpInfo TrainingExpInfo = TrainingExpCollection.isEmpty() ? new TrainingExpInfo() : TrainingExpCollection.get(0);
+            //简历基本信息
+            TrainingExpInfo.setResumeBaseInfo(resumeBaseRecInfo);
+            for (int i = 0; i < train.size(); i++) {
+                JSONArray array = train.getJSONArray(i);
+                for (int j = 0; j < array.size(); j++) {
+                    JSONObject data = array.getJSONObject(j);
+                    String name = data.getString("name");
+                    String value = data.getString("value");
+                    String text = data.getString("text");
+                    //dateStart	开始时间
+                    if ("StartDate".equals(name)) {
+                        TrainingExpInfo.setDateStart(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //dateEnd	结束时间
+                    if ("EndDate".equals(name)) {
+                        if ("至今".equals(text)) {
+                            text = "2199/12";
+                        }
+                        TrainingExpInfo.setDateEnd(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //trainingInstitution	培训机构
+                    if ("OrgName".equals(name)) {
+                        TrainingExpInfo.setTrainingInstitution(text);
+                    }
+                    //courseDescription	课程描述
+                    if ("Description".equals(name)) {
+                        TrainingExpInfo.setCourseDescription(text);
+                    }
+                    iTrainingExp.save(TrainingExpInfo);
+                }
+            }
+        } catch (Exception e) {
+            logger.error("简历-培训经历保存失败!" + e.getMessage());
+        }
+
+
+    }
+
+    /**
+     * 简历-获得证书
+     *
+     * @param certificate
+     */
+    public void saveCredential(Context ctx, JSONArray certificate, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("certificate--" + certificate);
+
+        try {
+            ICredential iCredential = CredentialFactory.getLocalInstance(ctx);
+            CredentialCollection CredentialCollection =
+                    iCredential.getCredentialCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            CredentialInfo CredentialInfo = CredentialCollection.isEmpty() ? new CredentialInfo() : CredentialCollection.get(0);
+            //简历基本信息
+            CredentialInfo.setResumeBase(resumeBaseRecInfo);
+            for (int i = 0; i < certificate.size(); i++) {
+                JSONArray array = certificate.getJSONArray(i);
+                for (int j = 0; j < array.size(); j++) {
+                    JSONObject data = array.getJSONObject(j);
+                    String name = data.getString("name");
+                    String value = data.getString("value");
+                    String text = data.getString("text");
+                    //date	证书发放日期
+                    if ("ObtainDate".equals(name)) {
+                        CredentialInfo.setDate(DateTimeUtils.parseDate(text, "yyyy/MM"));
+                    }
+                    //credentialName	证书名称
+                    if ("CertificateName".equals(name)) {
+                        CredentialInfo.setCredentialName(text);
+                    }
+                    //issuer	证书发布机构
+                    if ("Authority".equals(name)) {
+                        CredentialInfo.setIssuer(text);
+                    }
+                    //grade	证书成绩
+                    if ("Score".equals(name)) {
+                        CredentialInfo.setGrade(text);
+                    }
+                }
+                iCredential.save(CredentialInfo);
+            }
+        } catch (Exception e) {
+            logger.error("简历-获得证书保存失败!" + e.getMessage());
+        }
+
+    }
+
+    /**
+     * 简历-语言能力
+     *
+     * @param lang
+     */
+    public void saveLanguageAbility(Context ctx, JSONArray lang, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("lang--" + lang);
+        try {
+            ILanguageAbility iLanguageAbility = LanguageAbilityFactory.getLocalInstance(ctx);
+            LanguageAbilityCollection LanguageAbilityCollection =
+                    iLanguageAbility.getLanguageAbilityCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            LanguageAbilityInfo LanguageAbilityInfo = LanguageAbilityCollection.isEmpty() ? new LanguageAbilityInfo() : LanguageAbilityCollection.get(0);
+            //简历基本信息
+            LanguageAbilityInfo.setResumeBase(resumeBaseRecInfo);
+            //熟练度
+            Map<String, String> proficiencyMap = InitialValueUtils.getProficiencyMap();
+            for (int i = 0; i < lang.size(); i++) {
+                JSONArray array = lang.getJSONArray(i);
+                for (int j = 0; j < array.size(); j++) {
+                    JSONObject data = array.getJSONObject(j);
+                    String name = data.getString("name");
+                    String value = data.getString("value");
+                    String text = data.getString("text");
+                    //listeningSpeaking	听说
+                    if ("ListeningSpeakingAbility".equals(name)) {
+                        if (proficiencyMap.containsKey(value)) {
+                            LanguageAbilityInfo.setListeningSpeaking(ProficiencyEnum.getEnum(proficiencyMap.get(value)));
+                        }
+                    }
+                    //readingWriting	读写
+                    if ("ReadingWritingAbility".equals(name)) {
+                        LanguageAbilityInfo.setReadingWriting(ProficiencyEnum.getEnum(proficiencyMap.get(value)));
+                    }
+                    //language	语言
+                    if ("LanguageType".equals(name)) {
+                        LanguageAbilityInfo.setLanguage(text);
+                    }
+                    //lv	语言等级
+                    if ("LanguageLevel".equals(name)) {
+                        LanguageAbilityInfo.setLv(text);
+                    }
+                }
+                iLanguageAbility.save(LanguageAbilityInfo);
+            }
+        } catch (Exception e) {
+            logger.error("简历-语言能力保存失败!" + e.getMessage());
+        }
+    }
+
+    /**
+     * 简历-专业技能
+     *
+     * @param skill
+     */
+    public void saveProfessionalSkills(Context ctx, JSONArray skill, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("skill--" + skill);
+        try {
+            IProfessionalSkills iProfessionalSkills = ProfessionalSkillsFactory.getLocalInstance(ctx);
+            ProfessionalSkillsCollection ProfessionalSkillsCollection =
+                    iProfessionalSkills.getProfessionalSkillsCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            ProfessionalSkillsInfo ProfessionalSkillsInfo = ProfessionalSkillsCollection.isEmpty() ? new ProfessionalSkillsInfo() : ProfessionalSkillsCollection.get(0);
+            //简历基本信息
+            ProfessionalSkillsInfo.setResumeBase(resumeBaseRecInfo);
+            for (int i = 0; i < skill.size(); i++) {
+                JSONArray array = skill.getJSONArray(i);
+                for (int j = 0; j < array.size(); j++) {
+                    JSONObject data = array.getJSONObject(j);
+                    String name = data.getString("name");
+                    String value = data.getString("value");
+                    String text = data.getString("text");
+                    //skillName	技能名称
+                    if ("SkillName".equals(name)) {
+                        ProfessionalSkillsInfo.setSkillName(text);
+                    }
+                    //skillDescription	技能描述
+                    if ("SkillDescription".equals(name)) {
+                        ProfessionalSkillsInfo.setSkillDescription(text);
+                    }
+                }
+                iProfessionalSkills.save(ProfessionalSkillsInfo);
+            }
+        } catch (Exception e) {
+            logger.error("简历-专业技能保存失败!" + e.getMessage());
+        }
+    }
+
+
     @Override
     protected void _syncRecuritmentToBeisen(Context ctx, String billId) throws BOSException, EASBizException {
         super._syncRecuritmentToBeisen(ctx, billId);

+ 35 - 0
websrc/com/kingdee/eas/custom/recuritment/handler/ApplicantBeisenEditHandler.java

@@ -0,0 +1,35 @@
+package com.kingdee.eas.custom.recuritment.handler;
+
+import com.kingdee.bos.Context;
+import com.kingdee.bos.util.BOSUuid;
+import com.kingdee.eas.basedata.org.HROrgUnitInfo;
+import com.kingdee.eas.custom.recuritment.ApplicantBeisenInfo;
+import com.kingdee.eas.custom.recuritment.bizEnum.ExecuteResultEnum;
+import com.kingdee.eas.framework.CoreBaseInfo;
+import com.kingdee.eas.hr.base.HRBillBaseInfo;
+import com.kingdee.shr.base.syssetting.context.SHRContext;
+import com.kingdee.shr.base.syssetting.exception.SHRWebException;
+import com.kingdee.shr.base.syssetting.web.handler.EditHandler;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author qingwu
+ * @date 2025/7/2
+ * @apiNote
+ */
+public class ApplicantBeisenEditHandler extends EditHandler {
+    private Context ctx = SHRContext.getInstance().getContext();
+
+    @Override
+    protected void beforeSave(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model) throws SHRWebException {
+        HRBillBaseInfo hrBillBaseInfo = (HRBillBaseInfo) model;
+        HROrgUnitInfo hrOrgUnitInfo = new HROrgUnitInfo();
+        hrOrgUnitInfo.setId(BOSUuid.read("00000000-0000-0000-0000-000000000000CCE7AED4"));
+        hrBillBaseInfo.setHrOrgUnit(hrOrgUnitInfo);
+        ApplicantBeisenInfo applicantBeisenInfo = (ApplicantBeisenInfo) model;
+        applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.UNEXECUTE);
+        super.beforeSave(request, response, model);
+    }
+}

+ 45 - 0
websrc/com/kingdee/eas/custom/recuritment/handler/ApplicantBeisenListHandler.java

@@ -0,0 +1,45 @@
+package com.kingdee.eas.custom.recuritment.handler;
+
+import com.kingdee.bos.Context;
+import com.kingdee.eas.custom.recuritment.task.RecuritmentFacadeFactory;
+import com.kingdee.shr.base.syssetting.context.SHRContext;
+import com.kingdee.shr.base.syssetting.exception.SHRWebException;
+import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
+import com.kingdee.shr.base.syssetting.web.handler.ListHandler;
+import com.taobao.api.internal.util.StringUtils;
+import org.springframework.ui.ModelMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author qingwu
+ * @date 2025/7/2
+ * @apiNote
+ */
+public class ApplicantBeisenListHandler extends ListHandler {
+    /**
+     * 同步北森简历
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void syncBeisenResumeAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String billId = this.getBillId(request);
+        if (StringUtils.isEmpty(billId)) {
+            throw new ShrWebBizException("单据Id不能为空!!");
+        }
+        if (billId.split(",").length > 1) {
+            throw new ShrWebBizException("只能选中单行!!");
+        }
+        try {
+            RecuritmentFacadeFactory.getLocalInstance(ctx).syncBeisenResume(billId);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new ShrWebBizException(e);
+        }
+    }
+}

+ 73 - 48
websrc/com/kingdee/eas/custom/recuritment/service/SaveBeisenApplyIdService.java

@@ -1,19 +1,26 @@
 package com.kingdee.eas.custom.recuritment.service;
 
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.bsf.service.app.IHRMsfService;
 import com.kingdee.bos.dao.IObjectPK;
+import com.kingdee.bos.util.BOSUuid;
+import com.kingdee.eas.basedata.org.HROrgUnitInfo;
 import com.kingdee.eas.common.EASBizException;
-import com.kingdee.eas.custom.recuritment.ApplicantBeisenCollection;
 import com.kingdee.eas.custom.recuritment.ApplicantBeisenFactory;
 import com.kingdee.eas.custom.recuritment.ApplicantBeisenInfo;
 import com.kingdee.eas.custom.recuritment.IApplicantBeisen;
+import com.kingdee.eas.custom.recuritment.bizEnum.ExecuteResultEnum;
 import com.kingdee.util.StringUtils;
 import org.apache.log4j.Logger;
 
+import java.text.MessageFormat;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -24,62 +31,80 @@ import java.util.Map;
  * @apiNote
  */
 public class SaveBeisenApplyIdService implements IHRMsfService {
-    private static Logger logger =
-            Logger.getLogger(SaveBeisenApplyIdService.class);
+    private static Logger logger = Logger.getLogger(SaveBeisenApplyIdService.class);
+    private final String ERRORMSGTEMPLATE = "申请id[{0}]已经存在,请勿重复写入!";
 
     @Override
     public Object process(Context ctx, Map<String, Object> map) throws EASBizException, BOSException {
-        //申请id
-        String applyId = (String) map.get("applyId");
-        //应聘id
-        String candidateId = (String) map.get("candidateId");
-        if (StringUtils.isEmpty(applyId)) {
-            return packageResult(500, "", "申请id不能为空!");
+        String array = (String) map.get("array");
+        Map mapMsg = new HashMap();
+        List listMsg = new ArrayList();
+        if (StringUtils.isEmpty(array)) {
+            mapMsg.put("code", 500);
+            mapMsg.put("message", "参数不能为空");
+            return mapMsg;
         }
-        if (StringUtils.isEmpty(candidateId)) {
-            return packageResult(500, "", "应聘id不能为空!");
-
+        int errorSize = 0;
+        int successSize = 0;
+        String applyId = "";
+        JSONArray jsonArray = null;
+        try {
+            jsonArray = JSONArray.parseArray(array);
+            logger.error("array--" + array);
+            logger.error("jsonArray--" + jsonArray);
+        } catch (Exception e) {
+            mapMsg.put("code", 500);
+            mapMsg.put("listMsg", listMsg);
+            mapMsg.put("errorSize", errorSize);
+            mapMsg.put("successSize", successSize);
+            mapMsg.put("message", "请求失败:参数格式错误!");
+            return mapMsg;
         }
         try {
-            IApplicantBeisen iApplicantBeisen = ApplicantBeisenFactory.getLocalInstance(ctx);
-            String where = "where applyId='" + applyId + "' or candidateId = '" + candidateId + "'";
-            ApplicantBeisenCollection applicantBeisenCollection = iApplicantBeisen.getApplicantBeisenCollection(where);
-            if (applicantBeisenCollection.size() > 0) {
-                ApplicantBeisenInfo applicantBeisenInfo = applicantBeisenCollection.get(0);
-                String applyId2 = applicantBeisenInfo.getApplyId();
-                String candidateId2 = applicantBeisenInfo.getCandidateId();
-                String msg = "";
-                if (applyId2.equals(applyId)) {
-                    msg = "申请id[" + applyId + "]、";
+            for (int i = 0; i < jsonArray.size(); i++) {
+                JSONObject data = jsonArray.getJSONObject(i);
+                //申请id
+                applyId  = data.getString("applyId");
+                //应聘id
+                String candidateId = data.getString("candidateId");
+                if (StringUtils.isEmpty(applyId)) {
+                    listMsg.add(packageResult(applyId, 500, "", "申请id不能为空!"));
+                    ++errorSize;
+                    continue;
                 }
-                if (candidateId2.equals(candidateId)) {
-                    msg += "应聘id[" + candidateId + "]、";
+                IApplicantBeisen iApplicantBeisen = ApplicantBeisenFactory.getLocalInstance(ctx);
+                boolean isExists = iApplicantBeisen.exists("where applyId='" + applyId + "' ");
+                if (isExists) {
+                    String errorMsg = MessageFormat.format(ERRORMSGTEMPLATE, applyId, candidateId);
+                    listMsg.add(packageResult("applyId", 500, "", errorMsg));
+                    ++errorSize;
+                    continue;
                 }
-                msg.substring(0, msg.length() - 1);// 删除最后一个字符
-                msg += "重复!";
-                return packageResult(500, "", msg);
-            }
-            ApplicantBeisenInfo applicantBeisenInfo = new ApplicantBeisenInfo();
-            applicantBeisenInfo.setApplyId(applyId);
-            applicantBeisenInfo.setCandidateId(candidateId);
-            //String billNumber = NumberCodeRule.readCodeRuleNumber(ctx, applicantBeisenInfo, NumberCodeRule.getMainOrgByCu(ctx));
-            //applicantBeisenInfo.setNumber(billNumber);
-            ////需求管理
-            //RecuritmentDemandInfo recuritmentDemandInfo = getRecuritmentByApplyId(ctx, applyId);
-            //if (recuritmentDemandInfo != null) {
-            //    applicantBeisenInfo.setRecuritment(recuritmentDemandInfo);
-            //}
-            IObjectPK addnew = iApplicantBeisen.addnew(applicantBeisenInfo);
-            if (addnew != null) {
-                return packageResult(200, addnew.toString(), "成功");
+                ApplicantBeisenInfo applicantBeisenInfo = new ApplicantBeisenInfo();
+                HROrgUnitInfo hrOrgUnitInfo = new HROrgUnitInfo();
+                hrOrgUnitInfo.setId(BOSUuid.read("00000000-0000-0000-0000-000000000000CCE7AED4"));
+                applicantBeisenInfo.setHrOrgUnit(hrOrgUnitInfo);
+                applicantBeisenInfo.setApplyId(applyId);
+                applicantBeisenInfo.setCandidateId(candidateId);
+                applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.UNEXECUTE);
+                IObjectPK addnew = iApplicantBeisen.addnew(applicantBeisenInfo);
+                listMsg.add(packageResult(applyId, 200, addnew.toString(), "成功"));
+                successSize++;
+
             }
         } catch (Exception e) {
             e.printStackTrace();
-            throw new RuntimeException(e);
+            ++errorSize;
+            listMsg.add(packageResult(applyId, 500, "", e.getMessage()));
         }
-        return packageResult(500, "", "保存失败!");
-    }
+        mapMsg.put("code", 200);
+        mapMsg.put("listMsg", listMsg);
+        mapMsg.put("errorSize", errorSize);
+        mapMsg.put("successSize", successSize);
+        mapMsg.put("message", "请求成功!");
+        return mapMsg;
 
+    }
     ///**
     // * 通过申请ID获取需求管理
     // *
@@ -142,17 +167,17 @@ public class SaveBeisenApplyIdService implements IHRMsfService {
     /**
      * 封装结果
      *
+     * @param applyId
      * @param code
      * @param number
      * @param msg
      * @return
      */
-    public Map packageResult(int code, String number, String msg) {
+    public Map packageResult(String applyId, int code, String number, String msg) {
         Map result = new HashMap();
+        result.put("applyId", applyId);
         result.put("code", code);
-        if (number != "") {
-            result.put("number", number);
-        }
+        result.put("number", number);
         result.put("message", msg);
         return result;
     }