แก้ระบบบรรจุผูกโครงสร้างใหม่
This commit is contained in:
parent
57164f5d45
commit
18d75f4b04
37 changed files with 79295 additions and 3904 deletions
|
|
@ -189,23 +189,41 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
ProfileId = p.Profile.Id,
|
||||
Prefix = p.Profile.Prefix == null ? null : p.Profile.Prefix.Name,
|
||||
PrefixId = p.Profile.Prefix == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Prefix.Id,
|
||||
p.Profile.FirstName,
|
||||
p.Profile.LastName,
|
||||
Position = p.Profile.Position == null ? null : p.Profile.Position.Name,
|
||||
PositionId = p.Profile.Position == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Position.Id,
|
||||
PositionType = p.Profile.PositionType == null ? null : p.Profile.PositionType.Name,
|
||||
PositionTypeId = p.Profile.PositionType == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.PositionType.Id,
|
||||
p.Profile.PositionLine,
|
||||
p.Profile.PositionLineId,
|
||||
PositionLevel = p.Profile.PositionLevel == null ? null : p.Profile.PositionLevel.Name,
|
||||
PositionLevelId = p.Profile.PositionLevel == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.PositionLevel.Id,
|
||||
p.Profile.PositionExecutive,
|
||||
p.Profile.PositionExecutiveId,
|
||||
Organization = p.Profile.Oc,
|
||||
OrganizationId = p.Profile.OcId,
|
||||
p.prefix,
|
||||
p.profileId,
|
||||
p.firstName,
|
||||
p.lastName,
|
||||
p.root,
|
||||
p.rootShortName,
|
||||
p.child1,
|
||||
p.child1ShortName,
|
||||
p.child2,
|
||||
p.child2ShortName,
|
||||
p.child3,
|
||||
p.child3ShortName,
|
||||
p.child4,
|
||||
p.child4ShortName,
|
||||
p.posMasterNo,
|
||||
p.posLevelName,
|
||||
p.posTypeName,
|
||||
|
||||
// ProfileId = p.Profile.Id,
|
||||
// Prefix = p.Profile.Prefix == null ? null : p.Profile.Prefix.Name,
|
||||
// PrefixId = p.Profile.Prefix == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Prefix.Id,
|
||||
// p.Profile.FirstName,
|
||||
// p.Profile.LastName,
|
||||
// Position = p.Profile.Position == null ? null : p.Profile.Position.Name,
|
||||
// PositionId = p.Profile.Position == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Position.Id,
|
||||
// PositionType = p.Profile.PositionType == null ? null : p.Profile.PositionType.Name,
|
||||
// PositionTypeId = p.Profile.PositionType == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.PositionType.Id,
|
||||
// p.Profile.PositionLine,
|
||||
// p.Profile.PositionLineId,
|
||||
// PositionLevel = p.Profile.PositionLevel == null ? null : p.Profile.PositionLevel.Name,
|
||||
// PositionLevelId = p.Profile.PositionLevel == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.PositionLevel.Id,
|
||||
// p.Profile.PositionExecutive,
|
||||
// p.Profile.PositionExecutiveId,
|
||||
// Organization = p.Profile.Oc,
|
||||
// OrganizationId = p.Profile.OcId,
|
||||
p.Number,
|
||||
p.Date,
|
||||
p.Location,
|
||||
|
|
@ -216,29 +234,34 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
if (data == null)
|
||||
return null;
|
||||
|
||||
string Prefix = string.IsNullOrEmpty(data.Prefix.ToString()) ? string.Empty : data.Prefix.ToString();
|
||||
string FirstName = string.IsNullOrEmpty(data.FirstName.ToString()) ? string.Empty : data.FirstName.ToString();
|
||||
string LastName = string.IsNullOrEmpty(data.LastName.ToString()) ? string.Empty : data.LastName.ToString();
|
||||
string FullName = $"{Prefix} {FirstName} {LastName}";
|
||||
// string Prefix = string.IsNullOrEmpty(data.Prefix.ToString()) ? string.Empty : data.Prefix.ToString();
|
||||
// string FirstName = string.IsNullOrEmpty(data.FirstName.ToString()) ? string.Empty : data.FirstName.ToString();
|
||||
// string LastName = string.IsNullOrEmpty(data.LastName.ToString()) ? string.Empty : data.LastName.ToString();
|
||||
// string FullName = $"{Prefix} {FirstName} {LastName}";
|
||||
string Date = string.IsNullOrEmpty(data.Date.ToString()) ? "วันที่ - เดือน - พ.ศ. -" : DateTime.Parse(data.Date.ToString()).ToThaiFullDate().ToString().ToThaiNumber();
|
||||
string CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate().ToString().ToThaiNumber();
|
||||
return new
|
||||
{
|
||||
FullName,
|
||||
FullName = $"{data.prefix} {data.firstName} {data.lastName}",
|
||||
Date,
|
||||
CurrentDate,
|
||||
data.Position,
|
||||
data.PositionExecutive,
|
||||
data.PositionType,
|
||||
data.PositionLine,
|
||||
data.PositionLevel,
|
||||
data.Organization,
|
||||
data.PositionId,
|
||||
data.PositionExecutiveId,
|
||||
data.PositionTypeId,
|
||||
data.PositionLineId,
|
||||
data.PositionLevelId,
|
||||
data.OrganizationId,
|
||||
data.profileId,
|
||||
data.prefix,
|
||||
data.firstName,
|
||||
data.lastName,
|
||||
data.root,
|
||||
data.rootShortName,
|
||||
data.child1,
|
||||
data.child1ShortName,
|
||||
data.child2,
|
||||
data.child2ShortName,
|
||||
data.child3,
|
||||
data.child3ShortName,
|
||||
data.child4,
|
||||
data.child4ShortName,
|
||||
data.posMasterNo,
|
||||
data.posLevelName,
|
||||
data.posTypeName,
|
||||
data.Number,
|
||||
data.Location,
|
||||
data.Reason,
|
||||
|
|
@ -250,7 +273,7 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
public async Task<dynamic> GetHeadRetirementDeceasedAsync(Guid id)
|
||||
{
|
||||
var data = await _dbContext.Set<RetirementDeceased>().AsQueryable()
|
||||
.Include(x => x.Profile)
|
||||
// .Include(x => x.Profile)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
var oc = "";
|
||||
|
|
@ -264,28 +287,28 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
Send = "หัวหน้าสำนักงาน ก.ก.",
|
||||
};
|
||||
|
||||
if (data.Profile.OcId != null)
|
||||
{
|
||||
var organization = await _dbContext.Set<OrganizationEntity>().AsQueryable()
|
||||
.Where(x => x.Id == data.Profile.OcId)
|
||||
.FirstOrDefaultAsync();
|
||||
if (organization != null)
|
||||
{
|
||||
var organizationAgency = await _dbContext.Set<OrganizationEntity>().AsQueryable()
|
||||
.Where(x => x.Id == organization.OrganizationAgencyId)
|
||||
.FirstOrDefaultAsync();
|
||||
if (organizationAgency != null)
|
||||
{
|
||||
var agency = await _dbContext.Set<OrganizationEntity>().AsQueryable()
|
||||
.Where(x => x.Id == organizationAgency.Id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (agency != null)
|
||||
{
|
||||
oc = agency.OrganizationOrganization?.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (data.Profile.OcId != null)
|
||||
// {
|
||||
// var organization = await _dbContext.Set<OrganizationEntity>().AsQueryable()
|
||||
// .Where(x => x.Id == data.Profile.OcId)
|
||||
// .FirstOrDefaultAsync();
|
||||
// if (organization != null)
|
||||
// {
|
||||
// var organizationAgency = await _dbContext.Set<OrganizationEntity>().AsQueryable()
|
||||
// .Where(x => x.Id == organization.OrganizationAgencyId)
|
||||
// .FirstOrDefaultAsync();
|
||||
// if (organizationAgency != null)
|
||||
// {
|
||||
// var agency = await _dbContext.Set<OrganizationEntity>().AsQueryable()
|
||||
// .Where(x => x.Id == organizationAgency.Id)
|
||||
// .FirstOrDefaultAsync();
|
||||
// if (agency != null)
|
||||
// {
|
||||
// oc = agency.OrganizationOrganization?.Name;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
return new
|
||||
{
|
||||
|
|
@ -302,7 +325,7 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
public async Task UploadFileRetirementDeceasedAsync(Guid id, Domain.Models.Documents.Document file)
|
||||
{
|
||||
var data = await _dbContext.Set<RetirementDeceased>().AsQueryable()
|
||||
.Include(x => x.Profile)
|
||||
// .Include(x => x.Profile)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data != null)
|
||||
|
|
@ -361,8 +384,8 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
data.LastName,
|
||||
data.Location,
|
||||
FullName = $"{data.Prefix}{data.FirstName} {data.LastName}",
|
||||
SendDate = string.IsNullOrEmpty(data.SendDate.ToString())? string.Empty : DateTime.Parse(data.SendDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
ActiveDate = string.IsNullOrEmpty(data.ActiveDate.ToString())? string.Empty : DateTime.Parse(data.ActiveDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
SendDate = string.IsNullOrEmpty(data.SendDate.ToString()) ? string.Empty : DateTime.Parse(data.SendDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
ActiveDate = string.IsNullOrEmpty(data.ActiveDate.ToString()) ? string.Empty : DateTime.Parse(data.ActiveDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
data.Reason,
|
||||
data.Status,
|
||||
data.salary,
|
||||
|
|
@ -376,7 +399,7 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
data.CreatedAt,
|
||||
data.OligarchReject,
|
||||
data.OligarchApproveReason,
|
||||
data.OligarchRejectReason,
|
||||
data.OligarchRejectReason,
|
||||
OligarchRejectDate = string.IsNullOrEmpty(data.OligarchRejectDate.ToString()) ? string.Empty : DateTime.Parse(data.OligarchRejectDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
data.CommanderReject,
|
||||
data.CommanderApproveReason,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue