diff --git a/src/main/kotlin/com/pomelotea/hoperun/sign/api/HoperunDakaController.kt b/src/main/kotlin/com/pomelotea/hoperun/sign/api/HoperunDakaController.kt index a20ce96..49a475f 100644 --- a/src/main/kotlin/com/pomelotea/hoperun/sign/api/HoperunDakaController.kt +++ b/src/main/kotlin/com/pomelotea/hoperun/sign/api/HoperunDakaController.kt @@ -163,6 +163,17 @@ class HoperunSignController { monthAttLog.autoDakaBeginTime = autoDaka.beginTime monthAttLog.autoDakaEndTime = autoDaka.endTime } + monthAttResult.forEach { + it.actual_area_begin = + if (!it.actual_area_begin.isNullOrBlank()) { + if (it.actual_area_begin == "buqianka") "补签卡" else + area_regex.find(it.actual_area_begin!!)?.groups?.get(0)?.value + } else null + it.actual_area_end = if (!it.actual_area_end.isNullOrBlank()) { + if (it.actual_area_end == "buqianka") "补签卡" else + area_regex.find(it.actual_area_end!!)?.groups?.get(0)?.value + } else null + } return monthAttResult } @@ -374,6 +385,8 @@ class WebResult protected constructor() : java.io.Serializable { } } +val area_regex = Regex(".*[\\u4e00-\\u9fa5]|[0-9][\\u4e00-\\u9fa5]") + data class MonthAttLog( var area_id: String? = null, var area_id_begin: String? = null, @@ -390,6 +403,8 @@ data class MonthAttLog( var yearmonth: String? = null, var autoDakaBeginTime: String? = null, var autoDakaEndTime: String? = null, + var actual_area_begin: String? = null, + var actual_area_end: String? = null ) data class HoperunDakaRequest( 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 632152e..a631738 100644 --- a/src/main/kotlin/com/pomelotea/hoperun/sign/scheduler/AutoDakaScheduler.kt +++ b/src/main/kotlin/com/pomelotea/hoperun/sign/scheduler/AutoDakaScheduler.kt @@ -45,7 +45,7 @@ class AutoDakaScheduler { if (daka == null) { daka = generateDakaInfo(v, dakaDate) dakaQueue.add(daka) - logger.info("${v.username},${daka.toCsv()}") + logger.info("添加打卡任务: ${v.username}, $daka") } } } @@ -137,6 +137,9 @@ class AutoDakaScheduler { schedulerThreadPool as ScheduledThreadPoolExecutor val queue = schedulerThreadPool.queue logger.info("任务队列数量: ${queue.size}") + dakaQueue.forEach { + logger.info(it.toString()) + } } private fun getRandomEndTime(): String { @@ -167,4 +170,8 @@ data class Daka( fun toCsv(): String { return "$employeeNo,$dakaDate,$beginTime,$endTime,$added" } + + override fun toString(): String { + return "工号: $employeeNo, 日期: $dakaDate, 上班卡: $beginTime, 下班卡: $endTime, 定时开关: $added" + } } \ No newline at end of file diff --git a/src/main/resources/static/script.js b/src/main/resources/static/script.js index 9e11f8f..3b26f79 100644 --- a/src/main/resources/static/script.js +++ b/src/main/resources/static/script.js @@ -122,6 +122,14 @@ function loadDakaList() { '">打卡' + '' + '' : '') + + (index > 3 ? + '
' + + signlog.actual_area_begin + + '
' + + (signlog.actual_area_begin !== signlog.actual_area_end ? '
' + + signlog.actual_area_end + + '
' : '') + : '') + '' ); }