เตรียมไปออกคำสั่ง วินัย
This commit is contained in:
parent
3d8d65f21f
commit
536a94d907
12 changed files with 11865 additions and 2 deletions
|
|
@ -57,6 +57,8 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
||||||
{
|
{
|
||||||
var data_search = (from x in _context.DisciplineDisciplinarys
|
var data_search = (from x in _context.DisciplineDisciplinarys
|
||||||
where x.Title.Contains(keyword) ||
|
where x.Title.Contains(keyword) ||
|
||||||
|
// x.DisciplinaryFaultLevel == null ? false : x.DisciplinaryFaultLevel.Contains(keyword) ||
|
||||||
|
// x.DisciplinaryCaseFault == null ? false : x.DisciplinaryCaseFault.Contains(keyword)
|
||||||
x.DisciplinaryFaultLevel.Contains(keyword) ||
|
x.DisciplinaryFaultLevel.Contains(keyword) ||
|
||||||
x.DisciplinaryCaseFault.Contains(keyword)
|
x.DisciplinaryCaseFault.Contains(keyword)
|
||||||
select x).ToList();
|
select x).ToList();
|
||||||
|
|
@ -1398,5 +1400,58 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
||||||
return Error(new Exception("ไม่พบไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception("ไม่พบไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// สั่งรายชื่อไปออกคำสั่งให้ออกจากราชการไว้ก่อน
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPut("suspend/{id:length(36)}")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostToSuspend([FromBody] DisciplinePersonIdRequest req, Guid id)
|
||||||
|
{
|
||||||
|
var data = await _context.DisciplineDisciplinarys
|
||||||
|
.Include(x => x.DisciplineReport_Profiles)
|
||||||
|
.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates)
|
||||||
|
.Where(x => x.Id == id)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (data == null)
|
||||||
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
|
|
||||||
|
var persons = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => req.persons.Contains(x.Id)).ToList();
|
||||||
|
foreach (var item in persons)
|
||||||
|
{
|
||||||
|
data.DisciplineReport_Profiles.Add(
|
||||||
|
new DisciplineReport_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,
|
||||||
|
Status = "PENDING",
|
||||||
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
CreatedUserId = UserId ?? "",
|
||||||
|
CreatedAt = DateTime.Now,
|
||||||
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
|
LastUpdateUserId = UserId ?? "",
|
||||||
|
LastUpdatedAt = DateTime.Now,
|
||||||
|
});
|
||||||
|
item.Status = "SUSPEND";
|
||||||
|
item.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
item.LastUpdateUserId = UserId ?? "";
|
||||||
|
item.LastUpdatedAt = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
{
|
{
|
||||||
var data_search = (from x in _context.DisciplineDisciplinarys
|
var data_search = (from x in _context.DisciplineDisciplinarys
|
||||||
where x.Title.Contains(keyword) ||
|
where x.Title.Contains(keyword) ||
|
||||||
x.DisciplinaryFaultLevel.Contains(keyword) ||
|
x.DisciplinaryFaultLevel == null ? false : x.DisciplinaryFaultLevel.Contains(keyword) ||
|
||||||
x.DisciplinaryCaseFault.Contains(keyword) ||
|
x.DisciplinaryCaseFault == null ? false : x.DisciplinaryCaseFault.Contains(keyword) ||
|
||||||
x.Status == "DONE"
|
x.Status == "DONE"
|
||||||
select x).ToList();
|
select x).ToList();
|
||||||
var data = data_search
|
var data = data_search
|
||||||
|
|
@ -146,5 +146,34 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return Success(data.Id);
|
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>
|
||||||
|
[HttpPut("report/{commandTypeId:length(36)}")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostToReport([FromBody] DisciplineProfileRequest req, Guid commandTypeId)
|
||||||
|
{
|
||||||
|
foreach (var item in req.Id)
|
||||||
|
{
|
||||||
|
var uppdated = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == item);
|
||||||
|
if (uppdated == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
uppdated.CommandTypeId = commandTypeId;
|
||||||
|
uppdated.Status = "REPORT";
|
||||||
|
uppdated.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
uppdated.LastUpdateUserId = UserId ?? "";
|
||||||
|
uppdated.LastUpdatedAt = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,199 @@
|
||||||
|
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.DisciplineSuspend.Service.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/v{version:apiVersion}/discipline/suspend")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
|
[ApiController]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[Authorize]
|
||||||
|
[SwaggerTag("ระบบวินัยเรื่องผู้ถูกพักราชการ")]
|
||||||
|
public class DisciplineSuspendController : BaseController
|
||||||
|
{
|
||||||
|
private readonly DisciplineDbContext _context;
|
||||||
|
private readonly MinIODisciplineService _documentService;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
|
public DisciplineSuspendController(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>> GetDisciplineSuspend(int page = 1, int pageSize = 25, string keyword = "")
|
||||||
|
{
|
||||||
|
var data_search = (from x in _context.DisciplineReport_Profiles.Include(x => x.DisciplineDisciplinary)
|
||||||
|
where x.CitizenId.Contains(keyword) ||
|
||||||
|
x.Prefix.Contains(keyword) ||
|
||||||
|
x.FirstName.Contains(keyword) ||
|
||||||
|
x.LastName.Contains(keyword) ||
|
||||||
|
x.Organization.Contains(keyword) ||
|
||||||
|
x.Position.Contains(keyword) ||
|
||||||
|
x.PosNo.Contains(keyword) ||
|
||||||
|
x.PositionLevel.Contains(keyword) ||
|
||||||
|
x.DisciplineDisciplinary.Title.Contains(keyword)
|
||||||
|
select x).ToList();
|
||||||
|
var data = data_search
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
CitizenId = x.CitizenId,
|
||||||
|
Prefix = x.Prefix,
|
||||||
|
FirstName = x.FirstName,
|
||||||
|
LastName = x.LastName,
|
||||||
|
Organization = x.Organization,
|
||||||
|
Position = x.Position,
|
||||||
|
PosNo = x.PosNo,
|
||||||
|
PositionLevel = x.PositionLevel,
|
||||||
|
Salary = x.Salary,
|
||||||
|
Status = x.Status,
|
||||||
|
DescriptionSuspend = x.DescriptionSuspend,
|
||||||
|
StartDateSuspend = x.StartDateSuspend,
|
||||||
|
EndDateSuspend = x.EndDateSuspend,
|
||||||
|
Title = x.DisciplineDisciplinary.Title,
|
||||||
|
OffenseDetails = x.DisciplineDisciplinary.OffenseDetails,//ลักษณะความผิด
|
||||||
|
DisciplinaryFaultLevel = x.DisciplineDisciplinary.DisciplinaryFaultLevel,//ระดับโทษความผิด
|
||||||
|
DisciplinaryCaseFault = x.DisciplineDisciplinary.DisciplinaryCaseFault,//กรณีความผิด
|
||||||
|
})
|
||||||
|
.OrderByDescending(x => x.CitizenId)
|
||||||
|
.Skip((page - 1) * pageSize)
|
||||||
|
.Take(pageSize)
|
||||||
|
.ToList();
|
||||||
|
return Success(new { data, total = data_search.Count() });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// get รายการผู้ถูกพักราชการ
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("{id:guid}")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetByDisciplineSuspend(Guid id)
|
||||||
|
{
|
||||||
|
var _data = await _context.DisciplineReport_Profiles
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
CitizenId = x.CitizenId,
|
||||||
|
Prefix = x.Prefix,
|
||||||
|
FirstName = x.FirstName,
|
||||||
|
LastName = x.LastName,
|
||||||
|
Organization = x.Organization,
|
||||||
|
Position = x.Position,
|
||||||
|
PosNo = x.PosNo,
|
||||||
|
PositionLevel = x.PositionLevel,
|
||||||
|
Salary = x.Salary,
|
||||||
|
Status = x.Status,
|
||||||
|
DescriptionSuspend = x.DescriptionSuspend,
|
||||||
|
StartDateSuspend = x.StartDateSuspend,
|
||||||
|
EndDateSuspend = x.EndDateSuspend,
|
||||||
|
Title = x.DisciplineDisciplinary.Title,
|
||||||
|
OffenseDetails = x.DisciplineDisciplinary.OffenseDetails,//ลักษณะความผิด
|
||||||
|
DisciplinaryFaultLevel = x.DisciplineDisciplinary.DisciplinaryFaultLevel,//ระดับโทษความผิด
|
||||||
|
DisciplinaryCaseFault = x.DisciplineDisciplinary.DisciplinaryCaseFault,//กรณีความผิด
|
||||||
|
})
|
||||||
|
.Where(x => x.Id == id)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
if (_data == null)
|
||||||
|
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||||
|
|
||||||
|
return Success(_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// แก้ไขรายการผู้ถูกพักราชการ
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPut("{id:guid}")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> UpdateDisciplineSuspend([FromBody] DisciplineSuspendRequest req, Guid id)
|
||||||
|
{
|
||||||
|
var data = await _context.DisciplineReport_Profiles.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||||
|
if (data == null)
|
||||||
|
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||||
|
|
||||||
|
data.Organization = req.Organization;
|
||||||
|
data.Position = req.Position;
|
||||||
|
data.PosNo = req.PosNo;
|
||||||
|
data.PositionLevel = req.PositionLevel;
|
||||||
|
data.Salary = req.Salary;
|
||||||
|
data.DescriptionSuspend = req.DescriptionSuspend;
|
||||||
|
data.StartDateSuspend = req.StartDateSuspend;
|
||||||
|
data.EndDateSuspend = req.EndDateSuspend;
|
||||||
|
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
data.LastUpdateUserId = UserId ?? "";
|
||||||
|
data.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>
|
||||||
|
[HttpPost("report")]
|
||||||
|
// [HttpPut("report/{commandTypeId:length(36)}")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostToReport([FromBody] DisciplineProfileRequest req)
|
||||||
|
{
|
||||||
|
foreach (var item in req.Id)
|
||||||
|
{
|
||||||
|
var uppdated = await _context.DisciplineReport_Profiles
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == item);
|
||||||
|
if (uppdated == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// uppdated.CommandTypeId = commandTypeId;
|
||||||
|
uppdated.Status = "REPORT";
|
||||||
|
uppdated.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
uppdated.LastUpdateUserId = UserId ?? "";
|
||||||
|
uppdated.LastUpdatedAt = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Discipline.Service.Requests
|
||||||
|
{
|
||||||
|
public class DisciplineSuspendRequest
|
||||||
|
{
|
||||||
|
public string? Organization { get; set; }
|
||||||
|
public string? Position { get; set; }
|
||||||
|
public string? PosNo { get; set; }
|
||||||
|
public string? PositionLevel { get; set; }
|
||||||
|
public double? Salary { get; set; }
|
||||||
|
public string? DescriptionSuspend { get; set; }
|
||||||
|
public DateTime? StartDateSuspend { get; set; }
|
||||||
|
public DateTime? EndDateSuspend { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Discipline.Service.Requests
|
||||||
|
{
|
||||||
|
public class DisciplineProfileRequest
|
||||||
|
{
|
||||||
|
public List<Guid> Id { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -131,5 +131,6 @@ namespace BMA.EHR.Domain.Models.Discipline
|
||||||
public virtual List<DisciplineDisciplinary_DocWitnesses> DisciplineDisciplinary_DocWitnessess { get; set; } = new List<DisciplineDisciplinary_DocWitnesses>();
|
public virtual List<DisciplineDisciplinary_DocWitnesses> DisciplineDisciplinary_DocWitnessess { get; set; } = new List<DisciplineDisciplinary_DocWitnesses>();
|
||||||
public virtual List<DisciplineDisciplinary_DocOther> DisciplineDisciplinary_DocOthers { get; set; } = new List<DisciplineDisciplinary_DocOther>();
|
public virtual List<DisciplineDisciplinary_DocOther> DisciplineDisciplinary_DocOthers { get; set; } = new List<DisciplineDisciplinary_DocOther>();
|
||||||
public virtual List<DisciplineDisciplinary_DocRelevant> DisciplineDisciplinary_DocRelevants { get; set; } = new List<DisciplineDisciplinary_DocRelevant>();
|
public virtual List<DisciplineDisciplinary_DocRelevant> DisciplineDisciplinary_DocRelevants { get; set; } = new List<DisciplineDisciplinary_DocRelevant>();
|
||||||
|
public virtual List<DisciplineReport_Profile> DisciplineReport_Profiles { get; set; } = new List<DisciplineReport_Profile>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@ namespace BMA.EHR.Domain.Models.Discipline
|
||||||
public string? PositionLevel { get; set; }
|
public string? PositionLevel { get; set; }
|
||||||
[Comment("เงินเดือน")]
|
[Comment("เงินเดือน")]
|
||||||
public double? Salary { get; set; }
|
public double? Salary { get; set; }
|
||||||
|
[Comment("สถานะออกคำสั่ง")]
|
||||||
|
public string? Status { get; set; }
|
||||||
|
[Comment("ประเภทออกคำสั่ง")]
|
||||||
|
public Guid? CommandTypeId { get; set; }
|
||||||
[Required, Comment("Id เรื่องสอบสวน")]
|
[Required, Comment("Id เรื่องสอบสวน")]
|
||||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
45
BMA.EHR.Domain/Models/Discipline/DisciplineReport_Profile.cs
Normal file
45
BMA.EHR.Domain/Models/Discipline/DisciplineReport_Profile.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
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 DisciplineReport_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; }
|
||||||
|
[Comment("สถานะออกคำสั่ง")]
|
||||||
|
public string? Status { get; set; }
|
||||||
|
[Comment("ประเภทออกคำสั่ง")]
|
||||||
|
public Guid? CommandTypeId { get; set; }
|
||||||
|
[Comment("เหตุที่ถูกสั่งพักราชการ/ออกจากราชการไว้ก่อน")]
|
||||||
|
public string? DescriptionSuspend { get; set; }
|
||||||
|
[Comment("วันที่สั่งพักราชการ/ให้ออกจากราชการไว้ก่อน")]
|
||||||
|
public DateTime? StartDateSuspend { get; set; }
|
||||||
|
[Comment("วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน")]
|
||||||
|
public DateTime? EndDateSuspend { get; set; }
|
||||||
|
[Required, Comment("Id เรื่องสอบสวน")]
|
||||||
|
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
11255
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231129061326_add table DisciplineReport_Profiles.Designer.cs
generated
Normal file
11255
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231129061326_add table DisciplineReport_Profiles.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,105 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addtableDisciplineReport_Profiles : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "CommandTypeId",
|
||||||
|
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
comment: "ประเภทออกคำสั่ง",
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Status",
|
||||||
|
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true,
|
||||||
|
comment: "สถานะออกคำสั่ง")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "DisciplineReport_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: "เงินเดือน"),
|
||||||
|
Status = table.Column<string>(type: "longtext", nullable: true, comment: "สถานะออกคำสั่ง")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CommandTypeId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "ประเภทออกคำสั่ง", collation: "ascii_general_ci"),
|
||||||
|
DescriptionSuspend = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุที่ถูกสั่งพักราชการ/ออกจากราชการไว้ก่อน")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
StartDateSuspend = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่สั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"),
|
||||||
|
EndDateSuspend = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน"),
|
||||||
|
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_DisciplineReport_Profiles", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_DisciplineReport_Profiles_DisciplineDisciplinarys_Discipline~",
|
||||||
|
column: x => x.DisciplineDisciplinaryId,
|
||||||
|
principalTable: "DisciplineDisciplinarys",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_DisciplineReport_Profiles_DisciplineDisciplinaryId",
|
||||||
|
table: "DisciplineReport_Profiles",
|
||||||
|
column: "DisciplineDisciplinaryId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "DisciplineReport_Profiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CommandTypeId",
|
||||||
|
table: "DisciplineDisciplinary_ProfileComplaintInvestigates");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Status",
|
||||||
|
table: "DisciplineDisciplinary_ProfileComplaintInvestigates");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1239,6 +1239,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
.HasColumnType("varchar(13)")
|
.HasColumnType("varchar(13)")
|
||||||
.HasComment("รหัสบัตรประชาชน");
|
.HasComment("รหัสบัตรประชาชน");
|
||||||
|
|
||||||
|
b.Property<Guid?>("CommandTypeId")
|
||||||
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("ประเภทออกคำสั่ง");
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
b.Property<DateTime>("CreatedAt")
|
||||||
.HasColumnType("datetime(6)")
|
.HasColumnType("datetime(6)")
|
||||||
.HasColumnOrder(100)
|
.HasColumnOrder(100)
|
||||||
|
|
@ -1320,6 +1324,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
.HasColumnType("double")
|
.HasColumnType("double")
|
||||||
.HasComment("เงินเดือน");
|
.HasComment("เงินเดือน");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะออกคำสั่ง");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("DisciplineDisciplinaryId");
|
b.HasIndex("DisciplineDisciplinaryId");
|
||||||
|
|
@ -1830,6 +1838,128 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
b.ToTable("DisciplineInvestigate_ProfileComplaints");
|
b.ToTable("DisciplineInvestigate_ProfileComplaints");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_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<Guid?>("CommandTypeId")
|
||||||
|
.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<string>("DescriptionSuspend")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("เหตุที่ถูกสั่งพักราชการ/ออกจากราชการไว้ก่อน");
|
||||||
|
|
||||||
|
b.Property<Guid>("DisciplineDisciplinaryId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EndDateSuspend")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันสิ้นสุดการสั่งพักราชการ/ให้ออกจากราชการไว้ก่อน");
|
||||||
|
|
||||||
|
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.Property<DateTime?>("StartDateSuspend")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่สั่งพักราชการ/ให้ออกจากราชการไว้ก่อน");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("สถานะออกคำสั่ง");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DisciplineDisciplinaryId");
|
||||||
|
|
||||||
|
b.ToTable("DisciplineReport_Profiles");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.Document", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.Document", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -10108,6 +10238,17 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
b.Navigation("DisciplineInvestigate");
|
b.Navigation("DisciplineInvestigate");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineReport_Profile", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary")
|
||||||
|
.WithMany("DisciplineReport_Profiles")
|
||||||
|
.HasForeignKey("DisciplineDisciplinaryId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("DisciplineDisciplinary");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.LimitTypeLeave", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave")
|
b.HasOne("BMA.EHR.Domain.Models.HR.LimitLeave", "LimitLeave")
|
||||||
|
|
@ -10918,6 +11059,8 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
b.Navigation("DisciplineDisciplinary_DocWitnessess");
|
b.Navigation("DisciplineDisciplinary_DocWitnessess");
|
||||||
|
|
||||||
b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigates");
|
b.Navigation("DisciplineDisciplinary_ProfileComplaintInvestigates");
|
||||||
|
|
||||||
|
b.Navigation("DisciplineReport_Profiles");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", b =>
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ namespace BMA.EHR.Infrastructure.Persistence
|
||||||
public DbSet<DisciplineDisciplinary_DocWitnesses> DisciplineDisciplinary_DocWitnessess { get; set; }
|
public DbSet<DisciplineDisciplinary_DocWitnesses> DisciplineDisciplinary_DocWitnessess { get; set; }
|
||||||
public DbSet<DisciplineDisciplinary_DocOther> DisciplineDisciplinary_DocOthers { get; set; }
|
public DbSet<DisciplineDisciplinary_DocOther> DisciplineDisciplinary_DocOthers { get; set; }
|
||||||
public DbSet<DisciplineDisciplinary_DocRelevant> DisciplineDisciplinary_DocRelevants { get; set; }
|
public DbSet<DisciplineDisciplinary_DocRelevant> DisciplineDisciplinary_DocRelevants { get; set; }
|
||||||
|
public DbSet<DisciplineReport_Profile> DisciplineReport_Profiles { get; set; }
|
||||||
public DbSet<Document> Documents { get; set; }
|
public DbSet<Document> Documents { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue