From 303e103a68ad69c30fa604d10b88dc3975c9f450 Mon Sep 17 00:00:00 2001 From: 10191 <506754232@qq.com> Date: Wed, 29 Oct 2025 15:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E9=87=8F=E6=9B=B4=E6=96=B0=E4=BA=BA?= =?UTF-8?q?=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/WebAPI/Controllers/PersonController.cs | 42 +++++++++++++++++++ SGGL/WebAPI/Filter/TestPermissionAttribute.cs | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs index a146cd00..66da9b91 100644 --- a/SGGL/WebAPI/Controllers/PersonController.cs +++ b/SGGL/WebAPI/Controllers/PersonController.cs @@ -816,6 +816,48 @@ namespace WebAPI.Controllers } return responeData; } + public Model.ResponeData getAllPersonDataExchange(string projectId) + { + var responeData = new Model.ResponeData(); + try + { + responeData.data = (from x in Funs.DB.SitePerson_Person + join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId + where x.ProjectId == projectId + && !x.ExchangeTime.HasValue + && (!x.OutTime.HasValue || x.OutTime > DateTime.Now) && x.InTime.HasValue && x.InTime < DateTime.Now + && x.PhotoUrl != null + select new + { + x.PersonId, + x.PersonName, + x.CardNo, + x.IdentityCard, + x.UnitId, + y.UnitCode, + y.UnitName, + y.ShortUnitName, + Funs.DB.ProjectData_TeamGroup.First(z => z.TeamGroupId == x.TeamGroupId).TeamGroupName, + Sex = x.Sex ?? "1", + Funs.DB.Base_WorkPost.First(z => z.WorkPostId == x.WorkPostId).WorkPostName, + x.Telephone, + x.Address, + x.InTime, + x.AuditorDate, + x.ExchangeTime, + x.ExchangeTime2, + x.PhotoUrl, + x.IsUsed + }).Take(400).ToList(); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + ErrLogInfo.WriteLog(ex, "WX接口-获取人员下发门禁", "PersonController.getPersonDataExchange"); + } + return responeData; + } #endregion #region 获取离场人员 diff --git a/SGGL/WebAPI/Filter/TestPermissionAttribute.cs b/SGGL/WebAPI/Filter/TestPermissionAttribute.cs index 17361a1a..5f615e6a 100644 --- a/SGGL/WebAPI/Filter/TestPermissionAttribute.cs +++ b/SGGL/WebAPI/Filter/TestPermissionAttribute.cs @@ -132,6 +132,6 @@ namespace WebAPI.Filter /// /// /// - public static List listeds = new List { "Person*getPersonDataExchange" }; + public static List listeds = new List { "Person*getPersonDataExchange", "Person*getAllPersonDataExchange" }; } } \ No newline at end of file