消息 成员同步

This commit is contained in:
小久哥
2022-06-24 11:36:33 +08:00
parent 6063523f30
commit 8d89747fe4
3 changed files with 13 additions and 42 deletions
@@ -110,7 +110,13 @@ public class CpUserServiceImpl extends ServiceImpl<CpUserMapper,CpUserDO> implem
public void cpUserSync() throws WxErrorException {
WxCpConfigStorage config = wxCpService.getWxCpConfigStorage();
List<WxCpDepart> departList = wxCpService.getDepartmentService().list(null);
List<WxCpUser> userList = wxCpService.getUserService().listByDepartment(1L, true, 0);
//根据部门id获取部门成员信息
//6 旭清回鄉生態農業發展公司
//35 回鄉信息技术公司
List<WxCpUser> userList = wxCpService.getUserService().listByDepartment(6L, true, 0);
userList.addAll(wxCpService.getUserService().listByDepartment(35L, true, 0));
List<CpUserDO> rs = CpUserConvert.INSTANCE.convertListFromWxApi(userList);
@@ -120,7 +126,6 @@ public class CpUserServiceImpl extends ServiceImpl<CpUserMapper,CpUserDO> implem
List<String> nowUsersIds = nowUsers.stream().map(CpUserDO::getUserId).collect(Collectors.toList());
rs.removeIf(cpUserDO -> nowUsersIds.contains(cpUserDO.getUserId()));
this.saveBatch(rs);
// 已经离职的员工 设置删除