forked from wangziqi/gongxue-base
fix: release beds/lockers in batchCheckOut
The batchCheckOut method was not releasing assigned beds and lockers after checkout, leaving them orphaned as 'occupied'. Added the same release pattern used in checkOut() — using runner.manager.update() since batchCheckOut operates inside a QueryRunner transaction.
This commit is contained in:
@@ -343,6 +343,9 @@ export class OccupanciesService {
|
||||
if (remaining === 0) {
|
||||
await runner.manager.update(Room, occ.roomId, { gender: null as any });
|
||||
}
|
||||
// 释放床位/柜子
|
||||
if (occ.bedId) await runner.manager.update(Bed, occ.bedId, { status: 'available' });
|
||||
if (occ.lockerId) await runner.manager.update(Locker, occ.lockerId, { status: 'available' });
|
||||
success++;
|
||||
}
|
||||
await runner.commitTransaction();
|
||||
|
||||
Reference in New Issue
Block a user