Commit a27a3d44 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents b7be3774 c01ca213
...@@ -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,11 +94,14 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -96,11 +94,14 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
userEntity.setUpdateTime(new Date()); userEntity.setUpdateTime(new Date());
userEntity.setUpdateUserId(1L); userEntity.setUpdateUserId(1L);
return userEntity; return userEntity;
}).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.update(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