Merge branch 'develop' into working

This commit is contained in:
Suphonchai Phoonsawat 2024-06-27 19:31:42 +07:00
commit def2b8f7fe
11 changed files with 1650 additions and 1056 deletions

View file

@ -92,7 +92,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" : Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree, p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Oc = p.root == null ? "" : p.root, Oc = p.root == null ? "" : p.root,
PositionName = p.positionName == null ? "" : p.positionName, PositionName = p.positionName == null ? "" : p.positionName,
@ -151,7 +151,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" : Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree, p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Oc = p.root == null ? "" : p.root, Oc = p.root == null ? "" : p.root,
PositionName = p.positionName == null ? "" : p.positionName, PositionName = p.positionName == null ? "" : p.positionName,
@ -215,7 +215,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" : Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree, p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = pf.Oc == null ? "" : pf.Oc.Replace("/", " "), OldOc = pf.Oc == null ? "" : pf.Oc.Replace("/", " "),
Probation = pf.IsProbation ? "(อยู่ระหว่างปฏิบัติหน้าที่ราชการ)" : "", Probation = pf.IsProbation ? "(อยู่ระหว่างปฏิบัติหน้าที่ราชการ)" : "",
@ -285,7 +285,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" : Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
p.PlacementEducations.FirstOrDefault().Degree, p.PlacementEducations.FirstOrDefault().Degree,
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = pf.Oc == null ? "" : pf.Oc.Replace("/", " "), OldOc = pf.Oc == null ? "" : pf.Oc.Replace("/", " "),
OldPositionName = pf.Position == null ? "" : pf.Position.Name, OldPositionName = pf.Position == null ? "" : pf.Position.Name,
@ -351,13 +351,13 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
Education = p.EducationOld == null ? "-" : p.EducationOld, Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld, OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld, OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root, NewOc = p.root == null ? "" : p.root,
@ -421,13 +421,13 @@ namespace BMA.EHR.Application.Repositories.Commands
// pf.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree, // pf.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
Education = p.EducationOld == null ? "-" : p.EducationOld, Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld, OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld, OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root, NewOc = p.root == null ? "" : p.root,
@ -475,20 +475,20 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
Education = p.EducationOld == null ? "-" : p.EducationOld, Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld, OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld, OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.rootOld == null ? "" : p.rootOld, NewOc = p.rootOld == null ? "" : p.rootOld,
NewPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, NewPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld, NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
LeaveDate = p.LeaveDate == null ? "" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(), LeaveDate = p.LeaveDate == null ? "" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
@ -525,20 +525,20 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
Education = p.EducationOld == null ? "-" : p.EducationOld, Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.rootOld == null ? "" : p.rootOld, OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld, OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
NewOc = p.rootOld == null ? "" : p.rootOld, NewOc = p.rootOld == null ? "" : p.rootOld,
NewPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, NewPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld, NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
LeaveDate = p.LeaveDate == null ? "" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(), LeaveDate = p.LeaveDate == null ? "" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
@ -570,7 +570,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName, IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName, AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition, AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PlacementCommandIssuer = r.Command.PlacementCommandIssuer ?? "", PlacementCommandIssuer = r.Command.PlacementCommandIssuer ?? "",
PlacementCommandNo = r.Command.PlacementCommandNo == null ? "" : r.Command.PlacementCommandNo.ToThaiNumber(), PlacementCommandNo = r.Command.PlacementCommandNo == null ? "" : r.Command.PlacementCommandNo.ToThaiNumber(),
@ -606,7 +606,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName, IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName, AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition, AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PlacementCommandIssuer = r.Command.PlacementCommandIssuer ?? "", PlacementCommandIssuer = r.Command.PlacementCommandIssuer ?? "",
PlacementCommandNo = r.Command.PlacementCommandNo == null ? "" : r.Command.PlacementCommandNo.ToThaiNumber(), PlacementCommandNo = r.Command.PlacementCommandNo == null ? "" : r.Command.PlacementCommandNo.ToThaiNumber(),
@ -647,13 +647,13 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType13Response select new CommandType13Response
{ {
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, Organization = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
PositionName = p.PositionOld == null ? "" : p.PositionOld, PositionName = p.PositionOld == null ? "" : p.PositionOld,
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld, PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
//Salary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), //Salary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
ActiveDate = p.Date == null ? "" : p.Date.Value.ToThaiShortDate2().ToThaiNumber(), ActiveDate = p.Date == null ? "" : p.Date.Value.ToThaiShortDate2().ToThaiNumber(),
@ -695,7 +695,7 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
Education = p.EducationOld == null ? "-" : p.EducationOld, Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = p.OrganizationPositionOld ?? "", OldOc = p.OrganizationPositionOld ?? "",
OldPositionName = p.OrganizationPositionOld ?? "", OldPositionName = p.OrganizationPositionOld ?? "",
@ -744,7 +744,7 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType15Response select new CommandType15Response
{ {
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, PositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
// PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name, // PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
@ -836,7 +836,7 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType17Response select new CommandType17Response
{ {
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PositionName = p.PositionOld ?? "", PositionName = p.PositionOld ?? "",
Organization = p.OrganizationPositionOld ?? "", Organization = p.OrganizationPositionOld ?? "",
@ -888,7 +888,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName, IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName, AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition, AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
// PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name, // PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
Organization = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, Organization = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
@ -943,7 +943,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName, IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName, AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition, AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name, PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
Organization = p.OrganizationPositionOld ?? "", Organization = p.OrganizationPositionOld ?? "",
@ -997,7 +997,7 @@ namespace BMA.EHR.Application.Repositories.Commands
IssuerOrganizationName = r.Command.IssuerOrganizationName, IssuerOrganizationName = r.Command.IssuerOrganizationName,
AuthorizedUserFullName = r.Command.AuthorizedUserFullName, AuthorizedUserFullName = r.Command.AuthorizedUserFullName,
AuthorizedPosition = r.Command.AuthorizedPosition, AuthorizedPosition = r.Command.AuthorizedPosition,
CitizenId = r.CitizenId, CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name, PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
Organization = p.OrganizationPositionOld ?? "", Organization = p.OrganizationPositionOld ?? "",
@ -1060,7 +1060,7 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType21Response select new CommandType21Response
{ {
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId.ToThaiNumber(), CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = r.Organization == null ? "" : r.Organization.ToThaiNumber(), Organization = r.Organization == null ? "" : r.Organization.ToThaiNumber(),
PositionName = r.PositionName == null ? "" : r.PositionName.ToThaiNumber(), PositionName = r.PositionName == null ? "" : r.PositionName.ToThaiNumber(),
@ -1192,7 +1192,7 @@ namespace BMA.EHR.Application.Repositories.Commands
select new CommandType21Response select new CommandType21Response
{ {
Seq = r.Sequence.ToString().ToThaiNumber(), Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId.ToThaiNumber(), CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = p.OrganizationPositionOld ?? "", Organization = p.OrganizationPositionOld ?? "",
PositionName = p.PositionOld ?? "", PositionName = p.PositionOld ?? "",
@ -1311,7 +1311,7 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
fullName = $"{org.result.prefix}{org.result.firstName} {org.result.lastName}", fullName = $"{org.result.prefix}{org.result.firstName} {org.result.lastName}",
positionname = org.result.position, positionname = org.result.position,
positionno = org.result.posNo, positionno = org.result.posNo == null ? null : org.result.posNo.ToThaiNumber(),
organizationname = org.result.organization, organizationname = org.result.organization,
salary = org.result.salary == null ? null : org.result.salary.Value.ToNumericNoDecimalText().ToString(), salary = org.result.salary == null ? null : org.result.salary.Value.ToNumericNoDecimalText().ToString(),
}; };

View file

@ -2764,7 +2764,7 @@ namespace BMA.EHR.Application.Repositories.Commands
isProbation = true, isProbation = true,
isLeave = false, isLeave = false,
dateRetire = (DateTime?)null, dateRetire = (DateTime?)null,
dateAppoint = placementProfile.RecruitDate == null ? (DateTime?)null : placementProfile.RecruitDate, dateAppoint = command.CommandAffectDate == null ? null : command.CommandAffectDate,
dateStart = command.CommandAffectDate == null ? null : command.CommandAffectDate, dateStart = command.CommandAffectDate == null ? null : command.CommandAffectDate,
govAgeAbsent = 0, govAgeAbsent = 0,
govAgePlus = 0, govAgePlus = 0,
@ -5562,6 +5562,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
}); });
var _baseAPI = _configuration["API"]; var _baseAPI = _configuration["API"];
@ -5710,6 +5714,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
}); });
var _baseAPI = _configuration["API"]; var _baseAPI = _configuration["API"];
@ -6346,6 +6354,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
}); });
var baseAPI = _configuration["API"]; var baseAPI = _configuration["API"];
@ -6475,6 +6487,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
}); });
var baseAPI = _configuration["API"]; var baseAPI = _configuration["API"];
@ -6605,6 +6621,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
}); });
var baseAPI = _configuration["API"]; var baseAPI = _configuration["API"];
@ -6735,6 +6755,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ตัดเงินเดือน"
}); });
var baseAPI = _configuration["API"]; var baseAPI = _configuration["API"];
@ -6865,6 +6889,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งลงโทษ ลดขั้นเงินเดือน"
}); });
var baseAPI = _configuration["API"]; var baseAPI = _configuration["API"];
@ -6995,6 +7023,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งเพิ่มโทษ"
}); });
var baseAPI = _configuration["API"]; var baseAPI = _configuration["API"];
@ -7125,6 +7157,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งงดโทษ"
}); });
var baseAPI = _configuration["API"]; var baseAPI = _configuration["API"];
@ -7255,6 +7291,10 @@ namespace BMA.EHR.Application.Repositories.Commands
{ {
PersonId = x.RefPlacementProfileId, PersonId = x.RefPlacementProfileId,
Id = x.RefDisciplineId, Id = x.RefDisciplineId,
CommandAffectDate = command.CommandAffectDate,
CommandNo = command.CommandNo,
CommandYear = command.CommandYear.ToInteger().ToThaiYear(),
Detail = "คำสั่งยุติเรื่อง"
}); });
var baseAPI = _configuration["API"]; var baseAPI = _configuration["API"];

