Kaynağa Gözat

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

heyuan 4 ay önce
ebeveyn
işleme
764a30f391

+ 8 - 0
src/com/kingdee/eas/custom/beisen/utils/BeisenParam.java

@@ -103,6 +103,14 @@ public class BeisenParam {
      * 更新申请信息
      */
     public static final String POST_UPDATEAPPLYLIST = "https://openapi.italent.cn/RecruitV6/api/v1/Apply/UpdateApplyList";
+    /**
+     * 获取【分析报表、定制开发】报表表头数据
+     */
+    public static final String GET_GRIDHEADER = "https://openapi.italent.cn/Ocean/api/v2/Reports/GridHeader";
+    /**
+     * 获取【分析报表、定制报表】报表的列表详细数据
+     */
+    public static final String GET_GRIDDATA = "https://openapi.italent.cn/Ocean/api/v2/Reports/GridData";
 
 
 }

+ 48 - 0
src/com/kingdee/eas/custom/recuritment/entity/BackInfoTableHeader.java

@@ -0,0 +1,48 @@
+package com.kingdee.eas.custom.recuritment.entity;
+
+/**
+ * @author 青梧
+ * @version 1.0
+ * @description: 背调信息表头字段实体类
+ * @date 2025/9/18 11:55
+ */
+public class BackInfoTableHeader {
+    private String title;
+    private String id;
+    private boolean isStorage;
+
+    // 必须有无参构造函数
+    private BackInfoTableHeader() {
+    }
+
+    public BackInfoTableHeader(String title, String id, boolean isStorage) {
+        this.title = title;
+        this.id = id;
+        this.isStorage = isStorage;
+    }
+
+    // getter和setter方法
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public boolean isStorage() {
+        return isStorage;
+    }
+
+    public void setStorage(boolean storage) {
+        isStorage = storage;
+    }
+}

+ 75 - 6
src/com/kingdee/eas/custom/recuritment/task/RecuritmentFacadeControllerBean.java

@@ -6,6 +6,7 @@ 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.json.JSONTokener;
 import com.kingdee.bos.metadata.entity.*;
 import com.kingdee.bos.metadata.query.util.CompareType;
 import com.kingdee.bos.util.BOSUuid;
@@ -23,6 +24,7 @@ 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.entity.BackInfoTableHeader;
 import com.kingdee.eas.custom.recuritment.utils.AttachmentUtils;
 import com.kingdee.eas.custom.recuritment.utils.InitialValueUtils;
 import com.kingdee.eas.hr.base.IRelation;
@@ -40,6 +42,8 @@ import org.apache.logging.log4j.util.TriConsumer;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.text.ParseException;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -56,6 +60,10 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
     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();//共用参数
+    //背景调查表头字段
+    JSONObject json = new JSONObject();
+    //背景调查表头ID
+    String applyIdNumber = "";
 
     /**
      * @throws IOException
@@ -73,6 +81,27 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         for (Map.Entry<Object, Object> entry : set) {
             configMap.put((String) entry.getKey(), (String) entry.getValue());
         }
+        try {
+
+            // 使用Files.readAllBytes读取文件内容,然后转换为字符串
+            byte[] bytes = Files.readAllBytes(Paths.get(System.getProperty("EAS_HOME") + "/server/properties/beisen/backInfoTableHeader.json"));
+            String content = new String(bytes);
+            // 使用JSONTokener解析JSON内容
+            JSONTokener tokener = new JSONTokener(content);
+            com.kingdee.bos.json.JSONArray array = (com.kingdee.bos.json.JSONArray) tokener.nextValue();
+            for (int i = 0; i < array.length(); i++) {
+                com.kingdee.bos.json.JSONObject jsonObject = array.getJSONObject(i);
+                String title = jsonObject.getString("title");
+                String id = jsonObject.getString("id");
+                boolean isStorage = jsonObject.getBoolean("isStorage");
+                json.put(id, new BackInfoTableHeader(title, id, isStorage));
+                if ("申请ID".equals(title)) {
+                    applyIdNumber = id;
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
 
     /**
@@ -168,7 +197,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
                     //String errorMsg = null;
                     if (com.kingdee.bos.rabbitmq.util.StringUtils.isEmpty(errorMsg)) {
                         //修改录用报批数据
-                        updateApproval(ctx, mapData);
+                        updateApproval(ctx, mapData, applyId);
                         //修复简历数据
                         updateResumeBaseRe(ctx, iResumeBaseRec, mapData.get("resumeBaseRecId").toString());
                         //中间表成功信息
@@ -238,7 +267,7 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
      * @param ctx
      * @param mapData
      */
-    public void updateApproval(Context ctx, Map<String, String> mapData) throws BOSException, EASBizException {
+    public void updateApproval(Context ctx, Map<String, String> mapData, String applyId) throws BOSException, EASBizException, IOException {
         logger.error("updateApproval--");
         //简历ID
         String resumeBaseRecId = mapData.get("resumeBaseRecId");
@@ -249,6 +278,11 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
         if (recApprovalCollection.isEmpty()) {
             throw new BOSException("未查询到录用报批数据!");
         }
+        SelectorItemCollection sic = new SelectorItemCollection();
+        sic.add("firsteducation");
+        sic.add("firstspeciality");
+        sic.add("firstschool");
+        sic.add("personalScreening");
         RecApprovalInfo recApprovalInfo = recApprovalCollection.get(0);
         //查询简历-教育经历数据
         IEducationExpREC iEducationExpREC = EducationExpRECFactory.getLocalInstance(ctx);
@@ -261,10 +295,45 @@ public class RecuritmentFacadeControllerBean extends AbstractRecuritmentFacadeCo
             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);
+        }
+        //背调信息
+        String reportId = configMap.get("reportId");
+        String param = "?page=1&pageSize=100&reportId=" + reportId;
+        BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
+        logger.error("updateApproval--param--" + param);
+        JSONObject jsonObject = beisenApiClient.callGetApi(BeisenParam.GET_GRIDDATA + param, new JSONObject());
+        //JSONObject jsonObject = beisenApiClient.callGetApi("https://openapi.italent.cn/Ocean/api/v2/Reports/GridData" + param, new JSONObject());
+        logger.error("updateApproval--jsonObject--" + jsonObject);
+        if (jsonObject.getInteger("code") == 200) {
+            JSONObject data = jsonObject.getJSONObject("data");
+            JSONArray datas = data.getJSONArray("datas");
+            StringBuffer sb = new StringBuffer();
+            for (int i = 0; i < datas.size(); i++) {
+                JSONObject datasJSONObject = datas.getJSONObject(i);
+                logger.error("updateApproval--datasJSONObject--" + datasJSONObject);
+                logger.error("updateApproval--json--" + json);
+                logger.error("updateApproval--applyIdNumber--" + applyIdNumber);
+                //判断申请ID是否一致
+                if (datasJSONObject.getString(applyIdNumber).equals(applyId)) {
+                    sb.append(datas.size() > 1 ? "" : ("背调信息" + (i + 1) + "\n"));
+                    for (String key : datasJSONObject.keySet()) {
+                        if (json.containsKey(key)) {
+                            //获取表头
+                            BackInfoTableHeader backInfoTableHeader = (BackInfoTableHeader) json.get(key);
+                            String title = backInfoTableHeader.getTitle();
+                            String id = backInfoTableHeader.getId();
+                            boolean isStorage = backInfoTableHeader.isStorage();
+                            //获取值
+                            String value = datasJSONObject.getString(id);
+                            if (isStorage) {
+                                sb.append("\t").append(title).append(":").append(value).append("\n");
+                            }
+                        }
+                    }
+                }
+            }
+            recApprovalInfo.setPersonalScreening(sb.toString());
             iRecApproval.updatePartial(recApprovalInfo, sic);
         }
     }