From 15c67a4f788c570847487e82d56cbacef60d7a84 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 13 Jun 2024 14:26:46 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=90=8D=E7=A7=B0,=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DevicePermissionsController.cs | 1 + .../Response/GainfoFacePageResponse.cs | 5 +++ .../Services/Implements/GainfoFaceService.cs | 4 +- Src/Dlhis.Entity/Dlhis.Entity.csproj | 2 +- .../Jobs/MealSupplementHandlerJob.cs | 38 +++++++++---------- 5 files changed, 29 insertions(+), 21 deletions(-) diff --git a/Src/Dlhis.Basic/Device/Controllers/DevicePermissionsController.cs b/Src/Dlhis.Basic/Device/Controllers/DevicePermissionsController.cs index ac4563e5..c3b1cd11 100644 --- a/Src/Dlhis.Basic/Device/Controllers/DevicePermissionsController.cs +++ b/Src/Dlhis.Basic/Device/Controllers/DevicePermissionsController.cs @@ -30,6 +30,7 @@ public class DevicePermissionsController : ControllerBase [HttpPost("assign")] [Transactional] [IgnoreTenant] + [DataPermission] [AssignPermissionLimit] public async Task AssignAsync(DevicePermissionSaveRequest request) { diff --git a/Src/Dlhis.Basic/Organization/Response/GainfoFacePageResponse.cs b/Src/Dlhis.Basic/Organization/Response/GainfoFacePageResponse.cs index c105aa40..313221b0 100644 --- a/Src/Dlhis.Basic/Organization/Response/GainfoFacePageResponse.cs +++ b/Src/Dlhis.Basic/Organization/Response/GainfoFacePageResponse.cs @@ -25,6 +25,11 @@ public class GainfoFacePageResponse /// public string UserName { get; set; } + /// + /// 部门名称 + /// + public string DepartmentName { get; set; } + /// /// 是否存在人脸 /// diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs index 36d48369..5ee0898d 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoFaceService.cs @@ -50,13 +50,15 @@ public class GainfoFaceService : IGainfoFaceService var existsFaceCodes = await _faceDbContext.Queryable().Where(x => userCodes.Contains(x.UserCode)).Select(x => x.UserCode).ToListAsync(); var list = await _dbContext.Queryable() + .LeftJoin((x, d) => x.DepartmentNo == d.No) .Where(x => x.Factory == request.Factory) .WhereIF(request.Exists.HasValue && request.Exists.Value, x => existsFaceCodes.Contains(x.Code)) .WhereIF(request.Exists.HasValue && !request.Exists.Value, x => !existsFaceCodes.Contains(x.Code)) - .Select(x => new GainfoFacePageResponse + .Select((x, d) => new GainfoFacePageResponse { UserCode = x.Code, UserName = x.Name, + DepartmentName = d.Name, Exists = false }) .ToListAsync(); diff --git a/Src/Dlhis.Entity/Dlhis.Entity.csproj b/Src/Dlhis.Entity/Dlhis.Entity.csproj index 56780d28..978a1283 100644 --- a/Src/Dlhis.Entity/Dlhis.Entity.csproj +++ b/Src/Dlhis.Entity/Dlhis.Entity.csproj @@ -7,7 +7,7 @@ - + diff --git a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs index b254623c..ab44ca54 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/MealSupplementHandlerJob.cs @@ -137,25 +137,6 @@ public class MealSupplementHandlerJob : BaseJob .ExecuteCommandThrowVersionAsync(); }, 5); - var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List - { - new() - { - UniqueId = mealSupplement.UniqueId, - Status = "SUCCESS", - Msg = "操作成功" - } - }); - - //更新餐补信息为成功(同步成功) - await DbContext.Updateable() - .SetColumns(x => x.Result == r) - .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Success) - .SetColumns(x => x.Sync == true) - .SetColumns(x => x.ModifiedTime == DateTime.Now) - .Where(x => x.UniqueId == mealSupplement.UniqueId) - .ExecuteCommandAsync(); - await DbContext.InsertAsync(new BalanceRecordEntity { Amount = mealSupplement.Amount, @@ -189,6 +170,25 @@ public class MealSupplementHandlerJob : BaseJob ModifiedBy = 1, ModifiedTime = DateTime.Now, }); + + var r = await _jinkoJIPService.SyncMealSupplementRecordsAsync(new List + { + new() + { + UniqueId = mealSupplement.UniqueId, + Status = "SUCCESS", + Msg = "操作成功" + } + }); + + //更新餐补信息为成功(同步成功) + await DbContext.Updateable() + .SetColumns(x => x.Result == r) + .SetColumns(x => x.Status == MealSupplementStatusEnumtype.Success) + .SetColumns(x => x.Sync == true) + .SetColumns(x => x.ModifiedTime == DateTime.Now) + .Where(x => x.UniqueId == mealSupplement.UniqueId) + .ExecuteCommandAsync(); await DbContext.Client.Ado.CommitTranAsync(); }