feat: 考勤功能补全

1. 首页加载时检查工作状态(fetchWorkState)
2. MQTT type=4 工作状态推送处理(上班→亮屏,下班→关NFC+熄屏)
3. PunchStatus 增加打卡时间字段(onPunchTime/offPunchTime)
4. 考勤页显示打卡时间("已上班 07:02"/"已下班 17:05")
5. 首页注入 PunchApi/ScreenController/NfcController

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-28 19:30:29 +09:30
parent 967b001d46
commit b59fee4bb7
3 changed files with 72 additions and 5 deletions

View File

@@ -11,7 +11,11 @@ data class PunchStatus(
/** 上班打卡状态0=未上班, 1=已上班 */
@SerializedName("onPunchState") val onPunchState: Int = 0,
/** 下班打卡状态1=已下班, 其他=未下班 */
@SerializedName("offPunchState") val offPunchState: Int = 0
@SerializedName("offPunchState") val offPunchState: Int = 0,
/** 上班打卡时间API 可能返回,待验证字段名) */
@SerializedName("onPunchTime") val onPunchTime: String? = null,
/** 下班打卡时间 */
@SerializedName("offPunchTime") val offPunchTime: String? = null
) {
/** 是否已上班 */
val isOnDuty: Boolean get() = onPunchState == 1