Merge branch 'develop' into work
This commit is contained in:
commit
e77935422c
12 changed files with 45 additions and 7 deletions
|
|
@ -107,14 +107,22 @@ namespace BMA.EHR.Application.Repositories.Reports
|
||||||
var results = responseTask.Result;
|
var results = responseTask.Result;
|
||||||
var json = results.Content.ReadAsStringAsync().Result;
|
var json = results.Content.ReadAsStringAsync().Result;
|
||||||
List<ProfileJsonRequest> profiles = JsonConvert.DeserializeObject<List<ProfileJsonRequest>>(json);
|
List<ProfileJsonRequest> profiles = JsonConvert.DeserializeObject<List<ProfileJsonRequest>>(json);
|
||||||
profiles = profiles.OrderBy(x => x.order).ToList();
|
if (retireHistorys.TypeReport != null)
|
||||||
|
{
|
||||||
|
retireHistorys.Total = profiles.Where(x => x.remove == retireHistorys.TypeReport).Count();
|
||||||
|
profiles = profiles.Where(x => x.remove == retireHistorys.TypeReport).OrderBy(x => x.order).ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
profiles = profiles.OrderBy(x => x.order).ToList();
|
||||||
|
}
|
||||||
return new { retireHistorys.Detail, retireHistorys.Id, retireHistorys.CreatedAt, Year = retireHistorys.Year.ToThaiYear().ToString().ToThaiNumber(), retireHistorys.Round, retireHistorys.Type, retireHistorys.TypeReport, Total = retireHistorys.Total.ToString().ToThaiNumber(), profile = profiles};
|
return new { retireHistorys.Detail, retireHistorys.Id, retireHistorys.CreatedAt, Year = retireHistorys.Year.ToThaiYear().ToString().ToThaiNumber(), retireHistorys.Round, retireHistorys.Type, retireHistorys.TypeReport, Total = retireHistorys.Total.ToString().ToThaiNumber(), profile = profiles};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var profile_retire = await _dbContext.Set<RetirementProfile>()
|
var profile_retire = await _dbContext.Set<RetirementProfile>()
|
||||||
.Where(x => x.RetirementPeriod == retire)
|
.Where(x => x.RetirementPeriod == retire && (retire.TypeReport == null || retire.TypeReport == x.Remove))
|
||||||
.OrderBy(x => x.Order)
|
.OrderBy(x => x.Order)
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -265,6 +265,15 @@
|
||||||
<None Update="Reports\32-ประกาศเกษียณลูกจ้างประจำ.trdp">
|
<None Update="Reports\32-ประกาศเกษียณลูกจ้างประจำ.trdp">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="Reports\32-ประกาศเกษียณลูกจ้างประจำ-1.trdp">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="Reports\32-ประกาศเกษียณลูกจ้างประจำ-2.trdp">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="Reports\32-ประกาศเกษียณลูกจ้างประจำ-3.trdp">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Update="Reports\33-แบบฟอร์มหนังสือขอลาออกจากราชการ-1.trdp">
|
<None Update="Reports\33-แบบฟอร์มหนังสือขอลาออกจากราชการ-1.trdp">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,27 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "EMPLOYEE":
|
case "EMPLOYEE":
|
||||||
reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ.trdp";
|
//reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ.trdp";
|
||||||
returnfile = $"ประกาศเกษียณลูกจ้าง.{exportType}";
|
//returnfile = $"ประกาศเกษียณลูกจ้าง.{exportType}";
|
||||||
|
if (string.IsNullOrEmpty(retire.GetType().GetProperty("TypeReport").GetValue(retire)))
|
||||||
|
{
|
||||||
|
reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ-1.trdp";
|
||||||
|
returnfile = $"ประกาศเกษียณลูกจ้างประจำ.{exportType}";
|
||||||
|
}
|
||||||
|
else if (retire.GetType().GetProperty("TypeReport").GetValue(retire) == "ADD" || retire.GetType().GetProperty("TypeReport").GetValue(retire) == "EDIT")
|
||||||
|
{
|
||||||
|
reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ-2.trdp";
|
||||||
|
returnfile = $"แก้ไขประกาศเกษียณลูกจ้างประจำ.{exportType}";
|
||||||
|
}
|
||||||
|
else if (retire.GetType().GetProperty("TypeReport").GetValue(retire) == "REMOVE")
|
||||||
|
{
|
||||||
|
reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ-3.trdp";
|
||||||
|
returnfile = $"ยกเลิกประกาศเกษียณลูกจ้างประจำ.{exportType}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Error(retire.GetType().GetProperty("TypeReport").GetValue(retire));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return Error(retire.GetType().GetProperty("Type").GetValue(retire));
|
return Error(retire.GetType().GetProperty("Type").GetValue(retire));
|
||||||
|
|
@ -89,15 +108,17 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
////Add Parameter
|
////Add Parameter
|
||||||
//report.ReportParameters["Year"].Value = retire.GetType().GetProperty("Year").GetValue(retire);
|
//report.ReportParameters["Year"].Value = retire.GetType().GetProperty("Year").GetValue(retire);
|
||||||
//report.ReportParameters["Total"].Value = retire.GetType().GetProperty("Total").GetValue(retire);
|
//report.ReportParameters["Total"].Value = retire.GetType().GetProperty("Total").GetValue(retire);
|
||||||
|
report.ReportParameters["Type"].Value = returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.pdf" && returnfile != "แก้ไขประกาศเกษียณข้าราชการ.pdf" ? "1" : "0";
|
||||||
|
|
||||||
var _profileList = new List<dynamic>();
|
var _profileList = new List<dynamic>();
|
||||||
|
|
||||||
foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire))
|
foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire))
|
||||||
{
|
{
|
||||||
string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString() + ".";
|
string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString();
|
||||||
thaiOrder = thaiOrder.ToThaiNumber();
|
thaiOrder = $"ลำดับที่ {thaiOrder.ToThaiNumber()}";
|
||||||
_profileList.Add(new
|
_profileList.Add(new
|
||||||
{
|
{
|
||||||
|
no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.",
|
||||||
order = thaiOrder,
|
order = thaiOrder,
|
||||||
fullName = profile.GetType().GetProperty("fullName").GetValue(profile).ToString(),
|
fullName = profile.GetType().GetProperty("fullName").GetValue(profile).ToString(),
|
||||||
position = profile.GetType().GetProperty("position").GetValue(profile).ToString(),
|
position = profile.GetType().GetProperty("position").GetValue(profile).ToString(),
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
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