From 28af6e2a6b1219b8d5bc7a237808eb0f1dc862d7 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 24 Oct 2025 14:05:46 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=97=B6=E6=AE=B5=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Implements/GainfoService.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index 3bb7c6a8..d3fe58b2 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -160,18 +160,12 @@ public class GainfoService : IGainfoService page.Data.ForEach(item => { item.DepartmentName = outsourceInfos.FirstOrDefault(x => x.Code == item.Code)?.Supplier; }); } - + var basicTypes = await _dbContext.Queryable().Where(x => x.Type == "timeperiod").ToListAsync(); page.Data.ForEach(gainfo => { - if (gainfo.CardType == 1 || gainfo.CardType == 0 || gainfo.CardType.HasValue == false) - gainfo.CardTypeName = "全时段"; - - gainfo.CardTypeName = gainfo.CardType switch - { - 2 => "行政卡", - 3 => "车间卡", - _ => gainfo.CardTypeName - }; + gainfo.CardTypeName = gainfo.CardType is 1 or 0 or null + ? "全时段" + : basicTypes.FirstOrDefault(x => x.Code == gainfo.CardType.ToString())?.Display; }); return page;