แก้รายงานเกษียณ/ออกคำสั่งerror

This commit is contained in:
Bright 2024-07-05 13:58:00 +07:00
parent 0b13d5ccf2
commit b753901b95
8 changed files with 23 additions and 12 deletions

View file

@ -9158,11 +9158,14 @@ namespace BMA.EHR.Application.Repositories.Commands
var raw = JsonConvert.DeserializeObject<dynamic>(apiResult.Result);
if (raw != null)
{
ret.Add(new KeyValueItemResponse
if(raw.result!.rootId != null && raw.result!.root != null)
{
Id = raw.result!.rootId ?? null,
Name = raw.result!.root ?? null,
});
ret.Add(new KeyValueItemResponse
{
Id = raw.result!.rootId ?? null,
Name = raw.result!.root ?? null,
});
}
}
}
// var rootOcId = await GetRootOcIdAsync(UserOrganizationId);

View file

@ -118,25 +118,33 @@ namespace BMA.EHR.Report.Service.Controllers
{
_count++;
}
string position = profile.GetType().GetProperty("position").GetValue(profile);
position = position != string.Empty && position != null ? position : "-";
string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString();
thaiOrder = $"ลำดับที่ {thaiOrder.ToThaiNumber()}";
string thaiPosNo = profile.GetType().GetProperty("posNo").GetValue(profile);
thaiPosNo = thaiPosNo != null ? $"(ตำแหน่งเลขที่ {thaiPosNo.ToThaiNumber()})" : $"(ตำแหน่งเลขที่ - )";
string organizationOrganization = (profile.GetType().GetProperty("child4").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child4").GetValue(profile) + "/") +
(profile.GetType().GetProperty("child3").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child3").GetValue(profile) + "/") +
(profile.GetType().GetProperty("child2").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child2").GetValue(profile) + "/") +
(profile.GetType().GetProperty("child1").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child1").GetValue(profile) + "/") +
(profile.GetType().GetProperty("root").GetValue(profile) == null ? "" : profile.GetType().GetProperty("root").GetValue(profile));
string reason = profile.GetType().GetProperty("reason").GetValue(profile);
organizationOrganization = organizationOrganization != string.Empty ? organizationOrganization : reason != string.Empty ? reason : string.Empty ;
reason = organizationOrganization == reason ? string.Empty : reason;
_profileList.Add(new
{
count = $"{_count.ToString().ToThaiNumber()}.",
no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.",
order = thaiOrder,
organizationOrganization = (profile.GetType().GetProperty("child4").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child4").GetValue(profile) + "/") +
(profile.GetType().GetProperty("child3").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child3").GetValue(profile) + "/") +
(profile.GetType().GetProperty("child2").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child2").GetValue(profile) + "/") +
(profile.GetType().GetProperty("child1").GetValue(profile) == null ? "" : profile.GetType().GetProperty("child1").GetValue(profile) + "/") +
(profile.GetType().GetProperty("root").GetValue(profile) == null ? "" : profile.GetType().GetProperty("root").GetValue(profile)),
organizationOrganization = organizationOrganization,
fullName = $"{profile.GetType().GetProperty("prefix").GetValue(profile)}{profile.GetType().GetProperty("firstName").GetValue(profile)} {profile.GetType().GetProperty("lastName").GetValue(profile)}",
position = profile.GetType().GetProperty("position").GetValue(profile),
posNo = profile.GetType().GetProperty("posMasterNo").GetValue(profile),
position = position,
posNo = thaiPosNo,
oc = profile.GetType().GetProperty("root").GetValue(profile),
positionEmployeePosition = profile.GetType().GetProperty("position").GetValue(profile),
posNoEmployee = profile.GetType().GetProperty("posMasterNo").GetValue(profile),
reason = profile.GetType().GetProperty("reason").GetValue(profile),
reason = reason,
});
}