Merge branch 'develop' into work
This commit is contained in:
commit
6a08791d00
14 changed files with 106 additions and 79 deletions
|
|
@ -162,7 +162,7 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
{
|
||||
No = string.IsNullOrEmpty(evaluate_assign.data.evaluate.no.ToString()) ? string.Empty : evaluate_assign.data.evaluate.no.ToString().ToThaiNumber(),
|
||||
EvaluateDateStart = string.IsNullOrEmpty(evaluate_assign.data.evaluate.date_start.ToString()) ? "วันที่ เดือน พ.ศ." : evaluate_assign.data.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.data.evaluate.date_start.ToString()) ? "วันที่ เดือน พ.ศ." : evaluate_assign.data.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.data.evaluate.date_finish.ToString()) ? "วันที่ เดือน พ.ศ." : evaluate_assign.data.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
Name = string.IsNullOrEmpty(evaluate_assign.data.experimentee.name) ? string.Empty : evaluate_assign.data.experimentee.name,
|
||||
Position = string.IsNullOrEmpty(evaluate_assign.data.experimentee.Position) ? string.Empty : evaluate_assign.data.experimentee.Position,
|
||||
Department = string.IsNullOrEmpty(evaluate_assign.data.experimentee.Department) ? string.Empty : evaluate_assign.data.experimentee.Department,
|
||||
|
|
@ -206,7 +206,7 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
{
|
||||
No = string.IsNullOrEmpty(evaluate_assign.data.evaluate.no.ToString()) ? string.Empty : evaluate_assign.data.evaluate.no.ToString().ToThaiNumber(),
|
||||
EvaluateDateStart = string.IsNullOrEmpty(evaluate_assign.data.evaluate.date_start.ToString()) ? "วันที่ เดือน พ.ศ." : evaluate_assign.data.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.data.evaluate.date_start.ToString()) ? "วันที่ เดือน พ.ศ." : evaluate_assign.data.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.data.evaluate.date_finish.ToString()) ? "วันที่ เดือน พ.ศ." : evaluate_assign.data.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
|
||||
Name = string.IsNullOrEmpty(evaluate_assign.data.experimentee.name) ? string.Empty : evaluate_assign.data.experimentee.name,
|
||||
Position = string.IsNullOrEmpty(evaluate_assign.data.experimentee.Position) ? string.Empty : evaluate_assign.data.experimentee.Position,
|
||||
Department = string.IsNullOrEmpty(evaluate_assign.data.experimentee.Department) ? string.Empty : evaluate_assign.data.experimentee.Department,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
using System.Reflection.Metadata;
|
||||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Application.Responses;
|
||||
using BMA.EHR.Domain.Extensions;
|
||||
using BMA.EHR.Domain.Models.HR;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using BMA.EHR.Domain.Models.Retirement;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BMA.EHR.Application.Repositories.Reports
|
||||
{
|
||||
|
|
@ -70,64 +73,73 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
if (retireHistorys == null)
|
||||
return null;
|
||||
|
||||
var profile_retireHistory = await _dbContext.Set<RetirementProfile>()
|
||||
.Where(x => x.RetirementPeriod == retire)
|
||||
.OrderBy(x => x.Order)
|
||||
.Select(x => new
|
||||
{
|
||||
order = x.Order,
|
||||
id = x.Id,
|
||||
reason = x.Reason,
|
||||
remove = x.Remove,
|
||||
profileId = x.Profile.Id,
|
||||
citizenId = x.Profile.CitizenId,
|
||||
prefix = x.Profile.Prefix == null ? null : x.Profile.Prefix.Name,
|
||||
fullName = $"{x.Profile.FirstName} {x.Profile.LastName}",
|
||||
organizationOrganization = x.Profile.OrganizationOrganization,
|
||||
oc = x.Profile.Oc,
|
||||
position = x.Profile.Position == null ? null : x.Profile.Position.Name,
|
||||
positionType = x.Profile.PositionType == null ? null : x.Profile.PositionType.Name,
|
||||
positionExecutive = x.Profile.PositionExecutive,
|
||||
posNo = x.Profile.PosNo == null ? null : x.Profile.PosNo.Name,
|
||||
positionEmployeePosition = x.Profile.PositionEmployeePosition,
|
||||
positionEmployeeLevel = x.Profile.PositionEmployeeLevel,
|
||||
positionEmployeeGroup = x.Profile.PositionEmployeeGroup,
|
||||
posNoEmployee = x.Profile.PosNoEmployee,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
return new { retireHistorys.Id, retireHistorys.CreatedAt, Year = retireHistorys.Year.ToThaiYear().ToString().ToThaiNumber(), retireHistorys.Round, retireHistorys.Type, retireHistorys.TypeReport, Total = retireHistorys.Total.ToString().ToThaiNumber(), profile = profile_retireHistory };
|
||||
//var profile_retireHistory = await _dbContext.Set<RetirementProfile>()
|
||||
// .Where(x => x.RetirementPeriod == retire)
|
||||
// .OrderBy(x => x.Order)
|
||||
// .Select(x => new
|
||||
// {
|
||||
// order = x.Order,
|
||||
// id = x.Id,
|
||||
// reason = x.Reason,
|
||||
// remove = x.Remove,
|
||||
// profileId = x.Profile.Id,
|
||||
// citizenId = x.Profile.CitizenId,
|
||||
// prefix = x.Profile.Prefix == null ? string.Empty : x.Profile.Prefix.Name,
|
||||
// fullName = $"{x.Profile.FirstName} {x.Profile.LastName}",
|
||||
// organizationOrganization = x.Profile.OrganizationOrganization,
|
||||
// oc = x.Profile.Oc,
|
||||
// position = x.Profile.Position == null ? string.Empty : x.Profile.Position.Name,
|
||||
// positionType = x.Profile.PositionType == null ? string.Empty : x.Profile.PositionType.Name,
|
||||
// positionExecutive = x.Profile.PositionExecutive,
|
||||
// posNo = x.Profile.PosNo == null ? string.Empty : x.Profile.PosNo.Name,
|
||||
// positionEmployeePosition = x.Profile.PositionEmployeePosition,
|
||||
// positionEmployeeLevel = x.Profile.PositionEmployeeLevel,
|
||||
// positionEmployeeGroup = x.Profile.PositionEmployeeGroup,
|
||||
// posNoEmployee = x.Profile.PosNoEmployee,
|
||||
// })
|
||||
// .ToListAsync();
|
||||
|
||||
//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 = profile_retireHistory };
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var url = await _documentService.ImagesPathByName($"{retireHistorys.ProfileFile}.json");
|
||||
var responseTask = client.GetAsync(url);
|
||||
var results = responseTask.Result;
|
||||
var json = results.Content.ReadAsStringAsync().Result;
|
||||
List<ProfileJsonRequest> profiles = JsonConvert.DeserializeObject<List<ProfileJsonRequest>>(json);
|
||||
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};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var profile_retire = await _dbContext.Set<RetirementProfile>()
|
||||
.Where(x => x.RetirementPeriod == retire)
|
||||
.OrderBy(x => x.Order)
|
||||
.Select(x => new
|
||||
{
|
||||
order = x.Order,
|
||||
id = x.Id,
|
||||
reason = x.Reason,
|
||||
remove = x.Remove,
|
||||
profileId = x.Profile.Id,
|
||||
citizenId = x.Profile.CitizenId,
|
||||
prefix = x.Profile.Prefix == null ? null : x.Profile.Prefix.Name,
|
||||
fullName = $"{x.Profile.FirstName} {x.Profile.LastName}",
|
||||
organizationOrganization = x.Profile.OrganizationOrganization,
|
||||
oc = x.Profile.Oc,
|
||||
position = x.Profile.Position == null ? null : x.Profile.Position.Name,
|
||||
positionType = x.Profile.PositionType == null ? null : x.Profile.PositionType.Name,
|
||||
positionExecutive = x.Profile.PositionExecutive,
|
||||
posNo = x.Profile.PosNo == null ? null : x.Profile.PosNo.Name,
|
||||
positionEmployeePosition = x.Profile.PositionEmployeePosition,
|
||||
positionEmployeeLevel = x.Profile.PositionEmployeeLevel,
|
||||
positionEmployeeGroup = x.Profile.PositionEmployeeGroup,
|
||||
.Where(x => x.RetirementPeriod == retire)
|
||||
.OrderBy(x => x.Order)
|
||||
.Select(x => new
|
||||
{
|
||||
order = x.Order,
|
||||
id = x.Id,
|
||||
reason = x.Reason,
|
||||
remove = x.Remove,
|
||||
profileId = x.Profile.Id,
|
||||
citizenId = x.Profile.CitizenId,
|
||||
prefix = x.Profile.Prefix == null ? string.Empty : x.Profile.Prefix.Name,
|
||||
fullName = $"{x.Profile.FirstName} {x.Profile.LastName}",
|
||||
organizationOrganization = x.Profile.OrganizationOrganization,
|
||||
oc = x.Profile.Oc,
|
||||
position = x.Profile.Position == null ? string.Empty : x.Profile.Position.Name,
|
||||
positionType = x.Profile.PositionType == null ? string.Empty : x.Profile.PositionType.Name,
|
||||
positionExecutive = x.Profile.PositionExecutive,
|
||||
posNo = x.Profile.PosNo == null ? string.Empty : x.Profile.PosNo.Name,
|
||||
positionEmployeePosition = x.Profile.PositionEmployeePosition,
|
||||
positionEmployeeLevel = x.Profile.PositionEmployeeLevel,
|
||||
positionEmployeeGroup = x.Profile.PositionEmployeeGroup,
|
||||
posNoEmployee = x.Profile.PosNoEmployee,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
return new { retire.Id, retire.CreatedAt, Year = retire.Year.ToThaiYear().ToString().ToThaiNumber(), retire.Round, retire.Type, retire.TypeReport, Total = profile_retire.Count.ToString().ToThaiNumber(), profile = profile_retire };
|
||||
return new { retire.Detail, retire.Id, retire.CreatedAt, Year = retire.Year.ToThaiYear().ToString().ToThaiNumber(), retire.Round, retire.Type, retire.TypeReport, Total = profile_retire.Count.ToString().ToThaiNumber(), profile = profile_retire };
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ namespace BMA.EHR.Application.Responses
|
|||
public int develop_other_training_percent { get; set; }
|
||||
public int develop_total_percent { get; set; }
|
||||
public int develop_result { get; set; }
|
||||
public int evaluate_result { get; set; }
|
||||
public DateTime createdAt { get; set; }
|
||||
public DateTime updatedAt { get; set; }
|
||||
}
|
||||
|
|
|
|||
24
BMA.EHR.Application/Responses/ProfileJsonRequest.cs
Normal file
24
BMA.EHR.Application/Responses/ProfileJsonRequest.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
namespace BMA.EHR.Application.Responses
|
||||
{
|
||||
public class ProfileJsonRequest
|
||||
{
|
||||
public int order { get; set; }
|
||||
public Guid id { get; set; }
|
||||
public string reason { get; set; }
|
||||
public string remove { get; set; }
|
||||
public Guid profileId { get; set; }
|
||||
public string? citizenId { get; set; }
|
||||
public string? prefix { get; set; }
|
||||
public string? fullName { get; set; }
|
||||
public string? organizationOrganization { get; set; }
|
||||
public string? oc { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? positionType { get; set; }
|
||||
public string? positionExecutive { get; set; }
|
||||
public string? posNo { get; set; }
|
||||
public string? positionEmployeePosition { get; set; }
|
||||
public string? positionEmployeeLevel { get; set; }
|
||||
public string? positionEmployeeGroup { get; set; }
|
||||
public string? posNoEmployee { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue