Merge branch 'develop' into working

This commit is contained in:
Suphonchai Phoonsawat 2024-07-01 13:25:25 +07:00
commit e060bd04ce
8 changed files with 18664 additions and 44 deletions

View file

@ -195,6 +195,7 @@ namespace BMA.EHR.Application.Repositories.Commands
var report_data = (from r in raw_data
join p in _dbContext.Set<PlacementProfile>()
.Include(x => x.PlacementEducations)
.Include(x => x.Placement)
.Include(x => x.OrganizationPosition)
.ThenInclude(x => x.Organization)
.Include(x => x.PositionPath)
@ -202,13 +203,6 @@ namespace BMA.EHR.Application.Repositories.Commands
.Include(x => x.PositionNumber)
.Include(x => x.PositionType)
on r.RefPlacementProfileId equals p.Id
join pf in _dbContext.Set<Profile>()
.Include(x => x.Position)
.Include(x => x.PositionLevel)
.Include(x => x.PositionType)
.Include(x => x.PosNo)
.Include(x => x.Salaries)
on r.CitizenId equals pf.CitizenId
orderby r.Sequence
select new CommandType03Response
{
@ -217,13 +211,20 @@ namespace BMA.EHR.Application.Repositories.Commands
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = pf.Oc == null ? "" : pf.Oc.Replace("/", " "),
Probation = pf.IsProbation ? "(อยู่ระหว่างปฏิบัติหน้าที่ราชการ)" : "",
OldPositionName = pf.Position == null ? "" : pf.Position.Name,
OldPositionLevel = pf.PositionLevel == null ? "" : pf.PositionLevel.Name,
OldPositionType = pf.PositionType == null ? "" : pf.PositionType.Name,
OldPositionNumber = pf.PosNo == null ? "" : pf.PosNo.Name.ToThaiNumber(),
OldSalary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldOc = p.rootOld == null ? "" : p.rootOld,
//Probation = pf.IsProbation ? "(อยู่ระหว่างปฏิบัติหน้าที่ราชการ)" : "",
Probation = "",
OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld,
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
OldPositionNumber = p.posMasterNoOld == null ? "" :
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "2" ? $"{ p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "1" ? $"{ p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "0" ? $"{ p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.positionName == null ? "" : p.positionName,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
@ -265,6 +266,7 @@ namespace BMA.EHR.Application.Repositories.Commands
var report_data = (from r in raw_data
join p in _dbContext.Set<PlacementProfile>()
.Include(x => x.PlacementEducations)
.Include(x => x.Placement)
.Include(x => x.OrganizationPosition)
.ThenInclude(x => x.Organization)
.Include(x => x.PositionPath)
@ -272,13 +274,6 @@ namespace BMA.EHR.Application.Repositories.Commands
.Include(x => x.PositionNumber)
.Include(x => x.PositionType)
on r.RefPlacementProfileId equals p.Id
join pf in _dbContext.Set<Profile>()
.Include(x => x.Position)
.Include(x => x.PositionLevel)
.Include(x => x.PositionType)
.Include(x => x.PosNo)
.Include(x => x.Salaries)
on r.CitizenId equals pf.CitizenId
orderby r.Sequence
select new CommandType03Response
{
@ -287,12 +282,17 @@ namespace BMA.EHR.Application.Repositories.Commands
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
OldOc = pf.Oc == null ? "" : pf.Oc.Replace("/", " "),
OldPositionName = pf.Position == null ? "" : pf.Position.Name,
OldPositionLevel = pf.PositionLevel == null ? "" : pf.PositionLevel.Name,
OldPositionType = pf.PositionType == null ? "" : pf.PositionType.Name,
OldPositionNumber = pf.PosNo == null ? "" : pf.PosNo.Name.ToThaiNumber(),
OldSalary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldOc = p.rootOld == null ? "" : p.rootOld,
OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld,
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
OldPositionNumber = p.posMasterNoOld == null ? "" :
p.nodeOld == "4" ? $"{ p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "3" ? $"{ p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "2" ? $"{ p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "1" ? $"{ p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
p.nodeOld == "0" ? $"{ p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.root == null ? "" : p.root,
NewPositionName = p.positionName == null ? "" : p.positionName,
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,

View file

@ -331,6 +331,67 @@ namespace BMA.EHR.Domain.Models.Placement
[Comment("ประเภทคำสั่ง")]
public string? typeCommand { get; set; }
[Comment("ข้อมูลเก่า")]
public bool? IsOld { get; set; }
[Comment("เงินเดือน")]
public double? AmountOld { get; set; }
[Comment("ระดับโครงสร้าง")]
public string? nodeOld { get; set; }
[Comment("id โครงสร้าง")]
public string? nodeIdOld { get; set; }
[Comment("id อัตรากำลัง")]
public string? posmasterIdOld { get; set; }
[Comment("ชื่อหน่วยงาน root")]
public string? rootOld { get; set; }
[Comment("id หน่วยงาน root")]
public string? rootIdOld { get; set; }
[Comment("ชื่อย่อหน่วยงาน root")]
public string? rootShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child1")]
public string? child1Old { get; set; }
[Comment("id หน่วยงาน child1")]
public string? child1IdOld { get; set; }
[Comment("ชื่อย่อหน่วยงาน child1")]
public string? child1ShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child2")]
public string? child2Old { get; set; }
[Comment("id หน่วยงาน child2")]
public string? child2IdOld { get; set; }
[Comment("ชื่อย่อหน่วยงาน child2")]
public string? child2ShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child3")]
public string? child3Old { get; set; }
[Comment("id หน่วยงาน child3")]
public string? child3IdOld { get; set; }
[Comment("ชื่อย่อหน่วยงาน child3")]
public string? child3ShortNameOld { get; set; }
[Comment("ชื่อหน่วยงาน child4")]
public string? child4Old { get; set; }
[Comment("id หน่วยงาน child4")]
public string? child4IdOld { get; set; }
[Comment("ชื่อย่อหน่วยงาน child4")]
public string? child4ShortNameOld { get; set; }
[Comment("id revision")]
public string? orgRevisionIdOld { get; set; }
[Comment("id ตำแหน่ง")]
public string? positionIdOld { get; set; }
[Comment("เลขที่ตำแหน่ง")]
public int? posMasterNoOld { get; set; }
[Comment("ชื่อตำแหน่งในสายงาน")]
public string? positionNameOld { get; set; }
[Comment("สายงาน")]
public string? positionFieldOld { get; set; }
[Comment("id ประเภทตำแหน่ง")]
public string? posTypeIdOld { get; set; }
[Comment("ชื่อประเภทตำแหน่ง")]
public string? posTypeNameOld { get; set; }
[Comment("id ระดับตำแหน่ง")]
public string? posLevelIdOld { get; set; }
[Comment("ชื่อระดับตำแหน่ง")]
public string? posLevelNameOld { get; set; }
[Comment("Id รูปโปรไฟล์")]
public virtual Document? ProfileImg { get; set; }

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,363 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableplacementaddoldroot : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<double>(
name: "AmountOld",
table: "PlacementProfiles",
type: "double",
nullable: true,
comment: "เงินเดือน");
migrationBuilder.AddColumn<bool>(
name: "IsOld",
table: "PlacementProfiles",
type: "tinyint(1)",
nullable: true,
comment: "ข้อมูลเก่า");
migrationBuilder.AddColumn<string>(
name: "child1IdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child1")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1Old",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child1")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1ShortNameOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child1")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2IdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child2")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2Old",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child2")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2ShortNameOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child2")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3IdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child3")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3Old",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child3")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3ShortNameOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child3")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4IdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child4")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4Old",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child4")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4ShortNameOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child4")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "nodeIdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id โครงสร้าง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "nodeOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ระดับโครงสร้าง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "orgRevisionIdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id revision")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posLevelIdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id ระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posLevelNameOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "posMasterNoOld",
table: "PlacementProfiles",
type: "int",
nullable: true,
comment: "เลขที่ตำแหน่ง");
migrationBuilder.AddColumn<string>(
name: "posTypeIdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id ประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posTypeNameOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "positionFieldOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "สายงาน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "positionIdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "positionNameOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อตำแหน่งในสายงาน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posmasterIdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id อัตรากำลัง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootIdOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootShortNameOld",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AmountOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "IsOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child1IdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child1Old",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child1ShortNameOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child2IdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child2Old",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child2ShortNameOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child3IdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child3Old",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child3ShortNameOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child4IdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child4Old",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child4ShortNameOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "nodeIdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "nodeOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "orgRevisionIdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posLevelIdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posLevelNameOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posMasterNoOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posTypeIdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posTypeNameOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "positionFieldOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "positionIdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "positionNameOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posmasterIdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "rootIdOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "rootOld",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "rootShortNameOld",
table: "PlacementProfiles");
}
}
}

