fix #1511 และเปลี่ยน Env เพิ่ม VITE_URL_MGT
This commit is contained in:
parent
0b407f3c68
commit
48baf99adf
4 changed files with 9 additions and 6 deletions
|
|
@ -57,7 +57,8 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
_emailSenderService = emailSenderService;
|
||||
_appDbContext = appDbContext;
|
||||
|
||||
URL = (_configuration["API"]).Replace("/api/v1", "");
|
||||
URL = (_configuration["VITE_URL_MGT"]).Replace("/api/v1", "");
|
||||
Console.WriteLine($"URL : {URL}");
|
||||
_minIOService = minIOService;
|
||||
_leaveBeginningRepository = leaveBeginningRepository;
|
||||
}
|
||||
|
|
@ -478,10 +479,11 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
return data;
|
||||
}
|
||||
|
||||
public async Task<LeaveRequest?> GetLastLeaveRequestByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId)
|
||||
public async Task<LeaveRequest?> GetLastLeaveRequestByTypeForUserAsync(Guid keycloakUserId, Guid leaveTypeId,DateTime beforeDate)
|
||||
{
|
||||
var data = await _dbContext.Set<LeaveRequest>().AsQueryable().AsNoTracking()
|
||||
.Include(x => x.Type)
|
||||
.Where(x => x.LeaveStartDate.Date < beforeDate.Date)
|
||||
.Where(x => x.KeycloakUserId == keycloakUserId)
|
||||
.Where(x => x.Type.Id == leaveTypeId)
|
||||
.Where(x => x.LeaveStatus == "APPROVE")
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
var lastLeaveRequest =
|
||||
await _leaveRequestRepository.GetLastLeaveRequestByTypeForUserAsync(data.KeycloakUserId,
|
||||
data.Type.Id);
|
||||
data.Type.Id, data.LeaveStartDate.Date);
|
||||
|
||||
//var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||
//var approver = string.Empty;
|
||||
|
|
@ -593,7 +593,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
child3 = profileLeave.Child3 == null ? "" : profileLeave.Child3!.ToThaiNumber(),
|
||||
child4 = profileLeave.Child4 == null ? "" : profileLeave.Child4!.ToThaiNumber(),
|
||||
|
||||
positions = profileLeave.Positions.Select(x => new
|
||||
positions = profileLeave.Positions.Select(x => new
|
||||
{
|
||||
positionName = x.PositionName == null ? "" : x.PositionName.ToThaiNumber(),
|
||||
dateStart = x.DateStart.ToThaiShortDate().ToThaiNumber(),
|
||||
|
|
|
|||
|
|
@ -1405,7 +1405,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
var lastLeaveRequest =
|
||||
await _leaveRequestRepository.GetLastLeaveRequestByTypeForUserAsync(rawData.KeycloakUserId,
|
||||
rawData.Type.Id);
|
||||
rawData.Type.Id, rawData.LeaveStartDate.Date);
|
||||
|
||||
var sumLeave = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate);
|
||||
var sumHoliday = await _holidayRepository.GetHolidayCountAsync(rawData.LeaveStartDate, rawData.LeaveEndDate, category);
|
||||
|
|
@ -2172,7 +2172,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
var lastLeaveRequest =
|
||||
await _leaveRequestRepository.GetLastLeaveRequestByTypeForUserAsync(rawData.KeycloakUserId,
|
||||
rawData.Type.Id);
|
||||
rawData.Type.Id, rawData.LeaveStartDate.Date);
|
||||
|
||||
//var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||
//var approver = string.Empty;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
"MailFrom": "saraban.csc.rd@bangkok.go.th",
|
||||
"Port": "25"
|
||||
},
|
||||
"VITE_URL_MGT": "https://bma-ehr.frappet.synology.me",
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
||||
//"API": "https://bma-hrms.bangkok.go.th/api/v1",
|
||||
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue