Merge branch 'develop'
All checks were successful
All checks were successful
This commit is contained in:
commit
21c10d66f5
26 changed files with 2138 additions and 213 deletions
|
|
@ -155,7 +155,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
FirstName = pf.FirstName,
|
||||
LastName = pf.LastName,
|
||||
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);
|
||||
|
|
@ -216,7 +221,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
FirstName = pf.FirstName,
|
||||
LastName = pf.LastName,
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
@ -822,15 +832,20 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
.Where(x => x.ApproveType!.ToUpper() == "COMMANDER")
|
||||
.OrderBy(x => x.Seq)
|
||||
.FirstOrDefault();
|
||||
// Send Notification
|
||||
var noti1 = new Notification
|
||||
{
|
||||
Body = $"การขอลาของคุณ {rawData.FirstName} {rawData.LastName} รอรับการอนุมัติจากคุณ",
|
||||
ReceiverUserId = firstCommander!.ProfileId,
|
||||
Type = "",
|
||||
Payload = $"{URL}/leave/detail/{id}",
|
||||
};
|
||||
_appDbContext.Set<Notification>().Add(noti1);
|
||||
|
||||
// fix: If no commander, skip notification
|
||||
if (firstCommander != null)
|
||||
{
|
||||
// Send Notification
|
||||
var noti1 = new Notification
|
||||
{
|
||||
Body = $"การขอลาของคุณ {rawData.FirstName} {rawData.LastName} รอรับการอนุมัติจากคุณ",
|
||||
ReceiverUserId = firstCommander!.ProfileId,
|
||||
Type = "",
|
||||
Payload = $"{URL}/leave/detail/{id}",
|
||||
};
|
||||
_appDbContext.Set<Notification>().Add(noti1);
|
||||
}
|
||||
await _appDbContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
|
@ -1534,10 +1549,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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,9 +172,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
|||
}
|
||||
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 : true))))
|
||||
.ToList();
|
||||
data = data.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();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,10 +169,11 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
|||
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();
|
||||
}
|
||||
|
|
@ -279,9 +280,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
|||
}
|
||||
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 : true))))
|
||||
.ToList();
|
||||
data = data.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();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,9 +138,14 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
|||
}
|
||||
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 : true))))
|
||||
.ToList();
|
||||
data = data.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();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,21 +94,40 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
if (candidate == null)
|
||||
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||
|
||||
var editorConfirmLists = string.IsNullOrEmpty(candidate.PeriodExam?.EditorConfirm)
|
||||
? new List<string>
|
||||
List<string> editorConfirmLists;
|
||||
|
||||
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)
|
||||
.Replace(" ", " ")
|
||||
.Trim(),
|
||||
@"[1-9]\.\s*(.*?)(?=[1-9]\.|$)", // ตอนนี้ Fix ไว้ให้กรอกเลขลำดับตามด้วย .เท่านั้น เช่น 1. 2. 3. และรองรับได้สูงสุดแค่ 1-9 เท่านั้น
|
||||
RegexOptions.Singleline
|
||||
)
|
||||
.Cast<Match>()
|
||||
.Select((m, index) => $"{index + 1}. {m.Groups[1].Value.Trim()}") // สร้างหมายเลขข้อจาก Index
|
||||
.ToList();
|
||||
|
||||
// แยกข้อความเป็นแต่ละข้อ โดย split เมื่อเจอ pattern "ตัวเลข. "
|
||||
// ใช้ lookahead (?=...) เพื่อไม่กินตัวเลขทิ้ง และให้ตัวเลขยังอยู่ในผลลัพธ์
|
||||
editorConfirmLists = Regex.Split(cleanedText, @"(?=\d+\. )")
|
||||
.Where(s => !string.IsNullOrWhiteSpace(s))
|
||||
.Select(s => s.Replace("\n", "").Replace("\r", "").Trim())
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
editorConfirmLists = new List<string> { "-" };
|
||||
}
|
||||
|
||||
return new
|
||||
{
|
||||
|
|
|
|||
|
|
@ -814,8 +814,14 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
data_search = data_search
|
||||
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
|
||||
data_search = data_search.Where(x =>
|
||||
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
|
||||
.Select(x => new
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
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")
|
||||
.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")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
|
|
@ -195,6 +207,9 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
.HasColumnType("char(36)")
|
||||
.HasComment("รหัส Profile ในระบบทะเบียนประวัติ");
|
||||
|
||||
b.Property<Guid?>("RootDnaId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
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);
|
||||
if (req.Total + total > insigniaManage.Total)
|
||||
return Error(GlobalMessages.InsigniaManageOrgLimit);
|
||||
|
||||
|
||||
var ocData = _userProfileRepository.GetOc(req.OrganizationOrganizationId, 0, AccessToken);
|
||||
var root = ocData?.Root ?? null;
|
||||
var rootDnaId = ocData?.RootDnaId ?? null;
|
||||
|
|
@ -714,8 +714,14 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
}
|
||||
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)))).ToList();
|
||||
rawData = rawData.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();
|
||||
}
|
||||
|
||||
var data = rawData
|
||||
|
|
@ -993,8 +999,14 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
}
|
||||
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)))).ToList();
|
||||
rawData = rawData.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();
|
||||
}
|
||||
|
||||
var data = rawData
|
||||
|
|
|
|||
|
|
@ -1,61 +1,65 @@
|
|||
{
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"Microsoft": "Information",
|
||||
"System": "Warning"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ElasticConfiguration": {
|
||||
"Uri": "http://192.168.1.40:9200",
|
||||
"IndexFormat": "bma-ehr-log-index",
|
||||
"SystemName": "insignia"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
//"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;",
|
||||
"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;"
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"Microsoft": "Information",
|
||||
"System": "Warning"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ElasticConfiguration": {
|
||||
"Uri": "http://192.168.1.40:9200",
|
||||
"IndexFormat": "bma-ehr-log-index",
|
||||
"SystemName": "insignia"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
//"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;",
|
||||
// "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;"
|
||||
|
||||
//"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;",
|
||||
//"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=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;"
|
||||
},
|
||||
"Jwt": {
|
||||
//"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
|
||||
//"Issuer": "https://hrms-id.chin.in.th/realms/hrms"
|
||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
||||
},
|
||||
"EPPlus": {
|
||||
"ExcelPackage": {
|
||||
"LicenseContext": "NonCommercial"
|
||||
}
|
||||
},
|
||||
"MinIO": {
|
||||
"Endpoint": "https://edm-s3.frappet.synology.me/",
|
||||
"AccessKey": "XxtdnJajPjp3hHuKdOMn",
|
||||
"SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg",
|
||||
"BucketName": "bma-ehr-fpt"
|
||||
},
|
||||
"KeycloakCron": {
|
||||
"Hour": "08",
|
||||
"Minute": "00"
|
||||
},
|
||||
"Protocol": "HTTPS",
|
||||
"Node": {
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
||||
},
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
||||
"RabbitMQ": {
|
||||
"URL": "localhost",
|
||||
"UserName": "frappet",
|
||||
"Password": "FPTadmin2357"
|
||||
},
|
||||
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
|
||||
"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=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=192.168.1.63;user=root;password=12345678;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=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;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=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;"
|
||||
},
|
||||
"Jwt": {
|
||||
//"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
|
||||
//"Issuer": "https://hrms-id.chin.in.th/realms/hrms"
|
||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
||||
},
|
||||
"EPPlus": {
|
||||
"ExcelPackage": {
|
||||
"LicenseContext": "NonCommercial"
|
||||
}
|
||||
},
|
||||
"MinIO": {
|
||||
"Endpoint": "https://edm-s3.frappet.synology.me/",
|
||||
"AccessKey": "XxtdnJajPjp3hHuKdOMn",
|
||||
"SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg",
|
||||
"BucketName": "bma-ehr-fpt"
|
||||
},
|
||||
"KeycloakCron": {
|
||||
"Hour": "08",
|
||||
"Minute": "00"
|
||||
},
|
||||
"Protocol": "HTTPS",
|
||||
"Node": {
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
||||
},
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
||||
"RabbitMQ": {
|
||||
"URL": "localhost",
|
||||
"UserName": "frappet",
|
||||
"Password": "FPTadmin2357"
|
||||
},
|
||||
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ using OfficeOpenXml.ConditionalFormatting;
|
|||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using BMA.EHR.Application.Responses.Profiles;
|
||||
|
||||
namespace BMA.EHR.Leave.Service.Controllers
|
||||
{
|
||||
|
|
@ -97,7 +98,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")
|
||||
{
|
||||
|
|
@ -109,6 +110,62 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
if (req.Type != Guid.Empty)
|
||||
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>();
|
||||
|
||||
foreach (var item in resData)
|
||||
|
|
@ -205,7 +262,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
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);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
|
|
@ -237,7 +294,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
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);
|
||||
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 getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_LEAVE_LIST");
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_LEAVE_HISTORY");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
|
|
@ -325,7 +382,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
try
|
||||
{
|
||||
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);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
|
|
@ -359,6 +416,12 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveBeginning.FirstName = profile.FirstName;
|
||||
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.CreatedFullName = FullName ?? "";
|
||||
leaveBeginning.CreatedAt = DateTime.Now;
|
||||
|
|
|
|||
|
|
@ -1,66 +1,70 @@
|
|||
{
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"Microsoft": "Information",
|
||||
"System": "Warning"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ElasticConfiguration": {
|
||||
"Uri": "http://192.168.1.40:9200",
|
||||
"IndexFormat": "bma-ehr-log-index",
|
||||
"SystemName": "leave"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"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;",
|
||||
"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;"
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"Microsoft": "Information",
|
||||
"System": "Warning"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ElasticConfiguration": {
|
||||
"Uri": "http://192.168.1.40:9200",
|
||||
"IndexFormat": "bma-ehr-log-index",
|
||||
"SystemName": "leave"
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"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;",
|
||||
"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;"
|
||||
|
||||
//"DefaultConnection": "server=172.27.17.68;user=user;password=cDldaqkwESWvuZ37Gr0n;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;",
|
||||
//"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;"
|
||||
},
|
||||
"Jwt": {
|
||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
||||
//"Key": "xY2VR-EFvvNPsMs39u8ooVBWQL6mPwrNJOh3koJFTgU",
|
||||
//"Issuer": "https://hrms-id.bangkok.go.th/realms/hrms"
|
||||
},
|
||||
"EPPlus": {
|
||||
"ExcelPackage": {
|
||||
"LicenseContext": "NonCommercial"
|
||||
}
|
||||
},
|
||||
"MinIO": {
|
||||
"Endpoint": "https://edm-s3.frappet.synology.me/",
|
||||
"AccessKey": "XxtdnJajPjp3hHuKdOMn",
|
||||
"SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg",
|
||||
"BucketName": "bma-ehr-fpt"
|
||||
},
|
||||
"Protocol": "HTTPS",
|
||||
"Node": {
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
||||
},
|
||||
"Rabbit": {
|
||||
"Host": "192.168.1.40",
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
||||
"User": "admin",
|
||||
"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",
|
||||
// "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=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=192.168.1.63;user=root;password=12345678;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;",
|
||||
//"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;",
|
||||
//"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;"
|
||||
},
|
||||
"Jwt": {
|
||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||
"Issuer": "https://id.frappet.synology.me/realms/hrms"
|
||||
//"Key": "xY2VR-EFvvNPsMs39u8ooVBWQL6mPwrNJOh3koJFTgU",
|
||||
//"Issuer": "https://hrms-id.bangkok.go.th/realms/hrms"
|
||||
},
|
||||
"EPPlus": {
|
||||
"ExcelPackage": {
|
||||
"LicenseContext": "NonCommercial"
|
||||
}
|
||||
},
|
||||
"MinIO": {
|
||||
"Endpoint": "https://edm-s3.frappet.synology.me/",
|
||||
"AccessKey": "XxtdnJajPjp3hHuKdOMn",
|
||||
"SecretKey": "rVPzB05giC7bA400cUuIThzT4T9SGCcpcmL3tBBg",
|
||||
"BucketName": "bma-ehr-fpt"
|
||||
},
|
||||
"Protocol": "HTTPS",
|
||||
"Node": {
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
||||
},
|
||||
"Rabbit": {
|
||||
"Host": "192.168.1.40",
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
||||
//"API": "https://bma-hrms.bangkok.go.th/api/v1",
|
||||
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
|
||||
}
|
||||
"User": "admin",
|
||||
"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")
|
||||
{
|
||||
placementAppointments = placementAppointments
|
||||
.Where(x =>
|
||||
(node == 0 && x.child1DnaId == null && x.rootDnaId == nodeId) ||
|
||||
(node == 1 && x.child1DnaId != null && x.child2DnaId == null && x.child1DnaId == nodeId) ||
|
||||
(node == 2 && x.child2DnaId != null && x.child3DnaId == null && x.child2DnaId == nodeId) ||
|
||||
(node == 3 && x.child3DnaId != null && x.child4DnaId == null && x.child3DnaId == nodeId) ||
|
||||
(node == 4 && x.child4DnaId == nodeId)
|
||||
)
|
||||
.ToList();
|
||||
placementAppointments = placementAppointments.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,8 +222,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
placementAppointments = placementAppointments
|
||||
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
|
||||
placementAppointments = placementAppointments.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,8 +183,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
placementOfficers = placementOfficers
|
||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
||||
placementOfficers = placementOfficers.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,8 +221,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
placementReceives = placementReceives
|
||||
.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();
|
||||
placementReceives = placementReceives.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,8 +188,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
placementRepatriations = placementRepatriations
|
||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
||||
placementRepatriations = placementRepatriations.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,8 +274,14 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
placementTransfers = placementTransfers
|
||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
||||
placementTransfers = placementTransfers.Where(x =>
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -167,8 +167,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
retirementDeceaseds = retirementDeceaseds
|
||||
.Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList();
|
||||
retirementDeceaseds = retirementDeceaseds.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,8 +217,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
retirementOthers = retirementOthers
|
||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
||||
retirementOthers = retirementOthers.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,8 +198,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
retirementOuts = retirementOuts
|
||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
||||
retirementOuts = retirementOuts.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,8 +324,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
retirementResigns = retirementResigns
|
||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
||||
retirementResigns = retirementResigns.Where(x =>
|
||||
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);
|
||||
|
|
@ -432,8 +438,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
retirementResigns = retirementResigns
|
||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
||||
retirementResigns = retirementResigns.Where(x =>
|
||||
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);
|
||||
|
|
@ -2197,8 +2209,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
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 : true)))).ToList();
|
||||
data = data.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,8 +263,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
retirementResignEmployees = retirementResignEmployees
|
||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
||||
retirementResignEmployees = retirementResignEmployees.Where(x =>
|
||||
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);
|
||||
|
|
@ -370,8 +376,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
else if (role == "NORMAL")
|
||||
{
|
||||
retirementResignEmployees = retirementResignEmployees
|
||||
.Where(x => node == 0 ? x.child1DnaOldId == null : (node == 1 ? x.child2DnaOldId == null : (node == 2 ? x.child3DnaOldId == null : (node == 3 ? x.child4DnaOldId == null : true)))).ToList();
|
||||
retirementResignEmployees = retirementResignEmployees.Where(x =>
|
||||
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);
|
||||
|
|
@ -2113,8 +2125,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
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 : true)))).ToList();
|
||||
data = data.Where(x =>
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue