From e77757e324665a4fbb2ece1bc233a4fca80789e6 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 10 Feb 2025 17:27:13 +0700 Subject: [PATCH] fix issue #116, #1173, #1174 --- .../Controllers/DisciplineResultController.cs | 55 +++++++++++++++++++ .../PlacementAppointmentEmployeeController.cs | 1 + 2 files changed, 56 insertions(+) diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs index 56c96ab3..1ca01a7a 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs @@ -17,6 +17,7 @@ using System.Net.Http.Headers; using System.Security.Claims; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using System.Data; namespace BMA.EHR.DisciplineResult.Service.Controllers { @@ -849,6 +850,33 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers if (_res.IsSuccessStatusCode) { data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; }); + var _profile = new List(); + DateTime _date = DateTime.Now; + foreach (var item in data) + { + _profile.Add(new ProfileComplaintInvestigate + { + PersonId = item.PersonId, + Prefix = item.Prefix, + FirstName = item.FirstName, + LastName = item.LastName, + CitizenId = item.CitizenId, + rootDnaId = item.rootDnaId, + child1DnaId = item.child1DnaId, + child2DnaId = item.child2DnaId, + child3DnaId = item.child3DnaId, + child4DnaId = item.child4DnaId, + profileType = item.profileType, + commandType = "C-PM-19", + CreatedAt = _date, + CreatedUserId = UserId, + CreatedFullName = FullName, + LastUpdatedAt = _date, + LastUpdateUserId = UserId, + LastUpdateFullName = FullName, + }); + } + _context.ProfileComplaintInvestigate.AddRange(_profile); await _context.SaveChangesAsync(); } } @@ -950,6 +978,33 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers if (_res.IsSuccessStatusCode) { data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; }); + var _profile = new List(); + DateTime _date = DateTime.Now; + foreach (var item in data) + { + _profile.Add(new ProfileComplaintInvestigate + { + PersonId = item.PersonId, + Prefix = item.Prefix, + FirstName = item.FirstName, + LastName = item.LastName, + CitizenId = item.CitizenId, + rootDnaId = item.rootDnaId, + child1DnaId = item.child1DnaId, + child2DnaId = item.child2DnaId, + child3DnaId = item.child3DnaId, + child4DnaId = item.child4DnaId, + profileType = item.profileType, + commandType = "C-PM-20", + CreatedAt = _date, + CreatedUserId = UserId, + CreatedFullName = FullName, + LastUpdatedAt = _date, + LastUpdateUserId = UserId, + LastUpdateFullName = FullName, + }); + } + _context.ProfileComplaintInvestigate.AddRange(_profile); await _context.SaveChangesAsync(); } } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs index 4e7f40dd..11aaef01 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs @@ -476,6 +476,7 @@ namespace BMA.EHR.Placement.Service.Controllers placementAppointment.EducationOld = org.result.education; // placementAppointment.EducationOld = profile.Educations.Count() == 0 ? null : $"{profile.Educations.OrderByDescending(x => x.FinishDate).FirstOrDefault().Degree}-{profile.Educations.OrderByDescending(x => x.FinishDate).FirstOrDefault().Field}"; // placementAppointment.AmountOld = profile.Salaries.Count() == 0 ? null : profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount; + placementAppointment.AmountOld = org.result.salary; placementAppointment.positionOld = org.result.position; placementAppointment.PositionLevelOld = org.result.posLevelName;