no message

This commit is contained in:
Kittapath 2024-07-01 16:11:19 +07:00
parent 2678b7fc59
commit 6554971c3c
4 changed files with 87 additions and 83 deletions

View file

@ -239,6 +239,7 @@ namespace BMA.EHR.Application.Repositories.Commands
.Where(x => x.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN")
.Where(x => x.Draft! == true)
.Where(x => x.Placement!.PlacementType!.Name == "สอบแข่งขัน")
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
.OrderBy(x => x.ExamNumber)
.ToListAsync();
@ -297,6 +298,7 @@ namespace BMA.EHR.Application.Repositories.Commands
.Where(x => x.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN")
.Where(x => x.Draft! == true)
.Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
.OrderBy(x => x.ExamNumber)
.ToListAsync();
@ -354,6 +356,7 @@ namespace BMA.EHR.Application.Repositories.Commands
.Where(x => x.Placement.Id == command.Placement.Id)
.Where(x => !otherCommandReceivers.Contains(x.CitizenId!))
.Where(x => x.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN")
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINT")
.Where(x => x.Draft! == true)
.OrderBy(x => x.ExamNumber)
.ToListAsync();
@ -412,6 +415,7 @@ namespace BMA.EHR.Application.Repositories.Commands
.Where(x => x.Placement.Id == command.Placement.Id)
.Where(x => !otherCommandReceivers.Contains(x.CitizenId!))
.Where(x => x.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN")
.Where(x => x.typeCommand.Trim().ToUpper() == "MOVE")
.Where(x => x.Draft! == true)
.OrderBy(x => x.ExamNumber)
.ToListAsync();
@ -9156,8 +9160,8 @@ namespace BMA.EHR.Application.Repositories.Commands
{
ret.Add(new KeyValueItemResponse
{
Id = raw.result!.rootId,
Name = raw.result!.root,
Id = raw.result!.rootId??null,
Name = raw.result!.root??null,
});
}
}
@ -9794,39 +9798,39 @@ namespace BMA.EHR.Application.Repositories.Commands
// }
// }
// var Insignias = await _dbContext.Set<ProfileInsignia>()
// .Include(x => x.Insignia)
// .Where(x => orgIdSend.Contains(x.ProfileId))
// .ToListAsync();
// if (Insignias.Count > 0)
// {
// var apiUrlInsig = $"{_baseAPI}/org/dotnet/insignia/Dumb";
// using (var client = new HttpClient())
// {
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
// foreach (var insignia in Insignias)
// {
// var _res = await client.PostAsJsonAsync(apiUrlInsig, new
// {
// profileId = profile.Id,
// year = insignia.Year,
// no = insignia.No,
// volume = insignia.Volume,
// section = insignia.Section,
// page = insignia.Page,
// receiveDate = insignia.ReceiveDate,
// insigniaId = insignia.Insignia.Id, //where in node
// dateAnnounce = insignia.DateAnnounce,
// issue = insignia.Issue,
// volumeNo = insignia.VolumeNo,
// refCommandDate = insignia.RefCommandDate,
// refCommandNo = insignia.RefCommandNo,
// note = insignia.Note,
// });
// var _result = await _res.Content.ReadAsStringAsync();
// }
// }
// }
var Insignias = await _dbContext.Set<ProfileInsignia>()
.Include(x => x.Insignia)
.Where(x => profile.Id==x.ProfileId)
.ToListAsync();
if (Insignias.Count > 0)
{
var apiUrlInsig = $"{_baseAPI}/org/dotnet/insignia/Dumb";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
foreach (var insignia in Insignias)
{
var _res = await client.PostAsJsonAsync(apiUrlInsig, new
{
profileId = profile.Id,
year = insignia.Year,
no = insignia.No,
volume = insignia.Volume,
section = insignia.Section,
page = insignia.Page,
receiveDate = insignia.ReceiveDate,
insigniaId = insignia.Insignia.Id, //where in node
dateAnnounce = insignia.DateAnnounce,
issue = insignia.Issue,
volumeNo = insignia.VolumeNo,
refCommandDate = insignia.RefCommandDate,
refCommandNo = insignia.RefCommandNo,
note = insignia.Note,
});
var _result = await _res.Content.ReadAsStringAsync();
}
}
}
// var Honor = await _dbContext.Set<ProfileHonor>()
// .Where(x => orgIdSend.Contains(x.ProfileId))