🆗 修复生成定时打卡任务时,没有根据状态判断重复生成
This commit is contained in:
@@ -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 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 endDate = LocalDateTime.parse(it.dakaDate + "T" + it.endTime + ":" + randowSecond(), DateTimeFormatter.ISO_LOCAL_DATE_TIME)
|
||||||
val beginSeconds = beginDate.toEpochSecond(DEFAULT_ZONE) - (System.currentTimeMillis() / 1000)
|
val beginSeconds = beginDate.toEpochSecond(DEFAULT_ZONE) - (System.currentTimeMillis() / 1000)
|
||||||
@@ -129,9 +130,10 @@ data class Daka(
|
|||||||
val beginTime: String,
|
val beginTime: String,
|
||||||
val endTime: String,
|
val endTime: String,
|
||||||
val employeeNo: String,
|
val employeeNo: String,
|
||||||
val dakaDate: String
|
val dakaDate: String,
|
||||||
|
var added: Boolean = false
|
||||||
) {
|
) {
|
||||||
fun toCsv(): String {
|
fun toCsv(): String {
|
||||||
return "$employeeNo,$dakaDate,$beginTime,$endTime"
|
return "$employeeNo,$dakaDate,$beginTime,$endTime,$added"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user