Commit c01ca213 authored by 赵啸非's avatar 赵啸非

添加更新用户钉钉id任务

parent 45f94f6a
...@@ -65,12 +65,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -65,12 +65,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
log.info("同步用户"); log.info("同步用户");
staffService.syncPersons(null); staffService.syncPersons(null);
log.info("同步钉钉usreId"); log.info("同步钉钉usreId");
try {
List<UserEntity> userList = userService.getCacheList().stream() List<UserEntity> userList = userService.getCacheList().stream()
.filter(f -> !ObjectUtils.isEmpty(f.getCustomerId())) .filter(f -> !ObjectUtils.isEmpty(f.getCustomerId()))
.filter(f -> ObjectUtils.isEmpty(f.getDingUserId())).collect(Collectors.toList()); .filter(f -> ObjectUtils.isEmpty(f.getDingUserId())).collect(Collectors.toList());
List<UserEntity> updateUserList = userList.stream().map(item -> { List<UserEntity> updateUserList = userList.stream().map(item -> {
UserEntity userEntity = new UserEntity(); UserEntity userEntity = new UserEntity();
userEntity.setId(item.getId()); userEntity.setId(item.getId());
...@@ -96,12 +94,15 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -96,12 +94,15 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
userEntity.setUpdateTime(new Date()); userEntity.setUpdateTime(new Date());
userEntity.setUpdateUserId(1L); userEntity.setUpdateUserId(1L);
return userEntity; return userEntity;
}).filter(f->!ObjectUtils.isEmpty(f.getDingUserId())).collect(Collectors.toList()); }).filter(f -> !ObjectUtils.isEmpty(f.getDingUserId())).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateUserList)){ if (!ObjectUtils.isEmpty(updateUserList)) {
log.info("更新用户钉钉id信息数量:{}",updateUserList.size()); log.info("更新用户钉钉id信息数量:{}", updateUserList.size());
userService.getUserDao().updateBatch(updateUserList); userService.getUserDao().updateBatch(updateUserList);
} }
} catch (Exception e) {
log.error("同步钉钉usreId失败");
}
} catch (Exception e) { } catch (Exception e) {
log.error("同步人事异常", e); log.error("同步人事异常", e);
} }
......
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