Commit 6a216e2f authored by 钱坤's avatar 钱坤

企微user信息的IsLeader空指针问题

parent c3c978ee
......@@ -181,7 +181,7 @@ public class OrgSyncByWxcpJob {
List<WxCpUser> wxCpUserList = wxCpDepartDto.getWxCpUserList();
for (WxCpUser wxCpUser : wxCpUserList) {
// key employee_id + '&' + role_id
String type = wxCpUser.getIsLeader() == 1 ? RoleTypeEnum.TEAM.code : RoleTypeEnum.IFA.code;
String type = wxCpUser.getIsLeader() != null && wxCpUser.getIsLeader() == 1 ? RoleTypeEnum.TEAM.code : RoleTypeEnum.IFA.code;
hashMap.put(corpId + "_" + wxCpUser.getUserId() + "&" + roleMap.get(type), wxCpUser);
}
}
......@@ -257,7 +257,7 @@ public class OrgSyncByWxcpJob {
continue;
}
//更新
String type = wxCpUser.getIsLeader() == 1 ? EmployeeDutyEnum.DIRECTOR.code : EmployeeDutyEnum.STAFF.code;
String type = wxCpUser.getIsLeader() != null && wxCpUser.getIsLeader() == 1 ? EmployeeDutyEnum.DIRECTOR.code : EmployeeDutyEnum.STAFF.code;
if (!departmentEmployee.getType().equals(type)) {
departmentEmployee.setType(type);
updateList.add(departmentEmployee);
......@@ -266,7 +266,7 @@ public class OrgSyncByWxcpJob {
}
for (String s : hashMap.keySet()) {
WxCpUser wxCpUser = hashMap.get(s);
String type = wxCpUser.getIsLeader() == 1 ? EmployeeDutyEnum.DIRECTOR.code : EmployeeDutyEnum.STAFF.code;
String type = wxCpUser.getIsLeader() != null && wxCpUser.getIsLeader() == 1 ? EmployeeDutyEnum.DIRECTOR.code : EmployeeDutyEnum.STAFF.code;
String[] split = s.split("&");
String departmentId = split[0];
String employeeId = split[1];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment