Merge branch 'develop'
This commit is contained in:
commit
2aec997314
26 changed files with 2138 additions and 213 deletions
|
|
@ -155,7 +155,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
FirstName = pf.FirstName,
|
FirstName = pf.FirstName,
|
||||||
LastName = pf.LastName,
|
LastName = pf.LastName,
|
||||||
LeaveDaysUsed = 0,
|
LeaveDaysUsed = 0,
|
||||||
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0
|
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0,
|
||||||
|
RootDnaId = pf.RootDnaId,
|
||||||
|
Child1DnaId = pf.Child1DnaId,
|
||||||
|
Child2DnaId = pf.Child2DnaId,
|
||||||
|
Child3DnaId = pf.Child3DnaId,
|
||||||
|
Child4DnaId = pf.Child4DnaId
|
||||||
};
|
};
|
||||||
|
|
||||||
_dbContext.Set<LeaveBeginning>().Add(data);
|
_dbContext.Set<LeaveBeginning>().Add(data);
|
||||||
|
|
@ -216,7 +221,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
FirstName = pf.FirstName,
|
FirstName = pf.FirstName,
|
||||||
LastName = pf.LastName,
|
LastName = pf.LastName,
|
||||||
LeaveDaysUsed = 0,
|
LeaveDaysUsed = 0,
|
||||||
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0
|
LeaveDays = leaveType?.Code == "LV-005" ? limit : 0,
|
||||||
|
RootDnaId = pf.RootDnaId,
|
||||||
|
Child1DnaId = pf.Child1DnaId,
|
||||||
|
Child2DnaId = pf.Child2DnaId,
|
||||||
|
Child3DnaId = pf.Child3DnaId,
|
||||||
|
Child4DnaId = pf.Child4DnaId
|
||||||
};
|
};
|
||||||
|
|
||||||
_dbContext.Set<LeaveBeginning>().Add(data);
|
_dbContext.Set<LeaveBeginning>().Add(data);
|
||||||
|
|
|
||||||
|
|
@ -371,7 +371,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
rawData = rawData
|
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")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
rawData = rawData
|
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();
|
return await rawData.ToListAsync();
|
||||||
|
|
@ -822,15 +832,20 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
.Where(x => x.ApproveType!.ToUpper() == "COMMANDER")
|
.Where(x => x.ApproveType!.ToUpper() == "COMMANDER")
|
||||||
.OrderBy(x => x.Seq)
|
.OrderBy(x => x.Seq)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
// Send Notification
|
|
||||||
var noti1 = new Notification
|
// fix: If no commander, skip notification
|
||||||
{
|
if (firstCommander != null)
|
||||||
Body = $"การขอลาของคุณ {rawData.FirstName} {rawData.LastName} รอรับการอนุมัติจากคุณ",
|
{
|
||||||
ReceiverUserId = firstCommander!.ProfileId,
|
// Send Notification
|
||||||
Type = "",
|
var noti1 = new Notification
|
||||||
Payload = $"{URL}/leave/detail/{id}",
|
{
|
||||||
};
|
Body = $"การขอลาของคุณ {rawData.FirstName} {rawData.LastName} รอรับการอนุมัติจากคุณ",
|
||||||
_appDbContext.Set<Notification>().Add(noti1);
|
ReceiverUserId = firstCommander!.ProfileId,
|
||||||
|
Type = "",
|
||||||
|
Payload = $"{URL}/leave/detail/{id}",
|
||||||
|
};
|
||||||
|
_appDbContext.Set<Notification>().Add(noti1);
|
||||||
|
}
|
||||||
await _appDbContext.SaveChangesAsync();
|
await _appDbContext.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1534,10 +1549,11 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
data = data.Where(x =>
|
data = data.Where(x =>
|
||||||
node == 0 ? x.Child1DnaId == null :
|
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
|
||||||
node == 1 ? x.Child2DnaId == null :
|
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) && x.Child2DnaId == null :
|
||||||
node == 2 ? x.Child3DnaId == null :
|
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) && x.Child3DnaId == null :
|
||||||
node == 3 ? x.Child4DnaId == null :
|
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) && x.Child4DnaId == null :
|
||||||
|
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) :
|
||||||
true
|
true
|
||||||
).ToList();
|
).ToList();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -172,9 +172,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
data = data
|
data = data.Where(x =>
|
||||||
.Where(x => node == 0 ? x.Child1DnaId == null : (node == 1 ? x.Child2DnaId == null : (node == 2 ? x.Child3DnaId == null : (node == 3 ? x.Child4DnaId == null : true))))
|
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
|
||||||
.ToList();
|
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();
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,10 +169,11 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
data = data.Where(x =>
|
data = data.Where(x =>
|
||||||
node == 0 ? x.Child1DnaId == null :
|
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
|
||||||
node == 1 ? x.Child2DnaId == null :
|
node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) && x.Child2DnaId == null :
|
||||||
node == 2 ? x.Child3DnaId == null :
|
node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) && x.Child3DnaId == null :
|
||||||
node == 3 ? x.Child4DnaId == null :
|
node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) && x.Child4DnaId == null :
|
||||||
|
node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) :
|
||||||
true
|
true
|
||||||
).ToList();
|
).ToList();
|
||||||
}
|
}
|
||||||
|
|
@ -279,9 +280,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
data = data
|
data = data.Where(x =>
|
||||||
.Where(x => node == 0 ? x.Child1DnaId == null : (node == 1 ? x.Child2DnaId == null : (node == 2 ? x.Child3DnaId == null : (node == 3 ? x.Child4DnaId == null : true))))
|
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
|
||||||
.ToList();
|
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();
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,9 +138,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
data = data
|
data = data.Where(x =>
|
||||||
.Where(x => node == 0 ? x.Child1DnaId == null : (node == 1 ? x.Child2DnaId == null : (node == 2 ? x.Child3DnaId == null : (node == 3 ? x.Child4DnaId == null : true))))
|
node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId == null :
|
||||||
.ToList();
|
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();
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,21 +94,40 @@ namespace BMA.EHR.Application.Repositories.Reports
|
||||||
if (candidate == null)
|
if (candidate == null)
|
||||||
throw new Exception(GlobalMessages.CandidateNotFound);
|
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||||
|
|
||||||
var editorConfirmLists = string.IsNullOrEmpty(candidate.PeriodExam?.EditorConfirm)
|
List<string> editorConfirmLists;
|
||||||
? new List<string>
|
|
||||||
|
var textOnly = string.IsNullOrEmpty(candidate.PeriodExam?.EditorConfirm)
|
||||||
|
? null
|
||||||
|
: Regex.Replace(
|
||||||
|
candidate.PeriodExam.EditorConfirm,
|
||||||
|
"<[^>]+>",
|
||||||
|
string.Empty
|
||||||
|
)
|
||||||
|
.Replace(" ", " ")
|
||||||
|
.Trim();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(textOnly))
|
||||||
|
{
|
||||||
|
// ลบข้อความทั้งหมดก่อน "1." เพื่อให้เริ่มต้นที่ข้อแรกเสมอ
|
||||||
|
var cleanedText = Regex.Replace(textOnly, @"^.*?1\.", "1.").Trim();
|
||||||
|
|
||||||
|
// ถ้าข้อ 3 จบด้วย "มาตรา 1374." แล้วเลข 4. ติดกับประโยค ให้แทรกขึ้นบรรทัดใหม่เป็นข้อ 4.
|
||||||
|
if (!cleanedText.Contains("\n4.") && Regex.IsMatch(cleanedText, @"1374\.\s*"))
|
||||||
{
|
{
|
||||||
"-"
|
cleanedText = Regex.Replace(cleanedText, @"1374\.\s*", "137\n4. ");
|
||||||
}
|
}
|
||||||
: Regex.Matches(
|
|
||||||
Regex.Replace(candidate.PeriodExam.EditorConfirm, "<.*?>", string.Empty)
|
// แยกข้อความเป็นแต่ละข้อ โดย split เมื่อเจอ pattern "ตัวเลข. "
|
||||||
.Replace(" ", " ")
|
// ใช้ lookahead (?=...) เพื่อไม่กินตัวเลขทิ้ง และให้ตัวเลขยังอยู่ในผลลัพธ์
|
||||||
.Trim(),
|
editorConfirmLists = Regex.Split(cleanedText, @"(?=\d+\. )")
|
||||||
@"[1-9]\.\s*(.*?)(?=[1-9]\.|$)", // ตอนนี้ Fix ไว้ให้กรอกเลขลำดับตามด้วย .เท่านั้น เช่น 1. 2. 3. และรองรับได้สูงสุดแค่ 1-9 เท่านั้น
|
.Where(s => !string.IsNullOrWhiteSpace(s))
|
||||||
RegexOptions.Singleline
|
.Select(s => s.Replace("\n", "").Replace("\r", "").Trim())
|
||||||
)
|
.ToList();
|
||||||
.Cast<Match>()
|
}
|
||||||
.Select((m, index) => $"{index + 1}. {m.Groups[1].Value.Trim()}") // สร้างหมายเลขข้อจาก Index
|
else
|
||||||
.ToList();
|
{
|
||||||
|
editorConfirmLists = new List<string> { "-" };
|
||||||
|
}
|
||||||
|
|
||||||
return new
|
return new
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -814,8 +814,14 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
data_search = data_search
|
data_search = data_search.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
|
node == 0 ? x.rootDnaId == nodeId && x.child1DnaId == null :
|
||||||
|
node == 1 ? x.child1DnaId == nodeId && x.child2DnaId == null :
|
||||||
|
node == 2 ? x.child2DnaId == nodeId && x.child3DnaId == null :
|
||||||
|
node == 3 ? x.child3DnaId == nodeId && x.child4DnaId == null :
|
||||||
|
node == 4 ? x.child4DnaId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
var query = data_search
|
var query = data_search
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,15 @@ namespace BMA.EHR.Domain.Models.Leave.Requests
|
||||||
|
|
||||||
[Required, Comment("จำนวนวันลาที่ใช้ไป")]
|
[Required, Comment("จำนวนวันลาที่ใช้ไป")]
|
||||||
public double LeaveDaysUsed { get; set; } = 0.0;
|
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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1593
BMA.EHR.Infrastructure/Migrations/LeaveDb/20251204123147_Add Dna Field to LeaveBegging.Designer.cs
generated
Normal file
1593
BMA.EHR.Infrastructure/Migrations/LeaveDb/20251204123147_Add Dna Field to LeaveBegging.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,74 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddDnaFieldtoLeaveBegging : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "Child1DnaId",
|
||||||
|
table: "LeaveBeginnings",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "Child2DnaId",
|
||||||
|
table: "LeaveBeginnings",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "Child3DnaId",
|
||||||
|
table: "LeaveBeginnings",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "Child4DnaId",
|
||||||
|
table: "LeaveBeginnings",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "RootDnaId",
|
||||||
|
table: "LeaveBeginnings",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Child1DnaId",
|
||||||
|
table: "LeaveBeginnings");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Child2DnaId",
|
||||||
|
table: "LeaveBeginnings");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Child3DnaId",
|
||||||
|
table: "LeaveBeginnings");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Child4DnaId",
|
||||||
|
table: "LeaveBeginnings");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "RootDnaId",
|
||||||
|
table: "LeaveBeginnings");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -128,6 +128,18 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
.HasComment("PrimaryKey")
|
.HasComment("PrimaryKey")
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||||
|
|
||||||
|
b.Property<Guid?>("Child1DnaId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("Child2DnaId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("Child3DnaId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("Child4DnaId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
b.Property<DateTime>("CreatedAt")
|
||||||
.HasColumnType("datetime(6)")
|
.HasColumnType("datetime(6)")
|
||||||
.HasColumnOrder(100)
|
.HasColumnOrder(100)
|
||||||
|
|
@ -195,6 +207,9 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
.HasColumnType("char(36)")
|
.HasColumnType("char(36)")
|
||||||
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||||
|
|
||||||
|
b.Property<Guid?>("RootDnaId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("LeaveTypeId");
|
b.HasIndex("LeaveTypeId");
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
var total = insigniaManage.InsigniaManageOrganiations.Where(x => x.OrganizationId != req.OrganizationOrganizationId).Sum(x => x.Total);
|
var total = insigniaManage.InsigniaManageOrganiations.Where(x => x.OrganizationId != req.OrganizationOrganizationId).Sum(x => x.Total);
|
||||||
if (req.Total + total > insigniaManage.Total)
|
if (req.Total + total > insigniaManage.Total)
|
||||||
return Error(GlobalMessages.InsigniaManageOrgLimit);
|
return Error(GlobalMessages.InsigniaManageOrgLimit);
|
||||||
|
|
||||||
var ocData = _userProfileRepository.GetOc(req.OrganizationOrganizationId, 0, AccessToken);
|
var ocData = _userProfileRepository.GetOc(req.OrganizationOrganizationId, 0, AccessToken);
|
||||||
var root = ocData?.Root ?? null;
|
var root = ocData?.Root ?? null;
|
||||||
var rootDnaId = ocData?.RootDnaId ?? null;
|
var rootDnaId = ocData?.RootDnaId ?? null;
|
||||||
|
|
@ -714,8 +714,14 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
rawData = rawData
|
rawData = rawData.Where(x =>
|
||||||
.Where(x => node == 0 ? x.Child1DnaId == null : (node == 1 ? x.Child2DnaId == null : (node == 2 ? x.Child3DnaId == null : (node == 3 ? x.Child4DnaId == null : true)))).ToList();
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = rawData
|
var data = rawData
|
||||||
|
|
@ -993,8 +999,14 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
rawData = rawData
|
rawData = rawData.Where(x =>
|
||||||
.Where(x => node == 0 ? x.Child1DnaId == null : (node == 1 ? x.Child2DnaId == null : (node == 2 ? x.Child3DnaId == null : (node == 3 ? x.Child4DnaId == null : true)))).ToList();
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = rawData
|
var data = rawData
|
||||||
|
|
|
||||||
|
|
@ -1,61 +1,65 @@
|
||||||
{
|
{
|
||||||
"Serilog": {
|
"Serilog": {
|
||||||
"MinimumLevel": {
|
"MinimumLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Override": {
|
"Override": {
|
||||||
"Microsoft": "Information",
|
"Microsoft": "Information",
|
||||||
"System": "Warning"
|
"System": "Warning"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ElasticConfiguration": {
|
"ElasticConfiguration": {
|
||||||
"Uri": "http://192.168.1.40:9200",
|
"Uri": "http://192.168.1.40:9200",
|
||||||
"IndexFormat": "bma-ehr-log-index",
|
"IndexFormat": "bma-ehr-log-index",
|
||||||
"SystemName": "insignia"
|
"SystemName": "insignia"
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
|
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
|
||||||
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
// "DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
// "ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
// "LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
|
|
||||||
//"DefaultConnection": "server=hrms.chin.in.th;user=root;password=adminVM123;port=53636;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"DefaultConnection": "server=192.168.1.63;user=root;password=12345678;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
//"DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"ExamConnection": "server=192.168.1.63;user=root;password=12345678;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
//"ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"LeaveConnection": "server=192.168.1.63;user=root;password=12345678;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
//"LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
|
||||||
//"DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
//"DefaultConnection": "server=hrms.chin.in.th;user=root;password=adminVM123;port=53636;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
},
|
//"DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"Jwt": {
|
//"ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
//"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
|
//"LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
//"Issuer": "https://hrms-id.chin.in.th/realms/hrms"
|
//"DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
},
|
||||||
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
"Jwt": {
|
||||||
},
|
//"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
|
||||||
"EPPlus": {
|
//"Issuer": "https://hrms-id.chin.in.th/realms/hrms"
|
||||||
"ExcelPackage": {
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
"LicenseContext": "NonCommercial"
|
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
||||||
}
|
},
|
||||||
},
|
"EPPlus": {
|
||||||
"MinIO": {
|
"ExcelPackage": {
|
||||||
"Endpoint": "https://edm-s3.frappet.synology.me/",
|
"LicenseContext": "NonCommercial"
|
||||||
"AccessKey": "XxtdnJajPjp3hHuKdOMn",
|
}
|
||||||
"SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg",
|
},
|
||||||
"BucketName": "bma-ehr-fpt"
|
"MinIO": {
|
||||||
},
|
"Endpoint": "https://edm-s3.frappet.synology.me/",
|
||||||
"KeycloakCron": {
|
"AccessKey": "XxtdnJajPjp3hHuKdOMn",
|
||||||
"Hour": "08",
|
"SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg",
|
||||||
"Minute": "00"
|
"BucketName": "bma-ehr-fpt"
|
||||||
},
|
},
|
||||||
"Protocol": "HTTPS",
|
"KeycloakCron": {
|
||||||
"Node": {
|
"Hour": "08",
|
||||||
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
"Minute": "00"
|
||||||
},
|
},
|
||||||
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
"Protocol": "HTTPS",
|
||||||
"RabbitMQ": {
|
"Node": {
|
||||||
"URL": "localhost",
|
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
||||||
"UserName": "frappet",
|
},
|
||||||
"Password": "FPTadmin2357"
|
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
||||||
},
|
"RabbitMQ": {
|
||||||
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
|
"URL": "localhost",
|
||||||
|
"UserName": "frappet",
|
||||||
|
"Password": "FPTadmin2357"
|
||||||
|
},
|
||||||
|
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ using OfficeOpenXml.ConditionalFormatting;
|
||||||
using Swashbuckle.AspNetCore.Annotations;
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using BMA.EHR.Application.Responses.Profiles;
|
||||||
|
|
||||||
namespace BMA.EHR.Leave.Service.Controllers
|
namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -97,7 +98,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
try
|
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);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -109,6 +110,62 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
if (req.Type != Guid.Empty)
|
if (req.Type != Guid.Empty)
|
||||||
resData = resData.Where(x => x.LeaveTypeId == req.Type).ToList();
|
resData = resData.Where(x => x.LeaveTypeId == req.Type).ToList();
|
||||||
|
|
||||||
|
//กรองสิทธิ์
|
||||||
|
string role = jsonData["result"]?.ToString();
|
||||||
|
var nodeId = string.Empty;
|
||||||
|
var profileAdmin = new GetUserOCAllDto();
|
||||||
|
profileAdmin = await _userProfileRepository.GetUserOCAll(Guid.Parse(UserId!), AccessToken);
|
||||||
|
if (role == "NORMAL" || role == "CHILD")
|
||||||
|
{
|
||||||
|
nodeId = profileAdmin?.Node == 4
|
||||||
|
? profileAdmin?.Child4DnaId
|
||||||
|
: profileAdmin?.Node == 3
|
||||||
|
? profileAdmin?.Child3DnaId
|
||||||
|
: profileAdmin?.Node == 2
|
||||||
|
? profileAdmin?.Child2DnaId
|
||||||
|
: profileAdmin?.Node == 1
|
||||||
|
? profileAdmin?.Child1DnaId
|
||||||
|
: profileAdmin?.Node == 0
|
||||||
|
? profileAdmin?.RootDnaId
|
||||||
|
: "";
|
||||||
|
}
|
||||||
|
else if (role == "ROOT" || role == "PARENT")
|
||||||
|
{
|
||||||
|
nodeId = profileAdmin?.RootDnaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
int? node = profileAdmin?.Node;
|
||||||
|
if (role == "OWNER")
|
||||||
|
{
|
||||||
|
node = null;
|
||||||
|
}
|
||||||
|
if (role == "OWNER" || role == "CHILD")
|
||||||
|
{
|
||||||
|
resData = resData
|
||||||
|
.Where(x => node == 4 ? x.Child4DnaId == Guid.Parse(nodeId!) : (node == 3 ? x.Child3DnaId == Guid.Parse(nodeId!) : (node == 2 ? x.Child2DnaId == Guid.Parse(nodeId!) : (node == 1 ? x.Child1DnaId == Guid.Parse(nodeId!) : (node == 0 ? x.RootDnaId == Guid.Parse(nodeId!) : (node == null ? true : true)))))).ToList();
|
||||||
|
}
|
||||||
|
else if (role == "ROOT")
|
||||||
|
{
|
||||||
|
resData = resData
|
||||||
|
.Where(x => x.RootDnaId == Guid.Parse(nodeId!)).ToList();
|
||||||
|
}
|
||||||
|
else if (role == "PARENT")
|
||||||
|
{
|
||||||
|
resData = resData
|
||||||
|
.Where(x => x.RootDnaId == Guid.Parse(nodeId!) && x.Child1DnaId != null).ToList();
|
||||||
|
}
|
||||||
|
else if (role == "NORMAL")
|
||||||
|
{
|
||||||
|
resData = resData
|
||||||
|
.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).ToList();
|
||||||
|
}
|
||||||
|
//END
|
||||||
|
|
||||||
var result = new List<dynamic>();
|
var result = new List<dynamic>();
|
||||||
|
|
||||||
foreach (var item in resData)
|
foreach (var item in resData)
|
||||||
|
|
@ -205,7 +262,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("DELETE", "SYS_LEAVE_LIST");
|
var getPermission = await _permission.GetPermissionAPIAsync("DELETE", "SYS_LEAVE_HISTORY");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -237,7 +294,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_LEAVE_LIST");
|
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_LEAVE_HISTORY");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -270,7 +327,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_LEAVE_LIST");
|
var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_LEAVE_HISTORY");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -325,7 +382,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_LEAVE_LIST");
|
var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_LEAVE_HISTORY");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -359,6 +416,12 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
leaveBeginning.FirstName = profile.FirstName;
|
leaveBeginning.FirstName = profile.FirstName;
|
||||||
leaveBeginning.LastName = profile.LastName;
|
leaveBeginning.LastName = profile.LastName;
|
||||||
|
|
||||||
|
leaveBeginning.RootDnaId = profile.RootDnaId;
|
||||||
|
leaveBeginning.Child1DnaId = profile.Child1DnaId;
|
||||||
|
leaveBeginning.Child2DnaId = profile.Child2DnaId;
|
||||||
|
leaveBeginning.Child3DnaId = profile.Child3DnaId;
|
||||||
|
leaveBeginning.Child4DnaId = profile.Child4DnaId;
|
||||||
|
|
||||||
leaveBeginning.CreatedUserId = userId.ToString("D");
|
leaveBeginning.CreatedUserId = userId.ToString("D");
|
||||||
leaveBeginning.CreatedFullName = FullName ?? "";
|
leaveBeginning.CreatedFullName = FullName ?? "";
|
||||||
leaveBeginning.CreatedAt = DateTime.Now;
|
leaveBeginning.CreatedAt = DateTime.Now;
|
||||||
|
|
|
||||||
|
|
@ -1,66 +1,70 @@
|
||||||
{
|
{
|
||||||
"Serilog": {
|
"Serilog": {
|
||||||
"MinimumLevel": {
|
"MinimumLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Override": {
|
"Override": {
|
||||||
"Microsoft": "Information",
|
"Microsoft": "Information",
|
||||||
"System": "Warning"
|
"System": "Warning"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ElasticConfiguration": {
|
"ElasticConfiguration": {
|
||||||
"Uri": "http://192.168.1.40:9200",
|
"Uri": "http://192.168.1.40:9200",
|
||||||
"IndexFormat": "bma-ehr-log-index",
|
"IndexFormat": "bma-ehr-log-index",
|
||||||
"SystemName": "leave"
|
"SystemName": "leave"
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
|
|
||||||
//"DefaultConnection": "server=172.27.17.68;user=user;password=cDldaqkwESWvuZ37Gr0n;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
// "DefaultConnection": "server=192.168.1.63;user=root;password=12345678;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
//"ExamConnection": "server=172.27.17.68;user=user;password=cDldaqkwESWvuZ37Gr0n;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
// "ExamConnection": "server=192.168.1.63;user=root;password=12345678;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
//"LeaveConnection": "server=172.27.17.68;user=user;password=cDldaqkwESWvuZ37Gr0n;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
// "LeaveConnection": "server=192.168.1.63;user=root;password=12345678;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
},
|
|
||||||
"Jwt": {
|
//"DefaultConnection": "server=172.27.17.68;user=user;password=cDldaqkwESWvuZ37Gr0n;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
//"ExamConnection": "server=172.27.17.68;user=user;password=cDldaqkwESWvuZ37Gr0n;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
//"LeaveConnection": "server=172.27.17.68;user=user;password=cDldaqkwESWvuZ37Gr0n;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
//"Key": "xY2VR-EFvvNPsMs39u8ooVBWQL6mPwrNJOh3koJFTgU",
|
},
|
||||||
//"Issuer": "https://hrms-id.bangkok.go.th/realms/hrms"
|
"Jwt": {
|
||||||
},
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
"EPPlus": {
|
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
||||||
"ExcelPackage": {
|
//"Key": "xY2VR-EFvvNPsMs39u8ooVBWQL6mPwrNJOh3koJFTgU",
|
||||||
"LicenseContext": "NonCommercial"
|
//"Issuer": "https://hrms-id.bangkok.go.th/realms/hrms"
|
||||||
}
|
},
|
||||||
},
|
"EPPlus": {
|
||||||
"MinIO": {
|
"ExcelPackage": {
|
||||||
"Endpoint": "https://edm-s3.frappet.synology.me/",
|
"LicenseContext": "NonCommercial"
|
||||||
"AccessKey": "XxtdnJajPjp3hHuKdOMn",
|
}
|
||||||
"SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg",
|
},
|
||||||
"BucketName": "bma-ehr-fpt"
|
"MinIO": {
|
||||||
},
|
"Endpoint": "https://edm-s3.frappet.synology.me/",
|
||||||
"Protocol": "HTTPS",
|
"AccessKey": "XxtdnJajPjp3hHuKdOMn",
|
||||||
"Node": {
|
"SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg",
|
||||||
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
"BucketName": "bma-ehr-fpt"
|
||||||
},
|
},
|
||||||
"Rabbit": {
|
"Protocol": "HTTPS",
|
||||||
"Host": "192.168.1.40",
|
"Node": {
|
||||||
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
||||||
"User": "admin",
|
},
|
||||||
"Password": "Test123456",
|
"Rabbit": {
|
||||||
"Queue": "bma-checkin-queue",
|
"Host": "192.168.1.40",
|
||||||
"URL": "https://edm-mq.frappet.synology.me/api/queues/%2F/"
|
|
||||||
},
|
|
||||||
"Mail": {
|
|
||||||
"Server": "mail.bangkok.go.th",
|
|
||||||
"User": "saraban.csc.rd@bangkok.go.th",
|
|
||||||
"Password": "Saraban5222",
|
|
||||||
"MailFrom": "saraban.csc.rd@bangkok.go.th",
|
|
||||||
"Port": "25"
|
|
||||||
},
|
|
||||||
"VITE_URL_MGT": "https://bma-ehr.frappet.synology.me",
|
|
||||||
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
||||||
//"API": "https://bma-hrms.bangkok.go.th/api/v1",
|
"User": "admin",
|
||||||
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
|
"Password": "Test123456",
|
||||||
}
|
"Queue": "bma-checkin-queue",
|
||||||
|
"URL": "https://edm-mq.frappet.synology.me/api/queues/%2F/"
|
||||||
|
},
|
||||||
|
"Mail": {
|
||||||
|
"Server": "mail.bangkok.go.th",
|
||||||
|
"User": "saraban.csc.rd@bangkok.go.th",
|
||||||
|
"Password": "Saraban5222",
|
||||||
|
"MailFrom": "saraban.csc.rd@bangkok.go.th",
|
||||||
|
"Port": "25"
|
||||||
|
},
|
||||||
|
"VITE_URL_MGT": "https://bma-ehr.frappet.synology.me",
|
||||||
|
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
||||||
|
//"API": "https://bma-hrms.bangkok.go.th/api/v1",
|
||||||
|
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -229,15 +229,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
placementAppointments = placementAppointments
|
placementAppointments = placementAppointments.Where(x =>
|
||||||
.Where(x =>
|
node == 0 ? x.rootDnaId == nodeId && x.child1DnaId == null :
|
||||||
(node == 0 && x.child1DnaId == null && x.rootDnaId == nodeId) ||
|
node == 1 ? x.child1DnaId == nodeId && x.child2DnaId == null :
|
||||||
(node == 1 && x.child1DnaId != null && x.child2DnaId == null && x.child1DnaId == nodeId) ||
|
node == 2 ? x.child2DnaId == nodeId && x.child3DnaId == null :
|
||||||
(node == 2 && x.child2DnaId != null && x.child3DnaId == null && x.child2DnaId == nodeId) ||
|
node == 3 ? x.child3DnaId == nodeId && x.child4DnaId == null :
|
||||||
(node == 3 && x.child3DnaId != null && x.child4DnaId == null && x.child3DnaId == nodeId) ||
|
node == 4 ? x.child4DnaId == nodeId :
|
||||||
(node == 4 && x.child4DnaId == nodeId)
|
true
|
||||||
)
|
).ToList();
|
||||||
.ToList();
|
|
||||||
}
|
}
|
||||||
return Success(placementAppointments);
|
return Success(placementAppointments);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -222,8 +222,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
placementAppointments = placementAppointments
|
placementAppointments = placementAppointments.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
|
node == 0 ? x.rootDnaId == nodeId && x.child1DnaId == null :
|
||||||
|
node == 1 ? x.child1DnaId == nodeId && x.child2DnaId == null :
|
||||||
|
node == 2 ? x.child2DnaId == nodeId && x.child3DnaId == null :
|
||||||
|
node == 3 ? x.child3DnaId == nodeId && x.child4DnaId == null :
|
||||||
|
node == 4 ? x.child4DnaId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
return Success(placementAppointments);
|
return Success(placementAppointments);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -183,8 +183,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
placementOfficers = placementOfficers
|
placementOfficers = placementOfficers.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
|
||||||
|
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
|
||||||
|
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
|
||||||
|
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
|
||||||
|
node == 4 ? x.child4DnaOldId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
return Success(placementOfficers);
|
return Success(placementOfficers);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -221,8 +221,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
placementReceives = placementReceives
|
placementReceives = placementReceives.Where(x =>
|
||||||
.Where(x => (node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))) || (x.CreatedUserId == UserId)).ToList();
|
node == 0 ? x.rootDnaId == nodeId && x.child1DnaId == null :
|
||||||
|
node == 1 ? x.child1DnaId == nodeId && x.child2DnaId == null :
|
||||||
|
node == 2 ? x.child2DnaId == nodeId && x.child3DnaId == null :
|
||||||
|
node == 3 ? x.child3DnaId == nodeId && x.child4DnaId == null :
|
||||||
|
node == 4 ? x.child4DnaId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
return Success(placementReceives);
|
return Success(placementReceives);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -188,8 +188,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
placementRepatriations = placementRepatriations
|
placementRepatriations = placementRepatriations.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
|
||||||
|
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
|
||||||
|
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
|
||||||
|
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
|
||||||
|
node == 4 ? x.child4DnaOldId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
return Success(placementRepatriations);
|
return Success(placementRepatriations);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -274,8 +274,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
placementTransfers = placementTransfers
|
placementTransfers = placementTransfers.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
|
||||||
|
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
|
||||||
|
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
|
||||||
|
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
|
||||||
|
node == 4 ? x.child4DnaOldId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success(placementTransfers);
|
return Success(placementTransfers);
|
||||||
|
|
|
||||||
|
|
@ -167,8 +167,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
retirementDeceaseds = retirementDeceaseds
|
retirementDeceaseds = retirementDeceaseds.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
|
node == 0 ? x.rootDnaId == nodeId && x.child1DnaId == null :
|
||||||
|
node == 1 ? x.child1DnaId == nodeId && x.child2DnaId == null :
|
||||||
|
node == 2 ? x.child2DnaId == nodeId && x.child3DnaId == null :
|
||||||
|
node == 3 ? x.child3DnaId == nodeId && x.child4DnaId == null :
|
||||||
|
node == 4 ? x.child4DnaId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
return Success(retirementDeceaseds);
|
return Success(retirementDeceaseds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -217,8 +217,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
retirementOthers = retirementOthers
|
retirementOthers = retirementOthers.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
|
||||||
|
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
|
||||||
|
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
|
||||||
|
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
|
||||||
|
node == 4 ? x.child4DnaOldId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
return Success(retirementOthers);
|
return Success(retirementOthers);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,8 +198,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
retirementOuts = retirementOuts
|
retirementOuts = retirementOuts.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
|
||||||
|
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
|
||||||
|
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
|
||||||
|
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
|
||||||
|
node == 4 ? x.child4DnaOldId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
return Success(retirementOuts);
|
return Success(retirementOuts);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,8 +324,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
retirementResigns = retirementResigns
|
retirementResigns = retirementResigns.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
|
||||||
|
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
|
||||||
|
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
|
||||||
|
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
|
||||||
|
node == 4 ? x.child4DnaOldId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success(retirementResigns);
|
return Success(retirementResigns);
|
||||||
|
|
@ -432,8 +438,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
retirementResigns = retirementResigns
|
retirementResigns = retirementResigns.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
|
||||||
|
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
|
||||||
|
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
|
||||||
|
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
|
||||||
|
node == 4 ? x.child4DnaOldId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success(retirementResigns);
|
return Success(retirementResigns);
|
||||||
|
|
@ -2197,8 +2209,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
data = data
|
data = data.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
|
node == 0 ? x.rootDnaId == nodeId && x.child1DnaId == null :
|
||||||
|
node == 1 ? x.child1DnaId == nodeId && x.child2DnaId == null :
|
||||||
|
node == 2 ? x.child2DnaId == nodeId && x.child3DnaId == null :
|
||||||
|
node == 3 ? x.child3DnaId == nodeId && x.child4DnaId == null :
|
||||||
|
node == 4 ? x.child4DnaId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
return Success(data);
|
return Success(data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -263,8 +263,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
retirementResignEmployees = retirementResignEmployees
|
retirementResignEmployees = retirementResignEmployees.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
|
||||||
|
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
|
||||||
|
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
|
||||||
|
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
|
||||||
|
node == 4 ? x.child4DnaOldId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success(retirementResignEmployees);
|
return Success(retirementResignEmployees);
|
||||||
|
|
@ -370,8 +376,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
retirementResignEmployees = retirementResignEmployees
|
retirementResignEmployees = retirementResignEmployees.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
node == 0 ? x.rootDnaOldId == nodeId && x.child1DnaOldId == null :
|
||||||
|
node == 1 ? x.child1DnaOldId == nodeId && x.child2DnaOldId == null :
|
||||||
|
node == 2 ? x.child2DnaOldId == nodeId && x.child3DnaOldId == null :
|
||||||
|
node == 3 ? x.child3DnaOldId == nodeId && x.child4DnaOldId == null :
|
||||||
|
node == 4 ? x.child4DnaOldId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success(retirementResignEmployees);
|
return Success(retirementResignEmployees);
|
||||||
|
|
@ -2113,8 +2125,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else if (role == "NORMAL")
|
else if (role == "NORMAL")
|
||||||
{
|
{
|
||||||
data = data
|
data = data.Where(x =>
|
||||||
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
|
node == 0 ? x.rootDnaId == nodeId && x.child1DnaId == null :
|
||||||
|
node == 1 ? x.child1DnaId == nodeId && x.child2DnaId == null :
|
||||||
|
node == 2 ? x.child2DnaId == nodeId && x.child3DnaId == null :
|
||||||
|
node == 3 ? x.child3DnaId == nodeId && x.child4DnaId == null :
|
||||||
|
node == 4 ? x.child4DnaId == nodeId :
|
||||||
|
true
|
||||||
|
).ToList();
|
||||||
}
|
}
|
||||||
return Success(data);
|
return Success(data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue