ปรับ logic การส่งไฟล์ภาพ #2521
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m53s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m53s
This commit is contained in:
parent
a16ef7ac55
commit
81dc7f4544
1 changed files with 12 additions and 9 deletions
|
|
@ -597,7 +597,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
LocationName = data.LocationName,
|
||||
Remark = data.Remark,
|
||||
CheckInFileName = data.Img == null ? "no-file" : data.Img.FileName,
|
||||
//CheckInFileBytes = checkFileBytes,
|
||||
CheckInFileBytes = checkFileBytes,
|
||||
Token = AccessToken ?? ""
|
||||
};
|
||||
|
||||
|
|
@ -614,8 +614,17 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
var properties = channel.CreateBasicProperties();
|
||||
properties.Persistent = true;
|
||||
properties.MessageId = taskId;
|
||||
|
||||
// ส่งไป RabbitMQ
|
||||
channel.BasicPublish(exchange: "",
|
||||
routingKey: queue,
|
||||
basicProperties: properties,
|
||||
body: body);
|
||||
|
||||
// บันทึกสถานะงานก่อนส่งไป RabbitMQ
|
||||
// Clear Byte data Before Save to DB
|
||||
checkData.CheckInFileBytes = new byte[0];
|
||||
|
||||
// บันทึกสถานะงานหลังส่งไป RabbitMQ
|
||||
jobStatus = new CheckInJobStatus
|
||||
{
|
||||
TaskId = Guid.Parse(taskId),
|
||||
|
|
@ -627,13 +636,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
AdditionalData = JsonConvert.SerializeObject(checkData)
|
||||
};
|
||||
await _checkInJobStatusRepository.AddAsync(jobStatus);
|
||||
|
||||
// ส่งไป RabbitMQ
|
||||
channel.BasicPublish(exchange: "",
|
||||
routingKey: queue,
|
||||
basicProperties: properties,
|
||||
body: body);
|
||||
|
||||
|
||||
return Success(new { date = currentDate, taskId = taskId, keycloakId = userId });
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue