fix add person witth issue #1067
Some checks failed
release-dev / release-dev (push) Failing after 11s

This commit is contained in:
Suphonchai Phoonsawat 2025-02-13 11:43:26 +07:00
parent f4055d01c3
commit f953e24515

View file

@ -6,6 +6,7 @@ using BMA.EHR.Application.Responses.Insignias;
using BMA.EHR.Application.Responses.Organizations;
using BMA.EHR.Domain.Common;
using BMA.EHR.Domain.Extensions;
using BMA.EHR.Domain.Models.HR;
using BMA.EHR.Domain.Models.Insignias;
using BMA.EHR.Domain.Shared;
using BMA.EHR.Infrastructure.Persistence;
@ -1658,9 +1659,9 @@ namespace BMA.EHR.Insignia.Service.Controllers
if (profileInsignia == null)
{
/* var insigniaNoteProfile = new InsigniaNoteProfile
var insigniaNoteProfile = new InsigniaNoteProfile
{
Salary = profile.ProfileSalary == null || profile.ProfileSalary.Count() == 0 ? null : profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().Amount,
Salary = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.Amount,
IsApprove = true,
Status = "PENDING",
ProfileId = profile.Id,
@ -1677,7 +1678,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
Address = req.Address,
RequestInsignia = insignia,
OrganizationOrganizationReceive = req.OrganizationOrganizationReceive,
req.OrganizationOrganizationSend,
OrganizationOrganizationSend = req.OrganizationOrganizationSend,
InsigniaNote = insigniaNote,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
@ -1685,10 +1686,49 @@ namespace BMA.EHR.Insignia.Service.Controllers
LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
};*/
Amount = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.Amount,
CitizenId = profile.CitizenId,
DateAppoint = profile.DateAppoint,
Prefix = profile.Prefix,
FirstName = profile.FirstName,
LastName = profile.LastName,
Gender = profile.Gender,
PosLevelName = profile.PosLevel,
PosNo = profile.PosNo,
PosTypeName = profile.PosType,
Position = profile.Position,
ProfileType = profile.ProfileType,
PositionSalaryAmount = profile.ProfileSalary == null ? 0 : profile.ProfileSalary.PositionSalaryAmount,
Root = profile.Root,
RootId = profile.RootId,
RootDnaId = profile.RootDnaId,
Child1 = profile.Child1,
Child1Id = profile.Child1Id,
Child1DnaId = profile.Child1DnaId,
Child2 = profile.Child2,
Child2Id = profile.Child2Id,
Child2DnaId = profile.Child2DnaId,
Child3 = profile.Child3,
Child3Id = profile.Child3Id,
Child3DnaId = profile.Child3DnaId,
Child4 = profile.Child4,
Child4Id = profile.Child4Id,
Child4DnaId = profile.Child4DnaId,
};
insigniaNote.InsigniaNoteProfiles.Add(insigniaNoteProfile);
if (req.DateReceive != null && req.Date != null && profile.Id != null)
{
/*insigniaNoteProfile.Status = "DONE";*/
insigniaNoteProfile.Status = "DONE";
var profileInsigniaBody = new PostProfileInsigniaDto
{
profileId = profile.Id,