This commit is contained in:
parent
c6663b35c3
commit
ccb183dc95
11 changed files with 20289 additions and 112 deletions
|
|
@ -366,6 +366,8 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
posLevelName = p.posLevelName,
|
||||
|
||||
IsSend = p.IsReport,
|
||||
// DocumentReject = p.DocumentReject,
|
||||
RemarkReject = p.RemarkReject,
|
||||
IsDisciplinary = p.IsDisciplinary,
|
||||
profileType = p.profileType,
|
||||
CreatedAt = p.CreatedAt,
|
||||
|
|
@ -403,6 +405,18 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
};
|
||||
disciplineInvestigateRelevantDocs.Add(_doc);
|
||||
}
|
||||
|
||||
// var persons = new List<dynamic>();
|
||||
// foreach (var doc in _data.Persons)
|
||||
// {
|
||||
// var _doc = new
|
||||
// {
|
||||
// doc.Id,
|
||||
// doc.FileName,
|
||||
// PathName = await _documentService.ImagesPath(doc.Id)
|
||||
// };
|
||||
// disciplineInvestigateRelevantDocs.Add(_doc);
|
||||
// }
|
||||
var data = new
|
||||
{
|
||||
_data.Id,
|
||||
|
|
@ -1167,18 +1181,33 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
// [HttpPut("report/{commandTypeId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> PostToReport([FromBody] DisciplineProfileRequest req)
|
||||
{
|
||||
foreach (var item in req.Id)
|
||||
foreach (var item in req.id)
|
||||
{
|
||||
var uppdated = await _context.DisciplineInvestigate_ProfileComplaints
|
||||
.FirstOrDefaultAsync(x => x.Id == item);
|
||||
if (uppdated == null)
|
||||
continue;
|
||||
|
||||
// uppdated.CommandTypeId = commandTypeId;
|
||||
uppdated.IsReport = "REPORT";
|
||||
uppdated.IsReport = "DONE";
|
||||
uppdated.RemarkReject = req.remark;
|
||||
uppdated.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
uppdated.LastUpdateUserId = UserId ?? "";
|
||||
uppdated.LastUpdatedAt = DateTime.Now;
|
||||
|
||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||
{
|
||||
foreach (var file in Request.Form.Files)
|
||||
{
|
||||
var fileExtension = Path.GetExtension(file.FileName);
|
||||
var doc = await _documentService.UploadFileAsync(file, file.FileName);
|
||||
var _doc = await _context.Documents.AsQueryable()
|
||||
.FirstOrDefaultAsync(x => x.Id == doc.Id);
|
||||
if (_doc != null)
|
||||
{
|
||||
uppdated.DocumentReject = _doc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
|
|
|||
|
|
@ -194,6 +194,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
Status = p.Status,
|
||||
StatusDiscard = p.StatusDiscard,
|
||||
profileType = p.profileType,
|
||||
Remark = p.Remark,
|
||||
Offense = p.Offense,
|
||||
CreatedAt = p.CreatedAt
|
||||
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
|
||||
Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
|
||||
|
|
@ -2141,5 +2143,35 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// แก้ไขฐานความผิดรายบุคคล
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("summary/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdateSummaryDisciplineResult([FromBody] DisciplineResultSummaryRequest req, Guid id)
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_DISCIPLINE_RESULT");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
|
||||
data.Remark = req.remark;
|
||||
data.Offense = req.offense;
|
||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
data.LastUpdateUserId = UserId ?? "";
|
||||
data.LastUpdatedAt = DateTime.Now;
|
||||
await _context.SaveChangesAsync();
|
||||
return Success(data.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue