เก็บ lastUpdate หากมีเช็คออกคำสั่งย้อนหลัง
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m58s
Build & Deploy Retirement Service / build (push) Successful in 2m18s

This commit is contained in:
harid 2026-06-24 16:20:49 +07:00
parent bf5dc2cf19
commit 5021c00dd3
10 changed files with 94 additions and 23 deletions

View file

@ -1062,12 +1062,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
@ -1292,12 +1293,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
@ -1506,12 +1508,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
@ -1725,12 +1728,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
@ -1967,12 +1971,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
@ -2144,12 +2149,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();

View file

@ -2032,12 +2032,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow
var now = DateTime.Now;
placementProfile.ForEach(profile =>
{
profile.PlacementStatus = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
if (req.refIds.Length > 0)
{
profile.commandId = req.refIds[0].commandId;
@ -2441,12 +2442,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow
var now = DateTime.Now;
placementProfile.ForEach(profile =>
{
profile.PlacementStatus = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
if (req.refIds.Length > 0)
{
profile.commandId = req.refIds[0].commandId;
@ -2716,12 +2718,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.PlacementStatus = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
@ -2972,12 +2975,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.PlacementStatus = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
@ -3211,12 +3215,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.PlacementStatus = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();

View file

@ -828,13 +828,14 @@ namespace BMA.EHR.Placement.Service.Controllers
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var firstRef = req.refIds.FirstOrDefault();
var commandNoText = firstRef != null ? $"{firstRef.commandNo}/{firstRef.commandYear.ToThaiYear()}" : null;
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.commandNo = commandNoText;
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();

View file

@ -1306,12 +1306,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
Console.WriteLine($"[ReceiveReportExcecute] Saving changes to database for {data.Count} profiles");
await _context.SaveChangesAsync();

View file

@ -686,12 +686,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();

View file

@ -1212,12 +1212,13 @@ namespace BMA.EHR.Placement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = DateTime.Now;
profile.LastUpdatedAt = now;
});
// Return resultData for Node to process directly (Linear Flow)

View file

@ -926,7 +926,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
@ -1183,7 +1190,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)

View file

@ -712,7 +712,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)

View file

@ -2972,7 +2972,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
@ -3164,7 +3171,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
@ -3399,7 +3413,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
});
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
await _context.SaveChangesAsync();

View file

@ -2468,7 +2468,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
@ -2700,7 +2707,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
#endregion
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
var now = DateTime.Now;
data.ForEach(profile =>
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
});
data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL");
await _context.SaveChangesAsync();