query avatar placement

This commit is contained in:
DESKTOP-2S5P7D1\Windows 10 2023-09-06 13:52:32 +07:00
parent 3d0fbdceb8
commit d0c157ce90
12 changed files with 157 additions and 6 deletions

View file

@ -222,6 +222,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
p.CommanderApproveReason,
p.CommanderRejectReason,
p.CommanderRejectDate,
Avatar = p.Profile.Avatar == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Avatar.Id,
RetirementResignDocs = p.RetirementResignDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
})
.FirstOrDefaultAsync();
@ -268,6 +269,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
data.CommanderApproveReason,
data.CommanderRejectReason,
data.CommanderRejectDate,
Avatar = data.Avatar == Guid.Parse("00000000-0000-0000-0000-000000000000") ? null : await _documentService.ImagesPath(data.Avatar),
Docs = retirementResignDocs,
};
@ -670,6 +672,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Select(p => new
{
Id = p.Id,
PrefixId = p.RetirementResign.Profile.Prefix == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.RetirementResign.Profile.Prefix.Id,
Position = p.RetirementResign.Profile.Position == null ? null : p.RetirementResign.Profile.Position.Name,
PositionLevel = p.RetirementResign.Profile.PositionLevel == null ? null : p.RetirementResign.Profile.PositionLevel.Name,
Org = p.RetirementResign.Profile.OcId == null ? null : p.RetirementResign.Profile.OcId,
@ -694,6 +697,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
Suggestion = p.Suggestion,
AppointDate = p.AppointDate,
LastUpdatedAt = p.LastUpdatedAt,
OrganizationPositionOld = p.RetirementResign.OrganizationPositionOld,
CreatedAt = p.CreatedAt,
})
.FirstOrDefaultAsync();
@ -702,6 +706,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
var _data = new
{
data.Id,
data.PrefixId,
data.Position,
data.PositionLevel,
Org = data.Org == null ? null : FindOCFullPath(data.Org.Value, true),
@ -725,11 +730,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
data.FutureWorkReason,
data.Suggestion,
data.AppointDate,
data.OrganizationPositionOld,
data.LastUpdatedAt,
data.CreatedAt,
};
return Success(data);
return Success(_data);
}
/// <summary>