เกษียณเพิ่มส่วนราชการต้นสังกัด
This commit is contained in:
parent
1f5edf20ed
commit
a2bc99f739
9 changed files with 250 additions and 85 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
using BMA.EHR.Application.Common.Interfaces;
|
using BMA.EHR.Application.Common.Interfaces;
|
||||||
using BMA.EHR.Application.Requests;
|
using BMA.EHR.Application.Requests;
|
||||||
using BMA.EHR.Domain.Models.HR;
|
using BMA.EHR.Domain.Models.HR;
|
||||||
using BMA.EHR.Domain.Models.Insignias;
|
using BMA.EHR.Domain.Models.Insignias;
|
||||||
|
|
@ -238,7 +238,6 @@ namespace BMA.EHR.Application.Repositories
|
||||||
p.IsActive == true &&
|
p.IsActive == true &&
|
||||||
p.IsLeave == false &&
|
p.IsLeave == false &&
|
||||||
p.DateAppoint != null &&
|
p.DateAppoint != null &&
|
||||||
|
|
||||||
p.ProfileType == "employee" &&
|
p.ProfileType == "employee" &&
|
||||||
p.EmployeeClass == "perm"
|
p.EmployeeClass == "perm"
|
||||||
)
|
)
|
||||||
|
|
@ -5359,6 +5358,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
{
|
{
|
||||||
var result_candidate = new List<InsigniaResultSet>();
|
var result_candidate = new List<InsigniaResultSet>();
|
||||||
|
|
||||||
|
var type_coin = await GetCoinCandidate(periodId, ocId);
|
||||||
var employee_type1 = await GetEmployeeInsignia_Type1(periodId, ocId);
|
var employee_type1 = await GetEmployeeInsignia_Type1(periodId, ocId);
|
||||||
var employee_type2 = await GetEmployeeInsignia_Type2(periodId, ocId);
|
var employee_type2 = await GetEmployeeInsignia_Type2(periodId, ocId);
|
||||||
var type1_level1 = await GetInsigniaCandidate_Type1_Level1(periodId, ocId);
|
var type1_level1 = await GetInsigniaCandidate_Type1_Level1(periodId, ocId);
|
||||||
|
|
@ -5375,9 +5375,15 @@ namespace BMA.EHR.Application.Repositories
|
||||||
var type3_level11 = await GetInsigniaCandidate_Type3_Level11(periodId, ocId);
|
var type3_level11 = await GetInsigniaCandidate_Type3_Level11(periodId, ocId);
|
||||||
var type4_level10 = await GetInsigniaCandidate_Type4_Level10(periodId, ocId);
|
var type4_level10 = await GetInsigniaCandidate_Type4_Level10(periodId, ocId);
|
||||||
var type4_level11 = await GetInsigniaCandidate_Type4_Level11(periodId, ocId);
|
var type4_level11 = await GetInsigniaCandidate_Type4_Level11(periodId, ocId);
|
||||||
var type_coin = await GetInsigniaCandidate(periodId, ocId);
|
var type = await GetInsigniaCandidate(periodId, ocId);
|
||||||
|
|
||||||
// union result
|
// union result
|
||||||
|
foreach (var r in type_coin)
|
||||||
|
{
|
||||||
|
var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
||||||
|
if (old == null)
|
||||||
|
result_candidate.Add(r);
|
||||||
|
}
|
||||||
foreach (var r in type4_level11)
|
foreach (var r in type4_level11)
|
||||||
{
|
{
|
||||||
var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
||||||
|
|
@ -5474,7 +5480,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
if (old == null)
|
if (old == null)
|
||||||
result_candidate.Add(r);
|
result_candidate.Add(r);
|
||||||
}
|
}
|
||||||
foreach (var r in type_coin)
|
foreach (var r in type)
|
||||||
{
|
{
|
||||||
var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
||||||
if (old == null)
|
if (old == null)
|
||||||
|
|
@ -5520,64 +5526,105 @@ namespace BMA.EHR.Application.Repositories
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// <summary>
|
//กรองรายชื่อผู้มิสิทธิ์ยื่นขอเหรียญจักรพรรดิมาลา
|
||||||
/// กรองรายชื่อผู้มิสิทธิ์ยื่นขอเหรียญจักรพรรดิมาลา
|
public async Task<List<InsigniaResultSet>> GetCoinCandidate(Guid periodId, Guid ocId)
|
||||||
/// </summary>
|
{
|
||||||
/// <param name="periodId">รหัสของรอบการขอ</param>
|
try
|
||||||
/// <param name="ocId">รหัสโรงเรียน</param>
|
{
|
||||||
/// <returns></returns>
|
var allOc = GetAllIdByRoot(ocId);
|
||||||
// public async List<InsigniaResultSet> GetCoinCandidate(Guid periodId, Guid ocId)
|
|
||||||
// {
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
|
|
||||||
// var allOc = profileService.GetAllIdByRoot(ocId);
|
var period = await _dbContext.Set<InsigniaPeriod>().FirstOrDefaultAsync(p => p.Id == periodId);
|
||||||
|
|
||||||
// var period = await _dbContext.Set<InsigniaPeriods>().FirstOrDefault(p => p.Id == periodId);
|
if (period == null)
|
||||||
|
throw new Exception(GlobalMessages.CoinPeriodNotFound);
|
||||||
|
|
||||||
// if (period == null)
|
var oc = await _dbContext.Set<OrganizationEntity>().FirstOrDefaultAsync(x => x.Id == ocId);
|
||||||
// throw new Exception(GlobalMessages.CoinPeriodNotFound);
|
|
||||||
|
|
||||||
// var oc = await _dbContext.Set<OrganizationCharts>().FirstOrDefault(x => x.OcId == ocId);
|
if (oc == null)
|
||||||
|
throw new Exception(GlobalMessages.OCNotFound);
|
||||||
|
|
||||||
// if (oc == null)
|
|
||||||
// throw new Exception(GlobalMessages.OCNotFound);
|
|
||||||
|
|
||||||
// var result = await _dbContext.Set<Profile>()
|
var inst_profile = _dbContext.Set<Profile>()
|
||||||
// .Include(p => p.Position)
|
.Include(p => p.Prefix)
|
||||||
// .Include(p => p.PosNo)
|
.Include(p => p.Position)
|
||||||
// .Include(p => p.PositionLevel)
|
.Include(p => p.PosNo)
|
||||||
// .Include(p => p.Insignias)
|
.Include(p => p.PositionType)
|
||||||
// .ThenInclude(i => i.Insignia)
|
.Include(p => p.PositionLevel)
|
||||||
// .Include(p => p.Salaries)
|
.Include(p => p.Insignias)
|
||||||
// .Where(p => allOc.Contains(p.OrganizationChart.OcId)
|
.ThenInclude(i => i.Insignia)
|
||||||
// && p.IsLeave == false
|
.Include(p => p.Salaries)
|
||||||
// && p.IsActive == true
|
.Where(p =>
|
||||||
// && p.DateAppoint != null
|
allOc.Contains(p.OcId == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.OcId.Value) &&
|
||||||
// && p.DateAppoint.Value.CalculateGovAgeInYear(0, 0).ToInteger() >= 25)
|
p.IsActive == true &&
|
||||||
// .Select(p => new InsigniaResultSet
|
p.IsLeave == false &&
|
||||||
// {
|
p.DateAppoint != null
|
||||||
// ProfileId = p.Id,
|
)
|
||||||
// Prefix = p.Prefix,
|
.Select(p => new
|
||||||
// FullName = $"{(p.Prefix == null ? null : p.Prefix.Name)}{p.FirstName} {p.LastName}",
|
{
|
||||||
// Position = p.Position.Name,
|
ProfileId = p.Id,
|
||||||
// Rank = p.PositionLevel.Name,
|
Prefix = p.Prefix == null ? null : p.Prefix.Name,
|
||||||
// GovAge = p.DateAppoint.Value.CalculateGovAgeStr(0, 0),
|
FullName = $"{(p.Prefix == null ? null : p.Prefix.Name)}{p.FirstName} {p.LastName}",
|
||||||
// LastInsignia = p.Insignias.Count == 0 ? "" : p.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().Insignia.Name,
|
Position = p.Position == null ? null : p.Position.Name,
|
||||||
// Salary = p.Salaries.Count() == 0 ? null : p.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount,
|
Rank = p.PositionLevel == null ? null : p.PositionLevel.Name,
|
||||||
// PosNo = p.PosNo == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.PosNo.Id,
|
ProfileDateAppoint = p.DateAppoint.Value,
|
||||||
// RequestInsignia = GetInsigniaByName("เหรียญจักรพรรดิมาลา")
|
GovAge = p.DateAppoint.Value.CalculateGovAgeStr(0, 0),
|
||||||
// });
|
PosNo = p.PosNo == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.PosNo.Id,
|
||||||
|
Gender = p.Gender == null ? null : p.Gender.Name,
|
||||||
|
LastInsignia = p.Insignias.Count == 0 ? "" : p.Insignias.Where(x => !x.Insignia.Name.Contains("เหรียญจักรพรรดิมาลา")).OrderByDescending(x => x.Year).FirstOrDefault().Insignia.Name,
|
||||||
|
LastInsigniaId = p.Insignias.Count == 0 ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Insignias.Where(x => !x.Insignia.Name.Contains("เหรียญจักรพรรดิมาลา")).OrderByDescending(x => x.Year).FirstOrDefault().Insignia.Id,
|
||||||
|
Salary = p.Salaries.Count() == 0 ? null : p.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount,
|
||||||
|
});
|
||||||
|
|
||||||
// result = result.Where(x => !x.LastInsignia.Contains("เหรียญจักรพรรดิมาลา"));
|
// check วันที่บรรจะต้องมากกว่า 25 ปี
|
||||||
|
var result = ((from p in inst_profile
|
||||||
|
where p.ProfileDateAppoint <= new DateTime(period.Year - 25, 5, 29)
|
||||||
|
select p)
|
||||||
|
.ToList()
|
||||||
|
.Select(p => new InsigniaResultSet
|
||||||
|
{
|
||||||
|
ProfileId = p.ProfileId,
|
||||||
|
Prefix = p.Prefix,
|
||||||
|
FullName = p.FullName,
|
||||||
|
Position = p.Position,
|
||||||
|
PosNo = p.PosNo,
|
||||||
|
Rank = p.Rank,
|
||||||
|
GovAge = p.GovAge,
|
||||||
|
LastInsignia = p.LastInsignia,
|
||||||
|
LastInsigniaId = p.LastInsigniaId,
|
||||||
|
Salary = p.Salary,
|
||||||
|
RequestInsignia = GetInsigniaByName("เหรียญจักรพรรดิมาลา"),
|
||||||
|
Seq = 1,
|
||||||
|
Gender = p.Gender,
|
||||||
|
MatchingConditions = new List<MatchingCondition>(),
|
||||||
|
})).ToList();
|
||||||
|
|
||||||
// return result.ToList();
|
var result_candidate = new List<InsigniaResultSet>();
|
||||||
// }
|
|
||||||
// catch
|
foreach (var r in result)
|
||||||
// {
|
{
|
||||||
// throw;
|
var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
||||||
// }
|
|
||||||
// }
|
// Check ได้รับหรือเคยยื่นขอไปในปีที่แล้วหรือไม่?
|
||||||
|
if (!CanRequestInsignia(r.ProfileId, period.Year))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Check ว่าชั้นที่ขอสูงกว่าชั้นที่เคยได้รับแล้วหรือไม่?
|
||||||
|
if (!IsHigherLevel2(r.LastInsignia, r.RequestInsignia.Name))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (old == null)
|
||||||
|
{
|
||||||
|
result_candidate.Add(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result_candidate;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -911,23 +911,23 @@ namespace BMA.EHR.Application.Repositories.Reports
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
foreach (var insigniaPeriod in insigniaPeriods)
|
foreach (var insigniaPeriod in insigniaPeriods)
|
||||||
{
|
{
|
||||||
// if (insigniaPeriod.EndDate.AddDays(-insigniaPeriod.Amount).Date == DateTime.Now.Date)
|
if (insigniaPeriod.EndDate.AddDays(-insigniaPeriod.Amount).Date == DateTime.Now.Date)
|
||||||
// {
|
{
|
||||||
await _repositoryNoti.PushNotificationAsync(
|
await _repositoryNoti.PushNotificationAsync(
|
||||||
Guid.Parse("08db721d-ade4-480e-8d84-0853946a0ea5"),
|
Guid.Parse("08db721d-ade4-480e-8d84-0853946a0ea5"),
|
||||||
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round} {insigniaPeriod.EndDate.AddDays(-insigniaPeriod.Amount).Date}",
|
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
|
||||||
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round} {DateTime.Now.Date}",
|
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
|
||||||
"",
|
"",
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
await _repositoryNoti.PushNotificationAsync(
|
await _repositoryNoti.PushNotificationAsync(
|
||||||
Guid.Parse("08db721d-adff-47b0-8762-41cd5c991001"),
|
Guid.Parse("08db721d-adff-47b0-8762-41cd5c991001"),
|
||||||
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
|
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
|
||||||
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
|
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
|
||||||
"",
|
"",
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1151,6 +1151,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
FirstName = x.Profile.FirstName,
|
FirstName = x.Profile.FirstName,
|
||||||
LastName = x.Profile.LastName,
|
LastName = x.Profile.LastName,
|
||||||
CitizenId = x.Profile.CitizenId,
|
CitizenId = x.Profile.CitizenId,
|
||||||
|
Position = x.OrganizationPosition.PositionMaster.PositionPath == null ? "-" : x.OrganizationPosition.PositionMaster.PositionPath.Name,
|
||||||
|
PositionLevel = x.Profile.PositionLevel == null ? "-" : x.Profile.PositionLevel.Name,
|
||||||
IsDirector = x.OrganizationPosition.PositionMaster.IsDirector,
|
IsDirector = x.OrganizationPosition.PositionMaster.IsDirector,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
@ -1173,6 +1175,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
FirstName = x.Profile.FirstName,
|
FirstName = x.Profile.FirstName,
|
||||||
LastName = x.Profile.LastName,
|
LastName = x.Profile.LastName,
|
||||||
CitizenId = x.Profile.CitizenId,
|
CitizenId = x.Profile.CitizenId,
|
||||||
|
Position = x.Profile.Position == null ? "-" : x.Profile.Position.Name,
|
||||||
|
PositionLevel = x.Profile.PositionLevel == null ? "-" : x.Profile.PositionLevel.Name,
|
||||||
IsDirector = x.OrganizationPosition.PositionMaster.IsDirector,
|
IsDirector = x.OrganizationPosition.PositionMaster.IsDirector,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -141,6 +141,96 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
return 999999999;
|
return 999999999;
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task<string> GetAgency(Guid profileId)
|
||||||
|
{
|
||||||
|
var organizationAgency = "-";
|
||||||
|
var _profile = await _context.Profiles
|
||||||
|
.Where(x => x.Id == profileId)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (_profile != null)
|
||||||
|
{
|
||||||
|
if (_profile.ProfileType == "officer")
|
||||||
|
{
|
||||||
|
var organization = await _context.Organizations
|
||||||
|
.Where(x => x.Id == _profile.OcId)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (organization != null)
|
||||||
|
{
|
||||||
|
var _organizationAgency = await _context.Organizations
|
||||||
|
.Include(x => x.OrganizationOrganization)
|
||||||
|
.Where(x => x.Id == organization.OrganizationAgencyId)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (_organizationAgency != null && _organizationAgency.OrganizationOrganization != null)
|
||||||
|
{
|
||||||
|
organizationAgency = _organizationAgency.OrganizationOrganization.Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var profilePosition = await _context.OrganizationEmployees
|
||||||
|
.Include(x => x.OrganizationAgency)
|
||||||
|
.ThenInclude(x => x.OrganizationOrganization)
|
||||||
|
.Where(x => x.Organization != null)
|
||||||
|
.Where(x => x.OrganizationAgency != null)
|
||||||
|
.Where(x => x.OrganizationAgency.OrganizationOrganization != null)
|
||||||
|
.Where(x => x.OrganizationAgency.OrganizationOrganization.Name != null)
|
||||||
|
.Where(x => x.Organization.Id == _profile.OcId)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (profilePosition != null)
|
||||||
|
{
|
||||||
|
organizationAgency = profilePosition.OrganizationAgency.OrganizationOrganization.Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return organizationAgency;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<string> GetGovermentAgency(Guid profileId)
|
||||||
|
{
|
||||||
|
var organizationGovernmentAgency = "-";
|
||||||
|
var _profile = await _context.Profiles
|
||||||
|
.Where(x => x.Id == profileId)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (_profile != null)
|
||||||
|
{
|
||||||
|
if (_profile.ProfileType == "officer")
|
||||||
|
{
|
||||||
|
var organization = await _context.Organizations
|
||||||
|
.Where(x => x.Id == _profile.OcId)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (organization != null)
|
||||||
|
{
|
||||||
|
var _organizationGovernmentAgency = await _context.Organizations
|
||||||
|
.Include(x => x.OrganizationOrganization)
|
||||||
|
.Where(x => x.Id == organization.OrganizationGovernmentAgencyId)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (_organizationGovernmentAgency != null && _organizationGovernmentAgency.OrganizationOrganization != null)
|
||||||
|
{
|
||||||
|
organizationGovernmentAgency = _organizationGovernmentAgency.OrganizationOrganization.Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var profilePosition = await _context.OrganizationEmployees
|
||||||
|
.Include(x => x.OrganizationGovernmentAgency)
|
||||||
|
.ThenInclude(x => x.OrganizationOrganization)
|
||||||
|
.Where(x => x.Organization != null)
|
||||||
|
.Where(x => x.OrganizationGovernmentAgency != null)
|
||||||
|
.Where(x => x.OrganizationGovernmentAgency.OrganizationOrganization != null)
|
||||||
|
.Where(x => x.OrganizationGovernmentAgency.OrganizationOrganization.Name != null)
|
||||||
|
.Where(x => x.Organization.Id == _profile.OcId)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (profilePosition != null)
|
||||||
|
{
|
||||||
|
organizationGovernmentAgency = profilePosition.OrganizationGovernmentAgency.OrganizationOrganization.Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return organizationGovernmentAgency;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -308,6 +398,9 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
var profile_olds = new List<ProfileJsonRequest>();
|
var profile_olds = new List<ProfileJsonRequest>();
|
||||||
foreach (var r in profile_old)
|
foreach (var r in profile_old)
|
||||||
{
|
{
|
||||||
|
var organizationAgency = await GetAgency(r.profileId);
|
||||||
|
var organizationGovernmentAgency = await GetGovermentAgency(r.profileId);
|
||||||
|
|
||||||
var data = new ProfileJsonRequest
|
var data = new ProfileJsonRequest
|
||||||
{
|
{
|
||||||
order = r.order,
|
order = r.order,
|
||||||
|
|
@ -328,6 +421,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
positionEmployeeLevel = r.positionEmployeeLevel,
|
positionEmployeeLevel = r.positionEmployeeLevel,
|
||||||
positionEmployeeGroup = r.positionEmployeeGroup,
|
positionEmployeeGroup = r.positionEmployeeGroup,
|
||||||
posNoEmployee = r.posNoEmployee,
|
posNoEmployee = r.posNoEmployee,
|
||||||
|
organizationAgency = organizationAgency,//หน่วยงานต้นสังกัด
|
||||||
|
organizationGovernmentAgency = organizationGovernmentAgency,//ส่วนราชการต้นสังกัด
|
||||||
};
|
};
|
||||||
profile_olds.Add(data);
|
profile_olds.Add(data);
|
||||||
}
|
}
|
||||||
|
|
@ -465,6 +560,9 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
var profile_news = new List<ProfileJsonRequest>();
|
var profile_news = new List<ProfileJsonRequest>();
|
||||||
foreach (var r in profile_new)
|
foreach (var r in profile_new)
|
||||||
{
|
{
|
||||||
|
var organizationAgency = await GetAgency(r.profileId);
|
||||||
|
var organizationGovernmentAgency = await GetGovermentAgency(r.profileId);
|
||||||
|
|
||||||
var data = new ProfileJsonRequest
|
var data = new ProfileJsonRequest
|
||||||
{
|
{
|
||||||
order = r.order,
|
order = r.order,
|
||||||
|
|
@ -485,6 +583,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
positionEmployeeLevel = r.positionEmployeeLevel,
|
positionEmployeeLevel = r.positionEmployeeLevel,
|
||||||
positionEmployeeGroup = r.positionEmployeeGroup,
|
positionEmployeeGroup = r.positionEmployeeGroup,
|
||||||
posNoEmployee = r.posNoEmployee,
|
posNoEmployee = r.posNoEmployee,
|
||||||
|
organizationAgency = organizationAgency,//หน่วยงานต้นสังกัด
|
||||||
|
organizationGovernmentAgency = organizationGovernmentAgency,//ส่วนราชการต้นสังกัด
|
||||||
};
|
};
|
||||||
profile_news.Add(data);
|
profile_news.Add(data);
|
||||||
}
|
}
|
||||||
|
|
@ -553,6 +653,9 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
var profile_news = new List<ProfileJsonRequest>();
|
var profile_news = new List<ProfileJsonRequest>();
|
||||||
foreach (var r in profile_new)
|
foreach (var r in profile_new)
|
||||||
{
|
{
|
||||||
|
var organizationAgency = await GetAgency(r.profileId);
|
||||||
|
var organizationGovernmentAgency = await GetGovermentAgency(r.profileId);
|
||||||
|
|
||||||
var data = new ProfileJsonRequest
|
var data = new ProfileJsonRequest
|
||||||
{
|
{
|
||||||
order = r.order,
|
order = r.order,
|
||||||
|
|
@ -573,6 +676,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
positionEmployeeLevel = r.positionEmployeeLevel,
|
positionEmployeeLevel = r.positionEmployeeLevel,
|
||||||
positionEmployeeGroup = r.positionEmployeeGroup,
|
positionEmployeeGroup = r.positionEmployeeGroup,
|
||||||
posNoEmployee = r.posNoEmployee,
|
posNoEmployee = r.posNoEmployee,
|
||||||
|
organizationAgency = organizationAgency,//หน่วยงานต้นสังกัด
|
||||||
|
organizationGovernmentAgency = organizationGovernmentAgency,//ส่วนราชการต้นสังกัด
|
||||||
};
|
};
|
||||||
profile_news.Add(data);
|
profile_news.Add(data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,12 +144,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
p.Status,
|
p.Status,
|
||||||
p.Amount,
|
p.Amount,
|
||||||
p.RecruitDate,
|
p.RecruitDate,
|
||||||
PosNoId = p.PositionNumber == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.PositionNumber.Id,
|
PosNo = p.PositionNumber == null ? "-" : p.PositionNumber.Name,
|
||||||
PositionId = p.PositionPath == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.PositionPath.Id,
|
Position = p.PositionPath == null ? "-" : p.PositionPath.Name,
|
||||||
PositionPathSideId = p.PositionPathSide == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.PositionPathSide.Id,
|
PositionPathSide = p.PositionPathSide == null ? "-" : p.PositionPathSide.Name,
|
||||||
PositionTypeId = p.PositionType == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.PositionType.Id,
|
PositionType = p.PositionType == null ? "-" : p.PositionType.Name,
|
||||||
PositionLineId = p.PositionLine == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.PositionLine.Id,
|
PositionLine = p.PositionLine == null ? "-" : p.PositionLine.Name,
|
||||||
PositionLevelId = p.PositionLevel == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.PositionLevel.Id,
|
PositionLevel = p.PositionLevel == null ? "-" : p.PositionLevel.Name,
|
||||||
OrganizationPositionId = p.OrganizationPosition == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.OrganizationPosition.Id,
|
OrganizationPositionId = p.OrganizationPosition == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.OrganizationPosition.Id,
|
||||||
p.CreatedAt,
|
p.CreatedAt,
|
||||||
p.Reason,
|
p.Reason,
|
||||||
|
|
@ -198,12 +198,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
data.Status,
|
data.Status,
|
||||||
data.Amount,
|
data.Amount,
|
||||||
data.RecruitDate,
|
data.RecruitDate,
|
||||||
data.PosNoId,
|
data.PosNo,
|
||||||
data.PositionId,
|
data.Position,
|
||||||
data.PositionPathSideId,
|
data.PositionPathSide,
|
||||||
data.PositionTypeId,
|
data.PositionType,
|
||||||
data.PositionLineId,
|
data.PositionLine,
|
||||||
data.PositionLevelId,
|
data.PositionLevel,
|
||||||
data.OrganizationPositionId,
|
data.OrganizationPositionId,
|
||||||
data.CreatedAt,
|
data.CreatedAt,
|
||||||
data.Reason,
|
data.Reason,
|
||||||
|
|
@ -267,6 +267,13 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
PositionTypeOld = profile.PositionType == null ? null : profile.PositionType.Name,
|
PositionTypeOld = profile.PositionType == null ? null : profile.PositionType.Name,
|
||||||
PositionNumberOld = profile.PosNo == null ? null : profile.PosNo.Name,
|
PositionNumberOld = profile.PosNo == null ? null : profile.PosNo.Name,
|
||||||
OrganizationPositionOld = profile.Position == null ? profile.Oc : $"{profile.Position.Name}-{profile.Oc}",
|
OrganizationPositionOld = profile.Position == null ? profile.Oc : $"{profile.Position.Name}-{profile.Oc}",
|
||||||
|
PositionNumber = profile.PosNo,
|
||||||
|
PositionPath = profile.Position,
|
||||||
|
PositionPathSide = await _context.PositionPathSides.FindAsync(profile.PositionPathSideId),
|
||||||
|
PositionType = profile.PositionType,
|
||||||
|
PositionLine = await _context.PositionLines.FindAsync(profile.PositionLineId),
|
||||||
|
PositionLevel = profile.PositionLevel,
|
||||||
|
// OrganizationPositionId = p.OrganizationPosition == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.OrganizationPosition.Id,
|
||||||
Status = "WAITTING",
|
Status = "WAITTING",
|
||||||
CreatedUserId = UserId ?? "System Administrator",
|
CreatedUserId = UserId ?? "System Administrator",
|
||||||
CreatedFullName = FullName ?? "",
|
CreatedFullName = FullName ?? "",
|
||||||
|
|
|
||||||
|
|
@ -354,8 +354,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
await _repositoryNoti.PushNotificationAsync(
|
await _repositoryNoti.PushNotificationAsync(
|
||||||
Guid.Parse("08db721d-ae2f-4f5d-836a-02d2413df33d"),
|
Guid.Parse("08db721d-ae2f-4f5d-836a-02d2413df33d"),
|
||||||
$"{profile.Prefix?.Name}{profile.FirstName} {profile.LastName} ได้ทำการยื่นคำลาออก",
|
$"{profile.Prefix?.Name}{profile.FirstName} {profile.LastName} ได้ทำการยื่นขอลาออก",
|
||||||
$"{profile.Prefix?.Name}{profile.FirstName} {profile.LastName} ได้ทำการยื่นคำลาออก",
|
$"{profile.Prefix?.Name}{profile.FirstName} {profile.LastName} ได้ทำการยื่นขอลาออก",
|
||||||
"",
|
"",
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -23,5 +23,7 @@ namespace BMA.EHR.Retirement.Service.Requests
|
||||||
public string? positionEmployeeLevel { get; set; }
|
public string? positionEmployeeLevel { get; set; }
|
||||||
public string? positionEmployeeGroup { get; set; }
|
public string? positionEmployeeGroup { get; set; }
|
||||||
public string? posNoEmployee { get; set; }
|
public string? posNoEmployee { get; set; }
|
||||||
|
public string? organizationAgency { get; set; }
|
||||||
|
public string? organizationGovernmentAgency { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue