Merge branch 'develop' into working
This commit is contained in:
commit
72f64728bb
24 changed files with 31960 additions and 429 deletions
|
|
@ -41,36 +41,6 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||
|
||||
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||
public static string TextOffenseDetails(string value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case "NOT_SPECIFIED": return "ยังไม่ระบุ";
|
||||
case "NOT_DEADLY": return "ร้ายแรง";
|
||||
case "DEADLY": return "ไม่ร้ายแรง";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
public static string TextLevelConsideration(string value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case "NORMAL": return "ปกติ";
|
||||
case "URGENT": return "ด่วน";
|
||||
case "VERT_URGENT": return "ด่วนมาก";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
public static string TextStatus(string value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case "NEW": return "ใหม่";
|
||||
case "STOP": return "ยุติเรื่อง";
|
||||
case "SEND_INVESTIGATE": return "มีมูลส่งไปสืบสวนแล้ว";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
@ -87,28 +57,21 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
{
|
||||
var data_search = (from x in _context.DisciplineComplaints
|
||||
where x.Title.Contains(keyword) ||
|
||||
x.Description.Contains(keyword) ||
|
||||
x.Appellant.Contains(keyword)
|
||||
// TextOffenseDetails(x.OffenseDetails).Contains(keyword) ||
|
||||
// x.CreatedAt.Contains(keyword) ||
|
||||
// TextLevelConsideration(x.LevelConsideration).Contains(keyword) ||
|
||||
// x.DateConsideration.Contains(keyword) ||
|
||||
// TextStatus(x.Status).Contains(keyword) ||
|
||||
// x.RejectReason == null ? false : x.RejectReason.Contains(keyword)
|
||||
select x).ToList();
|
||||
var data = data_search
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,//id ข้อมูลเรื่องร้องเรียน
|
||||
Title = x.Title,//ชื่อเรื่อง
|
||||
Description = x.Description,//รายละเอียด
|
||||
RespondentType = x.RespondentType,
|
||||
Appellant = x.Appellant,//ผู้ถูกร้องเรียน
|
||||
OffenseDetails = x.OffenseDetails,//ลักษณะความผิด
|
||||
CreatedAt = x.CreatedAt,//วันที่สร้างเรื่องร้องเรียน
|
||||
LevelConsideration = x.LevelConsideration,//ระดับการพิจารณา
|
||||
DateConsideration = x.DateConsideration,//วันที่กำหนดพิจารณา
|
||||
Status = x.Status,//สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)
|
||||
RejectReason = x.RejectReason,//หมายเหตุยุติเรื่อง
|
||||
Result = x.Result,
|
||||
})
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Skip((page - 1) * pageSize)
|
||||
|
|
@ -160,7 +123,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
ComplaintFrom = x.ComplaintFrom,//รับเรื่องร้องเรียนจาก
|
||||
Appellant = x.Appellant,//ผู้ถูกร้องเรียน
|
||||
Status = x.Status,//สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)
|
||||
RejectReason = x.RejectReason,//หมายเหตุยุติเรื่อง
|
||||
Result = x.Result,
|
||||
DisciplineComplaintDocs = x.DisciplineComplaint_Docs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
})
|
||||
.Where(x => x.Id == id)
|
||||
|
|
@ -196,7 +159,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
_data.ComplaintFrom,
|
||||
_data.Appellant,
|
||||
_data.Status,
|
||||
_data.RejectReason,
|
||||
_data.Result,
|
||||
disciplineComplaintDocs,
|
||||
};
|
||||
return Success(data);
|
||||
|
|
@ -227,6 +190,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
DateNotification = req.dateNotification,
|
||||
ComplaintFrom = req.complaintFrom,
|
||||
Appellant = req.appellant,
|
||||
Result = req.result,
|
||||
Status = "NEW",
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
|
|
@ -293,6 +257,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
data.DateNotification = req.dateNotification;
|
||||
data.ComplaintFrom = req.complaintFrom;
|
||||
data.Appellant = req.appellant;
|
||||
data.Result = req.result;
|
||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
data.LastUpdateUserId = UserId ?? "";
|
||||
data.LastUpdatedAt = DateTime.Now;
|
||||
|
|
@ -361,8 +326,8 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("reject/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> RejectDisciplineComplaint([FromBody] DisciplineReasonRequest req, Guid id)
|
||||
[HttpGet("reject/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> RejectDisciplineComplaint(Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineComplaints
|
||||
.Where(x => x.Id == id)
|
||||
|
|
@ -372,7 +337,6 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
data.Status = "STOP";
|
||||
data.RejectReason = req.reason;
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
@ -386,10 +350,14 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("approve/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> ApproveDisciplineComplaint(Guid id)
|
||||
[HttpPut("approve/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> ApproveDisciplineComplaint([FromBody] DisciplinePersonIdRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineComplaints
|
||||
.Include(x => x.DisciplineComplaint_Profiles)
|
||||
.Include(x => x.DisciplineComplaint_Docs)
|
||||
.ThenInclude(x => x.Document)
|
||||
.Include(x => x.DisciplineInvestigates)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
|
|
@ -398,8 +366,72 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
return Error(new Exception("ไม่สามารถส่งต่อไปสืบสวนได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
data.Status = "SEND_INVESTIGATE";
|
||||
|
||||
var disciplineInvestigate = new Domain.Models.Discipline.DisciplineInvestigate
|
||||
{
|
||||
RespondentType = data.RespondentType.Trim().ToUpper(),
|
||||
Organization = data.Organization,
|
||||
ConsideredAgency = data.ConsideredAgency,
|
||||
Title = data.Title,
|
||||
Description = data.Description,
|
||||
DateReceived = data.DateReceived,
|
||||
LevelConsideration = data.LevelConsideration.Trim().ToUpper(),
|
||||
DateConsideration = data.DateConsideration,
|
||||
OffenseDetails = data.OffenseDetails.Trim().ToUpper(),
|
||||
DateNotification = data.DateNotification,
|
||||
ComplaintFrom = data.ComplaintFrom,
|
||||
Appellant = data.Appellant,
|
||||
ResultComplaint = data.Result,
|
||||
InvestigationStatusResult = "NOT_SPECIFIED",
|
||||
Status = "NEW",
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
var persons = data.DisciplineComplaint_Profiles.Where(x => req.persons.Contains(x.Id)).ToList();
|
||||
foreach (var item in persons)
|
||||
{
|
||||
disciplineInvestigate.DisciplineInvestigate_Profiles.Add(
|
||||
new DisciplineInvestigate_Profile
|
||||
{
|
||||
PersonId = item.PersonId,
|
||||
CitizenId = item.CitizenId,
|
||||
Prefix = item.Prefix,
|
||||
FirstName = item.FirstName,
|
||||
LastName = item.LastName,
|
||||
Organization = item.Organization,
|
||||
Salary = item.Salary,
|
||||
PosNo = item.PosNo,
|
||||
Position = item.Position,
|
||||
PositionLevel = item.PositionLevel,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
foreach (var item in data.DisciplineComplaint_Docs)
|
||||
{
|
||||
disciplineInvestigate.DisciplineInvestigate_DocComplaints.Add(
|
||||
new DisciplineInvestigate_DocComplaint
|
||||
{
|
||||
Document = item.Document,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
|
||||
data.DisciplineInvestigates.Add(disciplineInvestigate);
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
return Success(disciplineInvestigate.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -421,7 +453,6 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
if (data.Status.Trim().ToUpper() != "STOP")
|
||||
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), (int)StatusCodes.Status500InternalServerError);
|
||||
data.Status = "NEW";
|
||||
data.RejectReason = null;
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
@ -505,69 +536,5 @@ namespace BMA.EHR.DisciplineComplaint.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("send/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> SendDisciplineComplaint([FromBody] DisciplineComplaintPersonIdRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineComplaints.Include(x => x.DisciplineComplaint_Profiles).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);
|
||||
|
||||
// data.RespondentType = req.respondentType.Trim().ToUpper();
|
||||
// data.Organization = req.organizationId;
|
||||
// data.ConsideredAgency = req.consideredAgency;
|
||||
// data.Title = req.title;
|
||||
// data.Description = req.description;
|
||||
// data.DateReceived = req.dateReceived;
|
||||
// data.LevelConsideration = req.levelConsideration.Trim().ToUpper();
|
||||
// data.DateConsideration = req.dateConsideration;
|
||||
// data.OffenseDetails = req.offenseDetails.Trim().ToUpper();
|
||||
// data.DateNotification = req.dateNotification;
|
||||
// data.ComplaintFrom = req.complaintFrom;
|
||||
// data.Appellant = req.appellant;
|
||||
// data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
// data.LastUpdateUserId = UserId ?? "";
|
||||
// data.LastUpdatedAt = DateTime.Now;
|
||||
// _context.DisciplineComplaint_Profiles.RemoveRange(data.DisciplineComplaint_Profiles);
|
||||
// if (data.RespondentType.Trim().ToUpper() == "PERSON")
|
||||
// {
|
||||
// foreach (var item in req.persons)
|
||||
// {
|
||||
// data.DisciplineComplaint_Profiles.Add(
|
||||
// new DisciplineComplaint_Profile
|
||||
// {
|
||||
// CitizenId = item.idcard,
|
||||
// Prefix = item.prefix,
|
||||
// FirstName = item.firstName,
|
||||
// LastName = item.lastName,
|
||||
// Organization = item.organization,
|
||||
// Position = item.position,
|
||||
// PositionLevel = item.positionLevel,
|
||||
// Salary = item.salary,
|
||||
// PersonId = item.personId,
|
||||
// PosNo = item.posNo,
|
||||
// CreatedFullName = FullName ?? "System Administrator",
|
||||
// CreatedUserId = UserId ?? "",
|
||||
// CreatedAt = DateTime.Now,
|
||||
// LastUpdateFullName = FullName ?? "System Administrator",
|
||||
// LastUpdateUserId = UserId ?? "",
|
||||
// LastUpdatedAt = DateTime.Now,
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
await _context.SaveChangesAsync();
|
||||
return Success(data.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,696 @@
|
|||
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.DisciplineInvestigate.Service.Controllers
|
||||
{
|
||||
[Route("api/v{version:apiVersion}/discipline/investigate")]
|
||||
[ApiVersion("1.0")]
|
||||
[ApiController]
|
||||
[Produces("application/json")]
|
||||
[Authorize]
|
||||
[SwaggerTag("ระบบวินัยเรื่องสืบสวน")]
|
||||
public class DisciplineInvestigateController : BaseController
|
||||
{
|
||||
private readonly DisciplineDbContext _context;
|
||||
private readonly MinIODisciplineService _documentService;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
public DisciplineInvestigateController(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>> GetDisciplineInvestigate(int page = 1, int pageSize = 25, string keyword = "")
|
||||
{
|
||||
var data_search = (from x in _context.DisciplineInvestigates
|
||||
where x.Title.Contains(keyword)
|
||||
// x.Description.Contains(keyword) ||
|
||||
// x.Appellant.Contains(keyword)
|
||||
// TextOffenseDetails(x.OffenseDetails).Contains(keyword) ||
|
||||
// x.CreatedAt.Contains(keyword) ||
|
||||
// TextLevelConsideration(x.LevelConsideration).Contains(keyword) ||
|
||||
// x.DateConsideration.Contains(keyword) ||
|
||||
// TextStatus(x.Status).Contains(keyword) ||
|
||||
// x.RejectReason == null ? false : x.RejectReason.Contains(keyword)
|
||||
select x).ToList();
|
||||
var data = data_search
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,//id ข้อมูลเรื่องสืบสวน
|
||||
Title = x.Title,//ชื่อเรื่อง
|
||||
RespondentType = x.RespondentType,
|
||||
OffenseDetails = x.OffenseDetails,//ลักษณะความผิด
|
||||
Status = x.Status,//สถานะหรือผลการสืบสวน
|
||||
InvestigationDateStart = x.InvestigationDateStart,
|
||||
InvestigationDateEnd = x.InvestigationDateEnd,
|
||||
CreatedAt = x.CreatedAt,//วันที่สร้างเรื่องสืบสวน
|
||||
InvestigationDetail = x.InvestigationDetail,
|
||||
InvestigationStatusResult = x.InvestigationStatusResult,
|
||||
})
|
||||
.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("complaint/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetByDisciplineInvestigateComplaint(Guid id)
|
||||
{
|
||||
var _data = await _context.DisciplineInvestigates
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,//id ข้อมูลเรื่องสืบสวน
|
||||
IdComplaint = x.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน
|
||||
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
|
||||
Persons = x.DisciplineInvestigate_Profiles.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 เป็นหน่วยงาน
|
||||
ConsideredAgency = x.ConsideredAgency,//หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง
|
||||
Title = x.Title,//ชื่อเรื่อง
|
||||
Description = x.Description,//รายละเอียด
|
||||
DateReceived = x.DateReceived,//วันที่รับเรื่อง
|
||||
LevelConsideration = x.LevelConsideration,//ระดับการพัฒนา
|
||||
DateConsideration = x.DateConsideration,//วันที่กำหนดพิจารณา
|
||||
OffenseDetails = x.OffenseDetails,//ลักษณะความผิด
|
||||
DateNotification = x.DateNotification,//วันแจ้งเตือนล่วงหน้า
|
||||
ComplaintFrom = x.ComplaintFrom,//รับเรื่องสืบสวนจาก
|
||||
Appellant = x.Appellant,//ผู้ถูกสืบสวน
|
||||
Result = x.ResultComplaint,//ผลการตรวจสอบ
|
||||
Status = x.Status,//สถานะเรื่องสืบสวน
|
||||
DisciplineInvestigateDocComplaints = x.DisciplineInvestigate_DocComplaints.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
})
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (_data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
|
||||
var disciplineInvestigateDocComplaints = new List<dynamic>();
|
||||
foreach (var doc in _data.DisciplineInvestigateDocComplaints)
|
||||
{
|
||||
var _doc = new
|
||||
{
|
||||
doc.Id,
|
||||
doc.FileName,
|
||||
PathName = await _documentService.ImagesPath(doc.Id)
|
||||
};
|
||||
disciplineInvestigateDocComplaints.Add(_doc);
|
||||
}
|
||||
var data = new
|
||||
{
|
||||
_data.Id,
|
||||
_data.IdComplaint,
|
||||
_data.RespondentType,
|
||||
_data.Persons,
|
||||
_data.OrganizationId,
|
||||
_data.ConsideredAgency,
|
||||
_data.Title,
|
||||
_data.Description,
|
||||
_data.DateReceived,
|
||||
_data.LevelConsideration,
|
||||
_data.DateConsideration,
|
||||
_data.OffenseDetails,
|
||||
_data.DateNotification,
|
||||
_data.ComplaintFrom,
|
||||
_data.Appellant,
|
||||
_data.Result,
|
||||
_data.Status,
|
||||
disciplineInvestigateDocComplaints,
|
||||
};
|
||||
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("complaint/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdateDisciplineInvestigate([FromBody] DisciplineInvestigateComplaintRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates.Include(x => x.DisciplineInvestigate_Profiles).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);
|
||||
|
||||
data.Title = req.title;
|
||||
data.Description = req.description;
|
||||
data.OffenseDetails = req.offenseDetails.Trim().ToUpper();
|
||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
data.LastUpdateUserId = UserId ?? "";
|
||||
data.LastUpdatedAt = DateTime.Now;
|
||||
_context.DisciplineInvestigate_Profiles.RemoveRange(data.DisciplineInvestigate_Profiles);
|
||||
if (data.RespondentType.Trim().ToUpper() == "PERSON")
|
||||
{
|
||||
foreach (var item in req.persons)
|
||||
{
|
||||
data.DisciplineInvestigate_Profiles.Add(
|
||||
new DisciplineInvestigate_Profile
|
||||
{
|
||||
CitizenId = item.idcard,
|
||||
Prefix = item.prefix,
|
||||
FirstName = item.firstName,
|
||||
LastName = item.lastName,
|
||||
Organization = item.organization,
|
||||
Position = item.position,
|
||||
PositionLevel = item.positionLevel,
|
||||
Salary = item.salary,
|
||||
PersonId = item.personId,
|
||||
PosNo = item.posNo,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success(data.Id);
|
||||
}
|
||||
|
||||
/// <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>> GetByDisciplineInvestigate(Guid id)
|
||||
{
|
||||
var _data = await _context.DisciplineInvestigates
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,//id ข้อมูลเรื่องสืบสวน
|
||||
IdComplaint = x.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน
|
||||
InvestigationDetail = x.InvestigationDetail,
|
||||
InvestigationDetailOther = x.InvestigationDetailOther,
|
||||
InvestigationDateStart = x.InvestigationDateStart,
|
||||
InvestigationDateEnd = x.InvestigationDateEnd,
|
||||
InvestigationDescription = x.InvestigationDescription,
|
||||
InvestigationStatusResult = x.InvestigationStatusResult,
|
||||
InvestigationCauseText = x.InvestigationCauseText,
|
||||
Status = x.Status,//สถานะเรื่องสืบสวน
|
||||
Result = x.Result,//ผลการตรวจสอบ
|
||||
Director = x.DisciplineInvestigate_Directors.Select(d => new
|
||||
{
|
||||
Id = d.Id,
|
||||
DirectorId = d.DisciplineDirector.Id,
|
||||
Prefix = d.DisciplineDirector.Prefix,
|
||||
FirstName = d.DisciplineDirector.FirstName,
|
||||
LastName = d.DisciplineDirector.LastName,
|
||||
Position = d.DisciplineDirector.Position,
|
||||
Email = d.DisciplineDirector.Email,
|
||||
Duty = "",
|
||||
Phone = d.DisciplineDirector.Phone,
|
||||
Total = d.DisciplineDirector.DisciplineInvestigate_Directors.Count(),
|
||||
}).ToList(),
|
||||
DisciplineInvestigateDocs = x.DisciplineInvestigate_Docs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
DisciplineInvestigateRelevantDocs = x.DisciplineInvestigateRelevant_Docs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
})
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (_data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
|
||||
var disciplineInvestigateDocs = new List<dynamic>();
|
||||
foreach (var doc in _data.DisciplineInvestigateDocs)
|
||||
{
|
||||
var _doc = new
|
||||
{
|
||||
doc.Id,
|
||||
doc.FileName,
|
||||
PathName = await _documentService.ImagesPath(doc.Id)
|
||||
};
|
||||
disciplineInvestigateDocs.Add(_doc);
|
||||
}
|
||||
|
||||
var disciplineInvestigateRelevantDocs = new List<dynamic>();
|
||||
foreach (var doc in _data.DisciplineInvestigateRelevantDocs)
|
||||
{
|
||||
var _doc = new
|
||||
{
|
||||
doc.Id,
|
||||
doc.FileName,
|
||||
PathName = await _documentService.ImagesPath(doc.Id)
|
||||
};
|
||||
disciplineInvestigateRelevantDocs.Add(_doc);
|
||||
}
|
||||
var data = new
|
||||
{
|
||||
_data.Id,
|
||||
_data.IdComplaint,
|
||||
_data.InvestigationDetail,
|
||||
_data.InvestigationDetailOther,
|
||||
_data.InvestigationDateStart,
|
||||
_data.InvestigationDateEnd,
|
||||
_data.InvestigationDescription,
|
||||
_data.InvestigationStatusResult,
|
||||
_data.InvestigationCauseText,
|
||||
_data.Status,
|
||||
_data.Result,
|
||||
_data.Director,
|
||||
disciplineInvestigateDocs,
|
||||
disciplineInvestigateRelevantDocs,
|
||||
};
|
||||
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>> UpdateDisciplineInvestigate([FromBody] DisciplineInvestigateRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.Include(x => x.DisciplineInvestigate_Directors)
|
||||
.ThenInclude(x => x.DisciplineDirector)
|
||||
.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);
|
||||
|
||||
data.InvestigationDetail = req.investigationDetail.Trim().ToUpper();
|
||||
data.InvestigationDetailOther = req.investigationDetailOther;
|
||||
data.InvestigationDateStart = req.investigationDateStart;
|
||||
data.InvestigationDateEnd = req.investigationDateEnd;
|
||||
data.InvestigationDescription = req.investigationDescription;
|
||||
data.InvestigationStatusResult = req.investigationStatusResult.Trim().ToUpper();
|
||||
data.InvestigationCauseText = req.investigationCauseText.Trim().ToUpper();
|
||||
data.Result = req.result;
|
||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
data.LastUpdateUserId = UserId ?? "";
|
||||
data.LastUpdatedAt = DateTime.Now;
|
||||
_context.DisciplineInvestigate_Directors.RemoveRange(data.DisciplineInvestigate_Directors);
|
||||
foreach (var item in req.directors)
|
||||
{
|
||||
var director = await _context.DisciplineDirectors.AsQueryable()
|
||||
.FirstOrDefaultAsync(x => x.Id == item);
|
||||
if (director != null)
|
||||
{
|
||||
data.DisciplineInvestigate_Directors.Add(
|
||||
new DisciplineInvestigate_Director
|
||||
{
|
||||
DisciplineDirector = director,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success(data.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ยุติเรื่อง
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("reject/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> RejectDisciplineInvestigate(Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.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 (data.InvestigationStatusResult == null || data.InvestigationStatusResult.Trim().ToUpper() != "NO_CAUSE")
|
||||
return Error(new Exception("ไม่สามารถยุติเรื่องได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
data.Status = "STOP";
|
||||
|
||||
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>
|
||||
[HttpGet("approve/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> ApproveDisciplineInvestigate(Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.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);
|
||||
data.Status = "SEND_INVESTIGATE";
|
||||
|
||||
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>
|
||||
[HttpGet("resume/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> ResumeDisciplineInvestigate(Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "STOP")
|
||||
return Error(new Exception("รายการนี้ยังไม่ถูกยุติเรื่อง"), (int)StatusCodes.Status500InternalServerError);
|
||||
data.Status = "NEW";
|
||||
|
||||
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>
|
||||
[HttpPut("file/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> UploadFileDisciplineInvestigate([FromForm] DisciplineFileRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.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 disciplineInvestigate_Doc = new DisciplineInvestigate_Doc
|
||||
{
|
||||
DisciplineInvestigate = data,
|
||||
Document = _doc,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
await _context.DisciplineInvestigate_Docs.AddAsync(disciplineInvestigate_Doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
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("file/{id:guid}/{docId:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> DeleteFileDisciplineInvestigate(Guid id, Guid docId)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.Include(x => x.DisciplineInvestigate_Docs)
|
||||
.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.DisciplineInvestigate_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||
if (dataDoc != null)
|
||||
{
|
||||
_context.DisciplineInvestigate_Docs.Remove(dataDoc);
|
||||
await _context.SaveChangesAsync();
|
||||
await _documentService.DeleteFileAsync(docId);
|
||||
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>
|
||||
[HttpPut("complaint/file/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> UploadFileDisciplineInvestigateComplaint([FromForm] DisciplineFileRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.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 disciplineInvestigate_DocComplaint = new DisciplineInvestigate_DocComplaint
|
||||
{
|
||||
DisciplineInvestigate = data,
|
||||
Document = _doc,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
await _context.DisciplineInvestigate_DocComplaints.AddAsync(disciplineInvestigate_DocComplaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
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("complaint/file/{id:guid}/{docId:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> DeleteFileDisciplineInvestigateComplaint(Guid id, Guid docId)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.Include(x => x.DisciplineInvestigate_DocComplaints)
|
||||
.ThenInclude(x => x.Document)
|
||||
.Include(x => x.DisciplineComplaint)
|
||||
.ThenInclude(x => x.DisciplineComplaint_Docs)
|
||||
.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.DisciplineInvestigate_DocComplaints.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||
if (dataDoc != null)
|
||||
{
|
||||
_context.DisciplineInvestigate_DocComplaints.Remove(dataDoc);
|
||||
await _context.SaveChangesAsync();
|
||||
var dataDocComplaint = data.DisciplineComplaint.DisciplineComplaint_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||
if (dataDocComplaint == null)
|
||||
{
|
||||
await _documentService.DeleteFileAsync(docId);
|
||||
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>
|
||||
[HttpPut("relevant/file/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> UploadFileDisciplineInvestigateRelevant([FromForm] DisciplineFileRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.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 disciplineInvestigateRelevant_Doc = new DisciplineInvestigateRelevant_Doc
|
||||
{
|
||||
DisciplineInvestigate = data,
|
||||
Document = _doc,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
await _context.DisciplineInvestigateRelevant_Docs.AddAsync(disciplineInvestigateRelevant_Doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
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>> DeleteFileDisciplineInvestigateRelevant(Guid id, Guid docId)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.Include(x => x.DisciplineInvestigateRelevant_Docs)
|
||||
.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.DisciplineInvestigateRelevant_Docs.Where(x => x.Document.Id == docId).FirstOrDefault();
|
||||
if (dataDoc != null)
|
||||
{
|
||||
_context.DisciplineInvestigateRelevant_Docs.Remove(dataDoc);
|
||||
await _context.SaveChangesAsync();
|
||||
await _documentService.DeleteFileAsync(docId);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Discipline.Service.Requests
|
||||
{
|
||||
public class DisciplineComplaintPersonIdRequest
|
||||
{
|
||||
public Guid[] personId { get; set; }// id บุคคลผู้ถูกร้องเรียน
|
||||
}
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ namespace BMA.EHR.Discipline.Service.Requests
|
|||
public DateTime dateNotification { get; set; }//*วันแจ้งเตือนล่วงหน้า
|
||||
public string complaintFrom { get; set; }//*รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)
|
||||
public string appellant { get; set; }//*ผู้ร้องเรียน
|
||||
public string result { get; set; }
|
||||
// public FormFile documentFile { get; set; }//*ไฟล์เอกสารหลักฐาน
|
||||
}
|
||||
public class DisciplineComplaintProfileRequest
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Discipline.Service.Requests
|
||||
{
|
||||
public class DisciplineInvestigateComplaintRequest
|
||||
{
|
||||
public DisciplineComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null
|
||||
public string title { get; set; }// *เรื่องที่ร้องเรียน
|
||||
public string description { get; set; }// *รายละเอียดของเรื่องร้องเรียน
|
||||
public string offenseDetails { get; set; }// *ลักษณะความผิดครั้งแรกจะเป็น "ยังไม่ระบุ" (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)
|
||||
}
|
||||
public class DisciplineInvestigateComplaintProfileRequest
|
||||
{
|
||||
public Guid? personId { get; set; }
|
||||
public string? idcard { get; set; }
|
||||
public string? prefix { get; set; }
|
||||
public string? firstName { get; set; }
|
||||
public string? lastName { get; set; }
|
||||
public string? organization { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? positionLevel { get; set; }
|
||||
public string? posNo { get; set; }
|
||||
public double? salary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Discipline.Service.Requests
|
||||
{
|
||||
public class DisciplineInvestigateRequest
|
||||
{
|
||||
public string investigationDetail { get; set; }
|
||||
public string investigationDetailOther { get; set; }
|
||||
public DateTime investigationDateStart { get; set; }
|
||||
public DateTime investigationDateEnd { get; set; }
|
||||
public string investigationDescription { get; set; }
|
||||
public string investigationStatusResult { get; set; }
|
||||
public string investigationCauseText { get; set; }
|
||||
public string result { get; set; }
|
||||
public Guid[] directors { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Discipline.Service.Requests
|
||||
{
|
||||
public class DisciplinePersonIdRequest
|
||||
{
|
||||
public Guid[] persons { get; set; }// id บุคคลผู้ถูกร้องเรียน
|
||||
}
|
||||
}
|
||||
|
|
@ -41,8 +41,8 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
// [Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
// public Document Document { get; set; }
|
||||
|
||||
[Comment("เหตุผลยุติเรื่อง")]
|
||||
public string? RejectReason { get; set; }
|
||||
[Comment("ผลการตรวจสอบ")]
|
||||
public string? Result { get; set; }
|
||||
|
||||
[Comment("กรณีหน่วยงานใส่ id ของหน่วยงาน")]
|
||||
public Guid? Organization { get; set; }
|
||||
|
|
@ -51,5 +51,6 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
public Guid ConsideredAgency { get; set; }
|
||||
public virtual List<DisciplineComplaint_Profile> DisciplineComplaint_Profiles { get; set; } = new List<DisciplineComplaint_Profile>();
|
||||
public virtual List<DisciplineComplaint_Doc> DisciplineComplaint_Docs { get; set; } = new List<DisciplineComplaint_Doc>();
|
||||
public virtual List<DisciplineInvestigate> DisciplineInvestigates { get; set; } = new List<DisciplineInvestigate>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,324 +13,22 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
public Guid? PersonId { get; set; }
|
||||
[MaxLength(13), Comment("รหัสบัตรประชาชน")]
|
||||
public string? CitizenId { get; set; }
|
||||
// [MaxLength(50)]
|
||||
// public string? ProfileType { get; set; }
|
||||
// [MaxLength(20), Comment("ประเภทการจ้าง")]
|
||||
// public string? EmployeeType { get; set; }
|
||||
// [MaxLength(20), Comment("ประเภทลูกจ้าง")]
|
||||
// public string? EmployeeClass { get; set; }
|
||||
[Comment("คำนำหน้า")]
|
||||
public string? Prefix { get; set; }
|
||||
[Required, MaxLength(100), Comment("ชื่อ")]
|
||||
public string? FirstName { get; set; }
|
||||
[Required, MaxLength(100), Comment("นามสกุล")]
|
||||
public string? LastName { get; set; }
|
||||
// [Comment("Id คำนำหน้า(เดิม)")]
|
||||
// public Guid? PrefixOldId { get; set; }
|
||||
// [Required, MaxLength(100), Comment("ชื่อ(เดิม)")]
|
||||
// public string? FirstNameOld { get; set; }
|
||||
// [Required, MaxLength(100), Comment("นามสกุล(เดิม)")]
|
||||
// public string? LastNameOld { get; set; }
|
||||
// [MaxLength(100)]
|
||||
// public string AvatarRef { get; set; }
|
||||
// [Comment("Id เพศ")]
|
||||
// public Gender? Gender { get; set; }
|
||||
// [MaxLength(100), Comment("สัญชาติ")]
|
||||
// public string? Nationality { get; set; }
|
||||
// [MaxLength(100), Comment("เชื้อชาติ")]
|
||||
// public string? Race { get; set; }
|
||||
// [Comment("Id ศาสนา")]
|
||||
// public Guid? ReligionId { get; set; }
|
||||
// [Required, Comment("วันเกิด")]
|
||||
// public DateTime BirthDate { get; set; }
|
||||
// [Comment("Id กลุ่มเลือด")]
|
||||
// public Guid? BloodGroupId { get; set; }
|
||||
// [Comment("Id สถานะภาพ")]
|
||||
// public Guid? RelationshipId { get; set; }
|
||||
// [MaxLength(50), Comment("เบอร์โทร")]
|
||||
// public string? TelephoneNumber { get; set; }
|
||||
// [Comment("คู่สมรส")]
|
||||
// public bool? Couple { get; set; }
|
||||
// [Comment("Id คำนำหน้าคู่สมรส")]
|
||||
// public Guid? CouplePrefixId { get; set; }
|
||||
// [MaxLength(100), Comment("ชื่อคู่สมรส")]
|
||||
// public string? CoupleFirstName { get; set; }
|
||||
// [MaxLength(100), Comment("นามสกุลคู่สมรส")]
|
||||
// public string? CoupleLastName { get; set; }
|
||||
// [MaxLength(100), Comment("นามสกุลคู่สมรส(เดิม)")]
|
||||
// public string? CoupleLastNameOld { get; set; }
|
||||
// [MaxLength(100), Comment("อาชีพคู่สมรส")]
|
||||
// public string? CoupleCareer { get; set; }
|
||||
// [MaxLength(20), Comment("เลขที่บัตรประชาชนคู่สมรส")]
|
||||
// public string? CoupleCitizenId { get; set; }
|
||||
|
||||
// [Comment("มีชีวิตคู่สมรส")]
|
||||
// public bool CoupleLive { get; set; } = true;
|
||||
// [Comment("Id คำนำหน้าบิดา")]
|
||||
// public Guid? FatherPrefixId { get; set; }
|
||||
// [MaxLength(100), Comment("ชื่อบิดา")]
|
||||
// public string? FatherFirstName { get; set; }
|
||||
|
||||
// [MaxLength(100), Comment("นามสกุลบิดา")]
|
||||
// public string? FatherLastName { get; set; }
|
||||
|
||||
// [MaxLength(100), Comment("อาชีพบิดา")]
|
||||
// public string? FatherCareer { get; set; }
|
||||
// [MaxLength(20), Comment("เลขที่บัตรประชาชนบิดา")]
|
||||
// public string? FatherCitizenId { get; set; }
|
||||
|
||||
// [Comment("มีชีวิตบิดา")]
|
||||
// public bool FatherLive { get; set; } = true;
|
||||
// [Comment("Id คำนำหน้ามารดา")]
|
||||
// public Guid? MotherPrefixId { get; set; }
|
||||
|
||||
// [MaxLength(100), Comment("ชื่อมารดา")]
|
||||
// public string? MotherFirstName { get; set; }
|
||||
|
||||
// [MaxLength(100), Comment("นามสกุลมารดา")]
|
||||
// public string? MotherLastName { get; set; }
|
||||
|
||||
// [MaxLength(100), Comment("อาชีพมารดา")]
|
||||
// public string? MotherCareer { get; set; }
|
||||
// [MaxLength(20), Comment("เลขที่บัตรประชาชนมารดา")]
|
||||
// public string? MotherCitizenId { get; set; }
|
||||
|
||||
// [Comment("มีชีวิตมารดา")]
|
||||
// public bool MotherLive { get; set; } = true;
|
||||
// [MaxLength(200), Comment("ที่อยู่ปัจจุบัน")]
|
||||
// public string? CurrentAddress { get; set; }
|
||||
// [Comment("Id แขวงปัจจุบัน")]
|
||||
// public Guid? CurrentSubDistrictId { get; set; }
|
||||
// [Comment("Id เขตปัจจุบัน")]
|
||||
// public Guid? CurrentDistrictId { get; set; }
|
||||
// [Comment("Id จังหวัดปัจจุบัน")]
|
||||
// public Guid? CurrentProvinceId { get; set; }
|
||||
// [MaxLength(5), Comment("รหัสไปรษณีย์ปัจจุบัน")]
|
||||
// public string? CurrentZipCode { get; set; }
|
||||
// [Comment("ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้านหรือไม่")]
|
||||
// public bool? RegistrationSame { get; set; } = false;
|
||||
// [MaxLength(200), Comment("Id แขวงตามทะเบียนบ้าน")]
|
||||
// public string? RegistrationAddress { get; set; }
|
||||
// [Comment("แขวงตามทะเบียนบ้าน")]
|
||||
// public Guid? RegistrationSubDistrictId { get; set; }
|
||||
// [Comment("Id เขตตามทะเบียนบ้าน")]
|
||||
// public Guid? RegistrationDistrictId { get; set; }
|
||||
// [Comment("Id จังหวัดตามทะเบียนบ้าน")]
|
||||
// public Guid? RegistrationProvinceId { get; set; }
|
||||
// [MaxLength(5), Comment("รหัสไปรษณีย์ตามทะเบียนบ้าน")]
|
||||
// public string? RegistrationZipCode { get; set; }
|
||||
|
||||
// public DateTime? DateAppoint { get; set; }
|
||||
|
||||
// public DateTime? DateStart { get; set; }
|
||||
|
||||
// public DateTime? DateRetire { get; set; }
|
||||
|
||||
// public string? ReasonSameDate { get; set; }
|
||||
// // public Guid? AffiliationId { get; set; }
|
||||
// // public Guid? PositionId { get; set; }
|
||||
// // public Guid? WorkId { get; set; }
|
||||
// // public Guid? TypeId { get; set; }
|
||||
// // public Guid? LevelId { get; set; }
|
||||
// // public Guid? NumberId { get; set; }
|
||||
// // public Guid? BusinessId { get; set; }
|
||||
// [Comment("Id สังกัด")]
|
||||
// public Guid? OcId { get; set; }
|
||||
[Comment("สังกัด")]
|
||||
public string? Organization { get; set; }
|
||||
// public Guid? OrganizationShortNameId { get; set; }
|
||||
// public string? OrganizationShortName { get; set; }
|
||||
// public string? GovernmentCode { get; set; }
|
||||
// public Guid? OrganizationOrganizationId { get; set; }
|
||||
// public string? OrganizationOrganization { get; set; }
|
||||
[Comment("ตำแหน่ง")]
|
||||
public string? Position { get; set; }
|
||||
// [Comment("ตำแหน่ง")]
|
||||
// public string? Position { get; set; }
|
||||
[Comment("เลขที่ตำแหน่ง")]
|
||||
public string? PosNo { get; set; }
|
||||
// [Comment("เลขที่ตำแหน่ง")]
|
||||
// public string? PosNo { get; set; }
|
||||
// [Comment("เลขที่ตำแหน่งลูกจ้าง")]
|
||||
// public string? PosNoEmployee { get; set; }
|
||||
// [Comment("Id สายงาน")]
|
||||
// public Guid? PositionLineId { get; set; }
|
||||
// [Comment("สายงาน")]
|
||||
// public string? PositionLine { get; set; }
|
||||
// [Comment("Id ด้าน/สาขา")]
|
||||
// public Guid? PositionPathSideId { get; set; }
|
||||
// [Comment("ด้าน/สาขา")]
|
||||
// public string? PositionPathSide { get; set; }
|
||||
// // [Comment("Id ประเภทตำแหน่ง")]
|
||||
// // public Guid? PositionTypeId { get; set; }
|
||||
// [Comment("ประเภทตำแหน่ง")]
|
||||
// public PositionType? PositionType { get; set; }
|
||||
// // [Comment(" Id ระดับ")]
|
||||
// // public Guid? PositionLevelId { get; set; }
|
||||
[Comment("ระดับ")]
|
||||
public string? PositionLevel { get; set; }
|
||||
// [Comment("Id ตำแหน่งทางการบริหาร")]
|
||||
// public Guid? PositionExecutiveId { get; set; }
|
||||
// [Comment("ตำแหน่งทางการบริหาร")]
|
||||
// public string? PositionExecutive { get; set; }
|
||||
// [Comment("Id ด้านทางการบริหาร")]
|
||||
// public Guid? PositionExecutiveSideId { get; set; }
|
||||
// [Comment("ด้านทางการบริหาร")]
|
||||
// public string? PositionExecutiveSide { get; set; }
|
||||
|
||||
// [Comment("Id ตำแหน่ง")]
|
||||
// public PositionEmployeePosition? PositionEmployeePosition { get; set; }
|
||||
// // [Comment("ตำแหน่ง")]
|
||||
// // public string? PositionEmployeePosition { get; set; }
|
||||
// [Comment("Id ด้านของตำแหน่ง")]
|
||||
// public PositionEmployeePositionSide? PositionEmployeePositionSide { get; set; }
|
||||
// // [Comment("ด้านของตำแหน่ง")]
|
||||
// // public string? PositionEmployeePositionSide { get; set; }
|
||||
// [Comment(" Id ระดับชั้นงาน")]
|
||||
// public PositionEmployeeLevel? PositionEmployeeLevel { get; set; }
|
||||
// // [Comment("ระดับชั้นงาน")]
|
||||
// // public string? PositionEmployeeLevel { get; set; }
|
||||
// [Comment("Id กลุ่มงาน")]
|
||||
// public PositionEmployeeGroup? PositionEmployeeGroup { get; set; }
|
||||
// // [Comment("กลุ่มงาน")]
|
||||
// // public string? PositionEmployeeGroup { get; set; }
|
||||
// [Comment("Id สายงาน")]
|
||||
// public PositionEmployeeLine? PositionEmployeeLine { get; set; }
|
||||
// // [Comment("สายงาน")]
|
||||
// // public string? PositionEmployeeLine { get; set; }
|
||||
|
||||
// [MaxLength(100), Comment("สถานภาพทางกาย")]
|
||||
// public string Physical { get; set; }
|
||||
|
||||
// [MaxLength(100)]
|
||||
// public string Ability { get; set; }
|
||||
|
||||
// public bool IsActive { get; set; } = true;
|
||||
|
||||
// public bool IsLeave { get; set; } = false;
|
||||
|
||||
// public DateTime? LeaveDate { get; set; }
|
||||
|
||||
// [MaxLength(1000)]
|
||||
// public string? LeaveReason { get; set; }
|
||||
// public string? LeaveDetail { get; set; }
|
||||
// public string? LeaveNumberOrder { get; set; }
|
||||
// public DateTime? LeaveDateOrder { get; set; }
|
||||
|
||||
// public DateTime? CreatedDate { get; set; }
|
||||
|
||||
// public DateTime? ModifiedDate { get; set; }
|
||||
|
||||
// [MaxLength(250)]
|
||||
// public string CreatedUser { get; set; } = string.Empty;
|
||||
|
||||
// [MaxLength(5)]
|
||||
// public string EntryStatus { get; set; } = "st1"; // สถานะการตรวจสอบ st1 = create; st2 = pending
|
||||
|
||||
// public bool IsTransfer { get; set; } = false;
|
||||
|
||||
// public DateTime? TransferDate { get; set; }
|
||||
|
||||
// public int GovAgeAbsent { get; set; } = 0;
|
||||
|
||||
// public int GovAgePlus { get; set; } = 0;
|
||||
|
||||
// // public OrganizationEntity? Organization { get; set; }
|
||||
|
||||
// // public PositionNumberEntity PositionNumber { get; set; }
|
||||
|
||||
// // public Position Position { get; set; }
|
||||
|
||||
// // public PositionExecutive PositionExecutive { get; set; }
|
||||
|
||||
// public bool IsVerified { get; set; } = false;
|
||||
|
||||
// [MaxLength(100)]
|
||||
// public string VerifiedUser { get; set; } = string.Empty;
|
||||
|
||||
// public DateTime? VerifiedDate { get; set; }
|
||||
|
||||
// public Document? Avatar { get; set; }
|
||||
|
||||
// public bool IsProbation { get; set; } = true;
|
||||
|
||||
// // public PositionType PositionType { get; set; } // ประเภทตำแหน่ง
|
||||
|
||||
// // public PositionLevel PositionLevel { get; set; } // ระดับ
|
||||
|
||||
// // public OrganizationPositionEntity? OrganizationPosition { get; set; }
|
||||
// public LimitLeave? LimitLeave { get; set; }
|
||||
// public Guid? KeycloakId { get; set; }
|
||||
// [Comment("สังกัด")]
|
||||
// public string? EmployeeOc { get; set; }
|
||||
// [Comment("ค่าจ้าง")]
|
||||
// public double? EmployeeWage { get; set; }
|
||||
// [Comment("ประเภทบุคคล")]
|
||||
// public string? EmployeeTypeIndividual { get; set; }
|
||||
// [Comment("เงินเพิ่มการครองชีพชั่วคราว")]
|
||||
// public double? EmployeeMoneyIncrease { get; set; }
|
||||
// [Comment("เงินช่วยเหลือค่าครองชีพชั่วคราว")]
|
||||
// public double? EmployeeMoneyAllowance { get; set; }
|
||||
// [Comment("เงินสมทบประกันสังคม(ลูกจ้าง)")]
|
||||
// public double? EmployeeMoneyEmployee { get; set; }
|
||||
// [Comment("เงินสมทบประกันสังคม(นายจ้าง)")]
|
||||
// public double? EmployeeMoneyEmployer { get; set; }
|
||||
|
||||
// public virtual List<ProfileEducation> Educations { get; set; } = new List<ProfileEducation>();
|
||||
|
||||
// public virtual List<ProfileHonor> Honors { get; set; } = new List<ProfileHonor>();
|
||||
// public virtual List<ProfileAssessment> Assessments { get; set; } = new List<ProfileAssessment>();
|
||||
|
||||
// public virtual List<ProfileDiscipline> Disciplines { get; set; } = new List<ProfileDiscipline>();
|
||||
|
||||
// public virtual List<ProfileCertificate> Certificates { get; set; } = new List<ProfileCertificate>();
|
||||
|
||||
// public virtual List<ProfileTraining> Trainings { get; set; } = new List<ProfileTraining>();
|
||||
|
||||
// public virtual List<ProfileInsignia> Insignias { get; set; } = new List<ProfileInsignia>();
|
||||
|
||||
// public virtual List<ProfileSalary> Salaries { get; set; } = new List<ProfileSalary>();
|
||||
|
||||
// public virtual List<ProfileHistory> ProfileHistory { get; set; } = new List<ProfileHistory>();
|
||||
|
||||
// public virtual List<ProfileCoupleHistory> CoupleHistory { get; set; } = new List<ProfileCoupleHistory>();
|
||||
|
||||
// public virtual List<ProfileFatherHistory> FatherHistory { get; set; } = new List<ProfileFatherHistory>();
|
||||
|
||||
// public virtual List<ProfileMotherHistory> MotherHistory { get; set; } = new List<ProfileMotherHistory>();
|
||||
|
||||
// public virtual List<ProfileFamilyHistory> FamilyHistory { get; set; } = new List<ProfileFamilyHistory>();
|
||||
|
||||
// public virtual List<ProfileGovernmentHistory> GovernmentHistory { get; set; } = new List<ProfileGovernmentHistory>();
|
||||
|
||||
// public virtual List<ProfileLeave> Leaves { get; set; } = new List<ProfileLeave>();
|
||||
|
||||
// public virtual List<ProfileCurrentAddressHistory> CurrentAddressHistory { get; set; } = new List<ProfileCurrentAddressHistory>();
|
||||
|
||||
// public virtual List<ProfileRegistrationAddressHistory> RegistrationAddressHistory { get; set; } = new List<ProfileRegistrationAddressHistory>();
|
||||
|
||||
// public virtual List<ProfileAddressHistory> AddressHistory { get; set; } = new List<ProfileAddressHistory>();
|
||||
|
||||
// public virtual List<ProfileOther> Others { get; set; } = new List<ProfileOther>();
|
||||
|
||||
// public virtual List<ProfileAbility> Abilitys { get; set; } = new List<ProfileAbility>();
|
||||
|
||||
// public virtual List<ProfileDuty> Dutys { get; set; } = new List<ProfileDuty>();
|
||||
|
||||
// public virtual List<ProfileNopaid> Nopaids { get; set; } = new List<ProfileNopaid>();
|
||||
|
||||
// public virtual List<ProfileAvatarHistory> AvatarHistory { get; set; } = new List<ProfileAvatarHistory>();
|
||||
|
||||
// public virtual List<ProfilePaper> Papers { get; set; } = new List<ProfilePaper>();
|
||||
|
||||
// public virtual List<ProfileChildren> Childrens { get; set; } = new List<ProfileChildren>();
|
||||
// public virtual List<ProfileChangeName> ChangeNames { get; set; } = new List<ProfileChangeName>();
|
||||
// public virtual List<ProfileEmployment> Employments { get; set; } = new List<ProfileEmployment>();
|
||||
[Comment("เงินเดือน")]
|
||||
public double? Salary { get; set; }
|
||||
|
||||
// [Comment("Id ระดับการศึกษา")]
|
||||
// public EducationLevel? EducationLevel { get; set; }
|
||||
[Required, Comment("Id เรื่องร้องเรียน")]
|
||||
public DisciplineComplaint DisciplineComplaint { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,5 +24,6 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
|
||||
[Required, Comment("เบอร์โทรศัพท์")]
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public virtual List<DisciplineInvestigate_Director> DisciplineInvestigate_Directors { get; set; } = new List<DisciplineInvestigate_Director>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
84
BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs
Normal file
84
BMA.EHR.Domain/Models/Discipline/DisciplineInvestigate.cs
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
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 DisciplineInvestigate : EntityBase
|
||||
{
|
||||
|
||||
[Required, Comment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)")]
|
||||
public string Status { get; set; } = string.Empty;
|
||||
[Required, Comment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)")]
|
||||
public string RespondentType { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "text")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ")]
|
||||
public DateTime DateReceived { get; set; }
|
||||
[Required, Comment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")]
|
||||
public string LevelConsideration { get; set; } = string.Empty;
|
||||
|
||||
[Comment("วันที่กำหนดพิจารณา")]
|
||||
public DateTime? DateConsideration { get; set; }
|
||||
[Required, Comment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")]
|
||||
public string OffenseDetails { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("วันแจ้งเตือนล่วงหน้า")]
|
||||
public DateTime DateNotification { get; set; }
|
||||
[Required, Comment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")]
|
||||
public string ComplaintFrom { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("ผู้ร้องเรียน")]
|
||||
public string Appellant { get; set; } = string.Empty;
|
||||
|
||||
// [Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
// public Document Document { get; set; }
|
||||
|
||||
[Comment("ผลการตรวจสอบเรื่องร้องเรียน")]
|
||||
public string? ResultComplaint { get; set; }
|
||||
|
||||
[Comment("ผลการตรวจสอบ")]
|
||||
public string? Result { get; set; }
|
||||
|
||||
[Comment("กรณีหน่วยงานใส่ id ของหน่วยงาน")]
|
||||
public Guid? Organization { get; set; }
|
||||
|
||||
[Required, Comment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง")]
|
||||
public Guid ConsideredAgency { get; set; }
|
||||
|
||||
|
||||
[Comment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)")]
|
||||
public string? InvestigationDetail { get; set; }
|
||||
|
||||
[Comment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ")]
|
||||
public string? InvestigationDetailOther { get; set; }
|
||||
|
||||
[Comment("วันที่เริ่มการสอบสวน")]
|
||||
public DateTime? InvestigationDateStart { get; set; }
|
||||
|
||||
[Comment("วันที่สิ้นสุดการสอบสวน")]
|
||||
public DateTime? InvestigationDateEnd { get; set; }
|
||||
|
||||
[Comment("รายละเอียดเกี่ยวกับการสืบสวน")]
|
||||
public string? InvestigationDescription { get; set; }
|
||||
|
||||
[Comment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล")]
|
||||
public string? InvestigationStatusResult { get; set; }
|
||||
|
||||
[Comment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'")]
|
||||
public string? InvestigationCauseText { get; set; }
|
||||
public DisciplineComplaint DisciplineComplaint { get; set; }
|
||||
public virtual List<DisciplineInvestigate_Profile> DisciplineInvestigate_Profiles { get; set; } = new List<DisciplineInvestigate_Profile>();
|
||||
public virtual List<DisciplineInvestigate_DocComplaint> DisciplineInvestigate_DocComplaints { get; set; } = new List<DisciplineInvestigate_DocComplaint>();
|
||||
public virtual List<DisciplineInvestigate_Doc> DisciplineInvestigate_Docs { get; set; } = new List<DisciplineInvestigate_Doc>();
|
||||
public virtual List<DisciplineInvestigateRelevant_Doc> DisciplineInvestigateRelevant_Docs { get; set; } = new List<DisciplineInvestigateRelevant_Doc>();
|
||||
public virtual List<DisciplineInvestigate_Director> DisciplineInvestigate_Directors { get; set; } = new List<DisciplineInvestigate_Director>();
|
||||
}
|
||||
}
|
||||
|
|
@ -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 DisciplineInvestigateRelevant_Doc : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -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 DisciplineInvestigate_Director : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสกรรมการ")]
|
||||
public DisciplineDirector DisciplineDirector { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องร้องเรียน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -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 DisciplineInvestigate_Doc : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -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 DisciplineInvestigate_DocComplaint : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องร้องเรียน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineInvestigate_Profile : EntityBase
|
||||
{
|
||||
[Comment("id อ้างอิง profile")]
|
||||
public Guid? PersonId { get; set; }
|
||||
[MaxLength(13), Comment("รหัสบัตรประชาชน")]
|
||||
public string? CitizenId { get; set; }
|
||||
[Comment("คำนำหน้า")]
|
||||
public string? Prefix { get; set; }
|
||||
[Required, MaxLength(100), Comment("ชื่อ")]
|
||||
public string? FirstName { get; set; }
|
||||
[Required, MaxLength(100), Comment("นามสกุล")]
|
||||
public string? LastName { get; set; }
|
||||
[Comment("สังกัด")]
|
||||
public string? Organization { get; set; }
|
||||
[Comment("ตำแหน่ง")]
|
||||
public string? Position { get; set; }
|
||||
[Comment("เลขที่ตำแหน่ง")]
|
||||
public string? PosNo { get; set; }
|
||||
[Comment("ระดับ")]
|
||||
public string? PositionLevel { get; set; }
|
||||
[Comment("เงินเดือน")]
|
||||
public double? Salary { get; set; }
|
||||
[Required, Comment("Id เรื่องร้องเรียน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
9916
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123094644_add table DisciplineInvestigate.Designer.cs
generated
Normal file
9916
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123094644_add table DisciplineInvestigate.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,330 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addtableDisciplineInvestigate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RejectReason",
|
||||
table: "DisciplineComplaints");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Result",
|
||||
table: "DisciplineComplaints",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ผลการตรวจสอบ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineInvestigates",
|
||||
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"),
|
||||
Status = table.Column<string>(type: "longtext", nullable: false, comment: "สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
RespondentType = table.Column<string>(type: "longtext", nullable: false, comment: "ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Title = table.Column<string>(type: "text", nullable: false, comment: "เรื่องที่ร้องเรียน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Description = table.Column<string>(type: "text", nullable: false, comment: "รายละเอียดของเรื่องร้องเรียน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DateReceived = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"),
|
||||
LevelConsideration = table.Column<string>(type: "longtext", nullable: false, comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DateConsideration = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่กำหนดพิจารณา"),
|
||||
OffenseDetails = table.Column<string>(type: "longtext", nullable: false, comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DateNotification = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันแจ้งเตือนล่วงหน้า"),
|
||||
ComplaintFrom = table.Column<string>(type: "longtext", nullable: false, comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Appellant = table.Column<string>(type: "longtext", nullable: false, comment: "ผู้ร้องเรียน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ResultComplaint = table.Column<string>(type: "longtext", nullable: true, comment: "ผลการตรวจสอบเรื่องร้องเรียน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Result = table.Column<string>(type: "longtext", nullable: true, comment: "ผลการตรวจสอบ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Organization = table.Column<Guid>(type: "char(36)", nullable: true, comment: "กรณีหน่วยงานใส่ id ของหน่วยงาน", collation: "ascii_general_ci"),
|
||||
ConsideredAgency = table.Column<Guid>(type: "char(36)", nullable: false, comment: "หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง", collation: "ascii_general_ci"),
|
||||
InvestigationDetail = table.Column<string>(type: "longtext", nullable: true, comment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
InvestigationDetailOther = table.Column<string>(type: "longtext", nullable: true, comment: "ลักษณะการสืบสวนกรณีเลือกอื่นๆ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
InvestigationDateStart = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่เริ่มการสอบสวน"),
|
||||
InvestigationDateEnd = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่สิ้นสุดการสอบสวน"),
|
||||
InvestigationDescription = table.Column<string>(type: "longtext", nullable: true, comment: "รายละเอียดเกี่ยวกับการสืบสวน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
InvestigationStatusResult = table.Column<string>(type: "longtext", nullable: true, comment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
InvestigationCauseText = table.Column<string>(type: "longtext", nullable: true, comment: "กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DisciplineComplaintId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineInvestigates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigates_DisciplineComplaints_DisciplineCompla~",
|
||||
column: x => x.DisciplineComplaintId,
|
||||
principalTable: "DisciplineComplaints",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineInvestigate_Directors",
|
||||
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"),
|
||||
DisciplineDirectorId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineComplaintId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineInvestigate_Directors", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineComplaints_Discipl~",
|
||||
column: x => x.DisciplineComplaintId,
|
||||
principalTable: "DisciplineComplaints",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineDirectors_Discipli~",
|
||||
column: x => x.DisciplineDirectorId,
|
||||
principalTable: "DisciplineDirectors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id");
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineInvestigate_DocComplaints",
|
||||
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"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineInvestigate_DocComplaints", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_DocComplaints_DisciplineInvestigates_D~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_DocComplaints_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineInvestigate_Docs",
|
||||
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"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineInvestigate_Docs", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Docs_DisciplineInvestigates_Discipline~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Docs_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineInvestigate_Profiles",
|
||||
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"),
|
||||
PersonId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"),
|
||||
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
FirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Organization = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Position = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PosNo = table.Column<string>(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PositionLevel = table.Column<string>(type: "longtext", nullable: true, comment: "ระดับ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Salary = table.Column<double>(type: "double", nullable: true, comment: "เงินเดือน"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineInvestigate_Profiles", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Profiles_DisciplineInvestigates_Discip~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Directors_DisciplineComplaintId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineComplaintId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Directors_DisciplineDirectorId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineDirectorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Directors_DisciplineInvestigateId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_DocComplaints_DisciplineInvestigateId",
|
||||
table: "DisciplineInvestigate_DocComplaints",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_DocComplaints_DocumentId",
|
||||
table: "DisciplineInvestigate_DocComplaints",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Docs_DisciplineInvestigateId",
|
||||
table: "DisciplineInvestigate_Docs",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Docs_DocumentId",
|
||||
table: "DisciplineInvestigate_Docs",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Profiles_DisciplineInvestigateId",
|
||||
table: "DisciplineInvestigate_Profiles",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigates_DisciplineComplaintId",
|
||||
table: "DisciplineInvestigates",
|
||||
column: "DisciplineComplaintId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineInvestigate_DocComplaints");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineInvestigate_Docs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineInvestigate_Profiles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineInvestigates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Result",
|
||||
table: "DisciplineComplaints");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "RejectReason",
|
||||
table: "DisciplineComplaints",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "เหตุผลยุติเรื่อง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
}
|
||||
}
|
||||
9907
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123100343_add table DisciplineInvestigate1.Designer.cs
generated
Normal file
9907
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123100343_add table DisciplineInvestigate1.Designer.cs
generated
Normal file
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 addtableDisciplineInvestigate1 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineComplaints_Discipl~",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigate_Directors_DisciplineComplaintId",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineComplaintId",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "DisciplineInvestigateId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)",
|
||||
oldNullable: true)
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineInvestigateId",
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "DisciplineInvestigateId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)")
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineComplaintId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Directors_DisciplineComplaintId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineComplaintId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineComplaints_Discipl~",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineComplaintId",
|
||||
principalTable: "DisciplineComplaints",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineInvestigates_Disci~",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineInvestigateId",
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addtableDisciplineInvestigateRelevantDocs : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineInvestigateRelevant_Docs",
|
||||
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"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineInvestigateRelevant_Docs", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineInvestigates_Di~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigateRelevant_Docs_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineInvestigateId",
|
||||
table: "DisciplineInvestigateRelevant_Docs",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigateRelevant_Docs_DocumentId",
|
||||
table: "DisciplineInvestigateRelevant_Docs",
|
||||
column: "DocumentId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineInvestigateRelevant_Docs");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -111,15 +111,15 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
.HasColumnType("char(36)")
|
||||
.HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน");
|
||||
|
||||
b.Property<string>("RejectReason")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เหตุผลยุติเรื่อง");
|
||||
|
||||
b.Property<string>("RespondentType")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)");
|
||||
|
||||
b.Property<string>("Result")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผลการตรวจสอบ");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
|
|
@ -438,6 +438,509 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
b.ToTable("DisciplineDirectors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<string>("Appellant")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผู้ร้องเรียน");
|
||||
|
||||
b.Property<string>("ComplaintFrom")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)");
|
||||
|
||||
b.Property<Guid>("ConsideredAgency")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง");
|
||||
|
||||
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<DateTime?>("DateConsideration")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่กำหนดพิจารณา");
|
||||
|
||||
b.Property<DateTime>("DateNotification")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันแจ้งเตือนล่วงหน้า");
|
||||
|
||||
b.Property<DateTime>("DateReceived")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasComment("รายละเอียดของเรื่องร้องเรียน");
|
||||
|
||||
b.Property<Guid>("DisciplineComplaintId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("InvestigationCauseText")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'");
|
||||
|
||||
b.Property<DateTime?>("InvestigationDateEnd")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่สิ้นสุดการสอบสวน");
|
||||
|
||||
b.Property<DateTime?>("InvestigationDateStart")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("วันที่เริ่มการสอบสวน");
|
||||
|
||||
b.Property<string>("InvestigationDescription")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รายละเอียดเกี่ยวกับการสืบสวน");
|
||||
|
||||
b.Property<string>("InvestigationDetail")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)");
|
||||
|
||||
b.Property<string>("InvestigationDetailOther")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ");
|
||||
|
||||
b.Property<string>("InvestigationStatusResult")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล");
|
||||
|
||||
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.Property<string>("LevelConsideration")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)");
|
||||
|
||||
b.Property<string>("OffenseDetails")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)");
|
||||
|
||||
b.Property<Guid?>("Organization")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("กรณีหน่วยงานใส่ id ของหน่วยงาน");
|
||||
|
||||
b.Property<string>("RespondentType")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)");
|
||||
|
||||
b.Property<string>("Result")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผลการตรวจสอบ");
|
||||
|
||||
b.Property<string>("ResultComplaint")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ผลการตรวจสอบเรื่องร้องเรียน");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasComment("เรื่องที่ร้องเรียน");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineComplaintId");
|
||||
|
||||
b.ToTable("DisciplineInvestigates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", 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>("DisciplineInvestigateId")
|
||||
.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("DisciplineInvestigateId");
|
||||
|
||||
b.HasIndex("DocumentId");
|
||||
|
||||
b.ToTable("DisciplineInvestigateRelevant_Docs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", 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>("DisciplineDirectorId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("DisciplineInvestigateId")
|
||||
.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("DisciplineDirectorId");
|
||||
|
||||
b.HasIndex("DisciplineInvestigateId");
|
||||
|
||||
b.ToTable("DisciplineInvestigate_Directors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", 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>("DisciplineInvestigateId")
|
||||
.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("DisciplineInvestigateId");
|
||||
|
||||
b.HasIndex("DocumentId");
|
||||
|
||||
b.ToTable("DisciplineInvestigate_Docs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", 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>("DisciplineInvestigateId")
|
||||
.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("DisciplineInvestigateId");
|
||||
|
||||
b.HasIndex("DocumentId");
|
||||
|
||||
b.ToTable("DisciplineInvestigate_DocComplaints");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Profile", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<string>("CitizenId")
|
||||
.HasMaxLength(13)
|
||||
.HasColumnType("varchar(13)")
|
||||
.HasComment("รหัสบัตรประชาชน");
|
||||
|
||||
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>("DisciplineInvestigateId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)")
|
||||
.HasComment("ชื่อ");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)")
|
||||
.HasComment("นามสกุล");
|
||||
|
||||
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.Property<string>("Organization")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สังกัด");
|
||||
|
||||
b.Property<Guid?>("PersonId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("id อ้างอิง profile");
|
||||
|
||||
b.Property<string>("PosNo")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เลขที่ตำแหน่ง");
|
||||
|
||||
b.Property<string>("Position")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ตำแหน่ง");
|
||||
|
||||
b.Property<string>("PositionLevel")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ระดับ");
|
||||
|
||||
b.Property<string>("Prefix")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("คำนำหน้า");
|
||||
|
||||
b.Property<double?>("Salary")
|
||||
.HasColumnType("double")
|
||||
.HasComment("เงินเดือน");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DisciplineInvestigateId");
|
||||
|
||||
b.ToTable("DisciplineInvestigate_Profiles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.Document", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -8417,6 +8920,104 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
b.Navigation("DisciplineComplaint");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint", "DisciplineComplaint")
|
||||
.WithMany("DisciplineInvestigates")
|
||||
.HasForeignKey("DisciplineComplaintId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineComplaint");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate")
|
||||
.WithMany("DisciplineInvestigateRelevant_Docs")
|
||||
.HasForeignKey("DisciplineInvestigateId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document")
|
||||
.WithMany()
|
||||
.HasForeignKey("DocumentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineInvestigate");
|
||||
|
||||
b.Navigation("Document");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Director", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector")
|
||||
.WithMany("DisciplineInvestigate_Directors")
|
||||
.HasForeignKey("DisciplineDirectorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate")
|
||||
.WithMany("DisciplineInvestigate_Directors")
|
||||
.HasForeignKey("DisciplineInvestigateId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineDirector");
|
||||
|
||||
b.Navigation("DisciplineInvestigate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Doc", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate")
|
||||
.WithMany("DisciplineInvestigate_Docs")
|
||||
.HasForeignKey("DisciplineInvestigateId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document")
|
||||
.WithMany()
|
||||
.HasForeignKey("DocumentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineInvestigate");
|
||||
|
||||
b.Navigation("Document");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_DocComplaint", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate")
|
||||
.WithMany("DisciplineInvestigate_DocComplaints")
|
||||
.HasForeignKey("DisciplineInvestigateId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.Document", "Document")
|
||||
.WithMany()
|
||||
.HasForeignKey("DocumentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineInvestigate");
|
||||
|
||||
b.Navigation("Document");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate_Profile", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate")
|
||||
.WithMany("DisciplineInvestigate_Profiles")
|
||||
.HasForeignKey("DisciplineInvestigateId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DisciplineInvestigate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave")
|
||||
|
|
@ -9195,6 +9796,26 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
|||
b.Navigation("DisciplineComplaint_Docs");
|
||||
|
||||
b.Navigation("DisciplineComplaint_Profiles");
|
||||
|
||||
b.Navigation("DisciplineInvestigates");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", b =>
|
||||
{
|
||||
b.Navigation("DisciplineInvestigate_Directors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b =>
|
||||
{
|
||||
b.Navigation("DisciplineInvestigateRelevant_Docs");
|
||||
|
||||
b.Navigation("DisciplineInvestigate_Directors");
|
||||
|
||||
b.Navigation("DisciplineInvestigate_DocComplaints");
|
||||
|
||||
b.Navigation("DisciplineInvestigate_Docs");
|
||||
|
||||
b.Navigation("DisciplineInvestigate_Profiles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitLeave", b =>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,13 @@ namespace BMA.EHR.Infrastructure.Persistence
|
|||
public DbSet<DisciplineDirector> DisciplineDirectors { get; set; }
|
||||
public DbSet<DisciplineComplaint_Profile> DisciplineComplaint_Profiles { get; set; }
|
||||
public DbSet<DisciplineComplaint_Doc> DisciplineComplaint_Docs { get; set; }
|
||||
|
||||
public DbSet<DisciplineInvestigate> DisciplineInvestigates { get; set; }
|
||||
public DbSet<DisciplineInvestigate_Profile> DisciplineInvestigate_Profiles { get; set; }
|
||||
public DbSet<DisciplineInvestigate_DocComplaint> DisciplineInvestigate_DocComplaints { get; set; }
|
||||
public DbSet<DisciplineInvestigate_Doc> DisciplineInvestigate_Docs { get; set; }
|
||||
public DbSet<DisciplineInvestigate_Director> DisciplineInvestigate_Directors { get; set; }
|
||||
public DbSet<DisciplineInvestigateRelevant_Doc> DisciplineInvestigateRelevant_Docs { get; set; }
|
||||
public DbSet<Document> Documents { get; set; }
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue