From 9ce29ba833398567d7b46c193634465737a70290 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Mon, 21 Apr 2025 13:48:46 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E5=91=98=E5=90=8D=E7=A7=B0=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/WorkGridsController.cs | 3 +-- .../WorkGridScheduleAttendancePageResponse.cs | 15 +++++++++++++++ .../Implements/WorkGridScheduleService.cs | 18 +++++++++++++++++- Src/Dlhis.Basic/appsettings.Development.json | 10 +++++----- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/Src/Dlhis.Basic/WorkGrids/Controllers/WorkGridsController.cs b/Src/Dlhis.Basic/WorkGrids/Controllers/WorkGridsController.cs index d3aaba24..20bb2cc0 100644 --- a/Src/Dlhis.Basic/WorkGrids/Controllers/WorkGridsController.cs +++ b/Src/Dlhis.Basic/WorkGrids/Controllers/WorkGridsController.cs @@ -199,13 +199,12 @@ public class WorkGridsController : ControllerBase /// /// [HttpGet("user/attendance/page-all")] - [IgnoreTenant] public async Task> GetAllAttendancePageAsync([FromQuery] WorkGridScheduleAttendancePageRequest request) { return await _workGridScheduleService.GetAllAttendancePageAsync(request); } - /// + /// /// 网格人员考勤记录补传 /// /// diff --git a/Src/Dlhis.Basic/WorkGrids/Response/WorkGridScheduleAttendancePageResponse.cs b/Src/Dlhis.Basic/WorkGrids/Response/WorkGridScheduleAttendancePageResponse.cs index a89311df..48b6f121 100644 --- a/Src/Dlhis.Basic/WorkGrids/Response/WorkGridScheduleAttendancePageResponse.cs +++ b/Src/Dlhis.Basic/WorkGrids/Response/WorkGridScheduleAttendancePageResponse.cs @@ -92,6 +92,21 @@ public class WorkGridScheduleAttendancePageResponse } } + public string LeaderUserCode + { + get + { + if (WorkGridInfoObj != null) + { + return WorkGridInfoObj?.WorkGrid?.LeaderUserCode; + } + + return string.Empty; + } + } + + public string LeaderUserName { get; set; } + /// /// 是否是异常记录 /// diff --git a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs index c638f6bf..570edb3c 100644 --- a/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs +++ b/Src/Dlhis.Basic/WorkGrids/Services/Implements/WorkGridScheduleService.cs @@ -315,7 +315,7 @@ public class WorkGridScheduleService : IWorkGridScheduleService request.UserCode = request.Search; } - return await _dbContext.Queryable() + var page = await _dbContext.Queryable() .LeftJoin((log, d) => log.DeviceUniqueNo == d.UniqueNo) .LeftJoin((log, d, ga) => log.UserUniqueNo == ga.Code) .WhereIF(request.DateTimePeriod.HasValue(), log => log.RaiseDateTime >= request.DateTimePeriod.Start @@ -346,6 +346,22 @@ public class WorkGridScheduleService : IWorkGridScheduleService WorkGridInfo = log.WorkGridInfo, }) .ToPageListAsync(request); + + + var leaderUserCodes = page.Data.Select(x => x.LeaderUserCode).Distinct().ToList(); + var gainfos = await _dbContext.Queryable().Where(x => leaderUserCodes.Contains(x.Code)).Select(x => new { x.Code, x.Name }).ToListAsync(); + + page.Data.ForEach(x => + { + var gainfo = gainfos.FirstOrDefault(p => p.Code == x.LeaderUserCode); + if (gainfo != null) + { + x.LeaderUserName = gainfo.Name; + } + }); + + + return page; } diff --git a/Src/Dlhis.Basic/appsettings.Development.json b/Src/Dlhis.Basic/appsettings.Development.json index 0364272d..e384ae4e 100644 --- a/Src/Dlhis.Basic/appsettings.Development.json +++ b/Src/Dlhis.Basic/appsettings.Development.json @@ -27,9 +27,9 @@ }, "SwaggerOptions": { "Enable": true, - "Authority": "https://yikatong.isawesome.cn/oauth2", - "ClientId": "4fb184324eac4180", - "ClientSecret": "8ac8f235152f1524", + "Authority": "http://localhost:5000", + "ClientId": "98958aa485d38412", + "ClientSecret": "52589e011f02fe19", "Scopes": { "openid": "openid", "profile": "profile", @@ -37,8 +37,8 @@ } }, "IdentityServerOptions": { - "Authority": "https://yikatong.isawesome.cn/oauth2", - "RequireHttpsMetadata": true, + "Authority": "http://localhost:5000", + "RequireHttpsMetadata": false, "Issuer": "identity.isawesome.cn", "Audience": "", "Pat": {