fix : RDEN Download

This commit is contained in:
Suphonchai Phoonsawat 2024-07-08 21:31:33 +07:00
parent bef050f835
commit 6b9407f02a

View file

@ -2310,28 +2310,28 @@ namespace BMA.EHR.Insignia.Service.Controllers
var row = 2;
foreach (var item in requestProfiles)
{
var profile = _userProfileRepository.GetOfficerProfileById(item.ProfileId, AccessToken);
//var profile = _userProfileRepository.GetOfficerProfileById(item.ProfileId, AccessToken);
workSheet.Cells[row, 1].Value = _userProfileRepository.GetOc(insigniaPeriod.OrganizationId, 0, AccessToken).Root;
workSheet.Cells[row, 2].Value = profile.CitizenId;
workSheet.Cells[row, 3].Value = profile.Prefix == null ? "-" : ((profile.Prefix == "นาย" || profile.Prefix == "นาง" || profile.Prefix == "นางสาว") ? profile.Prefix : "-");
workSheet.Cells[row, 4].Value = profile.Prefix == null ? "-" : ((profile.Prefix == "นาย" || profile.Prefix == "นาง" || profile.Prefix == "นางสาว") ? "-" : profile.Prefix);
workSheet.Cells[row, 5].Value = profile.FirstName;
workSheet.Cells[row, 6].Value = profile.LastName;
workSheet.Cells[row, 7].Value = profile.Gender == null ? "-" : profile.Gender;
workSheet.Cells[row, 8].Value = profile.BirthDate.ToThaiDate();
workSheet.Cells[row, 9].Value = profile.DateAppoint == null ? null : profile.DateAppoint.Value.ToThaiDate();
workSheet.Cells[row, 2].Value = item.CitizenId;
workSheet.Cells[row, 3].Value = item.Prefix == null ? "-" : ((item.Prefix == "นาย" || item.Prefix == "นาง" || item.Prefix == "นางสาว") ? item.Prefix : "-");
workSheet.Cells[row, 4].Value = item.Prefix == null ? "-" : ((item.Prefix == "นาย" || item.Prefix == "นาง" || item.Prefix == "นางสาว") ? "-" : item.Prefix);
workSheet.Cells[row, 5].Value = item.FirstName;
workSheet.Cells[row, 6].Value = item.LastName;
workSheet.Cells[row, 7].Value = item.Gender == null ? "-" : item.Gender;
workSheet.Cells[row, 8].Value = item.BirthDate == null ? "" : item.BirthDate.Value.ToThaiDate();
workSheet.Cells[row, 9].Value = item.DateAppoint == null ? "" : item.DateAppoint.Value.ToThaiDate();
// workSheet.Cells[row, 10].Value = null;
//workSheet.Cells[row, 11].Value = item.Profile.Position == null ? null : item.Profile.Position.Name;
//workSheet.Cells[row, 11].Value = item.Position == null ? "" : item.Position;
workSheet.Cells[row, 12].Value = "";
workSheet.Cells[row, 13].Value = profile.PosLevel == null ? null : profile.PosLevel.PosLevelName;
workSheet.Cells[row, 13].Value = item.PosLevelName == null ? "" : item.PosLevelName;
workSheet.Cells[row, 14].Value = "";
workSheet.Cells[row, 15].Value = null;
workSheet.Cells[row, 16].Value = profile.Position ?? "";
workSheet.Cells[row, 17].Value = profile.ProfileSalary == null ? null : profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().Amount;
workSheet.Cells[row, 16].Value = item.Position ?? "";
workSheet.Cells[row, 17].Value = item.Amount == null ? 0 : item.Amount;
workSheet.Cells[row, 18].Value = null;
workSheet.Cells[row, 19].Value = profile.ProfileSalary == null ? null : profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount;
workSheet.Cells[row, 20].Value = "";
workSheet.Cells[row, 19].Value = item.PositionSalaryAmount == null ? 0 : item.PositionSalaryAmount;
workSheet.Cells[row, 20].Value = item.LastInsigniaName;
workSheet.Cells[row, 21].Value = "";
workSheet.Cells[row, 22].Value = null;
row++;
@ -2409,27 +2409,49 @@ namespace BMA.EHR.Insignia.Service.Controllers
var row = 2;
foreach (var item in requestProfiles)
{
var profile = _userProfileRepository.GetOfficerProfileById(item.ProfileId, AccessToken);
//var profile = _userProfileRepository.GetOfficerProfileById(item.ProfileId, AccessToken);
//workSheet.Cells[row, 1].Value = _userProfileRepository.GetOc(insigniaPeriod.OrganizationId, 0, AccessToken).Root;
//workSheet.Cells[row, 2].Value = profile.CitizenId;
//workSheet.Cells[row, 3].Value = profile.Prefix == null ? "-" : ((profile.Prefix == "นาย" || profile.Prefix == "นาง" || profile.Prefix == "นางสาว") ? profile.Prefix : "-");
//workSheet.Cells[row, 4].Value = profile.Prefix == null ? "-" : ((profile.Prefix == "นาย" || profile.Prefix == "นาง" || profile.Prefix == "นางสาว") ? "-" : profile.Prefix);
//workSheet.Cells[row, 5].Value = profile.FirstName;
//workSheet.Cells[row, 6].Value = profile.LastName;
//workSheet.Cells[row, 7].Value = profile.Gender == null ? "-" : profile.Gender;
//workSheet.Cells[row, 8].Value = profile.BirthDate.ToThaiDate();
//workSheet.Cells[row, 9].Value = profile.DateAppoint == null ? null : profile.DateAppoint.Value.ToThaiDate();
//// workSheet.Cells[row, 10].Value = null;
//// workSheet.Cells[row, 11].Value = item.Profile.Position == null ? null : item.Profile.Position.Name;
//workSheet.Cells[row, 12].Value = "";
//workSheet.Cells[row, 13].Value = profile.PosLevel == null ? null : profile.PosLevel.PosLevelName;
//workSheet.Cells[row, 14].Value = "";
//workSheet.Cells[row, 15].Value = null;
//workSheet.Cells[row, 16].Value = profile.Position == null ? "-" : profile.Position;
//workSheet.Cells[row, 17].Value = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().Amount;
//workSheet.Cells[row, 18].Value = null;
//workSheet.Cells[row, 19].Value = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount;
//workSheet.Cells[row, 20].Value = "";
//workSheet.Cells[row, 21].Value = "";
//workSheet.Cells[row, 22].Value = null;
workSheet.Cells[row, 1].Value = _userProfileRepository.GetOc(insigniaPeriod.OrganizationId, 0, AccessToken).Root;
workSheet.Cells[row, 2].Value = profile.CitizenId;
workSheet.Cells[row, 3].Value = profile.Prefix == null ? "-" : ((profile.Prefix == "นาย" || profile.Prefix == "นาง" || profile.Prefix == "นางสาว") ? profile.Prefix : "-");
workSheet.Cells[row, 4].Value = profile.Prefix == null ? "-" : ((profile.Prefix == "นาย" || profile.Prefix == "นาง" || profile.Prefix == "นางสาว") ? "-" : profile.Prefix);
workSheet.Cells[row, 5].Value = profile.FirstName;
workSheet.Cells[row, 6].Value = profile.LastName;
workSheet.Cells[row, 7].Value = profile.Gender == null ? "-" : profile.Gender;
workSheet.Cells[row, 8].Value = profile.BirthDate.ToThaiDate();
workSheet.Cells[row, 9].Value = profile.DateAppoint == null ? null : profile.DateAppoint.Value.ToThaiDate();
workSheet.Cells[row, 2].Value = item.CitizenId;
workSheet.Cells[row, 3].Value = item.Prefix == null ? "-" : ((item.Prefix == "นาย" || item.Prefix == "นาง" || item.Prefix == "นางสาว") ? item.Prefix : "-");
workSheet.Cells[row, 4].Value = item.Prefix == null ? "-" : ((item.Prefix == "นาย" || item.Prefix == "นาง" || item.Prefix == "นางสาว") ? "-" : item.Prefix);
workSheet.Cells[row, 5].Value = item.FirstName;
workSheet.Cells[row, 6].Value = item.LastName;
workSheet.Cells[row, 7].Value = item.Gender == null ? "-" : item.Gender;
workSheet.Cells[row, 8].Value = item.BirthDate == null ? "" : item.BirthDate.Value.ToThaiDate();
workSheet.Cells[row, 9].Value = item.DateAppoint == null ? "" : item.DateAppoint.Value.ToThaiDate();
// workSheet.Cells[row, 10].Value = null;
// workSheet.Cells[row, 11].Value = item.Profile.Position == null ? null : item.Profile.Position.Name;
//workSheet.Cells[row, 11].Value = item.Position == null ? "" : item.Position;
workSheet.Cells[row, 12].Value = "";
workSheet.Cells[row, 13].Value = profile.PosLevel == null ? null : profile.PosLevel.PosLevelName;
workSheet.Cells[row, 13].Value = item.PosLevelName == null ? "" : item.PosLevelName;
workSheet.Cells[row, 14].Value = "";
workSheet.Cells[row, 15].Value = null;
workSheet.Cells[row, 16].Value = profile.Position == null ? "-" : profile.Position;
workSheet.Cells[row, 17].Value = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().Amount;
workSheet.Cells[row, 16].Value = item.Position ?? "";
workSheet.Cells[row, 17].Value = item.Amount == null ? 0 : item.Amount;
workSheet.Cells[row, 18].Value = null;
workSheet.Cells[row, 19].Value = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount;
workSheet.Cells[row, 20].Value = "";
workSheet.Cells[row, 19].Value = item.PositionSalaryAmount == null ? 0 : item.PositionSalaryAmount;
workSheet.Cells[row, 20].Value = item.LastInsigniaName;
workSheet.Cells[row, 21].Value = "";
workSheet.Cells[row, 22].Value = null;
row++;