考试新增查询考试组接口

master
xiaochanghai 2 months ago
parent 15c7be45e1
commit 6af7945395
  1. 11
      Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs
  2. 7
      Tiobon.Core.Api/Tiobon.Core.xml
  3. 2
      Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs
  4. 27
      Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs
  5. 7
      Tiobon.Core/Tiobon.Core.xml

@ -280,4 +280,15 @@ public class Ghre_ExamRecordController : BaseController<IGhre_ExamRecordServices
{
return await _service.SubmitAttachment(examRecordId, attachments);
}
/// <summary>
/// 查询考试组
/// </summary>
/// <param name="examRecordId"></param>
/// <returns></returns>
[HttpPost("QueryGroups/{examRecordId}")]
public async Task<ServiceResult<List<ExamGroup>>> QueryGroups(long examRecordId)
{
return await _service.QueryGroups(examRecordId);
}
}

@ -1085,6 +1085,13 @@
<param name="examRecordId"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ExamRecordController.QueryGroups(System.Int64)">
<summary>
查询考试组
</summary>
<param name="examRecordId"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_ExamRecordDetailController">
<summary>
Ghre_ExamRecordDetail(Controller)

@ -36,4 +36,6 @@ public interface IGhre_ExamRecordServices : IBaseServices<Ghre_ExamRecord, Ghre_
/// </summary>
/// <returns></returns>
Task<ServiceResult> IssueCertificate();
Task<ServiceResult<List<ExamGroup>>> QueryGroups(long examRecordId);
}

@ -1676,4 +1676,31 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
return ServiceResult.OprateSuccess("发放成功!");
}
#endregion
#region 查询考试组
public async Task<ServiceResult<List<ExamGroup>>> QueryGroups(long examRecordId)
{
var Groups = await Db.Queryable<Ghre_ExamRecordGroup>()
.OrderByDescending(x => x.ExamTime)
.Where(x => x.ExamRecordId == examRecordId)
.Select(x => new
{
GroupId = x.Id,
x.ExamRecordId,
x.ExamTime,
x.Score
}).ToListAsync();
var groups = Groups
.Select(x => new ExamGroup()
{
GroupId = x.GroupId,
ExamRecordId = x.ExamRecordId,
ExamTime = x.ExamTime.ObjToString() + (x.Score != null ? $"得分:{x.Score}" : ""),
}).ToList();
return ServiceResult<List<ExamGroup>>.OprateSuccess("成功!", groups);
}
#endregion
}

@ -1085,6 +1085,13 @@
<param name="examRecordId"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ExamRecordController.QueryGroups(System.Int64)">
<summary>
查询考试组
</summary>
<param name="examRecordId"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_ExamRecordDetailController">
<summary>
Ghre_ExamRecordDetail(Controller)

Loading…
Cancel
Save