diff --git a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs index a3aa5c79..f9e95cbb 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs @@ -1782,26 +1782,32 @@ namespace BMA.EHR.Application.Repositories.Commands RegistrationSubDistrictId = placementProfile.RegistSubDistrict == null ? Guid.Empty : placementProfile.RegistSubDistrict!.Id, RegistrationDistrictId = placementProfile.RegistDistrict == null ? Guid.Empty : placementProfile.RegistDistrict!.Id, RegistrationProvinceId = placementProfile.RegistProvince == null ? Guid.Empty : placementProfile.RegistProvince!.Id, + RegistrationZipCode = placementProfile.RegistSubDistrict == null ? null : placementProfile.RegistSubDistrict!.ZipCode, CurrentAddress = placementProfile.CurrentAddress, CurrentSubDistrictId = placementProfile.CurrentSubDistrict == null ? Guid.Empty : placementProfile.CurrentSubDistrict!.Id, CurrentDistrictId = placementProfile.CurrentDistrict == null ? Guid.Empty : placementProfile.CurrentDistrict!.Id, CurrentProvinceId = placementProfile.CurrentProvince == null ? Guid.Empty : placementProfile.CurrentProvince!.Id, + CurrentZipCode = placementProfile.CurrentSubDistrict == null ? null : placementProfile.CurrentSubDistrict!.ZipCode, - FatherPrefixId = placementProfile.FatherPrefix == null ? Guid.Empty : placementProfile.FatherPrefix.Id, + FatherPrefixId = placementProfile.FatherPrefix == null ? null : placementProfile.FatherPrefix.Id, FatherFirstName = placementProfile.FatherFirstName, FatherLastName = placementProfile.FatherLastName, FatherCareer = placementProfile.FatherOccupation, + FatherLive = true, - MotherPrefixId = placementProfile.MotherPrefix == null ? Guid.Empty : placementProfile.MotherPrefix.Id, + MotherPrefixId = placementProfile.MotherPrefix == null ? null : placementProfile.MotherPrefix.Id, MotherFirstName = placementProfile.MotherFirstName, MotherLastName = placementProfile.MotherLastName, MotherCareer = placementProfile.MotherOccupation, + MotherLive = true, - CouplePrefixId = placementProfile.MarryPrefix == null ? Guid.Empty : placementProfile.MarryPrefix.Id, + Couple = placementProfile.MarryPrefix == null ? false : true, + CouplePrefixId = placementProfile.MarryPrefix == null ? null : placementProfile.MarryPrefix.Id, CoupleFirstName = placementProfile.MarryFirstName, CoupleLastName = placementProfile.MarryLastName, CoupleCareer = placementProfile.MarryOccupation, + CoupleLive = placementProfile.MarryPrefix == null ? false : true, Position = placementProfile.PositionPath, PositionPathSideId = placementProfile.PositionPathSide == null ? Guid.Empty : placementProfile.PositionPathSide.Id, @@ -1826,9 +1832,9 @@ namespace BMA.EHR.Application.Repositories.Commands VerifiedUser = "", FirstNameOld = "", LastNameOld = "", - CoupleLive = false, - FatherLive = false, - MotherLive = false, + // CoupleLive = false, + // FatherLive = false, + // MotherLive = false, CreatedUser = "", Educations = new List(), @@ -4864,7 +4870,7 @@ namespace BMA.EHR.Application.Repositories.Commands //data.Profile.IsActive = false; //data.Profile.IsLeave = true; - //data.Profile.LeaveReason = "ออกจากราชการ"; + //data.Profile.LeaveReason = "ลาออกจากราชการ"; //data.Profile.LeaveDate = command.CommandAffectDate; var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); @@ -5043,7 +5049,7 @@ namespace BMA.EHR.Application.Repositories.Commands //data.Profile.IsActive = false; //data.Profile.IsLeave = true; - //data.Profile.LeaveReason = "ออกจากราชการ"; + //data.Profile.LeaveReason = "ลาออกจากราชการ"; //data.Profile.LeaveDate = command.CommandAffectDate; var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); @@ -5222,7 +5228,7 @@ namespace BMA.EHR.Application.Repositories.Commands data.Profile.IsActive = false; data.Profile.IsLeave = true; - data.Profile.LeaveReason = "ออกจากราชการ"; + data.Profile.LeaveReason = "ลาออกจากราชการ"; data.Profile.LeaveDate = command.CommandAffectDate; var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); @@ -6315,7 +6321,7 @@ namespace BMA.EHR.Application.Repositories.Commands data.Profile.IsActive = false; data.Profile.IsLeave = true; - data.Profile.LeaveReason = "ออกจากราชการ"; + data.Profile.LeaveReason = "ลาออกจากราชการ"; data.Profile.LeaveDate = command.CommandAffectDate; var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); diff --git a/BMA.EHR.Insignia.Service/Controllers/InsigniaRequestController.cs b/BMA.EHR.Insignia.Service/Controllers/InsigniaRequestController.cs index 90f9eafe..cccf7aba 100644 --- a/BMA.EHR.Insignia.Service/Controllers/InsigniaRequestController.cs +++ b/BMA.EHR.Insignia.Service/Controllers/InsigniaRequestController.cs @@ -1041,7 +1041,17 @@ namespace BMA.EHR.Insignia.Service.Controllers var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.Profile == profile && x.Request.Period == insigniaPeriod); if (insigniaRequestProfile != null) return Error(GlobalMessages.InsigniaRequestProfileDupicate); - var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod); + // var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod); + var _orgProfile = await _context.ProfilePositions + .Where(x => x.Profile == profile) + .Where(x => x.OrganizationPosition != null) + .Where(x => x.OrganizationPosition.Organization != null) + .Where(x => x.OrganizationPosition.Organization.OrganizationAgencyId != null) + .Select(x => x.OrganizationPosition.Organization.OrganizationAgencyId) + .FirstOrDefaultAsync(); + var _org = await _context.Organizations + .FirstOrDefaultAsync(x => x.Id == _orgProfile); + var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod && x.Organization == _org); if (insigniaRequest == null) { var orgProfile = await _context.ProfilePositions diff --git a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs index 4987498e..c5d0110f 100644 --- a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs +++ b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs @@ -39,6 +39,7 @@ namespace BMA.EHR.Report.Service.Controllers /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("{exportType}/{Id}")] + [AllowAnonymous] public async Task> GetProfileRetirement([FromRoute] Guid Id, string exportType = "pdf") { var retire = await _service.GetProfileRetirementdAsync(Id); @@ -104,7 +105,7 @@ namespace BMA.EHR.Report.Service.Controllers } report.ReportParameters["Type"].Value = (returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.pdf" && returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.docx") && (returnfile != "แก้ไขประกาศเกษียณข้าราชการ.pdf" && returnfile != "แก้ไขประกาศเกษียณข้าราชการ.docx") && (returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.docx") && (returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.docx") ? "1" : "0"; var _profileList = new List(); - var _count=0; + var _count = 0; var tmpOc1 = string.Empty; foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire)) { @@ -121,7 +122,7 @@ namespace BMA.EHR.Report.Service.Controllers string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString(); thaiOrder = $"ลำดับที่ {thaiOrder.ToThaiNumber()}"; _profileList.Add(new - { + { count = $"{_count.ToString().ToThaiNumber()}.", no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.", order = thaiOrder, @@ -130,10 +131,12 @@ namespace BMA.EHR.Report.Service.Controllers position = string.IsNullOrEmpty(profile.GetType().GetProperty("position").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("position").GetValue(profile), posNo = string.IsNullOrEmpty(profile.GetType().GetProperty("posNo").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("posNo").GetValue(profile), organizationOrganization = string.IsNullOrEmpty(profile.GetType().GetProperty("organizationOrganization").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("organizationOrganization").GetValue(profile), + positionEmployeePosition = string.IsNullOrEmpty(profile.GetType().GetProperty("positionEmployeePosition").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("positionEmployeePosition").GetValue(profile), + posNoEmployee = string.IsNullOrEmpty(profile.GetType().GetProperty("posNoEmployee").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("posNoEmployee").GetValue(profile), }); } //Binding Data - if(report.ReportParameters["Type"].Value == "1") + if (report.ReportParameters["Type"].Value == "1") { report.ReportParameters["Year"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Year").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Year").GetValue(retire); report.ReportParameters["Total"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Total").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Total").GetValue(retire); diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp index 3c1e333a..d0b85966 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp index a8a2ac40..bdc305dc 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp index aef6247c..ff5f8303 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp index 428eadfe..659e0fbf 100644 Binary files a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp and b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-2.trdp b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-2.trdp index ba342c28..c1e422f6 100644 Binary files a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-2.trdp and b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-2.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-3.trdp b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-3.trdp index 0d97be94..2b570e53 100644 Binary files a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-3.trdp and b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-3.trdp differ