人员随机顺序打卡
This commit is contained in:
parent
b29a6cb646
commit
ed8bacdfb7
@ -22,6 +22,7 @@ import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@ -63,7 +64,8 @@ public class CheckLogin {
|
||||
ResourceUtil.getUtf8Reader(filePath), User.class);
|
||||
int size = userList.size();
|
||||
log.info("共有 {} 个需打卡账号", size);
|
||||
userList.forEach(forEachWithIndex((user, index) -> {
|
||||
Set<User> userSet = RandomUtil.randomEleSet(userList, size);
|
||||
userSet.forEach(forEachWithIndex((user, index) -> {
|
||||
boolean todaySign = user.isTodaySign(singMark);
|
||||
if (todaySign) {
|
||||
log.info("{} 账号已完成打卡", user.getUsername());
|
||||
|
@ -6,6 +6,8 @@ import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class User {
|
||||
@Alias("用户名")
|
||||
private String username;
|
||||
@ -66,6 +68,23 @@ public class User {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
User user = (User) o;
|
||||
return Objects.equals(username, user.username) && Objects.equals(password, user.password) ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(username, password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User{" +
|
||||
|
Loading…
Reference in New Issue
Block a user