no message

This commit is contained in:
harid 2025-12-04 16:15:38 +07:00
parent db7626ce69
commit 48792f0d31
3 changed files with 28 additions and 7 deletions

View file

@ -371,7 +371,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
else if (role == "NORMAL")
{
rawData = rawData
.Where(x => node == 0 ? x.Child1DnaId == null : (node == 1 ? x.Child2DnaId == null : (node == 2 ? x.Child3DnaId == null : (node == 3 ? x.Child4DnaId == null : true))));
.Where(x =>
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) && x.Child2DnaId == null :
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) && x.Child3DnaId == null :
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) && x.Child4DnaId == null :
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) : true);
}
@ -543,7 +548,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
else if (role == "NORMAL")
{
rawData = rawData
.Where(x => node == 0 ? x.Child1DnaId == null : (node == 1 ? x.Child2DnaId == null : (node == 2 ? x.Child3DnaId == null : (node == 3 ? x.Child4DnaId == null : true))));
.Where(x =>
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) && x.Child2DnaId == null :
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) && x.Child3DnaId == null :
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) && x.Child4DnaId == null :
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) : true);
}
return await rawData.ToListAsync();
@ -1534,10 +1544,11 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
else if (role == "NORMAL")
{
data = data.Where(x =>
node == 0 ? x.Child1DnaId == null :
node == 1 ? x.Child2DnaId == null :
node == 2 ? x.Child3DnaId == null :
node == 3 ? x.Child4DnaId == null :
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) && x.Child2DnaId == null :
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) && x.Child3DnaId == null :
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) && x.Child4DnaId == null :
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) :
true
).ToList();
}

View file

@ -29,5 +29,15 @@ namespace BMA.EHR.Domain.Models.Leave.Requests
[Required, Comment("จำนวนวันลาที่ใช้ไป")]
public double LeaveDaysUsed { get; set; } = 0.0;
public Guid? RootDnaId { get; set; }
public Guid? Child1DnaId { get; set; }
public Guid? Child2DnaId { get; set; }
public Guid? Child3DnaId { get; set; }
public Guid? Child4DnaId { get; set; }
}
}

View file

@ -97,7 +97,7 @@ namespace BMA.EHR.Leave.Service.Controllers
{
try
{
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_LEAVE_LIST");
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_LEAVE_HISTORY");
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
if (jsonData["status"]?.ToString() != "200")
{