View file

@ -1,4 +1,6 @@
using System.Drawing; using System.Drawing;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using BMA.EHR.Application.Common.Interfaces; using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Messaging; using BMA.EHR.Application.Messaging;
using BMA.EHR.Domain.Models.HR; using BMA.EHR.Domain.Models.HR;
@ -404,7 +406,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
throw new Exception("คำขอนี้ยังไม่ได้รับการอนุมัติจากผู้บังคับบัญชา ไม่สามารถทำรายการได้"); throw new Exception("คำขอนี้ยังไม่ได้รับการอนุมัติจากผู้บังคับบัญชา ไม่สามารถทำรายการได้");
} }
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(rawData.KeycloakUserId,AccessToken); var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(rawData.KeycloakUserId, AccessToken);
if (profile == null) if (profile == null)
{ {
throw new Exception(GlobalMessages.DataNotFound); throw new Exception(GlobalMessages.DataNotFound);
@ -421,19 +423,38 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
// insert to profile leave // insert to profile leave
var profileLeave = new ProfileLeave // var profileLeave = new ProfileLeave
// {
// DateStartLeave = rawData.LeaveStartDate,
// DateEndLeave = rawData.LeaveEndDate,
// TotalLeave = rawData.LeaveTotal,
// Status = "approve",
// Reason = rawData.LeaveDetail,
// ProfileId = profile.Id, // change from profile object to id
// TypeLeave = leaveType
// };
// _appDbContext.Set<ProfileLeave>().Add(profileLeave);
var _baseAPI = _configuration["API"];
var apiUrlSalary = $"{_baseAPI}/org/profile/leave";
using (var client = new HttpClient())
{ {
DateStartLeave = rawData.LeaveStartDate, client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
DateEndLeave = rawData.LeaveEndDate, var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{
TotalLeave = rawData.LeaveTotal, profileId = profile.Id,
Status = "approve", leaveTypeId = leaveType?.Id ?? null,
Reason = rawData.LeaveDetail, dateLeaveStart = rawData.LeaveStartDate,
dateLeaveEnd = rawData.LeaveEndDate,
ProfileId = profile.Id, // change from profile object to id leaveDays = 0,//หน้า fe ไม่ได้ใช้
TypeLeave = leaveType leaveCount = 0,//หน้า fe ไม่ได้ใช้
}; totalLeave = rawData.LeaveTotal,
_appDbContext.Set<ProfileLeave>().Add(profileLeave); status = "approve",
reason = rawData.LeaveDetail,
});
// var _result = await _res.Content.ReadAsStringAsync();
}
await _appDbContext.SaveChangesAsync(); await _appDbContext.SaveChangesAsync();
// insert to process timestamp // insert to process timestamp

View file

@ -11,6 +11,8 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Swashbuckle.AspNetCore.Annotations; using Swashbuckle.AspNetCore.Annotations;
using System.Configuration;
using System.Net.Http.Headers;
using System.Security.Claims; using System.Security.Claims;
namespace BMA.EHR.DisciplineResult.Service.Controllers namespace BMA.EHR.DisciplineResult.Service.Controllers
@ -26,15 +28,18 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
private readonly DisciplineDbContext _context; private readonly DisciplineDbContext _context;
private readonly MinIODisciplineService _documentService; private readonly MinIODisciplineService _documentService;
private readonly IHttpContextAccessor _httpContextAccessor; private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IConfiguration _configuration;
public DisciplineResultController(DisciplineDbContext context, public DisciplineResultController(DisciplineDbContext context,
MinIODisciplineService documentService, MinIODisciplineService documentService,
IHttpContextAccessor httpContextAccessor) IHttpContextAccessor httpContextAccessor,
IConfiguration configuration)
{ {
// _repository = repository; // _repository = repository;
_context = context; _context = context;
_documentService = documentService; _documentService = documentService;
_httpContextAccessor = httpContextAccessor; _httpContextAccessor = httpContextAccessor;
_configuration = configuration;
} }
#region " Properties " #region " Properties "
@ -42,6 +47,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value; private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
private string? token => _httpContextAccessor?.HttpContext?.Request.Headers["Authorization"];
#endregion #endregion
@ -465,6 +471,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
foreach (var d in req.result) foreach (var d in req.result)
{ {
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Include(x=>x.DisciplineDisciplinary)
.Where(x => x.Status == "REPORT") .Where(x => x.Status == "REPORT")
.Where(x => x.Id == d.id) .Where(x => x.Id == d.id)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
@ -472,6 +479,24 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{ {
data.Status = "NEW"; data.Status = "NEW";
data.CommandTypeId = null; data.CommandTypeId = null;
var baseAPI = _configuration["API"];
var apiUrlDiscipline = $"{baseAPI}org/profile/discipline";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{
profileId = d.personId,
date = d.commandAffectDate,
detail = data.DisciplineDisciplinary.Title,
level = data.DisciplineDisciplinary.DisciplinaryFaultLevel,
refCommandDate = "",
refCommandNo = $"{d.commandNo}/{d.commandYear}",
unStigma = d.detail,
});
var _result = await _res.Content.ReadAsStringAsync();
}
} }
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
} }
@ -492,6 +517,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
foreach (var d in req.result) foreach (var d in req.result)
{ {
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Include(x => x.DisciplineDisciplinary)
.Where(x => x.StatusDiscard == "REPORT") .Where(x => x.StatusDiscard == "REPORT")
.Where(x => x.Id == d.id) .Where(x => x.Id == d.id)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
@ -499,6 +525,24 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
{ {
data.StatusDiscard = "NEW"; data.StatusDiscard = "NEW";
data.CommandTypeDiscardId = null; data.CommandTypeDiscardId = null;
var baseAPI = _configuration["API"];
var apiUrlDiscipline = $"{baseAPI}org/profile/discipline";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{
profileId = d.personId,
date = d.commandAffectDate,
detail = data.DisciplineDisciplinary.Title,
level = data.DisciplineDisciplinary.DisciplinaryFaultLevel,
refCommandDate = "",
refCommandNo = $"{d.commandNo}/{d.commandYear}",
unStigma = d.detail,
});
var _result = await _res.Content.ReadAsStringAsync();
}
} }
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
} }
@ -519,17 +563,58 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
foreach (var d in req.result) foreach (var d in req.result)
{ {
var data1 = await _context.DisciplineInvestigate_ProfileComplaints var data1 = await _context.DisciplineInvestigate_ProfileComplaints
.Include(x => x.DisciplineInvestigate)
.Where(x => x.IsReport == "REPORT") .Where(x => x.IsReport == "REPORT")
.Where(x => x.Id == d.id) .Where(x => x.Id == d.id)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
if (data1 != null) if (data1 != null)
{
data1.IsReport = "NEW"; data1.IsReport = "NEW";
var baseAPI = _configuration["API"];
var apiUrlDiscipline = $"{baseAPI}org/profile/discipline";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{
profileId = d.personId,
date = d.commandAffectDate,
detail = data1.DisciplineInvestigate.Title,
level = "",
refCommandDate = "",
refCommandNo = $"{d.commandNo}/{d.commandYear}",
unStigma = d.detail,
});
var _result = await _res.Content.ReadAsStringAsync();
}
}
var data2 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates var data2 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Include(x => x.DisciplineDisciplinary)
.Where(x => x.IsReport == "REPORT") .Where(x => x.IsReport == "REPORT")
.Where(x => x.Id == d.id) .Where(x => x.Id == d.id)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
if (data2 != null) if (data2 != null) {
data2.IsReport = "NEW"; data2.IsReport = "NEW";
var baseAPI = _configuration["API"];
var apiUrlDiscipline = $"{baseAPI}org/profile/discipline";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{
profileId = d.personId,
date = d.commandAffectDate,
detail = data2.DisciplineDisciplinary.Title,
level = data2.DisciplineDisciplinary.DisciplinaryFaultLevel,
refCommandDate = "",
refCommandNo = $"{d.commandNo}/{d.commandYear}",
unStigma = d.detail,
});
var _result = await _res.Content.ReadAsStringAsync();
}
}
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
} }
return Success(); return Success();
@ -549,11 +634,31 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
foreach (var d in req.result) foreach (var d in req.result)
{ {
var data = await _context.DisciplineReport_Profiles var data = await _context.DisciplineReport_Profiles
.Include(x => x.DisciplineDisciplinary)
.Where(x => x.Status == "REPORT") .Where(x => x.Status == "REPORT")
.Where(x => x.Id == d.id) .Where(x => x.Id == d.id)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
if (data != null) if (data != null) {
data.Status = "DONE"; data.Status = "DONE";
var baseAPI = _configuration["API"];
var apiUrlDiscipline = $"{baseAPI}org/profile/discipline";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{
profileId = d.personId,
date = d.commandAffectDate,
detail = data.DisciplineDisciplinary.Title,
level = data.DisciplineDisciplinary.DisciplinaryFaultLevel,
refCommandDate = "",
refCommandNo = $"{d.commandNo}/{d.commandYear}",
unStigma = d.detail,
});
var _result = await _res.Content.ReadAsStringAsync();
}
}
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
} }
return Success(); return Success();

View file

@ -13,5 +13,10 @@ namespace BMA.EHR.Discipline.Service.Requests
public Guid id { get; set; } = Guid.Empty; public Guid id { get; set; } = Guid.Empty;
public Guid personId { get; set; } = Guid.Empty; public Guid personId { get; set; } = Guid.Empty;
public Guid? commandId { get; set; } = Guid.Empty; public Guid? commandId { get; set; } = Guid.Empty;
public DateTime? commandAffectDate { get; set; }
public string? commandNo { get; set; }
public string? commandYear { get; set; }
public string? detail { get; set; }
} }
} }

View file

@ -662,24 +662,24 @@ namespace BMA.EHR.Placement.Service.Controllers
return Success(); return Success();
} }
// /// <summary> /// <summary>
// /// หน่วยงานที่ถูกเลือกไปแล้ว /// หน่วยงานที่ถูกเลือกไปแล้ว
// /// </summary> /// </summary>
// /// <returns></returns> /// <returns></returns>
// /// <response code="200"></response> /// <response code="200"></response>
// /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response> /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
// /// <response code="401">ไม่ได้ Login เข้าระบบ</response> /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
// /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response> /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
// [HttpGet("use")] [HttpGet("use")]
// public async Task<ActionResult<ResponseObject>> GetAppointmentsUse() public async Task<ActionResult<ResponseObject>> GetAppointmentsUse()
// { {
// var appointments = await _context.PlacementAppointments var appointments = await _context.PlacementAppointments
// // .Where(x => x.PositionNumber != null) .Where(x => x.posmasterId != null)
// // .Where(x => x.Profile.ProfileType == "officer") .Where(x => x.Status != "DONE")
// // .Select(x => x.PositionNumber.Id) .Where(x => x.type == "OFFICER")
// .ToListAsync(); .Select(x => x.posmasterId)
.ToListAsync();
// return Success(appointments); return Success(appointments);
// } }
} }
} }

View file

@ -648,24 +648,24 @@ namespace BMA.EHR.Placement.Service.Controllers
return Success(); return Success();
} }
// /// <summary> /// <summary>
// /// หน่วยงานที่ถูกเลือกไปแล้ว /// หน่วยงานที่ถูกเลือกไปแล้ว
// /// </summary> /// </summary>
// /// <returns></returns> /// <returns></returns>
// /// <response code="200"></response> /// <response code="200"></response>
// /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response> /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
// /// <response code="401">ไม่ได้ Login เข้าระบบ</response> /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
// /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response> /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
// [HttpGet("use")] [HttpGet("use")]
// public async Task<ActionResult<ResponseObject>> GetAppointmentsUse() public async Task<ActionResult<ResponseObject>> GetAppointmentsUse()
// { {
// var appointments = await _context.PlacementAppointments var appointments = await _context.PlacementAppointments
// .Where(x => x.PositionNumber != null) .Where(x => x.posmasterId != null)
// .Where(x => x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm") .Where(x => x.Status != "DONE")
// .Select(x => x.PositionNumber.Id) .Where(x => x.type == "EMPLOYEE")
// .ToListAsync(); .Select(x => x.posmasterId)
.ToListAsync();
// return Success(appointments); return Success(appointments);
// } }
} }
} }

View file

@ -1045,17 +1045,6 @@ namespace BMA.EHR.Placement.Service.Controllers
return Success(); return Success();
} }
[HttpGet("position/use")]
public async Task<ActionResult<ResponseObject>> GetPositionUse()
{
var position = await _context.PlacementProfiles
.Where(x => x.PositionNumber != null)
.Select(x => x.PositionNumber)
.ToListAsync();
return Success(position);
}
[HttpPut("position/{personalId:length(36)}")] [HttpPut("position/{personalId:length(36)}")]
public async Task<ActionResult<ResponseObject>> UpdatePositionDraft([FromBody] List<Guid> items, Guid personalId) public async Task<ActionResult<ResponseObject>> UpdatePositionDraft([FromBody] List<Guid> items, Guid personalId)
{ {
@ -1283,5 +1272,24 @@ namespace BMA.EHR.Placement.Service.Controllers
return Success(); return Success();
} }
/// <summary>
/// หน่วยงานที่ถูกเลือกไปแล้ว
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("use")]
public async Task<ActionResult<ResponseObject>> GetPositionUse()
{
var position = await _context.PlacementProfiles
.Where(x => x.posmasterId != null)
.Where(x => x.PlacementStatus != "CONTAIN")
.Select(x => x.posmasterId)
.ToListAsync();
return Success(position);
}
} }
} }

