Compare commits
3 commits
checkin-de
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2fe424b87 | ||
|
|
5021c00dd3 | ||
|
|
bf5dc2cf19 |
11 changed files with 644 additions and 303 deletions
|
|
@ -1028,10 +1028,6 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
|
||||||
data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
on p.Id.ToString() equals r.refId
|
on p.Id.ToString() equals r.refId
|
||||||
|
|
@ -1067,52 +1063,95 @@ 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 : "")))),
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
#region Old: Circular Flow
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
|
// var baseAPIOrg = _configuration["API"];
|
||||||
using (var client = new HttpClient())
|
// 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 =>
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
profile.Status = "REPORTED";
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
profile.CommandTypeId = null;
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
|
});
|
||||||
|
|
||||||
|
var _profile = new List<ProfileComplaintInvestigate>();
|
||||||
|
foreach (var item in data)
|
||||||
|
{
|
||||||
|
_profile.Add(new ProfileComplaintInvestigate
|
||||||
{
|
{
|
||||||
data = resultData,
|
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 = now,
|
||||||
|
CreatedUserId = UserId ?? "",
|
||||||
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
LastUpdatedAt = now,
|
||||||
|
LastUpdateUserId = UserId ?? "",
|
||||||
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
});
|
});
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return Success();
|
_context.ProfileComplaintInvestigate.AddRange(_profile);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
return Success(resultData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -1184,10 +1223,6 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
|
||||||
data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
on p.Id.ToString() equals r.refId
|
on p.Id.ToString() equals r.refId
|
||||||
|
|
@ -1223,52 +1258,95 @@ 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 : "")))),
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
#region Old: Circular Flow
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
|
// var baseAPIOrg = _configuration["API"];
|
||||||
using (var client = new HttpClient())
|
// 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 =>
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
profile.Status = "REPORTED";
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
profile.CommandTypeId = null;
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
|
});
|
||||||
|
|
||||||
|
var _profile = new List<ProfileComplaintInvestigate>();
|
||||||
|
foreach (var item in data)
|
||||||
|
{
|
||||||
|
_profile.Add(new ProfileComplaintInvestigate
|
||||||
{
|
{
|
||||||
data = resultData,
|
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 = now,
|
||||||
|
CreatedUserId = UserId ?? "",
|
||||||
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
LastUpdatedAt = now,
|
||||||
|
LastUpdateUserId = UserId ?? "",
|
||||||
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
});
|
});
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return Success();
|
_context.ProfileComplaintInvestigate.AddRange(_profile);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
return Success(resultData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -1418,10 +1496,6 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
|
||||||
data.ForEach(profile => profile.Status = "DONE");
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
on p.Id.ToString() equals r.refId
|
on p.Id.ToString() equals r.refId
|
||||||
|
|
@ -1457,24 +1531,39 @@ 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 : "")))),
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
#region Old: Circular Flow
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
|
// var baseAPIOrg = _configuration["API"];
|
||||||
using (var client = new HttpClient())
|
// 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 =>
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
profile.Status = "DONE";
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
{
|
profile.LastUpdatedAt = now;
|
||||||
data = resultData,
|
});
|
||||||
});
|
await _context.SaveChangesAsync();
|
||||||
//// var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
//// if (_res.IsSuccessStatusCode)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
//// {
|
return Success(resultData);
|
||||||
//// data.ForEach(profile => profile.Status = "DONE");
|
|
||||||
//// await _context.SaveChangesAsync();
|
|
||||||
//// }
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -1562,10 +1651,6 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
|
||||||
data.ForEach(profile => profile.Status = "DONE");
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
on p.Id.ToString() equals r.refId
|
on p.Id.ToString() equals r.refId
|
||||||
|
|
@ -1601,24 +1686,39 @@ 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 : "")))),
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
#region Old: Circular Flow
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
|
// var baseAPIOrg = _configuration["API"];
|
||||||
using (var client = new HttpClient())
|
// 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 =>
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
profile.Status = "DONE";
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
{
|
profile.LastUpdatedAt = now;
|
||||||
data = resultData,
|
});
|
||||||
});
|
await _context.SaveChangesAsync();
|
||||||
//// var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
//// if (_res.IsSuccessStatusCode)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
//// {
|
return Success(resultData);
|
||||||
//// data.ForEach(profile => profile.Status = "DONE");
|
|
||||||
//// await _context.SaveChangesAsync();
|
|
||||||
//// }
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -1704,10 +1804,6 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
|
||||||
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
|
|
@ -1743,24 +1839,40 @@ 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 : "")))),
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
#region Old: Circular Flow
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
|
// var baseAPIOrg = _configuration["API"];
|
||||||
using (var client = new HttpClient())
|
// 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 =>
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
profile.Status = "NEW";
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
profile.CommandTypeId = null;
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
{
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
data = resultData,
|
profile.LastUpdatedAt = now;
|
||||||
});
|
});
|
||||||
//// var _result = await _res.Content.ReadAsStringAsync();
|
await _context.SaveChangesAsync();
|
||||||
//// if (_res.IsSuccessStatusCode)
|
|
||||||
//// {
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
return Success(resultData);
|
||||||
//// await _context.SaveChangesAsync();
|
|
||||||
//// }
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -1846,10 +1958,6 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
|
||||||
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
|
|
@ -1885,24 +1993,40 @@ 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 : "")))),
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
#region Old: Circular Flow
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
|
// var baseAPIOrg = _configuration["API"];
|
||||||
using (var client = new HttpClient())
|
// 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 =>
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
profile.Status = "NEW";
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
profile.CommandTypeId = null;
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
{
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
data = resultData,
|
profile.LastUpdatedAt = now;
|
||||||
});
|
});
|
||||||
//// var _result = await _res.Content.ReadAsStringAsync();
|
await _context.SaveChangesAsync();
|
||||||
//// if (_res.IsSuccessStatusCode)
|
|
||||||
//// {
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
return Success(resultData);
|
||||||
//// await _context.SaveChangesAsync();
|
|
||||||
//// }
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -1988,10 +2112,6 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
|
||||||
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
|
|
@ -2027,24 +2147,40 @@ 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 : "")))),
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
#region Old: Circular Flow
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
|
// var baseAPIOrg = _configuration["API"];
|
||||||
using (var client = new HttpClient())
|
// 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 =>
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
profile.Status = "NEW";
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
profile.CommandTypeId = null;
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
{
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
data = resultData,
|
profile.LastUpdatedAt = now;
|
||||||
});
|
});
|
||||||
//// var _result = await _res.Content.ReadAsStringAsync();
|
await _context.SaveChangesAsync();
|
||||||
//// if (_res.IsSuccessStatusCode)
|
|
||||||
//// {
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
return Success(resultData);
|
||||||
//// await _context.SaveChangesAsync();
|
|
||||||
//// }
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -2130,10 +2266,6 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
|
||||||
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
|
|
@ -2169,24 +2301,40 @@ 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 : "")))),
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
#region Old: Circular Flow
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
|
// var baseAPIOrg = _configuration["API"];
|
||||||
using (var client = new HttpClient())
|
// 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 =>
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
profile.Status = "NEW";
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
profile.CommandTypeId = null;
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
{
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
data = resultData,
|
profile.LastUpdatedAt = now;
|
||||||
});
|
});
|
||||||
//// var _result = await _res.Content.ReadAsStringAsync();
|
await _context.SaveChangesAsync();
|
||||||
//// if (_res.IsSuccessStatusCode)
|
|
||||||
//// {
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
return Success(resultData);
|
||||||
//// await _context.SaveChangesAsync();
|
|
||||||
//// }
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -2272,10 +2420,6 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
|
||||||
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
|
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
|
|
@ -2311,24 +2455,40 @@ 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 : "")))),
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
#region Old: Circular Flow
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline";
|
// var baseAPIOrg = _configuration["API"];
|
||||||
using (var client = new HttpClient())
|
// 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 =>
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
profile.Status = "NEW";
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
profile.CommandTypeId = null;
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
{
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
data = resultData,
|
profile.LastUpdatedAt = now;
|
||||||
});
|
});
|
||||||
//// var _result = await _res.Content.ReadAsStringAsync();
|
await _context.SaveChangesAsync();
|
||||||
//// if (_res.IsSuccessStatusCode)
|
|
||||||
//// {
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
return Success(resultData);
|
||||||
//// await _context.SaveChangesAsync();
|
|
||||||
//// }
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -2424,15 +2584,21 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
[HttpPost("command32/report/excecute")]
|
[HttpPost("command32/report/excecute")]
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportCommand32Execute([FromBody] ReportExecuteRequest req)
|
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
|
var data = await _context.DisciplineInvestigate_ProfileComplaints
|
||||||
.Include(x => x.DisciplineInvestigate)
|
.Include(x => x.DisciplineInvestigate)
|
||||||
// .Where(x => x.IsReport == "REPORT")
|
// .Where(x => x.IsReport == "REPORT")
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
var data1 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||||
data.ForEach(profile => profile.IsReport = "DONE");
|
.Include(x => x.DisciplineDisciplinary)
|
||||||
await _context.SaveChangesAsync();
|
// .Where(x => x.IsReport == "REPORT")
|
||||||
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
var resultData = (from p in data
|
var resultData = (from p in data
|
||||||
|
|
@ -2469,29 +2635,6 @@ 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 : "")))),
|
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();
|
}).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
|
var resultData1 = (from p in data1
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
on p.Id.ToString() equals r.refId
|
on p.Id.ToString() equals r.refId
|
||||||
|
|
@ -2525,23 +2668,69 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
posNo = p.posMasterNo != null ? p.posMasterNo.ToString() : null,
|
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 : "")))),
|
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();
|
}).ToList();
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success();
|
#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 =>
|
||||||
|
{
|
||||||
|
profile.IsReport = "DONE";
|
||||||
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
|
});
|
||||||
|
data1.ForEach(profile =>
|
||||||
|
{
|
||||||
|
profile.IsReport = "DONE";
|
||||||
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
|
});
|
||||||
|
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 });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -1062,7 +1062,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -1286,7 +1293,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -1494,7 +1508,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -1707,7 +1728,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -1943,7 +1971,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -2039,7 +2074,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-47
|
/// ออกคำสั่ง C-PM-47 โปรดเกล้าฯ แต่งตั้งให้ดำรงตำแหน่ง
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <response code="200"></response>
|
/// <response code="200"></response>
|
||||||
|
|
@ -2114,7 +2149,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
|
||||||
|
|
@ -2032,9 +2032,13 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow
|
// New: Linear Flow
|
||||||
|
var now = DateTime.Now;
|
||||||
placementProfile.ForEach(profile =>
|
placementProfile.ForEach(profile =>
|
||||||
{
|
{
|
||||||
profile.PlacementStatus = "DONE";
|
profile.PlacementStatus = "DONE";
|
||||||
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
if (req.refIds.Length > 0)
|
if (req.refIds.Length > 0)
|
||||||
{
|
{
|
||||||
profile.commandId = req.refIds[0].commandId;
|
profile.commandId = req.refIds[0].commandId;
|
||||||
|
|
@ -2438,9 +2442,13 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow
|
// New: Linear Flow
|
||||||
|
var now = DateTime.Now;
|
||||||
placementProfile.ForEach(profile =>
|
placementProfile.ForEach(profile =>
|
||||||
{
|
{
|
||||||
profile.PlacementStatus = "DONE";
|
profile.PlacementStatus = "DONE";
|
||||||
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
if (req.refIds.Length > 0)
|
if (req.refIds.Length > 0)
|
||||||
{
|
{
|
||||||
profile.commandId = req.refIds[0].commandId;
|
profile.commandId = req.refIds[0].commandId;
|
||||||
|
|
@ -2710,7 +2718,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
||||||
data.ForEach(profile => profile.PlacementStatus = "DONE");
|
var now = DateTime.Now;
|
||||||
|
data.ForEach(profile =>
|
||||||
|
{
|
||||||
|
profile.PlacementStatus = "DONE";
|
||||||
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
|
});
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -2960,7 +2975,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
||||||
data.ForEach(profile => profile.PlacementStatus = "DONE");
|
var now = DateTime.Now;
|
||||||
|
data.ForEach(profile =>
|
||||||
|
{
|
||||||
|
profile.PlacementStatus = "DONE";
|
||||||
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
|
});
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -3193,7 +3215,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
||||||
data.ForEach(profile => profile.PlacementStatus = "DONE");
|
var now = DateTime.Now;
|
||||||
|
data.ForEach(profile =>
|
||||||
|
{
|
||||||
|
profile.PlacementStatus = "DONE";
|
||||||
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
|
});
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
|
||||||
|
|
@ -828,10 +828,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
||||||
var firstRef = req.refIds.FirstOrDefault();
|
var firstRef = req.refIds.FirstOrDefault();
|
||||||
var commandNoText = firstRef != null ? $"{firstRef.commandNo}/{firstRef.commandYear.ToThaiYear()}" : null;
|
var commandNoText = firstRef != null ? $"{firstRef.commandNo}/{firstRef.commandYear.ToThaiYear()}" : null;
|
||||||
|
var now = DateTime.Now;
|
||||||
data.ForEach(profile =>
|
data.ForEach(profile =>
|
||||||
{
|
{
|
||||||
profile.Status = "DONE";
|
profile.Status = "DONE";
|
||||||
profile.commandNo = commandNoText;
|
profile.commandNo = commandNoText;
|
||||||
|
profile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
profile.LastUpdateUserId = UserId ?? "";
|
||||||
|
profile.LastUpdatedAt = now;
|
||||||
});
|
});
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1306,7 +1306,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow
|
// New: Linear Flow
|
||||||
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;
|
||||||
|
});
|
||||||
Console.WriteLine($"[ReceiveReportExcecute] Saving changes to database for {data.Count} profiles");
|
Console.WriteLine($"[ReceiveReportExcecute] Saving changes to database for {data.Count} profiles");
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
Console.WriteLine($"[ReceiveReportExcecute] Process completed successfully at {DateTime.Now}");
|
Console.WriteLine($"[ReceiveReportExcecute] Process completed successfully at {DateTime.Now}");
|
||||||
|
|
|
||||||
|
|
@ -686,7 +686,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
|
||||||
|
|
@ -1212,7 +1212,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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;
|
||||||
|
});
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
return Success(resultData);
|
return Success(resultData);
|
||||||
|
|
|
||||||
|
|
@ -926,7 +926,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -1183,7 +1190,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
|
||||||
|
|
@ -629,7 +629,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-18 คำสั่งให้ออกจากราชการ
|
/// ออกคำสั่ง C-PM-18 ให้ออกจากราชการ && C-PM-43 ให้ลูกจ้างออกจากราชการ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <response code="200"></response>
|
/// <response code="200"></response>
|
||||||
|
|
@ -712,7 +712,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
|
||||||
|
|
@ -2972,7 +2972,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -3164,7 +3171,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -3399,7 +3413,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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");
|
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2468,7 +2468,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
// Return resultData for Node to process directly (Linear Flow)
|
// Return resultData for Node to process directly (Linear Flow)
|
||||||
|
|
@ -2700,7 +2707,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
// 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");
|
data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL");
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue