|
|
@@ -79,27 +79,7 @@ public class WeComUserDetailJob {
|
|
|
for (ThirdPartWeComStaff staff : activeStaffList) {
|
|
|
pool.execute(() -> {
|
|
|
try {
|
|
|
- String uuid = staff.getThirdUuid();
|
|
|
- String offLineKey = "wecom:thirdpart:offline:" + uuid;
|
|
|
- if (redisUtils.containsKey(offLineKey)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- String response = apiClient.getRunClientByUuid(new UuidRequest(uuid));
|
|
|
- CommonResponse<LoginInfo> commonResponse =
|
|
|
- JSONObject.parseObject(response, new TypeReference<CommonResponse<LoginInfo>>() {
|
|
|
- });
|
|
|
- if (commonResponse.getErrcode() == 0) {
|
|
|
- LoginInfo loginInfo = commonResponse.getData();
|
|
|
- staff.setName(loginInfo.getUser_info().getObject().getNickname());
|
|
|
- staff.setRealName(loginInfo.getUser_info().getObject().getRealname());
|
|
|
- staff.setMobile(loginInfo.getUser_info().getObject().getMobile());
|
|
|
- staff.setAvatar(loginInfo.getUser_info().getObject().getAvatar());
|
|
|
- staff.setName(loginInfo.getUser_info().getObject().getNickname());
|
|
|
- staff.setUpdateTime(new Date());
|
|
|
- staffMapper.updateByPrimaryKeySelective(staff);
|
|
|
- }
|
|
|
- syncRoomList(staff);
|
|
|
- syncStaffUserList(staff);
|
|
|
+ syncStaffUserDetail(staff);
|
|
|
} catch (Exception e) {
|
|
|
log.error("syncUserDetail error", e);
|
|
|
} finally {
|
|
|
@@ -115,6 +95,30 @@ public class WeComUserDetailJob {
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
+ public void syncStaffUserDetail(ThirdPartWeComStaff staff) {
|
|
|
+ String uuid = staff.getThirdUuid();
|
|
|
+ String offLineKey = "wecom:thirdpart:offline:" + uuid;
|
|
|
+ if (redisUtils.containsKey(offLineKey)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String response = apiClient.getRunClientByUuid(new UuidRequest(uuid));
|
|
|
+ CommonResponse<LoginInfo> commonResponse =
|
|
|
+ JSONObject.parseObject(response, new TypeReference<CommonResponse<LoginInfo>>() {
|
|
|
+ });
|
|
|
+ if (commonResponse.getErrcode() == 0) {
|
|
|
+ LoginInfo loginInfo = commonResponse.getData();
|
|
|
+ staff.setName(loginInfo.getUser_info().getObject().getNickname());
|
|
|
+ staff.setRealName(loginInfo.getUser_info().getObject().getRealname());
|
|
|
+ staff.setMobile(loginInfo.getUser_info().getObject().getMobile());
|
|
|
+ staff.setAvatar(loginInfo.getUser_info().getObject().getAvatar());
|
|
|
+ staff.setName(loginInfo.getUser_info().getObject().getNickname());
|
|
|
+ staff.setUpdateTime(new Date());
|
|
|
+ staffMapper.updateByPrimaryKeySelective(staff);
|
|
|
+ }
|
|
|
+ syncRoomList(staff);
|
|
|
+ syncStaffUserList(staff);
|
|
|
+ }
|
|
|
+
|
|
|
private void syncStaffUserList(ThirdPartWeComStaff staff) {
|
|
|
List<ExternalContactsResponse.ContactItem> contactItemList = thirdPartyService.getExternalContacts(
|
|
|
new GetExternalContactsRequest(staff.getThirdUuid(), 100, 0));
|