| | |
| | | } |
| | | } |
| | | |
| | | public int syncUsersToQwStaff() throws IOException { |
| | | List<WorkWXUser> userList = getUserList(); |
| | | |
| | | if (userList == null || userList.isEmpty()) { |
| | | log.warn("获取到的用户列表为空"); |
| | | return 0; |
| | | } |
| | | |
| | | int insertCount = 0; |
| | | for (WorkWXUser user : userList) { |
| | | if (user.getUserid() == null || user.getUserid().isEmpty()) { |
| | | continue; |
| | | } |
| | | |
| | | QwStaff existingStaff = qwStaffMapper.selectOne( |
| | | new LambdaQueryWrapper<QwStaff>().eq(QwStaff::getAccount, user.getUserid()) |
| | | ); |
| | | |
| | | if (existingStaff == null) { |
| | | QwStaff qwStaff = new QwStaff(); |
| | | qwStaff.setName(user.getName()); |
| | | qwStaff.setAccount(user.getUserid()); |
| | | qwStaff.setDept(user.getDepartment() != null ? user.getDepartment().toString() : null); |
| | | |
| | | qwStaffMapper.insert(qwStaff); |
| | | insertCount++; |
| | | } |
| | | } |
| | | |
| | | log.info("同步用户到QW_STAFF表完成,新增用户数: {}", insertCount); |
| | | return insertCount; |
| | | } |
| | | |
| | | public List<CheckinData> getCheckinData(long startTime, long endTime, List<String> useridList) throws IOException { |
| | | String accessToken = getAccessToken(); |
| | | String url = String.format("https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckindata?access_token=%s", accessToken); |
| | |
| | | private String wifiname; |
| | | private String notes; |
| | | private String wifimac; |
| | | private String mediaids; |
| | | private List<String> mediaids; |
| | | private Double lat; |
| | | private Double lng; |
| | | @JsonProperty("sch_checkin_time") |