--- title: PunchLog 补卡(补签)处理规则 type: decision permalink: main/projects/a84c6646-289e-46f8-b0f9-41317c651955/punch-log-补卡-补签-处理规则 stable_id: 427171e3-5a30-42a0-8a4c-d66403dd5640 scope: project memory_type: decision project_id: a84c6646-289e-46f8-b0f9-41317c651955 usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998 status: active revision: 1 request_id: punchlog-decision-supplement-20261106 created_at: '2026-11-06T10:00:49.650092+00:00' updated_at: '2026-11-06T10:00:49.650092+00:00' tags: - iepms - supplement - attendance - algorithm --- listMy 返回的补卡记录特征:signType=4 且 supplementType 非空。关键: - 补卡记录的 signDate 是【提交补卡的日期】,不是被补的那天;真正的打卡时刻在 supplementDate。 - 仅当 approveStatus==1(已审批通过,approveComment 如“同意”)才计入;未审批/被拒的补卡不计。 - 普通打卡 signType=5、supplementType=null、status=1;补卡 status=null。 算法(src/punchlog/analyze.py effective_punch):每条记录归到【有效日】——普通用 signDate,已审批补卡用 supplementDate,未审批补卡忽略。再按天取最早/最晚两次判定缺卡。 重要:补卡只能在被补当天后 5 天内提交(超过则补不了)。所以分析区间 [start,end] 时,抓取窗口要放宽到 end+5 天(listMy 按 signDate 过滤,补卡 signDate 可能晚于被补日最多 5 天),再按有效日过滤回 [start,end]。cli.py 常量 SUPPLEMENT_WINDOW_DAYS=5。 实例验证:10-16 正常只打 09:29,补卡 supplementDate=10-16 21:00(10-19提交已批)→归为 2 次 11.5h 正常;11-02 正常 09:52 + 补卡 20:30(11-03提交已批)→ 10.6h 正常。 待办:请假(vacate)字段 vacateBeginDate/vacateEndDate 尚无样本,暂未处理;将来若有请假应不计缺卡。