Bladeren bron

修改企业微信导出

yurk 2 jaren geleden
bovenliggende
commit
24e2bc8d27

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/WxCorpInfoService.java

@@ -56,5 +56,5 @@ public interface WxCorpInfoService extends IService<WxCorpInfo> {
 
     User generateUserInfo(Integer companyId, String corpwxOpenId);
 
-    HttpRespMsg getBatchSearchUserInfo(WxCorpInfo wxCorpInfo, List<String> userNameList) throws Exception;
+    HttpRespMsg getBatchSearchUserInfo(WxCorpInfo wxCorpInfo, List<String> userNameList,String cursor) throws Exception;
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -330,7 +330,7 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 System.out.println("参与搜素的人员列表"+userNameList);
                 HttpRespMsg respMsg=new HttpRespMsg();
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList);
+                    respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
                     if(respMsg.code.equals("0")){
                         msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
                         return msg;

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -3170,7 +3170,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 System.out.println("参与搜素的人员列表"+userNameList);
                 HttpRespMsg respMsg=new HttpRespMsg();
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList);
+                    respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
                     if(respMsg.code.equals("0")){
                         msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
                         return msg;
@@ -3566,13 +3566,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 System.out.println("参与搜素的人员列表"+userNameList);
                 HttpRespMsg respMsg=new HttpRespMsg();
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList);
+                    respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
                     if(respMsg.code.equals("0")){
                         msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
                         return msg;
                     }
                 }
                 List<User> targetUserList= (List<User>) respMsg.data;
+                System.out.println(targetUserList);
                 List<String> existCodeList = new ArrayList<>();
                 int importCount = 0;
                 for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -3534,7 +3534,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             System.out.println("参与搜素的人员列表"+userNameList);
             HttpRespMsg respMsg=new HttpRespMsg();
             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList);
+                respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
                 if(respMsg.code.equals("0")){
                     msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
                     return msg;

+ 19 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -646,7 +646,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         return result;
     }
     @Override
-    public HttpRespMsg getBatchSearchUserInfo(WxCorpInfo wxCorpInfo, List<String> userNameList)throws Exception{
+    public HttpRespMsg getBatchSearchUserInfo(WxCorpInfo wxCorpInfo, List<String> userNameList ,String cursor)throws Exception{
         HttpRespMsg msg=new HttpRespMsg();
         List<User> userList=new ArrayList<>();
         String url = GET_BATCH_SEARCH_USER_INFO.replace("ACCESS_TOKEN",getProviderAccessToken());
@@ -663,7 +663,9 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             item.put("query_range",1);
             item.put("limit",50);
             item.put("full_match_field",1);
-            item.put("cursor",CURSOR.get("cursor"));
+            if(cursor!=null){
+                item.put("cursor",cursor);
+            }
             jsonArray.add(item);
         }
         jsonObject.put("query_request_list",jsonArray);
@@ -677,6 +679,8 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                 throw new Exception(json.toJSONString());
             }
             JSONArray resultList = json.getJSONArray("query_result_list");
+            List<String> targetUserNameList=new ArrayList<>();
+            String nextCursor=null;
             for (int i = 0; i < resultList.size(); i++) {
                 User user=new User();
                 JSONObject item = resultList.getJSONObject(i);
@@ -696,7 +700,20 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                 }
                 user.setCorpwxUserid(openUseridList.get(0));
                 userList.add(user);
+                boolean isLast = item.getBoolean("is_last");
+                if(!isLast){
+                    nextCursor = item.getString("next_cursor");
+                    targetUserNameList.add(userName);
+                }
             }
+            if(targetUserNameList.size()>0){
+                HttpRespMsg respMsg = getBatchSearchUserInfo(wxCorpInfo, targetUserNameList,nextCursor);
+                if(!respMsg.code.equals("0")){
+                    List<User> targetUserList= (List<User>) respMsg.data;
+                    userList.addAll(targetUserList);
+                }
+            }
+
         }
         msg.data=userList;
         return msg;

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -279,9 +279,10 @@ public class TimingTask {
 
 
     //每天2:11 同步钉钉用户前2天到未来30天时间段的打卡,请假,出差数据
-    @Scheduled(cron = "0 11 2 ? * *")
+    @Scheduled(cron = "0 45 13 ? * *")
     private void synFanWeiWorkData() {
-        if (isDev) return;
+        /*if (isDev) return;
+        if(!isPrivateDeploy) return;*/
         List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("sync_fanwei", 1));
         List<Integer> compIds = timeTypeList.stream().map(TimeType::getCompanyId).collect(Collectors.toList());
         if(compIds.isEmpty()){

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/DockWithMLD.java

@@ -77,10 +77,10 @@ public class DockWithMLD {
         header.put("Md5",md5OfStr);
         paramDatajson.put("header",header);
         //分页参数 处理全部数据 不需要进行分页
-        /*JSONObject pageInfo = new JSONObject();
-        pageInfo.put("pageNo", -1);
-        pageInfo.put("pageSize", -1);
-        paramDatajson.put("pageInfo",pageInfo);*/
+        JSONObject pageInfo = new JSONObject();
+        pageInfo.put("pageNo", 1);
+        pageInfo.put("pageSize",20);
+        paramDatajson.put("pageInfo",pageInfo);
         //封装 mainTable 参数
         JSONObject mainTable  = JSON.parseObject(screenString);
         paramDatajson.put("mainTable",mainTable);