diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs index 6a790cb6..60d9e59b 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs @@ -311,11 +311,12 @@ public class Ghrh_ResumeController : BaseController /// 简历Id /// input + /// 状态,0:暂存;1:提交 /// - [HttpPost, Route("AssessInterview/{id}")] - public async Task AssessInterview(long id, [FromBody] List> input) + [HttpPost, Route("AssessInterview/{id}/{status}")] + public async Task AssessInterview(long id, int status, [FromBody] List> input) { - return await _service.AssessInterview(id, input); + return await _service.AssessInterview(id, status, input); } #endregion diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 0ff0632c..833c7b65 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -6950,6 +6950,11 @@ 预留字段12 + + + 状态,0:暂存;1:提交 + + 面试工单日志 (Dto.Base) @@ -19441,6 +19446,11 @@ 预留字段12 + + + 状态,0:暂存;1:提交 + + 面试工单日志 (Model) diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index c7af8d54..afcc6cd3 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1469,12 +1469,13 @@ input - + 面试评估(主管填写) 简历Id input + 状态,0:暂存;1:提交 diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs index b05450fe..75c2f08a 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs @@ -48,7 +48,7 @@ public interface IGhrh_ResumeServices : IBaseServices RescheduleInterview(long id, ResumeRescheduleInterviewForm input, string type); - Task AssessInterview(long id, List> input); + Task AssessInterview(long id, int status, List> input); Task ModifyInterviewer(long id, List InterviewStaffs); diff --git a/Tiobon.Core.Model/Base/Ghrh/Ghrh_InterviewAssessDetail.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghrh/Ghrh_InterviewAssessDetail.Dto.Base.cs index f541f6f9..9f7d9796 100644 --- a/Tiobon.Core.Model/Base/Ghrh/Ghrh_InterviewAssessDetail.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghrh/Ghrh_InterviewAssessDetail.Dto.Base.cs @@ -6,7 +6,7 @@ * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── -*V0.01 2024/12/3 16:29:48 SimonHsiao 初版 +*V0.01 2024/12/6 21:07:07 SimonHsiao 初版 * * Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. *┌──────────────────────────────────┐ @@ -130,4 +130,9 @@ public class Ghrh_InterviewAssessDetailBase /// 预留字段12 /// public int? ReverseI2 { get; set; } + + /// + /// 状态,0:暂存;1:提交 + /// + public int? Status { get; set; } } diff --git a/Tiobon.Core.Model/Models/Ghrh/Ghrh_InterviewAssessDetail.cs b/Tiobon.Core.Model/Models/Ghrh/Ghrh_InterviewAssessDetail.cs index 2e78febb..dc103cc8 100644 --- a/Tiobon.Core.Model/Models/Ghrh/Ghrh_InterviewAssessDetail.cs +++ b/Tiobon.Core.Model/Models/Ghrh/Ghrh_InterviewAssessDetail.cs @@ -6,7 +6,7 @@ * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── -*V0.01 2024/12/3 16:29:48 SimonHsiao 初版 +*V0.01 2024/12/6 21:07:07 SimonHsiao 初版 * * Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. *┌──────────────────────────────────┐ @@ -131,4 +131,9 @@ public class Ghrh_InterviewAssessDetail : BasePoco /// 预留字段12 /// public int? ReverseI2 { get; set; } + + /// + /// 状态,0:暂存;1:提交 + /// + public int? Status { get; set; } } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 8e15a98a..99fe2899 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -2921,14 +2921,159 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; result.Body = body; #endregion + + + #region Header + + var printHeader = new JArray(); + obj = new(); + for (int i = 0; i < 2; i++) + { + obj = new(); + obj.Add(new JProperty("title", "标准")); + obj.Add(new JProperty("field", "Type" + (i + 1) + "Text")); + obj.Add(new JProperty("align", "center")); + obj.Add(new JProperty("width", i == 0 ? 80 : 120)); + obj.Add(new JProperty("fixed", null)); + printHeader.Add(obj); + } + + for (int i = 0; i < records.Count; i++) + { + var record = records[i]; + var staff = await Db.Queryable().Where(o => o.StaffID == record.StaffId).FirstAsync(); + obj = new(); + obj.Add(new JProperty("title", $"第{record.Round}轮面试\n{staff?.StaffName}\n {record.InterviewTime}")); + obj.Add(new JProperty("field", "Score" + (i + 1))); + obj.Add(new JProperty("align", "center")); + obj.Add(new JProperty("width", 120)); + obj.Add(new JProperty("fixed", null)); + + if (assessDetails.Where(o => o.StaffId == record.StaffId && o.InterviewRecordId == record.Id && o.Status == 1).Any()) + printHeader.Add(obj); + } + result.PrintHeader = printHeader; + #endregion + + #region 打印Body + var printBody = new JArray(); + assessConfigs.ForEach(x => + { + obj = new(); + obj.Add(new JProperty("Type1", x.ItemClass)); + obj.Add(new JProperty("Type1Text", x.ItemClassLabel)); + obj.Add(new JProperty("Type2", x.Id)); + obj.Add(new JProperty("Type2Text", x.ItemName)); + + + for (int i = 0; i < records.Count; i++) + { + var record = records[i]; + var assessDetail = assessDetails.Where(o => o.AssessConfigId == x.Id.ObjToString() && o.StaffId == record.StaffId && o.InterviewRecordId == record.Id).SingleOrDefault(); + if ((assessDetail != null && assessDetail.Status != 1 && assessDetail.InterviewRecordId == record.Id) || assessDetail is null) + continue; + + if (assessDetail != null) + obj.Add(new JProperty("Score" + (i + 1), assessDetail.AssessContent.ObjToInt())); + else + obj.Add(new JProperty("Score" + (i + 1), null)); + if (record.StaffId == staffId && record.Round == order.Round) + obj.Add(new JProperty("CanEdit" + (i + 1), true)); + else + obj.Add(new JProperty("CanEdit" + (i + 1), false)); + } + //obj.Add(new JProperty("EvaluateContent", null)); + printBody.Add(obj); + }); + + obj = new(); + obj.Add(new JProperty("Type1", "TotalScore")); + obj.Add(new JProperty("Type1Text", "总分")); + obj.Add(new JProperty("Type2", null)); + obj.Add(new JProperty("Type2Text", null)); + + for (int i = 0; i < records.Count; i++) + { + var record = records[i]; + var assessDetail = assessDetails.Where(o => o.AssessConfigId == "TotalScore" && o.StaffId == record.StaffId && o.InterviewRecordId == record.Id).SingleOrDefault(); + + if ((assessDetail != null && assessDetail.Status != 1 && assessDetail.InterviewRecordId == record.Id) || assessDetail is null) + continue; + + if (assessDetail != null) + obj.Add(new JProperty("Score" + (i + 1), assessDetail.AssessContent.ObjToInt())); + else + obj.Add(new JProperty("Score" + (i + 1), null)); + if (record.StaffId == staffId && record.Round == order.Round) + obj.Add(new JProperty("CanEdit" + (i + 1), true)); + else + obj.Add(new JProperty("CanEdit" + (i + 1), false)); + } + printBody.Add(obj); + + obj = new(); + obj.Add(new JProperty("Type1", "EvaluateContent")); + obj.Add(new JProperty("Type1Text", "总体评价")); + obj.Add(new JProperty("Type2", null)); + obj.Add(new JProperty("Type2Text", null)); + + for (int i = 0; i < records.Count; i++) + { + var record = records[i]; + var assessDetail = assessDetails.Where(o => o.AssessConfigId == "EvaluateContent" && o.StaffId == record.StaffId && o.InterviewRecordId == record.Id).SingleOrDefault(); + if ((assessDetail != null && assessDetail.Status != 1 && assessDetail.InterviewRecordId == record.Id) || assessDetail is null) + continue; + + + if (assessDetail != null) + obj.Add(new JProperty("Score" + (i + 1), assessDetail.AssessContent)); + else + obj.Add(new JProperty("Score" + (i + 1), null)); + if (record.StaffId == staffId && record.Round == order.Round) + obj.Add(new JProperty("CanEdit" + (i + 1), true)); + else + obj.Add(new JProperty("CanEdit" + (i + 1), false)); + } + printBody.Add(obj); + + obj = new(); + obj.Add(new JProperty("Type1", "IsPass")); + obj.Add(new JProperty("Type1Text", "面试结果")); + obj.Add(new JProperty("Type2", null)); + obj.Add(new JProperty("Type2Text", null)); + + for (int i = 0; i < records.Count; i++) + { + var record = records[i]; + var assessDetail = assessDetails.Where(o => o.AssessConfigId == "IsPass" && o.StaffId == record.StaffId && o.InterviewRecordId == record.Id).SingleOrDefault(); + + if ((assessDetail != null && assessDetail.Status != 1 && assessDetail.InterviewRecordId == record.Id) || assessDetail is null) + continue; + + + if (assessDetail != null) + obj.Add(new JProperty("Score" + (i + 1), assessDetail.AssessContent.ObjToInt())); + else + obj.Add(new JProperty("Score" + (i + 1), null)); + if (record.StaffId == staffId) + obj.Add(new JProperty("CanEdit" + (i + 1), true)); + else + obj.Add(new JProperty("CanEdit" + (i + 1), false)); + } + printBody.Add(obj); + + result.PrintBody = printBody; + #endregion + return ServiceResult.OprateSuccess("查询成功", result); } #endregion #region 面试评估 - public async Task AssessInterview(long id, List> input) + public async Task AssessInterview(long id, int status, List> input) { - + if (status > 1 || status < 0) + status = 0; var entity = await base.QueryById(id); if (entity == null) return ServiceResult.OprateFailed("无效的简历ID!"); @@ -2992,7 +3137,8 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; StaffId = staffId, InterviewRecordId = records[j].Id, AssessConfigId = assessConfigId.ObjToString(), - AssessContent = assessContent + AssessContent = assessContent, + Status = status }); } }