feat: 结算时同步钉钉已审批请假并标记为请假

This commit is contained in:
2026-08-05 18:43:02 +08:00
parent 32343b271b
commit c8316e9e8e
19 changed files with 746 additions and 58 deletions

View File

@@ -129,6 +129,18 @@ export class AttendanceSettlementService {
if (!imported.success || imported.errors.length > 0) {
throw new Error(imported.errors.join('; ') || '钉钉考勤拉取失败');
}
try {
await this.importService.syncLeaveStatusForLesson({
...importRange,
userIds,
autoMatch: true,
});
} catch (error: unknown) {
// 请假数据是补充信息,同步失败不应阻断结算;无请假的学生按缺勤处理。
this.logger.warn(
`课程${schedule.id} ${lessonDate}钉钉请假同步失败: ${error instanceof Error ? error.message : String(error)}`,
);
}
await this.attendanceService.createLessonAttendanceFromDingTalk(
schedule.id,
lessonDate,