ทmark alet insignia
This commit is contained in:
parent
b7027ebe55
commit
9692af553b
9 changed files with 16687 additions and 241 deletions
|
|
@ -866,6 +866,30 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
// }
|
||||
// #endregion
|
||||
|
||||
/// <summary>
|
||||
/// Mark แจ้งเตือนเงื่อนไขได้รับเครื่องราช
|
||||
/// </summary>
|
||||
/// <param name="insigniaRequestProfileId">Id รายชื่อคนที่ยื่นของในรอบ</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("alert/{insigniaRequestProfileId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> MarkAlertProfileInsignia([FromBody] InsigniaMarkAlertRequest req, Guid insigniaRequestProfileId)
|
||||
{
|
||||
var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.Id == insigniaRequestProfileId);
|
||||
if (insigniaRequestProfile == null)
|
||||
return Error(GlobalMessages.InsigniaRequestProfileNotFound);
|
||||
insigniaRequestProfile.MarkALert = JsonConvert.SerializeObject(req.Alert);
|
||||
insigniaRequestProfile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
insigniaRequestProfile.LastUpdateUserId = UserId ?? "";
|
||||
insigniaRequestProfile.LastUpdatedAt = DateTime.Now;
|
||||
_context.SaveChanges();
|
||||
return Success();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ย้ายขอมูลไปเป็น คนที่ไม่ยื่นขอ
|
||||
/// </summary>
|
||||
|
|
@ -880,7 +904,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
{
|
||||
var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.Id == insigniaRequestProfileId);
|
||||
if (insigniaRequestProfile == null)
|
||||
return Error(GlobalMessages.InsigniaPeriodNotFound);
|
||||
return Error(GlobalMessages.InsigniaRequestProfileNotFound);
|
||||
insigniaRequestProfile.Status = "REJECT";
|
||||
insigniaRequestProfile.ReasonReject = req.Reason;
|
||||
insigniaRequestProfile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
|
|
@ -904,7 +928,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
{
|
||||
var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.Id == insigniaRequestProfileId);
|
||||
if (insigniaRequestProfile == null)
|
||||
return Error(GlobalMessages.InsigniaPeriodNotFound);
|
||||
return Error(GlobalMessages.InsigniaRequestProfileNotFound);
|
||||
insigniaRequestProfile.Status = "DELETE";
|
||||
insigniaRequestProfile.ReasonReject = req.Reason;
|
||||
insigniaRequestProfile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
|
|
@ -2216,12 +2240,16 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
[HttpPut("note/return/{insigniaNoteProfileId:length(36)}"), DisableRequestSizeLimit]
|
||||
public async Task<ActionResult<ResponseObject>> UpdateReturnNoteInsignia([FromForm] InsigniaNoteReturnRequest req, Guid insigniaNoteProfileId)
|
||||
{
|
||||
var insigniaNoteProfile = await _context.InsigniaNoteProfiles.Where(x => x.Id == insigniaNoteProfileId).FirstOrDefaultAsync();
|
||||
var insigniaNoteProfile = await _context.InsigniaNoteProfiles.Include(x => x.DocReturnInsignia).Where(x => x.Id == insigniaNoteProfileId).FirstOrDefaultAsync();
|
||||
if (insigniaNoteProfile == null)
|
||||
return Error(GlobalMessages.InsigniaRequestProfileNotFound, 404);
|
||||
|
||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||
{
|
||||
if (insigniaNoteProfile.DocReturnInsignia != null)
|
||||
{
|
||||
await _documentService.DeleteFileAsync(insigniaNoteProfile.DocReturnInsignia.Id);
|
||||
}
|
||||
var file = Request.Form.Files[0];
|
||||
var fileExtension = Path.GetExtension(file.FileName);
|
||||
|
||||
|
|
@ -2250,12 +2278,17 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
[HttpPut("note/receive/{insigniaNoteProfileId:length(36)}"), DisableRequestSizeLimit]
|
||||
public async Task<ActionResult<ResponseObject>> UpdateReceiveNoteInsignia([FromForm] InsigniaNoteReturnRequest req, Guid insigniaNoteProfileId)
|
||||
{
|
||||
var insigniaNoteProfile = await _context.InsigniaNoteProfiles.Where(x => x.Id == insigniaNoteProfileId).FirstOrDefaultAsync();
|
||||
var insigniaNoteProfile = await _context.InsigniaNoteProfiles.Include(x => x.DocReceiveInsignia).Where(x => x.Id == insigniaNoteProfileId).FirstOrDefaultAsync();
|
||||
if (insigniaNoteProfile == null)
|
||||
return Error(GlobalMessages.InsigniaRequestProfileNotFound, 404);
|
||||
|
||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||
{
|
||||
if (insigniaNoteProfile.DocReceiveInsignia != null)
|
||||
{
|
||||
await _documentService.DeleteFileAsync(insigniaNoteProfile.DocReceiveInsignia.Id);
|
||||
}
|
||||
|
||||
var file = Request.Form.Files[0];
|
||||
var fileExtension = Path.GetExtension(file.FileName);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue