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; } } }