noti วินัย

This commit is contained in:
kittapath 2025-02-19 17:56:02 +07:00
parent 9e513d3f1a
commit ae990c0c5f
21 changed files with 244 additions and 1508 deletions

View file

@ -395,8 +395,23 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
}
}
}
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/find/director";
var refId = new List<Guid>();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var __res = await client.PostAsJsonAsync(apiUrlOrg, new
{
refId = new List<Guid> { id },
});
var __result = await __res.Content.ReadAsStringAsync();
var __org = JsonConvert.DeserializeObject<DirectorRequest>(__result);
if (__res.IsSuccessStatusCode)
{
refId = __org.result.Select(x => Guid.Parse(x.id)).ToList();
}
await _repositoryNoti.PushNotificationsAsync(
refId.ToArray(),
$"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}",
$"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}",
"",
@ -482,14 +497,34 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
}
}
}
// await _repositoryNoti.PushNotificationAsyncV2(
// req.ProfileId,
// $"เจ้าหน้าที่ได้ทำการสร้างคำร้องอุทธรณ์ร้องทุกข์",
// $"เจ้าหน้าที่ได้ทำการสร้างคำร้องอุทธรณ์ร้องทุกข์",
// "",
// true,
// true
// );
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/find/director";
var refId = new List<Guid>();
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var __res = await client.PostAsJsonAsync(apiUrlOrg, new
{
refId = new List<Guid> { Guid.Parse(req.ProfileId) },
});
var __result = await __res.Content.ReadAsStringAsync();
var __org = JsonConvert.DeserializeObject<DirectorRequest>(__result);
if (__res.IsSuccessStatusCode)
{
refId = __org.result.Select(x => Guid.Parse(x.id)).ToList();
}
await _repositoryNoti.PushNotificationsAsync(
refId.ToArray(),
$"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}",
$"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}",
"",
"",
true,
true
);
}
await _context.SaveChangesAsync();
return Success(disciplineComplaint_Appeal.Id);
}