fix report
This commit is contained in:
parent
a15f2a1081
commit
d86eb050a8
6 changed files with 64 additions and 17 deletions
|
|
@ -66,6 +66,12 @@
|
||||||
<None Update="Report\Organization\rptAccount1.trdp">
|
<None Update="Report\Organization\rptAccount1.trdp">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="Report\Organization\rptAccount2.trdp">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="Report\Organization\rptAccount3.trdp">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Update="Report\Profile\rptKK1Summary.trbp">
|
<None Update="Report\Profile\rptKK1Summary.trbp">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,19 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
|
|
||||||
#region " Methods "
|
#region " Methods "
|
||||||
|
|
||||||
|
[HttpGet("oc-type")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetOCType()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Success(await _organizationReportService.GetOrganizationTypes("หน่วยงาน"));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// รายงานบัญชี 1
|
/// รายงานบัญชี 1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -174,14 +187,15 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
OcFullNameNew = d.OcFullNameNew.Replace($"\r\n{d.OcNameNew}", string.Empty),
|
OcFullNameNew = d.OcFullNameNew.Replace($"\r\n{d.OcNameNew}", string.Empty),
|
||||||
OcNameNew = d.OcNameNew,
|
OcNameNew = d.OcNameNew,
|
||||||
ShortNameNew = d.ShortNameNew,
|
ShortNameNew = d.ShortNameNew,
|
||||||
PositionNumberNew = d.PositionNumberNew,
|
PositionNumberNew = d.PositionNumberNew == "" ? d.PositionNumber : d.PositionNumberNew,
|
||||||
PositionNumberIntNew = d.PositionNumberNew == "" ? 0 : Convert.ToInt32(d.PositionNumberNew.Split(".").Last()),
|
PositionNumberIntNew = d.PositionNumberNew == "" ? Convert.ToInt32(d.PositionNumber.Split(".").Last()) :
|
||||||
PositionLevelNew = d.PositionLevelNew,
|
Convert.ToInt32(d.PositionNumberNew.Split(".").Last()),
|
||||||
PositionNameNew = d.PositionNameNew,
|
PositionLevelNew = d.PositionLevelNew == "" ? d.PositionLevel : d.PositionLevelNew,
|
||||||
PositionSideNew = d.PositionSideNew,
|
PositionNameNew = d.PositionNameNew == "" ? d.PositionName : d.PositionNameNew,
|
||||||
PositionExecutiveNew = d.PositionExecutiveNew,
|
PositionSideNew = d.PositionSideNew == "" ? d.PositionSide : d.PositionSideNew,
|
||||||
PositionExecutiveSideNew = d.PositionExecutiveSideNew,
|
PositionExecutiveNew = d.PositionExecutiveNew == "" ? d.PositionExecutive : d.PositionExecutiveNew,
|
||||||
PositionTypeNew = d.PositionTypeNew,
|
PositionExecutiveSideNew = d.PositionExecutiveSideNew == "" ? d.PositionExecutiveSide : d.PositionExecutiveSideNew,
|
||||||
|
PositionTypeNew = d.PositionTypeNew == "" ? d.PositionType : d.PositionTypeNew,
|
||||||
|
|
||||||
Prefix = d.Prefix,
|
Prefix = d.Prefix,
|
||||||
FirstName = d.FirstName,
|
FirstName = d.FirstName,
|
||||||
|
|
@ -264,7 +278,7 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
OcName = d.OcName,
|
OcName = d.OcName,
|
||||||
ShortName = d.ShortName,
|
ShortName = d.ShortName,
|
||||||
PositionNumber = d.PositionNumber,
|
PositionNumber = d.PositionNumber,
|
||||||
PositionNumberInt =d.PositionNumber == "" ? 0 : Convert.ToInt32(d.PositionNumber.Split(".").Last()),
|
PositionNumberInt = d.PositionNumber == "" ? 0 : Convert.ToInt32(d.PositionNumber.Split(".").Last()),
|
||||||
PositionName = d.PositionName,
|
PositionName = d.PositionName,
|
||||||
PositionSide = d.PositionSide,
|
PositionSide = d.PositionSide,
|
||||||
PositionExecutive = d.PositionExecutive,
|
PositionExecutive = d.PositionExecutive,
|
||||||
|
|
@ -278,14 +292,15 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
OcFullNameNew = d.OcFullNameNew.Replace($"\r\n{d.OcNameNew}", string.Empty),
|
OcFullNameNew = d.OcFullNameNew.Replace($"\r\n{d.OcNameNew}", string.Empty),
|
||||||
OcNameNew = d.OcNameNew,
|
OcNameNew = d.OcNameNew,
|
||||||
ShortNameNew = d.ShortNameNew,
|
ShortNameNew = d.ShortNameNew,
|
||||||
PositionNumberNew = d.PositionNumberNew,
|
PositionNumberNew = d.PositionNumberNew == "" ? d.PositionNumber : d.PositionNumberNew,
|
||||||
PositionNumberIntNew = d.PositionNumberNew == "" ? 0 : Convert.ToInt32(d.PositionNumberNew.Split(".").Last()),
|
PositionNumberIntNew = d.PositionNumberNew == "" ? Convert.ToInt32(d.PositionNumber.Split(".").Last()) :
|
||||||
PositionLevelNew = d.PositionLevelNew,
|
Convert.ToInt32(d.PositionNumberNew.Split(".").Last()),
|
||||||
PositionNameNew = d.PositionNameNew,
|
PositionLevelNew = d.PositionLevelNew == "" ? d.PositionLevel : d.PositionLevelNew,
|
||||||
PositionSideNew = d.PositionSideNew,
|
PositionNameNew = d.PositionNameNew == "" ? d.PositionName : d.PositionNameNew,
|
||||||
PositionExecutiveNew = d.PositionExecutiveNew,
|
PositionSideNew = d.PositionSideNew == "" ? d.PositionSide : d.PositionSideNew,
|
||||||
PositionExecutiveSideNew = d.PositionExecutiveSideNew,
|
PositionExecutiveNew = d.PositionExecutiveNew == "" ? d.PositionExecutive : d.PositionExecutiveNew,
|
||||||
PositionTypeNew = d.PositionTypeNew,
|
PositionExecutiveSideNew = d.PositionExecutiveSideNew == "" ? d.PositionExecutiveSide : d.PositionExecutiveSideNew,
|
||||||
|
PositionTypeNew = d.PositionTypeNew == "" ? d.PositionType : d.PositionTypeNew,
|
||||||
|
|
||||||
Prefix = d.Prefix,
|
Prefix = d.Prefix,
|
||||||
FirstName = d.FirstName,
|
FirstName = d.FirstName,
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -33,6 +33,32 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
|
|
||||||
#region " Report Query "
|
#region " Report Query "
|
||||||
|
|
||||||
|
public async Task<IEnumerable<dynamic>?> GetOrganizationTypes(string type)
|
||||||
|
{
|
||||||
|
var Organizations = await _context.Organizations.ToListAsync();
|
||||||
|
|
||||||
|
var OrganizationOrganizations = await _context.OrganizationOrganizations.ToListAsync();
|
||||||
|
var OrganizationTypes = await _context.OrganizationTypes.FirstOrDefaultAsync(x => x.Name == type);
|
||||||
|
|
||||||
|
if (OrganizationTypes == null)
|
||||||
|
{
|
||||||
|
throw new Exception("Invalid Organization type.");
|
||||||
|
}
|
||||||
|
|
||||||
|
var dataType = (from o in Organizations
|
||||||
|
join os in OrganizationOrganizations on o.OrganizationOrganizationId equals os.Id into os1
|
||||||
|
from os in os1.DefaultIfEmpty()
|
||||||
|
where o.OrganizationTypeId == OrganizationTypes.Id && os != null
|
||||||
|
orderby o.OrganizationOrder
|
||||||
|
select new
|
||||||
|
{
|
||||||
|
organizationId = o.Id,
|
||||||
|
organizationName = os.Name
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<List<Account1ResultItem>> GetReport1Query(Guid ocId)
|
public async Task<List<Account1ResultItem>> GetReport1Query(Guid ocId)
|
||||||
{
|
{
|
||||||
var ocIdList = _profileService.GetAllIdByRoot(ocId);
|
var ocIdList = _profileService.GetAllIdByRoot(ocId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue