diff --git a/apps/server/src/sync/sync.module.ts b/apps/server/src/sync/sync.module.ts index d7b8ff7..5cba3e8 100644 --- a/apps/server/src/sync/sync.module.ts +++ b/apps/server/src/sync/sync.module.ts @@ -14,7 +14,6 @@ import { Student, Role, Class, - ClassStudent, } from '../entities'; import { SyncService } from './sync.service'; import { SyncController } from './sync.controller'; @@ -34,7 +33,6 @@ import { ScheduleSyncService } from './schedule-sync.service'; Student, Role, Class, - ClassStudent, ]), IntegrationModule, AttendanceModule, diff --git a/apps/server/src/sync/sync.service.ts b/apps/server/src/sync/sync.service.ts index 8089dda..2a7469c 100644 --- a/apps/server/src/sync/sync.service.ts +++ b/apps/server/src/sync/sync.service.ts @@ -40,8 +40,6 @@ export class SyncService { private readonly roleRepo: Repository, @InjectRepository(ClassEntity) private readonly classRepo: Repository, - @InjectRepository(ClassStudent) - private readonly classStudentRepo: Repository, private readonly dingTalkService: DingTalkService, private readonly weComService: WeComService, private readonly attendanceImportService: AttendanceImportService, @@ -255,7 +253,7 @@ export class SyncService { const tc = await manager.count(ClassTeacher, { where: { classId } }); const sc = await manager.count(ClassStudent, { where: { classId } }); if (tc === 0 && sc === 0) { - const cls = await this.classRepo.findOne({ where: { id: classId } }); + const cls = await manager.findOne(ClassEntity, { where: { id: classId } }); warnings.push(`班级 "${cls?.name}" (deptId=${deptId}) 无任何师生`); } }