fix 获取餐次guid

This commit is contained in:
cheche
2024-01-22 17:38:07 +08:00
parent 0fa8cba30a
commit eb235ae154
2 changed files with 15 additions and 9 deletions

View File

@@ -506,19 +506,23 @@ public class BalanceService : IBalanceService
private async Task<Dictionary<string, string>> GetShiftCode()
{
var list = await _dbContext.Queryable<BasicTypeEntity>().Where(x => x.Type == "mealshift").ToListAsync();
var shiftCodeDict = new Dictionary<string, string>();
var breakfastCode = list.FirstOrDefault(x => x.Code == "shift-breakfast")?.Code;
var lunchCode = list.FirstOrDefault(x => x.Code == "shift-lunch")?.Code;
var dinnerCode = list.FirstOrDefault(x => x.Code == "shift-dinner")?.Code;
var lateNightCode = list.FirstOrDefault(x => x.Code == "shift-midnightsnack")?.Code;
var shifts = await _dbContext.Queryable<CanteenBusinessShiftEntity>().ToListAsync();
//guid
var breakfastCode = shifts.Where(x=>x.CustomCode == "shift-breakfast").Select(x => x.Code).First().ToString();
shiftCodeDict.Add("Breakfast", breakfastCode);
shiftCodeDict.Add("Lunch", lunchCode);
shiftCodeDict.Add("Dinner", dinnerCode);
shiftCodeDict.Add("LateNight", lateNightCode);
var lunchCode = shifts.Where(x => x.CustomCode == "shift-lunch").Select(x => x.Code).First().ToString();
var dinnerCode = shifts.Where(x => x.CustomCode == "shift-dinner").Select(x => x.Code).First().ToString();
var lateNightCode = shifts.Where(x => x.CustomCode == "shift-midnightsnack").Select(x => x.Code).First().ToString();
shiftCodeDict.Add("Breakfast", breakfastCode.ToString());
shiftCodeDict.Add("Lunch", lunchCode.ToString());
shiftCodeDict.Add("Dinner", dinnerCode.ToString());
shiftCodeDict.Add("LateNight", lateNightCode.ToString());
return shiftCodeDict;
}

View File

@@ -1,5 +1,6 @@
using Kurisu.AspNetCore.Startup;
using Kurisu.Startup;
using Microsoft.IdentityModel.Logging;
namespace Dlhis.Canteen;
@@ -15,5 +16,6 @@ public class Startup : DefaultStartup
{
public Startup(IConfiguration configuration) : base(configuration)
{
IdentityModelEventSource.ShowPII = true;
}
}