新增实操分

master
xiaochanghai 6 months ago
parent ef435a3cec
commit 170bd93408
  1. 5338
      Model/Tiobon.Web.pdm
  2. 7
      Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs
  3. 50
      Tiobon.Core.Api/Tiobon.Core.Model.xml
  4. 2
      Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs
  5. 397
      Tiobon.Core.Model/Base/Ghre/Ghre_ExamRecord.Dto.Base.cs
  6. 28
      Tiobon.Core.Model/Models/Ghre/Ghre_ExamRecord.cs
  7. 19
      Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs
  8. 50
      Tiobon.Core/Tiobon.Core.Model.xml

File diff suppressed because it is too large Load Diff

@ -31,7 +31,6 @@ public class Ghre_ExamRecordController : BaseController<IGhre_ExamRecordServices
{ {
return await _service.Query(examId, body); return await _service.Query(examId, body);
} }
#endregion #endregion
[HttpPost("ModifyAdjustScore/{examRecordId}")] [HttpPost("ModifyAdjustScore/{examRecordId}")]
@ -40,6 +39,12 @@ public class Ghre_ExamRecordController : BaseController<IGhre_ExamRecordServices
return await _service.ModifyAdjustScore(examRecordId, edit); return await _service.ModifyAdjustScore(examRecordId, edit);
} }
[HttpPost("ModifyActualScore/{examRecordId}")]
public async Task<ServiceResult> ModifyActualScore(string examRecordId, [FromBody] EditGhre_ExamRecordInput edit)
{
return await _service.ModifyActualScore(examRecordId, edit);
}
/// <summary> /// <summary>
/// 获取考试记录明细扩展接口 /// 获取考试记录明细扩展接口
/// </summary> /// </summary>

@ -4285,16 +4285,6 @@
来源 来源
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.IsView">
<summary>
是否查看试卷
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.ViewTime">
<summary>
查看试卷时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.RemarkSz"> <member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.RemarkSz">
<summary> <summary>
备注 备注
@ -4365,6 +4355,21 @@
预留字段12 预留字段12
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.IsView">
<summary>
是否查看试卷
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.ViewTime">
<summary>
查看试卷时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.ActualScore">
<summary>
实操分
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_ExamRecordAnswerBase"> <member name="T:Tiobon.Core.Model.Models.Ghre_ExamRecordAnswerBase">
<summary> <summary>
Ghre_ExamRecordAnswer (Dto.Base) Ghre_ExamRecordAnswer (Dto.Base)
@ -17786,16 +17791,6 @@
来源 来源
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.IsView">
<summary>
是否查看试卷
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.ViewTime">
<summary>
查看试卷时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.RemarkSz"> <member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.RemarkSz">
<summary> <summary>
备注 备注
@ -17866,6 +17861,21 @@
预留字段12 预留字段12
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.IsView">
<summary>
是否查看试卷
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.ViewTime">
<summary>
查看试卷时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.ActualScore">
<summary>
实操分
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_ExamRecordAnswer"> <member name="T:Tiobon.Core.Model.Models.Ghre_ExamRecordAnswer">
<summary> <summary>
Ghre_ExamRecordAnswer (Model) Ghre_ExamRecordAnswer (Model)

@ -27,4 +27,6 @@ public interface IGhre_ExamRecordServices : IBaseServices<Ghre_ExamRecord, Ghre_
Task<ServiceResult> AnswerExamAsync(List<DefaultGhre_ExamPaperPreview> answers, long studyRecordId); Task<ServiceResult> AnswerExamAsync(List<DefaultGhre_ExamPaperPreview> answers, long studyRecordId);
Task<ServiceResult> ViewExamPaperCallBackAsync(long examRecordId); Task<ServiceResult> ViewExamPaperCallBackAsync(long examRecordId);
Task<ServiceResult> ModifyActualScore(string examRecordId, EditGhre_ExamRecordInput edit);
} }

