Browse Source

add: 同步用户信息;

master1
龚宝雄 6 months ago
parent
commit
9688bdf8e8
  1. 5
      nlsso-server/src/main/java/org/nl/system/service/user/dto/OnlineUserDto.java
  2. 6
      nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java

5
nlsso-server/src/main/java/org/nl/system/service/user/dto/OnlineUserDto.java

@ -41,11 +41,6 @@ public class OnlineUserDto {
*/ */
private String nickName; private String nickName;
/**
* 用户姓名
*/
private String person_name;
/** /**
* 岗位 * 岗位
*/ */

6
nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java

@ -84,12 +84,12 @@ public class EasBillSchedule {
//@Scheduled(cron = "0/120 * * * * *") //@Scheduled(cron = "0/120 * * * * *")
public void insertUsers(List<SysUser> existingUsers, List<SysUser> newUsers) { public void insertUsers(List<SysUser> existingUsers, List<SysUser> newUsers) {
Set<String> ids = existingUsers.stream().map(SysUser::getUsername).collect(Collectors.toSet()); Set<String> ids = existingUsers.stream().map(SysUser::getUsername).collect(Collectors.toSet());
// 过滤出需要插入的新用户,并设置默认属性
List<SysUser> insertUsers = newUsers.stream() List<SysUser> insertUsers = newUsers.stream()
.filter(user -> !ids.contains(user.getUsername())) .filter(user -> !ids.contains(user.getUsername()))
.peek(user -> { .peek(user -> {
user.setIs_used(true); // 设置默认启用 //默认启用
user.setCreate_time(new Date()); // 设置创建时间 user.setIs_used(true);
user.setCreate_time(new Date());
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());

Loading…
Cancel
Save