| | |
| | | List<WxCpDepart> wxCpDepartList = wxCpDepartmentService.list(null); |
| | | if(wxCpDepartList!=null&&wxCpDepartList.size()>0){ |
| | | for(WxCpDepart wxCpDepart : wxCpDepartList){ |
| | | if(wxCpDepart.getParentId().compareTo(24L)<0){ |
| | | //获取系统内对应部门 |
| | | SysDept sysDept = sysDeptService.getByWxDeptId(wxCpDepart.getId()); |
| | | //判断是否有该部门,没有则新建 |
| | |
| | | sysDept.setOrderNum(wxCpDepart.getOrder().intValue()); |
| | | sysDept.setCreateBy("企业微信同步"); |
| | | sysDept.setDeptName(wxCpDepart.getName()); |
| | | sysDept.setWxDeptId(wxCpDepart.getId()); |
| | | sysDeptService.insertDept(sysDept); |
| | | log.info("企业微信同步新增部门:"+wxCpDepart.getName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (WxErrorException e) { |
| | | throw new RuntimeException(e); |
| | | } |