no message

This commit is contained in:
kittapath 2024-10-10 19:26:01 +07:00
parent 1c7b3b1c6c
commit edd5bfe0c2
9 changed files with 126 additions and 224 deletions

View file

@ -1503,7 +1503,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() == "REPORT")
// .Where(x => x.PlacementStatus.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
await _context.SaveChangesAsync();
@ -1529,7 +1529,8 @@ namespace BMA.EHR.Placement.Service.Controllers
try
{
var report_data = (from p in _context.PlacementProfiles
// .Include(x => x.Placement)
.Include(x => x.Placement)
.Include(x => x.PlacementEducations)
// .ThenInclude(x => x.PlacementType)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
// .Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
@ -1540,15 +1541,16 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Oc = p.root == null ? "" : p.root,
PositionName = p.positionName == null ? "" : p.positionName,
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}",
Oc = (p.positionName == null ? "" : p.positionName) + "/" + (p.root == null ? "" : p.root),
PositionType = p.posTypeName == null ? "" : p.posTypeName,
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
PositionNumber = p.posMasterNo == null ? "" :
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
@ -1557,8 +1559,6 @@ namespace BMA.EHR.Placement.Service.Controllers
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
Salary = r.Amount == null ? "0" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}",
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
@ -1759,7 +1759,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() == "REPORT")
// .Where(x => x.PlacementStatus.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAI");
await _context.SaveChangesAsync();
@ -1785,7 +1785,8 @@ namespace BMA.EHR.Placement.Service.Controllers
try
{
var report_data = (from p in _context.PlacementProfiles
// .Include(x => x.Placement)
.Include(x => x.Placement)
.Include(x => x.PlacementEducations)
// .ThenInclude(x => x.PlacementType)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
// .Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
@ -1796,15 +1797,16 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Oc = p.root == null ? "" : p.root,
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
PositionName = p.positionName == null ? "" : p.positionName,
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}",
Oc = (p.positionName == null ? "" : p.positionName) + "/" + (p.root == null ? "" : p.root),
PositionType = p.posTypeName == null ? "" : p.posTypeName,
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
PositionNumber = p.posMasterNo == null ? "" :
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
@ -1813,8 +1815,6 @@ namespace BMA.EHR.Placement.Service.Controllers
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
Salary = r.Amount == null ? "0" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}",
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
@ -2015,7 +2015,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() == "REPORT")
// .Where(x => x.PlacementStatus.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
await _context.SaveChangesAsync();
@ -2041,7 +2041,7 @@ namespace BMA.EHR.Placement.Service.Controllers
try
{
var report_data = (from p in _context.PlacementProfiles
// .Include(x => x.Placement)
.Include(x => x.PlacementEducations)
// .ThenInclude(x => x.PlacementType)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
// .Where(x => x.Placement!.PlacementType!.Name == "แต่งตั้งข้าราชการ")
@ -2052,16 +2052,13 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
Probation = "",
OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld,
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
OldOc = (p.positionNameOld == null ? "" : p.positionNameOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
OldPositionNumber = p.posMasterNoOld == null ? "" :
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
@ -2069,11 +2066,9 @@ namespace BMA.EHR.Placement.Service.Controllers
p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.positionName == null ? "" : p.positionName,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
NewOc = (p.positionName == null ? "" : p.positionName) + "/" + (p.root == null ? "" : p.root),
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
NewPositionNumber = p.posMasterNo == null ? "" :
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
@ -2083,7 +2078,7 @@ namespace BMA.EHR.Placement.Service.Controllers
NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical
RemarkVertical = r.RemarkVertical,
}).ToList();
return Success(report_data);
}
@ -2191,7 +2186,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() == "REPORT")
// .Where(x => x.PlacementStatus.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
await _context.SaveChangesAsync();
@ -2217,7 +2212,7 @@ namespace BMA.EHR.Placement.Service.Controllers
try
{
var report_data = (from p in _context.PlacementProfiles
// .Include(x => x.Placement)
.Include(x => x.PlacementEducations)
// .ThenInclude(x => x.PlacementType)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
// .Where(x => x.Placement!.PlacementType!.Name == "แต่งตั้งข้าราชการ")
@ -2228,15 +2223,13 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld,
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
OldOc = (p.positionNameOld == null ? "" : p.positionNameOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
OldPositionNumber = p.posMasterNoOld == null ? "" :
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
@ -2244,10 +2237,9 @@ namespace BMA.EHR.Placement.Service.Controllers
p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.positionName == null ? "" : p.positionName,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
NewOc = (p.positionName == null ? "" : p.positionName) + "/" + (p.root == null ? "" : p.root),
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
NewPositionNumber = p.posMasterNo == null ? "" :
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
@ -2365,7 +2357,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() == "REPORT")
// .Where(x => x.PlacementStatus.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
await _context.SaveChangesAsync();
@ -2391,7 +2383,7 @@ namespace BMA.EHR.Placement.Service.Controllers
try
{
var report_data = (from p in _context.PlacementProfiles
// .Include(x => x.Placement)
.Include(x => x.PlacementEducations)
// .ThenInclude(x => x.PlacementType)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
// .Where(x => x.Placement!.PlacementType!.Name == "เลื่อนข้าราชการ")
@ -2402,15 +2394,13 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld,
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
OldOc = (p.positionNameOld == null ? "" : p.positionNameOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
OldPositionNumber = p.posMasterNoOld == null ? "" :
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
@ -2418,10 +2408,9 @@ namespace BMA.EHR.Placement.Service.Controllers
p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.positionName == null ? "" : p.positionName,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
NewOc = (p.positionName == null ? "" : p.positionName) + "/" + (p.root == null ? "" : p.root),
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
NewPositionNumber = p.posMasterNo == null ? "" :
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :