Merge branch 'develop' into develop-Bright
# Conflicts: # BMA.EHR.Application/Repositories/Commands/CommandRepository.cs
This commit is contained in:
commit
1c8c0bc537
36 changed files with 37025 additions and 652 deletions
|
|
@ -72,12 +72,12 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
join p in _dbContext.Set<PlacementProfile>()
|
||||
.Include(x => x.PlacementEducations)
|
||||
.Include(x => x.Placement)
|
||||
.Include(x => x.OrganizationPosition)
|
||||
.ThenInclude(x => x.Organization)
|
||||
.Include(x => x.PositionPath)
|
||||
.Include(x => x.PositionLevel)
|
||||
.Include(x => x.PositionNumber)
|
||||
.Include(x => x.PositionType)
|
||||
// .Include(x => x.OrganizationPosition)
|
||||
// .ThenInclude(x => x.Organization)
|
||||
// .Include(x => x.PositionPath)
|
||||
// .Include(x => x.PositionLevel)
|
||||
// .Include(x => x.PositionNumber)
|
||||
// .Include(x => x.PositionType)
|
||||
on r.RefPlacementProfileId equals p.Id
|
||||
orderby r.Sequence
|
||||
select new CommandType01Response
|
||||
|
|
@ -87,13 +87,18 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
CitizenId = r.CitizenId,
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
Oc = p.OrganizationPosition == null || p.OrganizationPosition!.Organization == null ? "" : _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
|
||||
PositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
|
||||
PositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
|
||||
PositionType = p.PositionType == null ? "" : p.PositionType.Name,
|
||||
PositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
|
||||
Oc = p.root == null ? "" : p.root,
|
||||
PositionName = p.positionName == null ? "" : p.positionName,
|
||||
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||
PositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||
PositionNumber = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
Salary = p.Amount == null ? "0" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
|
||||
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().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 = p.RemarkHorizontal,
|
||||
|
|
@ -141,13 +146,18 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
CitizenId = r.CitizenId,
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
Oc = p.OrganizationPosition == null || p.OrganizationPosition!.Organization == null ? "" : _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
|
||||
PositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
|
||||
PositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
|
||||
PositionType = p.PositionType == null ? "" : p.PositionType.Name,
|
||||
PositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
|
||||
Oc = p.root == null ? "" : p.root,
|
||||
PositionName = p.positionName == null ? "" : p.positionName,
|
||||
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||
PositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||
PositionNumber = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
Salary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
ExamNumber = p.ExamNumber == null ? "" : p.ExamNumber.Value.ToString().ToThaiNumber(),
|
||||
PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}",
|
||||
RemarkHorizontal = p.RemarkHorizontal,
|
||||
|
|
@ -207,13 +217,18 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
OldPositionType = pf.PositionType == null ? "" : pf.PositionType.Name,
|
||||
OldPositionNumber = pf.PosNo == null ? "" : pf.PosNo.Name.ToThaiNumber(),
|
||||
OldSalary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewOc = p.OrganizationPosition == null || p.OrganizationPosition!.Organization == null ? "" : _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
|
||||
NewPositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
|
||||
NewPositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
|
||||
NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
|
||||
NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
|
||||
NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
NewOc = p.root == null ? "" : p.root,
|
||||
NewPositionName = p.positionName == null ? "" : p.positionName,
|
||||
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
RemarkHorizontal = p.RemarkHorizontal,
|
||||
RemarkVertical = p.RemarkVertical,
|
||||
})
|
||||
|
|
@ -271,13 +286,18 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
OldPositionType = pf.PositionType == null ? "" : pf.PositionType.Name,
|
||||
OldPositionNumber = pf.PosNo == null ? "" : pf.PosNo.Name.ToThaiNumber(),
|
||||
OldSalary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewOc = p.OrganizationPosition == null || p.OrganizationPosition!.Organization == null ? "" : _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
|
||||
NewPositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
|
||||
NewPositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
|
||||
NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
|
||||
NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
|
||||
NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber()
|
||||
NewOc = p.root == null ? "" : p.root,
|
||||
NewPositionName = p.positionName == null ? "" : p.positionName,
|
||||
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber()
|
||||
})
|
||||
.ToList();
|
||||
|
||||
|
|
@ -327,7 +347,7 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
CitizenId = r.CitizenId,
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||
OldPositionName = p.OrganizationOld == null ? "" : p.OrganizationOld,
|
||||
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
|
||||
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
|
||||
|
|
@ -397,7 +417,7 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
CitizenId = r.CitizenId,
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||
OldPositionName = p.OrganizationOld == null ? "" : p.OrganizationOld,
|
||||
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
|
||||
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
|
||||
|
|
@ -442,49 +462,29 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
|
||||
var report_data = (from r in raw_data
|
||||
join p in _dbContext.Set<RetirementOther>()
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Salaries)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Position)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PositionLevel)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PositionType)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PosNo)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Educations)
|
||||
// .Include(x => x.OrganizationPosition)
|
||||
// .ThenInclude(x => x.Organization)
|
||||
// .Include(x => x.PositionPath)
|
||||
// .Include(x => x.PositionLevel)
|
||||
// .Include(x => x.PositionNumber)
|
||||
// .Include(x => x.PositionType)
|
||||
on r.RefPlacementProfileId equals p.Id
|
||||
orderby r.Sequence
|
||||
select new CommandType03Response
|
||||
{
|
||||
// Education = p.Profile.Educations == null || p.Profile.Educations.Count == 0 ? "" :
|
||||
// p.Profile.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
|
||||
Education = p.EducationOld == null ? "-" : p.EducationOld,
|
||||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
CitizenId = r.CitizenId,
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
// OldOc = p.Profile.Oc == null ? "" : p.Profile.Oc.Replace("/", " "),
|
||||
// OldPositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
|
||||
// OldPositionLevel = p.Profile.PositionLevel == null ? "" : p.Profile.PositionLevel.Name,
|
||||
// OldPositionType = p.Profile.PositionType == null ? "" : p.Profile.PositionType.Name,
|
||||
// OldPositionNumber = p.Profile.PosNo == null ? "" : p.Profile.PosNo.Name.ToThaiNumber(),
|
||||
// OldSalary = p.Profile.Salaries == null || p.Profile.Salaries.Count == 0 ? "" : p.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
|
||||
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
|
||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
// NewOc = p.OrganizationPosition == null || p.OrganizationPosition!.Organization == null ? "" : _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
|
||||
// NewPositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
|
||||
// NewPositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
|
||||
// NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
|
||||
// NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.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,
|
||||
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
|
||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
// LeaveDate = p.Profile.LeaveDate == null ? "" : p.Profile.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
LeaveDate = p.LeaveDate == null ? "" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Reason = p.Reason == null ? "-" : p.Reason,
|
||||
})
|
||||
.ToList();
|
||||
|
|
@ -512,49 +512,29 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
|
||||
var report_data = (from r in raw_data
|
||||
join p in _dbContext.Set<RetirementOther>()
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Salaries)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Position)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PositionLevel)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PositionType)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PosNo)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Educations)
|
||||
// .Include(x => x.OrganizationPosition)
|
||||
// .ThenInclude(x => x.Organization)
|
||||
// .Include(x => x.PositionPath)
|
||||
// .Include(x => x.PositionLevel)
|
||||
// .Include(x => x.PositionNumber)
|
||||
// .Include(x => x.PositionType)
|
||||
on r.RefPlacementProfileId equals p.Id
|
||||
orderby r.Sequence
|
||||
select new CommandType03Response
|
||||
{
|
||||
// Education = p.Profile.Educations == null || p.Profile.Educations.Count == 0 ? "" :
|
||||
// p.Profile.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
|
||||
Education = p.EducationOld == null ? "-" : p.EducationOld,
|
||||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
CitizenId = r.CitizenId,
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
// OldOc = p.Profile.Oc == null ? "" : p.Profile.Oc.Replace("/", " "),
|
||||
// OldPositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name,
|
||||
// OldPositionLevel = p.Profile.PositionLevel == null ? "" : p.Profile.PositionLevel.Name,
|
||||
// OldPositionType = p.Profile.PositionType == null ? "" : p.Profile.PositionType.Name,
|
||||
// OldPositionNumber = p.Profile.PosNo == null ? "" : p.Profile.PosNo.Name.ToThaiNumber(),
|
||||
// OldSalary = p.Profile.Salaries == null || p.Profile.Salaries.Count == 0 ? "" : p.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
|
||||
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
|
||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
// NewOc = p.OrganizationPosition == null || p.OrganizationPosition!.Organization == null ? "" : _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
|
||||
// NewPositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
|
||||
// NewPositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
|
||||
// NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
|
||||
// NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.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,
|
||||
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||
NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
|
||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
// LeaveDate = p.Profile.LeaveDate == null ? "" : p.Profile.LeaveDate.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,
|
||||
})
|
||||
|
|
@ -656,24 +636,17 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
var report_data = (from r in raw_data
|
||||
join p in _dbContext.Set<PlacementTransfer>()
|
||||
on r.RefPlacementProfileId equals p.Id
|
||||
join pf in _dbContext.Set<Profile>()
|
||||
.Include(x => x.Position)
|
||||
.Include(x => x.PositionLevel)
|
||||
.Include(x => x.PositionType)
|
||||
.Include(x => x.PosNo)
|
||||
.Include(x => x.Salaries)
|
||||
on r.CitizenId equals pf.CitizenId
|
||||
orderby r.Sequence
|
||||
select new CommandType13Response
|
||||
{
|
||||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
CitizenId = r.CitizenId,
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
Organization = pf.Oc == null ? "" : pf.Oc.Replace("/", " "),
|
||||
PositionName = pf.Position == null ? "" : pf.Position.Name,
|
||||
PositionLevel = pf.PositionLevel == null ? "" : pf.PositionLevel.Name,
|
||||
PositionType = pf.PositionType == null ? "" : pf.PositionType.Name,
|
||||
PositionNumber = pf.PosNo == null ? "" : pf.PosNo.Name.ToThaiNumber(),
|
||||
Organization = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
|
||||
PositionName = p.PositionOld == null ? "" : p.PositionOld,
|
||||
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld,
|
||||
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(),
|
||||
ActiveDate = p.Date == null ? "" : p.Date.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
|
|
@ -723,11 +696,16 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
OldPositionType = p.PositionTypeOld ?? "",
|
||||
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
// NewOc = p.OrganizationPosition == null || p.OrganizationPosition!.Organization == null ? "" : _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
|
||||
// NewPositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
|
||||
// NewPositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
|
||||
// NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
|
||||
// NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
|
||||
NewOc = p.root == null ? "" : p.root,
|
||||
NewPositionName = p.position == null ? "" : p.position,
|
||||
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Reason = p.Reason == null ? "-" : p.Reason,
|
||||
|
|
@ -1051,39 +1029,39 @@ namespace BMA.EHR.Application.Repositories.Commands
|
|||
}
|
||||
|
||||
var report_data = (from r in raw_data
|
||||
join p in _dbContext.Set<OrganizationEmployeeProfile>()
|
||||
.Include(x => x.Profile)
|
||||
.ThenInclude(x => x.Position)
|
||||
.Include(x => x.Profile)
|
||||
.ThenInclude(x => x.PositionLevel)
|
||||
.Include(x => x.Profile)
|
||||
.ThenInclude(x => x.PositionType)
|
||||
.Include(x => x.Profile)
|
||||
.ThenInclude(x => x.PosNo)
|
||||
.Include(x => x.OrgEmployee)
|
||||
.ThenInclude(x => x.OrganizationAgency)
|
||||
.ThenInclude(x => x.OrganizationOrganization)
|
||||
//.Include(x => x.OrgEmployee)
|
||||
//.ThenInclude(x => x.PosNo)
|
||||
.Include(x => x.OrgEmployee)
|
||||
.ThenInclude(x => x.PositionEmployeePosition)
|
||||
.Include(x => x.OrgEmployee)
|
||||
.ThenInclude(x => x.OrganizationPositionEmployeeLevels)
|
||||
.ThenInclude(x => x.PositionEmployeeLevel)
|
||||
on r.RefPlacementProfileId equals p.Id
|
||||
// join p in _dbContext.Set<OrganizationEmployeeProfile>()
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Position)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PositionLevel)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PositionType)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PosNo)
|
||||
// .Include(x => x.OrgEmployee)
|
||||
// .ThenInclude(x => x.OrganizationAgency)
|
||||
// .ThenInclude(x => x.OrganizationOrganization)
|
||||
// //.Include(x => x.OrgEmployee)
|
||||
// //.ThenInclude(x => x.PosNo)
|
||||
// .Include(x => x.OrgEmployee)
|
||||
// .ThenInclude(x => x.PositionEmployeePosition)
|
||||
// .Include(x => x.OrgEmployee)
|
||||
// .ThenInclude(x => x.OrganizationPositionEmployeeLevels)
|
||||
// .ThenInclude(x => x.PositionEmployeeLevel)
|
||||
// on r.RefPlacementProfileId equals p.Id
|
||||
orderby r.Sequence
|
||||
select new CommandType21Response
|
||||
{
|
||||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
CitizenId = r.CitizenId.ToThaiNumber(),
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
Organization = p.OrgEmployee == null || p.OrgEmployee!.OrganizationAgency == null || p.OrgEmployee!.OrganizationAgency!.OrganizationOrganization == null ? "" : p.OrgEmployee!.OrganizationAgency!.OrganizationOrganization!.Name,
|
||||
PositionName = p.OrgEmployee == null || p.OrgEmployee.PositionEmployeePosition == null ? "" : p.OrgEmployee.PositionEmployeePosition.Name.ToThaiNumber(),
|
||||
PositionLevel = p.OrgEmployee == null || p.OrgEmployee.OrganizationPositionEmployeeLevels == null ? "" : p.OrgEmployee.OrganizationPositionEmployeeLevels.First().PositionEmployeeLevel.Name.ToThaiNumber(),
|
||||
PositionType = p.Profile.PositionType == null ? "" : p.Profile.PositionType.Name.ToThaiNumber(),
|
||||
PositionNumber = p.OrgEmployee.PosNo == null ? "" : p.OrgEmployee.PosNo.ToThaiNumber(),
|
||||
Organization = r.Organization == null ? "" : r.Organization.ToThaiNumber(),
|
||||
PositionName = r.PositionName == null ? "" : r.PositionName.ToThaiNumber(),
|
||||
PositionLevel = r.PositionLevel == null ? "" : r.PositionLevel.ToThaiNumber(),
|
||||
PositionType = r.PositionType == null ? "" : r.PositionType.ToThaiNumber(),
|
||||
PositionNumber = r.PositionNumber == null ? "" : r.PositionNumber.ToThaiNumber(),
|
||||
Salary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
RetireDate = p.Profile.BirthDate.CalculateRetireDate().ToThaiFullDate3().ToThaiNumber(),
|
||||
RetireDate = r.BirthDate == null ? "" : r.BirthDate.Value.CalculateRetireDate().ToThaiFullDate3().ToThaiNumber(),
|
||||
CommandYear = r.Command.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber()
|
||||
})
|
||||
.ToList();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
47
BMA.EHR.Application/Responses/OrgRequest.cs
Normal file
47
BMA.EHR.Application/Responses/OrgRequest.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Application.Responses
|
||||
{
|
||||
public class OrgRequest
|
||||
{
|
||||
public OrgRequestData result { get; set; } = new();
|
||||
}
|
||||
public class OrgRequestData
|
||||
{
|
||||
public string? profileId { get; set; }
|
||||
public string? prefix { get; set; }
|
||||
public string? firstName { get; set; }
|
||||
public string? lastName { get; set; }
|
||||
public string? citizenId { get; set; }
|
||||
public string? root { get; set; }
|
||||
public string? rootId { get; set; }
|
||||
public string? rootShortName { get; set; }
|
||||
public string? child1 { get; set; }
|
||||
public string? child1Id { get; set; }
|
||||
public string? child1ShortName { get; set; }
|
||||
public string? child2 { get; set; }
|
||||
public string? child2Id { get; set; }
|
||||
public string? child2ShortName { get; set; }
|
||||
public string? child3 { get; set; }
|
||||
public string? child3Id { get; set; }
|
||||
public string? child3ShortName { get; set; }
|
||||
public string? child4 { get; set; }
|
||||
public string? child4Id { get; set; }
|
||||
public string? child4ShortName { get; set; }
|
||||
public string? node { get; set; }
|
||||
public string? nodeId { get; set; }
|
||||
public string? nodeShortName { get; set; }
|
||||
public int? posMasterNo { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? posTypeId { get; set; }
|
||||
public string? posTypeName { get; set; }
|
||||
public int? posTypeRank { get; set; }
|
||||
public string? posLevelId { get; set; }
|
||||
public string? posLevelName { get; set; }
|
||||
public int? posLevelRank { get; set; }
|
||||
public string? posExecutiveId { get; set; }
|
||||
public string? posExecutiveName { get; set; }
|
||||
public string? posNo { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -11,10 +11,18 @@
|
|||
{
|
||||
public Guid id { get; set; } = Guid.Empty;
|
||||
public string citizenId { get; set; } = string.Empty;
|
||||
public string prefix { get; set; } = string.Empty;
|
||||
public string? prefix { get; set; } = string.Empty;
|
||||
public string firstName { get; set; } = string.Empty;
|
||||
public string lastName { get; set; } = string.Empty;
|
||||
public string? profileId { get; set; } = string.Empty;
|
||||
// public Guid? commandId { get; set; } = Guid.Empty;
|
||||
|
||||
|
||||
public DateTime? BirthDate { get; set; }
|
||||
public string? Organization { get; set; }
|
||||
public string? PositionName { get; set; }
|
||||
public string? PositionLevel { get; set; }
|
||||
public string? PositionType { get; set; }
|
||||
public string? PositionNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4569,7 +4569,7 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
PersonalId = r.Id,
|
||||
Sequence = r.Sequence,
|
||||
IdCard = r.CitizenId,
|
||||
Name = $"{r.FirstName!} {r.LastName!}",
|
||||
Name = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
SelectStatus = r.RefPlacementProfileId == null ? false : (existed.FirstOrDefault(x => x.RefPlacementProfileId!.Value == r.RefPlacementProfileId!.Value) != null),
|
||||
Education = "" // ยังหาไม่เจอว่าอยุ่ field ไหน
|
||||
}).ToList();
|
||||
|
|
|
|||
|
|
@ -47,5 +47,19 @@ namespace BMA.EHR.Domain.Models.Commands.Core
|
|||
|
||||
[Comment("เงินค่าตอบแทนรายเดือน")]
|
||||
public double? MouthSalaryAmount { get; set; }
|
||||
|
||||
|
||||
[MaxLength(40), Comment("วันเกิด")]
|
||||
public DateTime? BirthDate { get; set; }
|
||||
[Comment("ชื่อหน่วยงาน root")]
|
||||
public string? Organization { get; set; }
|
||||
[Comment("ตำแหน่ง")]
|
||||
public string? PositionName { get; set; }
|
||||
[Comment("ระดับ")]
|
||||
public string? PositionLevel { get; set; }
|
||||
[Comment("ประเภท")]
|
||||
public string? PositionType { get; set; }
|
||||
[Comment("เลขที่ตำแหน่ง")]
|
||||
public string? PositionNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ namespace BMA.EHR.Domain.Models.Retirement
|
|||
public DateTime? PositionDate { get; set; }
|
||||
[Comment("วันที่พ้นจากราชการทหาร")]
|
||||
public DateTime? MilitaryDate { get; set; }
|
||||
[Comment("วันที่ออกราชการเมื่อ")]
|
||||
public DateTime? LeaveDate { get; set; }
|
||||
|
||||
|
||||
[Comment("profile Id")]
|
||||
|
|
|
|||
17924
BMA.EHR.Infrastructure/Migrations/20240611162221_update table RetirementOther add leavedate.Designer.cs
generated
Normal file
17924
BMA.EHR.Infrastructure/Migrations/20240611162221_update table RetirementOther add leavedate.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,75 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableRetirementOtheraddleavedate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ProfileLeaves_Profiles_ProfileId",
|
||||
table: "ProfileLeaves");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "LeaveDate",
|
||||
table: "RetirementOthers",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่ออกราชการเมื่อ");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "ProfileId",
|
||||
table: "ProfileLeaves",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)",
|
||||
oldNullable: true)
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ProfileLeaves_Profiles_ProfileId",
|
||||
table: "ProfileLeaves",
|
||||
column: "ProfileId",
|
||||
principalTable: "Profiles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ProfileLeaves_Profiles_ProfileId",
|
||||
table: "ProfileLeaves");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LeaveDate",
|
||||
table: "RetirementOthers");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "ProfileId",
|
||||
table: "ProfileLeaves",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)")
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ProfileLeaves_Profiles_ProfileId",
|
||||
table: "ProfileLeaves",
|
||||
column: "ProfileId",
|
||||
principalTable: "Profiles",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
||||
17949
BMA.EHR.Infrastructure/Migrations/20240617051330_update table CommandReceiver add Position.Designer.cs
generated
Normal file
17949
BMA.EHR.Infrastructure/Migrations/20240617051330_update table CommandReceiver add Position.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,91 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableCommandReceiveraddPosition : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "BirthDate",
|
||||
table: "CommandReceivers",
|
||||
type: "datetime(6)",
|
||||
maxLength: 40,
|
||||
nullable: true,
|
||||
comment: "วันเกิด");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Organization",
|
||||
table: "CommandReceivers",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ชื่อหน่วยงาน root")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "PositionLevel",
|
||||
table: "CommandReceivers",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ระดับ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "PositionName",
|
||||
table: "CommandReceivers",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "PositionNumber",
|
||||
table: "CommandReceivers",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "เลขที่ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "PositionType",
|
||||
table: "CommandReceivers",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ประเภท")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BirthDate",
|
||||
table: "CommandReceivers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Organization",
|
||||
table: "CommandReceivers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PositionLevel",
|
||||
table: "CommandReceivers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PositionName",
|
||||
table: "CommandReceivers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PositionNumber",
|
||||
table: "CommandReceivers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PositionType",
|
||||
table: "CommandReceivers");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -508,6 +508,11 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnType("double")
|
||||
.HasComment("เงินเดือน");
|
||||
|
||||
b.Property<DateTime?>("BirthDate")
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันเกิด");
|
||||
|
||||
b.Property<string>("CitizenId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(13)
|
||||
|
|
@ -582,10 +587,30 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnType("double")
|
||||
.HasComment("เงินค่าตอบแทนรายเดือน");
|
||||
|
||||
b.Property<string>("Organization")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อหน่วยงาน root");
|
||||
|
||||
b.Property<string>("PositionLevel")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ระดับ");
|
||||
|
||||
b.Property<string>("PositionName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ตำแหน่ง");
|
||||
|
||||
b.Property<string>("PositionNumber")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เลขที่ตำแหน่ง");
|
||||
|
||||
b.Property<double?>("PositionSalaryAmount")
|
||||
.HasColumnType("double")
|
||||
.HasComment("เงินประจำตำแหน่ง");
|
||||
|
||||
b.Property<string>("PositionType")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ประเภท");
|
||||
|
||||
b.Property<string>("Prefix")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
|
|
@ -4174,7 +4199,7 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnType("double")
|
||||
.HasComment("ลาครั้งที่");
|
||||
|
||||
b.Property<Guid?>("ProfileId")
|
||||
b.Property<Guid>("ProfileId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Reason")
|
||||
|
|
@ -14423,6 +14448,10 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<DateTime?>("LeaveDate")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่ออกราชการเมื่อ");
|
||||
|
||||
b.Property<DateTime?>("MilitaryDate")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่พ้นจากราชการทหาร");
|
||||
|
|
@ -16432,16 +16461,16 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeave", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
|
||||
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", null)
|
||||
.WithMany("Leaves")
|
||||
.HasForeignKey("ProfileId");
|
||||
.HasForeignKey("ProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("BMA.EHR.Domain.Models.HR.TypeLeave", "TypeLeave")
|
||||
.WithMany()
|
||||
.HasForeignKey("TypeLeaveId");
|
||||
|
||||
b.Navigation("Profile");
|
||||
|
||||
b.Navigation("TypeLeave");
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -533,7 +533,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
uppdated.orgRevisionId = req.orgRevisionId;
|
||||
uppdated.positionId = req.positionId;
|
||||
uppdated.posMasterNo = req.posMasterNo;
|
||||
uppdated.position = req.position;
|
||||
uppdated.position = req.positionName;
|
||||
uppdated.positionField = req.positionField;
|
||||
uppdated.posTypeId = req.posTypeId;
|
||||
uppdated.posTypeName = req.posTypeName;
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
uppdated.orgRevisionId = req.orgRevisionId;
|
||||
uppdated.positionId = req.positionId;
|
||||
uppdated.posMasterNo = req.posMasterNo;
|
||||
uppdated.position = req.position;
|
||||
uppdated.position = req.positionName;
|
||||
uppdated.positionField = req.positionField;
|
||||
uppdated.posTypeId = req.posTypeId;
|
||||
uppdated.posTypeName = req.posTypeName;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,132 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// list รายการช่วยราชการของ Keycloak
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("keycloak")]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByKeycloak()
|
||||
{
|
||||
var apiUrl = $"{_configuration["API"]}org/profile/keycloak/position";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
|
||||
|
||||
var placementOfficers = await _context.PlacementOfficers.AsQueryable()
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Where(x => x.Status == "DONE")
|
||||
.Where(x => x.profileId == org.result.profileId)
|
||||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
p.lastName,
|
||||
p.rootOld,
|
||||
p.rootOldId,
|
||||
p.rootShortNameOld,
|
||||
p.child1Old,
|
||||
p.child1OldId,
|
||||
p.child1ShortNameOld,
|
||||
p.child2Old,
|
||||
p.child2OldId,
|
||||
p.child2ShortNameOld,
|
||||
p.child3Old,
|
||||
p.child3OldId,
|
||||
p.child3ShortNameOld,
|
||||
p.child4Old,
|
||||
p.child4OldId,
|
||||
p.child4ShortNameOld,
|
||||
p.PositionOld,
|
||||
p.posMasterNoOld,
|
||||
p.posTypeOldId,
|
||||
p.posTypeNameOld,
|
||||
p.posLevelOldId,
|
||||
p.posLevelNameOld,
|
||||
p.CreatedAt,
|
||||
p.Reason,
|
||||
p.Status,
|
||||
p.DateStart,
|
||||
p.DateEnd,
|
||||
p.Organization,
|
||||
p.OrganizationPositionOld,
|
||||
p.IsActive,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
return Success(placementOfficers);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// list รายการช่วยราชการของ ProfileId
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("profileId/{id}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByProfileId(string id)
|
||||
{
|
||||
var placementOfficers = await _context.PlacementOfficers.AsQueryable()
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Where(x => x.Status == "DONE")
|
||||
.Where(x => x.profileId == id)
|
||||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
p.lastName,
|
||||
p.rootOld,
|
||||
p.rootOldId,
|
||||
p.rootShortNameOld,
|
||||
p.child1Old,
|
||||
p.child1OldId,
|
||||
p.child1ShortNameOld,
|
||||
p.child2Old,
|
||||
p.child2OldId,
|
||||
p.child2ShortNameOld,
|
||||
p.child3Old,
|
||||
p.child3OldId,
|
||||
p.child3ShortNameOld,
|
||||
p.child4Old,
|
||||
p.child4OldId,
|
||||
p.child4ShortNameOld,
|
||||
p.PositionOld,
|
||||
p.posMasterNoOld,
|
||||
p.posTypeOldId,
|
||||
p.posTypeNameOld,
|
||||
p.posLevelOldId,
|
||||
p.posLevelNameOld,
|
||||
p.CreatedAt,
|
||||
p.Reason,
|
||||
p.Status,
|
||||
p.DateStart,
|
||||
p.DateEnd,
|
||||
p.Organization,
|
||||
p.OrganizationPositionOld,
|
||||
p.IsActive,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
return Success(placementOfficers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get รายละเอียดช่วยราชการเจ้าหน้าที่
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -633,7 +633,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
uppdated.orgRevisionId = req.orgRevisionId;
|
||||
uppdated.positionId = req.positionId;
|
||||
uppdated.posMasterNo = req.posMasterNo;
|
||||
uppdated.position = req.position;
|
||||
uppdated.position = req.positionName;
|
||||
uppdated.positionField = req.positionField;
|
||||
uppdated.posTypeId = req.posTypeId;
|
||||
uppdated.posTypeName = req.posTypeName;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace BMA.EHR.Placement.Service.Requests
|
|||
public string? orgRevisionId { get; set; }
|
||||
public int? posMasterNo { get; set; }
|
||||
public string? positionId { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? positionName { get; set; }
|
||||
public string? positionField { get; set; }
|
||||
public string? posTypeId { get; set; }
|
||||
public string? posTypeName { get; set; }
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace BMA.EHR.Placement.Service.Requests
|
|||
public string? orgRevisionId { get; set; }
|
||||
public int? posMasterNo { get; set; }
|
||||
public string? positionId { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? positionName { get; set; }
|
||||
public string? positionField { get; set; }
|
||||
public string? posTypeId { get; set; }
|
||||
public string? posTypeName { get; set; }
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace BMA.EHR.Placement.Service.Requests
|
|||
public string? orgRevisionId { get; set; }
|
||||
public int? posMasterNo { get; set; }
|
||||
public string? positionId { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? positionName { get; set; }
|
||||
public string? positionField { get; set; }
|
||||
public string? posTypeId { get; set; }
|
||||
public string? posTypeName { get; set; }
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using Telerik.Reporting;
|
||||
using Telerik.Reporting.Processing;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace BMA.EHR.Report.Service.Controllers
|
||||
{
|
||||
|
|
@ -158,10 +159,12 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
dynamic knowledges = probation.GetType().GetProperty("Knowledge").GetValue(probation);
|
||||
foreach (var knowledge in knowledges)
|
||||
{
|
||||
string output = Regex.Replace(knowledge.description, "<.*?>", string.Empty);
|
||||
output = output.Replace(" ", " ");
|
||||
_knowledgeList.Add(new
|
||||
{
|
||||
Title = knowledge.title,
|
||||
Description =knowledge.description
|
||||
Description = output
|
||||
});
|
||||
}
|
||||
var tblKnowledges = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["table3"];
|
||||
|
|
@ -171,11 +174,13 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
dynamic competencys = probation.GetType().GetProperty("Competency").GetValue(probation);
|
||||
foreach (var competency in competencys)
|
||||
{
|
||||
string output = Regex.Replace(competency.description, "<.*?>", string.Empty);
|
||||
output = output.Replace(" ", " ");
|
||||
_competencysList.Add(new
|
||||
{
|
||||
Id = competency.id,
|
||||
Title = competency.title,
|
||||
Description = competency.description
|
||||
Description = output
|
||||
});
|
||||
}
|
||||
var tblCompetencys = (Telerik.Reporting.Table)report2.Items["detailSection1"].Items["table4"];
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -90,7 +90,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
var org = JsonConvert.DeserializeObject<Requests.OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
|
||||
|
|
@ -286,7 +286,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
var org = JsonConvert.DeserializeObject<Requests.OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
|
||||
|
|
@ -320,6 +320,23 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
await _context.RetirementDeceaseds.AddAsync(retirementDeceased);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var _baseAPI = _configuration["API"];
|
||||
var _apiUrl = $"{_baseAPI}/org/profile/leave/{req.ProfileId}";
|
||||
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, _apiUrl);
|
||||
var _res = await client.PostAsJsonAsync(_apiUrl, new
|
||||
{
|
||||
isLeave = true,
|
||||
leaveReason = "ถึงแก่กรรม",
|
||||
leaveDate = req.Date,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var _doc = new Domain.Models.Documents.Document();
|
||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||
{
|
||||
|
|
@ -384,15 +401,15 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
// {
|
||||
retirementDeceased.RetirementDeceasedNotis.Add(new RetirementDeceasedNoti
|
||||
{
|
||||
CitizenId = retirementDeceased.citizenId,
|
||||
Prefix = retirementDeceased.prefix,
|
||||
FirstName = retirementDeceased.firstName,
|
||||
LastName = retirementDeceased.lastName,
|
||||
CitizenId = retirementDeceased.citizenId == null ? "" : retirementDeceased.citizenId,
|
||||
Prefix = retirementDeceased.prefix == null ? "" : retirementDeceased.prefix,
|
||||
FirstName = retirementDeceased.firstName == null ? "" : retirementDeceased.firstName,
|
||||
LastName = retirementDeceased.lastName == null ? "" : retirementDeceased.lastName,
|
||||
IsSendMail = true,
|
||||
IsSendInbox = true,
|
||||
IsSendNotification = true,
|
||||
// OrganizationName = retirementDeceased.OrganizationName,
|
||||
PositionName = retirementDeceased.position,
|
||||
PositionName = retirementDeceased.position == null ? "" : retirementDeceased.position,
|
||||
profileId = req.ProfileId,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
|
|
@ -557,7 +574,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
var org = JsonConvert.DeserializeObject<Requests.OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
retirementOther.posLevelOldId = org.result.posLevelId;
|
||||
retirementOther.posLevelNameOld = org.result.posLevelName;
|
||||
|
||||
retirementOther.LeaveDate = org.result.leaveDate;
|
||||
retirementOther.PositionOld = org.result.position;
|
||||
retirementOther.PositionLevelOld = org.result.posLevelName;
|
||||
retirementOther.PositionTypeOld = org.result.posTypeName;
|
||||
|
|
|
|||
|
|
@ -269,6 +269,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
p.posLevelOldId,
|
||||
p.posLevelNameOld,
|
||||
p.IsNoDebt,
|
||||
p.IsNoBurden,
|
||||
p.IsDiscipline,
|
||||
// Avatar = p.Profile.Avatar == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Avatar.Id,
|
||||
RetirementResignDocs = p.RetirementResignDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
// RetirementResignDebtDocs = p.RetirementResignDebtDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
|
|
@ -356,6 +358,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
data.posLevelOldId,
|
||||
data.posLevelNameOld,
|
||||
data.IsNoDebt,
|
||||
data.IsNoBurden,
|
||||
data.IsDiscipline,
|
||||
// Avatar = data.Avatar == Guid.Parse("00000000-0000-0000-0000-000000000000") ? null : await _documentService.ImagesPath(data.Avatar),
|
||||
Docs = retirementResignDocs,
|
||||
// DocDebts = retirementResignDebtDocs,
|
||||
|
|
|
|||
|
|
@ -43,5 +43,6 @@ namespace BMA.EHR.Retirement.Service.Requests
|
|||
public string? posExecutiveId { get; set; }
|
||||
public string? posExecutiveName { get; set; }
|
||||
public string? posNo { get; set; }
|
||||
public DateTime? leaveDate { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue