แก้ออกคำสั่ง
This commit is contained in:
parent
d128960111
commit
85d9754db6
8 changed files with 124 additions and 103 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue