ソースを参照

修改企业微信导出

yurk 2 年 前
コミット
ca5e4d0394

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

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

+ 14 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

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

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

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

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

@@ -653,8 +653,8 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.APPLICATION_JSON);
         JSONObject jsonObject=new JSONObject();
-        jsonObject.put("auth_corpid","wwf11426cf618e1703");
-        jsonObject.put("agentid","1000066");
+        jsonObject.put("auth_corpid",wxCorpInfo.getCorpid());
+        jsonObject.put("agentid",wxCorpInfo.getAgentid());
         JSONArray jsonArray=new JSONArray();
         for (String s : userNameList) {
             JSONObject item=new JSONObject();