Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 13s
Some checks failed
release-dev / release-dev (push) Failing after 13s
This commit is contained in:
commit
6c095a27f7
16 changed files with 19840 additions and 410 deletions
|
|
@ -234,6 +234,18 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
|||
}
|
||||
}
|
||||
|
||||
public async Task PushEmailAsync(string Subject, string Body, string Email = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
_emailSenderService.SendMail(Subject, Body, Email);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task PushNotificationsAsync(Guid[] ReceiverUserIds, string Subject, string Body, string Payload = "", string NotiLink = "", bool IsSendInbox = false, bool IsSendMail = false)
|
||||
{
|
||||
try
|
||||
|
|
|
|||
|
|
@ -1022,7 +1022,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
positionname = p.Position,
|
||||
positionno = p.PosNo,
|
||||
organizationname = p.Organization,
|
||||
salary = r.Amount
|
||||
salary = r.Amount,
|
||||
RemarkHorizontal = r.RemarkHorizontal
|
||||
}).ToList();
|
||||
|
||||
var result = new List<dynamic>();
|
||||
|
|
|
|||
|
|
@ -136,5 +136,6 @@ namespace BMA.EHR.Domain.Models.Retirement
|
|||
|
||||
public virtual List<RetirementResignDoc> RetirementResignDocs { get; set; } = new List<RetirementResignDoc>();
|
||||
public virtual List<RetirementResignDebtDoc> RetirementResignDebtDocs { get; set; } = new List<RetirementResignDebtDoc>();
|
||||
public virtual List<RetirementResignCancel> RetirementResignCancels { get; set; } = new List<RetirementResignCancel>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
132
BMA.EHR.Domain/Models/Retirement/RetirementResignCancel.cs
Normal file
132
BMA.EHR.Domain/Models/Retirement/RetirementResignCancel.cs
Normal 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 RetirementResignCancel : 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 RetirementResign RetirementResign { get; set; }
|
||||
}
|
||||
}
|
||||
18410
BMA.EHR.Infrastructure/Migrations/20241029100828_update table RetirementResignCancel.Designer.cs
generated
Normal file
18410
BMA.EHR.Infrastructure/Migrations/20241029100828_update table RetirementResignCancel.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,156 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableRetirementResignCancel : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RetirementResignCancels",
|
||||
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"),
|
||||
RetirementResignId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RetirementResignCancels", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RetirementResignCancels_RetirementResigns_RetirementResignId",
|
||||
column: x => x.RetirementResignId,
|
||||
principalTable: "RetirementResigns",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RetirementResignCancels_RetirementResignId",
|
||||
table: "RetirementResignCancels",
|
||||
column: "RetirementResignId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "RetirementResignCancels");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16076,6 +16076,291 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
b.ToTable("RetirementResigns");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignCancel", 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>("RetirementResignId")
|
||||
.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("RetirementResignId");
|
||||
|
||||
b.ToTable("RetirementResignCancels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignDebtDoc", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -17794,6 +18079,17 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
b.Navigation("RetirementResign");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignCancel", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Retirement.RetirementResign", "RetirementResign")
|
||||
.WithMany()
|
||||
.HasForeignKey("RetirementResignId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("RetirementResign");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignDebtDoc", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "Document")
|
||||
|
|
|
|||
|
|
@ -330,6 +330,7 @@ namespace BMA.EHR.Infrastructure.Persistence
|
|||
public DbSet<RetirementDeceased> RetirementDeceaseds { get; set; }
|
||||
public DbSet<RetirementDeceasedNoti> RetirementDeceasedNotis { get; set; }
|
||||
public DbSet<RetirementResign> RetirementResigns { get; set; }
|
||||
public DbSet<RetirementResignCancel> RetirementResignCancels { get; set; }
|
||||
public DbSet<RetirementResignDoc> RetirementResignDocs { get; set; }
|
||||
public DbSet<RetirementResignDebtDoc> RetirementResignDebtDocs { get; set; }
|
||||
public DbSet<RetirementOut> RetirementOuts { get; set; }
|
||||
|
|
|
|||
|
|
@ -1479,7 +1479,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
refId = id,
|
||||
sysName = "LEAVE_LIST",
|
||||
sysName = "SYS_LEAVE_LIST",
|
||||
posLevelName = profile.PosLevel?.PosLevelName ?? "",
|
||||
posTypeName = profile.PosType?.PosTypeName ?? "",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -121,6 +121,17 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
[HttpPost("email")]
|
||||
public async Task<ActionResult<ResponseObject>> SendEmail([FromBody] SendEmailRequest req)
|
||||
{
|
||||
await _repositoryNoti.PushEmailAsync(
|
||||
req.Subject,
|
||||
req.Body,
|
||||
req.Email
|
||||
);
|
||||
return Success();
|
||||
}
|
||||
|
||||
[HttpPost("profiles")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdatePropertyByUserProfiles([FromBody] NotisRequest req)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1231,19 +1231,39 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
No = r.Sequence.ToString().ToThaiNumber(),
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
OldOrganization = (p.positionOld == null ? "" : p.positionOld) + "/" + (p.OrganizationOld == null ? "" : p.OrganizationOld),
|
||||
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld.ToThaiNumber(),
|
||||
OldPositionNumber = p.PositionNumberOld == null ? null : p.PositionNumberOld.ToThaiNumber(),
|
||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root),
|
||||
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName.ToThaiNumber(),
|
||||
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||
OldOrganization = p.rootOld == null ? p.positionOld == null ? "-" : $"{p.positionOld}/-" :
|
||||
p.child4Old != null
|
||||
? p.positionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
|
||||
p.child3Old != null
|
||||
? p.positionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
|
||||
p.child2Old != null
|
||||
? p.positionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
|
||||
p.child1Old != null
|
||||
? p.positionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child1Old}/{p.rootOld}" :
|
||||
p.rootOld != null
|
||||
? p.positionOld == null ? $"{p.rootOld}" : $"{p.positionOld}/{p.rootOld}" : "-",
|
||||
OldPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld.ToThaiNumber(),
|
||||
OldPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(),
|
||||
OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewOc = p.root == null ? p.position == null ? "-" : $"{p.position}/-" :
|
||||
p.node == 4
|
||||
? p.position == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
|
||||
p.node == 3
|
||||
? p.position == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
|
||||
p.node == 2
|
||||
? p.position == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child2}/{p.child1}/{p.root}" :
|
||||
p.node == 1
|
||||
? p.position == null ? $"{p.child1}/{p.root}" : $"{p.position}/{p.child1}/{p.root}" :
|
||||
p.node == 0
|
||||
? p.position == null ? $"{p.root}" : $"{p.position}/{p.root}" : "-",
|
||||
NewPositionLevel = p.posLevelName == null ? "-" : p.posLevelName.ToThaiNumber(),
|
||||
NewPositionNumber = p.posMasterNo == null ? "-" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
|
|
@ -1407,17 +1427,43 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
No = r.Sequence.ToString().ToThaiNumber(),
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
OldOc = (p.positionOld == null ? "" : p.positionOld) + "/" + (p.OrganizationOld == null ? "" : p.OrganizationOld),
|
||||
OldPositionNumber = p.PositionNumberOld == null ? null : p.PositionNumberOld.ToThaiNumber(),
|
||||
OldOc = p.rootOld == null ? p.positionOld == null ? "-" : $"{p.positionOld}/-" :
|
||||
p.child4Old != null
|
||||
? p.positionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
|
||||
p.child3Old != null
|
||||
? p.positionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
|
||||
p.child2Old != null
|
||||
? p.positionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
|
||||
p.child1Old != null
|
||||
? p.positionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child1Old}/{p.rootOld}" :
|
||||
p.rootOld != null
|
||||
? p.positionOld == null ? $"{p.rootOld}" : $"{p.positionOld}/{p.rootOld}" : "-",
|
||||
OldPositionNumber = p.posMasterNoOld == null ? "-" :
|
||||
p.child4Old != null ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||
p.child3Old != null ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||
p.child2Old != null ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||
p.child1Old != null ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||
p.rootOld != null ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "-",
|
||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root),
|
||||
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||
NewOc = p.root == null ? p.position == null ? "-" : $"{p.position}/-" :
|
||||
p.node == 4
|
||||
? p.position == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
|
||||
p.node == 3
|
||||
? p.position == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
|
||||
p.node == 2
|
||||
? p.position == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child2}/{p.child1}/{p.root}" :
|
||||
p.node == 1
|
||||
? p.position == null ? $"{p.child1}/{p.root}" : $"{p.position}/{p.child1}/{p.root}" :
|
||||
p.node == 0
|
||||
? p.position == null ? $"{p.root}" : $"{p.position}/{p.root}" : "-",
|
||||
NewPositionNumber = p.posMasterNo == null ? "-" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
ReportingDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
|
|
@ -1584,23 +1630,49 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
No = r.Sequence.ToString().ToThaiNumber(),
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
Education = p.EducationOld == null ? "" : p.EducationOld,
|
||||
OldOc = (p.positionOld == null ? "" : p.positionOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
|
||||
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
|
||||
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
|
||||
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root),
|
||||
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||
Education = p.EducationOld == null ? "-" : p.EducationOld,
|
||||
OldOc = p.rootOld == null ? p.positionOld == null ? "-" : $"{p.positionOld}/-" :
|
||||
p.child4Old != null
|
||||
? p.positionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
|
||||
p.child3Old != null
|
||||
? p.positionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
|
||||
p.child2Old != null
|
||||
? p.positionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" :
|
||||
p.child1Old != null
|
||||
? p.positionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child1Old}/{p.rootOld}" :
|
||||
p.rootOld != null
|
||||
? p.positionOld == null ? $"{p.rootOld}" : $"{p.positionOld}/{p.rootOld}" : "-",
|
||||
OldPositionType = p.posTypeNameOld == null ? "-" : p.posTypeNameOld,
|
||||
OldPositionLevel = p.posLevelNameOld == null ? "-" : p.posLevelNameOld,
|
||||
OldPositionNumber = p.posMasterNoOld == null ? "-" :
|
||||
p.child4Old != null ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||
p.child3Old != null ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||
p.child2Old != null ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||
p.child1Old != null ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||
p.rootOld != null ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "-",
|
||||
OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
PositionDate = p.PositionDate == null ? "-" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
NewOc = p.root == null ? p.position == null ? "-" : $"{p.position}/-" :
|
||||
p.node == 4
|
||||
? p.position == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
|
||||
p.node == 3
|
||||
? p.position == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
|
||||
p.node == 2
|
||||
? p.position == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child2}/{p.child1}/{p.root}" :
|
||||
p.node == 1
|
||||
? p.position == null ? $"{p.child1}/{p.root}" : $"{p.position}/{p.child1}/{p.root}" :
|
||||
p.node == 0
|
||||
? p.position == null ? $"{p.root}" : $"{p.position}/{p.root}" : "-",
|
||||
NewPositionType = p.posTypeName == null ? "-" : p.posTypeName,
|
||||
NewPositionLevel = p.posLevelName == null ? "-" : p.posLevelName,
|
||||
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
|
|
|
|||
|
|
@ -143,259 +143,260 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
}
|
||||
if (PlacementAdmin == true)
|
||||
|
||||
var rootId = "";
|
||||
var child1Id = "";
|
||||
var child2Id = "";
|
||||
var child3Id = "";
|
||||
var child4Id = "";
|
||||
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position-act";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var data = await _context.PlacementProfiles.Where(x => x.Placement.Id == examId).Select(x => new
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
Id = x.Id,
|
||||
PersonalId = x.Id,
|
||||
x.profileId,
|
||||
Avatar = x.ProfileImg == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.ProfileImg.Id,
|
||||
FullName = $"{x.Prefix}{x.Firstname} {x.Lastname}",
|
||||
Prefix = x.Prefix,
|
||||
Firstname = x.Firstname,
|
||||
Lastname = x.Lastname,
|
||||
IdCard = x.CitizenId,
|
||||
CitizenId = x.CitizenId,
|
||||
ExamNumber = x.ExamNumber,
|
||||
posmasterId = x.posmasterId,
|
||||
root = x.root,
|
||||
rootId = x.rootId,
|
||||
rootShortName = x.rootShortName,
|
||||
child1 = x.child1,
|
||||
child1Id = x.child1Id,
|
||||
child1ShortName = x.child1ShortName,
|
||||
child2 = x.child2,
|
||||
child2Id = x.child2Id,
|
||||
child2ShortName = x.child2ShortName,
|
||||
child3 = x.child3,
|
||||
child3Id = x.child3Id,
|
||||
child3ShortName = x.child3ShortName,
|
||||
child4 = x.child4,
|
||||
child4Id = x.child4Id,
|
||||
child4ShortName = x.child4ShortName,
|
||||
orgRevisionId = x.orgRevisionId,
|
||||
positionId = x.positionId,
|
||||
posMasterNo = x.posMasterNo,
|
||||
positionName = x.positionName,
|
||||
positionField = x.positionField,
|
||||
posTypeId = x.posTypeId,
|
||||
posTypeName = x.posTypeName,
|
||||
posLevelId = x.posLevelId,
|
||||
posLevelName = x.posLevelName,
|
||||
PositionCandidate = x.PositionCandidate == null ? null : x.PositionCandidate.Name,
|
||||
PositionCandidateId = x.PositionCandidate == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.PositionCandidate.Id,
|
||||
ReportingDate = x.ReportingDate,
|
||||
StatusId = x.PlacementStatus,
|
||||
Draft = x.Draft,
|
||||
typeCommand = x.typeCommand,
|
||||
IsOfficer = x.IsOfficer,
|
||||
IsRelief = x.IsRelief,
|
||||
posLevelCandidateId = x.posLevelIdOld != null ? Guid.Parse(x.posLevelIdOld) : (x.PositionLevel == null ? (Guid?)null : x.PositionLevel.Id),
|
||||
posTypeCandidateId = x.posTypeIdOld != null ? Guid.Parse(x.posTypeIdOld) : (x.PositionType == null ? (Guid?)null : x.PositionType.Id),
|
||||
}).OrderBy(x => x.ExamNumber).ToListAsync();
|
||||
|
||||
var result = new List<dynamic>();
|
||||
foreach (var p in data)
|
||||
{
|
||||
var _data = new
|
||||
var org = JsonConvert.DeserializeObject<OrgRequestAct>(_result);
|
||||
if (org.result.isOfficer == false)
|
||||
{
|
||||
p.Id,
|
||||
p.PersonalId,
|
||||
Avatar = p.Avatar == Guid.Parse("00000000-0000-0000-0000-000000000000") ? null : await _documentService.ImagesPath(p.Avatar),
|
||||
p.FullName,
|
||||
p.Prefix,
|
||||
p.Firstname,
|
||||
p.Lastname,
|
||||
p.IdCard,
|
||||
p.CitizenId,
|
||||
p.profileId,
|
||||
p.ExamNumber,
|
||||
p.posmasterId,
|
||||
p.root,
|
||||
p.rootId,
|
||||
p.rootShortName,
|
||||
p.child1,
|
||||
p.child1Id,
|
||||
p.child1ShortName,
|
||||
p.child2,
|
||||
p.child2Id,
|
||||
p.child2ShortName,
|
||||
p.child3,
|
||||
p.child3Id,
|
||||
p.child3ShortName,
|
||||
p.child4,
|
||||
p.child4Id,
|
||||
p.child4ShortName,
|
||||
node = p.root == null ? (int?)null : (p.child1 == null ? 0 : (p.child2 == null ? 1 : (p.child3 == null ? 2 : (p.child4 == null ? 3 : 4)))),
|
||||
nodeName = p.root == null ? null : (p.child1 == null ? p.root : (p.child2 == null ? p.child1 : (p.child3 == null ? p.child2 : (p.child4 == null ? p.child3 : p.child4)))),
|
||||
nodeId = p.rootId == null ? null : (p.child1Id == null ? p.rootId : (p.child2Id == null ? p.child1Id : (p.child3Id == null ? p.child2Id : (p.child4Id == null ? p.child3Id : p.child4Id)))),
|
||||
nodeShortName = p.rootShortName == null ? null : (p.child1ShortName == null ? p.rootShortName : (p.child2ShortName == null ? p.child1ShortName : (p.child3ShortName == null ? p.child2ShortName : (p.child4ShortName == null ? p.child3ShortName : p.child4ShortName)))),
|
||||
p.orgRevisionId,
|
||||
p.positionId,
|
||||
p.posMasterNo,
|
||||
p.positionName,
|
||||
p.positionField,
|
||||
p.posTypeId,
|
||||
p.posTypeName,
|
||||
p.posLevelId,
|
||||
p.posLevelName,
|
||||
p.PositionCandidate,
|
||||
p.PositionCandidateId,
|
||||
p.ReportingDate,
|
||||
BmaOfficer = p.IsOfficer == true ? "OFFICER" : null,
|
||||
p.StatusId,
|
||||
p.Draft,
|
||||
p.typeCommand,
|
||||
p.IsRelief,
|
||||
p.posLevelCandidateId,
|
||||
p.posTypeCandidateId,
|
||||
};
|
||||
result.Add(_data);
|
||||
}
|
||||
return Success(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
var rootId = "";
|
||||
var child1Id = "";
|
||||
var child2Id = "";
|
||||
var child3Id = "";
|
||||
var child4Id = "";
|
||||
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
|
||||
rootId = org.result.rootId == null ? "" : org.result.rootId;
|
||||
child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
|
||||
child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
|
||||
child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
|
||||
child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
|
||||
// return Success(new {rootId=rootId,child1Id=child1Id,child2Id=child2Id,child3Id=child3Id,child4Id=child4Id });
|
||||
var data = await _context.PlacementProfiles
|
||||
.Where(x => x.Placement.Id == examId)
|
||||
.Where(x => x.Draft == true)
|
||||
.Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id)))))
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,
|
||||
PersonalId = x.Id,
|
||||
x.profileId,
|
||||
Avatar = x.ProfileImg == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.ProfileImg.Id,
|
||||
FullName = $"{x.Prefix}{x.Firstname} {x.Lastname}",
|
||||
Prefix = x.Prefix,
|
||||
Firstname = x.Firstname,
|
||||
Lastname = x.Lastname,
|
||||
IdCard = x.CitizenId,
|
||||
CitizenId = x.CitizenId,
|
||||
ExamNumber = x.ExamNumber,
|
||||
posmasterId = x.posmasterId,
|
||||
root = x.root,
|
||||
rootId = x.rootId,
|
||||
rootShortName = x.rootShortName,
|
||||
child1 = x.child1,
|
||||
child1Id = x.child1Id,
|
||||
child1ShortName = x.child1ShortName,
|
||||
child2 = x.child2,
|
||||
child2Id = x.child2Id,
|
||||
child2ShortName = x.child2ShortName,
|
||||
child3 = x.child3,
|
||||
child3Id = x.child3Id,
|
||||
child3ShortName = x.child3ShortName,
|
||||
child4 = x.child4,
|
||||
child4Id = x.child4Id,
|
||||
child4ShortName = x.child4ShortName,
|
||||
orgRevisionId = x.orgRevisionId,
|
||||
positionId = x.positionId,
|
||||
posMasterNo = x.posMasterNo,
|
||||
positionName = x.positionName,
|
||||
positionField = x.positionField,
|
||||
posTypeId = x.posTypeId,
|
||||
posTypeName = x.posTypeName,
|
||||
posLevelId = x.posLevelId,
|
||||
posLevelName = x.posLevelName,
|
||||
PositionCandidate = x.PositionCandidate == null ? null : x.PositionCandidate.Name,
|
||||
PositionCandidateId = x.PositionCandidate == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.PositionCandidate.Id,
|
||||
ReportingDate = x.ReportingDate,
|
||||
StatusId = x.PlacementStatus,
|
||||
Draft = x.Draft,
|
||||
typeCommand = x.typeCommand,
|
||||
IsOfficer = x.IsOfficer,
|
||||
IsRelief = x.IsRelief,
|
||||
posLevelCandidateId = x.PositionLevel == null ? (Guid?)null : x.PositionLevel.Id,
|
||||
posTypeCandidateId = x.PositionType == null ? (Guid?)null : x.PositionType.Id,
|
||||
}).OrderBy(x => x.ExamNumber).ToListAsync();
|
||||
|
||||
var result = new List<dynamic>();
|
||||
foreach (var p in data)
|
||||
{
|
||||
var _data = new
|
||||
rootId = org.result.rootId == null ? "" : org.result.rootId;
|
||||
child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
|
||||
child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
|
||||
child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
|
||||
child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
|
||||
var data1 = await _context.PlacementProfiles
|
||||
.Where(x => x.Placement.Id == examId)
|
||||
.Where(x => x.Draft == true)
|
||||
.Where(x => x.PlacementStatus != "UN-CONTAIN")
|
||||
.Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id)))))
|
||||
.Select(x => new
|
||||
{
|
||||
p.Id,
|
||||
p.PersonalId,
|
||||
Avatar = p.Avatar == Guid.Parse("00000000-0000-0000-0000-000000000000") ? null : await _documentService.ImagesPath(p.Avatar),
|
||||
p.FullName,
|
||||
p.Prefix,
|
||||
p.Firstname,
|
||||
p.Lastname,
|
||||
p.IdCard,
|
||||
p.CitizenId,
|
||||
p.profileId,
|
||||
p.ExamNumber,
|
||||
p.posmasterId,
|
||||
p.root,
|
||||
p.rootId,
|
||||
p.rootShortName,
|
||||
p.child1,
|
||||
p.child1Id,
|
||||
p.child1ShortName,
|
||||
p.child2,
|
||||
p.child2Id,
|
||||
p.child2ShortName,
|
||||
p.child3,
|
||||
p.child3Id,
|
||||
p.child3ShortName,
|
||||
p.child4,
|
||||
p.child4Id,
|
||||
p.child4ShortName,
|
||||
node = p.root == null ? (int?)null : (p.child1 == null ? 0 : (p.child2 == null ? 1 : (p.child3 == null ? 2 : (p.child4 == null ? 3 : 4)))),
|
||||
nodeName = p.root == null ? null : (p.child1 == null ? p.root : (p.child2 == null ? p.child1 : (p.child3 == null ? p.child2 : (p.child4 == null ? p.child3 : p.child4)))),
|
||||
nodeId = p.rootId == null ? null : (p.child1Id == null ? p.rootId : (p.child2Id == null ? p.child1Id : (p.child3Id == null ? p.child2Id : (p.child4Id == null ? p.child3Id : p.child4Id)))),
|
||||
nodeShortName = p.rootShortName == null ? null : (p.child1ShortName == null ? p.rootShortName : (p.child2ShortName == null ? p.child1ShortName : (p.child3ShortName == null ? p.child2ShortName : (p.child4ShortName == null ? p.child3ShortName : p.child4ShortName)))),
|
||||
p.orgRevisionId,
|
||||
p.positionId,
|
||||
p.posMasterNo,
|
||||
p.positionName,
|
||||
p.positionField,
|
||||
p.posTypeId,
|
||||
p.posTypeName,
|
||||
p.posLevelId,
|
||||
p.posLevelName,
|
||||
p.PositionCandidate,
|
||||
p.PositionCandidateId,
|
||||
p.ReportingDate,
|
||||
BmaOfficer = p.IsOfficer == true ? "OFFICER" : null,
|
||||
p.StatusId,
|
||||
p.Draft,
|
||||
p.typeCommand,
|
||||
p.IsRelief,
|
||||
p.posLevelCandidateId,
|
||||
p.posTypeCandidateId,
|
||||
};
|
||||
result.Add(_data);
|
||||
Id = x.Id,
|
||||
PersonalId = x.Id,
|
||||
x.profileId,
|
||||
Avatar = x.ProfileImg == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.ProfileImg.Id,
|
||||
FullName = $"{x.Prefix}{x.Firstname} {x.Lastname}",
|
||||
Prefix = x.Prefix,
|
||||
Firstname = x.Firstname,
|
||||
Lastname = x.Lastname,
|
||||
IdCard = x.CitizenId,
|
||||
CitizenId = x.CitizenId,
|
||||
ExamNumber = x.ExamNumber,
|
||||
posmasterId = x.posmasterId,
|
||||
root = x.root,
|
||||
rootId = x.rootId,
|
||||
rootShortName = x.rootShortName,
|
||||
child1 = x.child1,
|
||||
child1Id = x.child1Id,
|
||||
child1ShortName = x.child1ShortName,
|
||||
child2 = x.child2,
|
||||
child2Id = x.child2Id,
|
||||
child2ShortName = x.child2ShortName,
|
||||
child3 = x.child3,
|
||||
child3Id = x.child3Id,
|
||||
child3ShortName = x.child3ShortName,
|
||||
child4 = x.child4,
|
||||
child4Id = x.child4Id,
|
||||
child4ShortName = x.child4ShortName,
|
||||
orgRevisionId = x.orgRevisionId,
|
||||
positionId = x.positionId,
|
||||
posMasterNo = x.posMasterNo,
|
||||
positionName = x.positionName,
|
||||
positionField = x.positionField,
|
||||
posTypeId = x.posTypeId,
|
||||
posTypeName = x.posTypeName,
|
||||
posLevelId = x.posLevelId,
|
||||
posLevelName = x.posLevelName,
|
||||
PositionCandidate = x.PositionCandidate == null ? null : x.PositionCandidate.Name,
|
||||
PositionCandidateId = x.PositionCandidate == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.PositionCandidate.Id,
|
||||
ReportingDate = x.ReportingDate,
|
||||
StatusId = x.PlacementStatus,
|
||||
Draft = x.Draft,
|
||||
typeCommand = x.typeCommand,
|
||||
IsOfficer = x.IsOfficer,
|
||||
IsRelief = x.IsRelief,
|
||||
posLevelCandidateId = x.PositionLevel == null ? (Guid?)null : x.PositionLevel.Id,
|
||||
posTypeCandidateId = x.PositionType == null ? (Guid?)null : x.PositionType.Id,
|
||||
}).OrderBy(x => x.ExamNumber).ToListAsync();
|
||||
|
||||
var result1 = new List<dynamic>();
|
||||
foreach (var p in data1)
|
||||
{
|
||||
var _data1 = new
|
||||
{
|
||||
p.Id,
|
||||
p.PersonalId,
|
||||
Avatar = p.Avatar == Guid.Parse("00000000-0000-0000-0000-000000000000") ? null : await _documentService.ImagesPath(p.Avatar),
|
||||
p.FullName,
|
||||
p.Prefix,
|
||||
p.Firstname,
|
||||
p.Lastname,
|
||||
p.IdCard,
|
||||
p.CitizenId,
|
||||
p.profileId,
|
||||
p.ExamNumber,
|
||||
p.posmasterId,
|
||||
p.root,
|
||||
p.rootId,
|
||||
p.rootShortName,
|
||||
p.child1,
|
||||
p.child1Id,
|
||||
p.child1ShortName,
|
||||
p.child2,
|
||||
p.child2Id,
|
||||
p.child2ShortName,
|
||||
p.child3,
|
||||
p.child3Id,
|
||||
p.child3ShortName,
|
||||
p.child4,
|
||||
p.child4Id,
|
||||
p.child4ShortName,
|
||||
node = p.root == null ? (int?)null : (p.child1 == null ? 0 : (p.child2 == null ? 1 : (p.child3 == null ? 2 : (p.child4 == null ? 3 : 4)))),
|
||||
nodeName = p.root == null ? null : (p.child1 == null ? p.root : (p.child2 == null ? p.child1 : (p.child3 == null ? p.child2 : (p.child4 == null ? p.child3 : p.child4)))),
|
||||
nodeId = p.rootId == null ? null : (p.child1Id == null ? p.rootId : (p.child2Id == null ? p.child1Id : (p.child3Id == null ? p.child2Id : (p.child4Id == null ? p.child3Id : p.child4Id)))),
|
||||
nodeShortName = p.rootShortName == null ? null : (p.child1ShortName == null ? p.rootShortName : (p.child2ShortName == null ? p.child1ShortName : (p.child3ShortName == null ? p.child2ShortName : (p.child4ShortName == null ? p.child3ShortName : p.child4ShortName)))),
|
||||
p.orgRevisionId,
|
||||
p.positionId,
|
||||
p.posMasterNo,
|
||||
p.positionName,
|
||||
p.positionField,
|
||||
p.posTypeId,
|
||||
p.posTypeName,
|
||||
p.posLevelId,
|
||||
p.posLevelName,
|
||||
p.PositionCandidate,
|
||||
p.PositionCandidateId,
|
||||
p.ReportingDate,
|
||||
BmaOfficer = p.IsOfficer == true ? "OFFICER" : null,
|
||||
p.StatusId,
|
||||
p.Draft,
|
||||
p.typeCommand,
|
||||
p.IsRelief,
|
||||
p.posLevelCandidateId,
|
||||
p.posTypeCandidateId,
|
||||
};
|
||||
result1.Add(_data1);
|
||||
}
|
||||
return Success(result1);
|
||||
}
|
||||
if (org.result.isOfficer == true)
|
||||
{
|
||||
var data = await _context.PlacementProfiles.Where(x => x.Placement.Id == examId).Select(x => new
|
||||
{
|
||||
Id = x.Id,
|
||||
PersonalId = x.Id,
|
||||
x.profileId,
|
||||
Avatar = x.ProfileImg == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.ProfileImg.Id,
|
||||
FullName = $"{x.Prefix}{x.Firstname} {x.Lastname}",
|
||||
Prefix = x.Prefix,
|
||||
Firstname = x.Firstname,
|
||||
Lastname = x.Lastname,
|
||||
IdCard = x.CitizenId,
|
||||
CitizenId = x.CitizenId,
|
||||
ExamNumber = x.ExamNumber,
|
||||
posmasterId = x.posmasterId,
|
||||
root = x.root,
|
||||
rootId = x.rootId,
|
||||
rootShortName = x.rootShortName,
|
||||
child1 = x.child1,
|
||||
child1Id = x.child1Id,
|
||||
child1ShortName = x.child1ShortName,
|
||||
child2 = x.child2,
|
||||
child2Id = x.child2Id,
|
||||
child2ShortName = x.child2ShortName,
|
||||
child3 = x.child3,
|
||||
child3Id = x.child3Id,
|
||||
child3ShortName = x.child3ShortName,
|
||||
child4 = x.child4,
|
||||
child4Id = x.child4Id,
|
||||
child4ShortName = x.child4ShortName,
|
||||
orgRevisionId = x.orgRevisionId,
|
||||
positionId = x.positionId,
|
||||
posMasterNo = x.posMasterNo,
|
||||
positionName = x.positionName,
|
||||
positionField = x.positionField,
|
||||
posTypeId = x.posTypeId,
|
||||
posTypeName = x.posTypeName,
|
||||
posLevelId = x.posLevelId,
|
||||
posLevelName = x.posLevelName,
|
||||
PositionCandidate = x.PositionCandidate == null ? null : x.PositionCandidate.Name,
|
||||
PositionCandidateId = x.PositionCandidate == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.PositionCandidate.Id,
|
||||
ReportingDate = x.ReportingDate,
|
||||
StatusId = x.PlacementStatus,
|
||||
Draft = x.Draft,
|
||||
typeCommand = x.typeCommand,
|
||||
IsOfficer = x.IsOfficer,
|
||||
IsRelief = x.IsRelief,
|
||||
posLevelCandidateId = x.posLevelIdOld != null ? Guid.Parse(x.posLevelIdOld) : (x.PositionLevel == null ? (Guid?)null : x.PositionLevel.Id),
|
||||
posTypeCandidateId = x.posTypeIdOld != null ? Guid.Parse(x.posTypeIdOld) : (x.PositionType == null ? (Guid?)null : x.PositionType.Id),
|
||||
}).OrderBy(x => x.ExamNumber).ToListAsync();
|
||||
|
||||
var result = new List<dynamic>();
|
||||
foreach (var p in data)
|
||||
{
|
||||
var _data = new
|
||||
{
|
||||
p.Id,
|
||||
p.PersonalId,
|
||||
Avatar = p.Avatar == Guid.Parse("00000000-0000-0000-0000-000000000000") ? null : await _documentService.ImagesPath(p.Avatar),
|
||||
p.FullName,
|
||||
p.Prefix,
|
||||
p.Firstname,
|
||||
p.Lastname,
|
||||
p.IdCard,
|
||||
p.CitizenId,
|
||||
p.profileId,
|
||||
p.ExamNumber,
|
||||
p.posmasterId,
|
||||
p.root,
|
||||
p.rootId,
|
||||
p.rootShortName,
|
||||
p.child1,
|
||||
p.child1Id,
|
||||
p.child1ShortName,
|
||||
p.child2,
|
||||
p.child2Id,
|
||||
p.child2ShortName,
|
||||
p.child3,
|
||||
p.child3Id,
|
||||
p.child3ShortName,
|
||||
p.child4,
|
||||
p.child4Id,
|
||||
p.child4ShortName,
|
||||
node = p.root == null ? (int?)null : (p.child1 == null ? 0 : (p.child2 == null ? 1 : (p.child3 == null ? 2 : (p.child4 == null ? 3 : 4)))),
|
||||
nodeName = p.root == null ? null : (p.child1 == null ? p.root : (p.child2 == null ? p.child1 : (p.child3 == null ? p.child2 : (p.child4 == null ? p.child3 : p.child4)))),
|
||||
nodeId = p.rootId == null ? null : (p.child1Id == null ? p.rootId : (p.child2Id == null ? p.child1Id : (p.child3Id == null ? p.child2Id : (p.child4Id == null ? p.child3Id : p.child4Id)))),
|
||||
nodeShortName = p.rootShortName == null ? null : (p.child1ShortName == null ? p.rootShortName : (p.child2ShortName == null ? p.child1ShortName : (p.child3ShortName == null ? p.child2ShortName : (p.child4ShortName == null ? p.child3ShortName : p.child4ShortName)))),
|
||||
p.orgRevisionId,
|
||||
p.positionId,
|
||||
p.posMasterNo,
|
||||
p.positionName,
|
||||
p.positionField,
|
||||
p.posTypeId,
|
||||
p.posTypeName,
|
||||
p.posLevelId,
|
||||
p.posLevelName,
|
||||
p.PositionCandidate,
|
||||
p.PositionCandidateId,
|
||||
p.ReportingDate,
|
||||
BmaOfficer = p.IsOfficer == true ? "OFFICER" : null,
|
||||
p.StatusId,
|
||||
p.Draft,
|
||||
p.typeCommand,
|
||||
p.IsRelief,
|
||||
p.posLevelCandidateId,
|
||||
p.posTypeCandidateId,
|
||||
};
|
||||
result.Add(_data);
|
||||
}
|
||||
return Success(result);
|
||||
}
|
||||
return Success(result);
|
||||
}
|
||||
}
|
||||
return Success(new List<dynamic>());
|
||||
}
|
||||
|
||||
[HttpGet("personal/{personalId:length(36)}")]
|
||||
|
|
@ -614,70 +615,68 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpGet("pass/stat/{examId:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetDashboardByPlacement(Guid examId)
|
||||
{
|
||||
if (PlacementAdmin == true)
|
||||
{
|
||||
var placement = await _context.Placements
|
||||
.Where(x => x.Id == examId)
|
||||
.Select(x => new
|
||||
{
|
||||
Total = x.PlacementProfiles.Count(),
|
||||
UnContain = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "UN-CONTAIN").Count(),
|
||||
PrepareContain = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN").Count(),
|
||||
Report = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "REPORT").Count(),
|
||||
Done = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "DONE").Count(),
|
||||
Disclaim = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "DISCLAIM").Count(),
|
||||
}).FirstOrDefaultAsync();
|
||||
if (placement == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
|
||||
return Success(placement);
|
||||
}
|
||||
else
|
||||
|
||||
var rootId = "";
|
||||
var child1Id = "";
|
||||
var child2Id = "";
|
||||
var child3Id = "";
|
||||
var child4Id = "";
|
||||
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position-act";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var rootId = "";
|
||||
var child1Id = "";
|
||||
var child2Id = "";
|
||||
var child3Id = "";
|
||||
var child4Id = "";
|
||||
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
|
||||
using (var client = new HttpClient())
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
var org = JsonConvert.DeserializeObject<OrgRequestAct>(_result);
|
||||
if (org.result.isOfficer == false)
|
||||
{
|
||||
rootId = org.result.rootId == null ? "" : org.result.rootId;
|
||||
child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
|
||||
child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
|
||||
child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
|
||||
child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
|
||||
var placement = await _context.Placements
|
||||
.Where(x => x.Id == examId)
|
||||
.Select(x => new
|
||||
{
|
||||
Total = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Count(),
|
||||
UnContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "UN-CONTAIN").Count(),
|
||||
PrepareContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN").Count(),
|
||||
Report = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "REPORT").Count(),
|
||||
Done = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DONE").Count(),
|
||||
Disclaim = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DISCLAIM").Count(),
|
||||
}).FirstOrDefaultAsync();
|
||||
if (placement == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
|
||||
rootId = org.result.rootId == null ? "" : org.result.rootId;
|
||||
child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
|
||||
child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
|
||||
child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
|
||||
child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
|
||||
// var profileOrg = await _context.Profiles.FirstOrDefaultAsync(x => x.KeycloakId == Guid.Parse(UserId ?? "00000000-0000-0000-0000-000000000000"));
|
||||
// if (profileOrg == null)
|
||||
// return Error(GlobalMessages.DataNotFound, 404);
|
||||
// var ocIdList = _documentService.GetAllIdByRoot(profileOrg.OcId);
|
||||
var placement = await _context.Placements
|
||||
.Where(x => x.Id == examId)
|
||||
.Select(x => new
|
||||
{
|
||||
Total = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Count(),
|
||||
UnContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "UN-CONTAIN").Count(),
|
||||
PrepareContain = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN").Count(),
|
||||
Report = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "REPORT").Count(),
|
||||
Done = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DONE").Count(),
|
||||
Disclaim = x.PlacementProfiles.Where(x => x.Draft == true).Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))).Where(p => p.PlacementStatus.Trim().ToUpper() == "DISCLAIM").Count(),
|
||||
}).FirstOrDefaultAsync();
|
||||
if (placement == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
|
||||
return Success(placement);
|
||||
return Success(placement);
|
||||
}
|
||||
if (org.result.isOfficer == true)
|
||||
{
|
||||
var placement = await _context.Placements
|
||||
.Where(x => x.Id == examId)
|
||||
.Select(x => new
|
||||
{
|
||||
Total = x.PlacementProfiles.Count(),
|
||||
UnContain = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "UN-CONTAIN").Count(),
|
||||
PrepareContain = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "PREPARE-CONTAIN").Count(),
|
||||
Report = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "REPORT").Count(),
|
||||
Done = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "DONE").Count(),
|
||||
Disclaim = x.PlacementProfiles.Where(p => p.PlacementStatus.Trim().ToUpper() == "DISCLAIM").Count(),
|
||||
}).FirstOrDefaultAsync();
|
||||
if (placement == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
return Success(placement);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Success(new List<dynamic>());
|
||||
}
|
||||
|
||||
[HttpPost("pass/deferment"), DisableRequestSizeLimit]
|
||||
|
|
@ -1606,7 +1605,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
result.Add(r);
|
||||
string? _null = null;
|
||||
result.Add(new {
|
||||
result.Add(new
|
||||
{
|
||||
No = _null,
|
||||
FullName = r.RemarkHorizontal,
|
||||
Education = _null,
|
||||
|
|
@ -1905,7 +1905,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
result.Add(r);
|
||||
string? _null = null;
|
||||
result.Add(new {
|
||||
result.Add(new
|
||||
{
|
||||
No = _null,
|
||||
FullName = r.RemarkHorizontal,
|
||||
Education = _null,
|
||||
|
|
@ -2222,7 +2223,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
result.Add(r);
|
||||
string? _null = null;
|
||||
result.Add(new {
|
||||
result.Add(new
|
||||
{
|
||||
No = _null,
|
||||
FullName = r.RemarkHorizontal,
|
||||
Education = _null,
|
||||
|
|
@ -2444,7 +2446,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
result.Add(r);
|
||||
string? _null = null;
|
||||
result.Add(new {
|
||||
result.Add(new
|
||||
{
|
||||
No = _null,
|
||||
FullName = r.RemarkHorizontal,
|
||||
Education = _null,
|
||||
|
|
@ -2658,7 +2661,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
result.Add(r);
|
||||
string? _null = null;
|
||||
result.Add(new {
|
||||
result.Add(new
|
||||
{
|
||||
No = _null,
|
||||
FullName = r.RemarkHorizontal,
|
||||
Education = _null,
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
refId = placementTransfer.Id,
|
||||
sysName = "PLACEMENT_TRANSFER",
|
||||
sysName = "SYS_TRANSFER_REQ",
|
||||
posLevelName = placementTransfer.posLevelNameOld,
|
||||
posTypeName = placementTransfer.posTypeNameOld,
|
||||
});
|
||||
|
|
@ -873,7 +873,8 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
{
|
||||
result.Add(r);
|
||||
string? _null = null;
|
||||
result.Add(new {
|
||||
result.Add(new
|
||||
{
|
||||
No = _null,
|
||||
FullName = r.RemarkHorizontal,
|
||||
OldOc = _null,
|
||||
|
|
|
|||
19
BMA.EHR.Placement.Service/Requests/OrgRequestAct.cs
Normal file
19
BMA.EHR.Placement.Service/Requests/OrgRequestAct.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Placement.Service.Requests
|
||||
{
|
||||
public class OrgRequestAct
|
||||
{
|
||||
public OrgRequestActData result { get; set; } = new();
|
||||
}
|
||||
public class OrgRequestActData
|
||||
{
|
||||
public bool? isOfficer { get; set; }
|
||||
public string? rootId { get; set; }
|
||||
public string? child1Id { get; set; }
|
||||
public string? child2Id { get; set; }
|
||||
public string? child3Id { get; set; }
|
||||
public string? child4Id { get; set; }
|
||||
}
|
||||
}
|
||||
12
BMA.EHR.Placement.Service/Requests/SendEmailRequest.cs
Normal file
12
BMA.EHR.Placement.Service/Requests/SendEmailRequest.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Placement.Service.Requests
|
||||
{
|
||||
public class SendEmailRequest
|
||||
{
|
||||
public string Subject { get; set; }
|
||||
public string Body { get; set; }
|
||||
public string Email { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -151,6 +151,55 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
p.Reason,
|
||||
p.ApproveReason,
|
||||
p.RejectReason,
|
||||
p.CancelReason,
|
||||
p.Status,
|
||||
p.RetirementResignCancels,//xxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
p.IsActive,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
return Success(retirementResigns);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// list รายการลาออกของ User
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("user-cancel")]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByProfileCancel()
|
||||
{
|
||||
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
|
||||
|
||||
var retirementResigns = await _context.RetirementResignCancels.AsQueryable()
|
||||
.Where(x => x.profileId == org.result.profileId)
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.Location,
|
||||
p.SendDate,
|
||||
p.ActiveDate,
|
||||
p.Reason,
|
||||
p.ApproveReason,
|
||||
p.RejectReason,
|
||||
p.CancelReason,
|
||||
p.Status,
|
||||
p.IsActive,
|
||||
})
|
||||
|
|
@ -200,6 +249,56 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
p.RemarkHorizontal,
|
||||
p.ApproveReason,
|
||||
p.RejectReason,
|
||||
p.CancelReason,
|
||||
p.IsActive,
|
||||
p.CreatedAt,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
return Success(retirementResigns);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// list รายการลาออกของ Admin
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("cancel")]
|
||||
public async Task<ActionResult<ResponseObject>> GetListByAdminCancel()
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_RESIGN");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var retirementResigns = await _context.RetirementResignCancels.AsQueryable()
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.citizenId,
|
||||
p.profileId,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
p.lastName,
|
||||
p.Location,
|
||||
p.SendDate,
|
||||
p.ActiveDate,
|
||||
p.Reason,
|
||||
p.Status,
|
||||
salary = p.AmountOld,
|
||||
p.PositionTypeOld,
|
||||
p.PositionLevelOld,
|
||||
p.PositionNumberOld,
|
||||
p.OrganizationPositionOld,
|
||||
p.RemarkHorizontal,
|
||||
p.ApproveReason,
|
||||
p.RejectReason,
|
||||
p.CancelReason,
|
||||
p.IsActive,
|
||||
p.CreatedAt,
|
||||
})
|
||||
|
|
@ -224,7 +323,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var createdUserId = await _context.RetirementResigns.AsQueryable()
|
||||
.Where(x => x.CreatedUserId == UserId)
|
||||
.FirstOrDefaultAsync();
|
||||
if (getWorkflow == false && createdUserId ==null)
|
||||
if (getWorkflow == false && createdUserId == null)
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_RESIGN");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
|
|
@ -293,6 +392,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
p.IsNoDebt,
|
||||
p.IsNoBurden,
|
||||
p.IsDiscipline,
|
||||
p.CancelReason,
|
||||
// Avatar = p.Profile.Avatar == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Avatar.Id,
|
||||
RetirementResignDocs = p.RetirementResignDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
// RetirementResignDebtDocs = p.RetirementResignDebtDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
|
|
@ -382,6 +482,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
data.IsNoDebt,
|
||||
data.IsNoBurden,
|
||||
data.IsDiscipline,
|
||||
data.CancelReason,
|
||||
// Avatar = data.Avatar == Guid.Parse("00000000-0000-0000-0000-000000000000") ? null : await _documentService.ImagesPath(data.Avatar),
|
||||
Docs = retirementResignDocs,
|
||||
// DocDebts = retirementResignDebtDocs,
|
||||
|
|
@ -390,6 +491,101 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
return Success(_data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get รายละเอียดลาออก
|
||||
/// </summary>
|
||||
/// <param name="id">Id ลาออก</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("cancel/{id:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> GetDetailByUserCancel(Guid id)
|
||||
{
|
||||
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "RETIREMENT_CANCEL");
|
||||
var createdUserId = await _context.RetirementResigns.AsQueryable()
|
||||
.Where(x => x.CreatedUserId == UserId)
|
||||
.FirstOrDefaultAsync();
|
||||
if (getWorkflow == false && createdUserId == null)
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "RETIREMENT_CANCEL");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
}
|
||||
var data = await _context.RetirementResigns.AsQueryable()
|
||||
.Where(x => x.Id == id)
|
||||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
p.lastName,
|
||||
p.profileId,
|
||||
p.Location,
|
||||
p.SendDate,
|
||||
p.ActiveDate,
|
||||
p.Reason,
|
||||
p.Status,
|
||||
salary = p.AmountOld,
|
||||
p.ApproveReason,
|
||||
p.RejectReason,
|
||||
p.IsActive,
|
||||
p.CreatedAt,
|
||||
p.PositionTypeOld,
|
||||
p.PositionLevelOld,
|
||||
p.PositionNumberOld,
|
||||
p.OrganizationPositionOld,
|
||||
p.OligarchReject,
|
||||
p.OligarchApproveReason,
|
||||
p.OligarchRejectReason,
|
||||
p.OligarchRejectDate,
|
||||
p.CommanderReject,
|
||||
p.CommanderApproveReason,
|
||||
p.CommanderRejectReason,
|
||||
p.CommanderRejectDate,
|
||||
p.OfficerReject,
|
||||
p.OfficerApproveReason,
|
||||
p.OfficerRejectReason,
|
||||
p.OfficerRejectDate,
|
||||
p.RemarkHorizontal,
|
||||
p.rootOld,
|
||||
p.rootOldId,
|
||||
p.rootShortNameOld,
|
||||
p.child1Old,
|
||||
p.child1OldId,
|
||||
p.child1ShortNameOld,
|
||||
p.child2Old,
|
||||
p.child2OldId,
|
||||
p.child2ShortNameOld,
|
||||
p.child3Old,
|
||||
p.child3OldId,
|
||||
p.child3ShortNameOld,
|
||||
p.child4Old,
|
||||
p.child4OldId,
|
||||
p.child4ShortNameOld,
|
||||
p.PositionOld,
|
||||
p.posMasterNoOld,
|
||||
p.posTypeOldId,
|
||||
p.posTypeNameOld,
|
||||
p.posLevelOldId,
|
||||
p.posLevelNameOld,
|
||||
p.IsNoDebt,
|
||||
p.IsNoBurden,
|
||||
p.IsDiscipline,
|
||||
p.CancelReason,
|
||||
RetirementResignDocs = p.RetirementResignDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
})
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(GlobalMessages.RetirementResignNotFound, 404);
|
||||
|
||||
return Success(data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// สร้างการลาออก
|
||||
/// </summary>
|
||||
|
|
@ -513,14 +709,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
}
|
||||
}
|
||||
await _repositoryNoti.PushNotificationAsync(
|
||||
Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"),
|
||||
$"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก",
|
||||
$"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก",
|
||||
"",
|
||||
"",
|
||||
true
|
||||
);
|
||||
// await _repositoryNoti.PushNotificationAsync(
|
||||
// Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"),
|
||||
// $"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก",
|
||||
// $"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก",
|
||||
// "",
|
||||
// "",
|
||||
// true
|
||||
// );
|
||||
await _context.SaveChangesAsync();
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
|
|
@ -529,7 +725,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var _res = await client.PostAsJsonAsync($"{_configuration["API"]}/org/workflow/add-workflow", new
|
||||
{
|
||||
refId = retirementResign.Id,
|
||||
sysName = "RETIREMENT_RESIFNATION",
|
||||
sysName = "SYS_RETIREMENT",
|
||||
posLevelName = retirementResign.PositionLevelOld,
|
||||
posTypeName = retirementResign.PositionTypeOld,
|
||||
});
|
||||
|
|
@ -569,6 +765,38 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
|
||||
return Success();
|
||||
}
|
||||
/// <summary>
|
||||
/// แก้ไขการลาออก
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("cancel/{id:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> PutCancel([FromForm] RetirementResignRequest req, Guid id)
|
||||
{
|
||||
var updated = await _context.RetirementResignCancels
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (updated == null)
|
||||
return Error(GlobalMessages.RetirementResignNotFound, 404);
|
||||
|
||||
updated.Location = req.Location;
|
||||
updated.ActiveDate = req.ActiveDate;
|
||||
updated.Reason = req.Reason;
|
||||
updated.OrganizationPositionOld = req.OrganizationPositionOld;
|
||||
updated.RemarkHorizontal = req.RemarkHorizontal;
|
||||
updated.PositionTypeOld = req.PositionTypeOld;
|
||||
updated.PositionLevelOld = req.PositionLevelOld;
|
||||
updated.PositionNumberOld = req.PositionNumberOld;
|
||||
updated.AmountOld = req.AmountOld;
|
||||
updated.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
updated.LastUpdateUserId = UserId ?? "";
|
||||
updated.LastUpdatedAt = DateTime.Now;
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// แก้ไขรายการตรวจสอบเงื่อนไขต่าง ๆ
|
||||
|
|
@ -665,61 +893,128 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (updated == null)
|
||||
return Error(GlobalMessages.RetirementResignNotFound, 404);
|
||||
updated.CancelReason = req.Reason;
|
||||
if (updated.Status == "DONE")
|
||||
{
|
||||
updated.Status = "DONECANCEL";
|
||||
|
||||
// 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($"{_configuration["API"]}/org/workflow/add-workflow", new
|
||||
// {
|
||||
// refId = retirementResign.Id,
|
||||
// sysName = "RETIREMENT_RESIFNATION_CANCEL",
|
||||
// posLevelName = retirementResign.PositionLevelOld,
|
||||
// posTypeName = retirementResign.PositionTypeOld,
|
||||
// });
|
||||
// }
|
||||
// updated.Status = "CANCEL";
|
||||
var retirementResignCancel = new RetirementResignCancel
|
||||
{
|
||||
Location = updated.Location,
|
||||
SendDate = updated.SendDate,
|
||||
ActiveDate = updated.ActiveDate,
|
||||
Reason = updated.Reason,
|
||||
OrganizationPositionOld = updated.OrganizationPositionOld,
|
||||
PositionTypeOld = updated.PositionTypeOld,
|
||||
PositionLevelOld = updated.PositionLevelOld,
|
||||
PositionNumberOld = updated.PositionNumberOld,
|
||||
AmountOld = updated.AmountOld,
|
||||
ApproveReason = updated.ApproveReason,
|
||||
RejectReason = updated.RejectReason,
|
||||
CancelReason = updated.CancelReason,
|
||||
IsActive = updated.IsActive,
|
||||
IsNoDebt = updated.IsNoDebt,
|
||||
IsNoBurden = updated.IsNoBurden,
|
||||
IsDiscipline = updated.IsDiscipline,
|
||||
OligarchReject = updated.OligarchReject,
|
||||
OligarchApproveReason = updated.OligarchApproveReason,
|
||||
OligarchRejectReason = updated.OligarchRejectReason,
|
||||
OligarchRejectDate = updated.OligarchRejectDate,
|
||||
CommanderReject = updated.CommanderReject,
|
||||
CommanderApproveReason = updated.CommanderApproveReason,
|
||||
CommanderRejectReason = updated.CommanderRejectReason,
|
||||
CommanderRejectDate = updated.CommanderRejectDate,
|
||||
OfficerReject = updated.OfficerReject,
|
||||
OfficerApproveReason = updated.OfficerApproveReason,
|
||||
OfficerRejectReason = updated.OfficerRejectReason,
|
||||
OfficerRejectDate = updated.OfficerRejectDate,
|
||||
RemarkHorizontal = updated.RemarkHorizontal,
|
||||
OrganizationOld = updated.OrganizationOld,
|
||||
PositionOld = updated.PositionOld,
|
||||
profileId = updated.profileId,
|
||||
prefix = updated.prefix,
|
||||
firstName = updated.firstName,
|
||||
lastName = updated.lastName,
|
||||
citizenId = updated.citizenId,
|
||||
rootOld = updated.rootOld,
|
||||
rootOldId = updated.rootOldId,
|
||||
rootShortNameOld = updated.rootShortNameOld,
|
||||
child1Old = updated.child1Old,
|
||||
child1OldId = updated.child1OldId,
|
||||
child1ShortNameOld = updated.child1ShortNameOld,
|
||||
child2Old = updated.child2Old,
|
||||
child2OldId = updated.child2OldId,
|
||||
child2ShortNameOld = updated.child2ShortNameOld,
|
||||
child3Old = updated.child3Old,
|
||||
child3OldId = updated.child3OldId,
|
||||
child3ShortNameOld = updated.child3ShortNameOld,
|
||||
child4Old = updated.child4Old,
|
||||
child4OldId = updated.child4OldId,
|
||||
child4ShortNameOld = updated.child4ShortNameOld,
|
||||
posMasterNoOld = updated.posMasterNoOld,
|
||||
posTypeOldId = updated.posTypeOldId,
|
||||
posTypeNameOld = updated.posTypeNameOld,
|
||||
posLevelOldId = updated.posLevelOldId,
|
||||
posLevelNameOld = updated.posLevelNameOld,
|
||||
RetirementResign = updated,
|
||||
Status = "PENDING",
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
await _context.SaveChangesAsync();
|
||||
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($"{_configuration["API"]}/org/workflow/add-workflow", new
|
||||
{
|
||||
refId = retirementResignCancel.Id,
|
||||
sysName = "RETIREMENT_CANCEL",
|
||||
posLevelName = retirementResignCancel.PositionLevelOld,
|
||||
posTypeName = retirementResignCancel.PositionTypeOld,
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
updated.Status = "CANCEL";
|
||||
}
|
||||
if (updated.OfficerReject != null)
|
||||
{
|
||||
await _repositoryNoti.PushNotificationAsync(
|
||||
Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"),
|
||||
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
"",
|
||||
"",
|
||||
true
|
||||
);
|
||||
}
|
||||
if (updated.CommanderReject != null)
|
||||
{
|
||||
await _repositoryNoti.PushNotificationAsync(
|
||||
Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"),
|
||||
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
"",
|
||||
"",
|
||||
true
|
||||
);
|
||||
}
|
||||
if (updated.OligarchReject != null)
|
||||
{
|
||||
await _repositoryNoti.PushNotificationAsync(
|
||||
Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"),
|
||||
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
"",
|
||||
"",
|
||||
true
|
||||
);
|
||||
}
|
||||
updated.CancelReason = req.Reason;
|
||||
// else
|
||||
// {
|
||||
updated.Status = "CANCEL";
|
||||
// }
|
||||
// if (updated.OfficerReject != null)
|
||||
// {
|
||||
// await _repositoryNoti.PushNotificationAsync(
|
||||
// Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"),
|
||||
// $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
// $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
// "",
|
||||
// "",
|
||||
// true
|
||||
// );
|
||||
// }
|
||||
// if (updated.CommanderReject != null)
|
||||
// {
|
||||
// await _repositoryNoti.PushNotificationAsync(
|
||||
// Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"),
|
||||
// $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
// $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
// "",
|
||||
// "",
|
||||
// true
|
||||
// );
|
||||
// }
|
||||
// if (updated.OligarchReject != null)
|
||||
// {
|
||||
// await _repositoryNoti.PushNotificationAsync(
|
||||
// Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"),
|
||||
// $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
// $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
|
||||
// "",
|
||||
// "",
|
||||
// true
|
||||
// );
|
||||
// }
|
||||
updated.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
updated.LastUpdateUserId = UserId ?? "";
|
||||
updated.LastUpdatedAt = DateTime.Now;
|
||||
|
|
@ -1764,7 +2059,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
{
|
||||
result.Add(r);
|
||||
string? _null = null;
|
||||
result.Add(new {
|
||||
result.Add(new
|
||||
{
|
||||
No = _null,
|
||||
FullName = r.RemarkHorizontal,
|
||||
CitizenId = _null,
|
||||
|
|
@ -1823,7 +2119,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
isLeave = true,
|
||||
leaveReason = "ลาออกจากราชการ",
|
||||
leaveReason = "ออกจากราชการ",
|
||||
dateLeave = r.commandAffectDate,
|
||||
}).ToList();
|
||||
|
||||
|
|
@ -1954,7 +2250,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
[HttpPost("leave-cancel/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportLeaveCancel([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.RetirementResigns
|
||||
var placementProfiles = await _context.RetirementResignCancels
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "REPORT");
|
||||
|
|
@ -1973,11 +2269,11 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
[HttpPost("leave-cancel/report/delete")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportDeleteLeaveCancel([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.RetirementResigns
|
||||
var placementProfiles = await _context.RetirementResignCancels
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.Status.ToUpper() == "REPORT")
|
||||
.ToListAsync();
|
||||
placementProfiles.ForEach(profile => profile.Status = "DONECANCEL");
|
||||
placementProfiles.ForEach(profile => profile.Status = "PENDING");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1999,7 +2295,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
{
|
||||
try
|
||||
{
|
||||
var report_data = (from p in _context.RetirementResigns
|
||||
var report_data = (from p in _context.RetirementResignCancels
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
|
|
@ -2028,7 +2324,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
{
|
||||
result.Add(r);
|
||||
string? _null = null;
|
||||
result.Add(new {
|
||||
result.Add(new
|
||||
{
|
||||
No = _null,
|
||||
FullName = r.RemarkHorizontal,
|
||||
CitizenId = _null,
|
||||
|
|
@ -2063,9 +2360,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
[HttpPost("leave-cancel/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteLeaveCancel([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = await _context.RetirementResigns
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var data = await _context.RetirementResignCancels
|
||||
.Include(x => x.RetirementResign)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
string? _null = null;
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
|
|
@ -2105,7 +2403,11 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.Status = "DONEREJECT");
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
// var _data = await _context.RetirementResigns
|
||||
// .Where(x => data.Select(x => x.RetirementResign.Id).Contains(x.Id))
|
||||
// .ToListAsync();
|
||||
// _data.ForEach(profile => profile.Status = "DONEREJECT");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue