แก้คิวรี่ ขร4

This commit is contained in:
Kittapath 2023-09-18 10:49:09 +07:00
parent 679cc2cfc2
commit 767705347b

View file

@ -665,54 +665,54 @@ namespace BMA.EHR.Application.Repositories.Reports
.Distinct()
.ToList();
var insignia_data = (from r in await _dbContext.Set<InsigniaRequestProfile>()
.Include(x => x.Profile)
.ThenInclude(x => x.Gender)
.Include(x => x.Profile)
.ThenInclude(x => x.Insignias)
.ThenInclude(x => x.Insignia)
.Include(x => x.Request)
.ThenInclude(x => x.Period)
.Include(x => x.Request)
.ThenInclude(x => x.Organization)
.Include(x => x.RequestInsignia)
.ThenInclude(x => x.InsigniaType)
.ToListAsync()
where r.Request.Period == period
&& r.IsApprove == true
&& r.Status == "PENDING"
&& r.RequestInsignia.InsigniaType != null
&& r.RequestInsignia.InsigniaType.Name != "เหรียญบำเหน็จในราชการ"
select new
{
InsigniaInitial = r.RequestInsignia.ShortName,
InsigniaName = r.RequestInsignia.Name,
ProfileId = r.Profile.Id,
CitizenId = r.Profile.CitizenId,
FullName = $"",
ShowProfileId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
Type = "",
AcademicStanding = "",
Level = "",
DateStart = "",
SalaryAmount = new double?(0),
InsigniaRecv = r.Profile.Insignias.Count() == 0 ? null :
(r.Profile.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().Insignia == null ? null : r.Profile.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().Insignia.ShortName),
InsigniaRecvDate = r.Profile.Insignias.Count() == 0 ? null :
(r.Profile.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().DateAnnounce == null ? null : r.Profile.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().DateAnnounce.Value.ToThaiShortDate()),
InsigniaRequest = "",
Remark = "",
Position = "",
// Position = GetPositionByYear(r.Profile.Id, r.Request.Period.Year) + " ประเภท" +
// GetPositionTypeByYear(r.Profile.Id, r.Request.Period.Year) + " ระดับ" +
// GetPositionLevelByYear(r.Profile.Id, r.Request.Period.Year),
OCName = _organizationCommonRepository.GetOrganizationNameFullPath(r.Request.Organization.Id, false, false)
})
.Distinct()
.ToList();
// var insignia_data = (from r in await _dbContext.Set<InsigniaRequestProfile>()
// .Include(x => x.Profile)
// .ThenInclude(x => x.Gender)
// .Include(x => x.Profile)
// .ThenInclude(x => x.Insignias)
// .ThenInclude(x => x.Insignia)
// .Include(x => x.Request)
// .ThenInclude(x => x.Period)
// .Include(x => x.Request)
// .ThenInclude(x => x.Organization)
// .Include(x => x.RequestInsignia)
// .ThenInclude(x => x.InsigniaType)
// .ToListAsync()
// where r.Request.Period == period
// && r.IsApprove == true
// && r.Status == "PENDING"
// && r.RequestInsignia.InsigniaType != null
// && r.RequestInsignia.InsigniaType.Name != "เหรียญบำเหน็จในราชการ"
// select new
// {
// InsigniaInitial = r.RequestInsignia.ShortName,
// InsigniaName = r.RequestInsignia.Name,
// ProfileId = r.Profile.Id,
// CitizenId = r.Profile.CitizenId,
// FullName = $"",
// ShowProfileId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
// Type = "",
// AcademicStanding = "",
// Level = "",
// DateStart = "",
// SalaryAmount = new double?(0),
// InsigniaRecv = r.Profile.Insignias.Count() == 0 ? null :
// (r.Profile.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().Insignia == null ? null : r.Profile.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().Insignia.ShortName),
// InsigniaRecvDate = r.Profile.Insignias.Count() == 0 ? null :
// (r.Profile.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().DateAnnounce == null ? null : r.Profile.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().DateAnnounce.Value.ToThaiShortDate()),
// InsigniaRequest = "",
// Remark = "",
// Position = "",
// // Position = GetPositionByYear(r.Profile.Id, r.Request.Period.Year) + " ประเภท" +
// // GetPositionTypeByYear(r.Profile.Id, r.Request.Period.Year) + " ระดับ" +
// // GetPositionLevelByYear(r.Profile.Id, r.Request.Period.Year),
// OCName = _organizationCommonRepository.GetOrganizationNameFullPath(r.Request.Organization.Id, false, false)
// })
// .Distinct()
// .ToList();
var data2 = teacher_data.Union(insignia_data).ToList();
return data2;
// var data2 = teacher_data.Union(insignia_data).ToList();
return teacher_data;
}
//44-บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