From f76d9212bc094fed07c8a20164d042059b37f61f Mon Sep 17 00:00:00 2001 From: liguoyang Date: Sun, 24 Mar 2024 21:34:51 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=98=BE=E7=A4=BA=E5=BD=93=E5=89=8Dfacto?= =?UTF-8?q?ry,=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Organization/Controllers/WerksController.cs | 1 + .../Organization/Response/GainfoCurrentResponse.cs | 5 +++++ .../Organization/Services/Implements/GainfoService.cs | 7 +++++++ Src/Dlhis.Common/EnumSetting/EnumsController.cs | 10 +++++++--- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs b/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs index 815977fa..1c9cc3e2 100644 --- a/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs +++ b/Src/Dlhis.Basic/Organization/Controllers/WerksController.cs @@ -11,6 +11,7 @@ namespace Dlhis.Basic.Organization.Controllers; [Authorize] [Route("api/[controller]")] [ApiController] +[Obsolete] public class WerksController : ControllerBase { private readonly IWerkService _werkService; diff --git a/Src/Dlhis.Basic/Organization/Response/GainfoCurrentResponse.cs b/Src/Dlhis.Basic/Organization/Response/GainfoCurrentResponse.cs index 774a39bc..607133fe 100644 --- a/Src/Dlhis.Basic/Organization/Response/GainfoCurrentResponse.cs +++ b/Src/Dlhis.Basic/Organization/Response/GainfoCurrentResponse.cs @@ -45,6 +45,11 @@ public class GainfoCurrentResponse /// public DateTime Birthday { get; set; } + /// + /// 厂区 + /// + public string Factory { get; set; } + /// /// 就餐信息 /// diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index edb11c45..e7c95bc4 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -203,6 +203,7 @@ public class GainfoService : IGainfoService Gender = ga.Gender, UserCode = ga.Code, UserName = ga.Name, + Factory = ga.Factory, MealInfo = new GainfoCurrentMealInfoResponse { Balance = mealUser.Balance @@ -210,6 +211,12 @@ public class GainfoService : IGainfoService }) .FirstAsync(); + if (info != null) + { + var tenantResult = await _tenantApi.GetTenantByCodeAsync(info.Factory); + info.Factory = tenantResult.Data.Name; + } + return info; } diff --git a/Src/Dlhis.Common/EnumSetting/EnumsController.cs b/Src/Dlhis.Common/EnumSetting/EnumsController.cs index f76610bf..cc940da5 100644 --- a/Src/Dlhis.Common/EnumSetting/EnumsController.cs +++ b/Src/Dlhis.Common/EnumSetting/EnumsController.cs @@ -51,7 +51,9 @@ public class EnumsController : ControllerBase Key = fd, Value = (int)item.GetValue(null) }; - }).ToList() + }) + .OrderBy(x => x.Value) + .ToList() }; }) .ToList(); @@ -66,9 +68,10 @@ public class EnumsController : ControllerBase Name = type, Data = g.AsEnumerable().Select(x => new KeyValueDto { - Key = x.Code, - Value = x.Display + Key = x.Display, + Value = x.Code }) + .OrderBy(x => x.Value) .ToList() }; }); @@ -97,6 +100,7 @@ public class EnumsController : ControllerBase Value = (int)item.GetValue(null) }; }) + .OrderBy(x => x.Value) .ToList() }; }