From f4ba77a30d8ffcbccc3f51f45b9b5d0558c9dabd Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 5 Oct 2023 09:17:21 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9B?= =?UTF-8?q?=E0=B8=B5=E0=B8=9E=E0=B9=89=E0=B8=99=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PlacementAppointmentEmployeeController.cs | 6 +++--- .../Controllers/RetirementController.cs | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs index 18595896..01834a1a 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs @@ -522,8 +522,8 @@ namespace BMA.EHR.Placement.Service.Controllers /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน - [HttpPut("report/{commandTypeId:length(36)}")] - public async Task> PostToReport([FromBody] PlacementProfileRequest req, Guid commandTypeId) + [HttpPost("report")] + public async Task> PostToReport([FromBody] PlacementProfileRequest req) { foreach (var item in req.Id) { @@ -533,7 +533,7 @@ namespace BMA.EHR.Placement.Service.Controllers if (uppdated == null) continue; - uppdated.CommandType = await _context.CommandTypes.FindAsync(commandTypeId); + // uppdated.CommandType = await _context.CommandTypes.FindAsync(commandTypeId); uppdated.Status = "REPORT"; uppdated.LastUpdateFullName = FullName ?? "System Administrator"; uppdated.LastUpdateUserId = UserId ?? ""; diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs index 29c29dd9..82183194 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs @@ -310,6 +310,12 @@ namespace BMA.EHR.Retirement.Service.Controllers { if (!req.Type.Trim().ToUpper().Contains("EMPLOYEE") && !req.Type.Trim().ToUpper().Contains("OFFICER")) return Error("ประเภทพ้นราชการไม่ถูกต้อง"); + if (req.Year == 0) + { + req.Year = DateTime.Now.Year; + if (req.Year > 2500) + req.Year = req.Year - 543; + } var round = 1; var retire = await _context.RetirementPeriods From 98acfa5425da7824d9ff6581c3ece55d517d5943 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 5 Oct 2023 10:01:16 +0700 Subject: [PATCH 2/2] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=A5=E0=B8=B0=E0=B9=80=E0=B8=AD=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=94=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88?= =?UTF-8?q?=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repositories/Commands/CommandReportRepository.cs | 12 ++++++++---- .../Repositories/Commands/CommandRepository.cs | 6 +++--- .../Responses/Reports/CommandType11Response.cs | 1 + .../Responses/Reports/CommandType18Response.cs | 1 + 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs index d91a32dd..ef11e021 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs @@ -573,7 +573,8 @@ namespace BMA.EHR.Application.Repositories.Commands FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", PlacementCommandIssuer = r.Command.PlacementCommandIssuer, PlacementCommandNo = r.Command.PlacementCommandNo.ToThaiNumber(), - PlacementCommandDate = r.Command.PlacementCommandDate == null ? "" : r.Command.PlacementCommandDate.Value.ToThaiFullDate3().ToThaiNumber() + PlacementCommandDate = r.Command.PlacementCommandDate == null ? "" : r.Command.PlacementCommandDate.Value.ToThaiFullDate3().ToThaiNumber(), + Subject = $"เรื่อง {r.Command.CommandSubject}", }) .ToListAsync(); if (raw_data == null) @@ -608,7 +609,8 @@ namespace BMA.EHR.Application.Repositories.Commands FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", PlacementCommandIssuer = r.Command.PlacementCommandIssuer, PlacementCommandNo = r.Command.PlacementCommandNo.ToThaiNumber(), - PlacementCommandDate = r.Command.PlacementCommandDate == null ? "" : r.Command.PlacementCommandDate.Value.ToThaiFullDate3().ToThaiNumber() + PlacementCommandDate = r.Command.PlacementCommandDate == null ? "" : r.Command.PlacementCommandDate.Value.ToThaiFullDate3().ToThaiNumber(), + Subject = $"เรื่อง {r.Command.CommandSubject}", }) .ToListAsync(); if (raw_data == null) @@ -898,7 +900,8 @@ namespace BMA.EHR.Application.Repositories.Commands GuiltyBasis = r.Command.GuiltyBasis.ToThaiNumber(), ConclusionFireNo = r.Command!.ConclusionFireNo.ToThaiNumber(), ConclusionFireDate = r.Command.ConclusionFireDate == null ? "" : r.Command.ConclusionFireDate.Value.ToThaiFullDate3().ToThaiNumber(), - ConclusionFireResolution = r.Command.ConclusionFireResolution.ToThaiNumber() + ConclusionFireResolution = r.Command.ConclusionFireResolution.ToThaiNumber(), + Subject = $"เรื่อง {r.Command.CommandSubject}", }) .ToList(); @@ -952,7 +955,8 @@ namespace BMA.EHR.Application.Repositories.Commands GuiltyBasis = r.Command.GuiltyBasis.ToThaiNumber(), ConclusionFireNo = r.Command!.ConclusionFireNo.ToThaiNumber(), ConclusionFireDate = r.Command.ConclusionFireDate == null ? "" : r.Command.ConclusionFireDate.Value.ToThaiFullDate3().ToThaiNumber(), - ConclusionFireResolution = r.Command.ConclusionFireResolution.ToThaiNumber() + ConclusionFireResolution = r.Command.ConclusionFireResolution.ToThaiNumber(), + Subject = $"เรื่อง {r.Command.CommandSubject}", }) .ToList(); diff --git a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs index b22bfafd..55987cd8 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs @@ -6695,9 +6695,9 @@ namespace BMA.EHR.Application.Repositories.Commands Double MonthSalaryAmount = 0; if (profile != null && profile.Salaries.Count() > 0) { - SalaryAmount = placementProfile.Amount == null || placementProfile.Amount == 0 ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value : 0; - PositionSalaryAmount = placementProfile.PositionSalaryAmount == null || placementProfile.PositionSalaryAmount == 0 ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount.Value : 0; - MonthSalaryAmount = placementProfile.MouthSalaryAmount == null || placementProfile.MouthSalaryAmount == 0 ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().MouthSalaryAmount.Value : 0; + SalaryAmount = placementProfile.Amount == null || placementProfile.Amount == 0 ? (profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount != null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value : 0) : 0; + PositionSalaryAmount = placementProfile.PositionSalaryAmount == null || placementProfile.PositionSalaryAmount == 0 ? (profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount != null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount.Value : 0) : 0; + MonthSalaryAmount = placementProfile.MouthSalaryAmount == null || placementProfile.MouthSalaryAmount == 0 ? (profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().MouthSalaryAmount != null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().MouthSalaryAmount.Value : 0) : 0; } return new PlacementSalaryResponse diff --git a/BMA.EHR.Application/Responses/Reports/CommandType11Response.cs b/BMA.EHR.Application/Responses/Reports/CommandType11Response.cs index 7e45cdac..3e80b20d 100644 --- a/BMA.EHR.Application/Responses/Reports/CommandType11Response.cs +++ b/BMA.EHR.Application/Responses/Reports/CommandType11Response.cs @@ -23,5 +23,6 @@ public string PlacementCommandNo { get; set; } = string.Empty; public string PlacementCommandDate { get; set; } = string.Empty; + public string Subject { get; set; } = string.Empty; } } diff --git a/BMA.EHR.Application/Responses/Reports/CommandType18Response.cs b/BMA.EHR.Application/Responses/Reports/CommandType18Response.cs index 31636db8..49c6baab 100644 --- a/BMA.EHR.Application/Responses/Reports/CommandType18Response.cs +++ b/BMA.EHR.Application/Responses/Reports/CommandType18Response.cs @@ -39,5 +39,6 @@ public string ConclusionFireDate { get; set; } = string.Empty; public string ConclusionFireResolution { get; set; } = string.Empty; + public string Subject { get; set; } = string.Empty; } }