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

@ -771,7 +771,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
data.ForEach(profile => profile.Status = "NEW");
await _context.SaveChangesAsync();
@ -863,7 +863,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
data.ForEach(profile => profile.Status = "NEW");
await _context.SaveChangesAsync();
@ -964,7 +964,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineReport_Profiles
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
data.ForEach(profile => profile.Status = "PENDING");
await _context.SaveChangesAsync();
@ -995,7 +995,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
try
{
var data = await _context.DisciplineReport_Profiles
.Where(x => x.Status == "REPORT")
// .Where(x => x.Status == "REPORT")
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
@ -1032,7 +1032,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineReport_Profiles
.Include(x => x.DisciplineDisciplinary)
.Where(x => x.Status == "REPORT")
// .Where(x => x.Status == "REPORT")
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
var resultData = (from p in data
@ -1114,7 +1114,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineReport_Profiles
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
data.ForEach(profile => profile.Status = "PENDING");
await _context.SaveChangesAsync();
@ -1140,7 +1140,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
var data = await _context.DisciplineReport_Profiles
.Include(x => x.DisciplineDisciplinary)
.Where(x => x.Status == "REPORT")
// .Where(x => x.Status == "REPORT")
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
var resultData = (from p in data
@ -1222,7 +1222,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
data.ForEach(profile => profile.Status = "NEW");
await _context.SaveChangesAsync();
@ -1329,7 +1329,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
data.ForEach(profile => profile.Status = "NEW");
await _context.SaveChangesAsync();
@ -1436,7 +1436,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
data.ForEach(profile => profile.Status = "NEW");
await _context.SaveChangesAsync();
@ -1543,7 +1543,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
data.ForEach(profile => profile.Status = "NEW");
await _context.SaveChangesAsync();
@ -1650,7 +1650,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.StatusDiscard.ToUpper() == "REPORT")
// .Where(x => x.StatusDiscard.ToUpper() == "REPORT")
.ToListAsync();
data.ForEach(profile => profile.StatusDiscard = "NEW");
await _context.SaveChangesAsync();
@ -1764,13 +1764,13 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data1 = await _context.DisciplineInvestigate_ProfileComplaints
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.IsReport == "REPORT")
// .Where(x => x.IsReport == "REPORT")
.ToListAsync();
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")
// .Where(x => x.IsReport == "REPORT")
.ToListAsync();
data2.ForEach(profile => profile.IsReport = "NEW");
@ -1797,7 +1797,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{
var data = await _context.DisciplineInvestigate_ProfileComplaints
.Include(x => x.DisciplineInvestigate)
.Where(x => x.IsReport == "REPORT")
// .Where(x => x.IsReport == "REPORT")
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
string? _null = null;
@ -1838,7 +1838,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
var data1 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Include(x => x.DisciplineDisciplinary)
.Where(x => x.IsReport == "REPORT")
// .Where(x => x.IsReport == "REPORT")
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
var resultData1 = (from p in data1

View file

@ -775,7 +775,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var placementProfiles = await _context.PlacementAppointments
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "PENDING");
await _context.SaveChangesAsync();
@ -808,21 +808,18 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
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(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.position == null ? "" : p.position,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
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() :
@ -831,7 +828,6 @@ namespace BMA.EHR.Placement.Service.Controllers
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(),
Reason = p.Reason == null ? "-" : p.Reason,
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
@ -937,7 +933,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var placementProfiles = await _context.PlacementAppointments
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "PENDING");
await _context.SaveChangesAsync();
@ -970,21 +966,18 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
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(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.position == null ? "" : p.position,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
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() :
@ -993,7 +986,6 @@ namespace BMA.EHR.Placement.Service.Controllers
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(),
Reason = p.Reason == null ? "-" : p.Reason,
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
@ -1099,7 +1091,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var placementProfiles = await _context.PlacementAppointments
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "PENDING");
await _context.SaveChangesAsync();
@ -1132,21 +1124,18 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
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(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.position == null ? "" : p.position,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
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() :
@ -1155,7 +1144,6 @@ namespace BMA.EHR.Placement.Service.Controllers
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(),
Reason = p.Reason == null ? "-" : p.Reason,
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
@ -1263,7 +1251,7 @@ namespace BMA.EHR.Placement.Service.Controllers
var placementProfiles = await _context.PlacementAppointments
.Where(x => req.refIds.Contains(x.Id.ToString()))
// .Where(x => x.type == "EMPLOYEE")
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "PENDING");
await _context.SaveChangesAsync();
@ -1297,16 +1285,13 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
Seq = r.Sequence.ToString().ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = p.rootOld,
OldOrganization = p.OrganizationOld,
OldPositionName = p.positionOld,
OldOrganization = (p.positionOld == null ? "" : p.positionOld) + "/" + (p.OrganizationOld == null ? "" : p.OrganizationOld),
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld.ToThaiNumber(),
OldPositionNumber = p.PositionNumberOld == null ? null : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.position == null ? "" : p.position,
NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root),
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName.ToThaiNumber(),
NewPositionNumber = p.posMasterNo == null ? "" :
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
@ -1315,7 +1300,6 @@ namespace BMA.EHR.Placement.Service.Controllers
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(),
Reason = p.Reason == null ? "-" : p.Reason,
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
@ -1420,7 +1404,7 @@ namespace BMA.EHR.Placement.Service.Controllers
var placementProfiles = await _context.PlacementAppointments
.Where(x => req.refIds.Contains(x.Id.ToString()))
// .Where(x => x.type == "EMPLOYEE")
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "PENDING");
await _context.SaveChangesAsync();
@ -1454,17 +1438,12 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
Seq = r.Sequence.ToString().ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = p.OrganizationPositionOld,
OldOrganization = p.OrganizationOld,
OldPositionName = p.positionOld,
OldPositionLevel = p.PositionLevelOld,
OldOc = (p.positionOld == null ? "" : p.positionOld) + "/" + (p.OrganizationOld == null ? "" : p.OrganizationOld),
OldPositionNumber = p.PositionNumberOld == null ? null : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.position == null ? "" : p.position,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root),
NewPositionNumber = p.posMasterNo == null ? "" :
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
@ -1472,7 +1451,6 @@ namespace BMA.EHR.Placement.Service.Controllers
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(),
Reason = p.Reason == null ? "-" : p.Reason,
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();

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() :

View file

@ -602,7 +602,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var placementProfiles = await _context.PlacementOfficers
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
await _context.SaveChangesAsync();
@ -635,8 +635,7 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
Organization = p.Organization == null ? "" : p.Organization,

View file

@ -912,7 +912,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var placementProfiles = await _context.PlacementReceives
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "PENDING");
await _context.SaveChangesAsync();
@ -945,20 +945,16 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Education = p.EducationOld == null ? "-" : p.EducationOld,
OldOc = p.OrganizationPositionOld ?? "",
OldPositionName = p.OrganizationPositionOld ?? "",
OldPositionLevel = p.PositionLevelOld ?? "",
OldPositionType = p.PositionTypeOld ?? "",
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldPositionLevel = p.PositionLevelOld ?? "",
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.position == null ? "" : p.position,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
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() :
@ -967,7 +963,6 @@ namespace BMA.EHR.Placement.Service.Controllers
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(),
Reason = p.Reason == null ? "-" : p.Reason,
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();

View file

@ -791,7 +791,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var placementProfiles = await _context.PlacementTransfers
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
await _context.SaveChangesAsync();
@ -824,19 +824,18 @@ namespace BMA.EHR.Placement.Service.Controllers
orderby r.Sequence
select new
{
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
PositionName = p.PositionOld == null ? "" : p.PositionOld,
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
Oc = (p.PositionOld == null ? "" : p.PositionOld) + "/" + (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld),
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
ActiveDate = p.Date == null ? "" : p.Date.Value.ToThaiShortDate2().ToThaiNumber(),
//ReceiveOrganizationName = r.Command!.ReceiveOrganizationName ?? "",
ReceiveOrganizationName = "",
Reason = p.Reason ?? ""
ActiveDate = p.Date == null ? "" : p.Date.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason ?? "",
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
return Success(report_data);
}

View file

@ -658,7 +658,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{
var placementProfiles = await _context.RetirementOthers
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "WAITTING");
await _context.SaveChangesAsync();
@ -691,26 +691,21 @@ namespace BMA.EHR.Retirement.Service.Controllers
orderby r.Sequence
select new
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
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(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.rootOld == null ? "" : p.rootOld,
NewPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
LeaveDate = "",
NewOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
LeaveDate = p.LeaveDate == null ? "" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
@ -813,7 +808,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{
var placementProfiles = await _context.RetirementOthers
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "WAITTING");
await _context.SaveChangesAsync();
@ -846,27 +841,22 @@ namespace BMA.EHR.Retirement.Service.Controllers
orderby r.Sequence
select new
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
No = r.Sequence.ToString().ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
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(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.rootOld == null ? "" : p.rootOld,
NewPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
LeaveDate = "",
MilitaryDate = p.MilitaryDate == null ? "" : p.MilitaryDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
LeaveDate = p.LeaveDate == null ? "" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
MilitaryDate = p.MilitaryDate == null ? "" : p.MilitaryDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();

View file

@ -499,7 +499,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{
var placementProfiles = await _context.RetirementResigns
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
// .Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
await _context.SaveChangesAsync();

View file

@ -1810,54 +1810,6 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
return Success();
}
/// <summary>
/// เอกสารแนบท้าย C-PM-23
/// </summary>
/// <param name="id">Record Id ของคำสั่ง</param>
/// <param name="exportType">pdf, docx หรือ xlsx</param>
/// <returns></returns>
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPost("employee/report/attachment")]
[AllowAnonymous]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<ResponseObject>> PostReportEmployeeAttachment([FromBody] ReportAttachmentRequest req)
{
try
{
var report_data = (from p in _context.RetirementResigns
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToList()
join r in req.refIds
on p.Id.ToString() equals r.refId
orderby r.Sequence
select new
{
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = p.OrganizationPositionOld ?? "",
PositionName = p.PositionOld ?? "",
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld.ToThaiNumber(),
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld.ToThaiNumber(),
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
RetireDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiFullDate3().ToThaiNumber(),
CommandYear = r.CommandYear.ToThaiYear().ToString().ToThaiNumber(),
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
return Success(report_data);
}
catch
{
throw;
}
}
/// <summary>
/// ออกคำสั่ง C-PM-23 คำสั่งให้ลูกจ้างออกจากราชการ
/// </summary>