ลาออกลูกจ้าง

This commit is contained in:
kittapath 2024-11-08 16:58:53 +07:00
parent 8e4ed43a9d
commit 0f75dad798
14 changed files with 21151 additions and 714 deletions

View file

@ -0,0 +1,141 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using BMA.EHR.Domain.Models.Base;
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Domain.Models.Organizations;
using BMA.EHR.Domain.Models.Documents;
using BMA.EHR.Domain.Models.HR;
namespace BMA.EHR.Domain.Models.Retirement
{
public class RetirementResignEmployee : EntityBase
{
[Comment("สถานที่ยื่นขอลาออกราชการ")]
public string? Location { get; set; } = string.Empty;
[Comment("วันที่ยื่นขอออกราชการ")]
public DateTime? SendDate { get; set; }
[Comment("วันที่ขอออกราชการ")]
public DateTime? ActiveDate { get; set; }
[Comment("เหตุผลที่ลาออกจากราชการ")]
public string? Reason { get; set; } = string.Empty;
// [Comment("Id ผู้ลาออก")]
// public Profile Profile { get; set; }
[Comment("สังกัด")]
public string? OrganizationPositionOld { get; set; }
[Comment("ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท")]
public string? PositionTypeOld { get; set; }
[Comment("ข้อมูลหน่วยงานเดิม ระดับ")]
public string? PositionLevelOld { get; set; }
[Comment("ข้อมูลหน่วยงานเดิม เลขที่")]
public string? PositionNumberOld { get; set; }
[Comment("ข้อมูลหน่วยงานเดิม เงินเดือน")]
public double? AmountOld { get; set; }
[Comment("สถานะลาออก")]
public string? Status { get; set; } = "WAITTING";
[Comment("เหตุผลอนุมัติ")]
public string? ApproveReason { get; set; }
[Comment("เหตุผลไม่อนุมัติ")]
public string? RejectReason { get; set; }
[Comment("เหตุผลยกเลิก")]
public string? CancelReason { get; set; }
[Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
[Comment("สถานะไม่เป็นหนี้สหกรณ์")]
public bool IsNoDebt { get; set; } = false;
[Comment("สถานะไม่มีภาระผูกพันค้ำประกันทุนการศึกษา")]
public bool IsNoBurden { get; set; } = false;
[Comment("สถานะพฤติการณ์ทางวินัย")]
public bool IsDiscipline { get; set; } = false;
[Comment("สถานะยับยั้งผู้ดูแล")]
public bool? OligarchReject { get; set; }
[Comment("เหตุผลอนุมัติผู้ดูแล")]
public string? OligarchApproveReason { get; set; }
[Comment("เหตุผลยับยั้งผู้ดูแล")]
public string? OligarchRejectReason { get; set; }
[Comment("วันที่ยับยั้งผู้ดูแล")]
public DateTime? OligarchRejectDate { get; set; }
[Comment("สถานะยับยั้งผู้บังคับบัญชา")]
public bool? CommanderReject { get; set; }
[Comment("เหตุผลอนุมัติผู้บังคับบัญชา")]
public string? CommanderApproveReason { get; set; }
[Comment("เหตุผลยับยั้งผู้บังคับบัญชา")]
public string? CommanderRejectReason { get; set; }
[Comment("วันที่ยับยั้งผู้บังคับบัญชา")]
public DateTime? CommanderRejectDate { get; set; }
[Comment("สถานะยับยั้งการเจ้าหน้าที่")]
public bool? OfficerReject { get; set; }
[Comment("เหตุผลอนุมัติการเจ้าหน้าที่")]
public string? OfficerApproveReason { get; set; }
[Comment("เหตุผลยับยั้งการเจ้าหน้าที่")]
public string? OfficerRejectReason { get; set; }
[Comment("วันที่ยับยั้งการเจ้าหน้าที่")]
public DateTime? OfficerRejectDate { get; set; }
[Comment("หมายเหตุแนวนอน")]
public string? RemarkHorizontal { get; set; }
[Comment("สังกัดเดิม")]
public string? OrganizationOld { get; set; }
[Comment("ตำแหน่งเดิม")]
public string? PositionOld { get; set; }
[Comment("profile Id")]
public string? profileId { get; set; }
[Comment("คำนำหน้า")]
public string? prefix { get; set; }
[Comment("ชื่อ")]
public string? firstName { get; set; }
[Comment("นามสกุล")]
public string? lastName { get; set; }
[Comment("เลขบัตรประชาชน")]
public string? citizenId { get; set; }
[Comment("ชื่อหน่วยงาน root old")]
public string? rootOld { get; set; }
[Comment("id หน่วยงาน root old")]
public string? rootOldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน root old")]
public string? rootShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child1 old")]
public string? child1Old { get; set; }
[Comment("id หน่วยงาน child1 old")]
public string? child1OldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน child1 old")]
public string? child1ShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child2 old")]
public string? child2Old { get; set; }
[Comment("id หน่วยงาน child2 old")]
public string? child2OldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน child2 old")]
public string? child2ShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child3 old")]
public string? child3Old { get; set; }
[Comment("id หน่วยงาน child3 old")]
public string? child3OldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน child3 old")]
public string? child3ShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child4 old")]
public string? child4Old { get; set; }
[Comment("id หน่วยงาน child4 old")]
public string? child4OldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน child4 old")]
public string? child4ShortNameOld { get; set; }
[Comment("เลขที่ตำแหน่ง old")]
public int? posMasterNoOld { get; set; }
// [Comment("ชื่อตำแหน่งในสายงาน old")]
// public string? positionOld { get; set; }
[Comment("id ประเภทตำแหน่ง old")]
public string? posTypeOldId { get; set; }
[Comment("ชื่อประเภทตำแหน่ง old")]
public string? posTypeNameOld { get; set; }
[Comment("id ระดับตำแหน่ง old")]
public string? posLevelOldId { get; set; }
[Comment("ชื่อระดับตำแหน่ง old")]
public string? posLevelNameOld { get; set; }
public virtual List<RetirementResignEmployeeDoc> RetirementResignEmployeeDocs { get; set; } = new List<RetirementResignEmployeeDoc>();
public virtual List<RetirementResignEmployeeDebtDoc> RetirementResignEmployeeDebtDocs { get; set; } = new List<RetirementResignEmployeeDebtDoc>();
public virtual List<RetirementResignEmployeeCancel> RetirementResignEmployeeCancels { get; set; } = new List<RetirementResignEmployeeCancel>();
}
}

View file

@ -0,0 +1,132 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using BMA.EHR.Domain.Models.Base;
namespace BMA.EHR.Domain.Models.Retirement
{
public class RetirementResignEmployeeCancel : EntityBase
{
[Comment("สถานที่ยื่นขอลาออกราชการ")]
public string? Location { get; set; } = string.Empty;
[Comment("วันที่ยื่นขอออกราชการ")]
public DateTime? SendDate { get; set; }
[Comment("วันที่ขอออกราชการ")]
public DateTime? ActiveDate { get; set; }
[Comment("เหตุผลที่ลาออกจากราชการ")]
public string? Reason { get; set; } = string.Empty;
[Comment("สังกัด")]
public string? OrganizationPositionOld { get; set; }
[Comment("ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท")]
public string? PositionTypeOld { get; set; }
[Comment("ข้อมูลหน่วยงานเดิม ระดับ")]
public string? PositionLevelOld { get; set; }
[Comment("ข้อมูลหน่วยงานเดิม เลขที่")]
public string? PositionNumberOld { get; set; }
[Comment("ข้อมูลหน่วยงานเดิม เงินเดือน")]
public double? AmountOld { get; set; }
[Comment("สถานะลาออก")]
public string? Status { get; set; } = "WAITTING";
[Comment("เหตุผลอนุมัติ")]
public string? ApproveReason { get; set; }
[Comment("เหตุผลไม่อนุมัติ")]
public string? RejectReason { get; set; }
[Comment("เหตุผลยกเลิก")]
public string? CancelReason { get; set; }
[Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
[Comment("สถานะไม่เป็นหนี้สหกรณ์")]
public bool IsNoDebt { get; set; } = false;
[Comment("สถานะไม่มีภาระผูกพันค้ำประกันทุนการศึกษา")]
public bool IsNoBurden { get; set; } = false;
[Comment("สถานะพฤติการณ์ทางวินัย")]
public bool IsDiscipline { get; set; } = false;
[Comment("สถานะยับยั้งผู้ดูแล")]
public bool? OligarchReject { get; set; }
[Comment("เหตุผลอนุมัติผู้ดูแล")]
public string? OligarchApproveReason { get; set; }
[Comment("เหตุผลยับยั้งผู้ดูแล")]
public string? OligarchRejectReason { get; set; }
[Comment("วันที่ยับยั้งผู้ดูแล")]
public DateTime? OligarchRejectDate { get; set; }
[Comment("สถานะยับยั้งผู้บังคับบัญชา")]
public bool? CommanderReject { get; set; }
[Comment("เหตุผลอนุมัติผู้บังคับบัญชา")]
public string? CommanderApproveReason { get; set; }
[Comment("เหตุผลยับยั้งผู้บังคับบัญชา")]
public string? CommanderRejectReason { get; set; }
[Comment("วันที่ยับยั้งผู้บังคับบัญชา")]
public DateTime? CommanderRejectDate { get; set; }
[Comment("สถานะยับยั้งการเจ้าหน้าที่")]
public bool? OfficerReject { get; set; }
[Comment("เหตุผลอนุมัติการเจ้าหน้าที่")]
public string? OfficerApproveReason { get; set; }
[Comment("เหตุผลยับยั้งการเจ้าหน้าที่")]
public string? OfficerRejectReason { get; set; }
[Comment("วันที่ยับยั้งการเจ้าหน้าที่")]
public DateTime? OfficerRejectDate { get; set; }
[Comment("หมายเหตุแนวนอน")]
public string? RemarkHorizontal { get; set; }
[Comment("สังกัดเดิม")]
public string? OrganizationOld { get; set; }
[Comment("ตำแหน่งเดิม")]
public string? PositionOld { get; set; }
[Comment("profile Id")]
public string? profileId { get; set; }
[Comment("คำนำหน้า")]
public string? prefix { get; set; }
[Comment("ชื่อ")]
public string? firstName { get; set; }
[Comment("นามสกุล")]
public string? lastName { get; set; }
[Comment("เลขบัตรประชาชน")]
public string? citizenId { get; set; }
[Comment("ชื่อหน่วยงาน root old")]
public string? rootOld { get; set; }
[Comment("id หน่วยงาน root old")]
public string? rootOldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน root old")]
public string? rootShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child1 old")]
public string? child1Old { get; set; }
[Comment("id หน่วยงาน child1 old")]
public string? child1OldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน child1 old")]
public string? child1ShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child2 old")]
public string? child2Old { get; set; }
[Comment("id หน่วยงาน child2 old")]
public string? child2OldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน child2 old")]
public string? child2ShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child3 old")]
public string? child3Old { get; set; }
[Comment("id หน่วยงาน child3 old")]
public string? child3OldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน child3 old")]
public string? child3ShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child4 old")]
public string? child4Old { get; set; }
[Comment("id หน่วยงาน child4 old")]
public string? child4OldId { get; set; }
[Comment("ชื่อย่อหน่วยงาน child4 old")]
public string? child4ShortNameOld { get; set; }
[Comment("เลขที่ตำแหน่ง old")]
public int? posMasterNoOld { get; set; }
// [Comment("ชื่อตำแหน่งในสายงาน old")]
// public string? positionOld { get; set; }
[Comment("id ประเภทตำแหน่ง old")]
public string? posTypeOldId { get; set; }
[Comment("ชื่อประเภทตำแหน่ง old")]
public string? posTypeNameOld { get; set; }
[Comment("id ระดับตำแหน่ง old")]
public string? posLevelOldId { get; set; }
[Comment("ชื่อระดับตำแหน่ง old")]
public string? posLevelNameOld { get; set; }
[Required, Comment("อ้างอิงรับย้าย")]
public virtual RetirementResignEmployee RetirementResignEmployee { get; set; }
}
}

View file

@ -0,0 +1,15 @@
using BMA.EHR.Domain.Models.Base;
using BMA.EHR.Domain.Models.Documents;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.Domain.Models.Retirement
{
public class RetirementResignEmployeeDebtDoc : EntityBase
{
[Required, Comment("อ้างอิงรหัสเอกสาร")]
public Document Document { get; set; }
[Required, Comment("อ้างอิงรับย้าย")]
public virtual RetirementResignEmployee RetirementResignEmployee { get; set; }
}
}

View file

@ -0,0 +1,15 @@
using BMA.EHR.Domain.Models.Base;
using BMA.EHR.Domain.Models.Documents;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
namespace BMA.EHR.Domain.Models.Retirement
{
public class RetirementResignEmployeeDoc : EntityBase
{
[Required, Comment("อ้างอิงรหัสเอกสาร")]
public Document Document { get; set; }
[Required, Comment("อ้างอิงรับย้าย")]
public virtual RetirementResignEmployee RetirementResignEmployee { get; set; }
}
}

View file

@ -100,6 +100,7 @@
public static readonly string RetirementNotFound = "ไม่พบข้อมูลการประกาศเกษียณอายุราชการ";
public static readonly string RetirementHistoryNotFound = "ไม่พบข้อมูลประวัติการประกาศเกษียณอายุราชการ";
public static readonly string RetirementResignNotFound = "ไม่พบข้อมูลการคำขอลาออก";
public static readonly string RetirementResignEmployeeNotFound = "ไม่พบข้อมูลการคำขอลาออก";
public static readonly string RetirementDeceasedNotFound = "ไม่พบข้อมูลบันทึกเวียนแจ้งการถึงแก่กรรม";
public static readonly string RetirementDeceasedNotiNotFound = "ไม่พบข้อมูลแจ้งเตือนบันทึกเวียนแจ้งการถึงแก่กรรม";
public static readonly string RetirementDischargeNotFound = "ไม่พบข้อมูลปลดออก";

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,379 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableretireresignemployee : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RetirementResignEmployees",
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"),
Location = table.Column<string>(type: "longtext", nullable: true, comment: "สถานที่ยื่นขอลาออกราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
SendDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยื่นขอออกราชการ"),
ActiveDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ขอออกราชการ"),
Reason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลที่ลาออกจากราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationPositionOld = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionTypeOld = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionLevelOld = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionNumberOld = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่")
.Annotation("MySql:CharSet", "utf8mb4"),
AmountOld = table.Column<double>(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"),
Status = table.Column<string>(type: "longtext", nullable: true, comment: "สถานะลาออก")
.Annotation("MySql:CharSet", "utf8mb4"),
ApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติ")
.Annotation("MySql:CharSet", "utf8mb4"),
RejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลไม่อนุมัติ")
.Annotation("MySql:CharSet", "utf8mb4"),
CancelReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยกเลิก")
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"),
IsNoDebt = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะไม่เป็นหนี้สหกรณ์"),
IsNoBurden = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะไม่มีภาระผูกพันค้ำประกันทุนการศึกษา"),
IsDiscipline = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะพฤติการณ์ทางวินัย"),
OligarchReject = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "สถานะยับยั้งผู้ดูแล"),
OligarchApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติผู้ดูแล")
.Annotation("MySql:CharSet", "utf8mb4"),
OligarchRejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยับยั้งผู้ดูแล")
.Annotation("MySql:CharSet", "utf8mb4"),
OligarchRejectDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยับยั้งผู้ดูแล"),
CommanderReject = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "สถานะยับยั้งผู้บังคับบัญชา"),
CommanderApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติผู้บังคับบัญชา")
.Annotation("MySql:CharSet", "utf8mb4"),
CommanderRejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยับยั้งผู้บังคับบัญชา")
.Annotation("MySql:CharSet", "utf8mb4"),
CommanderRejectDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยับยั้งผู้บังคับบัญชา"),
OfficerReject = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "สถานะยับยั้งการเจ้าหน้าที่"),
OfficerApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติการเจ้าหน้าที่")
.Annotation("MySql:CharSet", "utf8mb4"),
OfficerRejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยับยั้งการเจ้าหน้าที่")
.Annotation("MySql:CharSet", "utf8mb4"),
OfficerRejectDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยับยั้งการเจ้าหน้าที่"),
RemarkHorizontal = table.Column<string>(type: "longtext", nullable: true, comment: "หมายเหตุแนวนอน")
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationOld = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionOld = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่งเดิม")
.Annotation("MySql:CharSet", "utf8mb4"),
profileId = table.Column<string>(type: "longtext", nullable: true, comment: "profile Id")
.Annotation("MySql:CharSet", "utf8mb4"),
prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
.Annotation("MySql:CharSet", "utf8mb4"),
firstName = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
lastName = table.Column<string>(type: "longtext", nullable: true, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
citizenId = table.Column<string>(type: "longtext", nullable: true, comment: "เลขบัตรประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
rootOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4"),
rootOldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4"),
rootShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4"),
child1Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child1OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child1ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child2Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child2OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child2ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child3Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child3OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child3ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child4Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child4OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child4ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4"),
posMasterNoOld = table.Column<int>(type: "int", nullable: true, comment: "เลขที่ตำแหน่ง old"),
posTypeOldId = table.Column<string>(type: "longtext", nullable: true, comment: "id ประเภทตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
posTypeNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อประเภทตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
posLevelOldId = table.Column<string>(type: "longtext", nullable: true, comment: "id ระดับตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
posLevelNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อระดับตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementResignEmployees", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RetirementResignEmployeeCancels",
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"),
Location = table.Column<string>(type: "longtext", nullable: true, comment: "สถานที่ยื่นขอลาออกราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
SendDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยื่นขอออกราชการ"),
ActiveDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ขอออกราชการ"),
Reason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลที่ลาออกจากราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationPositionOld = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionTypeOld = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionLevelOld = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionNumberOld = table.Column<string>(type: "longtext", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่")
.Annotation("MySql:CharSet", "utf8mb4"),
AmountOld = table.Column<double>(type: "double", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"),
Status = table.Column<string>(type: "longtext", nullable: true, comment: "สถานะลาออก")
.Annotation("MySql:CharSet", "utf8mb4"),
ApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติ")
.Annotation("MySql:CharSet", "utf8mb4"),
RejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลไม่อนุมัติ")
.Annotation("MySql:CharSet", "utf8mb4"),
CancelReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยกเลิก")
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"),
IsNoDebt = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะไม่เป็นหนี้สหกรณ์"),
IsNoBurden = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะไม่มีภาระผูกพันค้ำประกันทุนการศึกษา"),
IsDiscipline = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะพฤติการณ์ทางวินัย"),
OligarchReject = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "สถานะยับยั้งผู้ดูแล"),
OligarchApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติผู้ดูแล")
.Annotation("MySql:CharSet", "utf8mb4"),
OligarchRejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยับยั้งผู้ดูแล")
.Annotation("MySql:CharSet", "utf8mb4"),
OligarchRejectDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยับยั้งผู้ดูแล"),
CommanderReject = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "สถานะยับยั้งผู้บังคับบัญชา"),
CommanderApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติผู้บังคับบัญชา")
.Annotation("MySql:CharSet", "utf8mb4"),
CommanderRejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยับยั้งผู้บังคับบัญชา")
.Annotation("MySql:CharSet", "utf8mb4"),
CommanderRejectDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยับยั้งผู้บังคับบัญชา"),
OfficerReject = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "สถานะยับยั้งการเจ้าหน้าที่"),
OfficerApproveReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลอนุมัติการเจ้าหน้าที่")
.Annotation("MySql:CharSet", "utf8mb4"),
OfficerRejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลยับยั้งการเจ้าหน้าที่")
.Annotation("MySql:CharSet", "utf8mb4"),
OfficerRejectDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยับยั้งการเจ้าหน้าที่"),
RemarkHorizontal = table.Column<string>(type: "longtext", nullable: true, comment: "หมายเหตุแนวนอน")
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationOld = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัดเดิม")
.Annotation("MySql:CharSet", "utf8mb4"),
PositionOld = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่งเดิม")
.Annotation("MySql:CharSet", "utf8mb4"),
profileId = table.Column<string>(type: "longtext", nullable: true, comment: "profile Id")
.Annotation("MySql:CharSet", "utf8mb4"),
prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
.Annotation("MySql:CharSet", "utf8mb4"),
firstName = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
lastName = table.Column<string>(type: "longtext", nullable: true, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
citizenId = table.Column<string>(type: "longtext", nullable: true, comment: "เลขบัตรประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
rootOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4"),
rootOldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4"),
rootShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน root old")
.Annotation("MySql:CharSet", "utf8mb4"),
child1Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child1OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child1ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child1 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child2Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child2OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child2ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child2 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child3Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child3OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child3ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child3 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child4Old = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อหน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child4OldId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4"),
child4ShortNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อย่อหน่วยงาน child4 old")
.Annotation("MySql:CharSet", "utf8mb4"),
posMasterNoOld = table.Column<int>(type: "int", nullable: true, comment: "เลขที่ตำแหน่ง old"),
posTypeOldId = table.Column<string>(type: "longtext", nullable: true, comment: "id ประเภทตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
posTypeNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อประเภทตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
posLevelOldId = table.Column<string>(type: "longtext", nullable: true, comment: "id ระดับตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
posLevelNameOld = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อระดับตำแหน่ง old")
.Annotation("MySql:CharSet", "utf8mb4"),
RetirementResignEmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementResignEmployeeCancels", x => x.Id);
table.ForeignKey(
name: "FK_RetirementResignEmployeeCancels_RetirementResignEmployees_Re~",
column: x => x.RetirementResignEmployeeId,
principalTable: "RetirementResignEmployees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RetirementResignEmployeeDebtDocs",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RetirementResignEmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementResignEmployeeDebtDocs", x => x.Id);
table.ForeignKey(
name: "FK_RetirementResignEmployeeDebtDocs_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RetirementResignEmployeeDebtDocs_RetirementResignEmployees_R~",
column: x => x.RetirementResignEmployeeId,
principalTable: "RetirementResignEmployees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RetirementResignEmployeeDocs",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RetirementResignEmployeeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementResignEmployeeDocs", x => x.Id);
table.ForeignKey(
name: "FK_RetirementResignEmployeeDocs_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RetirementResignEmployeeDocs_RetirementResignEmployees_Retir~",
column: x => x.RetirementResignEmployeeId,
principalTable: "RetirementResignEmployees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_RetirementResignEmployeeCancels_RetirementResignEmployeeId",
table: "RetirementResignEmployeeCancels",
column: "RetirementResignEmployeeId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResignEmployeeDebtDocs_DocumentId",
table: "RetirementResignEmployeeDebtDocs",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResignEmployeeDebtDocs_RetirementResignEmployeeId",
table: "RetirementResignEmployeeDebtDocs",
column: "RetirementResignEmployeeId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResignEmployeeDocs_DocumentId",
table: "RetirementResignEmployeeDocs",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResignEmployeeDocs_RetirementResignEmployeeId",
table: "RetirementResignEmployeeDocs",
column: "RetirementResignEmployeeId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RetirementResignEmployeeCancels");
migrationBuilder.DropTable(
name: "RetirementResignEmployeeDebtDocs");
migrationBuilder.DropTable(
name: "RetirementResignEmployeeDocs");
migrationBuilder.DropTable(
name: "RetirementResignEmployees");
}
}
}

View file

@ -16483,6 +16483,695 @@ namespace BMA.EHR.Infrastructure.Migrations
b.ToTable("RetirementResignDocs");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployee", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<DateTime?>("ActiveDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ขอออกราชการ");
b.Property<double?>("AmountOld")
.HasColumnType("double")
.HasComment("ข้อมูลหน่วยงานเดิม เงินเดือน");
b.Property<string>("ApproveReason")
.HasColumnType("longtext")
.HasComment("เหตุผลอนุมัติ");
b.Property<string>("CancelReason")
.HasColumnType("longtext")
.HasComment("เหตุผลยกเลิก");
b.Property<string>("CommanderApproveReason")
.HasColumnType("longtext")
.HasComment("เหตุผลอนุมัติผู้บังคับบัญชา");
b.Property<bool?>("CommanderReject")
.HasColumnType("tinyint(1)")
.HasComment("สถานะยับยั้งผู้บังคับบัญชา");
b.Property<DateTime?>("CommanderRejectDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ยับยั้งผู้บังคับบัญชา");
b.Property<string>("CommanderRejectReason")
.HasColumnType("longtext")
.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<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasComment("สถานะการใช้งาน");
b.Property<bool>("IsDiscipline")
.HasColumnType("tinyint(1)")
.HasComment("สถานะพฤติการณ์ทางวินัย");
b.Property<bool>("IsNoBurden")
.HasColumnType("tinyint(1)")
.HasComment("สถานะไม่มีภาระผูกพันค้ำประกันทุนการศึกษา");
b.Property<bool>("IsNoDebt")
.HasColumnType("tinyint(1)")
.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>("Location")
.HasColumnType("longtext")
.HasComment("สถานที่ยื่นขอลาออกราชการ");
b.Property<string>("OfficerApproveReason")
.HasColumnType("longtext")
.HasComment("เหตุผลอนุมัติการเจ้าหน้าที่");
b.Property<bool?>("OfficerReject")
.HasColumnType("tinyint(1)")
.HasComment("สถานะยับยั้งการเจ้าหน้าที่");
b.Property<DateTime?>("OfficerRejectDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ยับยั้งการเจ้าหน้าที่");
b.Property<string>("OfficerRejectReason")
.HasColumnType("longtext")
.HasComment("เหตุผลยับยั้งการเจ้าหน้าที่");
b.Property<string>("OligarchApproveReason")
.HasColumnType("longtext")
.HasComment("เหตุผลอนุมัติผู้ดูแล");
b.Property<bool?>("OligarchReject")
.HasColumnType("tinyint(1)")
.HasComment("สถานะยับยั้งผู้ดูแล");
b.Property<DateTime?>("OligarchRejectDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ยับยั้งผู้ดูแล");
b.Property<string>("OligarchRejectReason")
.HasColumnType("longtext")
.HasComment("เหตุผลยับยั้งผู้ดูแล");
b.Property<string>("OrganizationOld")
.HasColumnType("longtext")
.HasComment("สังกัดเดิม");
b.Property<string>("OrganizationPositionOld")
.HasColumnType("longtext")
.HasComment("สังกัด");
b.Property<string>("PositionLevelOld")
.HasColumnType("longtext")
.HasComment("ข้อมูลหน่วยงานเดิม ระดับ");
b.Property<string>("PositionNumberOld")
.HasColumnType("longtext")
.HasComment("ข้อมูลหน่วยงานเดิม เลขที่");
b.Property<string>("PositionOld")
.HasColumnType("longtext")
.HasComment("ตำแหน่งเดิม");
b.Property<string>("PositionTypeOld")
.HasColumnType("longtext")
.HasComment("ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท");
b.Property<string>("Reason")
.HasColumnType("longtext")
.HasComment("เหตุผลที่ลาออกจากราชการ");
b.Property<string>("RejectReason")
.HasColumnType("longtext")
.HasComment("เหตุผลไม่อนุมัติ");
b.Property<string>("RemarkHorizontal")
.HasColumnType("longtext")
.HasComment("หมายเหตุแนวนอน");
b.Property<DateTime?>("SendDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ยื่นขอออกราชการ");
b.Property<string>("Status")
.HasColumnType("longtext")
.HasComment("สถานะลาออก");
b.Property<string>("child1Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child1 old");
b.Property<string>("child1OldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child1 old");
b.Property<string>("child1ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child1 old");
b.Property<string>("child2Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child2 old");
b.Property<string>("child2OldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child2 old");
b.Property<string>("child2ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child2 old");
b.Property<string>("child3Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child3 old");
b.Property<string>("child3OldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child3 old");
b.Property<string>("child3ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child3 old");
b.Property<string>("child4Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child4 old");
b.Property<string>("child4OldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child4 old");
b.Property<string>("child4ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child4 old");
b.Property<string>("citizenId")
.HasColumnType("longtext")
.HasComment("เลขบัตรประชาชน");
b.Property<string>("firstName")
.HasColumnType("longtext")
.HasComment("ชื่อ");
b.Property<string>("lastName")
.HasColumnType("longtext")
.HasComment("นามสกุล");
b.Property<string>("posLevelNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อระดับตำแหน่ง old");
b.Property<string>("posLevelOldId")
.HasColumnType("longtext")
.HasComment("id ระดับตำแหน่ง old");
b.Property<int?>("posMasterNoOld")
.HasColumnType("int")
.HasComment("เลขที่ตำแหน่ง old");
b.Property<string>("posTypeNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อประเภทตำแหน่ง old");
b.Property<string>("posTypeOldId")
.HasColumnType("longtext")
.HasComment("id ประเภทตำแหน่ง old");
b.Property<string>("prefix")
.HasColumnType("longtext")
.HasComment("คำนำหน้า");
b.Property<string>("profileId")
.HasColumnType("longtext")
.HasComment("profile Id");
b.Property<string>("rootOld")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน root old");
b.Property<string>("rootOldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน root old");
b.Property<string>("rootShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน root old");
b.HasKey("Id");
b.ToTable("RetirementResignEmployees");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployeeCancel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<DateTime?>("ActiveDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ขอออกราชการ");
b.Property<double?>("AmountOld")
.HasColumnType("double")
.HasComment("ข้อมูลหน่วยงานเดิม เงินเดือน");
b.Property<string>("ApproveReason")
.HasColumnType("longtext")
.HasComment("เหตุผลอนุมัติ");
b.Property<string>("CancelReason")
.HasColumnType("longtext")
.HasComment("เหตุผลยกเลิก");
b.Property<string>("CommanderApproveReason")
.HasColumnType("longtext")
.HasComment("เหตุผลอนุมัติผู้บังคับบัญชา");
b.Property<bool?>("CommanderReject")
.HasColumnType("tinyint(1)")
.HasComment("สถานะยับยั้งผู้บังคับบัญชา");
b.Property<DateTime?>("CommanderRejectDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ยับยั้งผู้บังคับบัญชา");
b.Property<string>("CommanderRejectReason")
.HasColumnType("longtext")
.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<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasComment("สถานะการใช้งาน");
b.Property<bool>("IsDiscipline")
.HasColumnType("tinyint(1)")
.HasComment("สถานะพฤติการณ์ทางวินัย");
b.Property<bool>("IsNoBurden")
.HasColumnType("tinyint(1)")
.HasComment("สถานะไม่มีภาระผูกพันค้ำประกันทุนการศึกษา");
b.Property<bool>("IsNoDebt")
.HasColumnType("tinyint(1)")
.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>("Location")
.HasColumnType("longtext")
.HasComment("สถานที่ยื่นขอลาออกราชการ");
b.Property<string>("OfficerApproveReason")
.HasColumnType("longtext")
.HasComment("เหตุผลอนุมัติการเจ้าหน้าที่");
b.Property<bool?>("OfficerReject")
.HasColumnType("tinyint(1)")
.HasComment("สถานะยับยั้งการเจ้าหน้าที่");
b.Property<DateTime?>("OfficerRejectDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ยับยั้งการเจ้าหน้าที่");
b.Property<string>("OfficerRejectReason")
.HasColumnType("longtext")
.HasComment("เหตุผลยับยั้งการเจ้าหน้าที่");
b.Property<string>("OligarchApproveReason")
.HasColumnType("longtext")
.HasComment("เหตุผลอนุมัติผู้ดูแล");
b.Property<bool?>("OligarchReject")
.HasColumnType("tinyint(1)")
.HasComment("สถานะยับยั้งผู้ดูแล");
b.Property<DateTime?>("OligarchRejectDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ยับยั้งผู้ดูแล");
b.Property<string>("OligarchRejectReason")
.HasColumnType("longtext")
.HasComment("เหตุผลยับยั้งผู้ดูแล");
b.Property<string>("OrganizationOld")
.HasColumnType("longtext")
.HasComment("สังกัดเดิม");
b.Property<string>("OrganizationPositionOld")
.HasColumnType("longtext")
.HasComment("สังกัด");
b.Property<string>("PositionLevelOld")
.HasColumnType("longtext")
.HasComment("ข้อมูลหน่วยงานเดิม ระดับ");
b.Property<string>("PositionNumberOld")
.HasColumnType("longtext")
.HasComment("ข้อมูลหน่วยงานเดิม เลขที่");
b.Property<string>("PositionOld")
.HasColumnType("longtext")
.HasComment("ตำแหน่งเดิม");
b.Property<string>("PositionTypeOld")
.HasColumnType("longtext")
.HasComment("ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท");
b.Property<string>("Reason")
.HasColumnType("longtext")
.HasComment("เหตุผลที่ลาออกจากราชการ");
b.Property<string>("RejectReason")
.HasColumnType("longtext")
.HasComment("เหตุผลไม่อนุมัติ");
b.Property<string>("RemarkHorizontal")
.HasColumnType("longtext")
.HasComment("หมายเหตุแนวนอน");
b.Property<Guid>("RetirementResignEmployeeId")
.HasColumnType("char(36)");
b.Property<DateTime?>("SendDate")
.HasColumnType("datetime(6)")
.HasComment("วันที่ยื่นขอออกราชการ");
b.Property<string>("Status")
.HasColumnType("longtext")
.HasComment("สถานะลาออก");
b.Property<string>("child1Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child1 old");
b.Property<string>("child1OldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child1 old");
b.Property<string>("child1ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child1 old");
b.Property<string>("child2Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child2 old");
b.Property<string>("child2OldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child2 old");
b.Property<string>("child2ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child2 old");
b.Property<string>("child3Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child3 old");
b.Property<string>("child3OldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child3 old");
b.Property<string>("child3ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child3 old");
b.Property<string>("child4Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child4 old");
b.Property<string>("child4OldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child4 old");
b.Property<string>("child4ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child4 old");
b.Property<string>("citizenId")
.HasColumnType("longtext")
.HasComment("เลขบัตรประชาชน");
b.Property<string>("firstName")
.HasColumnType("longtext")
.HasComment("ชื่อ");
b.Property<string>("lastName")
.HasColumnType("longtext")
.HasComment("นามสกุล");
b.Property<string>("posLevelNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อระดับตำแหน่ง old");
b.Property<string>("posLevelOldId")
.HasColumnType("longtext")
.HasComment("id ระดับตำแหน่ง old");
b.Property<int?>("posMasterNoOld")
.HasColumnType("int")
.HasComment("เลขที่ตำแหน่ง old");
b.Property<string>("posTypeNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อประเภทตำแหน่ง old");
b.Property<string>("posTypeOldId")
.HasColumnType("longtext")
.HasComment("id ประเภทตำแหน่ง old");
b.Property<string>("prefix")
.HasColumnType("longtext")
.HasComment("คำนำหน้า");
b.Property<string>("profileId")
.HasColumnType("longtext")
.HasComment("profile Id");
b.Property<string>("rootOld")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน root old");
b.Property<string>("rootOldId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน root old");
b.Property<string>("rootShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน root old");
b.HasKey("Id");
b.HasIndex("RetirementResignEmployeeId");
b.ToTable("RetirementResignEmployeeCancels");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployeeDebtDoc", 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<Guid>("DocumentId")
.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<Guid>("RetirementResignEmployeeId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("DocumentId");
b.HasIndex("RetirementResignEmployeeId");
b.ToTable("RetirementResignEmployeeDebtDocs");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployeeDoc", 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<Guid>("DocumentId")
.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<Guid>("RetirementResignEmployeeId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("DocumentId");
b.HasIndex("RetirementResignEmployeeId");
b.ToTable("RetirementResignEmployeeDocs");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Commands.Core.Command", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Commands.Core.CommandStatus", "CommandStatus")
@ -18114,6 +18803,55 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("RetirementResign");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployeeCancel", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployee", "RetirementResignEmployee")
.WithMany("RetirementResignEmployeeCancels")
.HasForeignKey("RetirementResignEmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("RetirementResignEmployee");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployeeDebtDoc", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document")
.WithMany()
.HasForeignKey("DocumentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployee", "RetirementResignEmployee")
.WithMany("RetirementResignEmployeeDebtDocs")
.HasForeignKey("RetirementResignEmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Document");
b.Navigation("RetirementResignEmployee");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployeeDoc", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document")
.WithMany()
.HasForeignKey("DocumentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployee", "RetirementResignEmployee")
.WithMany("RetirementResignEmployeeDocs")
.HasForeignKey("RetirementResignEmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Document");
b.Navigation("RetirementResignEmployee");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Commands.Core.Command", b =>
{
b.Navigation("Deployments");
@ -18389,6 +19127,15 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("RetirementResignDocs");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignEmployee", b =>
{
b.Navigation("RetirementResignEmployeeCancels");
b.Navigation("RetirementResignEmployeeDebtDocs");
b.Navigation("RetirementResignEmployeeDocs");
});
#pragma warning restore 612, 618
}
}

View file

@ -333,6 +333,10 @@ namespace BMA.EHR.Infrastructure.Persistence
public DbSet<RetirementResignCancel> RetirementResignCancels { get; set; }
public DbSet<RetirementResignDoc> RetirementResignDocs { get; set; }
public DbSet<RetirementResignDebtDoc> RetirementResignDebtDocs { get; set; }
public DbSet<RetirementResignEmployee> RetirementResignEmployees { get; set; }
public DbSet<RetirementResignEmployeeCancel> RetirementResignEmployeeCancels { get; set; }
public DbSet<RetirementResignEmployeeDoc> RetirementResignEmployeeDocs { get; set; }
public DbSet<RetirementResignEmployeeDebtDoc> RetirementResignEmployeeDebtDocs { get; set; }
public DbSet<RetirementOut> RetirementOuts { get; set; }
public DbSet<RetirementDischarge> RetirementDischarges { get; set; }
public DbSet<RetirementExpulsion> RetirementExpulsions { get; set; }

View file

@ -333,7 +333,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
if (dataMain == null)
return Error(GlobalMessages.RetirementResignNotFound, 404);
if(dataMain.Status != "CANCEL"){
if (dataMain.Status != "CANCEL")
{
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "SYS_RESIGN");
var createdUserId = await _context.RetirementResigns.AsQueryable()
.Where(x => x.Id == id)
@ -509,8 +510,9 @@ namespace BMA.EHR.Retirement.Service.Controllers
return Success(_data);
}
else{
else
{
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "RETIREMENT_CANCEL");
var createdUserId = await _context.RetirementResignCancels.AsQueryable()
.Where(x => x.CreatedUserId == UserId)
@ -2436,6 +2438,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
templateDoc = r.templateDoc,
isLeave = true,
isGovernment = false,
leaveReason = "ออกจากราชการ",
dateLeave = r.commandAffectDate,
}).ToList();
@ -2460,102 +2463,6 @@ namespace BMA.EHR.Retirement.Service.Controllers
return Success();
}
/// <summary>
/// ส่งรายชื่อออกคำสั่ง C-PM-23
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPost("employee/report")]
public async Task<ActionResult<ResponseObject>> PostReportEmployee([FromBody] ReportPersonRequest req)
{
var placementProfiles = await _context.RetirementResigns
.Where(x => req.refIds.Contains(x.Id.ToString()))
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "REPORT");
await _context.SaveChangesAsync();
return Success();
}
/// <summary>
/// ลบรายชื่อออกคำสั่ง C-PM-23
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPost("employee/report/delete")]
public async Task<ActionResult<ResponseObject>> PostReportDeleteEmployee([FromBody] ReportPersonRequest req)
{
var placementProfiles = await _context.RetirementResigns
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Where(x => x.Status.ToUpper() == "REPORT")
.ToListAsync();
placementProfiles.ForEach(profile => profile.Status = "APPROVE");
await _context.SaveChangesAsync();
return Success();
}
/// <summary>
/// ออกคำสั่ง C-PM-23 คำสั่งให้ลูกจ้างออกจากราชการ
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPost("employee/report/excecute")]
public async Task<ActionResult<ResponseObject>> PostReportExecuteEmployee([FromBody] ReportExecuteRequest req)
{
var data = await _context.RetirementResigns
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
.ToListAsync();
var resultData = (from p in data
join r in req.refIds
on p.Id.ToString() equals r.refId
select new
{
profileId = p.profileId,
date = r.commandAffectDate,
amount = r.amount,
commandId = r.commandId,
positionSalaryAmount = r.positionSalaryAmount,
mouthSalaryAmount = r.mouthSalaryAmount,
posNo = p.PositionNumberOld,
position = p.PositionOld,
positionType = p.PositionTypeOld,
positionLevel = p.PositionLevelOld,
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
templateDoc = r.templateDoc,
isLeave = true,
leaveReason = "ลาออกจากราชการ",
dateLeave = r.commandAffectDate,
isGovernment = false
}).ToList();
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-leave";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{
data = resultData,
});
var _result = await _res.Content.ReadAsStringAsync();
if (_res.IsSuccessStatusCode)
{
data.ForEach(profile => profile.Status = "DONE");
await _context.SaveChangesAsync();
}
}
return Success();
}
/// <summary>
/// ส่งรายชื่อออกคำสั่ง C-PM-41
/// </summary>

View file

@ -0,0 +1,13 @@
using BMA.EHR.Domain.Models.MetaData;
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Retirement.Service.Requests
{
public class RetirementResignEmployeeDebtRequest
{
public bool IsNoDebt { get; set; }
public bool IsNoBurden { get; set; }
public bool IsDiscipline { get; set; }
// public List<FormFile>? File { get; set; }
}
}

View file

@ -0,0 +1,13 @@
using BMA.EHR.Domain.Models.MetaData;
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Retirement.Service.Requests
{
public class RetirementResignEmployeeEditRequest
{
public string? Location { get; set; }
public DateTime? SendDate { get; set; }
public DateTime? ActiveDate { get; set; }
public string? Reason { get; set; }
}
}

View file

@ -0,0 +1,20 @@
using BMA.EHR.Domain.Models.MetaData;
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Retirement.Service.Requests
{
public class RetirementResignEmployeeRequest
{
public string? Location { get; set; }
// public DateTime? SendDate { get; set; }
public DateTime? ActiveDate { get; set; }
public string? Reason { get; set; }
public string? OrganizationPositionOld { get; set; }
public string? PositionTypeOld { get; set; }
public string? PositionLevelOld { get; set; }
public string? PositionNumberOld { get; set; }
public string? RemarkHorizontal { get; set; }
public double? AmountOld { get; set; }
public List<FormFile>? File { get; set; }
}
}