From 1a06ab6807f6c5e1c70f4cdbd4272565fb19782c Mon Sep 17 00:00:00 2001 From: Jimgo Date: Mon, 31 Mar 2025 10:56:18 +0800 Subject: [PATCH] =?UTF-8?q?:ok:=20=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=89=93=E5=8D=B0,=20=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=89=93=E5=8D=A1=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hoperun/sign/api/HoperunDakaController.kt | 15 +++++++++++++++ .../hoperun/sign/scheduler/AutoDakaScheduler.kt | 9 ++++++++- src/main/resources/static/script.js | 8 ++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) 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 + + '
' : '') + : '') + '' ); }