v2.4.1
This commit is contained in:
1 parent
02fcf9ae8f
commit
e5afe60a11
8 files changed
+256
-65
No files matched your search
@@ -4,6 +4,7 @@ using Jiaowu.Api.Domain.Identity;
|
||||
using Jiaowu.Api.Infrastructure.Auth;
|
||||
using Jiaowu.Api.Infrastructure.Excel;
|
||||
using Jiaowu.Api.Infrastructure.Persistence;
|
||||
using Jiaowu.Api.Infrastructure.OfficialDocuments;
|
||||
using Jiaowu.Api.Infrastructure.Timetables;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -17,7 +18,8 @@ namespace Jiaowu.Api.Controllers;
|
||||
public sealed class TimetableManagementController(
|
||||
AppDbContext db,
|
||||
TimetableDataService timetableDataService,
|
||||
ICurrentUserDataScope currentUserDataScope) : ControllerBase
|
||||
ICurrentUserDataScope currentUserDataScope,
|
||||
OfficialDocumentOptions officialDocumentOptions) : ControllerBase
|
||||
{
|
||||
private const string ManagementRoles =
|
||||
SystemRoles.SuperAdmin + "," +
|
||||
@@ -239,7 +241,7 @@ public sealed class TimetableManagementController(
|
||||
}
|
||||
|
||||
var fileName = $"课表批量导出-{FileName(timetables[0].Term.Name)}.pdf";
|
||||
return File(TimetablePdfExporter.Create(timetables), "application/pdf", fileName);
|
||||
return File(TimetablePdfExporter.Create(timetables, officialDocumentOptions.FontPath), "application/pdf", fileName);
|
||||
}
|
||||
|
||||
[HttpPost("display-links/export.xlsx")]
|
||||
@@ -297,7 +299,7 @@ public sealed class TimetableManagementController(
|
||||
|
||||
private ActionResult PdfFile(TimetableData timetable) =>
|
||||
File(
|
||||
TimetablePdfExporter.Create(timetable),
|
||||
TimetablePdfExporter.Create(timetable, officialDocumentOptions.FontPath),
|
||||
"application/pdf",
|
||||
$"{FileName(timetable.Subject.Name)}-{FileName(timetable.Term.Name)}-课表.pdf");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user