feat: refine deposit room type workflows

This commit is contained in:
2026-07-17 17:36:04 +08:00
parent a5bda6f093
commit b3d0bafc22
11 changed files with 724 additions and 140 deletions

View File

@@ -88,7 +88,7 @@ export class AttendanceService {
const devicesBySn = new Map<string, AttendanceDevice>();
if (sns.length > 0) {
const devices = await this.attendanceDeviceRepo.find({
where: { deviceSn: In(sns), status: 'active' },
where: { deviceSn: In(sns) },
relations: ['classroom'],
});
for (const device of devices) devicesBySn.set(device.deviceSn, device);
@@ -907,7 +907,7 @@ export class AttendanceService {
qb.skip((page - 1) * pageSize).take(pageSize);
const [list, total] = await qb.getManyAndCount();
return { list, total, page, pageSize };
return { list: await this.attachAttendanceDeviceMappings(list), total, page, pageSize };
}
// ── Get distinct classes with attendance records ──
@@ -1053,7 +1053,8 @@ export class AttendanceService {
qb.orderBy('ar.attendanceDate', 'DESC').addOrderBy('ar.createdAt', 'DESC');
return qb.getMany();
const records = await qb.getMany();
return this.attachAttendanceDeviceMappings(records);
}
async findAttendanceRecord(id: number) {