fix issue #116, #1173, #1174
Some checks failed
release-dev / release-dev (push) Failing after 11s

This commit is contained in:
Bright 2025-02-10 17:27:13 +07:00
parent b6aa239b57
commit e77757e324
2 changed files with 56 additions and 0 deletions

View file

@ -17,6 +17,7 @@ using System.Net.Http.Headers;
using System.Security.Claims; using System.Security.Claims;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System.Data;
namespace BMA.EHR.DisciplineResult.Service.Controllers namespace BMA.EHR.DisciplineResult.Service.Controllers
{ {
@ -849,6 +850,33 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
if (_res.IsSuccessStatusCode) if (_res.IsSuccessStatusCode)
{ {
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; }); data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
var _profile = new List<ProfileComplaintInvestigate>();
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(); await _context.SaveChangesAsync();
} }
} }
@ -950,6 +978,33 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
if (_res.IsSuccessStatusCode) if (_res.IsSuccessStatusCode)
{ {
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; }); data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
var _profile = new List<ProfileComplaintInvestigate>();
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(); await _context.SaveChangesAsync();
} }
} }

View file

@ -476,6 +476,7 @@ namespace BMA.EHR.Placement.Service.Controllers
placementAppointment.EducationOld = org.result.education; 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.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 = profile.Salaries.Count() == 0 ? null : profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount;
placementAppointment.AmountOld = org.result.salary;
placementAppointment.positionOld = org.result.position; placementAppointment.positionOld = org.result.position;
placementAppointment.PositionLevelOld = org.result.posLevelName; placementAppointment.PositionLevelOld = org.result.posLevelName;