diff --git a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs index 6a7423f1..59cddefa 100644 --- a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs @@ -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, diff --git a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs index 444ed5d2..cbe645cc 100644 --- a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs @@ -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() - .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() + // .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 profiles = JsonConvert.DeserializeObject>(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() - .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 diff --git a/BMA.EHR.Application/Responses/EvaluateChairmanAssignResponse.cs b/BMA.EHR.Application/Responses/EvaluateChairmanAssignResponse.cs index 78878067..e40d274d 100644 --- a/BMA.EHR.Application/Responses/EvaluateChairmanAssignResponse.cs +++ b/BMA.EHR.Application/Responses/EvaluateChairmanAssignResponse.cs @@ -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; } } diff --git a/BMA.EHR.Application/Responses/ProfileJsonRequest.cs b/BMA.EHR.Application/Responses/ProfileJsonRequest.cs new file mode 100644 index 00000000..6c19f255 --- /dev/null +++ b/BMA.EHR.Application/Responses/ProfileJsonRequest.cs @@ -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; } + } +} diff --git a/BMA.EHR.Report.Service/Controllers/ProbationReportController.cs b/BMA.EHR.Report.Service/Controllers/ProbationReportController.cs index d6e48698..4da99ca5 100644 --- a/BMA.EHR.Report.Service/Controllers/ProbationReportController.cs +++ b/BMA.EHR.Report.Service/Controllers/ProbationReportController.cs @@ -1,22 +1,10 @@ using BMA.EHR.Domain.Common; -using BMA.EHR.Domain.Extensions; -using BMA.EHR.Domain.Shared; using BMA.EHR.Application.Repositories.Reports; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ModelBinding.Binders; using Swashbuckle.AspNetCore.Annotations; -using DocumentFormat.OpenXml.Drawing; using Telerik.Reporting; using Telerik.Reporting.Processing; -using System.IO; -using Newtonsoft.Json; -using BMA.EHR.Application.Responses; -using static BMA.EHR.Application.Responses.EvaluateRecordAssignResponse; -using static BMA.EHR.Application.Responses.ProbationAssignResponse; -using DocumentFormat.OpenXml.Drawing.Charts; -using DocumentFormat.OpenXml.Bibliography; -using DocumentFormat.OpenXml.Wordprocessing; namespace BMA.EHR.Report.Service.Controllers { @@ -819,7 +807,7 @@ namespace BMA.EHR.Report.Service.Controllers Check_Moral2Level2 = moral2.col2, Check_Moral2Level3 = moral2.col3, Check_Moral2Level4 = moral2.col4, - Check_Moral2Level5 = moral2.col4, + Check_Moral2Level5 = moral2.col5, Check_Moral3Level1 = moral3.col1, Check_Moral3Level2 = moral3.col2, Check_Moral3Level3 = moral3.col3, @@ -1033,7 +1021,7 @@ namespace BMA.EHR.Report.Service.Controllers Check_Moral2Level2 = moral2.col2, Check_Moral2Level3 = moral2.col3, Check_Moral2Level4 = moral2.col4, - Check_Moral2Level5 = moral2.col4, + Check_Moral2Level5 = moral2.col5, Check_Moral3Level1 = moral3.col1, Check_Moral3Level2 = moral3.col2, Check_Moral3Level3 = moral3.col3, @@ -1091,6 +1079,7 @@ namespace BMA.EHR.Report.Service.Controllers develop_other_training_percent = evaluate.develop_other_training_percent, develop_total_percent = evaluate.develop_total_percent, develop_result = evaluate.develop_result, + evaluate_result = evaluate.evaluate_result, }); var tblEvaluateAssign1 = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["table2"]; @@ -1101,7 +1090,7 @@ namespace BMA.EHR.Report.Service.Controllers tblEvaluateAssign3.DataSource = _Evaluate; var tblEvaluateAssign4 = (Telerik.Reporting.Table)report2.Items["detailSection1"].Items["table3"]; tblEvaluateAssign4.DataSource = _Evaluate; - + report2.DataSource = _Evaluate; var reportBook = new ReportBook(); reportBook.Reports.Add(report); reportBook.Reports.Add(report2); diff --git a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs index 0dfb6a88..9d56912b 100644 --- a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs +++ b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs @@ -42,14 +42,10 @@ namespace BMA.EHR.Report.Service.Controllers public async Task> GetProfileRetirement([FromRoute] Guid Id, string exportType = "pdf") { var retire = await _service.GetProfileRetirementdAsync(Id); - if (retire == null) + if (retire != null) { - return NotFound(); - } - else - { - var reportfile = ""; - var returnfile = ""; + var reportfile = string.Empty; + var returnfile = string.Empty; exportType = exportType.Trim(); switch (retire.GetType().GetProperty("Type").GetValue(retire)) { @@ -89,9 +85,10 @@ namespace BMA.EHR.Report.Service.Controllers { report = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream); } - //Add Parameter - report.ReportParameters["Year"].Value = retire.GetType().GetProperty("Year").GetValue(retire); - report.ReportParameters["Total"].Value = retire.GetType().GetProperty("Total").GetValue(retire); + report.DataSource = retire; + ////Add Parameter + //report.ReportParameters["Year"].Value = retire.GetType().GetProperty("Year").GetValue(retire); + //report.ReportParameters["Total"].Value = retire.GetType().GetProperty("Total").GetValue(retire); var _profileList = new List(); @@ -123,6 +120,10 @@ namespace BMA.EHR.Report.Service.Controllers var content = result.DocumentBytes; return File(content, $"application/{exportType}", returnfile); } + else + { + return NotFound(); + } } #endregion } diff --git a/BMA.EHR.Report.Service/Reports/16-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้บังคับบัญชา-1.trdp b/BMA.EHR.Report.Service/Reports/16-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้บังคับบัญชา-1.trdp index 36680956..13a9b82f 100644 Binary files a/BMA.EHR.Report.Service/Reports/16-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้บังคับบัญชา-1.trdp and b/BMA.EHR.Report.Service/Reports/16-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้บังคับบัญชา-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-1.trdp b/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-1.trdp index f12a4e52..9c1dad85 100644 Binary files a/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-1.trdp and b/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-2.trdp b/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-2.trdp index 4a3ce0da..25f905b0 100644 Binary files a/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-2.trdp and b/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-2.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp index aef01206..75a2286d 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp index f2f7deb8..132a00da 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp index 09beb8c6..2919650d 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp index bbb55bcf..5799b202 100644 Binary files a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp and b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp differ diff --git a/BMA.EHR.Report.Service/appsettings.json b/BMA.EHR.Report.Service/appsettings.json index d6921d83..169430e3 100644 --- a/BMA.EHR.Report.Service/appsettings.json +++ b/BMA.EHR.Report.Service/appsettings.json @@ -26,10 +26,10 @@ } }, "MinIO": { - "Endpoint": "https://s3.frappet.com/", + "Endpoint": "https://s3cluster.frappet.com/", "AccessKey": "frappet", - "SecretKey": "P@ssw0rd", - "BucketName": "bma-recruit" + "SecretKey": "FPTadmin2357", + "BucketName": "bma-ehr-fpt" }, "Protocol": "HTTPS", "telerikReporting": {