Compare commits
15 commits
leave-dev1
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c44bdf237 | ||
| 6f1ca58f04 | |||
| a956f0b0dd | |||
|
|
f0c493a026 | ||
|
|
fe5c2cd7c1 | ||
|
|
c4209400ff | ||
|
|
d6a7f1a5ca | ||
|
|
f50efc632b | ||
| 5f9c49f479 | |||
| 48aab28e04 | |||
| 1f7951dc4c | |||
|
|
d3a174faa0 | ||
|
|
afa5c85393 | ||
| 077b60b1c3 | |||
| efc96dfb6d |
11 changed files with 128 additions and 40 deletions
|
|
@ -1952,6 +1952,23 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
return 0;
|
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)
|
public async Task<double> GetSumApproveLeaveTotalByTypeAndRangeForUserByProfile(Guid profileId, Guid leaveTypeId, DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,17 @@ using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace BMA.EHR.Application.Repositories
|
namespace BMA.EHR.Application.Repositories
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Response model จาก Org API (check-isLeave)
|
||||||
|
/// </summary>
|
||||||
|
public class OrgProfileResult
|
||||||
|
{
|
||||||
|
public string citizenId { get; set; } = "";
|
||||||
|
public string? profileId { get; set; }
|
||||||
|
public bool isLeave { get; set; }
|
||||||
|
public bool isActive { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class PlacementRepository : GenericRepository<Guid, Placement>
|
public class PlacementRepository : GenericRepository<Guid, Placement>
|
||||||
{
|
{
|
||||||
#region " Fields "
|
#region " Fields "
|
||||||
|
|
@ -83,39 +94,43 @@ namespace BMA.EHR.Application.Repositories
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Job อัพเดทสถานะผู้สอบผ่านที่ลาออกไปแล้วแต่ยังไม่ส่งไปออกคำสั่ง
|
/// Job อัพเดทสถานะผู้สอบผ่านที่ลาออกไปแล้วแต่ยังไม่ส่งไปออกคำสั่ง
|
||||||
|
/// และอัพเดทบุคคลภายนอกที่เข้ามาอยู่ในระบบแล้ว
|
||||||
/// ทำงานทุกวันเวลา 05:00 น.
|
/// ทำงานทุกวันเวลา 05:00 น.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task UpdateStatusPlacementProfiles()
|
public async Task UpdateStatusPlacementProfiles()
|
||||||
{
|
{
|
||||||
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === STARTED ===");
|
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === STARTED ===");
|
||||||
|
|
||||||
var officerProfileIds = await _dbContext.Set<PlacementProfile>()
|
// 1. Query ทั้ง 2 กรณี: ทุกคนที่ยังไม่ DONE
|
||||||
.Where(p => !string.IsNullOrEmpty(p.profileId)
|
var allCitizenIds = await _dbContext.Set<PlacementProfile>()
|
||||||
&& p.IsOfficer == true
|
.Where(p => !string.IsNullOrEmpty(p.CitizenId)
|
||||||
&& p.PlacementStatus != "DONE"
|
&& p.PlacementStatus != "DONE"
|
||||||
// && p.Id == Guid.Parse("08deb7de-3030-4d1b-8519-8148584949fc")
|
// && p.CitizenId == "2536721883131"
|
||||||
)
|
)
|
||||||
.Select(p => p.profileId)
|
.Select(p => new { p.CitizenId, p.IsOfficer })
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
if (!officerProfileIds.Any())
|
if (!allCitizenIds.Any())
|
||||||
{
|
{
|
||||||
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] No profiles to process");
|
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] No profiles to process");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] พบข้าราชการที่สอบผ่านทั้งหมด {officerProfileIds.Count} คน ที่ยังไม่ส่งไปออกคำสั่ง");
|
var officerCount = allCitizenIds.Count(x => x.IsOfficer == true);
|
||||||
|
var notOfficerCount = allCitizenIds.Count(x => x.IsOfficer == false);
|
||||||
|
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] พบข้าราชการ {officerCount} คน, บุคคลภายนอก {notOfficerCount} คน");
|
||||||
|
|
||||||
|
// 2. ส่ง citizenIds ทั้งหมดไป Org API ครั้งเดียว
|
||||||
|
var citizenIds = allCitizenIds.Select(x => x.CitizenId).Distinct().ToList();
|
||||||
var apiUrl = $"{_configuration["API"]}/org/dotnet/check-isLeave";
|
var apiUrl = $"{_configuration["API"]}/org/dotnet/check-isLeave";
|
||||||
List<string> leaveProfileIds = new();
|
|
||||||
|
List<OrgProfileResult> orgResults = new();
|
||||||
|
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
||||||
var payload = new
|
|
||||||
{
|
var payload = new { citizenIds };
|
||||||
profileIds = officerProfileIds.Distinct().ToList()
|
|
||||||
};
|
|
||||||
var jsonPayload = JsonConvert.SerializeObject(payload);
|
var jsonPayload = JsonConvert.SerializeObject(payload);
|
||||||
var content = new StringContent(jsonPayload, System.Text.Encoding.UTF8, "application/json");
|
var content = new StringContent(jsonPayload, System.Text.Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
|
|
@ -123,15 +138,16 @@ namespace BMA.EHR.Application.Repositories
|
||||||
{
|
{
|
||||||
var response = await client.PostAsync(apiUrl, content);
|
var response = await client.PostAsync(apiUrl, content);
|
||||||
var result = await response.Content.ReadAsStringAsync();
|
var result = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
var responseObj = JsonConvert.DeserializeAnonymousType(result, new
|
var responseObj = JsonConvert.DeserializeAnonymousType(result, new
|
||||||
{
|
{
|
||||||
status = 0,
|
status = 0,
|
||||||
message = "",
|
message = "",
|
||||||
result = new List<string>()
|
result = new List<OrgProfileResult>()
|
||||||
});
|
});
|
||||||
|
|
||||||
leaveProfileIds = responseObj.result ?? new();
|
orgResults = responseObj?.result ?? new();
|
||||||
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] พบ {leaveProfileIds.Count} รายการที่ลาออก");
|
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] Org API ตอบกลับ {orgResults.Count} รายการ");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -140,18 +156,35 @@ namespace BMA.EHR.Application.Repositories
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (leaveProfileIds.Any())
|
if (!orgResults.Any())
|
||||||
{
|
{
|
||||||
var batchSize = 500;
|
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] ไม่มีรายการต้องอัปเดต");
|
||||||
var totalUpdated = 0;
|
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === COMPLETED ===");
|
||||||
var totalBatches = (int)Math.Ceiling((double)leaveProfileIds.Count / batchSize);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. แยกข้อมูลตามเงื่อนไข
|
||||||
|
var leaveCitizenIds = orgResults.Where(x => x.isLeave).Select(x => x.citizenId).ToList();
|
||||||
|
var inSystemProfiles = orgResults.Where(x => x.isActive && !x.isLeave && !string.IsNullOrEmpty(x.profileId)).ToList();
|
||||||
|
|
||||||
|
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] ลาออก {leaveCitizenIds.Count} รายการ, อยู่ที่ทะเบียนประวัติ {inSystemProfiles.Count} รายการ");
|
||||||
|
|
||||||
|
// 4. Split Batch Update (500 รายการ/batch)
|
||||||
|
var batchSize = 500;
|
||||||
|
var totalUpdated = 0;
|
||||||
|
|
||||||
|
// 4.1 Update คนลาออก → IsOfficer = false
|
||||||
|
if (leaveCitizenIds.Any())
|
||||||
|
{
|
||||||
|
var totalBatches = (int)Math.Ceiling((double)leaveCitizenIds.Count / batchSize);
|
||||||
for (int i = 0; i < totalBatches; i++)
|
for (int i = 0; i < totalBatches; i++)
|
||||||
{
|
{
|
||||||
var batch = leaveProfileIds.Skip(i * batchSize).Take(batchSize).ToList();
|
var batch = leaveCitizenIds.Skip(i * batchSize).Take(batchSize).ToList();
|
||||||
|
|
||||||
var profilesToUpdate = await _dbContext.Set<PlacementProfile>()
|
var profilesToUpdate = await _dbContext.Set<PlacementProfile>()
|
||||||
.Where(p => !string.IsNullOrEmpty(p.profileId) && batch.Contains(p.profileId))
|
.Where(p => !string.IsNullOrEmpty(p.CitizenId)
|
||||||
|
&& batch.Contains(p.CitizenId)
|
||||||
|
&& p.IsOfficer == true)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
foreach (var profile in profilesToUpdate)
|
foreach (var profile in profilesToUpdate)
|
||||||
|
|
@ -160,12 +193,43 @@ namespace BMA.EHR.Application.Repositories
|
||||||
}
|
}
|
||||||
|
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
|
|
||||||
totalUpdated += profilesToUpdate.Count;
|
totalUpdated += profilesToUpdate.Count;
|
||||||
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] Batch {i + 1}/{totalBatches} → อัปเดต {profilesToUpdate.Count} รายการ");
|
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] [ลาออก] Batch {i + 1}/{totalBatches} → อัปเดต {profilesToUpdate.Count} รายการ");
|
||||||
}
|
}
|
||||||
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] อัปเดตรวมทั้งหมด {totalUpdated} รายการ → IsOfficer = false");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 4.2 Update คนที่อยู่ในทะเบียนประวัติ → profileId + IsOfficer = true
|
||||||
|
if (inSystemProfiles.Any())
|
||||||
|
{
|
||||||
|
var totalBatches = (int)Math.Ceiling((double)inSystemProfiles.Count / batchSize);
|
||||||
|
for (int i = 0; i < totalBatches; i++)
|
||||||
|
{
|
||||||
|
var batch = inSystemProfiles.Skip(i * batchSize).Take(batchSize).ToList();
|
||||||
|
var batchCitizenIds = batch.Select(x => x.citizenId).ToList();
|
||||||
|
|
||||||
|
var profilesToUpdate = await _dbContext.Set<PlacementProfile>()
|
||||||
|
.Where(p => !string.IsNullOrEmpty(p.CitizenId)
|
||||||
|
&& batchCitizenIds.Contains(p.CitizenId)
|
||||||
|
&& p.IsOfficer == false)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
foreach (var profile in profilesToUpdate)
|
||||||
|
{
|
||||||
|
var orgProfile = batch.FirstOrDefault(x => x.citizenId == profile.CitizenId);
|
||||||
|
if (orgProfile != null)
|
||||||
|
{
|
||||||
|
profile.profileId = orgProfile.profileId;
|
||||||
|
profile.IsOfficer = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await _dbContext.SaveChangesAsync();
|
||||||
|
totalUpdated += profilesToUpdate.Count;
|
||||||
|
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] [เข้าระบบ] Batch {i + 1}/{totalBatches} → อัปเดต {profilesToUpdate.Count} รายการ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"[Job:UpdateStatusPlacementProfiles] อัปเดตรวมทั้งหมด {totalUpdated} รายการ");
|
||||||
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === COMPLETED ===");
|
Console.WriteLine("[Job:UpdateStatusPlacementProfiles] === COMPLETED ===");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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))
|
if (toDay >= new DateTime(toDay.Year, 10, 1) && toDay <= new DateTime(toDay.Year, 12, 31))
|
||||||
thisYear = thisYear + 1;
|
thisYear = thisYear + 1;
|
||||||
var leaveData = await _leaveBeginningRepository.GetByYearAndTypeIdForUser2Async(thisYear, data.Type.Id, data.KeycloakUserId);
|
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)
|
if (leaveData != null)
|
||||||
{
|
{
|
||||||
sumLeave += leaveData.BeginningLeaveDays;
|
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.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)
|
if (leaveData != null)
|
||||||
{
|
{
|
||||||
sumLeave += leaveData.BeginningLeaveDays;
|
sumLeave += leaveData.BeginningLeaveDays;
|
||||||
|
|
|
||||||
|
|
@ -542,7 +542,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
placementAppointment.positionOld = org.result.position;
|
placementAppointment.positionOld = org.result.position;
|
||||||
placementAppointment.PositionLevelOld = org.result.posLevelName;
|
placementAppointment.PositionLevelOld = org.result.posLevelName;
|
||||||
placementAppointment.PositionTypeOld = org.result.posTypeName;
|
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") +
|
placementAppointment.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
|
||||||
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
||||||
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
|
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
p.child4OldId,
|
p.child4OldId,
|
||||||
p.child4ShortNameOld,
|
p.child4ShortNameOld,
|
||||||
p.PositionOld,
|
p.PositionOld,
|
||||||
|
p.PositionNumberOld,
|
||||||
p.PositionExecutiveOld,
|
p.PositionExecutiveOld,
|
||||||
p.positionExecutiveFieldOld,
|
p.positionExecutiveFieldOld,
|
||||||
p.positionAreaOld,
|
p.positionAreaOld,
|
||||||
|
|
|
||||||
|
|
@ -514,9 +514,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
Console.Write($"[PlacementReceiveController] Check-Citizen API-Key : {_configuration["API_KEY"]}");
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
||||||
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlCheckCitizen, new
|
var _res = await client.PostAsJsonAsync(apiUrlCheckCitizen, new
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -541,6 +540,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
Console.Write("[PlacementReceiveController] Check-Position");
|
||||||
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
|
||||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
var _res = await client.SendAsync(_req);
|
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.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
|
var _res = await client.PostAsJsonAsync(apiUrlCheckCitizen, new
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
retirementOther.positionAreaOld = org.result.positionArea;
|
retirementOther.positionAreaOld = org.result.positionArea;
|
||||||
retirementOther.PositionLevelOld = org.result.posLevelName;
|
retirementOther.PositionLevelOld = org.result.posLevelName;
|
||||||
retirementOther.PositionTypeOld = org.result.posTypeName;
|
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") +
|
retirementOther.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
|
||||||
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
||||||
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
|
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
|
||||||
|
|
|
||||||
|
|
@ -1290,7 +1290,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
retirementResign.positionAreaOld = org.result.positionArea;
|
retirementResign.positionAreaOld = org.result.positionArea;
|
||||||
retirementResign.PositionLevelOld = org.result.posLevelName;
|
retirementResign.PositionLevelOld = org.result.posLevelName;
|
||||||
retirementResign.PositionTypeOld = org.result.posTypeName;
|
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") +
|
retirementResign.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
|
||||||
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
||||||
(org.result.child2 == null ? "" : org.result.child2 + "\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.positionAreaOld = org.result.positionArea;
|
||||||
retirementResign.PositionLevelOld = org.result.posLevelName;
|
retirementResign.PositionLevelOld = org.result.posLevelName;
|
||||||
retirementResign.PositionTypeOld = org.result.posTypeName;
|
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") +
|
retirementResign.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
|
||||||
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
||||||
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
|
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
|
||||||
|
|
@ -1513,7 +1513,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
return Error(GlobalMessages.RetirementResignNotFound, 404);
|
return Error(GlobalMessages.RetirementResignNotFound, 404);
|
||||||
|
|
||||||
updated.Location = req.Location;
|
updated.Location = req.Location;
|
||||||
updated.ActiveDate = req.ActiveDate;
|
if (req.SendDate != null)
|
||||||
|
{
|
||||||
|
updated.SendDate = req.SendDate;
|
||||||
|
}
|
||||||
// updated.Reason = req.Reason;
|
// updated.Reason = req.Reason;
|
||||||
updated.Remark = req.Remark;
|
updated.Remark = req.Remark;
|
||||||
updated.ReasonResign = req.Reason;
|
updated.ReasonResign = req.Reason;
|
||||||
|
|
|
||||||
|
|
@ -1227,7 +1227,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
retirementResignEmployee.PositionOld = org.result.position;
|
retirementResignEmployee.PositionOld = org.result.position;
|
||||||
retirementResignEmployee.PositionLevelOld = org.result.posLevelName;
|
retirementResignEmployee.PositionLevelOld = org.result.posLevelName;
|
||||||
retirementResignEmployee.PositionTypeOld = org.result.posTypeName;
|
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") +
|
retirementResignEmployee.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
|
||||||
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
||||||
(org.result.child2 == null ? "" : org.result.child2 + "\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.PositionOld = org.result.position;
|
||||||
retirementResignEmployee.PositionLevelOld = org.result.posLevelName;
|
retirementResignEmployee.PositionLevelOld = org.result.posLevelName;
|
||||||
retirementResignEmployee.PositionTypeOld = org.result.posTypeName;
|
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") +
|
retirementResignEmployee.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") +
|
||||||
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
(org.result.child3 == null ? "" : org.result.child3 + "\n") +
|
||||||
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
|
(org.result.child2 == null ? "" : org.result.child2 + "\n") +
|
||||||
|
|
@ -1450,7 +1450,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
return Error(GlobalMessages.RetirementResignEmployeeNotFound, 404);
|
return Error(GlobalMessages.RetirementResignEmployeeNotFound, 404);
|
||||||
|
|
||||||
updated.Location = req.Location;
|
updated.Location = req.Location;
|
||||||
updated.ActiveDate = req.ActiveDate;
|
if (req.SendDate != null)
|
||||||
|
{
|
||||||
|
updated.SendDate = req.SendDate;
|
||||||
|
}
|
||||||
// updated.Reason = req.Reason;
|
// updated.Reason = req.Reason;
|
||||||
updated.Remark = req.Remark;
|
updated.Remark = req.Remark;
|
||||||
updated.ReasonResign = req.Reason;
|
updated.ReasonResign = req.Reason;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ namespace BMA.EHR.Retirement.Service.Requests
|
||||||
public class RetirementResignEmployeeRequest
|
public class RetirementResignEmployeeRequest
|
||||||
{
|
{
|
||||||
public string? Location { get; set; }
|
public string? Location { get; set; }
|
||||||
// public DateTime? SendDate { get; set; }
|
public DateTime? SendDate { get; set; }
|
||||||
public DateTime? ActiveDate { get; set; }
|
public DateTime? ActiveDate { get; set; }
|
||||||
public string? Reason { get; set; }
|
public string? Reason { get; set; }
|
||||||
public string? Remark { get; set; }
|
public string? Remark { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ namespace BMA.EHR.Retirement.Service.Requests
|
||||||
public class RetirementResignRequest
|
public class RetirementResignRequest
|
||||||
{
|
{
|
||||||
public string? Location { get; set; }
|
public string? Location { get; set; }
|
||||||
// public DateTime? SendDate { get; set; }
|
public DateTime? SendDate { get; set; }
|
||||||
public DateTime? ActiveDate { get; set; }
|
public DateTime? ActiveDate { get; set; }
|
||||||
public string? Reason { get; set; }
|
public string? Reason { get; set; }
|
||||||
public string? Remark { get; set; }
|
public string? Remark { get; set; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue