diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs index 0472cbdc..660d16ef 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs @@ -2118,18 +2118,19 @@ namespace BMA.EHR.Retirement.Service.Controllers { var retirePeriodOfficer = await _context.RetirementPeriods .Include(x => x.RetirementRawProfiles.Where(y => y.Remove != "REMOVE")) - .Where(x => x.Year == year && x.Type.Trim().ToUpper().Contains(type)) + .Where(x => x.Year == year && (x.Type ?? "").Trim().ToUpper().Contains(type) && x.Round == 1) .FirstOrDefaultAsync(); if (retirePeriodOfficer == null) return Error("ไม่พบรอบประกาศเกษียณอายุราชการ"); - var data = retirePeriodOfficer.RetirementRawProfiles - .Select(x => new - { - profileId = x.profileId - }) - .ToList(); + var data = new + { + signDate = retirePeriodOfficer.SignDate ?? null, + profiles = retirePeriodOfficer.RetirementRawProfiles + .Select(x => new { profileId = x.profileId }) + .ToList() + }; return Success(data); }