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