placement ผูกโครงสร้างใหม่

This commit is contained in:
Kittapath 2024-04-30 00:10:07 +07:00
parent 0afe06fac0
commit dc91f81262
11 changed files with 35152 additions and 86 deletions

View file

@ -17,7 +17,7 @@ env:
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
jobs:
# act workflow_dispatch -W .github/workflows/release_placement.yaml --input IMAGE_VER=placement-1.0.0 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
# act workflow_dispatch -W .github/workflows/release_placement.yaml --input IMAGE_VER=latest -s DOCKER_USER=admin -s DOCKER_PASS=FPTadmin2357 -s SSH_PASSWORD=FPTadmin2357
release-dev:
runs-on: ubuntu-latest
steps:
@ -68,21 +68,21 @@ jobs:
docker compose pull
docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
- uses: snow-actions/line-notify@v1.1.0
if: success()
with:
access_token: ${{ env.TOKEN_LINE }}
message: |
-Success✅✅✅
Image: ${{env.IMAGE_NAME}}
Version: ${{ github.event.inputs.IMAGE_VER }}
By: ${{secrets.DOCKER_USER}}
- uses: snow-actions/line-notify@v1.1.0
if: failure()
with:
access_token: ${{ env.TOKEN_LINE }}
message: |
-Failure❌❌❌
Image: ${{env.IMAGE_NAME}}
Version: ${{ github.event.inputs.IMAGE_VER }}
By: ${{secrets.DOCKER_USER}}
# - uses: snow-actions/line-notify@v1.1.0
# if: success()
# with:
# access_token: ${{ env.TOKEN_LINE }}
# message: |
# -Success✅✅✅
# Image: ${{env.IMAGE_NAME}}
# Version: ${{ github.event.inputs.IMAGE_VER }}
# By: ${{secrets.DOCKER_USER}}
# - uses: snow-actions/line-notify@v1.1.0
# if: failure()
# with:
# access_token: ${{ env.TOKEN_LINE }}
# message: |
# -Failure❌❌❌
# Image: ${{env.IMAGE_NAME}}
# Version: ${{ github.event.inputs.IMAGE_VER }}
# By: ${{secrets.DOCKER_USER}}

View file

@ -257,8 +257,8 @@ namespace BMA.EHR.Domain.Models.Placement
[Comment("id อัตรากำลัง")]
public Guid? posmasterId { get; set; }
[Comment("id ตำแหน่ง")]
public Guid? positionId { get; set; }
// [Comment("id ตำแหน่ง")]
// public Guid? positionId { get; set; }
[Comment("ชื่อหน่วยงาน")]
public string? organizationName { get; set; }
@ -273,6 +273,56 @@ namespace BMA.EHR.Domain.Models.Placement
public string? PosPath { get; set; }
[Comment("ชื่อหน่วยงาน root")]
public string? root { get; set; }
[Comment("id หน่วยงาน root")]
public string? rootId { get; set; }
[Comment("ชื่อย่อหน่วยงาน root")]
public string? rootShortName { get; set; }
[Comment("ชื่อหน่วยงาน child1")]
public string? child1 { get; set; }
[Comment("id หน่วยงาน child1")]
public string? child1Id { get; set; }
[Comment("ชื่อย่อหน่วยงาน child1")]
public string? child1ShortName { get; set; }
[Comment("ชื่อหน่วยงาน child2")]
public string? child2 { get; set; }
[Comment("id หน่วยงาน child2")]
public string? child2Id { get; set; }
[Comment("ชื่อย่อหน่วยงาน child2")]
public string? child2ShortName { get; set; }
[Comment("ชื่อหน่วยงาน child3")]
public string? child3 { get; set; }
[Comment("id หน่วยงาน child3")]
public string? child3Id { get; set; }
[Comment("ชื่อย่อหน่วยงาน child3")]
public string? child3ShortName { get; set; }
[Comment("ชื่อหน่วยงาน child4")]
public string? child4 { get; set; }
[Comment("id หน่วยงาน child4")]
public string? child4Id { get; set; }
[Comment("ชื่อย่อหน่วยงาน child4")]
public string? child4ShortName { get; set; }
[Comment("id revision")]
public string? orgRevisionId { get; set; }
[Comment("id ตำแหน่ง")]
public string? positionId { get; set; }
[Comment("เลขที่ตำแหน่ง")]
public int? posMasterNo { get; set; }
[Comment("ชื่อตำแหน่งในสายงาน")]
public string? positionName { get; set; }
[Comment("สายงาน")]
public string? positionField { get; set; }
[Comment("id ประเภทตำแหน่ง")]
public string? posTypeId { get; set; }
[Comment("ชื่อประเภทตำแหน่ง")]
public string? posTypeName { get; set; }
[Comment("id ระดับตำแหน่ง")]
public string? posLevelId { get; set; }
[Comment("ชื่อระดับตำแหน่ง")]
public string? posLevelName { get; set; }
[Comment("Id รูปโปรไฟล์")]
public virtual Document? ProfileImg { get; set; }
public virtual List<PlacementProfileDoc> PlacementProfileDocs { get; set; } = new List<PlacementProfileDoc>();

View file

@ -0,0 +1,321 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetablePlacementProfilesaddorg : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "positionId",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id ตำแหน่ง",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: "id ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddColumn<string>(
name: "child1",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child1")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1Id",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child1")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child1ShortName",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child1")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child2")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2Id",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child2")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child2ShortName",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child2")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child3")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3Id",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child3")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child3ShortName",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child3")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน child4")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4Id",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน child4")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "child4ShortName",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน child4")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "orgRevisionId",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id revision")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posLevelId",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id ระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posLevelName",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posMasterNo",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "เลขที่ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posTypeId",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id ประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "posTypeName",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "positionField",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "สายงาน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "positionName",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อตำแหน่งในสายงาน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "root",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อหน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootId",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "id หน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "rootShortName",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "ชื่อย่อหน่วยงาน root")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "child1",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child1Id",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child1ShortName",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child2",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child2Id",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child2ShortName",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child3",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child3Id",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child3ShortName",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child4",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child4Id",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "child4ShortName",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "orgRevisionId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posLevelId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posLevelName",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posMasterNo",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posTypeId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "posTypeName",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "positionField",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "positionName",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "root",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "rootId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "rootShortName",
table: "PlacementProfiles");
migrationBuilder.AlterColumn<Guid>(
name: "positionId",
table: "PlacementProfiles",
type: "char(36)",
nullable: true,
comment: "id ตำแหน่ง",
collation: "ascii_general_ci",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "id ตำแหน่ง")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -0,0 +1,42 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetablePlacementProfilesaddorg1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "posMasterNo",
table: "PlacementProfiles",
type: "int",
nullable: true,
comment: "เลขที่ตำแหน่ง",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "เลขที่ตำแหน่ง")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "posMasterNo",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "เลขที่ตำแหน่ง",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true,
oldComment: "เลขที่ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -12133,6 +12133,54 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("varchar(200)")
.HasComment("โทรศัพท์");
b.Property<string>("child1")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child1");
b.Property<string>("child1Id")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child1");
b.Property<string>("child1ShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child1");
b.Property<string>("child2")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child2");
b.Property<string>("child2Id")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child2");
b.Property<string>("child2ShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child2");
b.Property<string>("child3")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child3");
b.Property<string>("child3Id")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child3");
b.Property<string>("child3ShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child3");
b.Property<string>("child4")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน child4");
b.Property<string>("child4Id")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน child4");
b.Property<string>("child4ShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน child4");
b.Property<int?>("node")
.HasColumnType("int")
.HasComment("ระดับโครงสร้าง");
@ -12141,6 +12189,10 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("char(36)")
.HasComment("id โครงสร้าง");
b.Property<string>("orgRevisionId")
.HasColumnType("longtext")
.HasComment("id revision");
b.Property<string>("orgTreeShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน");
@ -12149,14 +12201,54 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน");
b.Property<Guid?>("positionId")
.HasColumnType("char(36)")
b.Property<string>("posLevelId")
.HasColumnType("longtext")
.HasComment("id ระดับตำแหน่ง");
b.Property<string>("posLevelName")
.HasColumnType("longtext")
.HasComment("ชื่อระดับตำแหน่ง");
b.Property<int?>("posMasterNo")
.HasColumnType("int")
.HasComment("เลขที่ตำแหน่ง");
b.Property<string>("posTypeId")
.HasColumnType("longtext")
.HasComment("id ประเภทตำแหน่ง");
b.Property<string>("posTypeName")
.HasColumnType("longtext")
.HasComment("ชื่อประเภทตำแหน่ง");
b.Property<string>("positionField")
.HasColumnType("longtext")
.HasComment("สายงาน");
b.Property<string>("positionId")
.HasColumnType("longtext")
.HasComment("id ตำแหน่ง");
b.Property<string>("positionName")
.HasColumnType("longtext")
.HasComment("ชื่อตำแหน่งในสายงาน");
b.Property<Guid?>("posmasterId")
.HasColumnType("char(36)")
.HasComment("id อัตรากำลัง");
b.Property<string>("root")
.HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน root");
b.Property<string>("rootId")
.HasColumnType("longtext")
.HasComment("id หน่วยงาน root");
b.Property<string>("rootShortName")
.HasColumnType("longtext")
.HasComment("ชื่อย่อหน่วยงาน root");
b.HasKey("Id");
b.HasIndex("BloodGroupId");

View file

@ -13,6 +13,9 @@ using Microsoft.EntityFrameworkCore;
using Swashbuckle.AspNetCore.Annotations;
using System.Security.Claims;
using System.Security.Cryptography;
using Microsoft.Extensions.Configuration;
using System.Net.Http.Headers;
using Newtonsoft.Json;
namespace BMA.EHR.Placement.Service.Controllers
{
@ -29,18 +32,21 @@ namespace BMA.EHR.Placement.Service.Controllers
private readonly ApplicationDBContext _context;
private readonly MinIOService _documentService;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IConfiguration _configuration;
public PlacementController(PlacementRepository repository,
NotificationRepository repositoryNoti,
ApplicationDBContext context,
MinIOService documentService,
IHttpContextAccessor httpContextAccessor)
IHttpContextAccessor httpContextAccessor,
IConfiguration configuration)
{
_repository = repository;
_repositoryNoti = repositoryNoti;
_context = context;
_documentService = documentService;
_httpContextAccessor = httpContextAccessor;
_configuration = configuration;
}
#region " Properties "
@ -48,6 +54,7 @@ namespace BMA.EHR.Placement.Service.Controllers
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
private string? token => _httpContextAccessor.HttpContext.Request.Headers["Authorization"];
private bool? PlacementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1");
@ -672,72 +679,66 @@ namespace BMA.EHR.Placement.Service.Controllers
if (person.Draft == true)
return Error("ไม่สามารถแก้ไขข้อมูลนี้ได้เนื่องจากเผยแพร่ไปแล้ว");
// if (req.PosNoId != null)
// {
// var save_posNo = await _context.PositionNumbers.FindAsync(req.PosNoId);
// if (save_posNo == null)
// return Error(GlobalMessages.PositionPosNoNotFound, 404);
// person.PositionNumber = save_posNo;
// person.organizationName = req.organizationName;
// person.orgTreeShortName = req.orgTreeShortName;
// person.PosPath = req.posPath;
// person.PosNumber = req.posNumber;
// person.node = req.node;
// person.nodeId = req.nodeId;
// person.posmasterId = req.posmasterId;
// person.positionId = req.positionId;
// person.Amount = req.SalaryAmount;
// person.MouthSalaryAmount = req.MouthSalaryAmount;
// person.PositionSalaryAmount = req.PositionSalaryAmount;
// person.RecruitDate = req.ReportingDate;
// person.ReportingDate = req.ReportingDate;
// var save_orgPosition = await _context.OrganizationPositions.FirstOrDefaultAsync(x => x.PositionNumber == save_posNo);
// if (save_orgPosition == null)
// return Error(GlobalMessages.PositionPosNoNotFound, 404);
// person.OrganizationPosition = save_orgPosition;
// }
var apiUrl = $"{_configuration["API"]}org/find/all";
// if (req.PositionId != null)
// {
// var save = await _context.PositionPaths.FindAsync(req.PositionId);
// if (save == null)
// return Error(GlobalMessages.PositionPathNotFound, 404);
// person.PositionPath = save;
// }
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new
{
node = req.node,
nodeId = req.nodeId,
});
var _result = await _res.Content.ReadAsStringAsync();
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
// if (req.PositionLevelId != null)
// {
// var save = await _context.PositionLevels.FindAsync(req.PositionLevelId);
// if (save == null)
// return Error(GlobalMessages.PositionLevelNotFound, 404);
// person.PositionLevel = save;
// }
if (org == null || org.result == null)
return Error("ไม่พบหน่วยงานนี้ในระบบ", 404);
// if (req.PositionLineId != null)
// {
// var save = await _context.PositionLines.FindAsync(req.PositionLineId);
// if (save == null)
// return Error(GlobalMessages.PositionLineNotFound, 404);
// person.PositionLine = save;
// }
person.root = org.result.root;
person.rootId = org.result.rootId;
person.rootShortName = org.result.rootShortName;
person.child1 = req.node <= 0 ? null : org.result.child1;
person.child1Id = req.node <= 0 ? null : org.result.child1Id;
person.child1ShortName = req.node <= 0 ? null : org.result.child1ShortName;
person.child2 = req.node <= 1 ? null : org.result.child2;
person.child2Id = req.node <= 1 ? null : org.result.child2Id;
person.child2ShortName = req.node <= 1 ? null : org.result.child2ShortName;
person.child3 = req.node <= 2 ? null : org.result.child3;
person.child3Id = req.node <= 2 ? null : org.result.child3Id;
person.child3ShortName = req.node <= 2 ? null : org.result.child3ShortName;
person.child4 = req.node <= 3 ? null : org.result.child4;
person.child4Id = req.node <= 3 ? null : org.result.child4Id;
person.child4ShortName = req.node <= 3 ? null : org.result.child4ShortName;
}
// if (req.PositionPathSideId != null)
// {
// var save = await _context.PositionPathSides.FindAsync(req.PositionPathSideId);
// if (save == null)
// return Error(GlobalMessages.PositionPathSideNotFound, 404);
// person.PositionPathSide = save;
// }
// if (req.PositionTypeId != null)
// {
// var save = await _context.PositionTypes.FindAsync(req.PositionTypeId);
// if (save == null)
// return Error(GlobalMessages.PositionTypeNotFound, 404);
// person.PositionType = save;
// }
person.Draft = false;
person.organizationName = req.organizationName;
person.orgTreeShortName = req.orgTreeShortName;
person.PosPath = req.posPath;
person.PosNumber = req.posNumber;
person.node = req.node;
person.nodeId = req.nodeId;
person.posmasterId = req.posmasterId;
person.orgRevisionId = req.orgRevisionId;
person.positionId = req.positionId;
person.Amount = req.SalaryAmount;
person.MouthSalaryAmount = req.MouthSalaryAmount;
person.PositionSalaryAmount = req.PositionSalaryAmount;
person.RecruitDate = req.ReportingDate;
person.ReportingDate = req.ReportingDate;
person.posMasterNo = req.posMasterNo;
person.positionName = req.positionName;
person.positionField = req.positionField;
person.posTypeId = req.posTypeId;
person.posTypeName = req.posTypeName;
person.posLevelId = req.posLevelId;
person.posLevelName = req.posLevelName;
person.PlacementStatus = "PREPARE-CONTAIN";
person.LastUpdateFullName = FullName ?? "System Administrator";
person.LastUpdateUserId = UserId ?? "";

View file

@ -0,0 +1,28 @@
using BMA.EHR.Domain.Models.MetaData;
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Placement.Service.Requests
{
public class OrgRequest
{
public OrgRequestData result { get; set; } = new();
}
public class OrgRequestData
{
public string? root { get; set; }
public string? rootId { get; set; }
public string? rootShortName { get; set; }
public string? child1 { get; set; }
public string? child1Id { get; set; }
public string? child1ShortName { get; set; }
public string? child2 { get; set; }
public string? child2Id { get; set; }
public string? child2ShortName { get; set; }
public string? child3 { get; set; }
public string? child3Id { get; set; }
public string? child3ShortName { get; set; }
public string? child4 { get; set; }
public string? child4Id { get; set; }
public string? child4ShortName { get; set; }
}
}

View file

@ -25,6 +25,19 @@ namespace BMA.EHR.Placement.Service.Requests
public int? node { get; set; }
public Guid? nodeId { get; set; }
public Guid? posmasterId { get; set; }
public Guid? positionId { get; set; }
// public Guid? positionId { get; set; }
public string? orgRevisionId { get; set; }
public string? positionId { get; set; }
public int? posMasterNo { get; set; }
public string? positionName { get; set; }
public string? positionField { get; set; }
public string? posTypeId { get; set; }
public string? posTypeName { get; set; }
public string? posLevelId { get; set; }
public string? posLevelName { get; set; }
}
}

View file

@ -14,7 +14,7 @@
"AllowedHosts": "*",
"ConnectionStrings": {
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
},
"Jwt": {
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
@ -35,5 +35,6 @@
"Hour": "08",
"Minute": "00"
},
"Protocol": "HTTPS"
"Protocol": "HTTPS",
"API": "https://bma-ehr.frappet.synology.me/api/v1/"
}