9060 8 månader sedan
förälder
incheckning
d1c2359654

BIN
path/20250815/server/lib/addon/customer/lib/teda_beisen_yf_zqy.jar


+ 2 - 0
path/20250815/server/properties/beiSen/orgStaffConfig.properties

@@ -2,6 +2,8 @@ posId=posId
 CFOriginalId=id
 staffName=staffName
 orgPosName=Name
+orgOriginalId=code
+FParentID=parentOriginalId
 customFieldList.FControlWay=extkongzhifangshi_611852_1859865232
 customFieldList.FPersonCount=extdangqianrenshu_611852_10064951,integer
 customFieldList.FStaffYear=extdingbianrenshu_611852_1497615182,integer

+ 1 - 0
path/20250815/server/properties/beiSen/posStaffConfig.properties

@@ -2,6 +2,7 @@ posId=posId
 CFOriginalId=id
 staffName=staffName
 orgPosName=Name
+orgOriginalId=Org,integer
 orgPosStatus=status,integer
 customProperties.FControlWay=extkongzhifangshi_611852_1000107625
 customProperties.FPersonCount=extdangqianrenshu_611852_721575747,integer

+ 1 - 0
properties/posStaffConfig.properties

@@ -2,6 +2,7 @@ posId=posId
 CFOriginalId=id
 staffName=staffName
 orgPosName=Name
+orgPosStatus=status,integer
 customProperties.FControlWay=extkongzhifangshi_433107_1749927714
 customProperties.FPersonCount=extdangqianrenshu_433107_353309291,integer
 customProperties.FStaffYear=extdingbianrenshu_433107_1066638704,integer

+ 10 - 8
websrc/com/kingdee/eas/custom/beisen/synchronouspos/handler/ExecutorCountUtil.java

@@ -1,17 +1,19 @@
 package com.kingdee.eas.custom.beisen.synchronouspos.handler;
 
+import java.util.concurrent.atomic.AtomicInteger;
+
 public class ExecutorCountUtil {
-    private int count = 0;
+    private final AtomicInteger count = new AtomicInteger(0);
+    public int get() {
+        return count.get(); // 原子读取
+    }
     private static ExecutorCountUtil examples = new ExecutorCountUtil();
 
-    public int getCount() {
-        return count;
-    }
-    public void CountClear() {
-        this.count=0;
-    }
     public void countPlusPlus() {
-        this.count++;
+        count.incrementAndGet();
+    }
+    public void countLessLess() {
+        count.decrementAndGet();
     }
     public static ExecutorCountUtil getExamples() {
         return examples;

+ 48 - 71
websrc/com/kingdee/eas/custom/beisen/synchronouspos/handler/StaffManageProjectListHandlerEx.java

@@ -1,9 +1,13 @@
 package com.kingdee.eas.custom.beisen.synchronouspos.handler;
 
+import com.alibaba.fastjson.JSON;
 import com.google.common.collect.Maps;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
+import com.kingdee.bos.rabbitmq.guava.Lists;
 import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.custom.beisen.synchronouspos.osf.SyncOrgStaffManageRunnable;
+import com.kingdee.eas.custom.beisen.synchronouspos.osf.SyncPosStaffManageRunnable;
 import com.kingdee.shr.base.syssetting.IMSFServiceFacade;
 import com.kingdee.shr.base.syssetting.MSFServiceFacadeFactory;
 import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsBody;
@@ -27,90 +31,63 @@ public class StaffManageProjectListHandlerEx extends StaffManageProjectListHandl
     private static Logger log = Logger.getLogger(StaffManageProjectListHandlerEx.class);
 
     public void batchDisableAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-        try {
-            Context ctx = SHRContext.getInstance().getContext();
-            int successCount = 0;
-            int errorCount = 0;
-            BatchMessageTipsHeader batchMessageTipsHeader = new BatchMessageTipsHeader();
-            int i = 0;
-            Map<String, Object> map = Maps.newHashMap();
-            StringBuilder billIds = new StringBuilder("CFOriginalId,");
-            //同步编制,返回参数,以及同步结果
-
-            Map<String, List<Map<String, Object>>> result = (Map<String, List<Map<String, Object>>>) MSFServiceFacadeFactory.getLocalInstance(ctx).processService("syncStaffManageOSF", map);
-            //同步参数
-            List<Map<String, Object>> list = result.get("list");
-            //同步结果
-            List<Map<String, Object>> listMap = result.get("listMap");
-            for (int size = list.size(); i < size; ++i) {
-                Map<String, Object> objMap = list.get(i);
-                Map<String, Object> returnMap = listMap.get(i);
-                //获取同步状态
-                String code = String.valueOf(returnMap.get("code"));
-                BatchMessageTipsBody body = new BatchMessageTipsBody();
-                String CFOriginalId = (String) objMap.get("CFOriginalId");
-                billIds.append("," + CFOriginalId);
-                body.setId(CFOriginalId);
-                Boolean MuitTipsState = null;
-                if ("200".equals(code)) {
-                    MuitTipsState = Boolean.TRUE;
-                    ++successCount;
-                } else {
-                    MuitTipsState = Boolean.FALSE;
-                    ++errorCount;
-                }
-                body.setMuitTipsState(MuitTipsState);
-                body.setMuitTipsMessage(objMap.toString());
-                batchMessageTipsHeader.addResult(body);
-            }
-            String billIdstr = billIds.toString();
-            billIdstr.replace("CFOriginalId,", "");
-            batchMessageTipsHeader.setBillId(billIdstr);
-            batchMessageTipsHeader.setFailureCount(errorCount);
-            batchMessageTipsHeader.setSuccessCount(successCount);
-            this.writeSuccessData(batchMessageTipsHeader);
-        } catch (Exception var15) {
-            var15.printStackTrace();
-        }
-        return;
+        ExecutorCountUtil examples = ExecutorCountUtil.getExamples();
+        throw new ShrWebBizException("执行中任务数:"+Math.min(examples.get(),4)+",等待中任务数:"+Math.max(examples.get()-4,0)+"。");
     }
 
     public void batchEnableAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
         ExecutorCountUtil examples = ExecutorCountUtil.getExamples();
         Context ctx = SHRContext.getInstance().getContext(); // 重新获取上下文(如果需要)
-        IMSFServiceFacade msp =null;
+        System.out.println("batchEnableAction");
+        if (examples.get() <= 0) {
+            try {
+                IMSFServiceFacade msp = MSFServiceFacadeFactory.getLocalInstance(ctx);
+                ExecutorService executor = Executors.newFixedThreadPool(4);
 
-        try {
-            msp = MSFServiceFacadeFactory.getLocalInstance(ctx);
-        } catch (BOSException e) {
-            throw new RuntimeException(e);
-        }
+                Map<String, Object> map = Maps.newHashMap();
+                map.put("mack", "org");
+                Map<String, Object> result = (Map<String, Object>) msp.processService("syncStaffManageOSF", map);
+                System.out.println("result:"+ JSON.toJSONString(result));
 
-        if (examples.getCount()<=0) {
-            examples.countPlusPlus();
-            ExecutorService executor = Executors.newSingleThreadExecutor();
-            IMSFServiceFacade finalMsp = msp;
-            executor.submit(() -> {
-                try {
+                List<Map<String, Object>> orgListMap = (List<Map<String, Object>>) result.get("orgListMap");
+                List<Map<String, Object>> posListMap = (List<Map<String, Object>>) result.get("posListMap");
+                int orgLen = orgListMap.size();
+                int batchSize = 100;
+                for (int i = 0; i < orgLen; i+=batchSize) {
+                    examples.countPlusPlus();
+                    int end = Math.min(i + batchSize, orgLen);
+                    List<Map<String, Object>> orgSubListMap = orgListMap.subList(i,end);
+                    SyncOrgStaffManageRunnable syncOrg = new SyncOrgStaffManageRunnable(ctx, orgSubListMap, examples);
+                    executor.submit(syncOrg);
+                }
+                System.out.println("examples:"+ examples.get());
 
-                    Map<String, Object> map = Maps.newHashMap();
-                    Map<String, List<Map<String, Object>>> result = (Map<String, List<Map<String, Object>>>) finalMsp.processService("syncStaffManageOSF", map);
-                    // 处理结果...
-                    //examples.CountClear();
-                } catch (BOSException | EASBizException e) {
-                    log.error("Error in syncStaffManageOSF", e);
-                } catch (Exception e) {
-                    log.error("Unexpected error", e);
-                } finally {
-                    examples.CountClear();
+                int posLen = posListMap.size();
+                for (int i = 0; i < posLen; i+=batchSize) {
+                    examples.countPlusPlus();
+                    int end = Math.min(i + batchSize, posLen);
+                    List<Map<String, Object>> posSubListMap = posListMap.subList(i, end);
+                    SyncPosStaffManageRunnable syncOrg = new SyncPosStaffManageRunnable(ctx, posSubListMap, examples);
+                    executor.submit(syncOrg);
                 }
-            });
-            executor.shutdown();
+                System.out.println("examples:"+ examples.get());
+                executor.shutdown();
+
+            } catch (BOSException | EASBizException e) {
+                e.printStackTrace();
+            }
             throw new ShrWebBizException("触发成功,已在后台执行中,请等待");
-        }else {
+        } else {
             throw new ShrWebBizException("已触发,已在后台执行中,请等待");
         }
     }
 
+    public static void main(String[] args) {
+        ExecutorCountUtil examples = ExecutorCountUtil.getExamples();
+        examples.countPlusPlus();
+        System.out.println(examples.get());
+        examples.countLessLess();
+        System.out.println(examples.get());
+    }
 
 }

+ 88 - 0
websrc/com/kingdee/eas/custom/beisen/synchronouspos/osf/StaffManageProcess.java

@@ -0,0 +1,88 @@
+package com.kingdee.eas.custom.beisen.synchronouspos.osf;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Maps;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.rabbitmq.guava.Lists;
+import com.kingdee.eas.custom.beisen.utils.BeiSenUtils;
+import com.kingdee.eas.custom.beisen.utils.Helper;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * description: StaffManageRunnable <br>
+ * date: 2025/8/12 9:24 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class StaffManageProcess{
+
+    public Map<String, List<Map<String,Object>>> orgProcess(Context context, List<Map<String,Object>> orgListMap) throws IOException, URISyntaxException {
+        Map<String,List<Map<String,Object>>> result = Maps.newHashMap();
+        List<Map<String,Object>> list = Lists.newArrayList();
+        List<Map<String,Object>> listMap = Lists.newArrayList();
+        result.put("list",list);
+        result.put("listMap",listMap);
+        BeiSenUtils b = new BeiSenUtils(context);
+        Helper helper = b.helper;
+        String token = b.getAccessToken();
+        for(Map pos : orgListMap) {
+            // 若访问令牌不为空且开始时间和结束时间不为空
+            if (!com.kingdee.util.StringUtils.isEmpty(token)) {
+                // 创建请求头的 Map
+                Map<String, String> header = new HashMap<String, String>();
+                // 设置请求头的 Content-Type
+                header.put("Content-Type", "application/json");
+                // 设置请求头的 Authorization
+                header.put("Authorization", "Bearer " + token);
+                String url = "https://openapi.italent.cn/UserFrameworkApiV3/api/v1/departments/Put?originalId=" + URLEncoder.encode((String) pos.get("id"), "UTF-8");
+
+                JSONObject requestBody = new JSONObject(pos);
+                System.out.println("url:" + url);
+                System.out.println("requestBody:" + requestBody);
+                JSONObject responseJson = helper.getURL(url, header, requestBody, "PUT", requestBody.getString("posId"), "更新", "北森");
+                System.out.println("responseJson:" + responseJson);
+                listMap.add(responseJson);
+                list.add(pos);
+            }
+        }
+        return result;
+    }
+
+    public Map<String,List<Map<String,Object>>> posProcess(Context context,List<Map<String,Object>> posListMap) throws IOException, URISyntaxException {
+        Map<String,List<Map<String,Object>>> result = Maps.newHashMap();
+        List<Map<String,Object>> list = Lists.newArrayList();
+        List<Map<String,Object>> listMap = Lists.newArrayList();
+        result.put("list",list);
+        result.put("listMap",listMap);
+        BeiSenUtils b = new BeiSenUtils(context);
+        Helper helper = b.helper;
+        String token = b.getAccessToken();
+        for(Map pos : posListMap) {
+            // 若访问令牌不为空且开始时间和结束时间不为空
+            if (!com.kingdee.util.StringUtils.isEmpty(token)) {
+                // 创建请求头的 Map
+                Map<String, String> header = new HashMap<String, String>();
+                // 设置请求头的 Content-Type
+                header.put("Content-Type", "application/json");
+                // 设置请求头的 Authorization
+                header.put("Authorization", "Bearer " + token);
+                String url = "https://openapi.italent.cn/RecruitV6/api/v1/RecruitOnBoarding/UpdatePost";
+                JSONObject requestBody = new JSONObject(pos);
+                System.out.println("url:"+url);
+                System.out.println("requestBody:"+requestBody);
+                JSONObject responseJson = helper.getURL(url,header, requestBody, "PUT",requestBody.getString("posId"),"更新","北森");
+                System.out.println("responseJson:"+responseJson);
+                listMap.add(responseJson);
+                list.add(pos);
+            }
+        }
+        return result;
+    }
+}

+ 50 - 0
websrc/com/kingdee/eas/custom/beisen/synchronouspos/osf/SyncOrgStaffManageRunnable.java

@@ -0,0 +1,50 @@
+package com.kingdee.eas.custom.beisen.synchronouspos.osf;
+
+import com.kingdee.bos.Context;
+import com.kingdee.eas.custom.beisen.synchronouspos.handler.ExecutorCountUtil;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * description: SyncStaffManageRunnable <br>
+ * date: 2025/8/11 18:43 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class SyncOrgStaffManageRunnable implements Runnable{
+    private List<Map<String,Object>> listMap;
+    private Context context;
+    private Map<String,List<Map<String,Object>>> result;
+    private ExecutorCountUtil countUtil;
+    private boolean state = false;
+    public SyncOrgStaffManageRunnable(Context context, List<Map<String,Object>> listMap, ExecutorCountUtil countUtil) {
+        this.context=context;
+        this.listMap=listMap;
+        this.countUtil=countUtil;
+    }
+
+    public Map<String, List<Map<String, Object>>> getResult() {
+        return result;
+    }
+
+    public boolean getState() {
+        return state;
+    }
+
+    @Override
+    public void run() {
+        try {
+            result = new StaffManageProcess().orgProcess(context,listMap);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (URISyntaxException e) {
+            e.printStackTrace();
+        }finally {
+            countUtil.countLessLess();
+            state=true;
+        }
+    }
+}

+ 50 - 0
websrc/com/kingdee/eas/custom/beisen/synchronouspos/osf/SyncPosStaffManageRunnable.java

@@ -0,0 +1,50 @@
+package com.kingdee.eas.custom.beisen.synchronouspos.osf;
+
+import com.kingdee.bos.Context;
+import com.kingdee.eas.custom.beisen.synchronouspos.handler.ExecutorCountUtil;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * description: SyncStaffManageRunnable <br>
+ * date: 2025/8/11 18:43 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class SyncPosStaffManageRunnable implements Runnable{
+    private List<Map<String,Object>> listMap;
+    private Context context;
+    private Map<String,List<Map<String,Object>>> result;
+    private ExecutorCountUtil countUtil;
+    private boolean state = false;
+    public SyncPosStaffManageRunnable(Context context, List<Map<String,Object>> listMap, ExecutorCountUtil countUtil) {
+        this.context=context;
+        this.listMap=listMap;
+        this.countUtil=countUtil;
+    }
+
+    public Map<String, List<Map<String, Object>>> getResult() {
+        return result;
+    }
+
+    public boolean getState() {
+        return state;
+    }
+
+    @Override
+    public void run() {
+        try {
+            result = new StaffManageProcess().posProcess(context,listMap);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (URISyntaxException e) {
+            e.printStackTrace();
+        }finally {
+            countUtil.countLessLess();
+            state=true;
+        }
+    }
+}

+ 49 - 45
websrc/com/kingdee/eas/custom/beisen/synchronouspos/osf/SyncStaffManageOSFService.java

@@ -13,20 +13,41 @@ import com.kingdee.eas.custom.beisen.utils.Helper;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
 
+import java.io.IOException;
+import java.net.URISyntaxException;
 import java.net.URLEncoder;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+/**
+ * 编制同步
+ * description: SynchronousPosOSFService <br>
+ * date: 2025/7/11 17:46 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
 public  class SyncStaffManageOSFService implements IHRMsfService {
 
 
+    public  Map<String,List<Map<String,Object>>> orgProcess(Context context,List<Map<String,Object>> orgListMap) throws IOException, URISyntaxException {
+        return new StaffManageProcess().orgProcess(context,orgListMap);
+    }
+
+    public  Map<String,List<Map<String,Object>>> posProcess(Context context,List<Map<String,Object>> posListMap) throws IOException, URISyntaxException {
+        return new StaffManageProcess().posProcess(context,posListMap);
+    }
+
     @Override
     public Object process(Context context, Map<String, Object> map) throws EASBizException, BOSException {
+        String mack = (String) map.get("mack");
+
         Map<String,List<Map<String,Object>>> result = Maps.newHashMap();
         List<Map<String,Object>> list = Lists.newArrayList();
         List<Map<String,Object>> listMap = Lists.newArrayList();
+        List<Map<String,Object>> orgListMap = Lists.newArrayList();
+        List<Map<String,Object>> posListMap = Lists.newArrayList();
         result.put("list",list);
         result.put("listMap",listMap);
         String posPath = (String) map.get("posPath");
@@ -43,8 +64,6 @@ public  class SyncStaffManageOSFService implements IHRMsfService {
         sql.append(" and FChannel = 1 ");
         IRowSet rs = DbUtil.executeQuery(context, sql.toString());
         try{
-            BeiSenUtils b = new BeiSenUtils(context);
-            Helper helper = b.helper;
             BeisenParamByPropertiesUtil posUtil = new BeisenParamByPropertiesUtil(posPath);
             Map<String,String> poskeyMap = posUtil.getConfig();
             BeisenParamByPropertiesUtil orgUtil = new BeisenParamByPropertiesUtil(orgPath);
@@ -55,28 +74,30 @@ public  class SyncStaffManageOSFService implements IHRMsfService {
                 String FYear = rs.getString("FYear");
                 StringBuilder selSql = new StringBuilder();
                 selSql.append(" select * from ( ");
-                selSql.append(" select 'org' orgpos,org.fid posId,org.fname_l2 orgPosName,org.FDisplayName_L2 staffName, ");
+                selSql.append(" select 'org' orgpos,org.fid posId,org.Fnumber orgOriginalId,org.FParentID,org.fname_l2 orgPosName,org.FDisplayName_L2 staffName, ");
                 selSql.append("         org.fid CFOriginalId,(case when staff.FControlWay=0 then 3 when staff.FControlWay=1 then 2 else 1 end) FControlWay, ");
                 selSql.append("         staff.FPersonCount,staff.FStaffYear,staff.FYearActualStart, ");
                 selSql.append("         staff.FOnWayAddCount,staff.FOnWaySubCount, ");
                 selSql.append("         (staff.FStaffYear-staff.FOnWayAddCount+staff.FOnWaySubCount-staff.FPersonCount) FStaffYearUsable, ");
-                selSql.append("         (staff.FState+1) FState,staff.FContainSub ");
+                selSql.append("         (staff.FState+1) FState,staff.FContainSub, ");
+                selSql.append(" 1 orgPosStatus ");
                 selSql.append(" from ");
                 selSql.append(" "+FTableName+" staff ");
                 selSql.append(" left join t_org_admin org on org.fid=staff.FAdminOrgID ");
                 selSql.append(" left join t_org_position pos on pos.fid = staff.FpositionID ");
                 selSql.append(" where pos.fid is null and org.FReserveFieldFirst is not null ");
                 selSql.append(" UNION all ");
-                selSql.append(" select 'pos' orgpos,pos.fid posId,pos.fname_l2 orgPosName,org.FDisplayName_L2 staffName,pos.CFOriginalId, ");
+                selSql.append(" select 'pos' orgpos,pos.fid posId,org.FreserveFieldFirst orgOriginalId,pos.FParentID,pos.fname_l2 orgPosName,org.FDisplayName_L2 staffName,pos.CFOriginalId, ");
                 selSql.append(" (case when staff.FControlWay=0 then 3 when staff.FControlWay=1 then 2 else 1 end) FControlWay, ");
                 selSql.append("         staff.FPersonCount,staff.FStaffYear,staff.FYearActualStart, ");
                 selSql.append("         staff.FOnWayAddCount,staff.FOnWaySubCount, ");
                 selSql.append("         (staff.FStaffYear-staff.FOnWayAddCount+staff.FOnWaySubCount-staff.FPersonCount) FStaffYearUsable, ");
-                selSql.append("         (staff.FState+1) FState,staff.FContainSub ");
+                selSql.append("         (staff.FState+1) FState,staff.FContainSub, ");
+                selSql.append("  (case when pos.FDELETEDSTATUS=2 then 0 else 1 end) orgPosStatus ");
                 selSql.append(" from ");
                 selSql.append(" "+FTableName+" staff ");
-                selSql.append(" left join t_org_admin org on org.fid=staff.FAdminOrgID ");
                 selSql.append(" left join t_org_position pos on pos.fid = staff.FpositionID ");
+                selSql.append(" left join t_org_admin org on org.fid=pos.FADMINORGUNITID ");
                 selSql.append(" where pos.fid is not null and pos.CFOriginalId is not null ");
                 selSql.append(" ) t order by t.FContainSub desc ");
                 IRowSet rsSel = DbUtil.executeQuery(context, selSql.toString());
@@ -84,57 +105,38 @@ public  class SyncStaffManageOSFService implements IHRMsfService {
 
                 while (rsSel.next()){
                     String orgpos= rsSel.getString("orgpos");
-
-                    String token = b.getAccessToken();
                     if("org".equals(orgpos)){
                         Map<String, Object> pos = this.getPostData(orgkeyMap,rsSel);
-
                         if(null!=pos){
-                            // 若访问令牌不为空且开始时间和结束时间不为空
-                            if (!com.kingdee.util.StringUtils.isEmpty(token)) {
-                                // 创建请求头的 Map
-                                Map<String, String> header = new HashMap<String, String>();
-                                // 设置请求头的 Content-Type
-                                header.put("Content-Type", "application/json");
-                                // 设置请求头的 Authorization
-                                header.put("Authorization", "Bearer " + token);
-                                String url = "https://openapi.italent.cn/UserFrameworkApiV3/api/v1/departments/Put?originalId="+ URLEncoder.encode((String) pos.get("id"),"UTF-8");
-
-                                JSONObject requestBody = new JSONObject(pos);
-                                System.out.println("url:"+url);
-                                System.out.println("requestBody:"+requestBody);
-                                JSONObject responseJson = helper.getURL(url,header, requestBody, "PUT",requestBody.getString("posId"),"更新","北森");
-                                System.out.println("responseJson:"+responseJson);
-                                listMap.add(responseJson);
-                                list.add(pos);
-                            }
+                            orgListMap.add(pos);
                         }
                     }else if ("pos".equals(orgpos)){
                         Map<String, Object> pos = this.getPostData(poskeyMap,rsSel);
                         if(null!=pos){
-                            // 若访问令牌不为空且开始时间和结束时间不为空
-                            if (!com.kingdee.util.StringUtils.isEmpty(token)) {
-                                // 创建请求头的 Map
-                                Map<String, String> header = new HashMap<String, String>();
-                                // 设置请求头的 Content-Type
-                                header.put("Content-Type", "application/json");
-                                // 设置请求头的 Authorization
-                                header.put("Authorization", "Bearer " + token);
-                                String url = "https://openapi.italent.cn/RecruitV6/api/v1/RecruitOnBoarding/UpdatePost";
-                                JSONObject requestBody = new JSONObject(pos);
-                                System.out.println("url:"+url);
-                                System.out.println("requestBody:"+requestBody);
-                                JSONObject responseJson = helper.getURL(url,header, requestBody, "PUT",requestBody.getString("posId"),"更新","北森");
-                                System.out.println("responseJson:"+responseJson);
-                                listMap.add(responseJson);
-                                list.add(pos);
-                            }
+                            posListMap.add(pos);
                         }
                     }
                 }
+                if("org".equals(mack)||"pos".equals(mack)){
+                    //Map<String,List<Map<String,Object>>> resultOrg = this.orgProcess(context,orgListMap);
+                    result.put("orgListMap",orgListMap);
+                    result.put("posListMap",posListMap);
+                } else {
+                    result.put("orgListMap",orgListMap);
+                    result.put("posListMap",posListMap);
+                    Map<String,List<Map<String,Object>>> resultOrg = this.orgProcess(context,orgListMap);
+                    Map<String,List<Map<String,Object>>> resultPos = this.posProcess(context,posListMap);
+                    list.addAll(resultOrg.get("list"));
+                    listMap.addAll(resultOrg.get("listMap"));
+                    list.addAll(resultPos.get("list"));
+                    listMap.addAll(resultPos.get("listMap"));
+                    result.put("orgListMap",orgListMap);
+                    result.put("posListMap",posListMap);
+                }
             }
         }catch (Exception e){
             e.printStackTrace();
+            throw new BOSException(e);
         }finally {
 
         }
@@ -240,4 +242,6 @@ public  class SyncStaffManageOSFService implements IHRMsfService {
         }
         return pos;
     }
+
+
 }

+ 4 - 0
websrc/com/kingdee/eas/custom/beisen/synchronouspos/osf/SynchronousPosOSFService.java

@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
+ * ¸Úλͬ²½
  * description: SynchronousPosOSFService <br>
  * date: 2025/7/11 17:46 <br>
  * author: lhbj <br>
@@ -76,6 +77,7 @@ public class SynchronousPosOSFService implements IHRMsfService {
      * @throws SQLException
      */
     protected List<Map<String, Object>> getPostData(Context ctx,Map<String,String> keyMap,StringBuilder sql) throws BOSException, SQLException {
+
         IRowSet rowSet = DbUtil.executeQuery(ctx,sql.toString());
         List<Map<String, Object>> posList = Lists.newArrayList();
         while (rowSet.next()){
@@ -270,6 +272,7 @@ public class SynchronousPosOSFService implements IHRMsfService {
         BeiSenUtils b = new BeiSenUtils(ctx);
         Helper helper = b.helper;
         StringBuilder sql = this.getSql(posId, syncStartTimeStr, syncEndTimeStr, true);
+        System.out.println("_sendAddNewPosToBeisen:"+sql);
         List<Map<String, Object>> list = this.getPostData(ctx, keyMap, sql);
         List<JSONObject> responseList = Lists.newArrayList();
         for (Map<String, Object> pos : list) {
@@ -304,6 +307,7 @@ public class SynchronousPosOSFService implements IHRMsfService {
         BeiSenUtils b = new BeiSenUtils(ctx);
         Helper helper = b.helper;
         StringBuilder sql1 = this.getSql(posId,syncStartTimeStr,syncEndTimeStr,false);
+        System.out.println("_sendAddNewPosToBeisen:"+sql1);
         List<Map<String,Object>> list1 = this.getPostData(ctx,keyMap,sql1);
         List<JSONObject> responseList = Lists.newArrayList();
         // »ñÈ¡·ÃÎÊÁîÅÆ

+ 37 - 39
websrc/com/kingdee/eas/custom/beisen/synchronouspos/osf/posConfig.properties

@@ -1,43 +1,41 @@
-customProperties.posNumber=extgangweibianma_433107_380359134
+customProperties.posNumber=extgangweibianma_611852_717278830
 orgOriginalId=Org,integer
 posId=posId
 posName=Name
 posOriginalId=id
-#pospOriginalId1=upManage,integer
-#pospOriginalId2=dotManage,integer
-posDeletedStatus=Status,integer
-customProperties.posZwjzygx=extzhiweijiazhiyugongxian_433107_832609725
-customProperties.posZyzz=extzhuyaozhize_433107_1869816037
-customProperties.posGwdwsccg=extzhiweiduiwaijiaofuchengguo_433107_848485055
-customProperties.posCgzb=extchengguodezhibiao_433107_672018534
-customProperties.posZlzb=extzhiliangzhibiao_433107_1153480133
-customProperties.hrJobFamily=extzhiweizu_433107_1497123321
-customProperties.hrJobCategory=extzhiweilei_433107_1088618169
-customProperties.jobscHrJobSubCategory=extzhiweizilei_433107_1602866242
-customProperties.jobNumber=extzhiweibianma_433107_1290712431
-customProperties.jobName=extzhiweimingcheng_433107_512846676
-customProperties.lowJobLevel=extzuidizhiceng_433107_355678147
-customProperties.highJobLevel=extzuigaozhiceng_433107_174877615
-customProperties.lowJobGrade=extzuigaozhiji_433107_2045773973
-customProperties.highJobGrade=extzuidizhiji_433107_1385945899
-customProperties.education=extjiaoyushuiping_433107_1951575537
-customProperties.requirement=extzhuanyeyaoqiu_433107_1776687243
-customProperties.certification=extzigezhengshu_433107_1510044483
-customProperties.foreignLang=extwaiyuyaoqiu_433107_1249481814
-customProperties.knowledge=extzhishi_433107_641379677
-customProperties.skills=extjineng_433107_956614495
-customProperties.experience=extjingyan_433107_295083920
-customProperties.coreCompe=extguanjiansuzhi_433107_1844176444
-customProperties.position1=extgangwei1_433107_1257343019
-customProperties.ptime1=extshijian_433107_1542482809
-customProperties.position2=extgangwei2_433107_1926360484
-customProperties.ptime2=extshijian2_433107_2055690495
-customProperties.workAdd=extgongzuodidian_433107_1073710237
-customProperties.frequency=extchuchapinlu_433107_902126115
-customProperties.jobRespon=extgongzuozhize_433107_1005575449
-customProperties.qualifications=extrenzhizige_433107_1814678007
-customProperties.reserved1=extyuliuziduan1_433107_1429210295
-customProperties.reserved2=extyuliuziduan2_433107_1906458378
-customProperties.reserved3=extyuliuziduan3_433107_1446014427
-customProperties.reserved4=extyuliuziduan4_433107_785068249
-customProperties.reserved5=extyuliuziduan5_433107_2140944373
+posDeletedStatus=status,integer
+customProperties.posZwjzygx=extzhiweijiazhiyugongxian_611852_316714607
+customProperties.posZyzz=extzhuyaozhize_611852_517046142
+customProperties.posGwdwsccg=extzhiweiduiwaijiaofuchengguo_611852_1334269114
+customProperties.posCgzb=extchengguodezhibiao_611852_286609099
+customProperties.posZlzb=extzhiliangzhibiao_611852_1400230320
+customProperties.hrJobFamily=extzhiweizu_611852_1577409965
+customProperties.hrJobCategory=extzhiweilei_611852_1452533500
+customProperties.jobscHrJobSubCategory=extzhiweizilei_611852_384106906
+customProperties.jobNumber=extzhiweibianma_611852_1044410721
+customProperties.jobName=extzhiweimingcheng_611852_1973973347
+customProperties.lowJobLevel=extzuidizhiceng_611852_2142868778
+customProperties.highJobLevel=extzuigaozhiceng_611852_585596915
+customProperties.highJobGrade=extzuigaozhiji_611852_2055468542
+customProperties.lowJobGrade=extzuidizhiji_611852_1826544014
+customProperties.education=extjiaoyushuiping_611852_1924306834
+customProperties.requirement=extzhuanyeyaoqiu_611852_172994339
+customProperties.certification=extzigezhengshu_611852_1625932122
+customProperties.foreignLang=extwaiyuyaoqiu_611852_1298754968
+customProperties.knowledge=extzhishi_611852_291356608
+customProperties.skills=extjineng_611852_395273741
+customProperties.experience=extjingyan_611852_1185247246
+customProperties.coreCompe=extguanjiansuzhi_611852_493551551
+customProperties.position1=extgangwei1_611852_367564218
+customProperties.ptime1=extshijian1_611852_1649211176
+customProperties.position2=extgangwei2_611852_2037021279
+customProperties.ptime2=extshijian2_611852_1024768658
+customProperties.workAdd=extgongzuodidian_611852_395906990
+customProperties.frequency=extchuchapinlu_611852_522503076
+customProperties.jobRespon=extgongzuozhize_611852_1269250870
+customProperties.qualifications=extrenzhizige_611852_1076974893
+customProperties.reserved1=extyuliuziduan1_611852_474809659
+customProperties.reserved2=extyuliuziduan2_611852_1228338586
+customProperties.reserved3=extyuliuziduan3_611852_2110163217
+customProperties.reserved4=extyuliuziduan4_611852_909018623
+customProperties.reserved5=extyuliuziduan5_611852_908820417