Merge branch 'develop' into adiDev
Some checks failed
release-dev / release-dev (push) Failing after 11s

This commit is contained in:
AdisakKanthawilang 2025-02-11 20:22:47 +07:00
commit 719bf7c44f
6 changed files with 3815 additions and 2 deletions

View file

@ -17,6 +17,7 @@ using System.Net.Http.Headers;
using System.Security.Claims; using System.Security.Claims;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System.Data;
namespace BMA.EHR.DisciplineResult.Service.Controllers namespace BMA.EHR.DisciplineResult.Service.Controllers
{ {
@ -849,6 +850,33 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
if (_res.IsSuccessStatusCode) if (_res.IsSuccessStatusCode)
{ {
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; }); data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
var _profile = new List<ProfileComplaintInvestigate>();
DateTime _date = DateTime.Now;
foreach (var item in data)
{
_profile.Add(new ProfileComplaintInvestigate
{
PersonId = item.PersonId,
Prefix = item.Prefix,
FirstName = item.FirstName,
LastName = item.LastName,
CitizenId = item.CitizenId,
rootDnaId = item.rootDnaId,
child1DnaId = item.child1DnaId,
child2DnaId = item.child2DnaId,
child3DnaId = item.child3DnaId,
child4DnaId = item.child4DnaId,
profileType = item.profileType,
commandType = "C-PM-19",
CreatedAt = _date,
CreatedUserId = UserId,
CreatedFullName = FullName,
LastUpdatedAt = _date,
LastUpdateUserId = UserId,
LastUpdateFullName = FullName,
});
}
_context.ProfileComplaintInvestigate.AddRange(_profile);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
} }
} }
@ -950,6 +978,33 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
if (_res.IsSuccessStatusCode) if (_res.IsSuccessStatusCode)
{ {
data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; }); data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; });
var _profile = new List<ProfileComplaintInvestigate>();
DateTime _date = DateTime.Now;
foreach (var item in data)
{
_profile.Add(new ProfileComplaintInvestigate
{
PersonId = item.PersonId,
Prefix = item.Prefix,
FirstName = item.FirstName,
LastName = item.LastName,
CitizenId = item.CitizenId,
rootDnaId = item.rootDnaId,
child1DnaId = item.child1DnaId,
child2DnaId = item.child2DnaId,
child3DnaId = item.child3DnaId,
child4DnaId = item.child4DnaId,
profileType = item.profileType,
commandType = "C-PM-20",
CreatedAt = _date,
CreatedUserId = UserId,
CreatedFullName = FullName,
LastUpdatedAt = _date,
LastUpdateUserId = UserId,
LastUpdateFullName = FullName,
});
}
_context.ProfileComplaintInvestigate.AddRange(_profile);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
} }
} }

View file

@ -0,0 +1,68 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class updatetableProfileComplaintInvestigate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ProfileComplaintInvestigate",
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"),
PersonId = table.Column<string>(type: "longtext", nullable: true, comment: "id อ้างอิง profile")
.Annotation("MySql:CharSet", "utf8mb4"),
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
Prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
.Annotation("MySql:CharSet", "utf8mb4"),
FirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
LastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
rootDnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน rootDna")
.Annotation("MySql:CharSet", "utf8mb4"),
child1DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child1Dna")
.Annotation("MySql:CharSet", "utf8mb4"),
child2DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child2Dna")
.Annotation("MySql:CharSet", "utf8mb4"),
child3DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child3Dna")
.Annotation("MySql:CharSet", "utf8mb4"),
child4DnaId = table.Column<string>(type: "longtext", nullable: true, comment: "id หน่วยงาน child4Dna")
.Annotation("MySql:CharSet", "utf8mb4"),
commandType = table.Column<string>(type: "longtext", nullable: true, comment: "ประเภทคำสั่งลงโทษทางวินัย (C-PM-19->คำสั่งลงโทษปลดออกจากราชการ C-PM-20->คำสั่งลงโทษไล่ออกจากราชการ)")
.Annotation("MySql:CharSet", "utf8mb4"),
profileType = table.Column<string>(type: "longtext", nullable: true, comment: "สถานภาพ (OFFICER->ข้าราชการ EMPLOYEE->ลูกจ้างประจำ)")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ProfileComplaintInvestigate", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProfileComplaintInvestigate");
}
}
}

View file

