ソースを参照

优化 同步北森简历

qingwu 4 ヶ月 前
コミット
e1c9d45321

+ 30 - 19
src/com/kingdee/eas/custom/beisen/utils/BeisenParam.java

@@ -42,20 +42,6 @@ public class BeisenParam {
      * 获取应聘者面试评价文件
      */
     public static final String GET_INTERVIEWEVALUATIONFILE = "https://openapi.italent.cn/RecruitV6/api/v1/Interview/GetInterviewEvaluationFile";
-    /**
-     * 根据申请id获取原始简历
-     */
-    public static final String GET_ORIGINRESUMEBYAPPLYID = "https://openapi.italent.cn/RecruitV6/api/v1/Apply/GetOriginResumeByApplyId";
-
-    /**
-     * 根据申请ID获取背调信息
-     */
-    public static final String GET_BACKGROUNDINVESTIGATIONBYAPPLYID = "https://openapi.italent.cn/RecruitV6/api/v1/Investigation/GetBackgroundInvestigationByApplyId";
-    /**
-     * 更新申请信息
-     */
-    public static final String POST_UPDATEAPPLYLIST = "https://openapi.italent.cn/RecruitV6/api/v1/Apply/UpdateApplyList";
-
 
     /**
      * 北森配置文件路径
@@ -74,24 +60,49 @@ public class BeisenParam {
     /**
      * 渠道id
      */
-    public static final String BEISEN_CONFIG_CHANNELID = "CHANNELID";
+    public static final String BEISEN_CONFIG_CHANNELID = "BEISEN_CONFIG_CHANNELID";
     /**
      * 转移阶段状态
      */
     public static final String POST_TRANSFERPHASE_URL = "https://openapi.italent.cn/RecruitV6/api/v1/Apply/TransferPhase";
+    /**
+     * 根据同步Id获取应聘者Id
+     */
+    public static final String POST_GETAPPLICANTIDBYSYNCID_URL = "https://openapi.italent.cn/RecruitV6/api/v1/Applicant/GetApplicantIdBySyncId";
+
 
     /**
      * 招聘需求新增到岗
      */
     public static final String POST_ENTRYHANDLE_URL = "https://openapi.italent.cn/RecruitV6/api/v1/Requirement/EntryHandle";
 
-
     /**
      * 将要转移到的阶段id
      */
-    public static final String BEISEN_CONFIG_PHASEID = "PHASEID";
+    public static final String BEISEN_CONFIG_PHASEID = "phase3";
+
     /**
-     * 将要转移到的状态id
+     * 将要转移到离职的状态id
      */
-    public static final String BEISEN_CONFIG_STATUSID = "STATUSID";
+    public static final String BEISEN_CONFIG_RESERVE_STATUSID = "status3C";
+
+    /**
+     * 将要转移到在职的状态id
+     */
+    public static final String BEISEN_CONFIG_UNRESERVE_STATUSID = "status3A";
+    /**
+     * 根据申请id获取原始简历
+     */
+    public static final String GET_ORIGINRESUMEBYAPPLYID = "https://openapi.italent.cn/RecruitV6/api/v1/Apply/GetOriginResumeByApplyId";
+
+    /**
+     * 根据申请ID获取背调信息
+     */
+    public static final String GET_BACKGROUNDINVESTIGATIONBYAPPLYID = "https://openapi.italent.cn/RecruitV6/api/v1/Investigation/GetBackgroundInvestigationByApplyId";
+    /**
+     * 更新申请信息
+     */
+    public static final String POST_UPDATEAPPLYLIST = "https://openapi.italent.cn/RecruitV6/api/v1/Apply/UpdateApplyList";
+
+
 }

+ 12 - 8
src/com/kingdee/eas/custom/recuritment/task/RecuritmentFacadeControllerBean.java

@@ -158,7 +158,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
                     // 获取并处理原始简历文件
                     processResumeFile(applyId, ctx, resumeInfo, "原始简历");
                     // 获取并处理背调信息文件
-                    processResumeFile(applyId, ctx, resumeInfo, "背调信息");
+                    processResumeFile(applyId, ctx, resumeInfo, "背景调查审批表");
                     //生成录用报批
                     //String errorMsg = saveRecApproval(ctx, mapData);
                     String serviceName = "generateHireApprovalService";
@@ -171,9 +171,12 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
                         updateApproval(ctx, mapData);
                         //修复简历数据
                         updateResumeBaseRe(ctx, iResumeBaseRec, mapData.get("resumeBaseRecId").toString());
+                        //中间表成功信息
                         applicantBeisenInfo.setSyncResult("同步成功!");
                         applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.SUCCESS);
                         successSize++;
+                        //返回给北森信息
+                        pushMessageToBeisen(applyId, "同步成功");
                     } else {
                         throw new BOSException(errorMsg.toString());
                     }
@@ -183,6 +186,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
                 iApplicantBeisen.save(applicantBeisenInfo);
             } catch (Exception e) {
                 e.printStackTrace();
+                pushMessageToBeisen(applyId, e.getMessage());
                 applicantBeisenInfo.setSyncStatus(ExecuteResultEnum.ERROR);
                 applicantBeisenInfo.setSyncResult("简历处理失败: " + e.getMessage());
                 iApplicantBeisen.save(applicantBeisenInfo);
@@ -352,12 +356,12 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         if (recuritmentDemandCollection.isEmpty()) {
             //String message = "sHR未查询到对应的招聘需求,北森需求ID:" + recruitRequirementId + ",需求名称:" + dataJson.getString("name");;
             // 推送未查询到招聘需求消息至北森
-            pushMessageToBeisen(applyId, configMap.get("syncToBsErrorMsg"));
+            //pushMessageToBeisen(applyId, configMap.get("syncToBsErrorMsg"));
             //pushMessageToBeisen(applyId, "显示匹配不上金蝶原始需求单据");
-            throw new BOSException("sHR未查询到对应的招聘需求,需求名称::" + dataJson.getString("name") + ",北森需求ID" + recruitRequirementId);
+            throw new BOSException("sHR未查询到对应的招聘需求,北森需求名称:" + dataJson.getString("name") + ",北森需求ID" + recruitRequirementId);
         }
         //成功則修改北森字段为空
-        pushMessageToBeisen(applyId, "");
+        //pushMessageToBeisen(applyId, "成功");
         return recuritmentDemandCollection.get(0);
     }
 
@@ -368,7 +372,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
      * @param applyId 申请ID
      * @param message 消息
      */
-    public void pushMessageToBeisen(String applyId, String message) throws IOException {
+    public void pushMessageToBeisen(String applyId, String message) throws BOSException {
         try {
 
             BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
@@ -389,7 +393,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
             logger.error("pushMessageToBeisen--result--" + result);
         } catch (IOException e) {
             e.printStackTrace();
-            throw new RuntimeException(e);
+            throw new BOSException(e);
         }
     }
 
@@ -420,13 +424,13 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
                 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)) {
+            } 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);
+                logger.error("背景调查审批表--" + fileInfo);
                 //originResume
                 isOrigin = true;
             }