feat: 结算时同步钉钉已审批请假并标记为请假
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user