fix เอกสารแนบท้าย คำสั่ง01-05

This commit is contained in:
Bright 2024-10-22 09:25:17 +07:00
parent 4bec812d25
commit 142f87ce57
2 changed files with 121 additions and 90 deletions

View file

@ -817,23 +817,23 @@ namespace BMA.EHR.Placement.Service.Controllers
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.EducationOld == null ? "-" : p.EducationOld,
OldOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldOc = (p.OrganizationPositionOld == null ? "-" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
OldPositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld,
OldPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld,
OldPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
LeaveDate = "",
NewOc = (p.position == null ? "" : p.position) + "/" + (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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();

View file

@ -1557,31 +1557,31 @@ namespace BMA.EHR.Placement.Service.Controllers
{
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
PositionName = p.positionName == null ? "" : p.positionName,
ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" :
p.PlacementEducations.FirstOrDefault().Degree,
PositionName = p.positionName == null ? "-" : p.positionName,
ExamNumber = p.ExamNumber == null ? "-" : p.ExamNumber.Value.ToString().ToThaiNumber(),
PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}",
Oc = p.root == null ? "" :
p.node == 4 ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 3 ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 2 ? $"{p.child2}/{p.child1}/{p.root}" :
p.node == 1 ? $"{p.child1}/{p.root}" :
p.node == 0 ? $"{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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
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(),
p.node == 4 ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 3 ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 2 ? $"{p.child2}/{p.child1}/{p.root}" :
p.node == 1 ? $"{p.child1}/{p.root}" :
p.node == 0 ? $"{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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
Salary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
OccupationPosition = p.OccupationPosition == null ? "" : p.OccupationPosition, //ตำแหน่งเก่าก่อนสอบ
PositionCandidate = p.PositionCandidate == null ? "" : p.PositionCandidate.Name //ตำแหน่งที่สอบแข่งขัน
OccupationPosition = p.OccupationPosition == null ? "-" : p.OccupationPosition, //ตำแหน่งเก่าก่อนสอบ
PositionCandidate = p.PositionCandidate == null ? "-" : p.PositionCandidate.Name //ตำแหน่งที่สอบแข่งขัน
}).ToList();
return Success(report_data);
}
@ -1811,6 +1811,7 @@ namespace BMA.EHR.Placement.Service.Controllers
var report_data = (from p in _context.PlacementProfiles
.Include(x => x.Placement)
.Include(x => x.PlacementEducations)
.Include(x => x.PositionCandidate)
// .ThenInclude(x => x.PlacementType)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
// .Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
@ -1823,24 +1824,30 @@ namespace BMA.EHR.Placement.Service.Controllers
{
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree,
PositionName = p.positionName == null ? "" : p.positionName,
ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" :
p.PlacementEducations.FirstOrDefault().Degree,
PositionName = p.positionName == null ? "-" : p.positionName,
ExamNumber = p.ExamNumber == null ? "-" : 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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
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(),
Oc = p.root == null ? "" :
p.node == 4 ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 3 ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 2 ? $"{p.child2}/{p.child1}/{p.root}" :
p.node == 1 ? $"{p.child1}/{p.root}" :
p.node == 0 ? $"{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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
Salary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
PositionCandidate = p.PositionCandidate == null ? "-" : p.PositionCandidate.Name
}).ToList();
return Success(report_data);
}
@ -2084,29 +2091,41 @@ namespace BMA.EHR.Placement.Service.Controllers
{
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" :
p.PlacementEducations.FirstOrDefault().Degree,
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 ? "" :
OldOc = p.rootOld == null ? "" :
p.nodeOld == "4" ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
p.nodeOld == "3" ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
p.nodeOld == "2" ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" :
p.nodeOld == "1" ? $"{p.child1Old}/{p.rootOld}" :
p.nodeOld == "0" ? $"{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() :
p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
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.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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldPosition = p.positionNameOld == null ? "-" : p.positionNameOld,
NewOc = p.root == null ? "" :
p.node == 4 ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 3 ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 2 ? $"{p.child2}/{p.child1}/{p.root}" :
p.node == 1 ? $"{p.child1}/{p.root}" :
p.node == 0 ? $"{p.root}" : "",
NewPosition = p.positionName == null ? "-" : p.positionName,
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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
@ -2256,29 +2275,41 @@ namespace BMA.EHR.Placement.Service.Controllers
{
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" :
p.PlacementEducations.FirstOrDefault().Degree,
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() :
p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
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.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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
OldOc = p.rootOld == null ? "" :
p.nodeOld == "4" ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
p.nodeOld == "3" ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
p.nodeOld == "2" ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" :
p.nodeOld == "1" ? $"{p.child1Old}/{p.rootOld}" :
p.nodeOld == "0" ? $"{p.rootOld}" : "",
OldPosition = p.positionNameOld == null ? "-" : p.positionNameOld,
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() :
p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
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.node == 4 ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 3 ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 2 ? $"{p.child2}/{p.child1}/{p.root}" :
p.node == 1 ? $"{p.child1}/{p.root}" :
p.node == 0 ? $"{p.root}" : "",
NewPosition = p.positionName == null ? "-" : p.positionName,
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() :
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();