Merge branch 'develop' into work

This commit is contained in:
Kittapath 2023-10-11 12:50:48 +07:00
commit cd8291c42a
10 changed files with 16979 additions and 2 deletions

View file

@ -1501,7 +1501,7 @@ namespace BMA.EHR.Application.Repositories.Commands
//.Where(x => x.OrganizationPosition!.Organization!.Id == command.OwnerGovId)
.Where(x => !otherCommandReceivers.Contains(x.CitizenId!))
.Where(x => x.Status.Trim().ToUpper() == "REPORT")
.Where(x => x.CommandType!.Id == command.CommandType!.Id)
//.Where(x => x.CommandType!.Id == command.CommandType!.Id)
.Where(x => x.Profile.ProfileType == "employee")
.OrderBy(x => x.CitizenId)
.ToListAsync();
@ -1697,6 +1697,9 @@ namespace BMA.EHR.Application.Repositories.Commands
{
// query placement Profile
var placementProfile = await _dbContext.Set<PlacementProfile>()
.Include(x => x.PlacementProfileDocs)
.ThenInclude(x => x.Document)
.Include(x => x.Prefix)
.Include(x => x.FatherPrefix)
.Include(x => x.MotherPrefix)
@ -1889,6 +1892,23 @@ namespace BMA.EHR.Application.Repositories.Commands
});
}
// add profile document
foreach(var doc in placementProfile.PlacementProfileDocs)
{
profile.Papers.Add(new ProfilePaper
{
CategoryName = "Profile Documents",
Document = doc.Document,
Detail = doc.Document.FileName,
CreatedAt = DateTime.Now,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateUserId = UserId ?? "",
});
}
// add profile salary
var oc = _dbContext.Set<OrganizationEntity>()
@ -2090,6 +2110,9 @@ namespace BMA.EHR.Application.Repositories.Commands
foreach (var recv in command.Receivers)
{
var placementProfile = await _dbContext.Set<PlacementProfile>()
.Include(x => x.PlacementProfileDocs)
.ThenInclude(x => x.Document)
.Include(x => x.Prefix)
.Include(x => x.FatherPrefix)
.Include(x => x.MotherPrefix)
@ -2337,6 +2360,10 @@ namespace BMA.EHR.Application.Repositories.Commands
foreach (var recv in command.Receivers)
{
var placementProfile = await _dbContext.Set<PlacementProfile>()
.Include(x => x.PlacementProfileDocs)
.ThenInclude(x => x.Document)
.Include(x => x.Prefix)
.Include(x => x.FatherPrefix)
.Include(x => x.MotherPrefix)

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BMA.EHR.Application.Responses.Organizations
{
public class OrgPosFinal
{
public Guid? OrganizationPositionId { get; set; }
public string? PositionNumberName { get; set; }
}
}

View file

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BMA.EHR.Application.Responses.Organizations
{
public class TreeOrgResponseMap
{
public Guid? organizationPositionId { get; set; }
public Guid? positionMasterId { get; set; }
public string? positionUserNote { get; set; }
public bool? isCondition { get; set; }
public string? conditionNote { get; set; }
public string? keyId { get; set; }
public Guid? personId { get; set; }
public Guid? profileId { get; set; }
public string? header { get; set; }
public string? avatar { get; set; }
public Guid? organizationId { get; set; }
public string? organizationCode { get; set; }
public string? organizationName { get; set; }
public string? name { get; set; }
public int? order { get; set; }
public string? positionNum { get; set; }
public string? organizationShortName { get; set; }
public string? positionName { get; set; }
public string? positionSideName { get; set; }
public string? executivePosition { get; set; }
public string? executivePositionSide { get; set; }
public string? positionType { get; set; }
public string? positionLevel { get; set; }
public bool? positionLeaderFlag { get; set; }
public bool? lazy { get; set; }
public bool? isActive { get; set; }
public bool? enabled { get; set; }
public int? totalPositionCount { get; set; }
public int? totalPositionVacant { get; set; }
public Guid? organizationParentId { get; set; }
public string OrganizationStatus { get; set; } = "ปกติ";
public string? agency { get; set; }
public string? government { get; set; }
public string? department { get; set; }
public string? pile { get; set; }
public string? governmentCode { get; set; }
public Guid? positionNameId { get; set; }
public Guid? positionNumId { get; set; }
public Guid? positionLineId { get; set; }
public Guid? positionTypeId { get; set; }
public string? positionLine { get; set; }
public Object? positionSideNameObj { get; set; }
public Object? positionLevelObj { get; set; }
public int? positionNumInt
{
get
{
try
{
if (positionNum is null)
return 999 + order ?? 0;
else
{
var i = positionNum.Split(".").Last();
return Convert.ToInt32(i);
}
}
catch (Exception ex) { }
return null;
}
}
}
}

View file

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BMA.EHR.Application.Responses.Organizations
{
public class t1
{
public Guid? personID { get; set; }
public string? name { get; set; }
public string? positionName { get; set; }
public string? positionNum { get; set; }
public string? departmentName { get; set; }
public string? avatar { get; set; }
public string? nodeType { get; set; }
public Guid? parentId { get; set; }
public Guid? organizationId { get; set; }
public Guid? id { get; set; }
public int? positionNumInt
{
get
{
try
{
if (positionNum.Contains("."))
{
var i = positionNum.Split(".")[1];
return Convert.ToInt16(i);
}
}
catch (Exception ex) { }
return null;
}
}
}
}

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BMA.EHR.Application.Responses.Organizations
{
public class t2
{
public Guid? deptID { get; set; }
public string? departmentName { get; set; }
public int? totalPositionCount { get; set; }
public int? totalPositionVacant { get; set; }
public Guid? parentId { get; set; }
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetablefieldCommandReceiver : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Comment2",
table: "CommandReceivers",
type: "text",
nullable: false,
comment: "หมายเหตุแนวนอน")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Comment2",
table: "CommandReceivers");
}
}
}

View file

@ -482,6 +482,11 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnType("text")
.HasComment("หมายเหตุ");
b.Property<string>("Comment2")
.IsRequired()
.HasColumnType("text")
.HasComment("หมายเหตุแนวนอน");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnOrder(100)

View file

@ -15,7 +15,8 @@
"ConnectionStrings": {
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
// "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
"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.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
},
"Jwt": {
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",