แก้ออกคำสั่ง
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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -777,7 +777,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
placementProfiles.ForEach(profile => profile.Status = "PENDING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -939,7 +939,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
placementProfiles.ForEach(profile => profile.Status = "PENDING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1101,7 +1101,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
placementProfiles.ForEach(profile => profile.Status = "PENDING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1265,7 +1265,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => x.type == "EMPLOYEE")
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
placementProfiles.ForEach(profile => profile.Status = "PENDING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1422,7 +1422,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => x.type == "EMPLOYEE")
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
placementProfiles.ForEach(profile => profile.Status = "PENDING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -614,7 +614,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
Total = x.PlacementProfiles.Count(),
|
||||
UnContain = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "UN-CONTAIN").Count(),
|
||||
PrepareContain = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN").Count(),
|
||||
Contain = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "CONTAIN").Count(),
|
||||
Report = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "REPORT").Count(),
|
||||
Done = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "DONE").Count(),
|
||||
Disclaim = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "DISCLAIM").Count(),
|
||||
}).FirstOrDefaultAsync();
|
||||
if (placement == null)
|
||||
|
|
@ -658,7 +659,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
Total = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Count(),
|
||||
UnContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "UN-CONTAIN").Count(),
|
||||
PrepareContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN").Count(),
|
||||
Contain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "CONTAIN").Count(),
|
||||
Report = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "REPORT").Count(),
|
||||
Done = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DONE").Count(),
|
||||
Disclaim = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DISCLAIM").Count(),
|
||||
}).FirstOrDefaultAsync();
|
||||
if (placement == null)
|
||||
|
|
@ -1455,7 +1457,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
var position = await _context.PlacementProfiles
|
||||
.Where(x => x.posmasterId != null)
|
||||
.Where(x => x.PlacementStatus != "CONTAIN")
|
||||
.Where(x => x.PlacementStatus != "DONE" && x.PlacementStatus != "REPORT")
|
||||
.Select(x => x.posmasterId)
|
||||
.ToListAsync();
|
||||
return Success(position);
|
||||
|
|
@ -1479,7 +1481,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1497,7 +1499,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
var placementProfiles = await _context.PlacementProfiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "PREPARE-CONTAIN")
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -1746,7 +1748,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
// update placementstatus
|
||||
placementProfile.PlacementStatus = "CONTAIN";//DONE
|
||||
placementProfile.PlacementStatus = "DONE";//DONE
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
|
@ -1772,7 +1774,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1790,9 +1792,9 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
var placementProfiles = await _context.PlacementProfiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "PREPARE-CONTAIN")
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAI");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -2039,7 +2041,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
// update placementstatus
|
||||
placementProfile.PlacementStatus = "CONTAIN";//DONE
|
||||
placementProfile.PlacementStatus = "DONE";//DONE
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
|
@ -2064,7 +2066,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => x.Placement!.PlacementType!.Name == "แต่งตั้งข้าราชการ")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOIN")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -2082,7 +2084,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
var placementProfiles = await _context.PlacementProfiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "PREPARE-CONTAIN")
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -2215,7 +2217,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.PlacementStatus = "CONTAIN");
|
||||
data.ForEach(profile => profile.PlacementStatus = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
|
@ -2240,7 +2242,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => x.Placement!.PlacementType!.Name == "ย้ายข้าราชการ")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "MOVE")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -2258,7 +2260,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
var placementProfiles = await _context.PlacementProfiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "PREPARE-CONTAIN")
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -2389,7 +2391,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.PlacementStatus = "CONTAIN");
|
||||
data.ForEach(profile => profile.PlacementStatus = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
|
@ -2414,7 +2416,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => x.Placement!.PlacementType!.Name == "เลื่อนข้าราชการ")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "SLIP")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -2432,7 +2434,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
var placementProfiles = await _context.PlacementProfiles
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "PREPARE-CONTAIN")
|
||||
.Where(x => x.PlacementStatus.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
@ -2563,7 +2565,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.PlacementStatus = "CONTAIN");
|
||||
data.ForEach(profile => profile.PlacementStatus = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -914,7 +914,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
placementProfiles.ForEach(profile => profile.Status = "PENDING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -495,6 +495,25 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ลบส่งรายชื่อออกคำสั่ง C-PM-16
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command/report/delete")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportDelete([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.PlacementRepatriations
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-16 คำสั่งส่งตัวกลับ
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -793,7 +793,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "REPORTREPORT");
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -660,7 +660,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
placementProfiles.ForEach(profile => profile.Status = "WAITTING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -815,7 +815,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
|
||||
placementProfiles.ForEach(profile => profile.Status = "WAITTING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1927,7 +1927,7 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
|
|||
var placementProfiles = await _context.RetirementResigns
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "DONECANCEL");
|
||||
placementProfiles.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1945,9 +1945,9 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
|
|||
{
|
||||
var placementProfiles = await _context.RetirementResigns
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "DONECANCEL")
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "DONE");
|
||||
placementProfiles.ForEach(profile => profile.Status = "DONECANCEL");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue