fix 时段名称显示
This commit is contained in:
@@ -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<BasicTypeEntity>().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;
|
||||
|
||||
Reference in New Issue
Block a user