@ -2993,6 +2993,111 @@ namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
b.ToTable("Documents"); b.ToTable("Documents");
}); });
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.ProfileComplaintInvestigate", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)")
.HasColumnOrder(0)
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<string>("CitizenId")
.HasMaxLength(13)
.HasColumnType("varchar(13)")
.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<string>("FirstName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasComment("ชื่อ");
b.Property<string>("LastName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.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>("PersonId")
.HasColumnType("longtext")
.HasComment("id อ้างอิง profile");
b.Property<string>("Prefix")
.HasColumnType("longtext")
.HasComment("คำนำหน้า");
b.Property<string>("child1DnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child1Dna");
b.Property<string>("child2DnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child2Dna");
b.Property<string>("child3DnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child3Dna");
b.Property<string>("child4DnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child4Dna");
b.Property<string>("commandType")
.HasColumnType("longtext")
.HasComment("ประเภทคำสั่งลงโทษทางวินัย (C-PM-19->คำสั่งลงโทษปลดออกจากราชการ C-PM-20->คำสั่งลงโทษไล่ออกจากราชการ)");
b.Property<string>("profileType")
.HasColumnType("longtext")
.HasComment("สถานภาพ (OFFICER->ข้าราชการ EMPLOYEE->ลูกจ้างประจำ)");
b.Property<string>("rootDnaId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน rootDna");
b.HasKey("Id");
b.ToTable("ProfileComplaintInvestigate");
});
modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b => modelBuilder.Entity("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal_Doc", b =>
{ {
b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal") b.HasOne("BMA.EHR.Domain.Models.Discipline.DisciplineComplaint_Appeal", "DisciplineComplaint_Appeal")

View file

@ -2400,21 +2400,29 @@ namespace BMA.EHR.Insignia.Service.Controllers
[HttpPut("upload/{requestId:length(36)}"), DisableRequestSizeLimit] [HttpPut("upload/{requestId:length(36)}"), DisableRequestSizeLimit]
public async Task<ActionResult<ResponseObject>> UpdatePersonDeferment([FromForm] ImportFileRequest req, Guid requestId) public async Task<ActionResult<ResponseObject>> UpdatePersonDeferment([FromForm] ImportFileRequest req, Guid requestId)
{ {
var insigniaRequest = await _context.InsigniaRequests.AsNoTracking().Include(x => x.Document).Where(x => x.Id == requestId).FirstOrDefaultAsync(); var insigniaRequest = await _context.InsigniaRequests
//.AsNoTracking()
.Include(x => x.Document).Where(x => x.Id == requestId).FirstOrDefaultAsync();
if (insigniaRequest == null) if (insigniaRequest == null)
return Error(GlobalMessages.InsigniaRequestNotFound, 404); return Error(GlobalMessages.InsigniaRequestNotFound, 404);
if (Request.Form.Files != null && Request.Form.Files.Count != 0) if (Request.Form.Files != null && Request.Form.Files.Count != 0)
{ {
var oldDocId = "";
if (insigniaRequest.Document != null) if (insigniaRequest.Document != null)
{ {
await _documentService.DeleteFileAsync(insigniaRequest.Document.Id); oldDocId = insigniaRequest.Document.Id.ToString("D");
//await _documentService.DeleteFileAsync(insigniaRequest.Document.Id);
} }
var file = Request.Form.Files[0]; var file = Request.Form.Files[0];
var fileExtension = Path.GetExtension(file.FileName); var fileExtension = Path.GetExtension(file.FileName);
var doc = await _documentService.UploadFileAsync(file, file.FileName); var doc = await _documentService.UploadFileAsync(file, file.FileName);
insigniaRequest.Document = doc; insigniaRequest.Document = doc;
//if(oldDocId != "")
// await _documentService.DeleteFileAsync(Guid.Parse(oldDocId));
} }
insigniaRequest.LastUpdateFullName = FullName ?? "System Administrator"; insigniaRequest.LastUpdateFullName = FullName ?? "System Administrator";
insigniaRequest.LastUpdateUserId = UserId ?? ""; insigniaRequest.LastUpdateUserId = UserId ?? "";

View file

@ -476,6 +476,7 @@ namespace BMA.EHR.Placement.Service.Controllers
placementAppointment.EducationOld = org.result.education; placementAppointment.EducationOld = org.result.education;
// placementAppointment.EducationOld = profile.Educations.Count() == 0 ? null : $"{profile.Educations.OrderByDescending(x => x.FinishDate).FirstOrDefault().Degree}-{profile.Educations.OrderByDescending(x => x.FinishDate).FirstOrDefault().Field}"; // placementAppointment.EducationOld = profile.Educations.Count() == 0 ? null : $"{profile.Educations.OrderByDescending(x => x.FinishDate).FirstOrDefault().Degree}-{profile.Educations.OrderByDescending(x => x.FinishDate).FirstOrDefault().Field}";
// placementAppointment.AmountOld = profile.Salaries.Count() == 0 ? null : profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount; // placementAppointment.AmountOld = profile.Salaries.Count() == 0 ? null : profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount;
placementAppointment.AmountOld = org.result.salary;
placementAppointment.positionOld = org.result.position; placementAppointment.positionOld = org.result.position;
placementAppointment.PositionLevelOld = org.result.posLevelName; placementAppointment.PositionLevelOld = org.result.posLevelName;