From e947f08f8e8b982f35a87555240bc73caa949aa0 Mon Sep 17 00:00:00 2001 From: moss <> Date: Thu, 3 Apr 2025 11:13:25 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=AA=E0=B8=96?= =?UTF-8?q?=E0=B9=88=E0=B8=99=E0=B8=B0=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84?= =?UTF-8?q?=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DisciplineResultController.cs | 24 +++++++++---------- .../Requests/ReportPersonRequest.cs | 1 + .../PlacementAppointmentController.cs | 10 ++++---- .../Controllers/PlacementController.cs | 12 +++++----- .../Controllers/PlacementOfficerController.cs | 4 ++-- .../Controllers/PlacementReceiveController.cs | 2 +- .../PlacementRepatriationController.cs | 2 +- .../PlacementTransferController.cs | 2 +- .../Requests/ReportPersonRequest.cs | 1 + .../Controllers/RetirementOtherController.cs | 4 ++-- .../Controllers/RetirementOutController.cs | 4 ++-- .../Controllers/RetirementResignController.cs | 19 +++++++++++---- .../RetirementResignEmployeeController.cs | 13 ++++++++-- .../Requests/ReportPersonRequest.cs | 1 + 14 files changed, 60 insertions(+), 39 deletions(-) diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs index c38dea13..1b8ae559 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs @@ -294,7 +294,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers // continue; // uppdated.CommandTypeId = commandTypeId; - // uppdated.Status = "REPORT"; + // uppdated.Status = req.status.Trim().ToUpper(); // uppdated.LastUpdateFullName = FullName ?? "System Administrator"; // uppdated.LastUpdateUserId = UserId ?? ""; // uppdated.LastUpdatedAt = DateTime.Now; @@ -769,7 +769,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.Status = "REPORT"); + data.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -898,7 +898,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.Status = "REPORT"); + data.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -1029,7 +1029,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineReport_Profiles .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.Status = "REPORT"); + data.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -1209,7 +1209,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineReport_Profiles .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.Status = "REPORT"); + data.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -1327,7 +1327,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.Status = "REPORT"); + data.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -1443,7 +1443,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.Status = "REPORT"); + data.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -1559,7 +1559,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.Status = "REPORT"); + data.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -1675,7 +1675,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.Status = "REPORT"); + data.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -1791,7 +1791,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.Status = "REPORT"); + data.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -1908,12 +1908,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data1.ForEach(profile => profile.IsReport = "REPORT"); + data1.ForEach(profile => profile.IsReport = req.status.Trim().ToUpper()); var data2 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data2.ForEach(profile => profile.IsReport = "REPORT"); + data2.ForEach(profile => profile.IsReport = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); diff --git a/BMA.EHR.Discipline.Service/Requests/ReportPersonRequest.cs b/BMA.EHR.Discipline.Service/Requests/ReportPersonRequest.cs index f393a864..b8d37c24 100644 --- a/BMA.EHR.Discipline.Service/Requests/ReportPersonRequest.cs +++ b/BMA.EHR.Discipline.Service/Requests/ReportPersonRequest.cs @@ -6,5 +6,6 @@ namespace BMA.EHR.Discipline.Service.Requests public class ReportPersonRequest { public string[] refIds { get; set; } + public string status { get; set; } } } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index 380f223a..2ff52c69 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -759,7 +759,7 @@ namespace BMA.EHR.Placement.Service.Controllers .ToListAsync(); placementProfiles.ForEach(profile => { - profile.Status = "REPORT"; + profile.Status = req.status.Trim().ToUpper(); profile.typeCommand = "APPOINT"; }); await _context.SaveChangesAsync(); @@ -969,7 +969,7 @@ namespace BMA.EHR.Placement.Service.Controllers .ToListAsync(); placementProfiles.ForEach(profile => { - profile.Status = "REPORT"; + profile.Status = req.status.Trim().ToUpper(); profile.typeCommand = "MOVE"; }); await _context.SaveChangesAsync(); @@ -1180,7 +1180,7 @@ namespace BMA.EHR.Placement.Service.Controllers .ToListAsync(); placementProfiles.ForEach(profile => { - profile.Status = "REPORT"; + profile.Status = req.status.Trim().ToUpper(); profile.typeCommand = "SLIP"; }); await _context.SaveChangesAsync(); @@ -1380,7 +1380,7 @@ namespace BMA.EHR.Placement.Service.Controllers .ToListAsync(); placementProfiles.ForEach(profile => { - profile.Status = "REPORT"; + profile.Status = req.status.Trim().ToUpper(); profile.typeCommand = "MOVE"; }); await _context.SaveChangesAsync(); @@ -1588,7 +1588,7 @@ namespace BMA.EHR.Placement.Service.Controllers .ToListAsync(); placementProfiles.ForEach(profile => { - profile.Status = "REPORT"; + profile.Status = req.status.Trim().ToUpper(); profile.typeCommand = "SLIP"; }); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index 39a72123..eb07ddf3 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -1564,7 +1564,7 @@ namespace BMA.EHR.Placement.Service.Controllers .ToListAsync(); placementProfiles.ForEach(profile => { - profile.PlacementStatus = "REPORT"; + profile.PlacementStatus = req.status.Trim().ToUpper(); profile.typeCommand = "APPOINT"; }); await _context.SaveChangesAsync(); @@ -1895,7 +1895,7 @@ namespace BMA.EHR.Placement.Service.Controllers .ToListAsync(); placementProfiles.ForEach(profile => { - profile.PlacementStatus = "REPORT"; + profile.PlacementStatus = req.status.Trim().ToUpper(); profile.typeCommand = "APPOINT"; }); await _context.SaveChangesAsync(); @@ -2219,10 +2219,10 @@ namespace BMA.EHR.Placement.Service.Controllers // .Where(x => x.Placement!.PlacementType!.Name == "แต่งตั้งข้าราชการ") // .Where(x => x.typeCommand.Trim().ToUpper() == "APPOIN") .ToListAsync(); - placementProfiles.ForEach(profile => profile.PlacementStatus = "REPORT"); + placementProfiles.ForEach(profile => profile.PlacementStatus = req.status.Trim().ToUpper()); placementProfiles.ForEach(profile => { - profile.PlacementStatus = "REPORT"; + profile.PlacementStatus = req.status.Trim().ToUpper(); profile.typeCommand = "APPOIN"; }); @@ -2455,7 +2455,7 @@ namespace BMA.EHR.Placement.Service.Controllers .ToListAsync(); placementProfiles.ForEach(profile => { - profile.PlacementStatus = "REPORT"; + profile.PlacementStatus = req.status.Trim().ToUpper(); profile.typeCommand = "MOVE"; }); await _context.SaveChangesAsync(); @@ -2681,7 +2681,7 @@ namespace BMA.EHR.Placement.Service.Controllers var placementProfiles = await _context.PlacementProfiles .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.PlacementStatus = "REPORT"); + placementProfiles.ForEach(profile => profile.PlacementStatus = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index d56e4744..a84aec2c 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -411,7 +411,7 @@ namespace BMA.EHR.Placement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - placementOfficer.OrganizationPositionOld = org.result.position + "\n" + (placementOfficer.PositionExecutiveOld == null ? "" : placementOfficer.PositionExecutiveOld + "\n") + placementOfficer.OrganizationOld; + placementOfficer.OrganizationPositionOld = org.result.position + "\n" + (placementOfficer.PositionExecutiveOld == null ? "" : placementOfficer.PositionExecutiveOld + "\n") + placementOfficer.OrganizationOld; } await _context.PlacementOfficers.AddAsync(placementOfficer); await _context.SaveChangesAsync(); @@ -561,7 +561,7 @@ namespace BMA.EHR.Placement.Service.Controllers var placementProfiles = await _context.PlacementOfficers .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index 4d61fc21..e4a39d58 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -885,7 +885,7 @@ namespace BMA.EHR.Placement.Service.Controllers var placementProfiles = await _context.PlacementReceives .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index 5f8275e4..8b3b4a9c 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -500,7 +500,7 @@ namespace BMA.EHR.Placement.Service.Controllers var placementProfiles = await _context.PlacementRepatriations .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index 27c08a88..d38ba020 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -752,7 +752,7 @@ namespace BMA.EHR.Placement.Service.Controllers var placementProfiles = await _context.PlacementTransfers .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } diff --git a/BMA.EHR.Placement.Service/Requests/ReportPersonRequest.cs b/BMA.EHR.Placement.Service/Requests/ReportPersonRequest.cs index e061f5a1..c345f6bf 100644 --- a/BMA.EHR.Placement.Service/Requests/ReportPersonRequest.cs +++ b/BMA.EHR.Placement.Service/Requests/ReportPersonRequest.cs @@ -6,5 +6,6 @@ namespace BMA.EHR.Placement.Service.Requests public class ReportPersonRequest { public string[] refIds { get; set; } + public string status { get; set; } } } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index 110aa01b..6152ec16 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -660,7 +660,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var placementProfiles = await _context.RetirementOthers .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -880,7 +880,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var placementProfiles = await _context.RetirementOthers .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index 0a620b07..db256dfe 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -363,7 +363,7 @@ namespace BMA.EHR.Retirement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - retirementOut.OrganizationPositionOld = org.result.position + "\n" + (retirementOut.PositionExecutiveOld == null ? "" : retirementOut.PositionExecutiveOld + "\n") + retirementOut.OrganizationOld; + retirementOut.OrganizationPositionOld = org.result.position + "\n" + (retirementOut.PositionExecutiveOld == null ? "" : retirementOut.PositionExecutiveOld + "\n") + retirementOut.OrganizationOld; retirementOut.AmountOld = org.result.salary; } } @@ -513,7 +513,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var placementProfiles = await _context.RetirementResigns .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index 28c379a7..8e617dd2 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -948,7 +948,7 @@ namespace BMA.EHR.Retirement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - retirementResign.OrganizationPositionOld = org.result.position + "\n" + (retirementResign.PositionExecutiveOld == null ? "" : retirementResign.PositionExecutiveOld + "\n") + retirementResign.OrganizationOld; + retirementResign.OrganizationPositionOld = org.result.position + "\n" + (retirementResign.PositionExecutiveOld == null ? "" : retirementResign.PositionExecutiveOld + "\n") + retirementResign.OrganizationOld; } await _context.RetirementResigns.AddAsync(retirementResign); await _context.SaveChangesAsync(); @@ -1159,7 +1159,7 @@ namespace BMA.EHR.Retirement.Service.Controllers if (updated == null) return Error(GlobalMessages.RetirementResignNotFound, 404); updated.CancelReason = req.Reason; - if (updated.Status == "DONE") + if (updated.Status == "DONE" || updated.Status == "WAITTING") { var retirementResignCancel = new RetirementResignCancel { @@ -1246,6 +1246,15 @@ namespace BMA.EHR.Retirement.Service.Controllers } updated.IsCancel = true; } + else + { + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel17/{updated.Id}"); + } + } updated.Status = "CANCEL"; updated.LastUpdateFullName = FullName ?? "System Administrator"; updated.LastUpdateUserId = UserId ?? ""; @@ -2116,7 +2125,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var placementProfiles = await _context.RetirementResigns .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -2302,7 +2311,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var placementProfiles = await _context.RetirementResignCancels .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -2357,7 +2366,7 @@ namespace BMA.EHR.Retirement.Service.Controllers FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", PositionName = p.PositionOld ?? "-", Organization = p.OrganizationPositionOld ?? "-", - Oc = (p.PositionOld == null ? "" : $"{p.PositionOld}\n") + + Oc = (p.PositionOld == null ? "" : $"{p.PositionOld}\n") + (p.PositionExecutiveOld == null ? "" : $"{p.PositionExecutiveOld}\n") + (p.child4Old == null ? "" : $"{p.child4Old}\n") + (p.child3Old == null ? "" : $"{p.child3Old}\n") + diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs index b11d4773..ed0659b7 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -1152,6 +1152,15 @@ namespace BMA.EHR.Retirement.Service.Controllers } updated.IsCancel = true; } + else + { + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel23/{updated.Id}"); + } + } updated.Status = "CANCEL"; updated.LastUpdateFullName = FullName ?? "System Administrator"; updated.LastUpdateUserId = UserId ?? ""; @@ -1557,7 +1566,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var placementProfiles = await _context.RetirementResignEmployees .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } @@ -1742,7 +1751,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var placementProfiles = await _context.RetirementResignEmployeeCancels .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - placementProfiles.ForEach(profile => profile.Status = "REPORT"); + placementProfiles.ForEach(profile => profile.Status = req.status.Trim().ToUpper()); await _context.SaveChangesAsync(); return Success(); } diff --git a/BMA.EHR.Retirement.Service/Requests/ReportPersonRequest.cs b/BMA.EHR.Retirement.Service/Requests/ReportPersonRequest.cs index 5a6136be..31fd36dd 100644 --- a/BMA.EHR.Retirement.Service/Requests/ReportPersonRequest.cs +++ b/BMA.EHR.Retirement.Service/Requests/ReportPersonRequest.cs @@ -6,5 +6,6 @@ namespace BMA.EHR.Retirement.Service.Requests public class ReportPersonRequest { public string[] refIds { get; set; } + public string status { get; set; } } }