ออกคำสั่ง 27

This commit is contained in:
Kittapath 2024-06-17 15:02:54 +07:00
parent 6c09c68c5c
commit a89b8e0453
7 changed files with 18120 additions and 27 deletions

View file

@ -1029,39 +1029,39 @@ namespace BMA.EHR.Application.Repositories.Commands
}
var report_data = (from r in raw_data
join p in _dbContext.Set<OrganizationEmployeeProfile>()
.Include(x => x.Profile)
.ThenInclude(x => x.Position)
.Include(x => x.Profile)
.ThenInclude(x => x.PositionLevel)
.Include(x => x.Profile)
.ThenInclude(x => x.PositionType)
.Include(x => x.Profile)
.ThenInclude(x => x.PosNo)
.Include(x => x.OrgEmployee)
.ThenInclude(x => x.OrganizationAgency)
.ThenInclude(x => x.OrganizationOrganization)
//.Include(x => x.OrgEmployee)
//.ThenInclude(x => x.PosNo)
.Include(x => x.OrgEmployee)
.ThenInclude(x => x.PositionEmployeePosition)
.Include(x => x.OrgEmployee)
.ThenInclude(x => x.OrganizationPositionEmployeeLevels)
.ThenInclude(x => x.PositionEmployeeLevel)
on r.RefPlacementProfileId equals p.Id
// join p in _dbContext.Set<OrganizationEmployeeProfile>()
// .Include(x => x.Profile)
// .ThenInclude(x => x.Position)
// .Include(x => x.Profile)
// .ThenInclude(x => x.PositionLevel)
// .Include(x => x.Profile)
// .ThenInclude(x => x.PositionType)
// .Include(x => x.Profile)
// .ThenInclude(x => x.PosNo)
// .Include(x => x.OrgEmployee)
// .ThenInclude(x => x.OrganizationAgency)
// .ThenInclude(x => x.OrganizationOrganization)
// //.Include(x => x.OrgEmployee)
// //.ThenInclude(x => x.PosNo)
// .Include(x => x.OrgEmployee)
// .ThenInclude(x => x.PositionEmployeePosition)
// .Include(x => x.OrgEmployee)
// .ThenInclude(x => x.OrganizationPositionEmployeeLevels)
// .ThenInclude(x => x.PositionEmployeeLevel)
// on r.RefPlacementProfileId equals p.Id
orderby r.Sequence
select new CommandType21Response
{
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Organization = p.OrgEmployee == null || p.OrgEmployee!.OrganizationAgency == null || p.OrgEmployee!.OrganizationAgency!.OrganizationOrganization == null ? "" : p.OrgEmployee!.OrganizationAgency!.OrganizationOrganization!.Name,
PositionName = p.OrgEmployee == null || p.OrgEmployee.PositionEmployeePosition == null ? "" : p.OrgEmployee.PositionEmployeePosition.Name.ToThaiNumber(),
PositionLevel = p.OrgEmployee == null || p.OrgEmployee.OrganizationPositionEmployeeLevels == null ? "" : p.OrgEmployee.OrganizationPositionEmployeeLevels.First().PositionEmployeeLevel.Name.ToThaiNumber(),
PositionType = p.Profile.PositionType == null ? "" : p.Profile.PositionType.Name.ToThaiNumber(),
PositionNumber = p.OrgEmployee.PosNo == null ? "" : p.OrgEmployee.PosNo.ToThaiNumber(),
Organization = r.Organization == null ? "" : r.Organization.ToThaiNumber(),
PositionName = r.PositionName == null ? "" : r.PositionName.ToThaiNumber(),
PositionLevel = r.PositionLevel == null ? "" : r.PositionLevel.ToThaiNumber(),
PositionType = r.PositionType == null ? "" : r.PositionType.ToThaiNumber(),
PositionNumber = r.PositionNumber == null ? "" : r.PositionNumber.ToThaiNumber(),
Salary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
RetireDate = p.Profile.BirthDate.CalculateRetireDate().ToThaiFullDate3().ToThaiNumber(),
RetireDate = r.BirthDate == null ? "" : r.BirthDate.Value.CalculateRetireDate().ToThaiFullDate3().ToThaiNumber(),
CommandYear = r.Command.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber()
})
.ToList();

View file

@ -1596,8 +1596,14 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = d.prefix == null ? "" : d.prefix,
FirstName = d.firstName,
LastName = d.lastName,
RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
RefPlacementProfileId = d.id,
RefDisciplineId = d.id,
Organization = d.Organization,
PositionName = d.PositionName,
PositionLevel = d.PositionLevel,
PositionType = d.PositionType,
PositionNumber = d.PositionNumber,
BirthDate = d.BirthDate,
};
seq++;

View file

@ -16,5 +16,13 @@
public string lastName { get; set; } = string.Empty;
public string? profileId { get; set; } = string.Empty;
// public Guid? commandId { get; set; } = Guid.Empty;
public DateTime? BirthDate { get; set; }
public string? Organization { get; set; }
public string? PositionName { get; set; }
public string? PositionLevel { get; set; }
public string? PositionType { get; set; }
public string? PositionNumber { get; set; }
}
}

View file

@ -47,5 +47,19 @@ namespace BMA.EHR.Domain.Models.Commands.Core
[Comment("เงินค่าตอบแทนรายเดือน")]
public double? MouthSalaryAmount { get; set; }
[MaxLength(40), Comment("วันเกิด")]
public DateTime? BirthDate { get; set; }
[Comment("ชื่อหน่วยงาน root")]
public string? Organization { get; set; }
[Comment("ตำแหน่ง")]
public string? PositionName { get; set; }
[Comment("ระดับ")]
public string? PositionLevel { get; set; }
[Comment("ประเภท")]
public string? PositionType { get; set; }
[Comment("เลขที่ตำแหน่ง")]
public string? PositionNumber { get; set; }
}
}

View file

@ -0,0 +1,91 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableCommandReceiveraddPosition : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "BirthDate",
table: "CommandReceivers",
type: "datetime(6)",
maxLength: 40,
nullable: true,
comment: "วันเกิด");
migrationBuilder.AddColumn<string>(
name: "Organization",
table: "CommandReceivers",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionLevel",
table: "CommandReceivers",
type: "longtext",
nullable: true,
comment: "ระดับ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionName",
table: "CommandReceivers",
type: "longtext",
nullable: true,
comment: "ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionNumber",
table: "CommandReceivers",
type: "longtext",
nullable: true,
comment: "เลขที่ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionType",
table: "CommandReceivers",
type: "longtext",
nullable: true,
comment: "ประเภท")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "BirthDate",
table: "CommandReceivers");
migrationBuilder.DropColumn(
name: "Organization",
table: "CommandReceivers");
migrationBuilder.DropColumn(
name: "PositionLevel",
table: "CommandReceivers");
migrationBuilder.DropColumn(
name: "PositionName",
table: "CommandReceivers");
migrationBuilder.DropColumn(
name: "PositionNumber",
table: "CommandReceivers");
migrationBuilder.DropColumn(
name: "PositionType",
table: "CommandReceivers");
}
}
}

View file

@ -508,6 +508,11 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("double")
.HasComment("เงินเดือน");
b.Property<DateTime?>("BirthDate")
.HasMaxLength(40)
.HasColumnType("datetime(6)")
.HasComment("วันเกิด");
b.Property<string>("CitizenId")
.IsRequired()
.HasMaxLength(13)
@ -582,10 +587,30 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("double")
.HasComment("เงินค่าตอบแทนรายเดือน");
b.Property<string>("Organization")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน root");
b.Property<string>("PositionLevel")
.HasColumnType("longtext")
.HasComment("ระดับ");
b.Property<string>("PositionName")
.HasColumnType("longtext")
.HasComment("ตำแหน่ง");
b.Property<string>("PositionNumber")
.HasColumnType("longtext")
.HasComment("เลขที่ตำแหน่ง");
b.Property<double?>("PositionSalaryAmount")
.HasColumnType("double")
.HasComment("เงินประจำตำแหน่ง");
b.Property<string>("PositionType")
.HasColumnType("longtext")
.HasComment("ประเภท");
b.Property<string>("Prefix")
.IsRequired()
.HasMaxLength(50)