View file

@ -794,23 +794,23 @@ namespace BMA.EHR.Placement.Service.Controllers
return Success(); return Success();
} }
// /// <summary> /// <summary>
// /// หน่วยงานที่ถูกเลือกไปแล้ว /// หน่วยงานที่ถูกเลือกไปแล้ว
// /// </summary> /// </summary>
// /// <returns></returns> /// <returns></returns>
// /// <response code="200"></response> /// <response code="200"></response>
// /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response> /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
// /// <response code="401">ไม่ได้ Login เข้าระบบ</response> /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
// /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response> /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
// [HttpGet("use")] [HttpGet("use")]
// public async Task<ActionResult<ResponseObject>> GetReceiveUse() public async Task<ActionResult<ResponseObject>> GetPositionUse()
// { {
// var receives = await _context.PlacementReceives var position = await _context.PlacementReceives
// .Where(x => x.PositionNumber != null) .Where(x => x.posmasterId != null)
// .Select(x => x.PositionNumber.Id) .Where(x => x.Status != "DONE")
// .ToListAsync(); .Select(x => x.posmasterId)
.ToListAsync();
// return Success(receives); return Success(position);
// } }
} }
} }

View file

@ -525,24 +525,5 @@ namespace BMA.EHR.Placement.Service.Controllers
return Success(); return Success();
} }
/// <summary>
/// หน่วยงานที่ถูกเลือกไปแล้ว
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("use")]
public async Task<ActionResult<ResponseObject>> GetRelocationUse()
{
var relocation = await _context.PlacementRelocations
.Where(x => x.PositionNumber != null)
.Select(x => x.PositionNumber.Id)
.ToListAsync();
return Success(relocation);
}
} }
} }

File diff suppressed because it is too large Load diff