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 ad370a0..a631738 100644 --- a/src/main/kotlin/com/pomelotea/hoperun/sign/scheduler/AutoDakaScheduler.kt +++ b/src/main/kotlin/com/pomelotea/hoperun/sign/scheduler/AutoDakaScheduler.kt @@ -35,7 +35,7 @@ class AutoDakaScheduler { val logger: Logger = LoggerFactory.getLogger("DAKA-SHCEDULER") } - fun addAutoDakaScheduled(dakaDate: String = getNowDateyyyy_MM_dd()) { + private fun addAutoDakaScheduled(dakaDate: String = getNowDateyyyy_MM_dd()) { // 调休的工作日 if (isNeedDaka(dakaDate)) { HoperunUserConfig.userConfigMap.forEach { (_, v) -> @@ -45,8 +45,8 @@ class AutoDakaScheduler { if (daka == null) { daka = generateDakaInfo(v, dakaDate) dakaQueue.add(daka) + logger.info("添加打卡任务: ${v.username}, $daka") } - logger.info("${v.username},${daka.toCsv()}") } } } @@ -89,9 +89,9 @@ class AutoDakaScheduler { try { logger.info("[EXECUTE]BEGIN:${daka.employeeNo}:DATE:${daka.dakaDate}:TIME:${daka.beginTime}") // 模拟重新登录打卡 - logger.info("${daka.employeeNo}OLD-JSESSIONID: ${sessionMap[daka.employeeNo]}") + logger.info("${daka.employeeNo}-OLD-JSESSIONID: ${sessionMap[daka.employeeNo]}") resetJSessionId(employeeNo = daka.employeeNo) - logger.info("${daka.employeeNo}NEW-JSESSIONID: ${sessionMap[daka.employeeNo]}") + logger.info("${daka.employeeNo}-NEW-JSESSIONID: ${sessionMap[daka.employeeNo]}") val resp: DakaResponse = beginTime(employeeNo = daka.employeeNo, date = daka.dakaDate, time = daka.beginTime) if (resp.result != "success") { @@ -110,9 +110,9 @@ class AutoDakaScheduler { try { logger.info("[EXECUTE]END:${daka.employeeNo}:DATE:${daka.dakaDate}:TIME:${daka.endTime}") // 模拟重新登录打卡 - logger.info("${daka.employeeNo}OLD-JSESSIONID: ${sessionMap[daka.employeeNo]}") + logger.info("${daka.employeeNo}-OLD-JSESSIONID: ${sessionMap[daka.employeeNo]}") resetJSessionId(employeeNo = daka.employeeNo) - logger.info("${daka.employeeNo}NEW-JSESSIONID: ${sessionMap[daka.employeeNo]}") + logger.info("${daka.employeeNo}-NEW-JSESSIONID: ${sessionMap[daka.employeeNo]}") val resp: DakaResponse = endTime(employeeNo = daka.employeeNo, date = daka.dakaDate, time = daka.endTime) if (resp.result != "success") { logger.error("打下班卡失败") @@ -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/logback-spring.xml b/src/main/resources/logback-spring.xml index d46ac36..3e438ee 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -89,12 +89,14 @@ + + diff --git a/src/main/resources/static/index.0.html b/src/main/resources/static/index.0.html deleted file mode 100644 index 9372e45..0000000 --- a/src/main/resources/static/index.0.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - 打卡 - - - - -
-
- - -
- - -
-
-
-
-
打卡记录
-
-
-
-
-
- - - -
- - \ No newline at end of file diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 45e2aec..9ea9ef4 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -1 +1 @@ -打卡
打卡记录
\ No newline at end of file +打卡
打卡记录
diff --git a/src/main/resources/static/script.js b/src/main/resources/static/script.js index 695f366..4000dcd 100644 --- a/src/main/resources/static/script.js +++ b/src/main/resources/static/script.js @@ -105,7 +105,15 @@ function loadDakaList() { dateBeginTimeMap[signlog.yearmonth] = (signlog.begin_time == null ? "未打卡" : signlog.begin_time.substr(11, 5)); dateEndTimeMap[signlog.yearmonth] = (signlog.end_time == null ? "未打卡" : signlog.end_time.substr(11, 5)); index++; - $('.job-cards').append('
' + + let beginWarn = (signlog.begin_time != null && signlog.begin_time.substr(11, 5) > '09:30') + let endWarn = (signlog.end_time != null && signlog.end_time.substr(11, 5) < '18:30') + let buqianWarn = (signlog.actual_area_begin === '补签卡' || signlog.actual_area_end === '补签卡') + let weidakaWarn = (signlog.begin_time == null || signlog.end_time == null) + + $('.job-cards').append('
' + '
' + (nowDate === signlog.yearmonth ? "今天" : signlog.yearmonth) + '
' + '
' + signlog.area_id + @@ -113,15 +121,23 @@ function loadDakaList() { '
' + '' + '' + - (signlog.autoDakaBeginTime == null ? "" : '
') + - (signlog.autoDakaEndTime == null ? "" : '') + - (signlog.end_time != null && signlog.end_time.substr(11, 5) > "21:00" ? '' : '') + + (signlog.autoDakaBeginTime == null ? "" : '') + + (signlog.autoDakaEndTime == null ? "" : '') + + // (signlog.end_time != null && signlog.end_time.substr(11, 5) > "21:00" ? '' : '') + '
' + (index <= 3 ? '
' + '' + '' + '
' : '') + + (index > 3 ? + '
' + + signlog.actual_area_begin + + '
' + + (signlog.actual_area_begin !== signlog.actual_area_end ? '
' + + signlog.actual_area_end + + '
' : '') + : '') + '
' ); } diff --git a/src/main/resources/static/style.css b/src/main/resources/static/style.css index 18678a5..4a18752 100644 --- a/src/main/resources/static/style.css +++ b/src/main/resources/static/style.css @@ -11,6 +11,7 @@ --border-color: #d8d8d8; --alert-bg-color: #e8f2ff; --subtitle-color: #83838e; + --subtext-color: #d5d5d5; --inactive-color: #f0f0f0; --placeholder-color: #9b9ba5; --time-button: #fc5757; @@ -95,7 +96,7 @@ body { } .dark-mode .detail-button { background-color: var(--inactive-color); - color: var(--subtitle-color); + color: var(--subtext-color); } .job { @@ -188,6 +189,7 @@ body { } .user-profile { + display: none; width: 32px; height: 32px; border-radius: 50%; @@ -362,6 +364,10 @@ body { margin-left: -100px; margin-top: -100px; position: absolute; + box-shadow: 0px 2px 4px hsl(0 0% 0% / 25%); + animation: border-angle-rotate 2s infinite linear; + border: 0.5rem solid transparent; + border-radius: 16px; } .userinfo_dialog { @@ -374,6 +380,10 @@ body { position: absolute; margin: auto 0; transform: translate(-50%, -50%); + box-shadow: 0px 2px 4px hsl(0 0% 0% / 25%); + animation: border-angle-rotate 2s infinite linear; + border: 0.5rem solid transparent; + border-radius: 16px; } .userinfo_dialog > div > .alert-inline { @@ -389,12 +399,13 @@ body { } body > div > div.userinfo_dialog > div > div > div { - display: inline-flex; + display: inline-grid; + grid-template-columns: 20% 80%; width: 100%; } #username { - padding: 11px; + padding: 13px; } @@ -437,8 +448,12 @@ body > div > div.userinfo_dialog > div > div > div { color: var(--body-color) } +#username { + /*width: 64px;*/ +} + body > div > div.userinfo_dialog > div > div > div input { - width: 85%; + width: 100%; padding: 10px; display: block; border-radius: 8px 8px 8px 8px; @@ -468,7 +483,7 @@ body > div > div.userinfo_dialog > div > div > div input { border-radius: 6px; font-size: 13px; font-weight: 600; - margin-top: 14px; + margin-top: 6px; } .job-wrapper { @@ -598,7 +613,7 @@ body > div > div.userinfo_dialog > div > div > div input { padding-top: 20px; /*padding-right: 80px;*/ display: grid; - grid-template-columns: repeat(3, 1fr); + grid-template-columns: repeat(6, 1fr); grid-column-gap: 25px; grid-row-gap: 25px; -webkit-animation: slideY .6s both; @@ -637,18 +652,51 @@ body > div > div.userinfo_dialog > div > div > div input { } } +@property --border-angle { + syntax: ""; + initial-value: 0deg; + inherits: false; +} + + +@keyframes border-angle-rotate { + from { --border-angle: 0deg; } + to { --border-angle: 360deg; } +} + +.rainbow { + background: linear-gradient(var(--header-bg-color), var(--header-bg-color)) padding-box, + conic-gradient( + from var(--border-angle), + oklch(100% 100% 0deg), + oklch(100% 100% 45deg), + oklch(100% 100% 90deg), + oklch(100% 100% 135deg), + oklch(100% 100% 180deg), + oklch(100% 100% 225deg), + oklch(100% 100% 270deg), + oklch(100% 100% 315deg), + oklch(100% 100% 360deg) + ) + border-box; +} + .job-card { padding: 20px 16px; background-color: var(--header-bg-color); - border-radius: 8px; + border-radius: 16px; cursor: pointer; -webkit-transition: .2s; transition: .2s; + box-shadow: 0px 2px 4px hsl(0 0% 0% / 25%); + animation: border-angle-rotate 2s infinite linear; + border: 0.5rem solid transparent; } .job-card:hover { -webkit-transform: scale(1.02); transform: scale(1.02); } + .job-card svg { width: 46px; padding: 10px; @@ -713,13 +761,22 @@ body > div > div.userinfo_dialog > div > div > div input { padding: 6px 8px; border-radius: 4px; } -.detail-button + .detail-button { - margin-left: 4px; +/*.detail-button + .detail-button {*/ +/* margin-left: 4px;*/ +/*}*/ + +.job-detail-buttons { + display: grid; + grid-template-columns: repeat(2, 1fr); + grid-column-gap: 10px; + grid-row-gap: 4px; } .job-card-buttons { - display: -webkit-box; - display: flex; + display: grid; + grid-template-columns: repeat(2, 1fr); + grid-column-gap: 10px; + grid-row-gap: 25px; -webkit-box-align: center; align-items: center; -webkit-box-pack: justify; @@ -739,14 +796,15 @@ body > div > div.userinfo_dialog > div > div > div input { .card-buttons, .card-buttons-msg { padding: 10px; - width: 100%; + min-width: 46%; font-size: 12px; cursor: pointer; } -.card-buttons { - margin-right: 12px; -} +/*.card-buttons {*/ +/* margin-right: 4%;*/ +/* margin-left: 4%;*/ +/*}*/ .card-buttons-msg { background-color: var(--inactive-color); color: var(--subtitle-color);