Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 14s

This commit is contained in:
Suphonchai Phoonsawat 2025-02-10 15:10:19 +07:00
commit 5971933bab
8 changed files with 23717 additions and 24 deletions

View file

@ -0,0 +1,49 @@
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 ProfileComplaintInvestigate : EntityBase
{
[Comment("id อ้างอิง profile")]
public string? 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("id หน่วยงาน rootDna")]
public string? rootDnaId { get; set; }
[Comment("id หน่วยงาน child1Dna")]
public string? child1DnaId { get; set; }
[Comment("id หน่วยงาน child2Dna")]
public string? child2DnaId { get; set; }
[Comment("id หน่วยงาน child3Dna")]
public string? child3DnaId { get; set; }
[Comment("id หน่วยงาน child4Dna")]
public string? child4DnaId { get; set; }
[Comment("ประเภทคำสั่งลงโทษทางวินัย (C-PM-19->คำสั่งลงโทษปลดออกจากราชการ C-PM-20->คำสั่งลงโทษไล่ออกจากราชการ)")]
public string? commandType { get; set; }
[Comment("สถานภาพ (OFFICER->ข้าราชการ EMPLOYEE->ลูกจ้างประจำ)")]
public string? profileType { get; set; }
}
}

View file

@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addtableProfileComplaintInvestigate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View file

@ -0,0 +1,68 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class updatetableProfileComplaintInvestigate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ProfileComplaintInvestigate",
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<string>(type: "longtext", nullable: true, comment: "id อ้างอิง profile")
.Annotation("MySql:CharSet", "utf8mb4"),
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"),
rootDnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน rootDna")
.Annotation("MySql:CharSet", "utf8mb4"),
child1DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child1Dna")
.Annotation("MySql:CharSet", "utf8mb4"),
child2DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child2Dna")
.Annotation("MySql:CharSet", "utf8mb4"),
child3DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child3Dna")
.Annotation("MySql:CharSet", "utf8mb4"),
child4DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child4Dna")
.Annotation("MySql:CharSet", "utf8mb4"),
commandType = table.Column<string>(type: "longtext", nullable: true, comment: "ประเภทคำสั่งลงโทษทางวินัย (C-PM-19->คำสั่งลงโทษปลดออกจากราชการ C-PM-20->คำสั่งลงโทษไล่ออกจากราชการ)")
.Annotation("MySql:CharSet", "utf8mb4"),
profileType = table.Column<string>(type: "longtext", nullable: true, comment: "สถานภาพ (OFFICER->ข้าราชการ EMPLOYEE->ลูกจ้างประจำ)")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ProfileComplaintInvestigate", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProfileComplaintInvestigate");
}
}
}

View file

@ -2993,6 +2993,111 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
b.ToTable("Documents");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.ProfileComplaintInvestigate", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<string>("CitizenId")
.HasMaxLength(13)
.HasColumnType("varchar(13)")
.HasComment("รหัสบัตรประชาชน");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(100)
.HasComment("สร้างข้อมูลเมื่อ");
b.Property<string>("CreatedFullName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)")
.HasColumnOrder(104)
.HasComment("ชื่อ User ที่สร้างข้อมูล");
b.Property<string>("CreatedUserId")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<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>("PersonId")
.HasColumnType("longtext")
.HasComment("id อ้างอิง profile");
b.Property<string>("Prefix")
.HasColumnType("longtext")
.HasComment("คำนำหน้า");
b.Property<string>("child1DnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child1Dna");
b.Property<string>("child2DnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child2Dna");
b.Property<string>("child3DnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child3Dna");
b.Property<string>("child4DnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child4Dna");
b.Property<string>("commandType")
.HasColumnType("longtext")
.HasComment("ประเภทคำสั่งลงโทษทางวินัย (C-PM-19->คำสั่งลงโทษปลดออกจากราชการ C-PM-20->คำสั่งลงโทษไล่ออกจากราชการ)");
b.Property<string>("profileType")
.HasColumnType("longtext")
.HasComment("สถานภาพ (OFFICER->ข้าราชการ EMPLOYEE->ลูกจ้างประจำ)");
b.Property<string>("rootDnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน rootDna");
b.HasKey("Id");
b.ToTable("ProfileComplaintInvestigate");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal")

View file

@ -31,6 +31,7 @@ namespace BMA.EHR.Infrastructure.Persistence
public DbSet<DisciplineDisciplinary> DisciplineDisciplinarys { get; set; }
public DbSet<DisciplineDisciplinaryExtend> DisciplineDisciplinaryExtends { get; set; }
public DbSet<DisciplineDisciplinary_ProfileComplaintInvestigate> DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; }
public DbSet<ProfileComplaintInvestigate> ProfileComplaintInvestigate { get; set; }
public DbSet<DisciplineDisciplinary_DocInvestigateRelevant> DisciplineDisciplinary_DocInvestigateRelevants { get; set; }
public DbSet<DisciplineDisciplinary_DocInvestigate> DisciplineDisciplinary_DocInvestigates { get; set; }
public DbSet<DisciplineDisciplinary_DocResult> DisciplineDisciplinary_DocResults { get; set; }

View file

@ -1550,13 +1550,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Count();
//ปลดออก
var dl_cm19_count = _contextDiscipline.DisciplineDisciplinary_ProfileComplaintInvestigates
var dl_cm19_count = _contextDiscipline.ProfileComplaintInvestigate
.Where(x =>
x.CreatedAt.Date >= startDate &&
x.CreatedAt.Date <= endDate &&
x.Status.Trim().ToUpper() == "DONE" &&
x.profileType.Trim().ToUpper() == "OFFICER" &&
x.CommandTypeId == Guid.Parse("ef8db4d7-1472-4c1d-b73f-9114e618a96f") &&
x.commandType.Trim().ToUpper() == "C-PM-19" &&
(node == 0 ? x.rootDnaId.Contains(org.rootDnaId) : true) &&
(node == 1 ? x.child1DnaId.Contains(org.child1DnaId) : true) &&
(node == 2 ? x.child2DnaId.Contains(org.child2DnaId) : true) &&
@ -1565,13 +1564,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Count();
//ไล่ออก
var dl_cm20_count = _contextDiscipline.DisciplineDisciplinary_ProfileComplaintInvestigates
var dl_cm20_count = _contextDiscipline.ProfileComplaintInvestigate
.Where(x =>
x.CreatedAt.Date >= startDate &&
x.CreatedAt.Date <= endDate &&
x.Status.Trim().ToUpper() == "DONE" &&
x.profileType.Trim().ToUpper() == "OFFICER" &&
x.CommandTypeId == Guid.Parse("d9dee5c3-b75a-4927-9ce2-51e2233cf20b") &&
x.commandType.Trim().ToUpper() == "C-PM-20" &&
(node == 0 ? x.rootDnaId.Contains(org.rootDnaId) : true) &&
(node == 1 ? x.child1DnaId.Contains(org.child1DnaId) : true) &&
(node == 2 ? x.child2DnaId.Contains(org.child2DnaId) : true) &&
@ -1678,13 +1676,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Count();
//ปลดออก
var dl_cm19_count = _contextDiscipline.DisciplineDisciplinary_ProfileComplaintInvestigates
var dl_cm19_count = _contextDiscipline.ProfileComplaintInvestigate
.Where(x =>
x.CreatedAt.Date >= startDate &&
x.CreatedAt.Date <= endDate &&
x.Status.Trim().ToUpper() == "DONE" &&
x.profileType.Trim().ToUpper() == "OFFICER" &&
x.CommandTypeId == Guid.Parse("ef8db4d7-1472-4c1d-b73f-9114e618a96f") &&
x.commandType.Trim().ToUpper() == "C-PM-19" &&
(node == 0 ? x.rootDnaId.Contains(org.rootDnaId) : true) &&
(node == 1 ? x.child1DnaId.Contains(org.child1DnaId) : true) &&
(node == 2 ? x.child2DnaId.Contains(org.child2DnaId) : true) &&
@ -1693,13 +1690,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Count();
//ไล่ออก
var dl_cm20_count = _contextDiscipline.DisciplineDisciplinary_ProfileComplaintInvestigates
var dl_cm20_count = _contextDiscipline.ProfileComplaintInvestigate
.Where(x =>
x.CreatedAt.Date >= startDate &&
x.CreatedAt.Date <= endDate &&
x.Status.Trim().ToUpper() == "DONE" &&
x.profileType.Trim().ToUpper() == "OFFICER" &&
x.CommandTypeId == Guid.Parse("d9dee5c3-b75a-4927-9ce2-51e2233cf20b") &&
x.commandType.Trim().ToUpper() == "C-PM-20" &&
(node == 0 ? x.rootDnaId.Contains(org.rootDnaId) : true) &&
(node == 1 ? x.child1DnaId.Contains(org.child1DnaId) : true) &&
(node == 2 ? x.child2DnaId.Contains(org.child2DnaId) : true) &&
@ -1879,13 +1875,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Count();
//ปลดออก
var dl_cm19_count = _contextDiscipline.DisciplineDisciplinary_ProfileComplaintInvestigates
var dl_cm19_count = _contextDiscipline.ProfileComplaintInvestigate
.Where(x =>
x.CreatedAt.Date >= startDate &&
x.CreatedAt.Date <= endDate &&
x.Status.Trim().ToUpper() == "DONE" &&
x.profileType.Trim().ToUpper() == "EMPLOYEE" &&
x.CommandTypeId == Guid.Parse("ef8db4d7-1472-4c1d-b73f-9114e618a96f") &&
x.commandType.Trim().ToUpper() == "C-PM-19" &&
(node == 0 ? x.rootDnaId.Contains(org.rootDnaId) : true) &&
(node == 1 ? x.child1DnaId.Contains(org.child1DnaId) : true) &&
(node == 2 ? x.child2DnaId.Contains(org.child2DnaId) : true) &&
@ -1894,13 +1889,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Count();
//ไล่ออก
var dl_cm20_count = _contextDiscipline.DisciplineDisciplinary_ProfileComplaintInvestigates
var dl_cm20_count = _contextDiscipline.ProfileComplaintInvestigate
.Where(x =>
x.CreatedAt.Date >= startDate &&
x.CreatedAt.Date <= endDate &&
x.Status.Trim().ToUpper() == "DONE" &&
x.profileType.Trim().ToUpper() == "EMPLOYEE" &&
x.CommandTypeId == Guid.Parse("d9dee5c3-b75a-4927-9ce2-51e2233cf20b") &&
x.commandType.Trim().ToUpper() == "C-PM-20" &&
(node == 0 ? x.rootDnaId.Contains(org.rootDnaId) : true) &&
(node == 1 ? x.child1DnaId.Contains(org.child1DnaId) : true) &&
(node == 2 ? x.child2DnaId.Contains(org.child2DnaId) : true) &&
@ -1985,13 +1979,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Count();
//ปลดออก
var dl_cm19_count = _contextDiscipline.DisciplineDisciplinary_ProfileComplaintInvestigates
var dl_cm19_count = _contextDiscipline.ProfileComplaintInvestigate
.Where(x =>
x.CreatedAt.Date >= startDate &&
x.CreatedAt.Date <= endDate &&
x.Status.Trim().ToUpper() == "DONE" &&
x.profileType.Trim().ToUpper() == "EMPLOYEE" &&
x.CommandTypeId == Guid.Parse("ef8db4d7-1472-4c1d-b73f-9114e618a96f") &&
x.commandType.Trim().ToUpper() == "C-PM-19" &&
(node == 0 ? x.rootDnaId.Contains(org.rootDnaId) : true) &&
(node == 1 ? x.child1DnaId.Contains(org.child1DnaId) : true) &&
(node == 2 ? x.child2DnaId.Contains(org.child2DnaId) : true) &&
@ -2000,13 +1993,12 @@ namespace BMA.EHR.Retirement.Service.Controllers
.Count();
//ไล่ออก
var dl_cm20_count = _contextDiscipline.DisciplineDisciplinary_ProfileComplaintInvestigates
var dl_cm20_count = _contextDiscipline.ProfileComplaintInvestigate
.Where(x =>
x.CreatedAt.Date >= startDate &&
x.CreatedAt.Date <= endDate &&
x.Status.Trim().ToUpper() == "DONE" &&
x.profileType.Trim().ToUpper() == "EMPLOYEE" &&
x.CommandTypeId == Guid.Parse("d9dee5c3-b75a-4927-9ce2-51e2233cf20b") &&
x.commandType.Trim().ToUpper() == "C-PM-20" &&
(node == 0 ? x.rootDnaId.Contains(org.rootDnaId) : true) &&
(node == 1 ? x.child1DnaId.Contains(org.child1DnaId) : true) &&
(node == 2 ? x.child2DnaId.Contains(org.child2DnaId) : true) &&