แก้ report เกษียณ
This commit is contained in:
parent
fb6e71c60c
commit
21aabd2ec3
9 changed files with 33 additions and 14 deletions
|
|
@ -1782,26 +1782,32 @@ namespace BMA.EHR.Application.Repositories.Commands
|
||||||
RegistrationSubDistrictId = placementProfile.RegistSubDistrict == null ? Guid.Empty : placementProfile.RegistSubDistrict!.Id,
|
RegistrationSubDistrictId = placementProfile.RegistSubDistrict == null ? Guid.Empty : placementProfile.RegistSubDistrict!.Id,
|
||||||
RegistrationDistrictId = placementProfile.RegistDistrict == null ? Guid.Empty : placementProfile.RegistDistrict!.Id,
|
RegistrationDistrictId = placementProfile.RegistDistrict == null ? Guid.Empty : placementProfile.RegistDistrict!.Id,
|
||||||
RegistrationProvinceId = placementProfile.RegistProvince == null ? Guid.Empty : placementProfile.RegistProvince!.Id,
|
RegistrationProvinceId = placementProfile.RegistProvince == null ? Guid.Empty : placementProfile.RegistProvince!.Id,
|
||||||
|
RegistrationZipCode = placementProfile.RegistSubDistrict == null ? null : placementProfile.RegistSubDistrict!.ZipCode,
|
||||||
|
|
||||||
CurrentAddress = placementProfile.CurrentAddress,
|
CurrentAddress = placementProfile.CurrentAddress,
|
||||||
CurrentSubDistrictId = placementProfile.CurrentSubDistrict == null ? Guid.Empty : placementProfile.CurrentSubDistrict!.Id,
|
CurrentSubDistrictId = placementProfile.CurrentSubDistrict == null ? Guid.Empty : placementProfile.CurrentSubDistrict!.Id,
|
||||||
CurrentDistrictId = placementProfile.CurrentDistrict == null ? Guid.Empty : placementProfile.CurrentDistrict!.Id,
|
CurrentDistrictId = placementProfile.CurrentDistrict == null ? Guid.Empty : placementProfile.CurrentDistrict!.Id,
|
||||||
CurrentProvinceId = placementProfile.CurrentProvince == null ? Guid.Empty : placementProfile.CurrentProvince!.Id,
|
CurrentProvinceId = placementProfile.CurrentProvince == null ? Guid.Empty : placementProfile.CurrentProvince!.Id,
|
||||||
|
CurrentZipCode = placementProfile.CurrentSubDistrict == null ? null : placementProfile.CurrentSubDistrict!.ZipCode,
|
||||||
|
|
||||||
FatherPrefixId = placementProfile.FatherPrefix == null ? Guid.Empty : placementProfile.FatherPrefix.Id,
|
FatherPrefixId = placementProfile.FatherPrefix == null ? null : placementProfile.FatherPrefix.Id,
|
||||||
FatherFirstName = placementProfile.FatherFirstName,
|
FatherFirstName = placementProfile.FatherFirstName,
|
||||||
FatherLastName = placementProfile.FatherLastName,
|
FatherLastName = placementProfile.FatherLastName,
|
||||||
FatherCareer = placementProfile.FatherOccupation,
|
FatherCareer = placementProfile.FatherOccupation,
|
||||||
|
FatherLive = true,
|
||||||
|
|
||||||
MotherPrefixId = placementProfile.MotherPrefix == null ? Guid.Empty : placementProfile.MotherPrefix.Id,
|
MotherPrefixId = placementProfile.MotherPrefix == null ? null : placementProfile.MotherPrefix.Id,
|
||||||
MotherFirstName = placementProfile.MotherFirstName,
|
MotherFirstName = placementProfile.MotherFirstName,
|
||||||
MotherLastName = placementProfile.MotherLastName,
|
MotherLastName = placementProfile.MotherLastName,
|
||||||
MotherCareer = placementProfile.MotherOccupation,
|
MotherCareer = placementProfile.MotherOccupation,
|
||||||
|
MotherLive = true,
|
||||||
|
|
||||||
CouplePrefixId = placementProfile.MarryPrefix == null ? Guid.Empty : placementProfile.MarryPrefix.Id,
|
Couple = placementProfile.MarryPrefix == null ? false : true,
|
||||||
|
CouplePrefixId = placementProfile.MarryPrefix == null ? null : placementProfile.MarryPrefix.Id,
|
||||||
CoupleFirstName = placementProfile.MarryFirstName,
|
CoupleFirstName = placementProfile.MarryFirstName,
|
||||||
CoupleLastName = placementProfile.MarryLastName,
|
CoupleLastName = placementProfile.MarryLastName,
|
||||||
CoupleCareer = placementProfile.MarryOccupation,
|
CoupleCareer = placementProfile.MarryOccupation,
|
||||||
|
CoupleLive = placementProfile.MarryPrefix == null ? false : true,
|
||||||
|
|
||||||
Position = placementProfile.PositionPath,
|
Position = placementProfile.PositionPath,
|
||||||
PositionPathSideId = placementProfile.PositionPathSide == null ? Guid.Empty : placementProfile.PositionPathSide.Id,
|
PositionPathSideId = placementProfile.PositionPathSide == null ? Guid.Empty : placementProfile.PositionPathSide.Id,
|
||||||
|
|
@ -1826,9 +1832,9 @@ namespace BMA.EHR.Application.Repositories.Commands
|
||||||
VerifiedUser = "",
|
VerifiedUser = "",
|
||||||
FirstNameOld = "",
|
FirstNameOld = "",
|
||||||
LastNameOld = "",
|
LastNameOld = "",
|
||||||
CoupleLive = false,
|
// CoupleLive = false,
|
||||||
FatherLive = false,
|
// FatherLive = false,
|
||||||
MotherLive = false,
|
// MotherLive = false,
|
||||||
CreatedUser = "",
|
CreatedUser = "",
|
||||||
|
|
||||||
Educations = new List<ProfileEducation>(),
|
Educations = new List<ProfileEducation>(),
|
||||||
|
|
@ -4864,7 +4870,7 @@ namespace BMA.EHR.Application.Repositories.Commands
|
||||||
|
|
||||||
//data.Profile.IsActive = false;
|
//data.Profile.IsActive = false;
|
||||||
//data.Profile.IsLeave = true;
|
//data.Profile.IsLeave = true;
|
||||||
//data.Profile.LeaveReason = "ออกจากราชการ";
|
//data.Profile.LeaveReason = "ลาออกจากราชการ";
|
||||||
//data.Profile.LeaveDate = command.CommandAffectDate;
|
//data.Profile.LeaveDate = command.CommandAffectDate;
|
||||||
|
|
||||||
var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
||||||
|
|
@ -5043,7 +5049,7 @@ namespace BMA.EHR.Application.Repositories.Commands
|
||||||
|
|
||||||
//data.Profile.IsActive = false;
|
//data.Profile.IsActive = false;
|
||||||
//data.Profile.IsLeave = true;
|
//data.Profile.IsLeave = true;
|
||||||
//data.Profile.LeaveReason = "ออกจากราชการ";
|
//data.Profile.LeaveReason = "ลาออกจากราชการ";
|
||||||
//data.Profile.LeaveDate = command.CommandAffectDate;
|
//data.Profile.LeaveDate = command.CommandAffectDate;
|
||||||
|
|
||||||
var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
||||||
|
|
@ -5222,7 +5228,7 @@ namespace BMA.EHR.Application.Repositories.Commands
|
||||||
|
|
||||||
data.Profile.IsActive = false;
|
data.Profile.IsActive = false;
|
||||||
data.Profile.IsLeave = true;
|
data.Profile.IsLeave = true;
|
||||||
data.Profile.LeaveReason = "ออกจากราชการ";
|
data.Profile.LeaveReason = "ลาออกจากราชการ";
|
||||||
data.Profile.LeaveDate = command.CommandAffectDate;
|
data.Profile.LeaveDate = command.CommandAffectDate;
|
||||||
|
|
||||||
var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
||||||
|
|
@ -6315,7 +6321,7 @@ namespace BMA.EHR.Application.Repositories.Commands
|
||||||
|
|
||||||
data.Profile.IsActive = false;
|
data.Profile.IsActive = false;
|
||||||
data.Profile.IsLeave = true;
|
data.Profile.IsLeave = true;
|
||||||
data.Profile.LeaveReason = "ออกจากราชการ";
|
data.Profile.LeaveReason = "ลาออกจากราชการ";
|
||||||
data.Profile.LeaveDate = command.CommandAffectDate;
|
data.Profile.LeaveDate = command.CommandAffectDate;
|
||||||
|
|
||||||
var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
||||||
|
|
|
||||||
|
|
@ -1041,7 +1041,17 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.Profile == profile && x.Request.Period == insigniaPeriod);
|
var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.Profile == profile && x.Request.Period == insigniaPeriod);
|
||||||
if (insigniaRequestProfile != null)
|
if (insigniaRequestProfile != null)
|
||||||
return Error(GlobalMessages.InsigniaRequestProfileDupicate);
|
return Error(GlobalMessages.InsigniaRequestProfileDupicate);
|
||||||
var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod);
|
// var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod);
|
||||||
|
var _orgProfile = await _context.ProfilePositions
|
||||||
|
.Where(x => x.Profile == profile)
|
||||||
|
.Where(x => x.OrganizationPosition != null)
|
||||||
|
.Where(x => x.OrganizationPosition.Organization != null)
|
||||||
|
.Where(x => x.OrganizationPosition.Organization.OrganizationAgencyId != null)
|
||||||
|
.Select(x => x.OrganizationPosition.Organization.OrganizationAgencyId)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
var _org = await _context.Organizations
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == _orgProfile);
|
||||||
|
var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod && x.Organization == _org);
|
||||||
if (insigniaRequest == null)
|
if (insigniaRequest == null)
|
||||||
{
|
{
|
||||||
var orgProfile = await _context.ProfilePositions
|
var orgProfile = await _context.ProfilePositions
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpGet("{exportType}/{Id}")]
|
[HttpGet("{exportType}/{Id}")]
|
||||||
|
[AllowAnonymous]
|
||||||
public async Task<ActionResult<ResponseObject>> GetProfileRetirement([FromRoute] Guid Id, string exportType = "pdf")
|
public async Task<ActionResult<ResponseObject>> GetProfileRetirement([FromRoute] Guid Id, string exportType = "pdf")
|
||||||
{
|
{
|
||||||
var retire = await _service.GetProfileRetirementdAsync(Id);
|
var retire = await _service.GetProfileRetirementdAsync(Id);
|
||||||
|
|
@ -104,7 +105,7 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
}
|
}
|
||||||
report.ReportParameters["Type"].Value = (returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.pdf" && returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.docx") && (returnfile != "แก้ไขประกาศเกษียณข้าราชการ.pdf" && returnfile != "แก้ไขประกาศเกษียณข้าราชการ.docx") && (returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.docx") && (returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.docx") ? "1" : "0";
|
report.ReportParameters["Type"].Value = (returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.pdf" && returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.docx") && (returnfile != "แก้ไขประกาศเกษียณข้าราชการ.pdf" && returnfile != "แก้ไขประกาศเกษียณข้าราชการ.docx") && (returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.docx") && (returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.docx") ? "1" : "0";
|
||||||
var _profileList = new List<dynamic>();
|
var _profileList = new List<dynamic>();
|
||||||
var _count=0;
|
var _count = 0;
|
||||||
var tmpOc1 = string.Empty;
|
var tmpOc1 = string.Empty;
|
||||||
foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire))
|
foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire))
|
||||||
{
|
{
|
||||||
|
|
@ -130,10 +131,12 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
position = string.IsNullOrEmpty(profile.GetType().GetProperty("position").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("position").GetValue(profile),
|
position = string.IsNullOrEmpty(profile.GetType().GetProperty("position").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("position").GetValue(profile),
|
||||||
posNo = string.IsNullOrEmpty(profile.GetType().GetProperty("posNo").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("posNo").GetValue(profile),
|
posNo = string.IsNullOrEmpty(profile.GetType().GetProperty("posNo").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("posNo").GetValue(profile),
|
||||||
organizationOrganization = string.IsNullOrEmpty(profile.GetType().GetProperty("organizationOrganization").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("organizationOrganization").GetValue(profile),
|
organizationOrganization = string.IsNullOrEmpty(profile.GetType().GetProperty("organizationOrganization").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("organizationOrganization").GetValue(profile),
|
||||||
|
positionEmployeePosition = string.IsNullOrEmpty(profile.GetType().GetProperty("positionEmployeePosition").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("positionEmployeePosition").GetValue(profile),
|
||||||
|
posNoEmployee = string.IsNullOrEmpty(profile.GetType().GetProperty("posNoEmployee").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("posNoEmployee").GetValue(profile),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//Binding Data
|
//Binding Data
|
||||||
if(report.ReportParameters["Type"].Value == "1")
|
if (report.ReportParameters["Type"].Value == "1")
|
||||||
{
|
{
|
||||||
report.ReportParameters["Year"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Year").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Year").GetValue(retire);
|
report.ReportParameters["Year"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Year").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Year").GetValue(retire);
|
||||||
report.ReportParameters["Total"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Total").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Total").GetValue(retire);
|
report.ReportParameters["Total"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Total").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Total").GetValue(retire);
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue