Compare commits

...

18 commits

Author SHA1 Message Date
harid
f0c493a026 Merge branch 'develop' into dev
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m46s
2026-06-04 11:52:51 +07:00
harid
fe5c2cd7c1 fix #2547 2026-06-04 11:52:26 +07:00
harid
c4209400ff Merge branch 'develop-Bright' into dev
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m52s
2026-06-04 11:34:34 +07:00
harid
d6a7f1a5ca fix แก้ไขวันที่ยื่นขอลาออกแล้วข้อมูลไม่เปลี่ยน #2547 2026-06-04 11:34:06 +07:00
harid
f50efc632b Merge branch 'develop' into develop-Bright 2026-06-04 10:53:49 +07:00
5f9c49f479 Merge branch 'develop' into dev
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m45s
Build & Deploy Retirement Service / build (push) Successful in 1m45s
2026-06-04 10:19:11 +07:00
48aab28e04 Merge branch 'adiDev' into develop 2026-06-04 10:15:42 +07:00
1f7951dc4c update ลาออก admin 2026-06-04 10:15:33 +07:00
harid
d3a174faa0 log placementReceive 2026-06-04 10:10:31 +07:00
Suphonchai Phoonsawat
afa5c85393 fix #2545
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m48s
2026-06-04 10:01:11 +07:00
077b60b1c3 Merge branch 'develop' into adiDev
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m55s
Build & Deploy Retirement Service / build (push) Successful in 1m46s
2026-06-04 09:38:03 +07:00
efc96dfb6d แก้ format ฟิว posMasterNo (6) 2026-06-04 09:37:29 +07:00
Suphonchai Phoonsawat
4827906d1d Merge branch 'dev' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m48s
2026-05-29 15:46:56 +07:00
Suphonchai Phoonsawat
8ae822d05b leave report #2524 2026-05-29 15:46:29 +07:00
harid
71a4748d39 Job: อัพเดทสถานะผู้สอบผ่านที่ลาออกไปแล้วแต่ยังไม่ส่งไปออกคำสั่ง ทำงานทุกวันเวลา 05:00 น. #2518
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m55s
2026-05-29 15:32:26 +07:00
harid
ad70043264 กรองสถานะขอลาออกฝั่ง user #1586
All checks were successful
Build & Deploy Retirement Service / build (push) Successful in 1m52s
2026-05-29 14:56:16 +07:00
Suphonchai Phoonsawat
513956c861 Merge branch 'dev' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m56s
2026-05-29 10:26:01 +07:00
Suphonchai Phoonsawat
a48f3fa804 fix issue #2534 2026-05-29 10:25:11 +07:00
14 changed files with 204 additions and 43 deletions

View file

@ -1952,6 +1952,23 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
return 0;
}
public async Task<double> GetSumApproveLeaveTotalByTypeAndRangeForUserBefore(Guid keycloakUserId, Guid leaveTypeId, DateTime startDate, DateTime endDate)
{
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
.Include(x => x.Type)
.Where(x => x.KeycloakUserId == keycloakUserId)
.Where(x => x.Type.Id == leaveTypeId)
.Where(x => ((x.DateSendLeave ?? x.CreatedAt) >= startDate && (x.DateSendLeave ?? x.CreatedAt) < endDate))
//.Where(x => x.LeaveStartDate.Date >= startDate.Date && x.LeaveStartDate.Date <= endDate.Date)
.Where(x => x.LeaveStatus == "APPROVE" || x.LeaveStatus == "DELETING")
.ToListAsync();
if (data.Count > 0)
return data.Sum(x => x.LeaveTotal);
else
return 0;
}
public async Task<double> GetSumApproveLeaveTotalByTypeAndRangeForUserByProfile(Guid profileId, Guid leaveTypeId, DateTime startDate, DateTime endDate)
{
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()

View file

@ -119,10 +119,11 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
/// </summary>
public async Task<List<CheckInJobStatus>> GetStalePendingOrProcessingJobsAsync(int timeoutMinutes = 30)
{
//var cutoffDate = DateTime.Now.AddMinutes(-timeoutMinutes);
var cutoffDate = DateTime.Now.AddMinutes(-timeoutMinutes);
var staleJobs = await _dbContext.Set<CheckInJobStatus>()
.Where(x => (x.Status == "PENDING" || x.Status == "PROCESSING")
&& x.CreatedDate < cutoffDate)
&& x.CreatedDate <= cutoffDate)
.OrderBy(x => x.CreatedDate)
.ToListAsync();
@ -135,6 +136,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
public async Task<List<CheckInJobStatus>> GetStalePendingOrProcessingJobsByUserAsync(Guid userId, int timeoutMinutes = 30)
{
var cutoffDate = DateTime.Now.AddMinutes(-timeoutMinutes);
//var cutoffDate = new DateTime(2026, 5, 28, 23, 59, 59);
var staleJobs = await _dbContext.Set<CheckInJobStatus>()
.Where(x => x.KeycloakUserId == userId
&& (x.Status == "PENDING" || x.Status == "PROCESSING")

View file

@ -2,6 +2,9 @@
using BMA.EHR.Domain.Models.Placement;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System.Net.Http.Headers;
using Newtonsoft.Json;
namespace BMA.EHR.Application.Repositories
{
@ -11,15 +14,17 @@ namespace BMA.EHR.Application.Repositories
private readonly IApplicationDBContext _dbContext;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IConfiguration _configuration;
#endregion
#region " Constructor and Destructor "
public PlacementRepository(IApplicationDBContext dbContext, IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
public PlacementRepository(IApplicationDBContext dbContext, IHttpContextAccessor httpContextAccessor, IConfiguration configuration) : base(dbContext, httpContextAccessor)
{
_dbContext = dbContext;
_httpContextAccessor = httpContextAccessor;
_configuration = configuration;
}
#endregion
@ -76,6 +81,94 @@ namespace BMA.EHR.Application.Repositories
return data;
}
/// <summary>
/// Job อัพเดทสถานะผู้สอบผ่านที่ลาออกไปแล้วแต่ยังไม่ส่งไปออกคำสั่ง
/// ทำงานทุกวันเวลา 05:00 น.
/// </summary>
public async Task UpdateStatusPlacementProfiles()
{
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === STARTED ===");
var officerProfileIds = await _dbContext.Set<PlacementProfile>()
.Where(p => !string.IsNullOrEmpty(p.profileId)
&& p.IsOfficer == true
&& p.PlacementStatus != "DONE"
// && p.Id == Guid.Parse("08deb7de-3030-4d1b-8519-8148584949fc")
)
.Select(p => p.profileId)
.ToListAsync();
if (!officerProfileIds.Any())
{
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] No profiles to process");
return;
}
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] พบข้าราชการที่สอบผ่านทั้งหมด {officerProfileIds.Count} คน ที่ยังไม่ส่งไปออกคำสั่ง");
var apiUrl = $"{_configuration["API"]}/org/dotnet/check-isLeave";
List<string> leaveProfileIds = new();
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var payload = new
{
profileIds = officerProfileIds.Distinct().ToList()
};
var jsonPayload = JsonConvert.SerializeObject(payload);
var content = new StringContent(jsonPayload, System.Text.Encoding.UTF8, "application/json");
try
{
var response = await client.PostAsync(apiUrl, content);
var result = await response.Content.ReadAsStringAsync();
var responseObj = JsonConvert.DeserializeAnonymousType(result, new
{
status = 0,
message = "",
result = new List<string>()
});
leaveProfileIds = responseObj.result ?? new();
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] พบ {leaveProfileIds.Count} รายการที่ลาออก");
}
catch (Exception ex)
{
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] Call API failed: {ex.Message}");
return;
}
}
if (leaveProfileIds.Any())
{
var batchSize = 500;
var totalUpdated = 0;
var totalBatches = (int)Math.Ceiling((double)leaveProfileIds.Count / batchSize);
for (int i = 0; i < totalBatches; i++)
{
var batch = leaveProfileIds.Skip(i * batchSize).Take(batchSize).ToList();
var profilesToUpdate = await _dbContext.Set<PlacementProfile>()
.Where(p => !string.IsNullOrEmpty(p.profileId) && batch.Contains(p.profileId))
.ToListAsync();
foreach (var profile in profilesToUpdate)
{
profile.IsOfficer = false;
}
await _dbContext.SaveChangesAsync();
totalUpdated += profilesToUpdate.Count;
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] Batch {i + 1}/{totalBatches} → อัปเดต {profilesToUpdate.Count} รายการ");
}
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] อัปเดตรวมทั้งหมด {totalUpdated} รายการ → IsOfficer = false");
}
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === COMPLETED ===");
}
#endregion
}
}

View file

@ -164,7 +164,7 @@ namespace BMA.EHR.Leave.Service.Controllers
if (toDay >= new DateTime(toDay.Year, 10, 1) && toDay <= new DateTime(toDay.Year, 12, 31))
thisYear = thisYear + 1;
var leaveData = await _leaveBeginningRepository.GetByYearAndTypeIdForUser2Async(thisYear, data.Type.Id, data.KeycloakUserId);
var sumLeave = await _leaveRequestRepository.GetSumApproveLeaveTotalByTypeAndRangeForUser2(data.KeycloakUserId, data.Type.Id, startFiscalYear, endFiscalYear);
var sumLeave = await _leaveRequestRepository.GetSumApproveLeaveTotalByTypeAndRangeForUserBefore(data.KeycloakUserId, data.Type.Id, startFiscalYear, endFiscalYear);
if (leaveData != null)
{
sumLeave += leaveData.BeginningLeaveDays;
@ -346,7 +346,7 @@ namespace BMA.EHR.Leave.Service.Controllers
//var sumLeave = await _leaveRequestRepository.GetSumApproveLeaveTotalByTypeAndRangeForUser(data.KeycloakUserId, data.Type.Id, startFiscalYear, endFiscalYear);
var sumLeave = await _leaveRequestRepository.GetSumApproveLeaveTotalByTypeAndRangeForUser2(data.KeycloakUserId, data.Type.Id, startFiscalYear, endFiscalYear);
var sumLeave = await _leaveRequestRepository.GetSumApproveLeaveTotalByTypeAndRangeForUserBefore(data.KeycloakUserId, data.Type.Id, startFiscalYear, endFiscalYear);
if (leaveData != null)
{
sumLeave += leaveData.BeginningLeaveDays;
@ -2444,6 +2444,15 @@ namespace BMA.EHR.Leave.Service.Controllers
var workTotal = 0;
var seminarTotal = 0;
var wfaTotal = 0; //ปฏิบัติงานนอกสถานที่
var outOfficeTotal = 0; //ขออนุญาติิิออกนอกสถานที่
var oneStopSrvrTotal = 0; //จุดบริการด่วนมหานคร
var otherTotal = 0; //อื่นๆ
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
if (defaultRound == null)
{
@ -2627,10 +2636,18 @@ namespace BMA.EHR.Leave.Service.Controllers
workTotal += 1;
if (!timeStamps.IsLocationCheckIn)
{
if (timeStamps.CheckInLocationName == "ปฏิบัติงานที่บ้าน")
if (timeStamps.CheckInLocationName!.Contains("ปฏิบัติงานที่บ้าน"))
wfhTotal += 1;
else if (timeStamps.CheckInLocationName == "ไปประชุม / อบรม / สัมมนา")
seminarTotal += 1;
else if (timeStamps.CheckInLocationName.Contains("ปฏิบัติงานนอกสถานที่"))
wfaTotal += 1;
else if (timeStamps.CheckInLocationName.Contains("ขออนุญาตออกนอกสถานที่"))
outOfficeTotal += 1;
else if (timeStamps.CheckInLocationName.Contains("ปฏิบัติงานในจุดบริการด่วนมหานคร"))
oneStopSrvrTotal += 1;
else if (timeStamps.CheckInLocationName.Contains("อื่นๆ"))
otherTotal += 1;
}
}
@ -2781,19 +2798,36 @@ namespace BMA.EHR.Leave.Service.Controllers
worksheet.Cells[lastRow + 2, 8].Value = "อบรม ประชุม สัมมนาฯ";
worksheet.Cells[lastRow + 2, 9].Value = seminarTotal;
worksheet.Cells[lastRow + 2, 10].Value = "คน";
worksheet.Cells[lastRow + 3, 8].Value = "ปฎิบัติงานนอกสถานที่";
worksheet.Cells[lastRow + 3, 9].Value = wfaTotal;
worksheet.Cells[lastRow + 3, 10].Value = "คน";
worksheet.Cells[lastRow + 4, 8].Value = "ขออนุญาตออกนอกสถานที่";
worksheet.Cells[lastRow + 4, 9].Value = outOfficeTotal;
worksheet.Cells[lastRow + 4, 10].Value = "คน";
worksheet.Cells[lastRow + 5, 8].Value = "ปฎิบัติงานในจุดบริการด่วนมหานคร";
worksheet.Cells[lastRow + 5, 9].Value = oneStopSrvrTotal;
worksheet.Cells[lastRow + 5, 10].Value = "คน";
worksheet.Cells[lastRow + 6, 8].Value = "อื่นๆ";
worksheet.Cells[lastRow + 6, 9].Value = otherTotal;
worksheet.Cells[lastRow + 6, 10].Value = "คน";
worksheet.Cells[lastRow + 3, 2].Value = "ลาป่วย/ลากิจ";
worksheet.Cells[lastRow + 3, 5].Value = sickTotal;
worksheet.Cells[lastRow + 3, 6].Value = "คน";
worksheet.Cells[lastRow + 4, 2].Value = "มาสาย";
worksheet.Cells[lastRow + 4, 5].Value = lateTotal;
worksheet.Cells[lastRow + 4, 6].Value = "คน";
worksheet.Cells[lastRow + 6, 2].Value = "เรียน";
worksheet.Cells[lastRow + 7, 2].Value = "เพื่อโปรดทราบ";
worksheet.Cells[lastRow + 7, 9].Value = "ทราบ";
worksheet.Cells[lastRow + 7, 9].Style.Font.Bold = true;
worksheet.Cells[lastRow + 7, 9].Style.Font.Size = 22;
worksheet.Cells[lastRow + 8, 2].Value = "................................";
worksheet.Cells[lastRow + 8, 9].Value = "................................";
worksheet.Cells[lastRow + 8, 2].Value = "เรียน";
worksheet.Cells[lastRow + 9, 2].Value = "เพื่อโปรดทราบ";
worksheet.Cells[lastRow + 9, 9].Value = "ทราบ";
worksheet.Cells[lastRow + 9, 9].Style.Font.Bold = true;
worksheet.Cells[lastRow + 9, 9].Style.Font.Size = 22;
worksheet.Cells[lastRow + 10, 2].Value = "................................";
worksheet.Cells[lastRow + 10, 9].Value = "................................";
worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
var fileBytes = package.GetAsByteArray();
return File(fileBytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "TimeStampRecords.xlsx");

View file

@ -3125,6 +3125,7 @@ namespace BMA.EHR.Leave.Service.Controllers
leaveBeginningDict.TryGetValue(leaveType.Id, out var leaveData);
var approve = leaveData?.LeaveDaysUsed ?? 0;
var approveCount = leaveData?.LeaveCount ?? 0;
// fix issue : SIT ระบบบันทึกการลา>> สิทธิ์การลา(โอนสิทธิ์การลา) #974
var extendLeave = 0.0;
@ -3147,6 +3148,7 @@ namespace BMA.EHR.Leave.Service.Controllers
LeaveCountApprove = approve,
LeaveCountReject = reject,
LeaveCountDelete = delete,
LeaveCountApproveCount = approveCount,
};
result.Add(data);
}

View file

@ -23,15 +23,15 @@
"ExamConnection": "Server=192.168.1.63;User ID=root;Password=12345678;Port=3306;Database=hrms_exam;Allow User Variables=True;Convert Zero Datetime=True;Pooling=True;",
"LeaveConnection": "Server=192.168.1.63;User ID=root;Password=12345678;Port=3306;Database=hrms_leave;Allow User Variables=True;Convert Zero Datetime=True;Pooling=True;"
// "DefaultConnection": "server=127.0.0.1;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=3306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;Connection Timeout=180;",
// "ExamConnection": "server=127.0.0.1;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=3306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;Connection Timeout=180;",
// "LeaveConnection": "server=127.0.0.1;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=3306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;Connection Timeout=180;"
// "DefaultConnection": "server=127.0.0.1;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=13306;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;Connection Timeout=180;",
// "ExamConnection": "server=127.0.0.1;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=13306;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;Connection Timeout=180;",
// "LeaveConnection": "server=127.0.0.1;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=13306;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;Connection Timeout=180;"
},
"Jwt": {
"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
"Issuer": "https://hrmsbkk-id.case-collection.com/realms/hrms"
// "Key": "xY2VR-EFvvNPsMs39u8ooVBWQL6mPwrNJOh3koJFTgU",
// "Issuer": "https://hrms-id.bangkok.go.th/realms/hrms"
// "Key": "xY2VR-EFvvNPsMs39u8ooVBWQL6mPwrNJOh3koJFTgU",
// "Issuer": "https://hrms-id.bangkok.go.th/realms/hrms"
},
"EPPlus": {
"ExcelPackage": {
@ -43,6 +43,10 @@
"AccessKey": "iwvzjyjgz0BKtLPmMpPu",
"SecretKey": "Yv56vwctYdIspDknRJ46xztcBDzteGF3elZiDcAr",
"BucketName": "hrms-fpt"
// "Endpoint": "https://hrms-s3.bangkok.go.th/",
// "AccessKey": "frappet",
// "SecretKey": "FPTadmin2357",
// "BucketName": "bma-ehr-fpt"
},
"Protocol": "HTTPS",
"Node": {
@ -54,11 +58,11 @@
"Password": "12345678",
"Queue": "hrms-checkin-queue-dev",
"URL": "http://192.168.1.63:9122/api/queues/%2F/"
// "Host": "172.27.17.68",
// "User": "admin",
// "Password": "admin123456",
// "Queue": "hrms-checkin-queue",
// "URL": "http://172.27.17.68:9122/api/queues/%2F/"
// "Host": "172.27.17.68",
// "User": "admin",
// "Password": "admin123456",
// "Queue": "hrms-checkin-queue",
// "URL": "http://172.27.17.68:9122/api/queues/%2F/"
},
"Mail": {
"Server": "mail.bangkok.go.th",
@ -72,10 +76,10 @@
"API": "https://hrmsbkk.case-collection.com/api/v1",
"APIV2": "https://hrmsbkk.case-collection.com/api/v2",
"VITE_URL_MGT": "https://hrmsbkk-mgt.case-collection.com",
// "Domain": "https://hrms-exam.bangkok.go.th",
// "APIPROBATION": "https://hrms.bangkok.go.th/api/v1/probation",
// "API": "https://hrms.bangkok.go.th/api/v1",
// "APIV2": "https://hrms.bangkok.go.th/api/v2",
// "VITE_URL_MGT": "https://hrms-mgt.bangkok.go.th",
// "Domain": "https://hrms.bangkok.go.th",
// "APIPROBATION": "https://hrms.bangkok.go.th/api/v1/probation",
// "API": "https://hrms.bangkok.go.th/api/v1",
// "APIV2": "https://hrms.bangkok.go.th/api/v2",
// "VITE_URL_MGT": "https://hrms-mgt.bangkok.go.th",
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
}

View file

@ -542,7 +542,7 @@ namespace BMA.EHR.Placement.Service.Controllers
placementAppointment.positionOld = org.result.position;
placementAppointment.PositionLevelOld = org.result.posLevelName;
placementAppointment.PositionTypeOld = org.result.posTypeName;
placementAppointment.PositionNumberOld = org.result.nodeShortName + " " + org.result.posMasterNo;
placementAppointment.PositionNumberOld = org.result.posNo;
placementAppointment.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
(org.result.child2 == null ? "" : org.result.child2 + "\n") +

View file

@ -514,9 +514,8 @@ namespace BMA.EHR.Placement.Service.Controllers
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
Console.Write($"[PlacementReceiveController] Check-Citizen API-Key : {_configuration["API_KEY"]}");
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlCheckCitizen, new
{
@ -541,6 +540,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
Console.Write("[PlacementReceiveController] Check-Position");
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req);
@ -831,7 +831,7 @@ namespace BMA.EHR.Placement.Service.Controllers
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlCheckCitizen, new

View file

@ -21,6 +21,7 @@ using System.Text;
using System.Transactions;
using BMA.EHR.Placement.Service.Filters;
using BMA.EHR.Application.Repositories.Reports;
using BMA.EHR.Application.Repositories;
var builder = WebApplication.CreateBuilder(args);
{
@ -164,6 +165,8 @@ var app = builder.Build();
if (manager != null)
{
manager.AddOrUpdate("แจ้งเตือนระบบทดลองงาน", Job.FromExpression<ProbationReportRepository>(x => x.NotifyProbation()), Cron.Daily(Int32.Parse(builder.Configuration["KeycloakCron:Hour"]), Int32.Parse(builder.Configuration["KeycloakCron:Minute"])), TimeZoneInfo.Local);
// Job: อัพเดทสถานะผู้สอบผ่านที่ลาออกไปแล้วแต่ยังไม่ส่งไปออกคำสั่ง ทำงานทุกวันเวลา 05:00 น.
manager.AddOrUpdate("ประมวลผลข้าราชการฯ กทม.", Job.FromExpression<PlacementRepository>(x => x.UpdateStatusPlacementProfiles()), Cron.Daily(5), TimeZoneInfo.Local);
}
// apply migrations

View file

@ -448,7 +448,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
retirementOther.positionAreaOld = org.result.positionArea;
retirementOther.PositionLevelOld = org.result.posLevelName;
retirementOther.PositionTypeOld = org.result.posTypeName;
retirementOther.PositionNumberOld = org.result.nodeShortName + " " + org.result.posMasterNo;
retirementOther.PositionNumberOld = org.result.posNo;
retirementOther.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
(org.result.child2 == null ? "" : org.result.child2 + "\n") +

View file

@ -151,7 +151,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
var retirementResigns = await _context.RetirementResigns.AsQueryable()
.Where(x => x.profileId == org.result.profileId)
.Where(x => x.Status != "DELETE" && x.profileId == org.result.profileId)
.OrderByDescending(x => x.CreatedAt)
.Select(p => new
{
@ -1290,7 +1290,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
retirementResign.positionAreaOld = org.result.positionArea;
retirementResign.PositionLevelOld = org.result.posLevelName;
retirementResign.PositionTypeOld = org.result.posTypeName;
retirementResign.PositionNumberOld = org.result.nodeShortName + " " + org.result.posMasterNo;
retirementResign.PositionNumberOld = org.result.posNo;
retirementResign.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
@ -1439,7 +1439,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
retirementResign.positionAreaOld = org.result.positionArea;
retirementResign.PositionLevelOld = org.result.posLevelName;
retirementResign.PositionTypeOld = org.result.posTypeName;
retirementResign.PositionNumberOld = org.result.nodeShortName + " " + org.result.posMasterNo;
retirementResign.PositionNumberOld = org.result.posNo;
retirementResign.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
@ -1513,7 +1513,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
return Error(GlobalMessages.RetirementResignNotFound, 404);
updated.Location = req.Location;
updated.ActiveDate = req.ActiveDate;
if (req.SendDate != null)
{
updated.SendDate = req.SendDate;
}
// updated.Reason = req.Reason;
updated.Remark = req.Remark;
updated.ReasonResign = req.Reason;

View file

@ -89,7 +89,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
var retirementResignEmployees = await _context.RetirementResignEmployees.AsQueryable()
.Where(x => x.profileId == org.result.profileId)
.Where(x => x.Status != "DELETE" && x.profileId == org.result.profileId)
.OrderByDescending(x => x.CreatedAt)
.Select(p => new
{
@ -1227,7 +1227,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
retirementResignEmployee.PositionOld = org.result.position;
retirementResignEmployee.PositionLevelOld = org.result.posLevelName;
retirementResignEmployee.PositionTypeOld = org.result.posTypeName;
retirementResignEmployee.PositionNumberOld = org.result.nodeShortName + " " + org.result.posMasterNo;
retirementResignEmployee.PositionNumberOld = org.result.posNo;
retirementResignEmployee.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
@ -1381,7 +1381,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
retirementResignEmployee.PositionOld = org.result.position;
retirementResignEmployee.PositionLevelOld = org.result.posLevelName;
retirementResignEmployee.PositionTypeOld = org.result.posTypeName;
retirementResignEmployee.PositionNumberOld = org.result.nodeShortName + " " + org.result.posMasterNo;
retirementResignEmployee.PositionNumberOld = org.result.posNo;
retirementResignEmployee.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
@ -1450,7 +1450,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
return Error(GlobalMessages.RetirementResignEmployeeNotFound, 404);
updated.Location = req.Location;
updated.ActiveDate = req.ActiveDate;
if (req.SendDate != null)
{
updated.SendDate = req.SendDate;
}
// updated.Reason = req.Reason;
updated.Remark = req.Remark;
updated.ReasonResign = req.Reason;

View file

@ -6,7 +6,7 @@ namespace BMA.EHR.Retirement.Service.Requests
public class RetirementResignEmployeeRequest
{
public string? Location { get; set; }
// public DateTime? SendDate { get; set; }
public DateTime? SendDate { get; set; }
public DateTime? ActiveDate { get; set; }
public string? Reason { get; set; }
public string? Remark { get; set; }

View file

@ -6,7 +6,7 @@ namespace BMA.EHR.Retirement.Service.Requests
public class RetirementResignRequest
{
public string? Location { get; set; }
// public DateTime? SendDate { get; set; }
public DateTime? SendDate { get; set; }
public DateTime? ActiveDate { get; set; }
public string? Reason { get; set; }
public string? Remark { get; set; }