新增考试记录组

master
xiaochanghai 2 months ago
parent a6213e897f
commit 9559bcffcd
  1. 13
      Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs
  2. 8
      Tiobon.Core.Api/Tiobon.Core.xml
  3. 2
      Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs
  4. 11
      Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs
  5. 25
      Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs
  6. 8
      Tiobon.Core/Tiobon.Core.xml

@ -58,7 +58,18 @@ public class Ghre_ExamRecordController : BaseController<IGhre_ExamRecordServices
[HttpPost("QueryExtend/{examRecordId}")]
public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId)
{
return await _service.ExtendAsync(examRecordId);
return await _service.ExtendAsync(examRecordId, null);
}
/// <summary>
/// 获取考试记录明细扩展接口
/// </summary>
/// <param name="examRecordId"></param>
/// <param name="groupId"></param>
/// <returns></returns>
[HttpPost("QueryExtend/{examRecordId}/{groupId}")]
public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId, long groupId)
{
return await _service.ExtendAsync(examRecordId, groupId);
}
/// <summary>

@ -1007,6 +1007,14 @@
<param name="examRecordId"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ExamRecordController.ExtendAsync(System.Int64,System.Int64)">
<summary>
获取考试记录明细扩展接口
</summary>
<param name="examRecordId"></param>
<param name="groupId"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ExamRecordController.CommentAsync(Tiobon.Core.Model.Ghre_ExamRecordExtend,System.Int64)">
<summary>
提交评语接口

@ -12,7 +12,7 @@ public interface IGhre_ExamRecordServices : IBaseServices<Ghre_ExamRecord, Ghre_
Task<ServiceResult> ModifyAdjustScore(string examRecordId, EditGhre_ExamRecordInput edit);
Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId);
Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId, long? groupId);
Task<ServiceResult> CommentAsync(Ghre_ExamRecordExtend extend, long examRecordId);

@ -104,17 +104,24 @@ public class QueryExam : DefaultGhre_ExamPaperPageData
/// </summary>
public bool? IsAllowView { get; set; } = true;
/// <summary>
/// 是否缺考
/// </summary>
public bool? IsMissExam { get; set; } = false;
/// <summary>
/// 是否缺考
/// </summary>
public bool? IsAllowExam { get; set; } = true;
public List<ExamGroup> Groups { get; set; } = new List<ExamGroup>();
}
public class ExamGroup
{
public long? GroupId { get; set; }
public long? ExamRecordId { get; set; }
public DateTime? ExamTime { get; set; }
}
public class CommentData

@ -220,7 +220,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
return ServiceResult.OprateSuccess("修改成功!");
}
public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId)
public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId, long? groupId)
{
var extend = new Ghre_ExamRecordExtend();
var record = await QuerySingle(x => x.Id == examRecordId || x.StudyRecordId == examRecordId);
@ -830,6 +830,16 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
}
#endregion
extend.Groups = await Db.Queryable<Ghre_ExamRecordGroup>()
.OrderByDescending(x => x.ExamTime)
.Where(x => x.ExamRecordId == record.Id)
.Select(x => new ExamGroup()
{
GroupId = x.Id,
ExamRecordId = x.ExamRecordId,
ExamTime = x.ExamTime,
}).ToListAsync();
return ServiceResult<QueryExam>.OprateSuccess("查询成功!", extend);
}
@ -922,6 +932,16 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
var dt = Db.GetDate();
var group = new Ghre_ExamRecordGroup()
{
StaffId = App.User.StaffId,
ExamId = record.ExamId,
ExamTime = DateTime.Now,
ExamRecordId = record.Id,
StudyRecordId = record.StudyRecordId
};
var groupId = await Db.Insertable(group).ExecuteReturnSnowflakeIdAsync();
var exam = await Db.Queryable<Ghre_Exam>()
.Where(x => x.Id == record.ExamId)
.FirstAsync(x => x.Status == DIC_EXAM_STATUS.RELEASED);
@ -972,7 +992,8 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
QuestionId = answer.QuestionId,
StaffId = staff?.UserStaffID,
Score = 0,
AdjustScore = 0
AdjustScore = 0,
GroupId = groupId
});
var questionAnswers1 = questionAnswers.Where(x => x.QuestionId == answer.QuestionId).ToList();
switch (answer.QuestionType)

@ -1007,6 +1007,14 @@
<param name="examRecordId"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ExamRecordController.ExtendAsync(System.Int64,System.Int64)">
<summary>
获取考试记录明细扩展接口
</summary>
<param name="examRecordId"></param>
<param name="groupId"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ExamRecordController.CommentAsync(Tiobon.Core.Model.Ghre_ExamRecordExtend,System.Int64)">
<summary>
提交评语接口

Loading…
Cancel
Save