From c60c1a5961ca44cfa45c992b92c576815662d4dd Mon Sep 17 00:00:00 2001 From: MemRelay Date: Fri, 6 Nov 2026 18:00:53 +0800 Subject: [PATCH] =?UTF-8?q?create:=20PunchLog=20=E8=A1=A5=E5=8D=A1(?= =?UTF-8?q?=E8=A1=A5=E7=AD=BE)=E5=A4=84=E7=90=86=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MemRelay-Operation: memory-save:punchlog-decision-supplement-20261106 MemRelay-Resource: 427171e3-5a30-42a0-8a4c-d66403dd5640 --- .../PunchLog 补卡(补签)处理规则.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 projects/a84c6646-289e-46f8-b0f9-41317c651955/PunchLog 补卡(补签)处理规则.md diff --git a/projects/a84c6646-289e-46f8-b0f9-41317c651955/PunchLog 补卡(补签)处理规则.md b/projects/a84c6646-289e-46f8-b0f9-41317c651955/PunchLog 补卡(补签)处理规则.md new file mode 100644 index 0000000..980f2e3 --- /dev/null +++ b/projects/a84c6646-289e-46f8-b0f9-41317c651955/PunchLog 补卡(补签)处理规则.md @@ -0,0 +1,33 @@ +--- +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 尚无样本,暂未处理;将来若有请假应不计缺卡。 \ No newline at end of file