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

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();
}

View file

@ -758,6 +758,17 @@ namespace BMA.EHR.Placement.Service.Controllers
var data = await _context.PlacementOfficers
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
var firstRef = req.refIds.FirstOrDefault();
var commandNoText = firstRef != null ? $"{firstRef.commandNo}/{firstRef.commandYear.ToThaiYear()}" : null;
foreach (var profile in data)
{
profile.Status = "DONE";
profile.commandNo = commandNoText;
}
await _context.SaveChangesAsync();
var resultData = (from p in data
join r in req.refIds
on p.Id.ToString() equals r.refId
@ -809,17 +820,16 @@ namespace BMA.EHR.Placement.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
//data.ForEach(profile => profile.Status = "DONE");
foreach (var profile in data)
{
profile.Status = "DONE";
profile.commandNo = resultData.Count > 0 ? $"{resultData[0].commandNo}/{resultData[0].commandYear.ToThaiYear()}" : null;
}
await _context.SaveChangesAsync();
}
//// var _result = await _res.Content.ReadAsStringAsync();
//// if (_res.IsSuccessStatusCode)
//// {
//// foreach (var profile in data)
//// {
//// profile.Status = "DONE";
//// profile.commandNo = resultData.Count > 0 ? $"{resultData[0].commandNo}/{resultData[0].commandYear.ToThaiYear()}" : null;
//// }
//// await _context.SaveChangesAsync();
//// }
}
return Success();
}

View file

@ -1124,6 +1124,10 @@ namespace BMA.EHR.Placement.Service.Controllers
.Include(x => x.Avatar)
.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
@ -1223,12 +1227,12 @@ namespace BMA.EHR.Placement.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();
}

View file

@ -623,6 +623,10 @@ namespace BMA.EHR.Placement.Service.Controllers
var data = await _context.PlacementRepatriations
.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();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -675,12 +679,12 @@ namespace BMA.EHR.Placement.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();
}

View file

@ -1094,6 +1094,10 @@ namespace BMA.EHR.Placement.Service.Controllers
var data = await _context.PlacementTransfers
.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
@ -1146,12 +1150,12 @@ namespace BMA.EHR.Placement.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();
}

View file

@ -845,6 +845,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
var data = await _context.RetirementOthers
.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();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -914,12 +918,12 @@ namespace BMA.EHR.Retirement.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();
}
@ -1090,6 +1094,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
var data = await _context.RetirementOthers
.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();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -1159,12 +1167,12 @@ namespace BMA.EHR.Retirement.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();
}

View file

@ -642,6 +642,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
var data = await _context.RetirementOuts
.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
@ -701,12 +705,12 @@ namespace BMA.EHR.Retirement.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();
}

View file

@ -2861,6 +2861,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
var data = await _context.RetirementResigns
.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
@ -2915,12 +2919,12 @@ namespace BMA.EHR.Retirement.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();
}
@ -3060,6 +3064,11 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Include(x => x.RetirementResign)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
await _context.SaveChangesAsync();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -3120,13 +3129,13 @@ namespace BMA.EHR.Retirement.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => profile.Status = "DONE");
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
await _context.SaveChangesAsync();
}
// // var _result = await _res.Content.ReadAsStringAsync();
// // if (_res.IsSuccessStatusCode)
// // {
// // data.ForEach(profile => profile.Status = "DONE");
// // data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
// // await _context.SaveChangesAsync();
// // }
}
//}
//else

View file

@ -2361,6 +2361,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
var data = await _context.RetirementResignEmployees
.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
@ -2413,12 +2417,12 @@ namespace BMA.EHR.Retirement.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();
}
@ -2556,6 +2560,11 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Include(x => x.RetirementResignEmployee)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
data.ForEach(profile => profile.Status = "DONE");
data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL");
await _context.SaveChangesAsync();
string? _null = null;
var resultData = (from p in data
join r in req.refIds
@ -2615,13 +2624,13 @@ namespace BMA.EHR.Retirement.Service.Controllers
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => profile.Status = "DONE");
data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL");
await _context.SaveChangesAsync();
}
// // var _result = await _res.Content.ReadAsStringAsync();
// // if (_res.IsSuccessStatusCode)
// // {
// // data.ForEach(profile => profile.Status = "DONE");
// // data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL");
// // await _context.SaveChangesAsync();
// // }
}
//}
//else