From ac01263e0f4a77042ded329790a28157dfc4f978 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Fri, 2 Aug 2024 14:20:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=80=83=E8=AF=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=BA=BA=E5=91=98=E8=87=AA=E5=8A=A8=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Ghre/Ghre_ExamController.cs | 15 ++++++- Tiobon.Core.Api/Tiobon.Core.xml | 7 ++++ .../Ghre/IGhre_ExamServices.cs | 2 + .../Ghre/Ghre_ExamServices.cs | 40 +++++++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) 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