Compare commits

..

No commits in common. "dev" and "placement-dev1.0.55" have entirely different histories.

11 changed files with 305 additions and 565 deletions

View file

@ -1028,6 +1028,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
var resultData = (from p in data
join r in req.refIds
on p.Id.ToString() equals r.refId
@ -1063,66 +1067,23 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// // คำสั่งไล่ออก หรือ ปลดออก Status หลังออกคำสั่งใช้ "REPORTED" เพื่อไม่ให้ส่งรายชื่อไปออกคำสั่งซ้ำได้
// data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
// var _profile = new List<ProfileComplaintInvestigate>();
// DateTime _date = DateTime.Now;
// foreach (var item in data)
// {
// _profile.Add(new ProfileComplaintInvestigate
// {
// PersonId = item.PersonId,
// Prefix = item.Prefix,
// FirstName = item.FirstName,
// LastName = item.LastName,
// CitizenId = item.CitizenId,
// rootDnaId = item.rootDnaId,
// child1DnaId = item.child1DnaId,
// child2DnaId = item.child2DnaId,
// child3DnaId = item.child3DnaId,
// child4DnaId = item.child4DnaId,
// profileType = item.profileType,
// commandType = "C-PM-19",
// CreatedAt = _date,
// CreatedUserId = UserId,
// CreatedFullName = FullName,
// LastUpdatedAt = _date,
// LastUpdateUserId = UserId,
// LastUpdateFullName = FullName,
// });
// }
// _context.ProfileComplaintInvestigate.AddRange(_profile);
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
using (var client = new HttpClient())
{
profile.Status = "REPORTED";
profile.CommandTypeId = null;
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
//// คำสั่งไล่ออก หรือ ปลดออก Status หลังออกคำสั่งใช้ "REPORTED" เพื่อไม่ให้ส่งรายชื่อไปออกคำสั่งซ้ำได้
// data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
var _profile = new List<ProfileComplaintInvestigate>();
DateTime _date = DateTime.Now;
foreach (var item in data)
{
_profile.Add(new ProfileComplaintInvestigate
@ -1139,19 +1100,19 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
child4DnaId = item.child4DnaId,
profileType = item.profileType,
commandType = "C-PM-19",
CreatedAt = now,
CreatedUserId = UserId ?? "",
CreatedFullName = FullName ?? "System Administrator",
LastUpdatedAt = now,
LastUpdateUserId = UserId ?? "",
LastUpdateFullName = FullName ?? "System Administrator",
CreatedAt = _date,
CreatedUserId = UserId,
CreatedFullName = FullName,
LastUpdatedAt = _date,
LastUpdateUserId = UserId,
LastUpdateFullName = FullName,
});
}
_context.ProfileComplaintInvestigate.AddRange(_profile);
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
return Success(resultData);
}
}
return Success();
}
/// <summary>
@ -1223,6 +1184,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
var resultData = (from p in data
join r in req.refIds
on p.Id.ToString() equals r.refId
@ -1258,66 +1223,23 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// // คำสั่งไล่ออก หรือ ปลดออก Status หลังออกคำสั่งใช้ "REPORTED" เพื่อไม่ให้ส่งรายชื่อไปออกคำสั่งซ้ำได้
// data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
// var _profile = new List<ProfileComplaintInvestigate>();
// DateTime _date = DateTime.Now;
// foreach (var item in data)
// {
// _profile.Add(new ProfileComplaintInvestigate
// {
// PersonId = item.PersonId,
// Prefix = item.Prefix,
// FirstName = item.FirstName,
// LastName = item.LastName,
// CitizenId = item.CitizenId,
// rootDnaId = item.rootDnaId,
// child1DnaId = item.child1DnaId,
// child2DnaId = item.child2DnaId,
// child3DnaId = item.child3DnaId,
// child4DnaId = item.child4DnaId,
// profileType = item.profileType,
// commandType = "C-PM-20",
// CreatedAt = _date,
// CreatedUserId = UserId,
// CreatedFullName = FullName,
// LastUpdatedAt = _date,
// LastUpdateUserId = UserId,
// LastUpdateFullName = FullName,
// });
// }
// _context.ProfileComplaintInvestigate.AddRange(_profile);
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
using (var client = new HttpClient())
{
profile.Status = "REPORTED";
profile.CommandTypeId = null;
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
//// คำสั่งไล่ออก หรือ ปลดออก Status หลังออกคำสั่งใช้ "REPORTED" เพื่อไม่ให้ส่งรายชื่อไปออกคำสั่งซ้ำได้
// data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
var _profile = new List<ProfileComplaintInvestigate>();
DateTime _date = DateTime.Now;
foreach (var item in data)
{
_profile.Add(new ProfileComplaintInvestigate
@ -1334,19 +1256,19 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
child4DnaId = item.child4DnaId,
profileType = item.profileType,
commandType = "C-PM-20",
CreatedAt = now,
CreatedUserId = UserId ?? "",
CreatedFullName = FullName ?? "System Administrator",
LastUpdatedAt = now,
LastUpdateUserId = UserId ?? "",
LastUpdateFullName = FullName ?? "System Administrator",
CreatedAt = _date,
CreatedUserId = UserId,
CreatedFullName = FullName,
LastUpdatedAt = _date,
LastUpdateUserId = UserId,
LastUpdateFullName = FullName,
});
}
_context.ProfileComplaintInvestigate.AddRange(_profile);
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
return Success(resultData);
}
}
return Success();
}
/// <summary>
@ -1496,6 +1418,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
var resultData = (from p in data
join r in req.refIds
on p.Id.ToString() equals r.refId
@ -1531,39 +1457,24 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// data.ForEach(profile => profile.Status = "DONE");
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
using (var client = new HttpClient())
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
return Success(resultData);
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => profile.Status = "DONE");
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
/// <summary>
@ -1651,6 +1562,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
var resultData = (from p in data
join r in req.refIds
on p.Id.ToString() equals r.refId
@ -1686,39 +1601,24 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// data.ForEach(profile => profile.Status = "DONE");
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
using (var client = new HttpClient())
{
profile.Status = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
return Success(resultData);
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => profile.Status = "DONE");
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
/// <summary>
@ -1804,6 +1704,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -1839,40 +1743,24 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
using (var client = new HttpClient())
{
profile.Status = "NEW";
profile.CommandTypeId = null;
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
return Success(resultData);
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
/// <summary>
@ -1958,6 +1846,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -1993,40 +1885,24 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
using (var client = new HttpClient())
{
profile.Status = "NEW";
profile.CommandTypeId = null;
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
return Success(resultData);
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
/// <summary>
@ -2112,6 +1988,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -2147,40 +2027,24 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
using (var client = new HttpClient())
{
profile.Status = "NEW";
profile.CommandTypeId = null;
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
return Success(resultData);
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
/// <summary>
@ -2266,6 +2130,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -2301,40 +2169,24 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
using (var client = new HttpClient())
{
profile.Status = "NEW";
profile.CommandTypeId = null;
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
return Success(resultData);
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
/// <summary>
@ -2420,6 +2272,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -2455,40 +2311,24 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
using (var client = new HttpClient())
{
profile.Status = "NEW";
profile.CommandTypeId = null;
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
return Success(resultData);
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
/// <summary>
@ -2584,21 +2424,15 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
[HttpPost("command32/report/excecute")]
public async Task<ActionResult<ResponseObject>> PostReportCommand32Execute([FromBody] ReportExecuteRequest req)
{
// C-PM-32 (คำสั่งยุติเรื่อง) ต้องยุติงานใน 2 track ที่เก็บอยู่คนละตาราง:
// - data / resultData = ฝั่ง "การสอบสวน" (DisciplineInvestigate_ProfileComplaint)
// - data1 / resultData1 = ฝั่ง "การพิจารณาลงโทษ" (DisciplineDisciplinary_ProfileComplaintInvestigate)
// บุคคลเดียวกัน (profileId เดียวกัน) อาจอยู่ในทั้ง 2 track จึงต้องส่งให้ org แยก 2 ครั้ง (ห้าม merge รวมครั้งเดียว)
var data = await _context.DisciplineInvestigate_ProfileComplaints
.Include(x => x.DisciplineInvestigate)
// .Where(x => x.IsReport == "REPORT")
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
var data1 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Include(x => x.DisciplineDisciplinary)
// .Where(x => x.IsReport == "REPORT")
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.IsReport = "DONE");
await _context.SaveChangesAsync();
string? _null = null;
var resultData = (from p in data
@ -2635,6 +2469,29 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
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.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => profile.IsReport = "DONE");
//// await _context.SaveChangesAsync();
//// }
}
var data1 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Include(x => x.DisciplineDisciplinary)
// .Where(x => x.IsReport == "REPORT")
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
var resultData1 = (from p in data1
join r in req.refIds
on p.Id.ToString() equals r.refId
@ -2668,69 +2525,23 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posNo = p.posMasterNo != null ? p.posMasterNo.ToString() : null,
posNoAbb = p.child4ShortName != null ? p.child4ShortName : (p.child3ShortName != null ? p.child3ShortName : (p.child2ShortName != null ? p.child2ShortName : (p.child1ShortName != null ? p.child1ShortName : (p.rootShortName != null ? p.rootShortName : "")))),
}).ToList();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// data.ForEach(profile => profile.IsReport = "DONE");
// await _context.SaveChangesAsync();
// }
// }
// 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.PostAsJsonAsync(apiUrlOrg, new
// {
// data = resultData1,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// if (_res.IsSuccessStatusCode)
// {
// data1.ForEach(profile => profile.IsReport = "DONE");
// await _context.SaveChangesAsync();
// }
// }
#endregion
// New: Linear Flow
var now = DateTime.Now;
data.ForEach(profile =>
using (var client = new HttpClient())
{
profile.IsReport = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
});
data1.ForEach(profile =>
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
profile.IsReport = "DONE";
profile.LastUpdateFullName = FullName ?? "System Administrator";
profile.LastUpdateUserId = UserId ?? "";
profile.LastUpdatedAt = now;
data = resultData1,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data1.ForEach(profile => profile.IsReport = "DONE");
await _context.SaveChangesAsync();
}
}
// Return resultData for Node to process directly (Linear Flow)
//
// NOTE สำหรับฝั่ง Node (C-PM-32 เท่านั้น):
// - response.result เป็น object { data, data1 } (ไม่ใช่ array เหมือนคำสั่งอื่น)
// data = รายการฝั่ง "การสอบสวน" → ยิง POST {API}/org/command/excexute/salary-leave-discipline ครั้งที่ 1
// data1 = รายการฝั่ง "การพิจารณาลงโทษ" → ยิง POST {API}/org/command/excexute/salary-leave-discipline ครั้งที่ 2
// - ต้องยิง 2 ครั้งตามลำดับ data ก่อน → data1 (ห้าม merge รวมในครั้งเดียว เพราะ profileId อาจซ้ำข้าม 2 track)
// - คำสั่งอื่น (C-PM-19/20/25/26/27/28/29/30/31) response.result เป็น array → ยิง org 1 ครั้ง
return Success(new { data = resultData, data1 = resultData1 });
return Success();
}
/// <summary>

View file

@ -1062,13 +1062,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();
@ -1293,13 +1292,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();
@ -1508,13 +1506,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();
@ -1728,13 +1725,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();
@ -1971,13 +1967,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();
@ -2074,7 +2069,7 @@ namespace BMA.EHR.Placement.Service.Controllers
}
/// <summary>
/// ออกคำสั่ง C-PM-47 โปรดเกล้าฯ แต่งตั้งให้ดำรงตำแหน่ง
/// ออกคำสั่ง C-PM-47
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
@ -2149,13 +2144,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();

View file

@ -2032,13 +2032,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
if (req.refIds.Length > 0)
{
profile.commandId = req.refIds[0].commandId;
@ -2442,13 +2441,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
if (req.refIds.Length > 0)
{
profile.commandId = req.refIds[0].commandId;
@ -2718,13 +2716,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();
@ -2975,13 +2972,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();
@ -3215,13 +3211,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();

View file

@ -828,14 +828,13 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();

View file

@ -1306,13 +1306,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
Console.WriteLine($"[ReceiveReportExcecute] Saving changes to database for {data.Count} profiles");
await _context.SaveChangesAsync();

View file

@ -686,13 +686,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
await _context.SaveChangesAsync();

View file

@ -1212,13 +1212,12 @@ 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 = now;
profile.LastUpdatedAt = DateTime.Now;
});
// Return resultData for Node to process directly (Linear Flow)

View file

@ -926,14 +926,7 @@ namespace BMA.EHR.Retirement.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 = now;
});
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
@ -1190,14 +1183,7 @@ namespace BMA.EHR.Retirement.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 = now;
});
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)

View file

@ -629,7 +629,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
}
/// <summary>
/// ออกคำสั่ง C-PM-18 ให้ออกจากราชการ && C-PM-43 ให้ลูกจ้างออกจากราชการ
/// ออกคำสั่ง C-PM-18 คำสั่งให้ออกจากราชการ
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
@ -712,14 +712,7 @@ namespace BMA.EHR.Retirement.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 = now;
});
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)

View file

@ -2972,14 +2972,7 @@ namespace BMA.EHR.Retirement.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 = now;
});
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
@ -3171,14 +3164,7 @@ namespace BMA.EHR.Retirement.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 = now;
});
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
@ -3413,14 +3399,7 @@ namespace BMA.EHR.Retirement.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 = now;
});
data.ForEach(profile => profile.Status = "DONE");
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
await _context.SaveChangesAsync();

View file

@ -2468,14 +2468,7 @@ namespace BMA.EHR.Retirement.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 = now;
});
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
// Return resultData for Node to process directly (Linear Flow)
@ -2707,14 +2700,7 @@ namespace BMA.EHR.Retirement.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 = now;
});
data.ForEach(profile => profile.Status = "DONE");
data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL");
await _context.SaveChangesAsync();