diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs index 84b59eb0..b1783732 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs @@ -127,7 +127,6 @@ public class Ghre_ExamController : BaseController /// 复制 @@ -174,4 +173,18 @@ public class Ghre_ExamController : BaseController + /// 获取考试关联人员 + /// + /// id + /// + [HttpPost, Route("QueryRuleStaff/{id}")] + public async Task>> QueryRuleStaff(long id) + { + return await _service.QueryRuleStaff(id); + } + + #endregion + } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 76d37dbe..a003bb73 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -745,6 +745,13 @@ insert + + + 获取考试关联人员 + + id + + 考试通知记录(Controller) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs index 37492b94..ef27a9ce 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs @@ -31,6 +31,8 @@ namespace Tiobon.Core.IServices Task InsertMessageLog(Ghre_ExamMessageLogDto insert); + Task>> QueryRuleStaff(long examId); + Task> ExportExcel(QueryExport body, string status); } } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs index 4e94215c..1acc0fc0 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -18,6 +18,7 @@ using Tiobon.Core.Common.DB.Dapper; using Tiobon.Core.Common.Helper; using System.Data; using Snappier; +using Org.BouncyCastle.Crypto; namespace Tiobon.Core.Services; @@ -1517,4 +1518,43 @@ public class Ghre_ExamServices : BaseServices>> QueryRuleStaff(long examId) + { + + var exam = await base.QuerySingle(examId); + + var Ids = await Db.Queryable() + .Where(x => x.ExamId == null) + .WhereIF(exam.CourseId != null, x => x.CourseId == exam.CourseId) + .WhereIF(exam.CourseSceneId != null, x => x.CourseSceneId == exam.CourseSceneId) + .Select(x => x.StaffId).Distinct().ToListAsync(); + string sql = @"SELECT A.StaffID, + A.StaffName, + A.StaffNo, + A.Email Mail, + B.DeptName, + C.TitleName, + FORMAT(A.Indate, 'yyyy/MM/dd') Indate + FROM Ghra_Staff A + LEFT JOIN Ghro_Dept B ON A.DeptID = B.DeptID + LEFT JOIN Ghra_Title C ON A.TitleID = C.TitleID + WHERE 1=1 AND A.IsEnable=1 "; + + //var list = await _ghra_StaffSceneServices.Query(x => Ids.Contains(x.StaffID)); + if (Ids.Any()) + sql += $"AND StaffID IN({string.Join(",", Ids)}) "; + else sql += "AND 1!=1 "; + var data = await Db.Ado.SqlQueryAsync(sql); + data.ForEach(x => + { + if (x.DataSource.IsNull()) + { + x.DataSource = Consts.DIC_EXAM_STAFF_SOURCE.STUDY_RULE_REQUIRED; + x.DataSourceLabel = "必修规则"; + } + }); + + return ServiceResult>.OprateSuccess("查询成功!", data); + } } \ No newline at end of file