diff --git a/Tiobon.Core.Api/Controllers/FileController.cs b/Tiobon.Core.Api/Controllers/FileController.cs index a492f523..09982839 100644 --- a/Tiobon.Core.Api/Controllers/FileController.cs +++ b/Tiobon.Core.Api/Controllers/FileController.cs @@ -92,8 +92,9 @@ public class FileController : BaseApiController { string filePath = null; using var _context = ContextFactory.CreateContext(); + FileHelper.CreateDirectory($"/files/upload/{upload.masterId}"); - filePath = !string.IsNullOrEmpty(filePath) ? filePath : "upload"; + filePath = !string.IsNullOrEmpty(filePath) ? filePath : $"upload/{upload.masterId}"; var ext = string.Empty; if (string.IsNullOrEmpty(upload.file.FileName) == false) { @@ -162,7 +163,9 @@ public class FileController : BaseApiController [HttpPost, Route("CheckExists")] public ServiceResult CheckExistsAsync([FromBody] FileUpload upload) { - var filePath = $"/files/upload/{upload.fileName}"; + + FileHelper.CreateDirectory($"/files/upload/{upload.masterId}"); + var filePath = $"/files/upload/{upload.masterId}/{upload.fileName}"; #region 判断文件是否重复,重复即删除 var webRootPath = _hostingEnvironment.WebRootPath; if (System.IO.File.Exists(webRootPath + filePath)) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs index 53011e54..609e65b3 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs @@ -291,4 +291,15 @@ public class Ghre_ExamRecordController : BaseController + /// IssueCertificate + /// + /// + [HttpPost("IssueCertificate")] + public async Task IssueCertificate() + { + return await _service.IssueCertificate(); + } } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 21c91235..2ad69ed3 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1145,6 +1145,12 @@ + + + IssueCertificate + + + Ghre_ExamRecordDetail(Controller) diff --git a/Tiobon.Core.Model/ViewModels/Extend/ChunkUpload.cs b/Tiobon.Core.Model/ViewModels/Extend/ChunkUpload.cs index 1c015f12..fe73e23f 100644 --- a/Tiobon.Core.Model/ViewModels/Extend/ChunkUpload.cs +++ b/Tiobon.Core.Model/ViewModels/Extend/ChunkUpload.cs @@ -10,4 +10,5 @@ public class ChunkUpload public int chunkIndex { get; set; } public int totalChunks { get; set; } public string id { get; set; } = null; + public string masterId { get; set; } } \ No newline at end of file diff --git a/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs b/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs index 955ad132..23285f5c 100644 --- a/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs +++ b/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs @@ -114,6 +114,9 @@ public class QueryExam : DefaultGhre_ExamPaperPageData /// public bool? IsAllowExam { get; set; } = true; + public bool? IsAfterViewResultRetake { get; set; } + + public List Groups { get; set; } = new List(); } diff --git a/Tiobon.Core.Model/ViewModels/FileUpload.cs b/Tiobon.Core.Model/ViewModels/FileUpload.cs index 82ad2643..d4fbc734 100644 --- a/Tiobon.Core.Model/ViewModels/FileUpload.cs +++ b/Tiobon.Core.Model/ViewModels/FileUpload.cs @@ -10,6 +10,7 @@ public class FileUpload public string fileName { get; set; } public string userId { get; set; } public string langId { get; set; } + public string masterId { get; set; } } diff --git a/Tiobon.Core.Services/Ghre/Ghre_AttachmentServices.cs b/Tiobon.Core.Services/Ghre/Ghre_AttachmentServices.cs index b7521e4a..a79a4b05 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_AttachmentServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_AttachmentServices.cs @@ -15,7 +15,7 @@ public class Ghre_AttachmentServices : BaseServices> UploadVideoAsync(ChunkUpload upload) { var file = upload.file; - var path = $"{$"{Environment.CurrentDirectory}{Path.DirectorySeparatorChar}wwwroot{Path.DirectorySeparatorChar}files{Path.DirectorySeparatorChar}upload{Path.DirectorySeparatorChar}{upload.id}{Path.DirectorySeparatorChar}"}"; + var path = $"{$"{Environment.CurrentDirectory}{Path.DirectorySeparatorChar}wwwroot{Path.DirectorySeparatorChar}files{Path.DirectorySeparatorChar}upload/{upload.masterId}/{Path.DirectorySeparatorChar}{upload.id}{Path.DirectorySeparatorChar}"}"; if (!Directory.Exists(path)) Directory.CreateDirectory(path); using (var stream = File.Create(path + $"{upload.chunkIndex}")) @@ -32,11 +32,11 @@ public class Ghre_AttachmentServices : BaseServices() diff --git a/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs b/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs index 2c2b6b46..3fa96f10 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs @@ -475,6 +475,15 @@ public class Ghre_OpenClassServices : BaseServices it.Id == entity.ExamId) .ExecuteCommandAsync(); + + await Db.Updateable() + .SetColumns(it => new Ghre_ExamRecord() + { + BeginTime = entity.ExamStartTime, + EndTime = entity.ExamEndTime, + }) + .Where(it => it.ExamId == entity.ExamId) + .ExecuteCommandAsync(); } #region 生成反馈数据 diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 21c91235..2ad69ed3 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1145,6 +1145,12 @@ + + + IssueCertificate + + + Ghre_ExamRecordDetail(Controller)