แก้ กก

This commit is contained in:
kittapath 2024-10-31 12:54:13 +07:00
parent c724246081
commit a31447c278
5 changed files with 18536 additions and 53 deletions

View file

@ -207,14 +207,14 @@ namespace BMA.EHR.Domain.Models.Placement
[Comment("Id ด้าน/สาขา")]
public PositionPathSide? PositionPathSide { get; set; }
[Comment("Id ประเภทตำแหน่ง")]
public PositionType? PositionType { get; set; }
[Comment("ประเภทตำแหน่ง")]
public string? PositionType { get; set; }
[Comment("Id สายงาน")]
public PositionLine? PositionLine { get; set; }
[Comment("Id ระดับ")]
public PositionLevel? PositionLevel { get; set; }
[Comment("ระดับ")]
public string? PositionLevel { get; set; }
[Comment("คะแนนเต็มภาค ก")]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,105 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableplacementAddposition : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementProfiles_PositionLevels_PositionLevelId",
table: "PlacementProfiles");
migrationBuilder.DropForeignKey(
name: "FK_PlacementProfiles_PositionTypes_PositionTypeId",
table: "PlacementProfiles");
migrationBuilder.DropIndex(
name: "IX_PlacementProfiles_PositionLevelId",
table: "PlacementProfiles");
migrationBuilder.DropIndex(
name: "IX_PlacementProfiles_PositionTypeId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "PositionLevelId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "PositionTypeId",
table: "PlacementProfiles");
migrationBuilder.AddColumn<string>(
name: "PositionLevel",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ระดับ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionType",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PositionLevel",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "PositionType",
table: "PlacementProfiles");
migrationBuilder.AddColumn<Guid>(
name: "PositionLevelId",
table: "PlacementProfiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionTypeId",
table: "PlacementProfiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_PlacementProfiles_PositionLevelId",
table: "PlacementProfiles",
column: "PositionLevelId");
migrationBuilder.CreateIndex(
name: "IX_PlacementProfiles_PositionTypeId",
table: "PlacementProfiles",
column: "PositionTypeId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementProfiles_PositionLevels_PositionLevelId",
table: "PlacementProfiles",
column: "PositionLevelId",
principalTable: "PositionLevels",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementProfiles_PositionTypes_PositionTypeId",
table: "PlacementProfiles",
column: "PositionTypeId",
principalTable: "PositionTypes",
principalColumn: "Id");
}
}
}

View file

