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;