add field เพื่อระบบกรอกข้อมูลทะเบียนประวัติ

This commit is contained in:
Suphonchai Phoonsawat 2024-02-09 12:49:13 +07:00
parent 1f4cee21c7
commit c704556891
11 changed files with 51552 additions and 1 deletions

View file

@ -335,5 +335,7 @@ namespace BMA.EHR.Domain.Models.HR
[Comment("วันที่รอบการลงเวลามีผล")]
public DateTime? DutyTimeEffectiveDate { get; set; }
public virtual List<ProfileLeaveSummary> LeaveSummary { get; set; } = new();
}
}

View file

@ -0,0 +1,23 @@
using BMA.EHR.Domain.Models.Base;
namespace BMA.EHR.Domain.Models.HR
{
public class ProfileLeaveSummary : EntityBase
{
public virtual Profile? Profile { get; set; }
public int LeaveYear { get; set; } = 0;
public string? SumSick { get; set; } = string.Empty;
public string? SumRest { get; set; } = string.Empty;
public string? SumLate { get; set; } = string.Empty;
public string? SumAbsent { get; set; } = string.Empty;
public string? SumEducation { get; set; } = string.Empty;
public bool IsActive { get; set; } = true;
}
}

View file

@ -70,18 +70,34 @@ namespace BMA.EHR.Domain.Models.HR
[Comment("OrgName")]
public string? OrgName { get; set; }
[Comment("AgencyName")]
public string? AgencyName { get; set; }
[Comment("PosNoName")]
public string? PosNoName { get; set; }
// Add For Entry
public string? PositionRef { get; set; }
public string? PositionTypeName { get; set; }
public string? PositionLevelName { get; set; }
[Comment("PositionName")]
public string? PositionName { get; set; }
[Comment("PositionLineName")]
public string? PositionLineName { get; set; }
[Comment("CLevel")]
public string? CLevel { get; set; }
[Comment("PositionPathSideName")]
public string? PositionPathSideName { get; set; }
[Comment("PositionExecutiveName")]
public string? PositionExecutiveName { get; set; }
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,66 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddProfileLeaveSummaryTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ProfileLeaveSummary",
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"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LeaveYear = table.Column<int>(type: "int", nullable: false),
SumSick = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SumRest = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SumLate = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SumAbsent = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SumEducation = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ProfileLeaveSummary", x => x.Id);
table.ForeignKey(
name: "FK_ProfileLeaveSummary_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_ProfileLeaveSummary_ProfileId",
table: "ProfileLeaveSummary",
column: "ProfileId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProfileLeaveSummary");
}
}
}

View file

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddIsActivetoProfileLeaveSummaryTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "ProfileLeaveSummary",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsActive",
table: "ProfileLeaveSummary");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,51 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddFieldstoProfileSalaryTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "PositionLevelName",
table: "ProfileSalaries",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionRef",
table: "ProfileSalaries",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionTypeName",
table: "ProfileSalaries",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PositionLevelName",
table: "ProfileSalaries");
migrationBuilder.DropColumn(
name: "PositionRef",
table: "ProfileSalaries");
migrationBuilder.DropColumn(
name: "PositionTypeName",
table: "ProfileSalaries");
}
}
}

View file

@ -4259,6 +4259,84 @@ namespace BMA.EHR.Infrastructure.Migrations
b.ToTable("ProfileLeaveHistorys");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveSummary", 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<bool>("IsActive")
.HasColumnType("tinyint(1)");
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<int>("LeaveYear")
.HasColumnType("int");
b.Property<Guid?>("ProfileId")
.HasColumnType("char(36)");
b.Property<string>("SumAbsent")
.HasColumnType("longtext");
b.Property<string>("SumEducation")
.HasColumnType("longtext");
b.Property<string>("SumLate")
.HasColumnType("longtext");
b.Property<string>("SumRest")
.HasColumnType("longtext");
b.Property<string>("SumSick")
.HasColumnType("longtext");
b.HasKey("Id");
b.HasIndex("ProfileId");
b.ToTable("ProfileLeaveSummary");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b =>
{
b.Property<int>("Id")
@ -4883,6 +4961,9 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Property<Guid?>("PositionLevelId")
.HasColumnType("char(36)");
b.Property<string>("PositionLevelName")
.HasColumnType("longtext");
b.Property<Guid?>("PositionLineId")
.HasColumnType("char(36)")
.HasComment("Id สายงาน");
@ -4903,6 +4984,9 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("PositionPathSideName");
b.Property<string>("PositionRef")
.HasColumnType("longtext");
b.Property<double?>("PositionSalaryAmount")
.HasColumnType("double")
.HasComment("เงินประจำตำแหน่ง");
@ -4911,6 +4995,9 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("char(36)")
.HasComment("Id ประเภทตำแหน่ง");
b.Property<string>("PositionTypeName")
.HasColumnType("longtext");
b.Property<Guid?>("ProfileId")
.HasColumnType("char(36)");
@ -15123,6 +15210,15 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("TypeLeave");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileLeaveSummary", b =>
{
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
.WithMany("LeaveSummary")
.HasForeignKey("ProfileId");
b.Navigation("Profile");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileMotherHistory", b =>
{
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
@ -16773,6 +16869,8 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("Insignias");
b.Navigation("LeaveSummary");
b.Navigation("Leaves");
b.Navigation("MotherHistory");

View file

@ -244,6 +244,8 @@ namespace BMA.EHR.Infrastructure.Persistence
public DbSet<ProfileEmploymentHistory> ProfileEmploymentHistorys { get; set; }
public DbSet<ProfileLeaveSummary> ProfileLeaveSummary { get; set; }
#endregion
#endregion
@ -346,7 +348,7 @@ namespace BMA.EHR.Infrastructure.Persistence
#endregion
public ApplicationDBContext(DbContextOptions<ApplicationDBContext> options) : base(options)
{