แก้ออกคำสั่ง
This commit is contained in:
parent
d128960111
commit
85d9754db6
8 changed files with 124 additions and 103 deletions
|
|
@ -750,9 +750,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
[HttpPost("command19/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand19([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
@ -769,11 +769,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
[HttpPost("command19/report/delete")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportDeleteCommand19([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "APPROVE");
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "NEW");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -790,9 +790,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
public async Task<ActionResult<ResponseObject>> PostReportCommand19Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
|
|
@ -842,9 +842,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
[HttpPost("command20/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportcommand20([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
@ -861,11 +861,11 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
[HttpPost("command20/report/delete")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportDeletecommand20([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "APPROVE");
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "NEW");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -882,9 +882,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
public async Task<ActionResult<ResponseObject>> PostReportCommand20Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
|
|
@ -937,8 +937,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
@ -963,10 +963,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() =="REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "APPROVE");
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "PENDING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -995,9 +995,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Where(x => x.Status == "REPORT")
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
.Where(x => x.Status == "REPORT")
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
|
|
@ -1087,8 +1087,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
@ -1113,10 +1113,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "APPROVE");
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "PENDING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1139,10 +1139,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
{
|
||||
|
||||
var data = await _context.DisciplineReport_Profiles
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => x.Status == "REPORT")
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => x.Status == "REPORT")
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
|
|
@ -1195,7 +1195,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -1221,10 +1221,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "APPROVE");
|
||||
data.ForEach(profile => profile.Status = "NEW");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1246,9 +1246,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
public async Task<ActionResult<ResponseObject>> PostReportCommand27Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
string? _null = null;
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
|
|
@ -1302,7 +1302,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -1328,10 +1328,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "APPROVE");
|
||||
data.ForEach(profile => profile.Status = "NEW");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1353,9 +1353,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
public async Task<ActionResult<ResponseObject>> PostReportCommand28Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
string? _null = null;
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
|
|
@ -1409,7 +1409,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -1435,10 +1435,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "APPROVE");
|
||||
data.ForEach(profile => profile.Status = "NEW");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1460,9 +1460,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
public async Task<ActionResult<ResponseObject>> PostReportCommand29Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
.Include(x => x.DisciplineDisciplinary)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
string? _null = null;
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
|
|
@ -1516,7 +1516,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -1542,10 +1542,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "APPROVE");
|
||||
data.ForEach(profile => profile.Status = "NEW");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1623,9 +1623,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "REPORT");
|
||||
data.ForEach(profile => profile.StatusDiscard = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1649,10 +1649,10 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
try
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.StatusDiscard.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
data.ForEach(profile => profile.Status = "APPROVE");
|
||||
data.ForEach(profile => profile.StatusDiscard = "NEW");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1709,7 +1709,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
|
||||
data.ForEach(profile => { profile.StatusDiscard = "NEW"; profile.CommandTypeId = null; });
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
|
@ -1767,13 +1767,13 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
.Where(x => x.IsReport == "REPORT")
|
||||
.ToListAsync();
|
||||
|
||||
data1.ForEach(profile => profile.IsReport = "APPROVE");
|
||||
data1.ForEach(profile => profile.IsReport = "NEW");
|
||||
var data2 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.IsReport == "REPORT")
|
||||
.ToListAsync();
|
||||
|
||||
data2.ForEach(profile => profile.IsReport = "APPROVE");
|
||||
data2.ForEach(profile => profile.IsReport = "NEW");
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
@ -1831,7 +1831,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.IsReport = "NEW");
|
||||
data.ForEach(profile => profile.IsReport = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
|
@ -1869,7 +1869,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data1.ForEach(profile => profile.IsReport = "NEW");
|
||||
data1.ForEach(profile => profile.IsReport = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue