From e092604b970e9834ae96bc7b0b9115a3c95b9f05 Mon Sep 17 00:00:00 2001 From: kittapath Date: Fri, 21 Feb 2025 19:11:20 +0700 Subject: [PATCH 1/6] =?UTF-8?q?=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84?= =?UTF-8?q?=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B9=83=E0=B8=AB?= =?UTF-8?q?=E0=B8=A1=E0=B9=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DisciplineResultController.cs | 207 +++++++++-------- .../Requests/PassDisciplineResponse.cs | 2 +- .../Requests/ReportExecuteRequest.cs | 11 +- .../PlacementAppointmentController.cs | 171 ++++++++------ .../Controllers/PlacementController.cs | 217 ++++++++++-------- .../Controllers/PlacementOfficerController.cs | 32 ++- .../Controllers/PlacementReceiveController.cs | 47 ++-- .../PlacementRepatriationController.cs | 34 ++- .../PlacementTransferController.cs | 33 ++- .../Requests/ReportExecuteRequest.cs | 11 +- .../Controllers/RetirementOtherController.cs | 60 +++-- .../Controllers/RetirementOutController.cs | 32 ++- .../Controllers/RetirementResignController.cs | 65 ++++-- .../RetirementResignEmployeeController.cs | 66 ++++-- .../Requests/ReportExecuteRequest.cs | 11 +- 15 files changed, 592 insertions(+), 407 deletions(-) diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs index 1ca01a7a..c38dea13 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs @@ -539,7 +539,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers detail = data.DisciplineDisciplinary.Title, level = data.DisciplineDisciplinary.DisciplinaryFaultLevel, refCommandDate = DateTime.Now, - refCommandNo = $"{d.commandNo}/{d.commandYear}", + refCommandNo = $"{d.commandNo}/{d.commandYear?.ToThaiYear()}", unStigma = d.detail, }); var _result = await _res.Content.ReadAsStringAsync(); @@ -586,7 +586,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers detail = data.DisciplineDisciplinary.Title, level = data.DisciplineDisciplinary.DisciplinaryFaultLevel, refCommandDate = DateTime.Now, - refCommandNo = $"{d.commandNo}/{d.commandYear}", + refCommandNo = $"{d.commandNo}/{d.commandYear?.ToThaiYear()}", unStigma = d.detail, }); var _result = await _res.Content.ReadAsStringAsync(); @@ -632,7 +632,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers detail = data1.DisciplineInvestigate.Title, level = "", refCommandDate = DateTime.Now, - refCommandNo = $"{d.commandNo}/{d.commandYear}", + refCommandNo = $"{d.commandNo}/{d.commandYear?.ToThaiYear()}", unStigma = d.detail, }); var _result = await _res.Content.ReadAsStringAsync(); @@ -660,7 +660,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers detail = data2.DisciplineDisciplinary.Title, level = data2.DisciplineDisciplinary.DisciplinaryFaultLevel, refCommandDate = DateTime.Now, - refCommandNo = $"{d.commandNo}/{d.commandYear}", + refCommandNo = $"{d.commandNo}/{d.commandYear?.ToThaiYear()}", unStigma = d.detail, }); var _result = await _res.Content.ReadAsStringAsync(); @@ -815,25 +815,26 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = true, leaveReason = "ได้รับโทษทางวินัย ปลดออกจากราชการ", - dateLeave = r.commandAffectDate, - refCommandDate = DateTime.Now, + dateLeave = r.commandDateAffect, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, unStigma = "คำสั่งลงโทษ ปลดออกจากราชการ", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, isGovernment = false, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -943,25 +944,26 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = true, - leaveReason = "ได้รับโทษทางวินัย ออกจากราชการ", - dateLeave = r.commandAffectDate, - refCommandDate = DateTime.Now, + leaveReason = "ได้รับโทษทางวินัย ไล่ออกจากราชการ", + dateLeave = r.commandDateAffect, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, unStigma = "คำสั่งลงโทษ ไล่ออกจากราชการ", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, isGovernment = false, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1149,25 +1151,26 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = true, leaveReason = "ได้รับโทษทางวินัย พักจากราชการ", - dateLeave = r.commandAffectDate, - refCommandDate = DateTime.Now, + dateLeave = r.commandDateAffect, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, unStigma = "คำสั่งลงโทษ พักจากราชการ", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, isGovernment = false, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1266,25 +1269,26 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = true, leaveReason = "ได้รับโทษทางวินัย ให้ออกจากราชการไว้ก่อน", - dateLeave = r.commandAffectDate, - refCommandDate = DateTime.Now, + dateLeave = r.commandDateAffect, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, unStigma = "คำสั่งลงโทษ ให้ออกจากราชการไว้ก่อน", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, isGovernment = false, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1382,24 +1386,25 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = _null, leaveReason = _null, dateLeave = _null, - refCommandDate = DateTime.Now, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, unStigma = "คำสั่งลงโทษ ลงโทษ ภาคทัณฑ์", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1497,24 +1502,25 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = _null, leaveReason = _null, dateLeave = _null, - refCommandDate = DateTime.Now, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, unStigma = "คำสั่งลงโทษ ตัดเงินเดือน", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1612,24 +1618,25 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = _null, leaveReason = _null, dateLeave = _null, - refCommandDate = DateTime.Now, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, unStigma = "คำสั่งลงโทษ ลดขั้นเงินเดือน", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1727,24 +1734,25 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = _null, leaveReason = _null, dateLeave = _null, - refCommandDate = DateTime.Now, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, unStigma = "คำสั่งเพิ่มโทษ", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1842,24 +1850,25 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = _null, leaveReason = _null, dateLeave = _null, - refCommandDate = DateTime.Now, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, unStigma = "คำสั่งงดโทษ", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1973,24 +1982,25 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - commandId = r.commandId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = false, leaveReason = _null, dateLeave = _null, - refCommandDate = DateTime.Now, detail = p.DisciplineInvestigate.Title, level = "", unStigma = "คำสั่งยุติเรื่อง", + commandId = r.commandId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - profileType = p.profileType, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave-discipline"; @@ -2021,16 +2031,25 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers select new { profileId = p.PersonId, - date = r.commandAffectDate, - refCommandNo = $"{r.commandNo}/{r.commandYear}", - salaryRef = r.templateDoc, + profileType = p.profileType, isLeave = false, leaveReason = _null, dateLeave = _null, - refCommandDate = DateTime.Now, detail = p.DisciplineDisciplinary.Title, level = p.DisciplineDisciplinary.DisciplinaryFaultLevel, - unStigma = "คำสั่งยุติเรื่อง" + unStigma = "คำสั่งยุติเรื่อง", + commandId = r.commandId, + amount = r.amount, + amountSpecial = r.amountSpecial, + positionSalaryAmount = r.positionSalaryAmount, + mouthSalaryAmount = r.mouthSalaryAmount, + commandNo = r.commandNo, + commandYear = r.commandYear, + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); using (var client = new HttpClient()) { diff --git a/BMA.EHR.Discipline.Service/Requests/PassDisciplineResponse.cs b/BMA.EHR.Discipline.Service/Requests/PassDisciplineResponse.cs index 2e3a8a81..2882afef 100644 --- a/BMA.EHR.Discipline.Service/Requests/PassDisciplineResponse.cs +++ b/BMA.EHR.Discipline.Service/Requests/PassDisciplineResponse.cs @@ -16,7 +16,7 @@ namespace BMA.EHR.Discipline.Service.Requests public DateTime? commandAffectDate { get; set; } public string? commandNo { get; set; } - public string? commandYear { get; set; } + public int? commandYear { get; set; } public string? detail { get; set; } } } diff --git a/BMA.EHR.Discipline.Service/Requests/ReportExecuteRequest.cs b/BMA.EHR.Discipline.Service/Requests/ReportExecuteRequest.cs index bbe62ce8..bf5a59b1 100644 --- a/BMA.EHR.Discipline.Service/Requests/ReportExecuteRequest.cs +++ b/BMA.EHR.Discipline.Service/Requests/ReportExecuteRequest.cs @@ -10,16 +10,17 @@ namespace BMA.EHR.Discipline.Service.Requests public class ReportExecuteRequestObj { public string? refId { get; set; } - public DateTime commandAffectDate { get; set; } public string? commandNo { get; set; } - public string? commandId { get; set; } public int commandYear { get; set; } - public string? templateDoc { get; set; } + public string? commandId { get; set; } + public string? remark { get; set; } public double? amount { get; set; } public double? amountSpecial { get; set; } public double? positionSalaryAmount { get; set; } public double? mouthSalaryAmount { get; set; } - public string? refCommandCode { get; set; } - public string? refCommandName { get; set; } + public string? commandCode { get; set; } + public string? commandName { get; set; } + public DateTime commandDateAffect { get; set; } + public DateTime commandDateSign { get; set; } } } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index 342254c9..3b19dcef 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -908,30 +908,35 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.position, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.posTypeName, positionLevel = p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.position, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1127,30 +1132,35 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.position, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.posTypeName, positionLevel = p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.position, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1337,27 +1347,34 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.position, positionType = p.posTypeName, positionLevel = p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.position, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1549,27 +1566,34 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.position, positionType = p.posTypeName, positionLevel = p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.position, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1777,30 +1801,35 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.position, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.posTypeName, positionLevel = p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.position, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index ac13682b..8394ebdf 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -1749,8 +1749,8 @@ namespace BMA.EHR.Placement.Service.Controllers isProbation = true, isLeave = false, dateRetire = (DateTime?)null, - dateAppoint = r.commandAffectDate, - dateStart = r.commandAffectDate, + dateAppoint = r.commandDateAffect, + dateStart = r.commandDateAffect, govAgeAbsent = 0, govAgePlus = 0, birthDate = p.DateOfBirth == null ? (DateTime?)null : p.DateOfBirth, @@ -1809,30 +1809,34 @@ namespace BMA.EHR.Placement.Service.Controllers }).ToList(), bodySalarys = new { - profileId = string.Empty, - date = r.commandAffectDate, - commandId = r.commandId, + profileId = p.profileId, amount = r.amount, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.positionName == null ? string.Empty : p.positionName, - positionLine = string.Empty, - positionPathSide = string.Empty, - positionExecutive = string.Empty, - positionType = p.posTypeName == null ? string.Empty : p.posTypeName, - positionLevel = p.posLevelName == null ? string.Empty : p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, - isGovernment = true, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + positionExecutive = "", + positionType = p.posTypeName, + positionLevel = p.posLevelName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.positionName, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }, bodyPosition = new { @@ -1860,11 +1864,11 @@ namespace BMA.EHR.Placement.Service.Controllers if (req.refIds.Length > 0) { profile.commandId = req.refIds[0].commandId; - profile.refCommandCode = req.refIds[0].refCommandCode; - profile.refCommandDate = req.refIds[0].commandAffectDate; - profile.refCommandName = req.refIds[0].refCommandName; + profile.refCommandCode = req.refIds[0].commandCode; + profile.refCommandDate = req.refIds[0].commandDateAffect; + profile.refCommandName = req.refIds[0].commandName; profile.refCommandNo = $"{req.refIds[0].commandNo}/{req.refIds[0].commandYear.ToThaiYear()}"; - profile.templateDoc = req.refIds[0].templateDoc; + profile.templateDoc = req.refIds[0].remark; } }); await _context.SaveChangesAsync(); @@ -2072,8 +2076,8 @@ namespace BMA.EHR.Placement.Service.Controllers isProbation = true, isLeave = false, dateRetire = (DateTime?)null, - dateAppoint = r.commandAffectDate, - dateStart = r.commandAffectDate, + dateAppoint = r.commandDateAffect, + dateStart = r.commandDateAffect, govAgeAbsent = 0, govAgePlus = 0, birthDate = p.DateOfBirth == null ? (DateTime?)null : p.DateOfBirth, @@ -2132,30 +2136,34 @@ namespace BMA.EHR.Placement.Service.Controllers }).ToList(), bodySalarys = new { - profileId = string.Empty, - date = r.commandAffectDate, + profileId = p.profileId, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.positionName == null ? string.Empty : p.positionName, - positionLine = string.Empty, - positionPathSide = string.Empty, - positionExecutive = string.Empty, - positionType = p.posTypeName == null ? string.Empty : p.posTypeName, - positionLevel = p.posLevelName == null ? string.Empty : p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, - isGovernment = true, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + positionExecutive = "", + positionType = p.posTypeName, + positionLevel = p.posLevelName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.positionName, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }, bodyPosition = new { @@ -2183,11 +2191,11 @@ namespace BMA.EHR.Placement.Service.Controllers if (req.refIds.Length > 0) { profile.commandId = req.refIds[0].commandId; - profile.refCommandCode = req.refIds[0].refCommandCode; - profile.refCommandDate = req.refIds[0].commandAffectDate; - profile.refCommandName = req.refIds[0].refCommandName; + profile.refCommandCode = req.refIds[0].commandCode; + profile.refCommandDate = req.refIds[0].commandDateAffect; + profile.refCommandName = req.refIds[0].commandName; profile.refCommandNo = $"{req.refIds[0].commandNo}/{req.refIds[0].commandYear.ToThaiYear()}"; - profile.templateDoc = req.refIds[0].templateDoc; + profile.templateDoc = req.refIds[0].remark; } }); await _context.SaveChangesAsync(); @@ -2396,30 +2404,35 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.positionName, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.posTypeName, positionLevel = p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.positionName, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -2631,30 +2644,35 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.positionName, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.posTypeName, positionLevel = p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.positionName, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -2851,30 +2869,35 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.positionName, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.posTypeName, positionLevel = p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, posmasterId = p.posmasterId, positionId = p.positionId, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.positionName, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index 7f589e2b..2b72056f 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -678,26 +678,36 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, - commandId = r.commandId, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, officerOrg = p.Organization, dateStart = p.DateStart, dateEnd = p.DateEnd, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -717,7 +727,7 @@ namespace BMA.EHR.Placement.Service.Controllers foreach (var profile in data) { profile.Status = "DONE"; - profile.commandNo = resultData.Count > 0 ? resultData[0].refCommandNo : null; + profile.commandNo = resultData.Count > 0 ? $"{resultData[0].commandNo}/{resultData[0].commandYear.ToThaiYear()}" : null; } await _context.SaveChangesAsync(); } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index 55a8c66f..a2c774c0 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -1048,8 +1048,8 @@ namespace BMA.EHR.Placement.Service.Controllers isProbation = false, isLeave = false, dateRetire = (DateTime?)null, - dateAppoint = r.commandAffectDate, - dateStart = r.commandAffectDate, + dateAppoint = r.commandDateAffect, + dateStart = r.commandDateAffect, govAgeAbsent = 0, govAgePlus = 0, birthDate = p.DateOfBirth == null ? (DateTime?)null : p.DateOfBirth, @@ -1076,29 +1076,34 @@ namespace BMA.EHR.Placement.Service.Controllers }, bodySalarys = new { - profileId = string.Empty, - date = r.commandAffectDate, + profileId = p.profileId, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.posMasterNo == null ? "" : - p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" : - p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" : - p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" : - p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "", - position = p.position == null ? string.Empty : p.position, - positionLine = string.Empty, - positionPathSide = string.Empty, - positionExecutive = string.Empty, - positionType = p.posTypeName == null ? string.Empty : p.posTypeName, - positionLevel = p.posLevelName == null ? string.Empty : p.posLevelName, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + positionExecutive = "", + positionType = p.posTypeName, + positionLevel = p.posLevelName, + commandId = r.commandId, + orgRoot = p.root, + orgChild1 = p.child1, + orgChild2 = p.child2, + orgChild3 = p.child3, + orgChild4 = p.child4, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNo, + posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : + p.node == 3 ? $"{p.child3ShortName}" : + p.node == 2 ? $"{p.child2ShortName}" : + p.node == 1 ? $"{p.child1ShortName}" : + p.node == 0 ? $"{p.rootShortName}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.position, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }, bodyPosition = new { diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index 6c65ce03..53bb2d5f 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -498,29 +498,43 @@ namespace BMA.EHR.Placement.Service.Controllers var data = await _context.PlacementRepatriations .Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString())) .ToListAsync(); + string? _null = null; var resultData = (from p in data join r in req.refIds on p.Id.ToString() equals r.refId select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, - commandId = r.commandId, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, + officerOrg = p.Organization, + dateStart = p.Date, + dateEnd = p.DateRepatriation, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index f545dce7..83fe185e 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -876,26 +876,37 @@ namespace BMA.EHR.Placement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, + commandId = r.commandId, leaveReason = "โอนออก", - dateLeave = r.commandAffectDate, + dateLeave = r.commandDateAffect, isLeave = true, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, + officerOrg = p.Organization, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs b/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs index ddfe4004..7f8e0855 100644 --- a/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs +++ b/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs @@ -10,16 +10,17 @@ namespace BMA.EHR.Placement.Service.Requests public class ReportExecuteRequestObj { public string? refId { get; set; } - public DateTime commandAffectDate { get; set; } public string? commandNo { get; set; } - public string? commandId { get; set; } public int commandYear { get; set; } - public string? templateDoc { get; set; } + public string? commandId { get; set; } + public string? remark { get; set; } public double? amount { get; set; } public double? amountSpecial { get; set; } public double? positionSalaryAmount { get; set; } public double? mouthSalaryAmount { get; set; } - public string? refCommandCode { get; set; } - public string? refCommandName { get; set; } + public string? commandCode { get; set; } + public string? commandName { get; set; } + public DateTime commandDateAffect { get; set; } + public DateTime commandDateSign { get; set; } } } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index 893ba38d..049a8629 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -701,27 +701,37 @@ namespace BMA.EHR.Retirement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, isLeave = false, leaveReason = _null, dateLeave = _null, + commandId = r.commandId, isGovernment = true, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -911,27 +921,37 @@ namespace BMA.EHR.Retirement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, amountSpecial = r.amountSpecial, - commandId = r.commandId, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, isLeave = false, leaveReason = _null, dateLeave = _null, + commandId = r.commandId, isGovernment = true, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index c84639f8..531973ef 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -554,27 +554,37 @@ namespace BMA.EHR.Retirement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, - commandId = r.commandId, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, isLeave = true, leaveReason = "ให้ออกจากราชการ", - dateLeave = r.commandAffectDate, + dateLeave = r.commandDateAffect, + commandId = r.commandId, isGovernment = false, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index 403f3869..555dd4ca 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -2232,27 +2232,37 @@ namespace BMA.EHR.Retirement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, - commandId = r.commandId, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, isLeave = true, - isGovernment = false, leaveReason = "ออกจากราชการ", - dateLeave = r.commandAffectDate, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + dateLeave = r.commandDateAffect, + commandId = r.commandId, + isGovernment = false, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -2421,26 +2431,37 @@ namespace BMA.EHR.Retirement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, - commandId = r.commandId, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, isLeave = false, leaveReason = _null, dateLeave = _null, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + isGovernment = false, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs index 198c36f8..106f2308 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -1676,27 +1676,36 @@ namespace BMA.EHR.Retirement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, - commandId = r.commandId, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - // positionLine = "", - // positionPathSide = "", - // positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, isLeave = true, - isGovernment = false, leaveReason = "ออกจากราชการ", - dateLeave = r.commandAffectDate, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + dateLeave = r.commandDateAffect, + commandId = r.commandId, + isGovernment = false, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; @@ -1865,26 +1874,37 @@ namespace BMA.EHR.Retirement.Service.Controllers select new { profileId = p.profileId, - date = r.commandAffectDate, amount = r.amount, - commandId = r.commandId, amountSpecial = r.amountSpecial, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, - posNo = p.PositionNumberOld, - position = p.PositionOld, - positionLine = "", - positionPathSide = "", positionExecutive = "", positionType = p.PositionTypeOld, positionLevel = p.PositionLevelOld, - refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}", - templateDoc = r.templateDoc, isLeave = false, leaveReason = _null, dateLeave = _null, - refCommandCode = r.refCommandCode, - refCommandName = r.refCommandName, + commandId = r.commandId, + isGovernment = false, + orgRoot = p.rootOld, + orgChild1 = p.child1Old, + orgChild2 = p.child2Old, + orgChild3 = p.child3Old, + orgChild4 = p.child4Old, + commandNo = r.commandNo, + commandYear = r.commandYear, + posNo = p.posMasterNoOld, + posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : + p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : + p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : + p.child1ShortNameOld != null ? $"{p.child1ShortNameOld}" : + p.rootShortNameOld != null ? $"{p.rootShortNameOld}" : "", + commandDateAffect = r.commandDateAffect, + commandDateSign = r.commandDateSign, + positionName = p.PositionOld, + commandCode = r.commandCode, + commandName = r.commandName, + remark = r.remark, }).ToList(); var baseAPIOrg = _configuration["API"]; diff --git a/BMA.EHR.Retirement.Service/Requests/ReportExecuteRequest.cs b/BMA.EHR.Retirement.Service/Requests/ReportExecuteRequest.cs index c90e92ca..d0b60328 100644 --- a/BMA.EHR.Retirement.Service/Requests/ReportExecuteRequest.cs +++ b/BMA.EHR.Retirement.Service/Requests/ReportExecuteRequest.cs @@ -10,16 +10,17 @@ namespace BMA.EHR.Retirement.Service.Requests public class ReportExecuteRequestObj { public string? refId { get; set; } - public DateTime commandAffectDate { get; set; } public string? commandNo { get; set; } - public string? commandId { get; set; } public int commandYear { get; set; } - public string? templateDoc { get; set; } + public string? commandId { get; set; } + public string? remark { get; set; } public double? amount { get; set; } public double? amountSpecial { get; set; } public double? positionSalaryAmount { get; set; } public double? mouthSalaryAmount { get; set; } - public string? refCommandCode { get; set; } - public string? refCommandName { get; set; } + public string? commandCode { get; set; } + public string? commandName { get; set; } + public DateTime commandDateAffect { get; set; } + public DateTime commandDateSign { get; set; } } } From 01dc27099e1182c13b3d93da223b90905b656a52 Mon Sep 17 00:00:00 2001 From: kittapath Date: Fri, 21 Feb 2025 23:48:11 +0700 Subject: [PATCH 2/6] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20=E0=B8=95?= =?UTF-8?q?=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release_Retirement.yaml | 72 +++++++++---------- .github/workflows/release_discipline.yaml | 72 +++++++++---------- .github/workflows/release_placement.yaml | 72 +++++++++---------- .../PlacementAppointmentController.cs | 10 +-- .../Controllers/PlacementController.cs | 10 +-- .../Controllers/PlacementOfficerController.cs | 2 +- .../Controllers/PlacementReceiveController.cs | 2 +- .../PlacementRepatriationController.cs | 2 +- .../PlacementTransferController.cs | 2 +- .../Controllers/RetirementOtherController.cs | 4 +- .../Controllers/RetirementOutController.cs | 2 +- .../Controllers/RetirementResignController.cs | 4 +- .../RetirementResignEmployeeController.cs | 4 +- 13 files changed, 129 insertions(+), 129 deletions(-) diff --git a/.github/workflows/release_Retirement.yaml b/.github/workflows/release_Retirement.yaml index 4d644cb3..18051f4e 100644 --- a/.github/workflows/release_Retirement.yaml +++ b/.github/workflows/release_Retirement.yaml @@ -68,40 +68,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - name: Notify Discord Success - if: success() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "✅ Deployment Success!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - "color": 3066993, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/success-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Success + # if: success() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "✅ Deployment Success!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + # "color": 3066993, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/success-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} - - name: Notify Discord Failure - if: failure() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "❌ Deployment Failed!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - "color": 15158332, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/failure-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Failure + # if: failure() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "❌ Deployment Failed!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + # "color": 15158332, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/failure-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/release_discipline.yaml b/.github/workflows/release_discipline.yaml index 80639a84..ed655586 100644 --- a/.github/workflows/release_discipline.yaml +++ b/.github/workflows/release_discipline.yaml @@ -68,40 +68,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - name: Notify Discord Success - if: success() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "✅ Deployment Success!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - "color": 3066993, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/success-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Success + # if: success() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "✅ Deployment Success!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + # "color": 3066993, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/success-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} - - name: Notify Discord Failure - if: failure() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "❌ Deployment Failed!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - "color": 15158332, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/failure-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Failure + # if: failure() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "❌ Deployment Failed!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + # "color": 15158332, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/failure-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/release_placement.yaml b/.github/workflows/release_placement.yaml index e1af3041..87088cc2 100644 --- a/.github/workflows/release_placement.yaml +++ b/.github/workflows/release_placement.yaml @@ -68,40 +68,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - name: Notify Discord Success - if: success() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "✅ Deployment Success!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - "color": 3066993, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/success-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Success + # if: success() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "✅ Deployment Success!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + # "color": 3066993, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/success-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} - - name: Notify Discord Failure - if: failure() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "❌ Deployment Failed!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - "color": 15158332, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/failure-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Failure + # if: failure() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "❌ Deployment Failed!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + # "color": 15158332, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/failure-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index 3b19dcef..e1d4d513 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -925,7 +925,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : @@ -1149,7 +1149,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : @@ -1363,7 +1363,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : @@ -1582,7 +1582,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : @@ -1818,7 +1818,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index 8394ebdf..8fe4064d 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -1825,7 +1825,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : @@ -2152,7 +2152,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : @@ -2421,7 +2421,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : @@ -2661,7 +2661,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : @@ -2886,7 +2886,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index 2b72056f..14fafef4 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -696,7 +696,7 @@ namespace BMA.EHR.Placement.Service.Controllers dateEnd = p.DateEnd, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index a2c774c0..beb6fe35 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -1092,7 +1092,7 @@ namespace BMA.EHR.Placement.Service.Controllers orgChild4 = p.child4, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNo, + posNo = p.posMasterNo?.ToString(), posNoAbb = p.node == 4 ? $"{p.child4ShortName}" : p.node == 3 ? $"{p.child3ShortName}" : p.node == 2 ? $"{p.child2ShortName}" : diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index 53bb2d5f..6e9a178f 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -523,7 +523,7 @@ namespace BMA.EHR.Placement.Service.Controllers dateEnd = p.DateRepatriation, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index 83fe185e..c1421929 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -895,7 +895,7 @@ namespace BMA.EHR.Placement.Service.Controllers officerOrg = p.Organization, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index 049a8629..fd0e8af2 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -720,7 +720,7 @@ namespace BMA.EHR.Retirement.Service.Controllers orgChild4 = p.child4Old, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : @@ -940,7 +940,7 @@ namespace BMA.EHR.Retirement.Service.Controllers orgChild4 = p.child4Old, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index 531973ef..fa573c93 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -573,7 +573,7 @@ namespace BMA.EHR.Retirement.Service.Controllers orgChild4 = p.child4Old, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index 555dd4ca..2db7d80b 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -2251,7 +2251,7 @@ namespace BMA.EHR.Retirement.Service.Controllers orgChild4 = p.child4Old, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : @@ -2450,7 +2450,7 @@ namespace BMA.EHR.Retirement.Service.Controllers orgChild4 = p.child4Old, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs index 106f2308..c1e97428 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -1694,7 +1694,7 @@ namespace BMA.EHR.Retirement.Service.Controllers orgChild4 = p.child4Old, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : @@ -1893,7 +1893,7 @@ namespace BMA.EHR.Retirement.Service.Controllers orgChild4 = p.child4Old, commandNo = r.commandNo, commandYear = r.commandYear, - posNo = p.posMasterNoOld, + posNo = p.posMasterNoOld?.ToString(), posNoAbb = p.child4ShortNameOld != null ? $"{p.child4ShortNameOld}" : p.child3ShortNameOld != null ? $"{p.child3ShortNameOld}" : p.child2ShortNameOld != null ? $"{p.child2ShortNameOld}" : From 35c6bc97a1867ea248042649513e928065d6ff74 Mon Sep 17 00:00:00 2001 From: kittapath Date: Mon, 24 Feb 2025 10:08:16 +0700 Subject: [PATCH 3/6] noti build --- .github/workflows/release_Retirement.yaml | 72 +++++++++++------------ .github/workflows/release_discipline.yaml | 72 +++++++++++------------ .github/workflows/release_placement.yaml | 72 +++++++++++------------ 3 files changed, 108 insertions(+), 108 deletions(-) diff --git a/.github/workflows/release_Retirement.yaml b/.github/workflows/release_Retirement.yaml index 18051f4e..4d644cb3 100644 --- a/.github/workflows/release_Retirement.yaml +++ b/.github/workflows/release_Retirement.yaml @@ -68,40 +68,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - # - name: Notify Discord Success - # if: success() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "✅ Deployment Success!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - # "color": 3066993, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/success-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Success + if: success() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "✅ Deployment Success!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + "color": 3066993, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/success-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} - # - name: Notify Discord Failure - # if: failure() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "❌ Deployment Failed!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - # "color": 15158332, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/failure-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Failure + if: failure() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "❌ Deployment Failed!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + "color": 15158332, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/failure-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/release_discipline.yaml b/.github/workflows/release_discipline.yaml index ed655586..80639a84 100644 --- a/.github/workflows/release_discipline.yaml +++ b/.github/workflows/release_discipline.yaml @@ -68,40 +68,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - # - name: Notify Discord Success - # if: success() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "✅ Deployment Success!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - # "color": 3066993, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/success-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Success + if: success() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "✅ Deployment Success!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + "color": 3066993, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/success-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} - # - name: Notify Discord Failure - # if: failure() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "❌ Deployment Failed!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - # "color": 15158332, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/failure-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Failure + if: failure() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "❌ Deployment Failed!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + "color": 15158332, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/failure-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/release_placement.yaml b/.github/workflows/release_placement.yaml index 87088cc2..e1af3041 100644 --- a/.github/workflows/release_placement.yaml +++ b/.github/workflows/release_placement.yaml @@ -68,40 +68,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - # - name: Notify Discord Success - # if: success() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "✅ Deployment Success!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - # "color": 3066993, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/success-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Success + if: success() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "✅ Deployment Success!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + "color": 3066993, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/success-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} - # - name: Notify Discord Failure - # if: failure() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "❌ Deployment Failed!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - # "color": 15158332, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/failure-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Failure + if: failure() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "❌ Deployment Failed!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + "color": 15158332, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/failure-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} From 19ff8f2d6535fa2a9cf9ed72ca64cb08e2005695 Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 25 Feb 2025 11:03:50 +0700 Subject: [PATCH 4/6] fix issue #1194 --- .../Controllers/RetirementResignEmployeeController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs index c1e97428..51090c8b 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -1612,7 +1612,7 @@ namespace BMA.EHR.Retirement.Service.Controllers FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", PositionName = p.PositionOld ?? "", Organization = p.OrganizationPositionOld ?? "", - PositionLevel = p.PositionLevelOld ?? "", + PositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld.ToThaiNumber(), PositionType = p.PositionTypeOld ?? "", PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(), ActiveDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiShortDate2().ToThaiNumber(), From 3882e11454ff38917d13d2cce177007df4679342 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Thu, 6 Mar 2025 10:24:56 +0700 Subject: [PATCH 5/6] fix and add filter leaveRequest --- BMA.EHR.Leave/Controllers/LeaveRequestController.cs | 8 ++++++-- .../DTOs/LeaveRequest/GetLeaveCancelRequestResultDto.cs | 2 ++ .../DTOs/LeaveRequest/GetLeaveRequestForAdminDto.cs | 3 +++ .../DTOs/LeaveRequest/GetLeaveRequestForAdminResultDto.cs | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs index ffbb104b..c919d7cd 100644 --- a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs @@ -1378,6 +1378,7 @@ namespace BMA.EHR.Leave.Service.Controllers LeaveTypeId = item.Type.Id, LeaveTypeName = item.Type.Name, FullName = $"{item.Prefix}{item.FirstName} {item.LastName}", + ProfileType = item.ProfileType ?? "-", DateSendLeave = item.CreatedAt.Date, Status = item.LeaveStatus, CitizenId = item.CitizenId ?? "", @@ -1396,7 +1397,8 @@ namespace BMA.EHR.Leave.Service.Controllers if (req.Keyword != "") result = result.Where(x => x.FullName.Contains(req.Keyword)).ToList(); - + if (!string.IsNullOrEmpty(req.ProfileType) && req.ProfileType.ToUpper() != "ALL") + result = result.Where(x => x.ProfileType.ToUpper().Contains(req.ProfileType.ToUpper())).ToList(); var pageResult = result.Skip((req.Page - 1) * req.PageSize).Take(req.PageSize).ToList(); return Success(new { data = pageResult, total = result.Count }); @@ -1487,6 +1489,7 @@ namespace BMA.EHR.Leave.Service.Controllers Id = item.Id, LeaveTypeId = item.Type.Id, LeaveTypeName = item.Type.Name, + ProfileType = item.ProfileType ?? "-", FullName = $"{item.Prefix}{item.FirstName} {item.LastName}", DateSendLeave = item.CreatedAt.Date, Status = item.LeaveCancelStatus ?? "" @@ -1496,7 +1499,8 @@ namespace BMA.EHR.Leave.Service.Controllers if (req.Keyword != "") result = result.Where(x => x.FullName.Contains(req.Keyword)).ToList(); - + if (!string.IsNullOrEmpty(req.ProfileType) && req.ProfileType.ToUpper() != "ALL") + result = result.Where(x => x.ProfileType.ToUpper().Contains(req.ProfileType.ToUpper())).ToList(); var pageResult = result.Skip((req.Page - 1) * req.PageSize).Take(req.PageSize).ToList(); return Success(new { data = pageResult, total = result.Count }); diff --git a/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveCancelRequestResultDto.cs b/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveCancelRequestResultDto.cs index 20e5510b..a8023f5e 100644 --- a/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveCancelRequestResultDto.cs +++ b/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveCancelRequestResultDto.cs @@ -13,5 +13,7 @@ public DateTime DateSendLeave { get; set; } public string Status { get; set; } + + public string ProfileType { get; set; } = string.Empty; } } diff --git a/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveRequestForAdminDto.cs b/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveRequestForAdminDto.cs index f1bb40a8..2a8e4acf 100644 --- a/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveRequestForAdminDto.cs +++ b/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveRequestForAdminDto.cs @@ -25,5 +25,8 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveRequest public DateTime StartDate { get; set; } = DateTime.MinValue; public DateTime EndDate { get; set; } = DateTime.MinValue; + + public string ProfileType { get; set; } = string.Empty; + } } diff --git a/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveRequestForAdminResultDto.cs b/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveRequestForAdminResultDto.cs index 97ce6b64..b5873f22 100644 --- a/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveRequestForAdminResultDto.cs +++ b/BMA.EHR.Leave/DTOs/LeaveRequest/GetLeaveRequestForAdminResultDto.cs @@ -31,5 +31,7 @@ public string LeaveRange { get; set; } = string.Empty; public bool? HajjDayStatus { get; set; } + + public string? ProfileType { get; set; } } } From e028dc5cf5b06ae4b06dc29f4b7fb9d8f8cb2202 Mon Sep 17 00:00:00 2001 From: kittapath Date: Fri, 7 Mar 2025 14:49:27 +0700 Subject: [PATCH 6/6] =?UTF-8?q?report=20=E0=B8=A5=E0=B8=87=E0=B9=80?= =?UTF-8?q?=E0=B8=A7=E0=B8=A5=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LeaveReportController.cs | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/BMA.EHR.Leave/Controllers/LeaveReportController.cs b/BMA.EHR.Leave/Controllers/LeaveReportController.cs index 16e0c2e8..0fa71312 100644 --- a/BMA.EHR.Leave/Controllers/LeaveReportController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveReportController.cs @@ -808,7 +808,7 @@ namespace BMA.EHR.Leave.Service.Controllers var therapyDay = leaveDays.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-011"); var therapyDayCount = therapyDay != null ? therapyDay.SumLeaveDay : 0; - var timeStamps = await _processUserTimeStampRepository.GetTimeStampHistoryByRangeForUserAsync(p.Keycloak ?? Guid.Empty,req.StartDate,req.EndDate); + var timeStamps = await _processUserTimeStampRepository.GetTimeStampHistoryByRangeForUserAsync(p.Keycloak ?? Guid.Empty, req.StartDate, req.EndDate); var defaultRound = await _dutyTimeRepository.GetDefaultAsync(); if (defaultRound == null) @@ -822,27 +822,27 @@ namespace BMA.EHR.Leave.Service.Controllers var duty = userRound ?? defaultRound; - /* var processTimeStamps = timeStamps - .Select(d => new - { - d.Id, - CheckInStatus = DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) > - DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ? - "LATE" : - "NORMAL", - CheckOutStatus = d.CheckOut == null ? "" : - DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) < - DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ? - "LATE" : - DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) < - DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ? - "ABSENT" : - "NORMAL", - });*/ + /* var processTimeStamps = timeStamps + .Select(d => new + { + d.Id, + CheckInStatus = DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) > + DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ? + "LATE" : + "NORMAL", + CheckOutStatus = d.CheckOut == null ? "" : + DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) < + DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ? + "LATE" : + DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) < + DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ? + "ABSENT" : + "NORMAL", + });*/ /*var absentCount = processTimeStamps.Count(x => x.CheckOutStatus == "ABSENT"); var lateCount = processTimeStamps.Count(x => x.CheckInStatus == "LATE");*/ - + var absentCount = timeStamps.Count(d => d.CheckOutStatus == "ABSENT"); // นับจำนวนที่มี CheckOutStatus == "ABSENT" var lateCount = timeStamps.Count(d => @@ -949,8 +949,8 @@ namespace BMA.EHR.Leave.Service.Controllers return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden); } var profile = new List(); - profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficerRetireFilter(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD", req.isRetirement??true); - + profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficerRetireFilter(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD", req.isRetirement ?? true); + // get leave day var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByTypeAndRange(req.StartDate, req.EndDate); var leaveTypes = await _leaveTypeRepository.GetAllAsync(); @@ -1154,8 +1154,8 @@ namespace BMA.EHR.Leave.Service.Controllers for (DateTime i = req.StartDate.Date; i <= req.EndDate.Date; i = i.AddDays(1)) { - if (!excludeDates.Contains(i)) - dateList.Add(i); + // if (!excludeDates.Contains(i)) + dateList.Add(i); } var employees = new List(); @@ -1227,7 +1227,7 @@ namespace BMA.EHR.Leave.Service.Controllers if (timeStamps.CheckOut != null) { if (timeStamps.CheckOutStatus == "ABSENT") - remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckOut ? $" (นอกสถานที่:{ timeStamps.CheckOutLocationName })".Trim() : "") ; + remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckOut ? $" (นอกสถานที่:{timeStamps.CheckOutLocationName})".Trim() : ""); else if (timeStamps.CheckInStatus == "ABSENT") remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : ""); else if (timeStamps.CheckInStatus == "LATE")