From bf5dc2cf190533b31556e47491022cc0c8820a49 Mon Sep 17 00:00:00 2001 From: harid Date: Tue, 23 Jun 2026 18:24:30 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=81=E0=B9=87=E0=B8=9A=20lastUpda?= =?UTF-8?q?te=20=E0=B8=AB=E0=B8=B2=E0=B8=81=E0=B8=A1=E0=B8=B5=E0=B9=80?= =?UTF-8?q?=E0=B8=8A=E0=B9=87=E0=B8=84=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=E0=B8=A2=E0=B9=89?= =?UTF-8?q?=E0=B8=AD=E0=B8=99=E0=B8=AB=E0=B8=A5=E0=B8=B1=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlacementAppointmentController.cs | 48 ++++++++++++++++--- .../Controllers/PlacementController.cs | 30 ++++++++++-- .../Controllers/PlacementOfficerController.cs | 3 ++ .../Controllers/PlacementReceiveController.cs | 8 +++- .../PlacementRepatriationController.cs | 8 +++- .../PlacementTransferController.cs | 8 +++- 6 files changed, 93 insertions(+), 12 deletions(-) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index 50114759..a8d91874 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -1062,7 +1062,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -1286,7 +1292,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -1494,7 +1506,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -1707,7 +1725,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -1943,7 +1967,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -2114,7 +2144,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index 9557ae00..1e1d5417 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -2035,6 +2035,9 @@ namespace BMA.EHR.Placement.Service.Controllers placementProfile.ForEach(profile => { profile.PlacementStatus = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; if (req.refIds.Length > 0) { profile.commandId = req.refIds[0].commandId; @@ -2441,6 +2444,9 @@ namespace BMA.EHR.Placement.Service.Controllers placementProfile.ForEach(profile => { profile.PlacementStatus = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; if (req.refIds.Length > 0) { profile.commandId = req.refIds[0].commandId; @@ -2710,7 +2716,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.PlacementStatus = "DONE"); + data.ForEach(profile => + { + profile.PlacementStatus = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -2960,7 +2972,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.PlacementStatus = "DONE"); + data.ForEach(profile => + { + profile.PlacementStatus = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -3193,7 +3211,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.PlacementStatus = "DONE"); + data.ForEach(profile => + { + profile.PlacementStatus = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index 8fcb51cf..7c26a018 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -832,6 +832,9 @@ namespace BMA.EHR.Placement.Service.Controllers { profile.Status = "DONE"; profile.commandNo = commandNoText; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; }); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index 32f91eae..262d86bd 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -1306,7 +1306,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); Console.WriteLine($"[ReceiveReportExcecute] Saving changes to database for {data.Count} profiles"); await _context.SaveChangesAsync(); Console.WriteLine($"[ReceiveReportExcecute] Process completed successfully at {DateTime.Now}"); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index b56fc804..97e1e406 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -686,7 +686,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index 73741918..843fa25a 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -1212,7 +1212,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = DateTime.Now; + }); // Return resultData for Node to process directly (Linear Flow) return Success(resultData);