diff --git a/src/main/kotlin/com/pomelotea/hoperun/sign/scheduler/AutoDakaScheduler.kt b/src/main/kotlin/com/pomelotea/hoperun/sign/scheduler/AutoDakaScheduler.kt index cd6c16a..aca48e4 100644 --- a/src/main/kotlin/com/pomelotea/hoperun/sign/scheduler/AutoDakaScheduler.kt +++ b/src/main/kotlin/com/pomelotea/hoperun/sign/scheduler/AutoDakaScheduler.kt @@ -58,7 +58,8 @@ class AutoDakaScheduler { } } - dakaQueue.forEach { + dakaQueue.filter { !it.added }.forEach { + it.added = true val beginDate = LocalDateTime.parse(it.dakaDate + "T" + it.beginTime + ":" + randowSecond(), DateTimeFormatter.ISO_LOCAL_DATE_TIME) val endDate = LocalDateTime.parse(it.dakaDate + "T" + it.endTime + ":" + randowSecond(), DateTimeFormatter.ISO_LOCAL_DATE_TIME) val beginSeconds = beginDate.toEpochSecond(DEFAULT_ZONE) - (System.currentTimeMillis() / 1000) @@ -129,9 +130,10 @@ data class Daka( val beginTime: String, val endTime: String, val employeeNo: String, - val dakaDate: String + val dakaDate: String, + var added: Boolean = false ) { fun toCsv(): String { - return "$employeeNo,$dakaDate,$beginTime,$endTime" + return "$employeeNo,$dakaDate,$beginTime,$endTime,$added" } } \ No newline at end of file