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:
@@ -85,6 +85,42 @@ export class ClassesController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 从钉钉同步部门创建班级 */
|
||||
@Post('from-department')
|
||||
@RequirePermission('class:create')
|
||||
async createFromDepartment(
|
||||
@Body() dto: { departmentId: number; name?: string; classType?: string },
|
||||
@Request() req: any,
|
||||
) {
|
||||
const result = await this.service.createFromDepartment(dto);
|
||||
await this.logService.log({
|
||||
userId: req.user?.id,
|
||||
username: req.user?.username,
|
||||
module: '班级管理',
|
||||
action: '从部门创建班级',
|
||||
targetId: result.id,
|
||||
targetType: 'class',
|
||||
detail: `班级${result.code} ${result.name}`,
|
||||
ipAddress: extractRequestInfo(req).ipAddress,
|
||||
userAgent: extractRequestInfo(req).userAgent,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/** 归档班级 */
|
||||
@Put(':id/archive')
|
||||
@RequirePermission('class:edit')
|
||||
async archive(@Param('id') id: string) {
|
||||
return this.service.archive(+id);
|
||||
}
|
||||
|
||||
/** 取消归档 */
|
||||
@Put(':id/restore')
|
||||
@RequirePermission('class:edit')
|
||||
async restore(@Param('id') id: string) {
|
||||
return this.service.restore(+id);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
@RequirePermission('class:edit')
|
||||
async update(
|
||||
|
||||
Reference in New Issue
Block a user