บันทึกผลการสอบสวนวินัย
This commit is contained in:
parent
e510639947
commit
3d8d65f21f
16 changed files with 33949 additions and 25 deletions
|
|
@ -55,7 +55,7 @@ namespace BMA.EHR.DisciplineDirector.Service.Controllers
|
|||
[HttpGet()]
|
||||
public async Task<ActionResult<ResponseObject>> GetDiscipline(int page = 1, int pageSize = 25, string keyword = "")
|
||||
{
|
||||
var data_search = (from x in _context.DisciplineDirectors
|
||||
var data_search = (from x in _context.DisciplineDirectors.Include(x => x.DisciplineInvestigate_Directors).Include(x => x.DisciplineDisciplinary_DirectorInvestigates)
|
||||
where x.Prefix.Contains(keyword) ||
|
||||
x.FirstName.Contains(keyword) ||
|
||||
x.LastName.Contains(keyword) ||
|
||||
|
|
@ -73,6 +73,8 @@ namespace BMA.EHR.DisciplineDirector.Service.Controllers
|
|||
Position = x.Position,
|
||||
Email = x.Email,
|
||||
Phone = x.Phone,
|
||||
TotalInvestigate = x.DisciplineInvestigate_Directors.Count(),
|
||||
TotalDisciplinary = x.DisciplineDisciplinary_DirectorInvestigates.Count(),
|
||||
})
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
|
|
@ -101,6 +103,8 @@ namespace BMA.EHR.DisciplineDirector.Service.Controllers
|
|||
Position = x.Position,
|
||||
Email = x.Email,
|
||||
Phone = x.Phone,
|
||||
TotalInvestigate = x.DisciplineInvestigate_Directors.Count(),
|
||||
TotalDisciplinary = x.DisciplineDisciplinary_DirectorInvestigates.Count(),
|
||||
})
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
Email = d.DisciplineDirector.Email,
|
||||
Duty = "",
|
||||
Phone = d.DisciplineDirector.Phone,
|
||||
Total = d.DisciplineDirector.DisciplineDisciplinary_DirectorInvestigates.Count(),
|
||||
// Total = d.DisciplineDirector.DisciplineDisciplinary_DirectorInvestigates.Count(),
|
||||
}).ToList(),
|
||||
DisciplineDisciplinaryDocInvestigates = x.DisciplineDisciplinary_DocInvestigates.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
DisciplineDisciplinaryDocInvestigateRelevants = x.DisciplineDisciplinary_DocInvestigateRelevants.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
|
|
@ -397,6 +397,16 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
DisciplinaryCaseFault = x.DisciplinaryCaseFault,
|
||||
DisciplinaryDateEvident = x.DisciplinaryDateEvident,
|
||||
DisciplinaryDateAllegation = x.DisciplinaryDateAllegation,
|
||||
|
||||
DisciplinaryDateStart = x.DisciplinaryDateStart,
|
||||
DisciplinaryDateEnd = x.DisciplinaryDateEnd,
|
||||
DaysExtend = x.DisciplinaryDaysExtend,
|
||||
DisciplinaryDateInvestigation = x.DisciplinaryDateInvestigation,
|
||||
DisciplinaryDateResult = x.DisciplinaryDateResult,
|
||||
DisciplinaryStatusResult = x.DisciplinaryStatusResult,
|
||||
DisciplinaryCauseText = x.DisciplinaryCauseText,
|
||||
DisciplinaryResult = x.DisciplinaryResult,
|
||||
Status = x.Status,
|
||||
Result = x.Result,
|
||||
Director = x.DisciplineDisciplinary_DirectorInvestigates.Select(d => new
|
||||
{
|
||||
|
|
@ -409,7 +419,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
Email = d.DisciplineDirector.Email,
|
||||
Duty = "",
|
||||
Phone = d.DisciplineDirector.Phone,
|
||||
Total = d.DisciplineDirector.DisciplineDisciplinary_DirectorInvestigates.Count(),
|
||||
// Total = d.DisciplineDirector.DisciplineDisciplinary_DirectorInvestigates.Count(),
|
||||
}).ToList(),
|
||||
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
|
||||
Persons = x.DisciplineDisciplinary_ProfileComplaintInvestigates.Select(p => new
|
||||
|
|
@ -428,6 +438,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
Organization = p.Organization,
|
||||
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
|
||||
OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
|
||||
DisciplineDisciplinary_DocRelevants = x.DisciplineDisciplinary_DocRelevants.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
DisciplineDisciplinary_DocSummaryEvidences = x.DisciplineDisciplinary_DocSummaryEvidences.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
DisciplineDisciplinary_DocRecordAccusers = x.DisciplineDisciplinary_DocRecordAccusers.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
DisciplineDisciplinary_DocWitnessess = x.DisciplineDisciplinary_DocWitnessess.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
|
|
@ -438,6 +449,17 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
if (_data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
|
||||
var disciplineDisciplinary_DocRelevants = new List<dynamic>();
|
||||
foreach (var doc in _data.DisciplineDisciplinary_DocRelevants)
|
||||
{
|
||||
var _doc = new
|
||||
{
|
||||
doc.Id,
|
||||
doc.FileName,
|
||||
PathName = await _documentService.ImagesPath(doc.Id)
|
||||
};
|
||||
disciplineDisciplinary_DocRelevants.Add(_doc);
|
||||
}
|
||||
var disciplineDisciplinary_DocSummaryEvidences = new List<dynamic>();
|
||||
foreach (var doc in _data.DisciplineDisciplinary_DocSummaryEvidences)
|
||||
{
|
||||
|
|
@ -496,11 +518,21 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
_data.DisciplinaryCaseFault,
|
||||
_data.DisciplinaryDateEvident,
|
||||
_data.DisciplinaryDateAllegation,
|
||||
_data.DisciplinaryDateStart,
|
||||
_data.DisciplinaryDateEnd,
|
||||
_data.DaysExtend,
|
||||
_data.DisciplinaryDateInvestigation,
|
||||
_data.DisciplinaryDateResult,
|
||||
_data.DisciplinaryStatusResult,
|
||||
_data.DisciplinaryCauseText,
|
||||
_data.DisciplinaryResult,
|
||||
_data.Status,
|
||||
_data.Result,
|
||||
_data.Director,
|
||||
_data.RespondentType,
|
||||
_data.Persons,
|
||||
_data.OrganizationId,
|
||||
disciplineDisciplinary_DocRelevants,
|
||||
disciplineDisciplinary_DocSummaryEvidences,
|
||||
disciplineDisciplinary_DocRecordAccusers,
|
||||
disciplineDisciplinary_DocWitnessess,
|
||||
|
|
@ -523,6 +555,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
var data = await _context.DisciplineDisciplinarys
|
||||
.Include(x => x.DisciplineDisciplinary_DirectorInvestigates)
|
||||
.ThenInclude(x => x.DisciplineDirector)
|
||||
.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
|
|
@ -539,6 +572,14 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
data.DisciplinaryCaseFault = req.DisciplinaryCaseFault;
|
||||
data.DisciplinaryDateEvident = req.DisciplinaryDateEvident;
|
||||
data.DisciplinaryDateAllegation = req.DisciplinaryDateAllegation;
|
||||
data.DisciplinaryDateStart = req.DisciplinaryDateStart;
|
||||
data.DisciplinaryDateEnd = req.DisciplinaryDateEnd;
|
||||
data.DisciplinaryDaysExtend = req.DaysExtend;
|
||||
data.DisciplinaryDateInvestigation = req.DisciplinaryDateInvestigation;
|
||||
data.DisciplinaryDateResult = req.DisciplinaryDateResult;
|
||||
data.DisciplinaryStatusResult = req.DisciplinaryStatusResult;
|
||||
data.DisciplinaryCauseText = req.DisciplinaryCauseText;
|
||||
data.DisciplinaryResult = req.DisciplinaryResult;
|
||||
data.Result = req.Result;
|
||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
data.LastUpdateUserId = UserId ?? "";
|
||||
|
|
@ -861,7 +902,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("relevant/file/{id:guid}")]
|
||||
[HttpPut("investigate/relevant/file/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> UploadFileDisciplineDisciplinaryInvestigateRelevant([FromForm] DisciplineFileRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinarys
|
||||
|
|
@ -909,7 +950,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpDelete("relevant/file/{id:guid}/{docId:guid}")]
|
||||
[HttpDelete("investigate/relevant/file/{id:guid}/{docId:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> DeleteFileDisciplineDisciplinaryInvestigateRelevant(Guid id, Guid docId)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinarys
|
||||
|
|
@ -943,6 +984,89 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// อัพไฟล์เอกสารที่เกี่ยวข้องกับการสอบสวน
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("relevant/file/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> UploadFileDisciplineDisciplinaryRelevants([FromForm] DisciplineFileRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinarys
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
|
||||
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)
|
||||
{
|
||||
var disciplineDisciplinary_DocRelevant = new DisciplineDisciplinary_DocRelevant
|
||||
{
|
||||
DisciplineDisciplinary = data,
|
||||
Document = _doc,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
await _context.DisciplineDisciplinary_DocRelevants.AddAsync(disciplineDisciplinary_DocRelevant);
|
||||
}
|
||||
}
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ลบเอกสารที่เกี่ยวข้องกับการสอบสวน
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpDelete("relevant/file/{id:guid}/{docId:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> DeleteFileDisciplineDisciplinaryRelevants(Guid id, Guid docId)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinarys
|
||||
.Include(x => x.DisciplineDisciplinary_DocRelevants)
|
||||
.ThenInclude(x => x.Document)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
var dataDoc = data.DisciplineDisciplinary_DocRelevants.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||
if (dataDoc != null)
|
||||
{
|
||||
_context.DisciplineDisciplinary_DocRelevants.Remove(dataDoc);
|
||||
await _context.SaveChangesAsync();
|
||||
await _documentService.DeleteFileAsync(docId);
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Error(new Exception("ไม่พบไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// อัพไฟล์หลักฐานสนับสนุนข้อกล่าวหา
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
Email = d.DisciplineDirector.Email,
|
||||
Duty = "",
|
||||
Phone = d.DisciplineDirector.Phone,
|
||||
Total = d.DisciplineDirector.DisciplineInvestigate_Directors.Count(),
|
||||
// Total = d.DisciplineDirector.DisciplineInvestigate_Directors.Count(),
|
||||
}).ToList(),
|
||||
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
|
||||
Persons = x.DisciplineInvestigate_ProfileComplaints.Select(p => new
|
||||
|
|
@ -571,27 +571,24 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
foreach (var item in data.DisciplineInvestigate_Directors)
|
||||
{
|
||||
disciplineDisciplinary.DisciplineDisciplinary_DirectorInvestigates.Add(
|
||||
new DisciplineDisciplinary_DirectorInvestigate
|
||||
{
|
||||
DisciplineDirector = item.DisciplineDirector,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
// foreach (var item in data.DisciplineInvestigate_Directors)
|
||||
// {
|
||||
// disciplineDisciplinary.DisciplineDisciplinary_DirectorInvestigates.Add(
|
||||
// new DisciplineDisciplinary_DirectorInvestigate
|
||||
// {
|
||||
// DisciplineDirector = item.DisciplineDirector,
|
||||
// CreatedFullName = FullName ?? "System Administrator",
|
||||
// CreatedUserId = UserId ?? "",
|
||||
// CreatedAt = DateTime.Now,
|
||||
// LastUpdateFullName = FullName ?? "System Administrator",
|
||||
// LastUpdateUserId = UserId ?? "",
|
||||
// LastUpdatedAt = DateTime.Now,
|
||||
// });
|
||||
// }
|
||||
|
||||
data.DisciplineDisciplinarys.Add(disciplineDisciplinary);
|
||||
await _context.SaveChangesAsync();
|
||||
return Success(disciplineDisciplinary.Id);
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,150 @@
|
|||
using BMA.EHR.Application.Repositories;
|
||||
using BMA.EHR.Application.Repositories.MessageQueue;
|
||||
using BMA.EHR.Discipline.Service.Requests;
|
||||
using BMA.EHR.Domain.Common;
|
||||
using BMA.EHR.Domain.Models.Discipline;
|
||||
using BMA.EHR.Domain.Shared;
|
||||
using BMA.EHR.Infrastructure.Persistence;
|
||||
// using BMA.EHR.Placement.Service.Requests;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||
{
|
||||
[Route("api/v{version:apiVersion}/discipline/result")]
|
||||
[ApiVersion("1.0")]
|
||||
[ApiController]
|
||||
[Produces("application/json")]
|
||||
[Authorize]
|
||||
[SwaggerTag("ระบบวินัยเรื่องผลการพิจารณาทางวินัย")]
|
||||
public class DisciplineResultController : BaseController
|
||||
{
|
||||
private readonly DisciplineDbContext _context;
|
||||
private readonly MinIODisciplineService _documentService;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
public DisciplineResultController(DisciplineDbContext context,
|
||||
MinIODisciplineService documentService,
|
||||
IHttpContextAccessor httpContextAccessor)
|
||||
{
|
||||
// _repository = repository;
|
||||
_context = context;
|
||||
_documentService = documentService;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
#region " Properties "
|
||||
|
||||
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||
|
||||
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// list รายการสรุปผลการพิจารณาทางวินัย
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet()]
|
||||
public async Task<ActionResult<ResponseObject>> GetDisciplineResult(int page = 1, int pageSize = 25, string keyword = "")
|
||||
{
|
||||
var data_search = (from x in _context.DisciplineDisciplinarys
|
||||
where x.Title.Contains(keyword) ||
|
||||
x.DisciplinaryFaultLevel.Contains(keyword) ||
|
||||
x.DisciplinaryCaseFault.Contains(keyword) ||
|
||||
x.Status == "DONE"
|
||||
select x).ToList();
|
||||
var data = data_search
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,//id ข้อมูลเรื่องสอบสวน
|
||||
Title = x.Title,//ชื่อเรื่อง
|
||||
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
|
||||
OffenseDetails = x.OffenseDetails,//ลักษณะความผิด
|
||||
DisciplinaryFaultLevel = x.DisciplinaryFaultLevel,//ระดับโทษความผิด
|
||||
DisciplinaryCaseFault = x.DisciplinaryCaseFault,//กรณีความผิด
|
||||
Status = x.Status,//สถานะหรือผลการสอบสวน
|
||||
CreatedAt = x.CreatedAt,//วันที่สร้างเรื่องสอบสวน
|
||||
})
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
return Success(new { data, total = data_search.Count() });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get รายการสรุปผลการพิจารณาทางวินัย
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetByDisciplineResult(Guid id)
|
||||
{
|
||||
var _data = await _context.DisciplineDisciplinarys
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,//id ข้อมูลเรื่องสอบสวน
|
||||
IdInvestigate = x.DisciplineInvestigate.Id,//id ข้อมูลเรื่องสืบสวน
|
||||
IdComplaint = x.DisciplineInvestigate.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน
|
||||
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
|
||||
Persons = x.DisciplineDisciplinary_ProfileComplaintInvestigates.Select(p => new
|
||||
{
|
||||
Id = p.Id,
|
||||
Idcard = p.CitizenId,
|
||||
Name = $"{p.Prefix}{p.FirstName} {p.LastName}",
|
||||
Prefix = p.Prefix,
|
||||
FirstName = p.FirstName,
|
||||
LastName = p.LastName,
|
||||
Position = p.Position,
|
||||
PositionLevel = p.PositionLevel,
|
||||
Salary = p.Salary,
|
||||
PersonId = p.PersonId,
|
||||
PosNo = p.PosNo,
|
||||
Organization = p.Organization,
|
||||
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
|
||||
OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
|
||||
ResultDescription = x.ResultDescription,//สรุปผลการพิจารณา
|
||||
})
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (_data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
|
||||
return Success(_data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// แก้ไขรายการสรุปผลการพิจารณาทางวินัย
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdateDisciplineResult([FromBody] DisciplineResultRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinarys.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
|
||||
data.ResultDescription = req.resultDescription;
|
||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
data.LastUpdateUserId = UserId ?? "";
|
||||
data.LastUpdatedAt = DateTime.Now;
|
||||
await _context.SaveChangesAsync();
|
||||
return Success(data.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11,8 +11,18 @@ namespace BMA.EHR.Discipline.Service.Requests
|
|||
public string? DisciplinaryFaultLevel { get; set; }
|
||||
public string? DisciplinaryInvestigateAt { get; set; }
|
||||
public string? DisciplinaryCaseFault { get; set; }
|
||||
public DateTime DisciplinaryDateEvident { get; set; }
|
||||
public DateTime DisciplinaryDateAllegation { get; set; }
|
||||
public DateTime? DisciplinaryDateEvident { get; set; }
|
||||
public DateTime? DisciplinaryDateAllegation { get; set; }
|
||||
|
||||
public DateTime DisciplinaryDateStart { get; set; }
|
||||
public DateTime DisciplinaryDateEnd { get; set; }
|
||||
public int? DaysExtend { get; set; }
|
||||
public DateTime? DisciplinaryDateInvestigation { get; set; }
|
||||
public DateTime DisciplinaryDateResult { get; set; }
|
||||
public string? DisciplinaryStatusResult { get; set; }
|
||||
public string? DisciplinaryCauseText { get; set; }
|
||||
public string? DisciplinaryResult { get; set; }
|
||||
|
||||
public string? Result { get; set; }
|
||||
public Guid[] directors { get; set; }
|
||||
public DisciplineDisciplinaryInvestigateComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Discipline.Service.Requests
|
||||
{
|
||||
public class DisciplineResultRequest
|
||||
{
|
||||
public string resultDescription { get; set; }// *สรุปผลการพิจารณา
|
||||
}
|
||||
}
|
||||
|
|
@ -97,6 +97,27 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
public DateTime? DisciplinaryDateEvident { get; set; }
|
||||
[Comment("วันที่รับทราบข้อกล่าวหา")]
|
||||
public DateTime? DisciplinaryDateAllegation { get; set; }
|
||||
[Comment("วันที่เริ่มการสอบสวน")]
|
||||
public DateTime? DisciplinaryDateStart { get; set; }
|
||||
[Comment("วันที่สิ้นสุดการสอบสวน")]
|
||||
public DateTime? DisciplinaryDateEnd { get; set; }
|
||||
[Comment("จำนวนวันที่ขยาย")]
|
||||
public int? DisciplinaryDaysExtend { get; set; }
|
||||
[Comment("วันที่มีคำสั่งให้สอบสวน")]
|
||||
public DateTime? DisciplinaryDateInvestigation { get; set; }
|
||||
[Comment("วันที่รายงานผลการสอบสวน")]
|
||||
public DateTime? DisciplinaryDateResult { get; set; }
|
||||
|
||||
[Comment("ผลการสอบสวน ผล")]
|
||||
public string? DisciplinaryStatusResult { get; set; }
|
||||
[Comment("ผลการสอบสวน กรณีมีมูล")]
|
||||
public string? DisciplinaryCauseText { get; set; }
|
||||
[Comment("ผลการสอบสวน เหตุผล")]
|
||||
public string? DisciplinaryResult { get; set; }
|
||||
|
||||
|
||||
[Comment("สรุปผลการพิจารณา")]
|
||||
public string? ResultDescription { get; set; }
|
||||
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
public virtual List<DisciplineDisciplinary_ProfileComplaintInvestigate> DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; } = new List<DisciplineDisciplinary_ProfileComplaintInvestigate>();
|
||||
|
|
@ -109,5 +130,6 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
public virtual List<DisciplineDisciplinary_DocRecordAccuser> DisciplineDisciplinary_DocRecordAccusers { get; set; } = new List<DisciplineDisciplinary_DocRecordAccuser>();
|
||||
public virtual List<DisciplineDisciplinary_DocWitnesses> DisciplineDisciplinary_DocWitnessess { get; set; } = new List<DisciplineDisciplinary_DocWitnesses>();
|
||||
public virtual List<DisciplineDisciplinary_DocOther> DisciplineDisciplinary_DocOthers { get; set; } = new List<DisciplineDisciplinary_DocOther>();
|
||||
public virtual List<DisciplineDisciplinary_DocRelevant> DisciplineDisciplinary_DocRelevants { get; set; } = new List<DisciplineDisciplinary_DocRelevant>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_DocRelevant : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,97 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableDisciplineDisciplinarysaddDisciplinaryDateResult : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DutyTimeEffectiveDate",
|
||||
table: "Profile",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่รอบการลงเวลามีผล");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DutyTimeId",
|
||||
table: "Profile",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
comment: "รอบการลงเวลาเข้างาน",
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DisciplinaryDateEnd",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่สิ้นสุดการสอบสวน");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DisciplinaryDateInvestigation",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่มีคำสั่งให้สอบสวน");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DisciplinaryDateResult",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่รายงานผลการสอบสวน");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DisciplinaryDateStart",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่เริ่มการสอบสวน");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "DisciplinaryDaysExtend",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "int",
|
||||
nullable: true,
|
||||
comment: "จำนวนวันที่ขยาย");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DutyTimeEffectiveDate",
|
||||
table: "Profile");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DutyTimeId",
|
||||
table: "Profile");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryDateEnd",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryDateInvestigation",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryDateResult",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryDateStart",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryDaysExtend",
|
||||
table: "DisciplineDisciplinarys");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,104 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableDisciplineDisciplinarysaddDisciplineDisciplinary_DocRelevant : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinaryCauseText",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ผลการสอบสวน กรณีมีมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinaryResult",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ผลการสอบสวน เหตุผล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinaryStatusResult",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ผลการสอบสวน ผล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_DocRelevants",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_DocRelevants", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocRelevants_DisciplineDisciplinarys_~",
|
||||
column: x => x.DisciplineDisciplinaryId,
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocRelevants_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocRelevants_DisciplineDisciplinaryId",
|
||||
table: "DisciplineDisciplinary_DocRelevants",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocRelevants_DocumentId",
|
||||
table: "DisciplineDisciplinary_DocRelevants",
|
||||
column: "DocumentId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_DocRelevants");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryCauseText",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryResult",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryStatusResult",
|
||||
table: "DisciplineDisciplinarys");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,30 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableDisciplineDisciplinarysaddresultDescription : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ResultDescription",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "สรุปผลการพิจารณา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ResultDescription",
|
||||
table: "DisciplineDisciplinarys");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -501,14 +501,38 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("กรณีความผิด");
|
||||
|
||||
b.Property<string>("DisciplinaryCauseText")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผลการสอบสวน กรณีมีมูล");
|
||||
|
||||
b.Property<DateTime?>("DisciplinaryDateAllegation")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่รับทราบข้อกล่าวหา");
|
||||
|
||||
b.Property<DateTime?>("DisciplinaryDateEnd")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่สิ้นสุดการสอบสวน");
|
||||
|
||||
b.Property<DateTime?>("DisciplinaryDateEvident")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่สรุปพยานหลักฐาน");
|
||||
|
||||
b.Property<DateTime?>("DisciplinaryDateInvestigation")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่มีคำสั่งให้สอบสวน");
|
||||
|
||||
b.Property<DateTime?>("DisciplinaryDateResult")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่รายงานผลการสอบสวน");
|
||||
|
||||
b.Property<DateTime?>("DisciplinaryDateStart")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่เริ่มการสอบสวน");
|
||||
|
||||
b.Property<int?>("DisciplinaryDaysExtend")
|
||||
.HasColumnType("int")
|
||||
.HasComment("จำนวนวันที่ขยาย");
|
||||
|
||||
b.Property<string>("DisciplinaryFaultLevel")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก");
|
||||
|
|
@ -525,6 +549,14 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("อ้างอิงมาตราตามกฎหมาย");
|
||||
|
||||
b.Property<string>("DisciplinaryResult")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผลการสอบสวน เหตุผล");
|
||||
|
||||
b.Property<string>("DisciplinaryStatusResult")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผลการสอบสวน ผล");
|
||||
|
||||
b.Property<string>("DisciplinarySummaryEvidence")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา");
|
||||
|
|
@ -610,6 +642,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("ผลการตรวจสอบเรื่องร้องเรียน");
|
||||
|
||||
b.Property<string>("ResultDescription")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สรุปผลการพิจารณา");
|
||||
|
||||
b.Property<string>("ResultInvestigate")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผลการตรวจสอบเรื่องสืบสวน");
|
||||
|
|
@ -1003,6 +1039,68 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
b.ToTable("DisciplineDisciplinary_DocRecordAccusers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRelevant", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<Guid>("DisciplineDisciplinaryId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("DocumentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineDisciplinaryId");
|
||||
|
||||
b.HasIndex("DocumentId");
|
||||
|
||||
b.ToTable("DisciplineDisciplinary_DocRelevants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -2052,6 +2150,14 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
b.Property<DateTime?>("DateStart")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime?>("DutyTimeEffectiveDate")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่รอบการลงเวลามีผล");
|
||||
|
||||
b.Property<Guid?>("DutyTimeId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("รอบการลงเวลาเข้างาน");
|
||||
|
||||
b.Property<string>("EmployeeClass")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("varchar(20)")
|
||||
|
|
@ -9836,6 +9942,25 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
b.Navigation("Document");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocRelevant", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary")
|
||||
.WithMany("DisciplineDisciplinary_DocRelevants")
|
||||
.HasForeignKey("DisciplineDisciplinaryId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document")
|
||||
.WithMany()
|
||||
.HasForeignKey("DocumentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineDisciplinary");
|
||||
|
||||
b.Navigation("Document");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DocSummaryEvidence", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary")
|
||||
|
|
@ -10786,6 +10911,8 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
|
||||
b.Navigation("DisciplineDisciplinary_DocRecordAccusers");
|
||||
|
||||
b.Navigation("DisciplineDisciplinary_DocRelevants");
|
||||
|
||||
b.Navigation("DisciplineDisciplinary_DocSummaryEvidences");
|
||||
|
||||
b.Navigation("DisciplineDisciplinary_DocWitnessess");
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ namespace BMA.EHR.Infrastructure.Persistence
|
|||
public DbSet<DisciplineDisciplinary_DocRecordAccuser> DisciplineDisciplinary_DocRecordAccusers { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocWitnesses> DisciplineDisciplinary_DocWitnessess { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocOther> DisciplineDisciplinary_DocOthers { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocRelevant> DisciplineDisciplinary_DocRelevants { get; set; }
|
||||
public DbSet<Document> Documents { get; set; }
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue