Browse Source

新增社会关系

qingwu 2 weeks ago
parent
commit
622e1def3b

+ 72 - 101
src/com/kingdee/eas/custom/recuritment/task/RecuritmentFacadeControllerBean.java

@@ -41,8 +41,7 @@ import java.time.format.DateTimeFormatter;
 import java.util.*;
 
 public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeControllerBean {
-    private static Logger logger =
-            Logger.getLogger(RecuritmentFacadeControllerBean.class);
+    private static Logger logger = Logger.getLogger(RecuritmentFacadeControllerBean.class);
 
 
     // 北京时区/shanghai时区
@@ -186,8 +185,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         }
         logger.error("requirementId--" + recruitRequirementId);
         //招聘需求
-        RecuritmentDemandCollection recuritmentDemandCollection =
-                iRecuritmentDemand.getRecuritmentDemandCollection("where requirementId='" + recruitRequirementId + "'");
+        RecuritmentDemandCollection recuritmentDemandCollection = iRecuritmentDemand.getRecuritmentDemandCollection("where requirementId='" + recruitRequirementId + "'");
         if (recuritmentDemandCollection.isEmpty()) {
             throw new BOSException("sHR未查询到对应的招聘需求,北森需求ID:" + recruitRequirementId);
         }
@@ -206,9 +204,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         logger.error("processResumeFile--");
         try {
             // 根据文件类型获取对应的文件信息
-            JSONObject fileInfo = "标准简历".equals(fileType)
-                    ? getStandardResumeFileUrlByApplyId(applyId)
-                    : getInterviewEvaluationFile(applyId);
+            JSONObject fileInfo = "标准简历".equals(fileType) ? getStandardResumeFileUrlByApplyId(applyId) : getInterviewEvaluationFile(applyId);
             logger.error("fileInfo--" + fileInfo);
             if (fileInfo == null) {
                 throw new BOSException("获取{}文件信息失败: 返回结果为null" + fileType);
@@ -262,7 +258,6 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         sectionHandlers.put("awards", this::saveResumeRewardPunish);
         //
         sectionHandlers.put("family", this::saveFamilyInfo);
-
         // 遍历处理所有简历部分
         sectionHandlers.forEach((sectionKey, handler) -> {
             //判断是否存key
@@ -748,8 +743,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         logger.error("awards--" + awards);
         try {
             IResumeRewardPunish iResumeRewardPunish = ResumeRewardPunishFactory.getLocalInstance(ctx);
-            ResumeRewardPunishCollection ResumeRewardPunishCollection =
-                    iResumeRewardPunish.getResumeRewardPunishCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            ResumeRewardPunishCollection ResumeRewardPunishCollection = iResumeRewardPunish.getResumeRewardPunishCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             if (!ResumeRewardPunishCollection.isEmpty()) {
                 iResumeRewardPunish.delete("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             }
@@ -787,85 +781,6 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
 
     }
 
-
-
-    /**
-     * 简历-社会关系
-     * @param education
-     * coyle
-     * 20250715
-     */
-    public void saveFamilyInfo(Context ctx, JSONArray family, ResumeBaseRecInfo resumeBaseRecInfo) {
-        logger.error("family--" + family);
-        try {
-            IResumeFamily familyIns = ResumeFamilyFactory.getLocalInstance(ctx);
-            ResumeFamilyCollection familyCol  = familyIns.getResumeFamilyCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
-
-            //关系
-            IRelation relationIns = RelationFactory.getLocalInstance(ctx);
-            //简历基本信息
-            for (int i = 0; i < family.size(); i++) {
-                ResumeFamilyInfo familyInfo =   new ResumeFamilyInfo() ;
-                if( familyCol.size()> i ) {
-                    familyInfo = familyCol.get(i);
-                }
-                familyInfo.setResumeBase(resumeBaseRecInfo);
-
-                JSONArray array = family.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");
-                    //姓名
-                    if ("Name".equals(name)) {
-                        familyInfo.setName(value);
-                    }
-                    // 与本人关系
-                    if ("relation".equals(name)) {
-                        RelationCollection relationCol  = relationIns.getRelationCollection("where beisenVal = '" + value + "'");
-                        if (!relationCol.isEmpty()) {
-                            familyInfo.setRelation(relationCol.get(0));
-                        }
-                    }
-                    if ("age".equals(name)) {
-                        familyInfo.setAge(text);
-                    }
-                    //职务
-                    if ("JobTitle".equals(name)) {
-                        familyInfo.setSpecDuty(text);
-                    }
-                    //公司名
-                    if ("CompanyName".equals(name)) {
-                        familyInfo.setWorkUnit(text);
-                    }
-                    //telephone
-                    if ("telephone".equals(name)) {
-                        familyInfo.setOfficePhone(text);
-                    }
-                    familyIns.save(familyInfo);
-                }
-            }
-        } catch (Exception e) {
-            logger.error("社会关系保存失败!" + e.getMessage());
-            throw new RuntimeException(e);
-        }
-
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
     /**
      * 简历-项目经历
      *
@@ -875,8 +790,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         logger.error("project--" + project);
         try {
             IProjectExp iProjectExp = ProjectExpFactory.getLocalInstance(ctx);
-            ProjectExpCollection ProjectExpCollection =
-                    iProjectExp.getProjectExpCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            ProjectExpCollection ProjectExpCollection = iProjectExp.getProjectExpCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             if (!ProjectExpCollection.isEmpty()) {
                 iProjectExp.delete("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             }
@@ -930,8 +844,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         logger.error("train--" + train);
         try {
             ITrainingExp iTrainingExp = TrainingExpFactory.getLocalInstance(ctx);
-            TrainingExpCollection TrainingExpCollection =
-                    iTrainingExp.getTrainingExpCollection("where resumeBaseInfo = '" + resumeBaseRecInfo.getId().toString() + "'");
+            TrainingExpCollection TrainingExpCollection = iTrainingExp.getTrainingExpCollection("where resumeBaseInfo = '" + resumeBaseRecInfo.getId().toString() + "'");
             if (!TrainingExpCollection.isEmpty()) {
                 iTrainingExp.delete("where resumeBaseInfo = '" + resumeBaseRecInfo.getId().toString() + "'");
             }
@@ -986,8 +899,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
 
         try {
             ICredential iCredential = CredentialFactory.getLocalInstance(ctx);
-            CredentialCollection CredentialCollection =
-                    iCredential.getCredentialCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            CredentialCollection CredentialCollection = iCredential.getCredentialCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             if (!CredentialCollection.isEmpty()) {
                 iCredential.delete("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             }
@@ -1038,8 +950,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         logger.error("lang--" + lang);
         try {
             ILanguageAbility iLanguageAbility = LanguageAbilityFactory.getLocalInstance(ctx);
-            LanguageAbilityCollection LanguageAbilityCollection =
-                    iLanguageAbility.getLanguageAbilityCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            LanguageAbilityCollection LanguageAbilityCollection = iLanguageAbility.getLanguageAbilityCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             if (!LanguageAbilityCollection.isEmpty()) {
                 iLanguageAbility.delete("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             }
@@ -1092,8 +1003,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         logger.error("skill--" + skill);
         try {
             IProfessionalSkills iProfessionalSkills = ProfessionalSkillsFactory.getLocalInstance(ctx);
-            ProfessionalSkillsCollection ProfessionalSkillsCollection =
-                    iProfessionalSkills.getProfessionalSkillsCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            ProfessionalSkillsCollection ProfessionalSkillsCollection = iProfessionalSkills.getProfessionalSkillsCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             if (!ProfessionalSkillsCollection.isEmpty()) {
                 iProfessionalSkills.delete("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
             }
@@ -1125,6 +1035,68 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         }
     }
 
+    /**
+     * 简历-社会关系
+     *
+     * @param
+     */
+    public void saveFamilyInfo(Context ctx, JSONArray family, ResumeBaseRecInfo resumeBaseRecInfo) {
+        logger.error("family--" + family);
+        try {
+            IResumeFamily familyIns = ResumeFamilyFactory.getLocalInstance(ctx);
+            ResumeFamilyCollection familyCol = familyIns.getResumeFamilyCollection("where resumeBase = '" + resumeBaseRecInfo.getId().toString() + "'");
+            //关系
+            IRelation relationIns = RelationFactory.getLocalInstance(ctx);
+            //简历基本信息
+            for (int i = 0; i < family.size(); i++) {
+                ResumeFamilyInfo familyInfo = new ResumeFamilyInfo();
+                if (familyCol.size() > i) {
+                    familyInfo = familyCol.get(i);
+                }
+                familyInfo.setResumeBase(resumeBaseRecInfo);
+
+                JSONArray array = family.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");
+                    //姓名
+                    if ("Name".equals(name)) {
+                        familyInfo.setName(value);
+                    }
+                    // 与本人关系
+                    if ("relation".equals(name)) {
+                        RelationCollection relationCol = relationIns.getRelationCollection("where beisenVal = '" + value + "'");
+                        if (!relationCol.isEmpty()) {
+                            familyInfo.setRelation(relationCol.get(0));
+                        }
+                    }
+                    if ("age".equals(name)) {
+                        familyInfo.setAge(text);
+                    }
+                    //职务
+                    if ("JobTitle".equals(name)) {
+                        familyInfo.setSpecDuty(text);
+                    }
+                    //公司名
+                    if ("CompanyName".equals(name)) {
+                        familyInfo.setWorkUnit(text);
+                    }
+                    //telephone
+                    if ("telephone".equals(name)) {
+                        familyInfo.setOfficePhone(text);
+                    }
+                    familyIns.save(familyInfo);
+                }
+            }
+        } catch (Exception e) {
+            logger.error("社会关系保存失败!" + e.getMessage());
+            throw new RuntimeException(e);
+        }
+
+    }
+
 
     @Override
     protected void _syncRecuritmentToBeisen(Context ctx, String billId) throws BOSException, EASBizException {
@@ -1157,8 +1129,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
      * coyle
      */
     @Override
-    protected void _updateRecuritment(Context ctx, String startDate, String endDate, int offset)
-            throws BOSException, EASBizException {
+    protected void _updateRecuritment(Context ctx, String startDate, String endDate, int offset) throws BOSException, EASBizException {
         super._updateRecuritment(ctx, startDate, endDate, offset);
 
         // 0. 参数校验与日期解析