Prechádzať zdrojové kódy

修复已填工时情况表 的500错误

seyason 2 rokov pred
rodič
commit
5b77bd44af

+ 4 - 40
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -1770,10 +1770,10 @@ public class WeiXinCorpController {
 
         int companyRootDeptId = 1;
         if (syncMembs == 1) {
-            JSONArray allCorpWxUserJsonArray = getDeptUserInfo(curCorpAccessToken, companyRootDeptId);
+            JSONArray rootCorpUserJsonArray = getDeptUserInfo(curCorpAccessToken, companyRootDeptId);
             //获取远程的带姓名的详情,通过企业通讯录的token获取
             JSONArray remoteUnAUserList = null;
-            if (allCorpWxUserJsonArray.size() > 0) {
+            if (rootCorpUserJsonArray.size() > 0) {
                 remoteUnAUserList = remoteGetDeptUserDetail(wxCorpInfo, corpContactAccessToken, companyRootDeptId);
                 //做id转化
                 List<String> corpUserIds = new ArrayList<>();
@@ -1805,15 +1805,12 @@ public class WeiXinCorpController {
 
             List<User> updateUserList = new ArrayList<>();
 
-            for (int m=0;m<allCorpWxUserJsonArray.size(); m++) {
-                JSONObject userJson = allCorpWxUserJsonArray.getJSONObject(m);
+            for (int m=0;m<rootCorpUserJsonArray.size(); m++) {
+                JSONObject userJson = rootCorpUserJsonArray.getJSONObject(m);
                 String curUserid = userJson.getString("userid");
                 //跳过非激活状态的员工
                 if (userJson.getInteger("status") != 1) continue;
                 System.out.println("userid="+curUserid+", name=" + userJson.getString("name")+", department="+userJson.getJSONArray("department"));
-//                if (userJson.getJSONArray("direct_leader").size() > 0) {
-//                    hasDirectLdMembs.add(userJson);
-//                }
                 //不存在的人员, 进行插入
                 User user = new User();
 
@@ -2053,39 +2050,6 @@ public class WeiXinCorpController {
         if (needUpdateDepts.size() > 0) {
             departmentService.updateBatchById(needUpdateDepts);
         }
-        //更新人员的直属上级
-//        if (hasDirectLdMembs.size() > 0) {
-//            List<String> corpwxUids = new ArrayList<>();
-//            for (JSONObject userJson : hasDirectLdMembs) {
-//                String curUserid = userJson.getString("userid");
-//                //取第一个leaderId
-//                JSONArray directLeader = userJson.getJSONArray("direct_leader");
-//                String string = directLeader.getString(0);
-//                corpwxUids.add(curUserid);
-//                if (!corpwxUids.contains(string)) {
-//                    corpwxUids.add(string);
-//                }
-//            }
-//            List<User> userList = userMapper.selectList(new QueryWrapper<User>().select("id, corpwx_userid, superior_id").in("corpwx_userid", corpwxUids));
-//            List<User> updateUserList = new ArrayList<>();
-//            for (JSONObject userJson : hasDirectLdMembs) {
-//                String curUserid = userJson.getString("userid");
-//                User user = userList.stream().filter(u -> u.getCorpwxUserid().equals(curUserid)).findFirst().get();
-//                JSONArray directLeader = userJson.getJSONArray("direct_leader");
-//                String leaderCorpWxuid = directLeader.getString(0);
-//                //查找leader
-//                User leader = userList.stream().filter(u -> u.getCorpwxUserid().equals(leaderCorpWxuid)).findFirst().get();
-//                if (!leader.getId().equals(user.getSuperiorId())) {
-//                    user.setSuperiorId(leader.getId());
-//                    updateUserList.add(user);
-//                }
-//            }
-//            if (updateUserList.size() > 0) {
-//                //批量更新上级领导
-//                userService.updateBatchById(updateUserList);
-//            }
-//        }
-
         //更新人员的deptcascade
         updateUserDeptCascade(companyId);
 

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

@@ -2987,7 +2987,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             String name = (String)data.get("name");
             String departmentName = (String) data.get("departmentName");
             String corpwxUserId = (String) data.get("corpwxUserId");
-            String corpwxDeptId = (String) data.get("corpwxDeptId");
+            Integer corpwxDeptId = (Integer) data.get("corpwxDeptId");
             Map<String, Object> map = new HashMap<>();
             String date = new SimpleDateFormat("yyyy-MM-dd").format((Date)data.get("createDate"));
             String corpwxUserid = (String) data.get("corpwxUserId");