@ -6,212 +6,213 @@
* *
* Ver * Ver
* *
*V0.01 2024/7/24 13:42:13 SimonHsiao *V0.01 2024/12/23 14:36:50 SimonHsiao
* *
* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. * Copyright(c) 2024 Tiobon Corporation. All Rights Reserved.
* *
*   *  
* SimonHsiao * SimonHsiao
* *
*/ */
using System.ComponentModel; namespace Tiobon.Core.Model.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Tiobon.Core.Model.Models
/// <summary>
/// 考试记录 (Dto.Base)
/// </summary>
public class Ghre_ExamRecordBase
{ {
/// <summary> /// <summary>
/// 考试记录 (Dto.Base) /// 试卷ID
/// </summary> /// </summary>
public class Ghre_ExamRecordBase public long? ExamId { get; set; }
{
/// <summary>
/// <summary> /// 培训记录ID
/// 试卷ID /// </summary>
/// </summary> public long? StudyRecordId { get; set; }
public long? ExamId { get; set; }
/// <summary>
/// <summary> /// 员工ID
/// 培训记录ID /// </summary>
/// </summary> public int? StaffId { get; set; }
public long? StudyRecordId { get; set; }
/// <summary>
/// <summary> /// 课程快照ID
/// 员工ID /// </summary>
/// </summary> public long? CourseSnapId { get; set; }
public int? StaffId { get; set; }
/// <summary>
/// <summary> /// 试卷ID
/// 课程快照ID /// </summary>
/// </summary> public long? ExamPaperId { get; set; }
public long? CourseSnapId { get; set; }
/// <summary>
/// <summary> /// 得分
/// 试卷ID /// </summary>
/// </summary> [Display(Name = "Score"), Description("得分"), Column(TypeName = "decimal(20,2)")]
public long? ExamPaperId { get; set; } public decimal? Score { get; set; }
/// <summary> /// <summary>
/// 得分 /// 调整得分
/// </summary> /// </summary>
[Display(Name = "Score"), Description("得分"), Column(TypeName = "decimal(20,2)")] [Display(Name = "AdjustScore"), Description("调整得分"), Column(TypeName = "decimal(20,2)")]
public decimal? Score { get; set; } public decimal? AdjustScore { get; set; }
/// <summary> /// <summary>
/// 调整得分 /// 考试日期
/// </summary> /// </summary>
[Display(Name = "AdjustScore"), Description("调整得分"), Column(TypeName = "decimal(20,2)")] public DateTime? ExamDate { get; set; }
public decimal? AdjustScore { get; set; }
/// <summary>
/// <summary> /// 开始时间
/// 考试日期 /// </summary>
/// </summary> public DateTime? BeginTime { get; set; }
public DateTime? ExamDate { get; set; }
/// <summary>
/// <summary> /// 结束时间
/// 开始时间 /// </summary>
/// </summary> public DateTime? EndTime { get; set; }
public DateTime? BeginTime { get; set; }
/// <summary>
/// <summary> /// 实际开始时间
/// 结束时间 /// </summary>
/// </summary> public DateTime? ActualBeginTime { get; set; }
public DateTime? EndTime { get; set; }
/// <summary>
/// <summary> /// 实际结束时间
/// 实际开始时间 /// </summary>
/// </summary> public DateTime? ActualEndTime { get; set; }
public DateTime? ActualBeginTime { get; set; }
/// <summary>
/// <summary> /// 重考次数
/// 实际结束时间 /// </summary>
/// </summary> public int? RetakeTimes { get; set; }
public DateTime? ActualEndTime { get; set; }
/// <summary>
/// <summary> /// 状态
/// 重考次数 /// </summary>
/// </summary> [Display(Name = "Status"), Description("状态"), MaxLength(32, ErrorMessage = "状态 不能超过 32 个字符")]
public int? RetakeTimes { get; set; } public string Status { get; set; }
/// <summary> /// <summary>
/// 状态 /// 评分状态
/// </summary> /// </summary>
[Display(Name = "Status"), Description("状态"), MaxLength(32, ErrorMessage = "状态 不能超过 32 个字符")] [Display(Name = "ScoreStatus"), Description("评分状态"), MaxLength(32, ErrorMessage = "评分状态 不能超过 32 个字符")]
public string Status { get; set; } public string ScoreStatus { get; set; }
/// <summary> /// <summary>
/// 评分状态 /// 评语
/// </summary> /// </summary>
[Display(Name = "ScoreStatus"), Description("评分状态"), MaxLength(32, ErrorMessage = "评分状态 不能超过 32 个字符")] [Display(Name = "Comment"), Description("评语"), MaxLength(2000, ErrorMessage = "评语 不能超过 2000 个字符")]
public string ScoreStatus { get; set; } public string Comment { get; set; }
/// <summary> /// <summary>
/// 评语 /// 是否合格
/// </summary> /// </summary>
[Display(Name = "Comment"), Description("评语"), MaxLength(2000, ErrorMessage = "评语 不能超过 2000 个字符")] public bool? IsPass { get; set; }
public string Comment { get; set; }
/// <summary>
/// <summary> /// 来源
/// 是否合格 /// </summary>
/// </summary> [Display(Name = "Source"), Description("来源"), MaxLength(32, ErrorMessage = "来源 不能超过 32 个字符")]
public bool? IsPass { get; set; } public string Source { get; set; }
/// <summary> /// <summary>
/// 来源 /// 备注
/// </summary> /// </summary>
[Display(Name = "Source"), Description("来源"), MaxLength(32, ErrorMessage = "来源 不能超过 32 个字符")] [Display(Name = "RemarkSz"), Description("备注"), MaxLength(2000, ErrorMessage = "备注 不能超过 2000 个字符")]
public string Source { get; set; } public string RemarkSz { get; set; }
/// <summary> /// <summary>
/// 是否查看试卷 /// 默认标志
/// </summary> /// </summary>
public bool? IsView { get; set; } public int? IsDefault { get; set; }
/// <summary> /// <summary>
/// 查看试卷时间 /// 预留字段1
/// </summary> /// </summary>
public DateTime? ViewTime { get; set; } [Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")]
public string Reverse1 { get; set; }
/// <summary>
/// 备注 /// <summary>
/// </summary> /// 预留字段2
[Display(Name = "RemarkSz"), Description("备注"), MaxLength(2000, ErrorMessage = "备注 不能超过 2000 个字符")] /// </summary>
public string RemarkSz { get; set; } [Display(Name = "Reverse2"), Description("预留字段2"), MaxLength(1000, ErrorMessage = "预留字段2 不能超过 1000 个字符")]
public string Reverse2 { get; set; }
/// <summary>
/// 默认标志 /// <summary>
/// </summary> /// 预留字段3
public int? IsDefault { get; set; } /// </summary>
[Display(Name = "Reverse3"), Description("预留字段3"), MaxLength(1000, ErrorMessage = "预留字段3 不能超过 1000 个字符")]
/// <summary> public string Reverse3 { get; set; }
/// 预留字段1
/// </summary> /// <summary>
[Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")] /// 预留字段4
public string Reverse1 { get; set; } /// </summary>
[Display(Name = "Reverse4"), Description("预留字段4"), MaxLength(1000, ErrorMessage = "预留字段4 不能超过 1000 个字符")]
/// <summary> public string Reverse4 { get; set; }
/// 预留字段2
/// </summary> /// <summary>
[Display(Name = "Reverse2"), Description("预留字段2"), MaxLength(1000, ErrorMessage = "预留字段2 不能超过 1000 个字符")] /// 预留字段5
public string Reverse2 { get; set; } /// </summary>
[Display(Name = "Reverse5"), Description("预留字段5"), MaxLength(1000, ErrorMessage = "预留字段5 不能超过 1000 个字符")]
/// <summary> public string Reverse5 { get; set; }
/// 预留字段3
/// </summary> /// <summary>
[Display(Name = "Reverse3"), Description("预留字段3"), MaxLength(1000, ErrorMessage = "预留字段3 不能超过 1000 个字符")] /// 预留字段6
public string Reverse3 { get; set; } /// </summary>
[Display(Name = "Reverse6"), Description("预留字段6"), MaxLength(1000, ErrorMessage = "预留字段6 不能超过 1000 个字符")]
/// <summary> public string Reverse6 { get; set; }
/// 预留字段4
/// </summary> /// <summary>
[Display(Name = "Reverse4"), Description("预留字段4"), MaxLength(1000, ErrorMessage = "预留字段4 不能超过 1000 个字符")] /// 预留字段7
public string Reverse4 { get; set; } /// </summary>
[Display(Name = "Reverse7"), Description("预留字段7"), MaxLength(1000, ErrorMessage = "预留字段7 不能超过 1000 个字符")]
/// <summary> public string Reverse7 { get; set; }
/// 预留字段5
/// </summary> /// <summary>
[Display(Name = "Reverse5"), Description("预留字段5"), MaxLength(1000, ErrorMessage = "预留字段5 不能超过 1000 个字符")] /// 预留字段8
public string Reverse5 { get; set; } /// </summary>
[Display(Name = "Reverse8"), Description("预留字段8"), MaxLength(1000, ErrorMessage = "预留字段8 不能超过 1000 个字符")]
/// <summary> public string Reverse8 { get; set; }
/// 预留字段6
/// </summary> /// <summary>
[Display(Name = "Reverse6"), Description("预留字段6"), MaxLength(1000, ErrorMessage = "预留字段6 不能超过 1000 个字符")] /// 预留字段9
public string Reverse6 { get; set; } /// </summary>
[Display(Name = "Reverse9"), Description("预留字段9"), MaxLength(1000, ErrorMessage = "预留字段9 不能超过 1000 个字符")]
/// <summary> public string Reverse9 { get; set; }
/// 预留字段7
/// </summary> /// <summary>
[Display(Name = "Reverse7"), Description("预留字段7"), MaxLength(1000, ErrorMessage = "预留字段7 不能超过 1000 个字符")] /// 预留字段10
public string Reverse7 { get; set; } /// </summary>
[Display(Name = "Reverse10"), Description("预留字段10"), MaxLength(1000, ErrorMessage = "预留字段10 不能超过 1000 个字符")]
/// <summary> public string Reverse10 { get; set; }
/// 预留字段8
/// </summary> /// <summary>
[Display(Name = "Reverse8"), Description("预留字段8"), MaxLength(1000, ErrorMessage = "预留字段8 不能超过 1000 个字符")] /// 预留字段11
public string Reverse8 { get; set; } /// </summary>
public int? ReverseI1 { get; set; }
/// <summary>
/// 预留字段9 /// <summary>
/// </summary> /// 预留字段12
[Display(Name = "Reverse9"), Description("预留字段9"), MaxLength(1000, ErrorMessage = "预留字段9 不能超过 1000 个字符")] /// </summary>
public string Reverse9 { get; set; } public int? ReverseI2 { get; set; }
/// <summary> /// <summary>
/// 预留字段10 /// 是否查看试卷
/// </summary> /// </summary>
[Display(Name = "Reverse10"), Description("预留字段10"), MaxLength(1000, ErrorMessage = "预留字段10 不能超过 1000 个字符")] public bool? IsView { get; set; }
public string Reverse10 { get; set; }
/// <summary>
/// <summary> /// 查看试卷时间
/// 预留字段11 /// </summary>
/// </summary> public DateTime? ViewTime { get; set; }
public int? ReverseI1 { get; set; }
/// <summary>
/// <summary> /// 实操分
/// 预留字段12 /// </summary>
/// </summary> [Display(Name = "ActualScore"), Description("实操分"), Column(TypeName = "decimal(20,2)")]
public int? ReverseI2 { get; set; } public decimal? ActualScore { get; set; }
}
} }

@ -6,7 +6,7 @@
* *
* Ver * Ver
* *
*V0.01 2024/7/24 13:42:13 SimonHsiao *V0.01 2024/12/23 14:36:50 SimonHsiao
* *
* Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. * Copyright(c) 2024 Tiobon Corporation. All Rights Reserved.
* *
@ -120,16 +120,6 @@ public class Ghre_ExamRecord : BasePoco
[Display(Name = "Source"), Description("来源"), MaxLength(32, ErrorMessage = "来源 不能超过 32 个字符")] [Display(Name = "Source"), Description("来源"), MaxLength(32, ErrorMessage = "来源 不能超过 32 个字符")]
public string Source { get; set; } public string Source { get; set; }
/// <summary>
/// 是否查看试卷
/// </summary>
public bool? IsView { get; set; }
/// <summary>
/// 查看试卷时间
/// </summary>
public DateTime? ViewTime { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
@ -210,4 +200,20 @@ public class Ghre_ExamRecord : BasePoco
/// 预留字段12 /// 预留字段12
/// </summary> /// </summary>
public int? ReverseI2 { get; set; } public int? ReverseI2 { get; set; }
/// <summary>
/// 是否查看试卷
/// </summary>
public bool? IsView { get; set; }
/// <summary>
/// 查看试卷时间
/// </summary>
public DateTime? ViewTime { get; set; }
/// <summary>
/// 实操分
/// </summary>
[Display(Name = "ActualScore"), Description("实操分"), Column(TypeName = "decimal(20,2)")]
public decimal? ActualScore { get; set; }
} }

@ -115,6 +115,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
x.TotalScore += x.Score ?? 0; x.TotalScore += x.Score ?? 0;
x.TotalScore += x.AdjustScore ?? 0; x.TotalScore += x.AdjustScore ?? 0;
x.TotalScore += x.ActualScore ?? 0;
//if (x.DueDate != null) //if (x.DueDate != null)
// x.DueDate1 = x.DueDate.Value.ToString("yyyy-MM-dd"); // x.DueDate1 = x.DueDate.Value.ToString("yyyy-MM-dd");
//if (x.ExamDate != null) //if (x.ExamDate != null)
@ -153,12 +154,28 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
if (examPaper != null) if (examPaper != null)
entity.IsPass = examPaper.PassScore > (entity.Score + entity.AdjustScore) ? false : true; entity.IsPass = examPaper.PassScore > (entity.Score + entity.AdjustScore) ? false : true;
await Update(entity); await Update(entity, ["IsPass", "AdjustScore"]);
return ServiceResult.OprateSuccess("修改成功!"); return ServiceResult.OprateSuccess("修改成功!");
//return await QueryFilterPage(body, $"ExamId='{examId}'"); //return await QueryFilterPage(body, $"ExamId='{examId}'");
} }
public async Task<ServiceResult> ModifyActualScore(string examRecordId, EditGhre_ExamRecordInput edit)
{
var entity = await QuerySingle(examRecordId);
if (edit.ActualScore < 0)
return ServiceResult.OprateFailed($"实操分为【{edit.ActualScore}】,分数不可小于0!");
entity.ActualScore = edit.ActualScore;
//string score1 = Regex.Replace(entity.Score.ToString(), @"\.(0+)$", "") + "/" + Regex.Replace(entity.Score.ToString(), @"\.(0+)$", "");
await Update(entity, ["ActualScore"]);
return ServiceResult.OprateSuccess("修改成功!");
}
public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId) public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId)
{ {
var extend = new Ghre_ExamRecordExtend(); var extend = new Ghre_ExamRecordExtend();

@ -4285,16 +4285,6 @@
来源 来源
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.IsView">
<summary>
是否查看试卷
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.ViewTime">
<summary>
查看试卷时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.RemarkSz"> <member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.RemarkSz">
<summary> <summary>
备注 备注
@ -4365,6 +4355,21 @@
预留字段12 预留字段12
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.IsView">
<summary>
是否查看试卷
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.ViewTime">
<summary>
查看试卷时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordBase.ActualScore">
<summary>
实操分
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_ExamRecordAnswerBase"> <member name="T:Tiobon.Core.Model.Models.Ghre_ExamRecordAnswerBase">
<summary> <summary>
Ghre_ExamRecordAnswer (Dto.Base) Ghre_ExamRecordAnswer (Dto.Base)
@ -17786,16 +17791,6 @@
来源 来源
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.IsView">
<summary>
是否查看试卷
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.ViewTime">
<summary>
查看试卷时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.RemarkSz"> <member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.RemarkSz">
<summary> <summary>
备注 备注
@ -17866,6 +17861,21 @@
预留字段12 预留字段12
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.IsView">
<summary>
是否查看试卷
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.ViewTime">
<summary>
查看试卷时间
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecord.ActualScore">
<summary>
实操分
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_ExamRecordAnswer"> <member name="T:Tiobon.Core.Model.Models.Ghre_ExamRecordAnswer">
<summary> <summary>
Ghre_ExamRecordAnswer (Model) Ghre_ExamRecordAnswer (Model)

Loading…
Cancel
Save