แก้ report เกษียณ

This commit is contained in:
Kittapath 2023-10-12 04:46:44 +07:00
parent fb6e71c60c
commit 21aabd2ec3
9 changed files with 33 additions and 14 deletions

View file

@ -1782,26 +1782,32 @@ namespace BMA.EHR.Application.Repositories.Commands
RegistrationSubDistrictId = placementProfile.RegistSubDistrict == null ? Guid.Empty : placementProfile.RegistSubDistrict!.Id,
RegistrationDistrictId = placementProfile.RegistDistrict == null ? Guid.Empty : placementProfile.RegistDistrict!.Id,
RegistrationProvinceId = placementProfile.RegistProvince == null ? Guid.Empty : placementProfile.RegistProvince!.Id,
RegistrationZipCode = placementProfile.RegistSubDistrict == null ? null : placementProfile.RegistSubDistrict!.ZipCode,
CurrentAddress = placementProfile.CurrentAddress,
CurrentSubDistrictId = placementProfile.CurrentSubDistrict == null ? Guid.Empty : placementProfile.CurrentSubDistrict!.Id,
CurrentDistrictId = placementProfile.CurrentDistrict == null ? Guid.Empty : placementProfile.CurrentDistrict!.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,
FatherLastName = placementProfile.FatherLastName,
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,
MotherLastName = placementProfile.MotherLastName,
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,
CoupleLastName = placementProfile.MarryLastName,
CoupleCareer = placementProfile.MarryOccupation,
CoupleLive = placementProfile.MarryPrefix == null ? false : true,
Position = placementProfile.PositionPath,
PositionPathSideId = placementProfile.PositionPathSide == null ? Guid.Empty : placementProfile.PositionPathSide.Id,
@ -1826,9 +1832,9 @@ namespace BMA.EHR.Application.Repositories.Commands
VerifiedUser = "",
FirstNameOld = "",
LastNameOld = "",
CoupleLive = false,
FatherLive = false,
MotherLive = false,
// CoupleLive = false,
// FatherLive = false,
// MotherLive = false,
CreatedUser = "",
Educations = new List<ProfileEducation>(),
@ -4864,7 +4870,7 @@ namespace BMA.EHR.Application.Repositories.Commands
//data.Profile.IsActive = false;
//data.Profile.IsLeave = true;
//data.Profile.LeaveReason = "ออกจากราชการ";
//data.Profile.LeaveReason = "ลาออกจากราชการ";
//data.Profile.LeaveDate = command.CommandAffectDate;
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.IsLeave = true;
//data.Profile.LeaveReason = "ออกจากราชการ";
//data.Profile.LeaveReason = "ลาออกจากราชการ";
//data.Profile.LeaveDate = command.CommandAffectDate;
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.IsLeave = true;
data.Profile.LeaveReason = "ออกจากราชการ";
data.Profile.LeaveReason = "ลาออกจากราชการ";
data.Profile.LeaveDate = command.CommandAffectDate;
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.IsLeave = true;
data.Profile.LeaveReason = "ออกจากราชการ";
data.Profile.LeaveReason = "ลาออกจากราชการ";
data.Profile.LeaveDate = command.CommandAffectDate;
var lastSarary = data.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();

View file

@ -1041,7 +1041,17 @@ namespace BMA.EHR.Insignia.Service.Controllers
var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.Profile == profile && x.Request.Period == insigniaPeriod);
if (insigniaRequestProfile != null)
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)
{
var orgProfile = await _context.ProfilePositions

View file

@ -39,6 +39,7 @@ namespace BMA.EHR.Report.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("{exportType}/{Id}")]
[AllowAnonymous]
public async Task<ActionResult<ResponseObject>> GetProfileRetirement([FromRoute] Guid Id, string exportType = "pdf")
{
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";
var _profileList = new List<dynamic>();
var _count=0;
var _count = 0;
var tmpOc1 = string.Empty;
foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire))
{
@ -121,7 +122,7 @@ namespace BMA.EHR.Report.Service.Controllers
string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString();
thaiOrder = $"ลำดับที่ {thaiOrder.ToThaiNumber()}";
_profileList.Add(new
{
{
count = $"{_count.ToString().ToThaiNumber()}.",
no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.",
order = thaiOrder,
@ -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),
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),
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
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["Total"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Total").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Total").GetValue(retire);