View file

@ -11971,6 +11971,10 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("double")
.HasComment("เงินเดือน");
b.Property<double?>("AmountOld")
.HasColumnType("double")
.HasComment("เงินเดือน");
b.Property<string>("BloodGroup")
.HasColumnType("longtext")
.HasComment("Id กลุ่มเลือด");
@ -12090,6 +12094,10 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("tinyint(1)")
.HasComment("ข้าราชการฯ กทม.");
b.Property<bool?>("IsOld")
.HasColumnType("tinyint(1)")
.HasComment("ข้อมูลเก่า");
b.Property<string>("IsProperty")
.HasColumnType("longtext")
.HasComment("การคัดกรองคุณสมบัติ");
@ -12385,10 +12393,22 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child1");
b.Property<string>("child1IdOld")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child1");
b.Property<string>("child1Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child1");
b.Property<string>("child1ShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child1");
b.Property<string>("child1ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child1");
b.Property<string>("child2")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child2");
@ -12397,10 +12417,22 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child2");
b.Property<string>("child2IdOld")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child2");
b.Property<string>("child2Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child2");
b.Property<string>("child2ShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child2");
b.Property<string>("child2ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child2");
b.Property<string>("child3")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child3");
@ -12409,10 +12441,22 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child3");
b.Property<string>("child3IdOld")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child3");
b.Property<string>("child3Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child3");
b.Property<string>("child3ShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child3");
b.Property<string>("child3ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child3");
b.Property<string>("child4")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child4");
@ -12421,10 +12465,22 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child4");
b.Property<string>("child4IdOld")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child4");
b.Property<string>("child4Old")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child4");
b.Property<string>("child4ShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child4");
b.Property<string>("child4ShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child4");
b.Property<int?>("node")
.HasColumnType("int")
.HasComment("ระดับโครงสร้าง");
@ -12433,10 +12489,22 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("char(36)")
.HasComment("id โครงสร้าง");
b.Property<string>("nodeIdOld")
.HasColumnType("longtext")
.HasComment("id โครงสร้าง");
b.Property<string>("nodeOld")
.HasColumnType("longtext")
.HasComment("ระดับโครงสร้าง");
b.Property<string>("orgRevisionId")
.HasColumnType("longtext")
.HasComment("id revision");
b.Property<string>("orgRevisionIdOld")
.HasColumnType("longtext")
.HasComment("id revision");
b.Property<string>("orgTreeShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน");
@ -12449,38 +12517,74 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("id ระดับตำแหน่ง");
b.Property<string>("posLevelIdOld")
.HasColumnType("longtext")
.HasComment("id ระดับตำแหน่ง");
b.Property<string>("posLevelName")
.HasColumnType("longtext")
.HasComment("ชื่อระดับตำแหน่ง");
b.Property<string>("posLevelNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อระดับตำแหน่ง");
b.Property<int?>("posMasterNo")
.HasColumnType("int")
.HasComment("เลขที่ตำแหน่ง");
b.Property<int?>("posMasterNoOld")
.HasColumnType("int")
.HasComment("เลขที่ตำแหน่ง");
b.Property<string>("posTypeId")
.HasColumnType("longtext")
.HasComment("id ประเภทตำแหน่ง");
b.Property<string>("posTypeIdOld")
.HasColumnType("longtext")
.HasComment("id ประเภทตำแหน่ง");
b.Property<string>("posTypeName")
.HasColumnType("longtext")
.HasComment("ชื่อประเภทตำแหน่ง");
b.Property<string>("posTypeNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อประเภทตำแหน่ง");
b.Property<string>("positionField")
.HasColumnType("longtext")
.HasComment("สายงาน");
b.Property<string>("positionFieldOld")
.HasColumnType("longtext")
.HasComment("สายงาน");
b.Property<string>("positionId")
.HasColumnType("longtext")
.HasComment("id ตำแหน่ง");
b.Property<string>("positionIdOld")
.HasColumnType("longtext")
.HasComment("id ตำแหน่ง");
b.Property<string>("positionName")
.HasColumnType("longtext")
.HasComment("ชื่อตำแหน่งในสายงาน");
b.Property<string>("positionNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อตำแหน่งในสายงาน");
b.Property<string>("posmasterId")
.HasColumnType("longtext")
.HasComment("id อัตรากำลัง");
b.Property<string>("posmasterIdOld")
.HasColumnType("longtext")
.HasComment("id อัตรากำลัง");
b.Property<string>("profileId")
.HasColumnType("longtext")
.HasComment("profileId");
@ -12493,10 +12597,22 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("id หน่วยงาน root");
b.Property<string>("rootIdOld")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน root");
b.Property<string>("rootOld")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน root");
b.Property<string>("rootShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน root");
b.Property<string>("rootShortNameOld")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน root");
b.Property<string>("typeCommand")
.HasColumnType("longtext")
.HasComment("ประเภทคำสั่ง");

View file

@ -62,9 +62,9 @@ namespace BMA.EHR.Placement.Service.Controllers
[HttpPost()]
public async Task<ActionResult<ResponseObject>> UpdatePropertyByUser([FromBody] NotiRequest req)
{
var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.Id == req.ReceiverUserId);
if (profile == null)
return Error(GlobalMessages.DataNotFound);
// var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.Id == req.ReceiverUserId);
// if (profile == null)
// return Error(GlobalMessages.DataNotFound);
await _repositoryNoti.PushNotificationAsync(
req.ReceiverUserId,
@ -116,18 +116,32 @@ namespace BMA.EHR.Placement.Service.Controllers
var inbox = await _context.Inboxes.FirstOrDefaultAsync(x => x.Id == id);
if (inbox == null)
return Error(GlobalMessages.DataNotFound);
var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.KeycloakId == Guid.Parse(inbox.CreatedUserId));
if (profile == null)
return Error(GlobalMessages.DataNotFound);
await _repositoryNoti.PushNotificationAsync(
profile.Id,
req.Subject,
req.Body,
req.Payload,
req.IsSendInbox,
req.IsSendMail
);
var apiUrl = $"{_configuration["API"]}org/profile/keycloak/position/{inbox.CreatedUserId}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
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)
{
await _repositoryNoti.PushNotificationAsync(
Guid.Parse(org.result.id),
req.Subject,
req.Body,
req.Payload,
req.IsSendInbox,
req.IsSendMail
);
}
return Success();
}
// var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.KeycloakId == Guid.Parse(inbox.CreatedUserId));
// if (profile == null)
// return Error(GlobalMessages.DataNotFound);
return Success();
}
@ -135,9 +149,9 @@ namespace BMA.EHR.Placement.Service.Controllers
[HttpPost("cronjob")]
public async Task<ActionResult<ResponseObject>> CornjobProbation([FromBody] NotiCronjobProbationRequest req)
{
var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.Id == req.ReceiverUserId);
if (profile == null)
return Error(GlobalMessages.DataNotFound);
// var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.Id == req.ReceiverUserId);
// if (profile == null)
// return Error(GlobalMessages.DataNotFound);
_context.CronjobNotiProbations.Add(new CronjobNotiProbation
{

View file

@ -784,6 +784,55 @@ namespace BMA.EHR.Placement.Service.Controllers
person.posLevelId = req.posLevelId;
person.posLevelName = req.posLevelName;
apiUrl = $"{_configuration["API"]}org/profile/profileid/position/{person.profileId}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
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)
{
person.IsOld = false;
}
else
{
// person.AmountOld = org.result.xxxxxxxx;
person.nodeOld = org.result.node;
person.nodeIdOld = org.result.nodeId;
// person.posmasterIdOld = org.result.xxxxxxxx;
person.rootOld = org.result.root;
person.rootIdOld = org.result.rootId;
person.rootShortNameOld = org.result.rootShortName;
person.child1Old = org.result.child1;
person.child1IdOld = org.result.child1Id;
person.child1ShortNameOld = org.result.child1ShortName;
person.child2Old = org.result.child2;
person.child2IdOld = org.result.child2Id;
person.child2ShortNameOld = org.result.child2ShortName;
person.child3Old = org.result.child3;
person.child3IdOld = org.result.child3Id;
person.child3ShortNameOld = org.result.child3ShortName;
person.child4Old = org.result.child4;
person.child4IdOld = org.result.child4Id;
person.child4ShortNameOld = org.result.child4ShortName;
// person.orgRevisionIdOld = org.result.xxxxxxx;
// person.positionIdOld = org.result.xxxxxxx;
person.posMasterNoOld = org.result.posMasterNo;
person.positionNameOld = org.result.position;
// person.positionFieldOld = org.result.xxxxxxx;
person.posTypeIdOld = org.result.posTypeId;
person.posTypeNameOld = org.result.posTypeName;
person.posLevelIdOld = org.result.posLevelId;
person.posLevelNameOld = org.result.posLevelName;
}
}
person.PlacementStatus = "PREPARE-CONTAIN";
person.LastUpdateFullName = FullName ?? "System Administrator";
person.LastUpdateUserId = UserId ?? "";

View file

@ -9,6 +9,7 @@ namespace BMA.EHR.Placement.Service.Requests
}
public class OrgRequestData
{
public string? id { get; set; }
public string? profileId { get; set; }
public string? prefix { get; set; }
public string? firstName { get; set; }