ATTV1 实现考勤统一入口与企微同步

这个提交包含在:
2026-05-17 16:56:24 +08:00
父节点 d50b7db143
当前提交 916cc3b7f7
共修改 51 个文件,包含 3323 行新增和 1762 行删除
@@ -37,6 +37,10 @@ function buildReference(normalizedEntityType, entityRecord, entityId) {
return formatDateRange(entityRecord?.start_date, entityRecord?.end_date) ?? entityId;
}
if (normalizedEntityType === "attendance_correction") {
return entityRecord?.work_date ? formatDateOnly(entityRecord.work_date) : entityId;
}
if (normalizedEntityType === "purchase_request") {
return entityRecord?.request_no ?? entityId;
}
@@ -81,6 +85,29 @@ function buildWorkflowEntityMeta(entityType, entityRecord, entityId) {
};
}
if (normalizedEntityType === "attendance_correction") {
const kindLabel =
entityRecord?.kind === "missed_punch"
? "补卡"
: entityRecord?.kind === "out"
? "外出"
: entityRecord?.kind === "overtime"
? "加班"
: "考勤修正";
return {
entityType: normalizedEntityType,
label: "考勤修正",
reference: buildReference(normalizedEntityType, entityRecord, entityId),
targetType: "attendance_correction",
detailPath: "/attendance",
summary: {
applicantName: entityRecord?.owner?.name ?? null,
kindLabel,
reason: entityRecord?.reason ?? null,
},
};
}
if (normalizedEntityType === "purchase_request") {
return {
entityType: normalizedEntityType,
@@ -137,6 +164,14 @@ function buildSummaryLines(entityMeta) {
];
}
if (entityMeta.entityType === "attendance_correction") {
return [
`申请人:${entityMeta.summary.applicantName ?? "未知申请人"}`,
`类型:${entityMeta.summary.kindLabel ?? "考勤修正"}`,
`日期:${entityMeta.reference}`,
];
}
if (entityMeta.entityType === "purchase_request") {
return [
`申请人:${entityMeta.summary.applicantName ?? "未知申请人"}`,