@ -12376,8 +12376,9 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Property<Guid?>("PositionCandidateId")
.HasColumnType("char(36)");
b.Property<Guid?>("PositionLevelId")
.HasColumnType("char(36)");
b.Property<string>("PositionLevel")
.HasColumnType("longtext")
.HasComment("ระดับ");
b.Property<Guid?>("PositionLineId")
.HasColumnType("char(36)");
@ -12395,8 +12396,9 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("double")
.HasComment("เงินประจำตำแหน่ง");
b.Property<Guid?>("PositionTypeId")
.HasColumnType("char(36)");
b.Property<string>("PositionType")
.HasColumnType("longtext")
.HasComment("ประเภทตำแหน่ง");
b.Property<string>("Prefix")
.HasColumnType("longtext")
@ -12723,8 +12725,6 @@ namespace BMA.EHR.Infrastructure.Migrations
b.HasIndex("PositionCandidateId");
b.HasIndex("PositionLevelId");
b.HasIndex("PositionLineId");
b.HasIndex("PositionNumberId");
@ -12733,8 +12733,6 @@ namespace BMA.EHR.Infrastructure.Migrations
b.HasIndex("PositionPathSideId");
b.HasIndex("PositionTypeId");
b.HasIndex("ProfileImgId");
b.HasIndex("ReliefDocId");
@ -17724,10 +17722,6 @@ namespace BMA.EHR.Infrastructure.Migrations
.WithMany()
.HasForeignKey("PositionCandidateId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLevel", "PositionLevel")
.WithMany()
.HasForeignKey("PositionLevelId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionLine", "PositionLine")
.WithMany()
.HasForeignKey("PositionLineId");
@ -17744,10 +17738,6 @@ namespace BMA.EHR.Infrastructure.Migrations
.WithMany()
.HasForeignKey("PositionPathSideId");
b.HasOne("BMA.EHR.Domain.Models.MetaData.PositionType", "PositionType")
.WithMany()
.HasForeignKey("PositionTypeId");
b.HasOne("BMA.EHR.Domain.Models.Documents.Document", "ProfileImg")
.WithMany()
.HasForeignKey("ProfileImgId");
@ -17762,8 +17752,6 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("PositionCandidate");
b.Navigation("PositionLevel");
b.Navigation("PositionLine");
b.Navigation("PositionNumber");
@ -17772,8 +17760,6 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Navigation("PositionPathSide");
b.Navigation("PositionType");
b.Navigation("ProfileImg");
b.Navigation("ReliefDoc");
@ -18082,7 +18068,7 @@ namespace BMA.EHR.Infrastructure.Migrations
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResignCancel", b =>
{
b.HasOne("BMA.EHR.Domain.Models.Retirement.RetirementResign", "RetirementResign")
.WithMany()
.WithMany("RetirementResignCancels")
.HasForeignKey("RetirementResignId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@ -18397,6 +18383,8 @@ namespace BMA.EHR.Infrastructure.Migrations
modelBuilder.Entity("BMA.EHR.Domain.Models.Retirement.RetirementResign", b =>
{
b.Navigation("RetirementResignCancels");
b.Navigation("RetirementResignDebtDocs");
b.Navigation("RetirementResignDocs");

View file

@ -211,16 +211,15 @@ namespace BMA.EHR.Placement.Service.Controllers
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,
posLevelCandidate = x.PositionLevel,
posTypeCandidate = x.PositionType,
positionCandidate = x.positionName,
}).OrderBy(x => x.ExamNumber).ToListAsync();
var result1 = new List<dynamic>();
@ -269,16 +268,15 @@ namespace BMA.EHR.Placement.Service.Controllers
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,
p.posLevelCandidate,
p.posTypeCandidate,
p.positionCandidate,
};
result1.Add(_data1);
}
@ -325,16 +323,15 @@ namespace BMA.EHR.Placement.Service.Controllers
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),
posLevelCandidate = x.PositionLevel,
posTypeCandidate = x.PositionType,
positionCandidate = x.positionName,
}).OrderBy(x => x.ExamNumber).ToListAsync();
var result = new List<dynamic>();
@ -383,16 +380,15 @@ namespace BMA.EHR.Placement.Service.Controllers
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,
p.posLevelCandidate,
p.posTypeCandidate,
p.positionCandidate,
};
result.Add(_data);
}
@ -438,8 +434,7 @@ namespace BMA.EHR.Placement.Service.Controllers
DateOfBirth = x.DateOfBirth,
Age = x.DateOfBirth == null ? null : x.DateOfBirth.Value.CalculateAgeStrV2(0, 0),
Telephone = x.Telephone,
PositionCandidate = x.PositionCandidate == null ? null : x.PositionCandidate.Name,
PositionCandidateId = x.PositionCandidate == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.PositionCandidate.Id,
positionCandidate = x.positionName,
Gender = x.Gender,
Relationship = x.Relationship,
BloodGroup = x.BloodGroup,
@ -550,7 +545,6 @@ namespace BMA.EHR.Placement.Service.Controllers
data.Age,
data.Telephone,
data.PositionCandidate,
data.PositionCandidateId,
data.Gender,
data.Relationship,
data.BloodGroup,
@ -1547,7 +1541,6 @@ namespace BMA.EHR.Placement.Service.Controllers
var report_data = (from p in _context.PlacementProfiles
.Include(x => x.Placement)
.Include(x => x.PlacementEducations)
.Include(x => x.PositionCandidate)
// .ThenInclude(x => x.PlacementType)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
// .Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
@ -1587,18 +1580,18 @@ namespace BMA.EHR.Placement.Service.Controllers
Salary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
OccupationPosition = p.OccupationPosition == null ? "-" : p.OccupationPosition, //ตำแหน่งเก่าก่อนสอบ
PositionCandidate = p.PositionCandidate == null ? "-" : p.PositionCandidate.Name, //ตำแหน่งที่สอบแข่งขัน
PositionCandidate = p.positionName, //ตำแหน่งที่สอบแข่งขัน
OcCandidate = p.root == null ? p.PositionCandidate == null ? "-" : $"{p.PositionCandidate}/-" :
p.node == 4
? p.PositionCandidate.Name == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.PositionCandidate.Name}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
? p.positionName == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 3
? p.PositionCandidate.Name == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.PositionCandidate.Name}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
? p.positionName == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child3}/{p.child2}/{p.child1}/{p.root}" :
p.node == 2
? p.PositionCandidate.Name == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.PositionCandidate.Name}/{p.child2}/{p.child1}/{p.root}" :
? p.positionName == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child2}/{p.child1}/{p.root}" :
p.node == 1
? p.PositionCandidate.Name == null ? $"{p.child1}/{p.root}" : $"{p.PositionCandidate.Name}/{p.child1}/{p.root}" :
? p.positionName == null ? $"{p.child1}/{p.root}" : $"{p.positionName}/{p.child1}/{p.root}" :
p.node == 0
? p.PositionCandidate.Name == null ? $"{p.root}" : $"{p.PositionCandidate.Name}/{p.root}" : "-",
? p.positionName == null ? $"{p.root}" : $"{p.positionName}/{p.root}" : "-",
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();
@ -1859,7 +1852,6 @@ namespace BMA.EHR.Placement.Service.Controllers
var report_data = (from p in _context.PlacementProfiles
.Include(x => x.Placement)
.Include(x => x.PlacementEducations)
.Include(x => x.PositionCandidate)
// .ThenInclude(x => x.PlacementType)
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
// .Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
@ -1898,7 +1890,7 @@ namespace BMA.EHR.Placement.Service.Controllers
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "-",
Salary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
PositionCandidate = p.PositionCandidate == null ? "-" : p.PositionCandidate.Name,
PositionCandidate = p.positionName,
RemarkHorizontal = r.RemarkHorizontal,
RemarkVertical = r.RemarkVertical,
}).ToList();