เก็บประวัติการขยายเวลา
This commit is contained in:
parent
8dae449c62
commit
0c1ae31b22
12 changed files with 11898 additions and 0 deletions
|
|
@ -416,6 +416,13 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
||||||
DisciplinaryStatusResult = x.DisciplinaryStatusResult,
|
DisciplinaryStatusResult = x.DisciplinaryStatusResult,
|
||||||
DisciplinaryCauseText = x.DisciplinaryCauseText,
|
DisciplinaryCauseText = x.DisciplinaryCauseText,
|
||||||
DisciplinaryResult = x.DisciplinaryResult,
|
DisciplinaryResult = x.DisciplinaryResult,
|
||||||
|
DisciplinaryExtendHistory = x.DisciplineDisciplinaryExtends.Select(e => new
|
||||||
|
{
|
||||||
|
Name = e.Name,
|
||||||
|
Num = e.Num,
|
||||||
|
DateStart = e.DateStart,
|
||||||
|
DateEnd = e.DateEnd,
|
||||||
|
}),
|
||||||
Status = x.Status,
|
Status = x.Status,
|
||||||
Result = x.Result,
|
Result = x.Result,
|
||||||
Director = x.DisciplineDisciplinary_DirectorInvestigates.Select(d => new
|
Director = x.DisciplineDisciplinary_DirectorInvestigates.Select(d => new
|
||||||
|
|
@ -538,6 +545,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
||||||
_data.DisciplinaryStatusResult,
|
_data.DisciplinaryStatusResult,
|
||||||
_data.DisciplinaryCauseText,
|
_data.DisciplinaryCauseText,
|
||||||
_data.DisciplinaryResult,
|
_data.DisciplinaryResult,
|
||||||
|
_data.DisciplinaryExtendHistory,
|
||||||
_data.Status,
|
_data.Status,
|
||||||
_data.Result,
|
_data.Result,
|
||||||
_data.Director,
|
_data.Director,
|
||||||
|
|
@ -568,12 +576,15 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
||||||
.Include(x => x.DisciplineDisciplinary_DirectorInvestigates)
|
.Include(x => x.DisciplineDisciplinary_DirectorInvestigates)
|
||||||
.ThenInclude(x => x.DisciplineDirector)
|
.ThenInclude(x => x.DisciplineDirector)
|
||||||
.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates)
|
.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates)
|
||||||
|
.Include(x => x.DisciplineDisciplinaryExtends)
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), (int)StatusCodes.Status500InternalServerError);
|
||||||
|
var editExtend = false;
|
||||||
|
if (data.DisciplinaryDateEnd != req.DisciplinaryDateEnd) editExtend = true;
|
||||||
|
|
||||||
data.DisciplinaryWitnesses = req.DisciplinaryWitnesses;
|
data.DisciplinaryWitnesses = req.DisciplinaryWitnesses;
|
||||||
data.DisciplinaryRecordAccuser = req.DisciplinaryRecordAccuser;
|
data.DisciplinaryRecordAccuser = req.DisciplinaryRecordAccuser;
|
||||||
|
|
@ -597,6 +608,24 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
||||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
data.LastUpdateUserId = UserId ?? "";
|
data.LastUpdateUserId = UserId ?? "";
|
||||||
data.LastUpdatedAt = DateTime.Now;
|
data.LastUpdatedAt = DateTime.Now;
|
||||||
|
if (editExtend == true)
|
||||||
|
{
|
||||||
|
var sumExtend = data.DisciplineDisciplinaryExtends.Count();
|
||||||
|
data.DisciplineDisciplinaryExtends.Add(
|
||||||
|
new DisciplineDisciplinaryExtend
|
||||||
|
{
|
||||||
|
Name = sumExtend > 0 ? "ขยายครั้งที่" + sumExtend : "วันที่สอบสวน",
|
||||||
|
Num = sumExtend,
|
||||||
|
DateStart = sumExtend > 0 ? data.DisciplinaryDateEnd.Value.AddDays(data.DisciplinaryDaysExtend == null ? 0 : -(double)data.DisciplinaryDaysExtend) : data.DisciplinaryDateStart,
|
||||||
|
DateEnd = data.DisciplinaryDateEnd,
|
||||||
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
CreatedUserId = UserId ?? "",
|
||||||
|
CreatedAt = DateTime.Now,
|
||||||
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
|
LastUpdateUserId = UserId ?? "",
|
||||||
|
LastUpdatedAt = DateTime.Now,
|
||||||
|
});
|
||||||
|
}
|
||||||
_context.DisciplineDisciplinary_DirectorInvestigates.RemoveRange(data.DisciplineDisciplinary_DirectorInvestigates);
|
_context.DisciplineDisciplinary_DirectorInvestigates.RemoveRange(data.DisciplineDisciplinary_DirectorInvestigates);
|
||||||
foreach (var item in req.directors)
|
foreach (var item in req.directors)
|
||||||
{
|
{
|
||||||
|
|
@ -1470,5 +1499,32 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ปฏิทินรายการวินัยเรื่องสอบสวน
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("calendar")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetCalendarDisciplineDisciplinary([FromBody] DisciplineCalendarRequest req)
|
||||||
|
{
|
||||||
|
var data = await _context.DisciplineDisciplinarys
|
||||||
|
.Where(x => x.DisciplinaryDateStart != null)
|
||||||
|
.Where(x => x.DisciplinaryDateEnd != null)
|
||||||
|
.Where(x => x.DisciplinaryDateStart.Value.Year == req.year || x.DisciplinaryDateEnd.Value.Year == req.year || x.DisciplinaryDateStart.Value.Month == req.month || x.DisciplinaryDateEnd.Value.Month == req.month)
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
Id = x.Id,//id ข้อมูลเรื่องสอบสวน
|
||||||
|
Title = x.Title,//ชื่อเรื่อง
|
||||||
|
DisciplinaryDateStart = x.DisciplinaryDateStart,//
|
||||||
|
DisciplinaryDateEnd = x.DisciplinaryDateEnd,//
|
||||||
|
})
|
||||||
|
.OrderBy(d => d.DisciplinaryDateStart.Value.Date)
|
||||||
|
.ToListAsync();
|
||||||
|
return Success(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,13 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
InvestigationCauseText = x.InvestigationCauseText,
|
InvestigationCauseText = x.InvestigationCauseText,
|
||||||
InvestigationExtendStatus = x.InvestigationExtendStatus,
|
InvestigationExtendStatus = x.InvestigationExtendStatus,
|
||||||
InvestigationDaysExtend = x.InvestigationDaysExtend,
|
InvestigationDaysExtend = x.InvestigationDaysExtend,
|
||||||
|
InvestigationExtendHistory = x.DisciplineInvestigateExtends.Select(e => new
|
||||||
|
{
|
||||||
|
Name = e.Name,
|
||||||
|
Num = e.Num,
|
||||||
|
DateStart = e.DateStart,
|
||||||
|
DateEnd = e.DateEnd,
|
||||||
|
}),
|
||||||
Status = x.Status,//สถานะเรื่องสืบสวน
|
Status = x.Status,//สถานะเรื่องสืบสวน
|
||||||
Result = x.Result,//ผลการตรวจสอบ
|
Result = x.Result,//ผลการตรวจสอบ
|
||||||
Director = x.DisciplineInvestigate_Directors.Select(d => new
|
Director = x.DisciplineInvestigate_Directors.Select(d => new
|
||||||
|
|
@ -322,6 +329,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
_data.InvestigationCauseText,
|
_data.InvestigationCauseText,
|
||||||
_data.InvestigationExtendStatus,
|
_data.InvestigationExtendStatus,
|
||||||
_data.InvestigationDaysExtend,
|
_data.InvestigationDaysExtend,
|
||||||
|
_data.InvestigationExtendHistory,
|
||||||
_data.Status,
|
_data.Status,
|
||||||
_data.Result,
|
_data.Result,
|
||||||
_data.Director,
|
_data.Director,
|
||||||
|
|
@ -346,6 +354,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
public async Task<ActionResult<ResponseObject>> UpdateDisciplineInvestigate([FromBody] DisciplineInvestigateRequest req, Guid id)
|
public async Task<ActionResult<ResponseObject>> UpdateDisciplineInvestigate([FromBody] DisciplineInvestigateRequest req, Guid id)
|
||||||
{
|
{
|
||||||
var data = await _context.DisciplineInvestigates
|
var data = await _context.DisciplineInvestigates
|
||||||
|
.Include(x => x.DisciplineInvestigateExtends)
|
||||||
.Include(x => x.DisciplineInvestigate_ProfileComplaints)
|
.Include(x => x.DisciplineInvestigate_ProfileComplaints)
|
||||||
.Include(x => x.DisciplineInvestigate_Directors)
|
.Include(x => x.DisciplineInvestigate_Directors)
|
||||||
.ThenInclude(x => x.DisciplineDirector)
|
.ThenInclude(x => x.DisciplineDirector)
|
||||||
|
|
@ -355,6 +364,8 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||||
if (data.Status.Trim().ToUpper() != "NEW")
|
if (data.Status.Trim().ToUpper() != "NEW")
|
||||||
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
return Error(new Exception("ไม่สามารถแก้ไขข้อมูลนี้ได้"), StatusCodes.Status500InternalServerError);
|
||||||
|
var editExtend = false;
|
||||||
|
if (data.InvestigationDateEnd != req.investigationDateEnd) editExtend = true;
|
||||||
|
|
||||||
data.InvestigationDetail = req.investigationDetail.Trim().ToUpper();
|
data.InvestigationDetail = req.investigationDetail.Trim().ToUpper();
|
||||||
data.InvestigationDetailOther = req.investigationDetailOther;
|
data.InvestigationDetailOther = req.investigationDetailOther;
|
||||||
|
|
@ -369,6 +380,24 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
||||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
data.LastUpdateUserId = UserId ?? "";
|
data.LastUpdateUserId = UserId ?? "";
|
||||||
data.LastUpdatedAt = DateTime.Now;
|
data.LastUpdatedAt = DateTime.Now;
|
||||||
|
if (editExtend == true)
|
||||||
|
{
|
||||||
|
var sumExtend = data.DisciplineInvestigateExtends.Count();
|
||||||
|
data.DisciplineInvestigateExtends.Add(
|
||||||
|
new DisciplineInvestigateExtend
|
||||||
|
{
|
||||||
|
Name = sumExtend > 0 ? "ขยายครั้งที่" + sumExtend : "วันที่สืบสวน",
|
||||||
|
Num = sumExtend,
|
||||||
|
DateStart = sumExtend > 0 ? data.InvestigationDateEnd.Value.AddDays(data.InvestigationDaysExtend == null ? 0 : -(double)data.InvestigationDaysExtend) : data.InvestigationDateStart,
|
||||||
|
DateEnd = data.InvestigationDateEnd,
|
||||||
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
CreatedUserId = UserId ?? "",
|
||||||
|
CreatedAt = DateTime.Now,
|
||||||
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
|
LastUpdateUserId = UserId ?? "",
|
||||||
|
LastUpdatedAt = DateTime.Now,
|
||||||
|
});
|
||||||
|
}
|
||||||
_context.DisciplineInvestigate_Directors.RemoveRange(data.DisciplineInvestigate_Directors);
|
_context.DisciplineInvestigate_Directors.RemoveRange(data.DisciplineInvestigate_Directors);
|
||||||
foreach (var item in req.directors)
|
foreach (var item in req.directors)
|
||||||
{
|
{
|
||||||
|
|
@ -881,5 +910,32 @@ namespace BMA.EHR.DisciplineInvestigate.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>
|
||||||
|
[HttpPost("calendar")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetCalendarDisciplineInvestigate([FromBody] DisciplineCalendarRequest req)
|
||||||
|
{
|
||||||
|
var data = await _context.DisciplineInvestigates
|
||||||
|
.Where(x => x.InvestigationDateStart != null)
|
||||||
|
.Where(x => x.InvestigationDateEnd != null)
|
||||||
|
.Where(x => x.InvestigationDateStart.Value.Year == req.year || x.InvestigationDateEnd.Value.Year == req.year || x.InvestigationDateStart.Value.Month == req.month || x.InvestigationDateEnd.Value.Month == req.month)
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
Id = x.Id,//id ข้อมูลเรื่องสืบสวน
|
||||||
|
Title = x.Title,//ชื่อเรื่อง
|
||||||
|
InvestigationDateStart = x.InvestigationDateStart,//
|
||||||
|
InvestigationDateEnd = x.InvestigationDateEnd,//
|
||||||
|
})
|
||||||
|
.OrderBy(d => d.InvestigationDateStart.Value.Date)
|
||||||
|
.ToListAsync();
|
||||||
|
return Success(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
|
PersonId = x.PersonId,
|
||||||
CitizenId = x.CitizenId,
|
CitizenId = x.CitizenId,
|
||||||
Prefix = x.Prefix,
|
Prefix = x.Prefix,
|
||||||
FirstName = x.FirstName,
|
FirstName = x.FirstName,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Discipline.Service.Requests
|
||||||
|
{
|
||||||
|
public class DisciplineCalendarRequest
|
||||||
|
{
|
||||||
|
public int year { get; set; }//
|
||||||
|
public int month { get; set; }//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -139,5 +139,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<DisciplineDisciplinaryExtend> DisciplineDisciplinaryExtends { get; set; } = new List<DisciplineDisciplinaryExtend>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
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 DisciplineDisciplinaryExtend : EntityBase
|
||||||
|
{
|
||||||
|
[Comment("ชื่อการขยาย")]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
[Comment("ครั้งที่ขยาย")]
|
||||||
|
public int Num { get; set; }
|
||||||
|
[Comment("วันที่เริ่ม")]
|
||||||
|
public DateTime? DateStart { get; set; }
|
||||||
|
[Comment("วันที่สิ้นสุด")]
|
||||||
|
public DateTime? DateEnd { get; set; }
|
||||||
|
[Required, Comment("Id เรื่องสอบสวน")]
|
||||||
|
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -87,5 +87,6 @@ namespace BMA.EHR.Domain.Models.Discipline
|
||||||
public virtual List<DisciplineInvestigateRelevant_Doc> DisciplineInvestigateRelevant_Docs { get; set; } = new List<DisciplineInvestigateRelevant_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>();
|
public virtual List<DisciplineInvestigate_Director> DisciplineInvestigate_Directors { get; set; } = new List<DisciplineInvestigate_Director>();
|
||||||
public virtual List<DisciplineDisciplinary> DisciplineDisciplinarys { get; set; } = new List<DisciplineDisciplinary>();
|
public virtual List<DisciplineDisciplinary> DisciplineDisciplinarys { get; set; } = new List<DisciplineDisciplinary>();
|
||||||
|
public virtual List<DisciplineInvestigateExtend> DisciplineInvestigateExtends { get; set; } = new List<DisciplineInvestigateExtend>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
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 DisciplineInvestigateExtend : EntityBase
|
||||||
|
{
|
||||||
|
[Comment("ชื่อการขยาย")]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
[Comment("ครั้งที่ขยาย")]
|
||||||
|
public int Num { get; set; }
|
||||||
|
[Comment("วันที่เริ่ม")]
|
||||||
|
public DateTime? DateStart { get; set; }
|
||||||
|
[Comment("วันที่สิ้นสุด")]
|
||||||
|
public DateTime? DateEnd { get; set; }
|
||||||
|
[Required, Comment("Id เรื่องสืบสวน")]
|
||||||
|
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
11450
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231206093300_add table DisciplineInvestigateExtends.Designer.cs
generated
Normal file
11450
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231206093300_add table DisciplineInvestigateExtends.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,103 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addtableDisciplineInvestigateExtends : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "DisciplineDisciplinaryExtends",
|
||||||
|
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"),
|
||||||
|
Name = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อการขยาย")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
Num = table.Column<int>(type: "int", nullable: false, comment: "ครั้งที่ขยาย"),
|
||||||
|
DateStart = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่เริ่ม"),
|
||||||
|
DateEnd = 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_DisciplineDisciplinaryExtends", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_DisciplineDisciplinaryExtends_DisciplineDisciplinarys_Discip~",
|
||||||
|
column: x => x.DisciplineDisciplinaryId,
|
||||||
|
principalTable: "DisciplineDisciplinarys",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "DisciplineInvestigateExtends",
|
||||||
|
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"),
|
||||||
|
Name = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อการขยาย")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
Num = table.Column<int>(type: "int", nullable: false, comment: "ครั้งที่ขยาย"),
|
||||||
|
DateStart = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่เริ่ม"),
|
||||||
|
DateEnd = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่สิ้นสุด"),
|
||||||
|
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_DisciplineInvestigateExtends", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_DisciplineInvestigateExtends_DisciplineInvestigates_Discipli~",
|
||||||
|
column: x => x.DisciplineInvestigateId,
|
||||||
|
principalTable: "DisciplineInvestigates",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_DisciplineDisciplinaryExtends_DisciplineDisciplinaryId",
|
||||||
|
table: "DisciplineDisciplinaryExtends",
|
||||||
|
column: "DisciplineDisciplinaryId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_DisciplineInvestigateExtends_DisciplineInvestigateId",
|
||||||
|
table: "DisciplineInvestigateExtends",
|
||||||
|
column: "DisciplineInvestigateId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "DisciplineDisciplinaryExtends");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "DisciplineInvestigateExtends");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -679,6 +679,79 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
b.ToTable("DisciplineDisciplinarys");
|
b.ToTable("DisciplineDisciplinarys");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", 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<DateTime?>("DateEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่สิ้นสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DateStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่เริ่ม");
|
||||||
|
|
||||||
|
b.Property<Guid>("DisciplineDisciplinaryId")
|
||||||
|
.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.Property<string>("Name")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อการขยาย");
|
||||||
|
|
||||||
|
b.Property<int>("Num")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("ครั้งที่ขยาย");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DisciplineDisciplinaryId");
|
||||||
|
|
||||||
|
b.ToTable("DisciplineDisciplinaryExtends");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -1508,6 +1581,79 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
b.ToTable("DisciplineInvestigates");
|
b.ToTable("DisciplineInvestigates");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", 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<DateTime?>("DateEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่สิ้นสุด");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DateStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasComment("วันที่เริ่ม");
|
||||||
|
|
||||||
|
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.Property<string>("Name")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ชื่อการขยาย");
|
||||||
|
|
||||||
|
b.Property<int>("Num")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("ครั้งที่ขยาย");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("DisciplineInvestigateId");
|
||||||
|
|
||||||
|
b.ToTable("DisciplineInvestigateExtends");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -9978,6 +10124,17 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
b.Navigation("DisciplineInvestigate");
|
b.Navigation("DisciplineInvestigate");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinaryExtend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", "DisciplineDisciplinary")
|
||||||
|
.WithMany("DisciplineDisciplinaryExtends")
|
||||||
|
.HasForeignKey("DisciplineDisciplinaryId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("DisciplineDisciplinary");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary_DirectorInvestigate", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector")
|
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineDirector", "DisciplineDirector")
|
||||||
|
|
@ -10171,6 +10328,17 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
b.Navigation("DisciplineComplaint");
|
b.Navigation("DisciplineComplaint");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateExtend", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate")
|
||||||
|
.WithMany("DisciplineInvestigateExtends")
|
||||||
|
.HasForeignKey("DisciplineInvestigateId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("DisciplineInvestigate");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigateRelevant_Doc", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate")
|
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineInvestigate", "DisciplineInvestigate")
|
||||||
|
|
@ -11060,6 +11228,8 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineDisciplinary", b =>
|
||||||
{
|
{
|
||||||
|
b.Navigation("DisciplineDisciplinaryExtends");
|
||||||
|
|
||||||
b.Navigation("DisciplineDisciplinary_DirectorInvestigates");
|
b.Navigation("DisciplineDisciplinary_DirectorInvestigates");
|
||||||
|
|
||||||
b.Navigation("DisciplineDisciplinary_DocComplaintInvestigates");
|
b.Navigation("DisciplineDisciplinary_DocComplaintInvestigates");
|
||||||
|
|
@ -11090,6 +11260,8 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||||
{
|
{
|
||||||
b.Navigation("DisciplineDisciplinarys");
|
b.Navigation("DisciplineDisciplinarys");
|
||||||
|
|
||||||
|
b.Navigation("DisciplineInvestigateExtends");
|
||||||
|
|
||||||
b.Navigation("DisciplineInvestigateRelevant_Docs");
|
b.Navigation("DisciplineInvestigateRelevant_Docs");
|
||||||
|
|
||||||
b.Navigation("DisciplineInvestigate_Directors");
|
b.Navigation("DisciplineInvestigate_Directors");
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ namespace BMA.EHR.Infrastructure.Persistence
|
||||||
public DbSet<DisciplineComplaint_Doc> DisciplineComplaint_Docs { get; set; }
|
public DbSet<DisciplineComplaint_Doc> DisciplineComplaint_Docs { get; set; }
|
||||||
|
|
||||||
public DbSet<DisciplineInvestigate> DisciplineInvestigates { get; set; }
|
public DbSet<DisciplineInvestigate> DisciplineInvestigates { get; set; }
|
||||||
|
public DbSet<DisciplineInvestigateExtend> DisciplineInvestigateExtends { get; set; }
|
||||||
public DbSet<DisciplineInvestigate_ProfileComplaint> DisciplineInvestigate_ProfileComplaints { get; set; }
|
public DbSet<DisciplineInvestigate_ProfileComplaint> DisciplineInvestigate_ProfileComplaints { get; set; }
|
||||||
public DbSet<DisciplineInvestigate_DocComplaint> DisciplineInvestigate_DocComplaints { get; set; }
|
public DbSet<DisciplineInvestigate_DocComplaint> DisciplineInvestigate_DocComplaints { get; set; }
|
||||||
public DbSet<DisciplineInvestigate_Doc> DisciplineInvestigate_Docs { get; set; }
|
public DbSet<DisciplineInvestigate_Doc> DisciplineInvestigate_Docs { get; set; }
|
||||||
|
|
@ -28,6 +29,7 @@ namespace BMA.EHR.Infrastructure.Persistence
|
||||||
public DbSet<DisciplineInvestigateRelevant_Doc> DisciplineInvestigateRelevant_Docs { get; set; }
|
public DbSet<DisciplineInvestigateRelevant_Doc> DisciplineInvestigateRelevant_Docs { get; set; }
|
||||||
|
|
||||||
public DbSet<DisciplineDisciplinary> DisciplineDisciplinarys { get; set; }
|
public DbSet<DisciplineDisciplinary> DisciplineDisciplinarys { get; set; }
|
||||||
|
public DbSet<DisciplineDisciplinaryExtend> DisciplineDisciplinaryExtends { get; set; }
|
||||||
public DbSet<DisciplineDisciplinary_ProfileComplaintInvestigate> DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; }
|
public DbSet<DisciplineDisciplinary_ProfileComplaintInvestigate> DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; }
|
||||||
public DbSet<DisciplineDisciplinary_DocInvestigateRelevant> DisciplineDisciplinary_DocInvestigateRelevants { get; set; }
|
public DbSet<DisciplineDisciplinary_DocInvestigateRelevant> DisciplineDisciplinary_DocInvestigateRelevants { get; set; }
|
||||||
public DbSet<DisciplineDisciplinary_DocInvestigate> DisciplineDisciplinary_DocInvestigates { get; set; }
|
public DbSet<DisciplineDisciplinary_DocInvestigate> DisciplineDisciplinary_DocInvestigates { get; set; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue