แจ้งเตือนล่วงหน้าวินัย

This commit is contained in:
Kittapath 2024-01-03 09:13:33 +07:00
parent 46599d1bc5
commit b371717f89
16 changed files with 3710 additions and 63 deletions

View file

@ -0,0 +1,81 @@
using BMA.EHR.Application.Common.Interfaces;
using BMA.EHR.Application.Repositories.MessageQueue;
using BMA.EHR.Domain.Models.Discipline;
using BMA.EHR.Domain.Models.Retirement;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Application.Repositories
{
public class DisciplineRepository : GenericRepository<Guid, RetirementPeriod>
{
private readonly IApplicationDBContext _dbContext;
private readonly IDisciplineDbContext _dbDisContext;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly NotificationRepository _repositoryNoti;
public DisciplineRepository(IApplicationDBContext dbContext,
IDisciplineDbContext dbDisContext,
NotificationRepository repositoryNoti,
IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
{
_dbContext = dbContext;
_dbDisContext = dbDisContext;
_httpContextAccessor = httpContextAccessor;
_repositoryNoti = repositoryNoti;
}
//เรื่องร้องเรียน
public async Task NotifyDisciplineComplaint()
{
var cronjobNotis = await _dbDisContext.Set<DisciplineComplaint>()
.Where(x => x.DateNotification != null && x.DateNotification.Date == DateTime.Now.Date)
.AsQueryable()
.ToListAsync();
foreach (var cronjobNoti in cronjobNotis)
{
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
$"แจ้งเตือนบันทึกข้อมูลร้องเรียนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}",
$"แจ้งเตือนบันทึกข้อมูลร้องเรียนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}"
);
}
await _dbContext.SaveChangesAsync();
}
//เรื่องสืบสวน
public async Task NotifyDisciplineInvestigate()
{
var cronjobNotis = await _dbDisContext.Set<DisciplineInvestigate>()
.Where(x => x.InvestigationDateEnd != null && x.InvestigationDateEnd.Value.Date.AddDays(-7) == DateTime.Now.Date)
.AsQueryable()
.ToListAsync();
foreach (var cronjobNoti in cronjobNotis)
{
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
$"แจ้งเตือนบันทึกข้อมูลสืบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}",
$"แจ้งเตือนบันทึกข้อมูลสืบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}"
);
}
await _dbContext.SaveChangesAsync();
}
//เรื่องสอบสวน
public async Task NotifyDisciplineDisciplinary()
{
var cronjobNotis = await _dbDisContext.Set<DisciplineDisciplinary>()
.Where(x => x.DisciplinaryDateEnd != null && x.DisciplinaryDateEnd.Value.Date.AddDays(-7) == DateTime.Now.Date)
.AsQueryable()
.ToListAsync();
foreach (var cronjobNoti in cronjobNotis)
{
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
$"แจ้งเตือนบันทึกข้อมูลสอบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}",
$"แจ้งเตือนบันทึกข้อมูลสอบสวนก่อนวันสิ้นสุดเรื่อง {cronjobNoti.Title}"
);
}
await _dbContext.SaveChangesAsync();
}
}
}

View file

@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Swashbuckle.AspNetCore.Annotations;
using System.Runtime.Serialization;
using System.Security.Claims;
namespace BMA.EHR.DisciplineComplaint.Service.Controllers
@ -56,12 +57,14 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetDisciplineComplaint(int page = 1, int pageSize = 25, string keyword = "")
public async Task<ActionResult<ResponseObject>> GetDisciplineComplaint(int page = 1, int pageSize = 25, string keyword = "", string status = "")
{
var data_search = (from x in _context.DisciplineComplaints
where x.Title.Contains(keyword) ||
x.Appellant.Contains(keyword)
select x).ToList();
if (status.Trim().ToUpper() != "ALL")
data_search = data_search.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
var data = data_search
.Select(x => new
{
@ -188,9 +191,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
Title = req.title,
Description = req.description,
DateReceived = req.dateReceived,
LevelConsideration = req.levelConsideration.Trim().ToUpper(),
LevelConsideration = req.levelConsideration == null ? null : req.levelConsideration.Trim().ToUpper(),
DateConsideration = req.dateConsideration,
OffenseDetails = req.offenseDetails.Trim().ToUpper(),
OffenseDetails = req.offenseDetails == null ? null : req.offenseDetails.Trim().ToUpper(),
DateNotification = req.dateNotification,
ComplaintFrom = req.complaintFrom,
Appellant = req.appellant,
@ -262,9 +265,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
data.Title = req.title;
data.Description = req.description;
data.DateReceived = req.dateReceived;
data.LevelConsideration = req.levelConsideration.Trim().ToUpper();
data.LevelConsideration = req.levelConsideration == null ? null : req.levelConsideration.Trim().ToUpper();
data.DateConsideration = req.dateConsideration;
data.OffenseDetails = req.offenseDetails.Trim().ToUpper();
data.OffenseDetails = req.offenseDetails == null ? null : req.offenseDetails.Trim().ToUpper();
data.DateNotification = req.dateNotification;
data.ComplaintFrom = req.complaintFrom;
data.Appellant = req.appellant;
@ -385,9 +388,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
Title = data.Title,
Description = data.Description,
DateReceived = data.DateReceived,
LevelConsideration = data.LevelConsideration.Trim().ToUpper(),
LevelConsideration = data.LevelConsideration == null ? null : data.LevelConsideration.Trim().ToUpper(),
DateConsideration = data.DateConsideration,
OffenseDetails = data.OffenseDetails.Trim().ToUpper(),
OffenseDetails = data.OffenseDetails == null ? null : data.OffenseDetails.Trim().ToUpper(),
DateNotification = data.DateNotification,
ComplaintFrom = data.ComplaintFrom,
Appellant = data.Appellant,
@ -419,6 +422,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
PosNo = item.PosNo,
Position = item.Position,
PositionLevel = item.PositionLevel,
IsDisciplinary = false,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
CreatedAt = DateTime.Now,

View file

@ -53,7 +53,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetDisciplineDisciplinary(int page = 1, int pageSize = 25, string keyword = "")
public async Task<ActionResult<ResponseObject>> GetDisciplineDisciplinary(int page = 1, int pageSize = 25, string keyword = "", string status = "")
{
var data_search = (from x in _context.DisciplineDisciplinarys
where x.Title.Contains(keyword) ||
@ -62,6 +62,8 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
x.DisciplinaryFaultLevel.Contains(keyword) ||
x.DisciplinaryCaseFault.Contains(keyword)
select x).ToList();
if (status.Trim().ToUpper() != "ALL")
data_search = data_search.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
var data = data_search
.Select(x => new
{
@ -465,6 +467,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
// Report = p.DisciplineReport_Profiles.Count() > 0 ? true : false,
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
DisciplinaryFaultLevelOther = x.DisciplinaryFaultLevelOther,
DisciplineDisciplinary_DocRelevants = x.DisciplineDisciplinary_DocRelevants.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
DisciplineDisciplinary_DocSummaryEvidences = x.DisciplineDisciplinary_DocSummaryEvidences.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
DisciplineDisciplinary_DocRecordAccusers = x.DisciplineDisciplinary_DocRecordAccusers.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
@ -561,6 +564,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
_data.RespondentType,
_data.Persons,
_data.OrganizationId,
_data.DisciplinaryFaultLevelOther,
disciplineDisciplinary_DocRelevants,
disciplineDisciplinary_DocSummaryEvidences,
disciplineDisciplinary_DocRecordAccusers,
@ -613,6 +617,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
data.DisciplinaryStatusResult = req.DisciplinaryStatusResult;
data.DisciplinaryCauseText = req.DisciplinaryCauseText;
data.DisciplinaryResult = req.DisciplinaryResult;
data.DisciplinaryFaultLevelOther = req.DisciplinaryFaultLevelOther;
data.Result = req.Result;
data.LastUpdateFullName = FullName ?? "System Administrator";
data.LastUpdateUserId = UserId ?? "";

View file

@ -53,11 +53,13 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetDisciplineInvestigate(int page = 1, int pageSize = 25, string keyword = "")
public async Task<ActionResult<ResponseObject>> GetDisciplineInvestigate(int page = 1, int pageSize = 25, string keyword = "", string status = "")
{
var data_search = (from x in _context.DisciplineInvestigates
where x.Title.Contains(keyword)
select x).ToList();
if (status.Trim().ToUpper() != "ALL")
data_search = data_search.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
var data = data_search
.Select(x => new
{
@ -289,6 +291,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
PosNo = p.PosNo,
Organization = p.Organization,
IsSend = p.IsReport,
IsDisciplinary = p.IsDisciplinary,
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
DisciplineInvestigateDocs = x.DisciplineInvestigate_Docs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
@ -451,6 +454,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
Salary = item.salary,
PersonId = item.personId,
PosNo = item.posNo,
IsDisciplinary = isReport == null ? false : isReport.IsDisciplinary,
IsReport = isReport == null ? "NEW" : isReport.IsReport,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
@ -529,9 +533,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
Title = data.Title,
Description = data.Description,
DateReceived = data.DateReceived,
LevelConsideration = data.LevelConsideration.Trim().ToUpper(),
LevelConsideration = data.LevelConsideration == null ? null : data.LevelConsideration.Trim().ToUpper(),
DateConsideration = data.DateConsideration,
OffenseDetails = data.OffenseDetails.Trim().ToUpper(),
OffenseDetails = data.OffenseDetails == null ? null : data.OffenseDetails.Trim().ToUpper(),
DateNotification = data.DateNotification,
ComplaintFrom = data.ComplaintFrom,
Appellant = data.Appellant,
@ -584,6 +588,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
LastUpdateUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
});
item.IsDisciplinary = true;
}
foreach (var item in data.DisciplineInvestigate_DocComplaints)
{

View file

@ -54,7 +54,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
public async Task<ActionResult<ResponseObject>> GetDisciplineResult(int page = 1, int pageSize = 25, string keyword = "")
public async Task<ActionResult<ResponseObject>> GetDisciplineResult(int page = 1, int pageSize = 25, string keyword = "", string status = "")
{
var data_search = (from x in _context.DisciplineDisciplinarys
where x.Title.Contains(keyword)
@ -62,6 +62,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
// x.DisciplinaryFaultLevel == null ? false : x.DisciplinaryFaultLevel.Contains(keyword) ||
// x.DisciplinaryCaseFault == null ? false : x.DisciplinaryCaseFault.Contains(keyword) ||
select x).ToList();
if (status.Trim().ToUpper() != "ALL")
data_search = data_search.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
var data = data_search
.Select(x => new
{

View file

@ -0,0 +1,16 @@
using System.Diagnostics.CodeAnalysis;
using Hangfire.Dashboard;
namespace BMA.EHR.Discipline.Service.Filters
{
public class CustomAuthorizeFilter : IDashboardAuthorizationFilter
{
public bool Authorize([NotNull] DashboardContext context)
{
//var httpcontext = context.GetHttpContext();
//return httpcontext.User.Identity.IsAuthenticated;
return true;
}
}
}

View file

@ -3,6 +3,9 @@ using BMA.EHR.Discipline.Service;
using BMA.EHR.Domain.Middlewares;
using BMA.EHR.Infrastructure;
using BMA.EHR.Infrastructure.Persistence;
using Hangfire;
using Hangfire.Common;
using Hangfire.MySql;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
@ -15,6 +18,9 @@ using Serilog.Exceptions;
using Serilog.Sinks.Elasticsearch;
using System.Reflection;
using System.Text;
using System.Transactions;
using BMA.EHR.Discipline.Service.Filters;
using BMA.EHR.Application.Repositories;
var builder = WebApplication.CreateBuilder(args);
{
@ -92,7 +98,31 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSwaggerGen();
builder.Services.ConfigureOptions<ConfigureSwaggerOptions>();
// Register DbContext
var defaultConnection = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddDbContext<DisciplineDbContext>(options =>
options.UseMySql(defaultConnection, ServerVersion.AutoDetect(defaultConnection)));
builder.Services.AddHealthChecks();
// Add Hangfire services.
builder.Services.AddHangfire(configuration => configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseStorage(
new MySqlStorage(
defaultConnection,
new MySqlStorageOptions
{
TransactionIsolationLevel = IsolationLevel.ReadCommitted,
QueuePollInterval = TimeSpan.FromSeconds(15),
JobExpirationCheckInterval = TimeSpan.FromHours(1),
CountersAggregateInterval = TimeSpan.FromMinutes(5),
PrepareSchemaIfNecessary = true,
DashboardJobListLimit = 50000,
TransactionTimeout = TimeSpan.FromMinutes(1),
TablesPrefix = "Hangfire"
})));
builder.Services.AddHangfireServer();
}
var app = builder.Build();
@ -123,6 +153,17 @@ var app = builder.Build();
app.UseStaticFiles();
app.MapControllers();
app.UseMiddleware<ErrorHandlerMiddleware>();
app.UseHangfireDashboard("/hangfire", new DashboardOptions()
{
Authorization = new[] { new CustomAuthorizeFilter() }
});
var manager = new RecurringJobManager();
if (manager != null)
{
manager.AddOrUpdate("แจ้งเตือนเรื่องร้องเรียน", Job.FromExpression<DisciplineRepository>(x => x.NotifyDisciplineComplaint()), Cron.Daily(Int32.Parse(builder.Configuration["KeycloakCron:Hour"]), Int32.Parse(builder.Configuration["KeycloakCron:Minute"])), TimeZoneInfo.Local);
manager.AddOrUpdate("แจ้งเตือนเรื่องสืบสวน", Job.FromExpression<DisciplineRepository>(x => x.NotifyDisciplineInvestigate()), Cron.Daily(Int32.Parse(builder.Configuration["KeycloakCron:Hour"]), Int32.Parse(builder.Configuration["KeycloakCron:Minute"])), TimeZoneInfo.Local);
manager.AddOrUpdate("แจ้งเตือนเรื่องสอบสวน", Job.FromExpression<DisciplineRepository>(x => x.NotifyDisciplineDisciplinary()), Cron.Daily(Int32.Parse(builder.Configuration["KeycloakCron:Hour"]), Int32.Parse(builder.Configuration["KeycloakCron:Minute"])), TimeZoneInfo.Local);
}
// apply migrations
await using var scope = app.Services.CreateAsyncScope();

View file

@ -9,15 +9,15 @@ namespace BMA.EHR.Discipline.Service.Requests
public Guid? organizationId { get; set; }// กรณีหน่วยงานใส่ id ของหน่วยงาน
public Guid consideredAgency { get; set; }// *หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง
public string title { get; set; }// *เรื่องที่ร้องเรียน
public string description { get; set; }// *รายละเอียดของเรื่องร้องเรียน
public string? description { get; set; }// *รายละเอียดของเรื่องร้องเรียน
public DateTime dateReceived { get; set; }// *วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ
public string levelConsideration { get; set; }// *ระดับการพิจารณา "ยังไม่ระบุ" (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)
public string? levelConsideration { get; set; }// *ระดับการพิจารณา "ยังไม่ระบุ" (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)
public DateTime? dateConsideration { get; set; }// วันที่กำหนดพิจารณา
public string offenseDetails { get; set; }// *ลักษณะความผิดครั้งแรกจะเป็น "ยังไม่ระบุ" (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)
public string? offenseDetails { get; set; }// *ลักษณะความผิดครั้งแรกจะเป็น "ยังไม่ระบุ" (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)
public DateTime dateNotification { get; set; }//*วันแจ้งเตือนล่วงหน้า
public string complaintFrom { get; set; }//*รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)
public string appellant { get; set; }//*ผู้ร้องเรียน
public string result { 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

View file

@ -23,6 +23,7 @@ namespace BMA.EHR.Discipline.Service.Requests
public string? DisciplinaryStatusResult { get; set; }
public string? DisciplinaryCauseText { get; set; }
public string? DisciplinaryResult { get; set; }
public string? DisciplinaryFaultLevelOther { get; set; }
public string? Result { get; set; }
public Guid[] directors { get; set; }

View file

@ -17,26 +17,26 @@ namespace BMA.EHR.Domain.Models.Discipline
[Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")]
public string Title { get; set; } = string.Empty;
[Required, Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "text")]
public string Description { get; set; } = string.Empty;
[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("ระดับการพิจารณา 'ยังไม่ระบุ' (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;
[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;
[Comment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")]
public string? ComplaintFrom { get; set; } = string.Empty;
[Required, Comment("ผู้ร้องเรียน")]
public string Appellant { get; set; } = string.Empty;
[Comment("ผู้ร้องเรียน")]
public string? Appellant { get; set; } = string.Empty;
// [Required, Comment("อ้างอิงรหัสเอกสาร")]
// public Document Document { get; set; }

View file

@ -17,26 +17,26 @@ namespace BMA.EHR.Domain.Models.Discipline
[Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")]
public string Title { get; set; } = string.Empty;
[Required, Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "text")]
public string Description { get; set; } = string.Empty;
[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("ระดับการพิจารณา 'ยังไม่ระบุ' (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;
[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;
[Comment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")]
public string? ComplaintFrom { get; set; } = string.Empty;
[Required, Comment("ผู้ร้องเรียน")]
public string Appellant { get; set; } = string.Empty;
[Comment("ผู้ร้องเรียน")]
public string? Appellant { get; set; } = string.Empty;
// [Required, Comment("อ้างอิงรหัสเอกสาร")]
// public Document Document { get; set; }
@ -134,6 +134,8 @@ namespace BMA.EHR.Domain.Models.Discipline
public string? ResultTitleType { get; set; }
[Comment("ปีงบประมาณ")]
public int? ResultYear { get; set; }
[Comment("ระดับโทษความผิดกรณีอื่นๆ")]
public string? DisciplinaryFaultLevelOther { get; set; }
public DisciplineInvestigate DisciplineInvestigate { get; set; }
public virtual List<DisciplineDisciplinary_ProfileComplaintInvestigate> DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; } = new List<DisciplineDisciplinary_ProfileComplaintInvestigate>();

View file

@ -17,26 +17,26 @@ namespace BMA.EHR.Domain.Models.Discipline
[Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")]
public string Title { get; set; } = string.Empty;
[Required, Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "text")]
public string Description { get; set; } = string.Empty;
[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("ระดับการพิจารณา 'ยังไม่ระบุ' (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;
[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;
[Comment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")]
public string? ComplaintFrom { get; set; } = string.Empty;
[Required, Comment("ผู้ร้องเรียน")]
public string Appellant { get; set; } = string.Empty;
[Comment("ผู้ร้องเรียน")]
public string? Appellant { get; set; } = string.Empty;
// [Required, Comment("อ้างอิงรหัสเอกสาร")]
// public Document Document { get; set; }

View file

@ -31,6 +31,8 @@ namespace BMA.EHR.Domain.Models.Discipline
public double? Salary { get; set; }
[Comment("ส่งไปยุติเรื่อง")]
public string? IsReport { get; set; } = "NEW";
[Comment("ส่งไปสอบสวน")]
public bool? IsDisciplinary { get; set; } = false;
[Required, Comment("Id เรื่องสืบสวน")]
public DisciplineInvestigate DisciplineInvestigate { get; set; }
}

View file

@ -0,0 +1,521 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class updatetableDisciplineDisciplinarysaddDisciplinaryFaultLevelOther : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "OffenseDetails",
table: "DisciplineInvestigates",
type: "longtext",
nullable: true,
comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LevelConsideration",
table: "DisciplineInvestigates",
type: "longtext",
nullable: true,
comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "DisciplineInvestigates",
type: "text",
nullable: true,
comment: "รายละเอียดของเรื่องร้องเรียน",
oldClrType: typeof(string),
oldType: "text",
oldComment: "รายละเอียดของเรื่องร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ComplaintFrom",
table: "DisciplineInvestigates",
type: "longtext",
nullable: true,
comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Appellant",
table: "DisciplineInvestigates",
type: "longtext",
nullable: true,
comment: "ผู้ร้องเรียน",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ผู้ร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<bool>(
name: "IsDisciplinary",
table: "DisciplineInvestigate_ProfileComplaints",
type: "tinyint(1)",
nullable: true,
comment: "ส่งไปสอบสวน");
migrationBuilder.AlterColumn<string>(
name: "OffenseDetails",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LevelConsideration",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "DisciplineDisciplinarys",
type: "text",
nullable: true,
comment: "รายละเอียดของเรื่องร้องเรียน",
oldClrType: typeof(string),
oldType: "text",
oldComment: "รายละเอียดของเรื่องร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ComplaintFrom",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Appellant",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "ผู้ร้องเรียน",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ผู้ร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "DisciplinaryFaultLevelOther",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: true,
comment: "ระดับโทษความผิดกรณีอื่นๆ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "OffenseDetails",
table: "DisciplineComplaints",
type: "longtext",
nullable: true,
comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LevelConsideration",
table: "DisciplineComplaints",
type: "longtext",
nullable: true,
comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "DisciplineComplaints",
type: "text",
nullable: true,
comment: "รายละเอียดของเรื่องร้องเรียน",
oldClrType: typeof(string),
oldType: "text",
oldComment: "รายละเอียดของเรื่องร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ComplaintFrom",
table: "DisciplineComplaints",
type: "longtext",
nullable: true,
comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Appellant",
table: "DisciplineComplaints",
type: "longtext",
nullable: true,
comment: "ผู้ร้องเรียน",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ผู้ร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsDisciplinary",
table: "DisciplineInvestigate_ProfileComplaints");
migrationBuilder.DropColumn(
name: "DisciplinaryFaultLevelOther",
table: "DisciplineDisciplinarys");
migrationBuilder.UpdateData(
table: "DisciplineInvestigates",
keyColumn: "OffenseDetails",
keyValue: null,
column: "OffenseDetails",
value: "");
migrationBuilder.AlterColumn<string>(
name: "OffenseDetails",
table: "DisciplineInvestigates",
type: "longtext",
nullable: false,
comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineInvestigates",
keyColumn: "LevelConsideration",
keyValue: null,
column: "LevelConsideration",
value: "");
migrationBuilder.AlterColumn<string>(
name: "LevelConsideration",
table: "DisciplineInvestigates",
type: "longtext",
nullable: false,
comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineInvestigates",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "DisciplineInvestigates",
type: "text",
nullable: false,
comment: "รายละเอียดของเรื่องร้องเรียน",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true,
oldComment: "รายละเอียดของเรื่องร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineInvestigates",
keyColumn: "ComplaintFrom",
keyValue: null,
column: "ComplaintFrom",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ComplaintFrom",
table: "DisciplineInvestigates",
type: "longtext",
nullable: false,
comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineInvestigates",
keyColumn: "Appellant",
keyValue: null,
column: "Appellant",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Appellant",
table: "DisciplineInvestigates",
type: "longtext",
nullable: false,
comment: "ผู้ร้องเรียน",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ผู้ร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineDisciplinarys",
keyColumn: "OffenseDetails",
keyValue: null,
column: "OffenseDetails",
value: "");
migrationBuilder.AlterColumn<string>(
name: "OffenseDetails",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: false,
comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineDisciplinarys",
keyColumn: "LevelConsideration",
keyValue: null,
column: "LevelConsideration",
value: "");
migrationBuilder.AlterColumn<string>(
name: "LevelConsideration",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: false,
comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineDisciplinarys",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "DisciplineDisciplinarys",
type: "text",
nullable: false,
comment: "รายละเอียดของเรื่องร้องเรียน",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true,
oldComment: "รายละเอียดของเรื่องร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineDisciplinarys",
keyColumn: "ComplaintFrom",
keyValue: null,
column: "ComplaintFrom",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ComplaintFrom",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: false,
comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineDisciplinarys",
keyColumn: "Appellant",
keyValue: null,
column: "Appellant",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Appellant",
table: "DisciplineDisciplinarys",
type: "longtext",
nullable: false,
comment: "ผู้ร้องเรียน",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ผู้ร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineComplaints",
keyColumn: "OffenseDetails",
keyValue: null,
column: "OffenseDetails",
value: "");
migrationBuilder.AlterColumn<string>(
name: "OffenseDetails",
table: "DisciplineComplaints",
type: "longtext",
nullable: false,
comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineComplaints",
keyColumn: "LevelConsideration",
keyValue: null,
column: "LevelConsideration",
value: "");
migrationBuilder.AlterColumn<string>(
name: "LevelConsideration",
table: "DisciplineComplaints",
type: "longtext",
nullable: false,
comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineComplaints",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "DisciplineComplaints",
type: "text",
nullable: false,
comment: "รายละเอียดของเรื่องร้องเรียน",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true,
oldComment: "รายละเอียดของเรื่องร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineComplaints",
keyColumn: "ComplaintFrom",
keyValue: null,
column: "ComplaintFrom",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ComplaintFrom",
table: "DisciplineComplaints",
type: "longtext",
nullable: false,
comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineComplaints",
keyColumn: "Appellant",
keyValue: null,
column: "Appellant",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Appellant",
table: "DisciplineComplaints",
type: "longtext",
nullable: false,
comment: "ผู้ร้องเรียน",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ผู้ร้องเรียน")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -29,12 +29,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<string>("Appellant")
.IsRequired()
.HasColumnType("longtext")
.HasComment("ผู้ร้องเรียน");
b.Property<string>("ComplaintFrom")
.IsRequired()
.HasColumnType("longtext")
.HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)");
@ -74,7 +72,6 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text")
.HasComment("รายละเอียดของเรื่องร้องเรียน");
@ -98,12 +95,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.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 คือ ร้ายแรง)");
@ -675,12 +670,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<string>("Appellant")
.IsRequired()
.HasColumnType("longtext")
.HasComment("ผู้ร้องเรียน");
b.Property<string>("ComplaintFrom")
.IsRequired()
.HasColumnType("longtext")
.HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)");
@ -720,7 +713,6 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text")
.HasComment("รายละเอียดของเรื่องร้องเรียน");
@ -768,6 +760,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.HasColumnType("longtext")
.HasComment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก");
b.Property<string>("DisciplinaryFaultLevelOther")
.HasColumnType("longtext")
.HasComment("ระดับโทษความผิดกรณีอื่นๆ");
b.Property<string>("DisciplinaryInvestigateAt")
.HasColumnType("longtext")
.HasComment("สอบสวนที่");
@ -855,12 +851,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.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 คือ ร้ายแรง)");
@ -1760,12 +1754,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<string>("Appellant")
.IsRequired()
.HasColumnType("longtext")
.HasComment("ผู้ร้องเรียน");
b.Property<string>("ComplaintFrom")
.IsRequired()
.HasColumnType("longtext")
.HasComment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)");
@ -1805,7 +1797,6 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.HasComment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text")
.HasComment("รายละเอียดของเรื่องร้องเรียน");
@ -1868,12 +1859,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.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 คือ ร้ายแรง)");
@ -2283,6 +2272,10 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
.HasColumnType("varchar(100)")
.HasComment("ชื่อ");
b.Property<bool?>("IsDisciplinary")
.HasColumnType("tinyint(1)")
.HasComment("ส่งไปสอบสวน");
b.Property<string>("IsReport")
.HasColumnType("longtext")
.HasComment("ส่งไปยุติเรื่อง");