fix: repair 5 sites where StudentDingMapping.studentId was misused as User FK
- dingtalk.service.ts syncOneUser: query studentRepo (not userRepo) by mapping.studentId - sync.service.ts importDingTalkUsers: skip User role lookup for existing mappings - attendance.service.ts autoMatchDingRecords: use studentId directly, remove second-hop query - schedule-sync.service.ts syncAll: skip teacher mapping block (deprecated) - rbac.service.ts getUnboundUsers: return [] (method deleted in Task 4)
This commit is contained in:
@@ -87,11 +87,8 @@ export class ScheduleSyncService {
|
||||
}
|
||||
|
||||
// ── Step 2: 获取教师→钉钉用户ID映射 ──
|
||||
const teacherIds = [...new Set(schedules.map((s) => s.teacherId!).filter(Boolean))];
|
||||
const mappings = await this.studentDingMappingRepo.find({
|
||||
where: { studentId: In(teacherIds) },
|
||||
});
|
||||
const userIdToDingId = new Map(mappings.map((m) => [m.studentId, m.dingUserId]));
|
||||
// ponytail: teacher scheduling deprecated; StudentDingMapping.studentId is Student FK, not User
|
||||
const userIdToDingId = new Map<number, string>();
|
||||
|
||||
// ── Step 3: 按 (startTime, endTime) 创建/匹配班次 ──
|
||||
const shiftKey = (start: string, end: string) => `${start}-${end}`;
|
||||
|
||||
Reference in New Issue
Block a user