ปรับให้เป็น process ที่ควรบันทึกตามลำดับ #224
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m46s
Build & Deploy Placement Service / build (push) Successful in 1m56s
Build & Deploy Discipline Service / build (push) Successful in 1m55s

This commit is contained in:
harid 2026-05-01 11:20:15 +07:00
parent 2bdb8bb733
commit 5b0fcd0680
10 changed files with 260 additions and 143 deletions

View file

@ -1013,6 +1013,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Include(x => x.DisciplineDisciplinary)
.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
@ -1061,8 +1066,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
// คำสั่งไล่ออก หรือ ปลดออก Status หลังออกคำสั่งใช้ "REPORTED" เพื่อไม่ให้ส่งรายชื่อไปออกคำสั่งซ้ำได้
data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
//// คำสั่งไล่ออก หรือ ปลดออก 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)
@ -1150,6 +1155,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Include(x => x.DisciplineDisciplinary)
.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
@ -1198,8 +1208,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
// คำสั่งไล่ออก หรือ ปลดออก Status หลังออกคำสั่งใช้ "REPORTED" เพื่อไม่ให้ส่งรายชื่อไปออกคำสั่งซ้ำได้
data.ForEach(profile => { profile.Status = "REPORTED"; profile.CommandTypeId = null; });
//// คำสั่งไล่ออก หรือ ปลดออก 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)
@ -1379,6 +1389,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
// .Where(x => x.Status == "REPORT")
.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
@ -1424,12 +1439,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => profile.Status = "DONE");
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
@ -1518,6 +1533,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
// .Where(x => x.Status == "REPORT")
.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
@ -1563,12 +1583,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => profile.Status = "DONE");
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
@ -1641,6 +1661,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Include(x => x.DisciplineDisciplinary)
.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
@ -1686,12 +1711,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
@ -1764,6 +1789,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Include(x => x.DisciplineDisciplinary)
.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
@ -1809,12 +1839,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
@ -1887,6 +1917,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Include(x => x.DisciplineDisciplinary)
.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
@ -1932,12 +1967,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
@ -2010,6 +2045,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Include(x => x.DisciplineDisciplinary)
.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
@ -2055,12 +2095,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
@ -2133,6 +2173,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Include(x => x.DisciplineDisciplinary)
.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
@ -2178,12 +2223,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
@ -2272,6 +2317,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
// .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
join r in req.refIds
@ -2317,12 +2367,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => profile.IsReport = "DONE");
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => profile.IsReport = "DONE");
//// await _context.SaveChangesAsync();
//// }
}
var data1 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates