add command placement
This commit is contained in:
parent
752b1a5479
commit
3aa94c7b34
5 changed files with 19389 additions and 2 deletions
|
|
@ -382,6 +382,18 @@ namespace BMA.EHR.Domain.Models.Placement
|
|||
[Comment("ชื่อระดับตำแหน่ง")]
|
||||
public string? posLevelNameOld { get; set; }
|
||||
|
||||
[MaxLength(200), Comment("โทรศัพท์มือถือ")]
|
||||
public string? commandId { get; set; }
|
||||
[MaxLength(200), Comment("โทรศัพท์มือถือ")]
|
||||
public string? refCommandCode { get; set; }
|
||||
[MaxLength(200), Comment("โทรศัพท์มือถือ")]
|
||||
public DateTime? refCommandDate { get; set; }
|
||||
[MaxLength(200), Comment("โทรศัพท์มือถือ")]
|
||||
public string? refCommandName { get; set; }
|
||||
[MaxLength(200), Comment("โทรศัพท์มือถือ")]
|
||||
public string? refCommandNo { get; set; }
|
||||
[MaxLength(200), Comment("โทรศัพท์มือถือ")]
|
||||
public string? templateDoc { get; set; }
|
||||
|
||||
[Comment("Id รูปโปรไฟล์")]
|
||||
public virtual Document? ProfileImg { get; set; }
|
||||
|
|
|
|||
19225
BMA.EHR.Infrastructure/Migrations/20250124100911_update table placementProfile add command.Designer.cs
generated
Normal file
19225
BMA.EHR.Infrastructure/Migrations/20250124100911_update table placementProfile add command.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,96 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableplacementProfileaddcommand : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "commandId",
|
||||
table: "PlacementProfiles",
|
||||
type: "varchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: true,
|
||||
comment: "โทรศัพท์มือถือ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "refCommandCode",
|
||||
table: "PlacementProfiles",
|
||||
type: "varchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: true,
|
||||
comment: "โทรศัพท์มือถือ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "refCommandDate",
|
||||
table: "PlacementProfiles",
|
||||
type: "datetime(6)",
|
||||
maxLength: 200,
|
||||
nullable: true,
|
||||
comment: "โทรศัพท์มือถือ");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "refCommandName",
|
||||
table: "PlacementProfiles",
|
||||
type: "varchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: true,
|
||||
comment: "โทรศัพท์มือถือ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "refCommandNo",
|
||||
table: "PlacementProfiles",
|
||||
type: "varchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: true,
|
||||
comment: "โทรศัพท์มือถือ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "templateDoc",
|
||||
table: "PlacementProfiles",
|
||||
type: "varchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: true,
|
||||
comment: "โทรศัพท์มือถือ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "commandId",
|
||||
table: "PlacementProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "refCommandCode",
|
||||
table: "PlacementProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "refCommandDate",
|
||||
table: "PlacementProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "refCommandName",
|
||||
table: "PlacementProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "refCommandNo",
|
||||
table: "PlacementProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "templateDoc",
|
||||
table: "PlacementProfiles");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -12657,6 +12657,11 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อย่อหน่วยงาน child4");
|
||||
|
||||
b.Property<string>("commandId")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasComment("โทรศัพท์มือถือ");
|
||||
|
||||
b.Property<int?>("node")
|
||||
.HasColumnType("int")
|
||||
.HasComment("ระดับโครงสร้าง");
|
||||
|
|
@ -12765,6 +12770,26 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("profileId");
|
||||
|
||||
b.Property<string>("refCommandCode")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasComment("โทรศัพท์มือถือ");
|
||||
|
||||
b.Property<DateTime?>("refCommandDate")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasComment("โทรศัพท์มือถือ");
|
||||
|
||||
b.Property<string>("refCommandName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasComment("โทรศัพท์มือถือ");
|
||||
|
||||
b.Property<string>("refCommandNo")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasComment("โทรศัพท์มือถือ");
|
||||
|
||||
b.Property<string>("root")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อหน่วยงาน root");
|
||||
|
|
@ -12789,6 +12814,11 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อย่อหน่วยงาน root");
|
||||
|
||||
b.Property<string>("templateDoc")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasComment("โทรศัพท์มือถือ");
|
||||
|
||||
b.Property<string>("typeCommand")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ประเภทคำสั่ง");
|
||||
|
|
|
|||
|
|
@ -1803,7 +1803,19 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
placementProfile.ForEach(profile => profile.PlacementStatus = "DONE");
|
||||
placementProfile.ForEach(profile =>
|
||||
{
|
||||
profile.PlacementStatus = "DONE";
|
||||
if (req.refIds.Length > 0)
|
||||
{
|
||||
profile.commandId = req.refIds[0].commandId;
|
||||
profile.refCommandCode = req.refIds[0].refCommandCode;
|
||||
profile.refCommandDate = req.refIds[0].commandAffectDate;
|
||||
profile.refCommandName = req.refIds[0].refCommandName;
|
||||
profile.refCommandNo = $"{req.refIds[0].commandNo}/{req.refIds[0].commandYear.ToThaiYear()}";
|
||||
profile.templateDoc = req.refIds[0].templateDoc;
|
||||
}
|
||||
});
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
|
@ -2110,7 +2122,19 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
placementProfile.ForEach(profile => profile.PlacementStatus = "DONE");
|
||||
placementProfile.ForEach(profile =>
|
||||
{
|
||||
profile.PlacementStatus = "DONE";
|
||||
if (req.refIds.Length > 0)
|
||||
{
|
||||
profile.commandId = req.refIds[0].commandId;
|
||||
profile.refCommandCode = req.refIds[0].refCommandCode;
|
||||
profile.refCommandDate = req.refIds[0].commandAffectDate;
|
||||
profile.refCommandName = req.refIds[0].refCommandName;
|
||||
profile.refCommandNo = $"{req.refIds[0].commandNo}/{req.refIds[0].commandYear.ToThaiYear()}";
|
||||
profile.templateDoc = req.refIds[0].templateDoc;
|
||||
}
|
||||
});
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue