ปรับให้เป็น 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

@ -2541,6 +2541,11 @@ namespace BMA.EHR.Placement.Service.Controllers
var data = await _context.PlacementProfiles
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.PlacementStatus = "DONE");
await _context.SaveChangesAsync();
var resultData = (from p in data
join r in req.refIds
on p.Id.ToString() equals r.refId
@ -2590,12 +2595,12 @@ namespace BMA.EHR.Placement.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => profile.PlacementStatus = "DONE");
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => profile.PlacementStatus = "DONE");
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
@ -2777,6 +2782,11 @@ namespace BMA.EHR.Placement.Service.Controllers
var data = await _context.PlacementProfiles
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.PlacementStatus = "DONE");
await _context.SaveChangesAsync();
var resultData = (from p in data
join r in req.refIds
on p.Id.ToString() equals r.refId
@ -2826,12 +2836,12 @@ namespace BMA.EHR.Placement.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => profile.PlacementStatus = "DONE");
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => profile.PlacementStatus = "DONE");
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}
@ -2998,6 +3008,11 @@ namespace BMA.EHR.Placement.Service.Controllers
var data = await _context.PlacementProfiles
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.PlacementStatus = "DONE");
await _context.SaveChangesAsync();
var resultData = (from p in data
join r in req.refIds
on p.Id.ToString() equals r.refId
@ -3047,12 +3062,12 @@ namespace BMA.EHR.Placement.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => profile.PlacementStatus = "DONE");
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// data.ForEach(profile => profile.PlacementStatus = "DONE");
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}