From d47df139edf3eaea5a67feb917ee4f25621093c2 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Fri, 7 Jun 2024 03:06:11 +0700 Subject: [PATCH 1/3] no message --- .../Commands/CommandRepository.cs | 576 +++++++++++++----- .../Reports/RetireReportRepository.cs | 2 + .../Responses/ProfileJsonRequest.cs | 58 +- .../Controllers/PlacementController.cs | 39 ++ .../Requests/PersonDateRequest.cs | 11 + .../Controllers/RetireReportController.cs | 35 +- .../Reports/31-ประกาศเกษียณข้าราชการ-1.trdp | Bin 28928 -> 29002 bytes .../Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp | Bin 28931 -> 29013 bytes BMA.EHR.Report.Service/appsettings.json | 6 +- 9 files changed, 532 insertions(+), 195 deletions(-) create mode 100644 BMA.EHR.Placement.Service/Requests/PersonDateRequest.cs diff --git a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs index 467a3857..b3c38680 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs @@ -2588,22 +2588,22 @@ namespace BMA.EHR.Application.Repositories.Commands await ExecuteCommand12Async(command); break; case "C-PM-13": - await ExecuteCommand13Async(command); + await ExecuteCommand13Async(command, token); break; case "C-PM-14": - await ExecuteCommand14Async(command); + await ExecuteCommand14Async(command, token); break; case "C-PM-15": - await ExecuteCommand15Async(command); + await ExecuteCommand15Async(command, token); break; case "C-PM-16": - await ExecuteCommand16Async(command); + await ExecuteCommand16Async(command, token); break; case "C-PM-17": - await ExecuteCommand17Async(command); + await ExecuteCommand17Async(command, token); break; case "C-PM-18": - await ExecuteCommand18Async(command); + await ExecuteCommand18Async(command, token); break; case "C-PM-19": await ExecuteCommand19Async(command, token); @@ -3785,7 +3785,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand05Async(Command command) + private async Task ExecuteCommand05Async(Command command, string token = "") { try { @@ -3842,6 +3842,31 @@ namespace BMA.EHR.Application.Repositories.Commands if (placementProfile == null) throw new Exception(GlobalMessages.DataNotFound); + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = placementProfile.profileId, + date = command.CommandAffectDate, + amount = placementProfile.Amount, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = placementProfile.posMasterNo, + position = placementProfile.position, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = placementProfile.posTypeName, + positionLevel = placementProfile.posLevelName, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งแต่งตั้ง คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // var profile = placementProfile.Profile; // if (profile != null) // { @@ -4041,7 +4066,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand06Async(Command command) + private async Task ExecuteCommand06Async(Command command, string token = "") { try { @@ -4098,6 +4123,31 @@ namespace BMA.EHR.Application.Repositories.Commands if (placementProfile == null) throw new Exception(GlobalMessages.DataNotFound); + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = placementProfile.profileId, + date = command.CommandAffectDate, + amount = placementProfile.Amount, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = placementProfile.posMasterNo, + position = placementProfile.position, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = placementProfile.posTypeName, + positionLevel = placementProfile.posLevelName, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งเลื่อน คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // var profile = placementProfile.Profile; // if (profile != null) // { @@ -4297,7 +4347,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand07Async(Command command) + private async Task ExecuteCommand07Async(Command command, string token = "") { try { @@ -4354,6 +4404,31 @@ namespace BMA.EHR.Application.Repositories.Commands if (placementProfile == null) throw new Exception(GlobalMessages.DataNotFound); + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = placementProfile.profileId, + date = command.CommandAffectDate, + amount = placementProfile.Amount, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = placementProfile.posMasterNo, + position = placementProfile.position, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = placementProfile.posTypeName, + positionLevel = placementProfile.posLevelName, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งย้าย คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // var profile = placementProfile.Profile; // if (profile != null) // { @@ -4553,7 +4628,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand08Async(Command command) + private async Task ExecuteCommand08Async(Command command, string token = "") { try { @@ -4623,6 +4698,31 @@ namespace BMA.EHR.Application.Repositories.Commands if (placementProfile == null) throw new Exception(GlobalMessages.DataNotFound); + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = placementProfile.profileId, + date = command.CommandAffectDate, + amount = placementProfile.Amount, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = placementProfile.posMasterNoOld, + position = placementProfile.PositionOld, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = placementProfile.posTypeNameOld, + positionLevel = placementProfile.posLevelNameOld, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งบรรจุและแต่งตั้งข้าราชการฯ กลับเข้ารับราชการ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // var profile = placementProfile.Profile; // if (profile != null) // { @@ -4808,7 +4908,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand09Async(Command command) + private async Task ExecuteCommand09Async(Command command, string token = "") { try { @@ -4878,6 +4978,31 @@ namespace BMA.EHR.Application.Repositories.Commands if (placementProfile == null) throw new Exception(GlobalMessages.DataNotFound); + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = placementProfile.profileId, + date = command.CommandAffectDate, + amount = placementProfile.Amount, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = placementProfile.posMasterNoOld, + position = placementProfile.PositionOld, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = placementProfile.posTypeNameOld, + positionLevel = placementProfile.posLevelNameOld, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งบรรจุและแต่งตั้งผู้ออกไปรับราชการทหารกลับเข้ารับราชการ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // var profile = placementProfile.Profile; // if (profile != null) // { @@ -5608,7 +5733,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand13Async(Command command) + private async Task ExecuteCommand13Async(Command command, string token = "") { try { @@ -5636,74 +5761,45 @@ namespace BMA.EHR.Application.Repositories.Commands if (data == null) throw new Exception(GlobalMessages.DataNotFound); - //data.Profile.IsActive = false; - //data.Profile.IsLeave = true; - //data.Profile.LeaveReason = "คำสั่งให้โอนข้าราชการกรุงเทพมหานครสามัญ"; - //data.Profile.LeaveDate = command.CommandAffectDate; + var baseAPI = _configuration["API"]; + var apiUrl = $"{baseAPI}/org/profile/leave/{data.profileId}"; - //var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); - //var order = 1; - //if (lastSarary != null && lastSarary.Order != null) - //order = lastSarary.Order.Value + 1; - - // var salary = new ProfileSalary - // { - // Order = order, - // Date = command.CommandAffectDate, - // Amount = lastSarary == null ? null : lastSarary.Amount, - // PositionSalaryAmount = lastSarary == null ? null : lastSarary.PositionSalaryAmount, - // MouthSalaryAmount = lastSarary == null ? null : lastSarary.MouthSalaryAmount, - // SalaryClass = "", - // SalaryRef = "คำสั่งให้โอนข้าราชการกรุงเทพมหานครสามัญ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", - - // OcId = lastSarary == null ? null : lastSarary.OcId, - - // PositionId = lastSarary == null ? null : lastSarary.PositionId, - - // PositionLevel = lastSarary == null ? null : lastSarary.PositionLevel, - // PositionLineId = lastSarary == null ? null : lastSarary.PositionLineId, - // PositionTypeId = lastSarary == null ? null : lastSarary.PositionTypeId, - // OrganizationShortNameId = lastSarary == null ? null : lastSarary.OrganizationShortNameId, - // PosNoId = lastSarary == null ? null : lastSarary.PosNoId, - - // CommandNo = $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()}", - // RefCommandNo = $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()}", - // CommandTypeName = command.CommandType.Name, - - - // PositionEmployeeGroupId = null, - // PositionEmployeeLevelId = null, - // PositionEmployeePositionId = null, - // PositionEmployeePositionSideId = null, - // PosNoEmployee = "", - - - // //PositionPathSideId = lastSarary == null ? null : lastSarary.PositionPathSideId == null, - // PositionExecutiveId = lastSarary == null ? null : lastSarary.PositionExecutiveId, - // //PositionExecutiveSideId = lastSarary == null ? null : lastSarary.PositionExecutiveSideId, - - // IsActive = true, - // CreatedAt = DateTime.Now, - // CreatedFullName = FullName ?? "System Administrator", - // CreatedUserId = UserId ?? "", - // LastUpdatedAt = DateTime.Now, - // LastUpdateFullName = FullName ?? "System Administrator", - // LastUpdateUserId = UserId ?? "", - - // }; - - // if (lastSarary != null && lastSarary.PositionPathSideId != null) salary.PositionPathSideId = lastSarary.PositionPathSideId; - // if (lastSarary != null && lastSarary.PositionExecutiveSideId != null) salary.PositionExecutiveSideId = lastSarary.PositionExecutiveSideId; - - // data.Profile.Salaries.Add(salary); - - // // remove profile position - // var profilePosition = await _dbContext.Set() - // .Include(x => x.Profile) - // .Include(x => x.OrganizationPosition) - // .FirstOrDefaultAsync(x => x.Profile!.Id == data.Id); - // if (profilePosition != null) - // _dbContext.Set().Remove(profilePosition); + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); + var _res = await client.PostAsJsonAsync(apiUrl, new + { + isLeave = true, + leaveReason = "คำสั่งให้โอนข้าราชการกรุงเทพมหานครสามัญ", + leaveDate = command.CommandAffectDate, + }); + var _result = await _res.Content.ReadAsStringAsync(); + } + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = data.profileId, + date = command.CommandAffectDate, + amount = data.AmountOld, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = data.PositionNumberOld, + position = data.PositionOld, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = data.PositionLevelOld, + positionLevel = data.PositionLevelOld, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งให้โอนข้าราชการกรุงเทพมหานครสามัญ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // // update placementstatus data.Status = "DONE"; @@ -5793,7 +5889,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand14Async(Command command) + private async Task ExecuteCommand14Async(Command command, string token = "") { try { @@ -5870,6 +5966,32 @@ namespace BMA.EHR.Application.Repositories.Commands if (placementProfile == null) throw new Exception("Invalid placement profile: " + recv.RefPlacementProfileId); + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = placementProfile.profileId, + date = command.CommandAffectDate, + amount = placementProfile.Amount, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = placementProfile.posMasterNo, + position = placementProfile.position, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = placementProfile.posTypeName, + positionLevel = placementProfile.posLevelName, + refCommandNo = command.CommandNo, + templateDoc = "รับโอนข้าราชการกรุงเทพมหานครสามัญ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } + // // ใส่ฟีลจากข้อมูล // var profile = new Profile // { @@ -6143,7 +6265,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand15Async(Command command) + private async Task ExecuteCommand15Async(Command command, string token = "") { try { @@ -6174,15 +6296,31 @@ namespace BMA.EHR.Application.Repositories.Commands if (data == null) throw new Exception(GlobalMessages.DataNotFound); - //data.Profile.IsActive = false; - //data.Profile.IsLeave = true; - //data.Profile.LeaveReason = "ลาออกจากราชการ"; - //data.Profile.LeaveDate = command.CommandAffectDate; - - //var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); - // var order = 1; - // if (lastSarary != null && lastSarary.Order != null) - // order = lastSarary.Order.Value + 1; + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = data.profileId, + date = command.CommandAffectDate, + amount = data.AmountOld, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = data.PositionNumberOld, + position = data.PositionOld, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = data.PositionLevelOld, + positionLevel = data.PositionLevelOld, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งให้ช่วยราชการ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // var salary = new ProfileSalary // { @@ -6323,7 +6461,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand16Async(Command command) + private async Task ExecuteCommand16Async(Command command, string token = "") { try { @@ -6354,66 +6492,31 @@ namespace BMA.EHR.Application.Repositories.Commands if (data == null) throw new Exception(GlobalMessages.DataNotFound); - //data.Profile.IsActive = false; - //data.Profile.IsLeave = true; - //data.Profile.LeaveReason = "ลาออกจากราชการ"; - //data.Profile.LeaveDate = command.CommandAffectDate; - - // var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); - // var order = 1; - // if (lastSarary != null && lastSarary.Order != null) - // order = lastSarary.Order.Value + 1; - - // var salary = new ProfileSalary - // { - // Order = order, - // Date = command.CommandAffectDate, - // Amount = lastSarary == null ? null : lastSarary.Amount, - // PositionSalaryAmount = lastSarary == null ? null : lastSarary.PositionSalaryAmount, - // MouthSalaryAmount = lastSarary == null ? null : lastSarary.MouthSalaryAmount, - // SalaryClass = "", - // SalaryRef = "คำสั่งส่งตัวกลับ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", - - // OcId = lastSarary == null ? null : lastSarary.OcId, - - // PositionId = lastSarary == null ? null : lastSarary.PositionId, - - // PositionLevel = lastSarary == null ? null : lastSarary.PositionLevel, - // PositionLineId = lastSarary == null ? null : lastSarary.PositionLineId, - // PositionTypeId = lastSarary == null ? null : lastSarary.PositionTypeId, - // OrganizationShortNameId = lastSarary == null ? null : lastSarary.OrganizationShortNameId, - // PosNoId = lastSarary == null ? null : lastSarary.PosNoId, - - // CommandNo = $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()}", - // RefCommandNo = $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()}", - // CommandTypeName = command.CommandType.Name, - - - // PositionEmployeeGroupId = null, - // PositionEmployeeLevelId = null, - // PositionEmployeePositionId = null, - // PositionEmployeePositionSideId = null, - // PosNoEmployee = "", - - - // //PositionPathSideId = lastSarary == null ? null : lastSarary.PositionPathSideId == null, - // PositionExecutiveId = lastSarary == null ? null : lastSarary.PositionExecutiveId, - // //PositionExecutiveSideId = lastSarary == null ? null : lastSarary.PositionExecutiveSideId, - - // IsActive = true, - // CreatedAt = DateTime.Now, - // CreatedFullName = FullName ?? "System Administrator", - // CreatedUserId = UserId ?? "", - // LastUpdatedAt = DateTime.Now, - // LastUpdateFullName = FullName ?? "System Administrator", - // LastUpdateUserId = UserId ?? "", - - // }; - - // if (lastSarary != null && lastSarary.PositionPathSideId != null) salary.PositionPathSideId = lastSarary.PositionPathSideId; - // if (lastSarary != null && lastSarary.PositionExecutiveSideId != null) salary.PositionExecutiveSideId = lastSarary.PositionExecutiveSideId; - - // data.Profile.Salaries.Add(salary); + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = data.profileId, + date = command.CommandAffectDate, + amount = data.AmountOld, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = data.PositionNumberOld, + position = data.PositionOld, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = data.PositionLevelOld, + positionLevel = data.PositionLevelOld, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งส่งตัวกลับ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // update placementstatus data.Status = "DONE"; @@ -6503,7 +6606,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand17Async(Command command) + private async Task ExecuteCommand17Async(Command command, string token = "") { try { @@ -6535,11 +6638,50 @@ namespace BMA.EHR.Application.Repositories.Commands if (data == null) throw new Exception(GlobalMessages.DataNotFound); - // data.Profile.IsActive = false; - // data.Profile.IsLeave = true; - // data.Profile.LeaveReason = "ลาออกจากราชการ"; - // data.Profile.LeaveDate = command.CommandAffectDate; + //// data.Profile.IsActive = false; + //// data.Profile.IsLeave = true; + //// data.Profile.LeaveReason = "ลาออกจากราชการ"; + //// data.Profile.LeaveDate = command.CommandAffectDate; + var baseAPI = _configuration["API"]; + var apiUrl = $"{baseAPI}/org/profile/leave/{data.profileId}"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); + var _res = await client.PostAsJsonAsync(apiUrl, new + { + isLeave = true, + leaveReason = "ลาออกจากราชการ", + leaveDate = command.CommandAffectDate, + }); + var _result = await _res.Content.ReadAsStringAsync(); + } + + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = data.profileId, + date = command.CommandAffectDate, + amount = data.AmountOld, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = data.PositionNumberOld, + position = data.PositionOld, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = data.PositionTypeOld, + positionLevel = data.PositionLevelOld, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งอนุญาตให้ข้าราชการลาออกจากราชการ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); // var order = 1; // if (lastSarary != null && lastSarary.Order != null) @@ -6692,7 +6834,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand18Async(Command command) + private async Task ExecuteCommand18Async(Command command, string token = "") { try { @@ -6723,11 +6865,50 @@ namespace BMA.EHR.Application.Repositories.Commands if (data == null) throw new Exception(GlobalMessages.DataNotFound); - // data.Profile.IsActive = false; - // data.Profile.IsLeave = true; - // data.Profile.LeaveReason = "ได้รับโทษทางวินัย ให้ออกจากราชการ"; - // data.Profile.LeaveDate = command.CommandAffectDate; + //// data.Profile.IsActive = false; + //// data.Profile.IsLeave = true; + //// data.Profile.LeaveReason = "ได้รับโทษทางวินัย ให้ออกจากราชการ"; + //// data.Profile.LeaveDate = command.CommandAffectDate; + var baseAPI = _configuration["API"]; + var apiUrl = $"{baseAPI}/org/profile/leave/{data.profileId}"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); + var _res = await client.PostAsJsonAsync(apiUrl, new + { + isLeave = true, + leaveReason = "ได้รับโทษทางวินัย ให้ออกจากราชการ", + leaveDate = command.CommandAffectDate, + }); + var _result = await _res.Content.ReadAsStringAsync(); + } + + var apiUrlSalary = $"{baseAPI}/org/profile/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileId = data.profileId, + date = command.CommandAffectDate, + amount = data.AmountOld, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = data.PositionNumberOld, + position = data.PositionOld, + positionLine = "", + positionPathSide = "", + positionExecutive = "", + positionType = data.PositionTypeOld, + positionLevel = data.PositionLevelOld, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งให้ออกจากราชการ คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); // var order = 1; // if (lastSarary != null && lastSarary.Order != null) @@ -7471,7 +7652,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand22Async(Command command) + private async Task ExecuteCommand22Async(Command command, string token = "") { try { @@ -7522,6 +7703,28 @@ namespace BMA.EHR.Application.Repositories.Commands if (data == null) throw new Exception(GlobalMessages.DataNotFound); + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile-employee/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileEmployeeId = data.profileId, + date = command.CommandAffectDate, + amount = data.Amount, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = data.posMasterNo, + position = data.position, + positionType = data.posTypeName, + positionLevel = data.posLevelName, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งแต่งตั้งลูกจ้างประจำ(ปรับระดับชั้นงาน) คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // // data.Profile.PositionEmployeeLine = data.PositionEmployeeLine; // // data.Profile.PositionEmployeePosition = data.PositionEmployeePosition; // data.Profile.PositionEmployeePosition = data.OrgEmployee == null ? null : data.OrgEmployee!.PositionEmployeePosition; @@ -7666,7 +7869,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand23Async(Command command) + private async Task ExecuteCommand23Async(Command command, string token = "") { try { @@ -7698,10 +7901,25 @@ namespace BMA.EHR.Application.Repositories.Commands if (data == null) throw new Exception(GlobalMessages.DataNotFound); - // data.Profile.IsActive = false; - // data.Profile.IsLeave = true; - // data.Profile.LeaveReason = "ลาออกจากราชการ"; - // data.Profile.LeaveDate = command.CommandAffectDate; + //// data.Profile.IsActive = false; + //// data.Profile.IsLeave = true; + //// data.Profile.LeaveReason = "ลาออกจากราชการ"; + //// data.Profile.LeaveDate = command.CommandAffectDate; + var baseAPI = _configuration["API"]; + var apiUrl = $"{baseAPI}/org/profile-employee/salary/{data.profileId}"; + + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Put, apiUrl); + var _res = await client.PostAsJsonAsync(apiUrl, new + { + isLeave = true, + leaveReason = "ลาออกจากราชการ", + leaveDate = command.CommandAffectDate, + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); // var order = 1; @@ -7846,7 +8064,7 @@ namespace BMA.EHR.Application.Repositories.Commands /// /// object ของรายการคำสั่ง /// - private async Task ExecuteCommand24Async(Command command) + private async Task ExecuteCommand24Async(Command command, string token = "") { try { @@ -7897,6 +8115,28 @@ namespace BMA.EHR.Application.Repositories.Commands if (data == null) throw new Exception(GlobalMessages.DataNotFound); + var baseAPI = _configuration["API"]; + var apiUrlSalary = $"{baseAPI}/org/profile-employee/salary"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); + var _res = await client.PostAsJsonAsync(apiUrlSalary, new + { + profileEmployeeId = data.profileId, + date = command.CommandAffectDate, + amount = data.Amount, + positionSalaryAmount = 0, + mouthSalaryAmount = 0, + posNo = data.posMasterNo, + position = data.position, + positionType = data.posTypeName, + positionLevel = data.posLevelName, + refCommandNo = command.CommandNo, + templateDoc = "คำสั่งแต่งตั้งลูกจ้างประจำ(ย้าย) คำสั่ง" + command.IssuerOrganizationName + "ที่ " + $"{command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate!.Value.ToThaiFullDate3()}", + }); + var _result = await _res.Content.ReadAsStringAsync(); + } // // data.Profile.PositionEmployeeLine = data.PositionEmployeeLine; // // data.Profile.PositionEmployeePosition = data.PositionEmployeePosition; // data.Profile.PositionEmployeePosition = data.OrgEmployee == null ? null : data.OrgEmployee!.PositionEmployeePosition; diff --git a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs index 143d3d10..a18c1ed0 100644 --- a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs @@ -241,6 +241,7 @@ namespace BMA.EHR.Application.Repositories.Reports // p.Profile.PositionExecutiveId, // Organization = p.Profile.Oc, // OrganizationId = p.Profile.OcId, + p.position, p.Number, p.Date, p.Location, @@ -282,6 +283,7 @@ namespace BMA.EHR.Application.Repositories.Reports data.Number, data.Location, data.Reason, + Position = data.position, }; } #endregion diff --git a/BMA.EHR.Application/Responses/ProfileJsonRequest.cs b/BMA.EHR.Application/Responses/ProfileJsonRequest.cs index 6c19f255..84d9c97a 100644 --- a/BMA.EHR.Application/Responses/ProfileJsonRequest.cs +++ b/BMA.EHR.Application/Responses/ProfileJsonRequest.cs @@ -6,19 +6,55 @@ public Guid id { get; set; } public string reason { get; set; } public string remove { get; set; } - public Guid profileId { get; set; } - public string? citizenId { get; set; } + // public Guid profileId { get; set; } + // public string? citizenId { get; set; } + // public string? prefix { get; set; } + // public string? fullName { get; set; } + // public string? organizationOrganization { get; set; } + // public string? oc { get; set; } + // public string? position { get; set; } + // public string? positionType { get; set; } + // public string? positionExecutive { get; set; } + // public string? posNo { get; set; } + // public string? positionEmployeePosition { get; set; } + // public string? positionEmployeeLevel { get; set; } + // public string? positionEmployeeGroup { get; set; } + // public string? posNoEmployee { get; set; } + // public string? organizationAgency { get; set; } + // public string? organizationGovernmentAgency { get; set; } + public string? profileId { get; set; } public string? prefix { get; set; } - public string? fullName { get; set; } - public string? organizationOrganization { get; set; } - public string? oc { get; set; } + public string? firstName { get; set; } + public string? lastName { get; set; } + public string? citizenId { get; set; } + public string? root { get; set; } + public string? rootId { get; set; } + public string? rootShortName { get; set; } + public string? child1 { get; set; } + public string? child1Id { get; set; } + public string? child1ShortName { get; set; } + public string? child2 { get; set; } + public string? child2Id { get; set; } + public string? child2ShortName { get; set; } + public string? child3 { get; set; } + public string? child3Id { get; set; } + public string? child3ShortName { get; set; } + public string? child4 { get; set; } + public string? child4Id { get; set; } + public string? child4ShortName { get; set; } + // public string? node { get; set; } + // public string? nodeId { get; set; } + // public string? nodeShortName { get; set; } + public int? posMasterNo { get; set; } public string? position { get; set; } - public string? positionType { get; set; } - public string? positionExecutive { get; set; } + public string? posTypeId { get; set; } + public string? posTypeName { get; set; } + public int? posTypeRank { get; set; } + public string? posLevelId { get; set; } + public string? posLevelName { get; set; } + public int? posLevelRank { get; set; } + public string? posExecutiveId { get; set; } + public string? posExecutiveName { get; set; } public string? posNo { get; set; } - public string? positionEmployeePosition { get; set; } - public string? positionEmployeeLevel { get; set; } - public string? positionEmployeeGroup { get; set; } - public string? posNoEmployee { get; set; } } } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index de8edb4d..71103626 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -1065,6 +1065,31 @@ namespace BMA.EHR.Placement.Service.Controllers .FirstOrDefaultAsync(x => x.Id == personalId); if (profile == null) return Error(GlobalMessages.DataNotFound, 404); + + profile.root = null; + profile.rootId = null; + profile.rootShortName = null; + profile.child1 = null; + profile.child1Id = null; + profile.child1ShortName = null; + profile.child2 = null; + profile.child2Id = null; + profile.child2ShortName = null; + profile.child3 = null; + profile.child3Id = null; + profile.child3ShortName = null; + profile.child4 = null; + profile.child4Id = null; + profile.child4ShortName = null; + profile.orgRevisionId = null; + profile.posMasterNo = null; + profile.positionName = null; + profile.positionField = null; + profile.posTypeId = null; + profile.posTypeName = null; + profile.posLevelId = null; + profile.posLevelName = null; + profile.OrganizationPosition = null; profile.PositionNumber = null; profile.PositionPath = null; @@ -1087,6 +1112,20 @@ namespace BMA.EHR.Placement.Service.Controllers return Success(); } + + [HttpPut("date/update/{personalId:length(36)}")] + public async Task> UpdateDateDraft([FromBody] PersonDateRequest req, Guid personalId) + { + var profile = await _context.PlacementProfiles + .FirstOrDefaultAsync(x => x.Id == personalId); + if (profile == null) + return Error(GlobalMessages.DataNotFound, 404); + profile.ReportingDate = req.Date; + _context.SaveChanges(); + + return Success(); + } + [HttpGet("user/{personalId:length(36)}")] public async Task> GetUserByOrganization(Guid personalId) { diff --git a/BMA.EHR.Placement.Service/Requests/PersonDateRequest.cs b/BMA.EHR.Placement.Service/Requests/PersonDateRequest.cs new file mode 100644 index 00000000..11e16079 --- /dev/null +++ b/BMA.EHR.Placement.Service/Requests/PersonDateRequest.cs @@ -0,0 +1,11 @@ +using BMA.EHR.Domain.Models.MetaData; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Placement.Service.Requests +{ + public class PersonDateRequest + { + public DateTime? Date { get; set; } + + } +} \ No newline at end of file diff --git a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs index e550341c..311386b9 100644 --- a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs +++ b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs @@ -108,7 +108,7 @@ namespace BMA.EHR.Report.Service.Controllers var tmpOc1 = string.Empty; foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire)) { - var tmpOc2 = profile.GetType().GetProperty("oc").GetValue(profile); + var tmpOc2 = profile.GetType().GetProperty("root").GetValue(profile); if (tmpOc1 != tmpOc2) { _count = 1; @@ -125,23 +125,31 @@ namespace BMA.EHR.Report.Service.Controllers count = $"{_count.ToString().ToThaiNumber()}.", no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.", order = thaiOrder, - oc = string.IsNullOrEmpty(profile.GetType().GetProperty("oc").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("oc").GetValue(profile), - fullName = string.IsNullOrEmpty(profile.GetType().GetProperty("fullName").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("fullName").GetValue(profile), - 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), - reason = string.IsNullOrEmpty(profile.GetType().GetProperty("reason").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("reason").GetValue(profile), + organizationOrganization = (profile.GetType().GetProperty("child4").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child4").GetValue(profile) + "/") + + (profile.GetType().GetProperty("child3").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child3").GetValue(profile) + "/") + + (profile.GetType().GetProperty("child2").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child2").GetValue(profile) + "/") + + (profile.GetType().GetProperty("child1").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child1").GetValue(profile) + "/") + + (profile.GetType().GetProperty("root").GetValue(profile) == null ? "" : profile.GetType().GetProperty("root").GetValue(profile)), + fullName = $"{profile.GetType().GetProperty("prefix").GetValue(profile)}{profile.GetType().GetProperty("firstName").GetValue(profile)} {profile.GetType().GetProperty("lastName").GetValue(profile)}", + position = profile.GetType().GetProperty("position").GetValue(profile), + posNo = profile.GetType().GetProperty("posMasterNo").GetValue(profile), + oc = profile.GetType().GetProperty("root").GetValue(profile), + positionEmployeePosition = profile.GetType().GetProperty("position").GetValue(profile), + posNoEmployee = profile.GetType().GetProperty("posMasterNo").GetValue(profile), + reason = profile.GetType().GetProperty("reason").GetValue(profile), }); } + //Binding Data 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); - report.ReportParameters["Detail"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Detail").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Detail").GetValue(retire); - report.DataSource = _profileList; + // report.ReportParameters["Year"].Value = retire.GetType().GetProperty("year").GetValue(retire); + // report.ReportParameters["Total"].Value = retire.GetType().GetProperty("total").GetValue(retire); + // report.ReportParameters["Detail"].Value = retire.GetType().GetProperty("detail").GetValue(retire); + // report.DataSource = _profileList; + report.DataSource = retire; + var tblProfile = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["table1"]; + tblProfile.DataSource = _profileList; } else { @@ -149,6 +157,7 @@ namespace BMA.EHR.Report.Service.Controllers var tblProfile = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["table1"]; tblProfile.DataSource = _profileList; } + // return Success(retire); System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); InstanceReportSource instanceReportSource = new InstanceReportSource() { diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp index d0b859668204c14b4ff5961dd0538c057fd1b121..a23454a67ceb86ec4494a58bf5e55123fe962e05 100644 GIT binary patch delta 1849 zcmV-92gdk-;sMIy0S-`00|XQR000O8gcZkFu?~`G4uloQSg-#zN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(pd%o00S74+;A=gbskJtlMZnj0XLH=aV7>PZ~y=R E09{*6VgLXD diff --git a/BMA.EHR.Report.Service/appsettings.json b/BMA.EHR.Report.Service/appsettings.json index 6c56493d..056e86bb 100644 --- a/BMA.EHR.Report.Service/appsettings.json +++ b/BMA.EHR.Report.Service/appsettings.json @@ -14,12 +14,12 @@ "AllowedHosts": "*", "ConnectionStrings": { //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", - "DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", - "ExamConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", - "Issuer": "https://identity.frappet.com/realms/bma-ehr" + "Issuer": "https://id.frappet.synology.me/realms/bma-ehr" }, "EPPlus": { "ExcelPackage": { From 206ce4b2b1a4156c11e32d7cc5368b5abb863601 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 7 Jun 2024 15:26:05 +0700 Subject: [PATCH 2/3] add profileId --- .../Controllers/PlacementReceiveController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index 4c2c8626..cec8796e 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -165,6 +165,7 @@ namespace BMA.EHR.Placement.Service.Controllers p.posLevelOldId, p.posLevelNameOld, p.CreatedAt, + p.profileId, }) .ToListAsync(); // if (PlacementAdmin == true) From b7fd1b38a623fe5b818a0bb6ebe0b791655509ee Mon Sep 17 00:00:00 2001 From: Kittapath Date: Fri, 7 Jun 2024 15:47:06 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repositories/Reports/RetireReportRepository.cs | 5 +++-- BMA.EHR.Report.Service/Controllers/RetireReportController.cs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs index a18c1ed0..d7d26408 100644 --- a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs @@ -69,7 +69,7 @@ namespace BMA.EHR.Application.Repositories.Reports var retire = await _dbContext.Set() .Include(x => x.RetirementProfiles) .FirstOrDefaultAsync(x => x.Id == retireId); - var retires = new List(); + // var retires = new List(); if (retire == null) { var retireHistorys = await _dbContext.Set().AsQueryable() @@ -126,6 +126,7 @@ namespace BMA.EHR.Application.Repositories.Reports else { var profile_retire = await _dbContext.Set() + .Include(x => x.RetirementPeriod) .Where(x => x.RetirementPeriod == retire && (retire.TypeReport == null || retire.TypeReport == x.Remove)) .OrderBy(x => x.Order) .Select(x => new @@ -193,7 +194,7 @@ namespace BMA.EHR.Application.Repositories.Reports // retires.Add(data); // } - return new { retire.Detail, retire.Id, retire.CreatedAt, Year = retire.Year.ToThaiYear().ToString().ToThaiNumber(), retire.Round, retire.Type, retire.TypeReport, Total = profile_retire.Count.ToString().ToThaiNumber(), profile = retires }; + return new { retire.Detail, retire.Id, retire.CreatedAt, Year = retire.Year.ToThaiYear().ToString().ToThaiNumber(), retire.Round, retire.Type, retire.TypeReport, Total = profile_retire.Count.ToString().ToThaiNumber(), profile = profile_retire }; } } #endregion diff --git a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs index 311386b9..6b3ca3d7 100644 --- a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs +++ b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs @@ -157,7 +157,6 @@ namespace BMA.EHR.Report.Service.Controllers var tblProfile = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["table1"]; tblProfile.DataSource = _profileList; } - // return Success(retire); System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); InstanceReportSource instanceReportSource = new InstanceReportSource() {