แก้ noti
This commit is contained in:
parent
31ac8f9299
commit
2fc1587d18
3 changed files with 14 additions and 8 deletions
|
|
@ -187,9 +187,9 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var profile = await _dbContext.Set<Profile>().FirstOrDefaultAsync(x => x.Id == ReceiverUserId);
|
// var profile = await _dbContext.Set<Profile>().FirstOrDefaultAsync(x => x.Id == ReceiverUserId);
|
||||||
if (profile != null)
|
//if (profile != null)
|
||||||
{
|
//{
|
||||||
_dbContext.Set<Notification>().Add(new Notification
|
_dbContext.Set<Notification>().Add(new Notification
|
||||||
{
|
{
|
||||||
Body = Body,
|
Body = Body,
|
||||||
|
|
@ -224,7 +224,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
||||||
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com");
|
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com");
|
||||||
}
|
}
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -75,12 +75,12 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
[HttpPost("keycloak")]
|
[HttpPost("keycloak")]
|
||||||
public async Task<ActionResult<ResponseObject>> UpdatePropertyByUserKeycloak([FromBody] NotiRequest req)
|
public async Task<ActionResult<ResponseObject>> UpdatePropertyByUserKeycloak([FromBody] NotiRequest req)
|
||||||
{
|
{
|
||||||
var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.KeycloakId == req.ReceiverUserId);
|
// var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.KeycloakId == req.ReceiverUserId);
|
||||||
if (profile == null)
|
// if (profile == null)
|
||||||
return Error(GlobalMessages.DataNotFound);
|
// return Error(GlobalMessages.DataNotFound);
|
||||||
|
|
||||||
await _repositoryNoti.PushNotificationAsync(
|
await _repositoryNoti.PushNotificationAsync(
|
||||||
profile.Id,
|
req.ReceiverUserId,
|
||||||
req.Subject,
|
req.Subject,
|
||||||
req.Body,
|
req.Body,
|
||||||
req.Payload,
|
req.Payload,
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
Draft = x.Draft,
|
Draft = x.Draft,
|
||||||
typeCommand = x.typeCommand,
|
typeCommand = x.typeCommand,
|
||||||
IsOfficer = x.IsOfficer,
|
IsOfficer = x.IsOfficer,
|
||||||
|
IsRelief = x.IsRelief,
|
||||||
posLevelCandidateId = x.PositionLevel == null ? (Guid?)null : x.PositionLevel.Id,
|
posLevelCandidateId = x.PositionLevel == null ? (Guid?)null : x.PositionLevel.Id,
|
||||||
posTypeCandidateId = x.PositionType == null ? (Guid?)null : x.PositionType.Id,
|
posTypeCandidateId = x.PositionType == null ? (Guid?)null : x.PositionType.Id,
|
||||||
}).OrderBy(x => x.ExamNumber).ToListAsync();
|
}).OrderBy(x => x.ExamNumber).ToListAsync();
|
||||||
|
|
@ -202,6 +203,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
p.StatusId,
|
p.StatusId,
|
||||||
p.Draft,
|
p.Draft,
|
||||||
p.typeCommand,
|
p.typeCommand,
|
||||||
|
p.IsRelief,
|
||||||
p.posLevelCandidateId,
|
p.posLevelCandidateId,
|
||||||
p.posTypeCandidateId,
|
p.posTypeCandidateId,
|
||||||
};
|
};
|
||||||
|
|
@ -277,6 +279,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
Draft = x.Draft,
|
Draft = x.Draft,
|
||||||
typeCommand = x.typeCommand,
|
typeCommand = x.typeCommand,
|
||||||
IsOfficer = x.IsOfficer,
|
IsOfficer = x.IsOfficer,
|
||||||
|
IsRelief = x.IsRelief,
|
||||||
posLevelCandidateId = x.PositionLevel == null ? (Guid?)null : x.PositionLevel.Id,
|
posLevelCandidateId = x.PositionLevel == null ? (Guid?)null : x.PositionLevel.Id,
|
||||||
posTypeCandidateId = x.PositionType == null ? (Guid?)null : x.PositionType.Id,
|
posTypeCandidateId = x.PositionType == null ? (Guid?)null : x.PositionType.Id,
|
||||||
}).OrderBy(x => x.ExamNumber).ToListAsync();
|
}).OrderBy(x => x.ExamNumber).ToListAsync();
|
||||||
|
|
@ -327,6 +330,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
p.StatusId,
|
p.StatusId,
|
||||||
p.Draft,
|
p.Draft,
|
||||||
p.typeCommand,
|
p.typeCommand,
|
||||||
|
p.IsRelief,
|
||||||
p.posLevelCandidateId,
|
p.posLevelCandidateId,
|
||||||
p.posTypeCandidateId,
|
p.posTypeCandidateId,
|
||||||
};
|
};
|
||||||
|
|
@ -449,6 +453,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
ExamNumber = x.ExamNumber,
|
ExamNumber = x.ExamNumber,
|
||||||
ExamRound = x.ExamRound,
|
ExamRound = x.ExamRound,
|
||||||
Pass = x.Pass,
|
Pass = x.Pass,
|
||||||
|
IsRelief = x.IsRelief,
|
||||||
IsProperty = x.IsProperty == null ? null : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PersonPropertyRequest>>(x.IsProperty),
|
IsProperty = x.IsProperty == null ? null : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PersonPropertyRequest>>(x.IsProperty),
|
||||||
BmaOfficer = x.IsOfficer == true ? "OFFICER" : null,
|
BmaOfficer = x.IsOfficer == true ? "OFFICER" : null,
|
||||||
PlacementProfileDocs = x.PlacementProfileDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
PlacementProfileDocs = x.PlacementProfileDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||||
|
|
@ -527,6 +532,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
data.ExamRound,
|
data.ExamRound,
|
||||||
data.Pass,
|
data.Pass,
|
||||||
data.IsProperty,
|
data.IsProperty,
|
||||||
|
data.IsRelief,
|
||||||
BmaOfficer = data.BmaOfficer,
|
BmaOfficer = data.BmaOfficer,
|
||||||
Docs = placementProfileDocs,
|
Docs = placementProfileDocs,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue