This commit is contained in:
parent
dc2603d107
commit
25f6ebcdd7
2 changed files with 104 additions and 5 deletions
|
|
@ -10,6 +10,7 @@ using BMA.EHR.Domain.Models.Insignias;
|
|||
using BMA.EHR.Domain.Shared;
|
||||
using BMA.EHR.Infrastructure.Persistence;
|
||||
using BMA.EHR.Insignia.Service.Requests;
|
||||
using Elasticsearch.Net;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
|
@ -223,6 +224,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
[HttpPost("report2/{type}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetInsigniaReport2Async([FromBody] GetInsigniaDetailByNodeReportDto req, string type)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_INSIGNIA_REPORT");
|
||||
|
|
@ -232,18 +234,17 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var yearInsignalPeriod = await _repository.GetYearInsigniaPeriod(req.roundId);
|
||||
var agency = "";
|
||||
|
||||
var data = await _repository.GetEvaluationResultReport(req.roundId, type, req.node, req.nodeId);
|
||||
var data = await _repository.GetEvaluationResult5YearReport(req.roundId, type, req.node, req.nodeId);
|
||||
var year = ((DateTime.UtcNow.Year) + 543);
|
||||
|
||||
var _agency = data.Count > 0 ? data[0].GetType().GetProperty("Agency").GetValue(data[0]) : null;
|
||||
var result = new
|
||||
{
|
||||
template = "reportInsignia2",
|
||||
reportName = "reportInsignia2",
|
||||
data = new
|
||||
{
|
||||
agency = agency,
|
||||
agency = _agency,
|
||||
yearInsignalPeriod = yearInsignalPeriod,
|
||||
year1 = year.ToString().ToThaiNumber(),
|
||||
year2 = (year - 1).ToString().ToThaiNumber(),
|
||||
|
|
@ -256,7 +257,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
return Success(result);
|
||||
|
||||
}
|
||||
catch
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue