fix cronjob
This commit is contained in:
parent
96246d5853
commit
fb76f5737a
2 changed files with 50 additions and 4 deletions
|
|
@ -1167,7 +1167,7 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
if (matchedData != null)
|
||||
{
|
||||
resultList.Add(new
|
||||
{
|
||||
{
|
||||
rowNo = seq++.ToString().ToThaiNumber(),
|
||||
d.ProfileId,
|
||||
d.FullName,
|
||||
|
|
@ -1342,10 +1342,10 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
ResultOCT3 = d.ResultOCT3 ?? "-",
|
||||
ResultAPR4 = d.ResultAPR4 ?? "-",
|
||||
ResultOCT4 = d.ResultOCT4 ?? "-",
|
||||
ResultAPR5 = d.ResultAPR5 ?? "-",
|
||||
ResultAPR5 = d.ResultAPR5 ?? "-",
|
||||
ResultOCT5 = d.ResultOCT5 ?? "-",
|
||||
Remark = d.Reason ?? "-"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return resultList;
|
||||
|
|
@ -1488,6 +1488,49 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
}
|
||||
|
||||
//คำนวนผู้ได้รับเครื่องราชฯ
|
||||
public async Task CalInsigniaRequestBkkByType(string type = "officer")
|
||||
{
|
||||
var insigniaPeriods = await _dbContext.Set<InsigniaPeriod>()
|
||||
.Include(x => x.InsigniaRequests)
|
||||
.AsQueryable()
|
||||
.ToListAsync();
|
||||
insigniaPeriods = insigniaPeriods
|
||||
.Where(x => x.StartDate < DateTime.Now.Date || x.InsigniaRequests.Count == 0).ToList();
|
||||
|
||||
foreach (var insigniaPeriod in insigniaPeriods)
|
||||
{
|
||||
if (insigniaPeriod.StartDate >= DateTime.Now.Date || insigniaPeriod.InsigniaRequests.Count > 0)
|
||||
continue;
|
||||
var organizations = await _userProfileRepository.GetActiveRootLatestAsync(AccessToken);
|
||||
if (organizations == null)
|
||||
continue;
|
||||
insigniaPeriod.RevisionId = Guid.Parse(organizations[0].OrgRevisionId);
|
||||
foreach (var organization in organizations)
|
||||
{
|
||||
if (organization == null)
|
||||
continue;
|
||||
|
||||
var result = await _repositoryInsignia.GetInsigniaRequestByTypeAsync(insigniaPeriod.Id, organization.Id, type);
|
||||
if (result != null)
|
||||
{
|
||||
Guid period = result.PeriodId;
|
||||
string requestStatus = result.RequestStatus;
|
||||
var candidate = await _repositoryInsignia.GetInsigniaCandidateBKKByTypeAsync(insigniaPeriod.Id, organization.Id, type);
|
||||
// ตรวจสอบว่ารายการอยู่ใน table insignia_request_new
|
||||
if (requestStatus == null)
|
||||
{
|
||||
// บันทึกรายชื่อ
|
||||
if (candidate != null)
|
||||
await _repositoryInsignia.InsertCandidate(period, organization.Id, organization.OrgRootName, candidate, type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task CalInsignaiRequestBkk()
|
||||
{
|
||||
var insigniaPeriods = await _dbContext.Set<InsigniaPeriod>()
|
||||
|
|
@ -1528,6 +1571,8 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<dynamic> GetKhr5TotalReport(Guid id, string type = null, int node = -1, Guid nodeId = default)
|
||||
{
|
||||
var period = await _dbContext.Set<InsigniaNote>()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue