แก้ api ลา
This commit is contained in:
parent
d08b4ca723
commit
4822110533
20 changed files with 20695 additions and 2783 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -136,6 +136,28 @@ namespace BMA.EHR.Application.Repositories
|
|||
var apiPath = $"{_configuration["API"]}/org/dotnet/keycloak/{keycloakId}";
|
||||
var apiKey = _configuration["API_KEY"];
|
||||
|
||||
var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey);
|
||||
if (apiResult != null)
|
||||
{
|
||||
var raw = JsonConvert.DeserializeObject<GetProfileByKeycloakIdResultDto>(apiResult);
|
||||
if (raw != null)
|
||||
return raw.Result;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<GetProfileByKeycloakIdDto?> GetProfileByProfileIdAsync(Guid keycloakId, string? accessToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
var apiPath = $"{_configuration["API"]}/org/dotnet/profile/{keycloakId}";
|
||||
var apiKey = _configuration["API_KEY"];
|
||||
|
||||
var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey);
|
||||
if (apiResult != null)
|
||||
|
|
@ -146,15 +168,6 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
|
||||
return null;
|
||||
|
||||
//var data = await _dbContext.Set<Profile>().AsQueryable()
|
||||
// .Include(p => p.Prefix)
|
||||
// .Include(p => p.Position)
|
||||
// .Include(p => p.PositionLevel)
|
||||
// .Include(p => p.Salaries)
|
||||
// .FirstOrDefaultAsync(p => p.KeycloakId == keycloakId);
|
||||
|
||||
//return data;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -532,7 +545,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
}
|
||||
|
||||
public GetProfileByIdDto GetOfficerProfileByCitizenId(string citizenId, string? accessToken)
|
||||
public async Task<GetProfileByKeycloakIdDto?> GetOfficerProfileByCitizenId(string citizenId, string? accessToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -542,7 +555,7 @@ namespace BMA.EHR.Application.Repositories
|
|||
var apiResult = GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey);
|
||||
if (apiResult.Result != null)
|
||||
{
|
||||
var raw = JsonConvert.DeserializeObject<GetProfileByIdResultDto>(apiResult.Result);
|
||||
var raw = JsonConvert.DeserializeObject<GetProfileByKeycloakIdResultDto>(apiResult.Result);
|
||||
if (raw != null)
|
||||
return raw.Result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,19 +9,19 @@ namespace BMA.EHR.Application.Requests
|
|||
public string CitizenId { get; set; } = String.Empty;
|
||||
|
||||
public string Prefix { get; set; } = String.Empty;
|
||||
|
||||
|
||||
public string FirstName { get; set; } = String.Empty;
|
||||
|
||||
|
||||
public string LastName { get; set; } = String.Empty;
|
||||
|
||||
|
||||
public DateTime? BirthDate { get; set; }
|
||||
|
||||
|
||||
public DateTime? DateAppoint { get; set; }
|
||||
|
||||
|
||||
public string? ProfileType { get; set; }
|
||||
|
||||
|
||||
public string? PosTypeName { get; set; }
|
||||
|
||||
|
||||
public string? PosLevelName { get; set; }
|
||||
|
||||
public string FullName { get; set; } = String.Empty;
|
||||
|
|
@ -33,7 +33,7 @@ namespace BMA.EHR.Application.Requests
|
|||
public string GovAge { get; set; } = String.Empty;
|
||||
|
||||
public double? Salary { get; set; }
|
||||
|
||||
|
||||
public double? PositionSalary { get; set; }
|
||||
|
||||
public string LastInsignia { get; set; } = String.Empty;
|
||||
|
|
@ -49,6 +49,11 @@ namespace BMA.EHR.Application.Requests
|
|||
|
||||
public int Seq { get; set; }
|
||||
|
||||
public double? Amount { get; set; }
|
||||
public double? PositionSalaryAmount { get; set; }
|
||||
public Guid? RootId { get; set; }
|
||||
public string? Root { get; set; }
|
||||
|
||||
public List<MatchingCondition> MatchingConditions { get; set; } = new List<MatchingCondition>();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ namespace BMA.EHR.Application.Responses.Profiles
|
|||
|
||||
public Guid? OcId { get; set; }
|
||||
|
||||
public PosType? PosType { get; set; }
|
||||
public string? PosType { get; set; }
|
||||
|
||||
public PosLevel? PosLevel { get; set; }
|
||||
public string? PosLevel { get; set; }
|
||||
|
||||
public string? Oc { get; set; }
|
||||
|
||||
|
|
@ -45,16 +45,17 @@ namespace BMA.EHR.Application.Responses.Profiles
|
|||
public bool? IsLeave { get; set; }
|
||||
|
||||
public string? Root { get; set; }
|
||||
|
||||
public string? Child1 { get; set; }
|
||||
|
||||
public string? Child2 { get; set; }
|
||||
|
||||
public string? Child3 { get; set; }
|
||||
|
||||
public string? Child4 { get; set; }
|
||||
public Guid? RootId { get; set; }
|
||||
public Guid? Child1Id { get; set; }
|
||||
public Guid? Child2Id { get; set; }
|
||||
public Guid? Child3Id { get; set; }
|
||||
public Guid? Child4Id { get; set; }
|
||||
public double? Amount { get; set; }
|
||||
|
||||
public double? PositionSalaryAmount { get; set; }
|
||||
public string? Commander { get; set; }
|
||||
|
||||
}
|
||||
|
|
@ -127,5 +128,6 @@ namespace BMA.EHR.Application.Responses.Profiles
|
|||
public int? Year { get; set; }
|
||||
|
||||
public Guid? InsigniaId { get; set; }
|
||||
public string? Insignia { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,9 +25,13 @@ namespace BMA.EHR.Application.Responses.Profiles
|
|||
|
||||
public Guid? OcId { get; set; }
|
||||
|
||||
public PosType? PosType { get; set; }
|
||||
public string? PosType { get; set; }
|
||||
|
||||
public PosLevel? PosLevel { get; set; }
|
||||
public string? PosLevel { get; set; }
|
||||
|
||||
public Guid? PosTypeId { get; set; }
|
||||
|
||||
public Guid? PosLevelId { get; set; }
|
||||
|
||||
public string? Oc { get; set; }
|
||||
|
||||
|
|
@ -42,5 +46,9 @@ namespace BMA.EHR.Application.Responses.Profiles
|
|||
public string? PosNoEmployee { get; set; }
|
||||
|
||||
public string? Gender { get; set; }
|
||||
public double? Amount { get; set; }
|
||||
public double? PositionSalaryAmount { get; set; }
|
||||
public Guid? RootId { get; set; }
|
||||
public string? Root { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ namespace BMA.EHR.Domain.Models.Insignias
|
|||
public int Total { get; set; }
|
||||
[Comment("รหัสหน่วยงาน")]
|
||||
public Guid OrganizationId { get; set; }
|
||||
[Comment("รหัสหน่วยงาน")]
|
||||
public string? Organization { get; set; }
|
||||
//public OrganizationOrganization OrganizationOrganization { get; set; }
|
||||
[Comment("Fk Table InsigniaManage")]
|
||||
public InsigniaManage InsigniaManage { get; set; }
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ namespace BMA.EHR.Domain.Models.Insignias
|
|||
[Comment("Fk Table OrganizationOrganization Borrow")]
|
||||
//public OrganizationOrganization? BorrowOrganization { get; set; }
|
||||
public Guid? BorrowOrganizationId { get; set; }
|
||||
public string? BorrowOrganization { get; set; }
|
||||
|
||||
[Comment("คืนวันที่")]
|
||||
public DateTime? ReturnDate { get; set; }
|
||||
|
|
@ -25,6 +26,7 @@ namespace BMA.EHR.Domain.Models.Insignias
|
|||
[Comment("Fk Table OrganizationOrganization Return")]
|
||||
//public OrganizationOrganization? ReturnOrganization { get; set; }
|
||||
public Guid? ReturnOrganizationId { get; set; }
|
||||
public string? ReturnOrganization { get; set; }
|
||||
|
||||
[Comment("เหตุผลคืน")]
|
||||
public string? ReturnReason { get; set; }
|
||||
|
|
|
|||
|
|
@ -11,13 +11,6 @@ namespace BMA.EHR.Domain.Models.Insignias
|
|||
[MaxLength(200)]
|
||||
public string? Name { get; set; }
|
||||
public int Year { get; set; }
|
||||
// public DateTime StartDate { get; set; }
|
||||
// public DateTime EndDate { get; set; }
|
||||
// [MaxLength(50)]
|
||||
// public int Amount { get; set; }
|
||||
// public Document? ReliefDoc { get; set; }
|
||||
// [Comment("ราบการยื่นขอ")]
|
||||
// public int Round { get; set; } = 1;
|
||||
public virtual List<InsigniaNoteProfile> InsigniaNoteProfiles { get; set; }
|
||||
public virtual List<InsigniaNoteDoc> InsigniaNoteDocs { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,5 +76,7 @@ namespace BMA.EHR.Domain.Models.Insignias
|
|||
public string? PosNo { get; set; }
|
||||
public double? Amount { get; set; }
|
||||
public double? PositionSalaryAmount { get; set; }
|
||||
public Guid? RootId { get; set; }
|
||||
public string? Root { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,8 @@ namespace BMA.EHR.Domain.Models.Insignias
|
|||
public string? PosNo { get; set; }
|
||||
public double? Amount { get; set; }
|
||||
public double? PositionSalaryAmount { get; set; }
|
||||
|
||||
public string? LastInsigniaName { get; set; }
|
||||
public Guid? RootId { get; set; }
|
||||
public string? Root { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
19178
BMA.EHR.Infrastructure/Migrations/20241118093933_update table insignia add rootid.Designer.cs
generated
Normal file
19178
BMA.EHR.Infrastructure/Migrations/20241118093933_update table insignia add rootid.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,97 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableinsigniaaddrootid : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Root",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "RootId",
|
||||
table: "InsigniaRequestProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Root",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "RootId",
|
||||
table: "InsigniaNoteProfiles",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "BorrowOrganization",
|
||||
table: "InsigniaManageProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ReturnOrganization",
|
||||
table: "InsigniaManageProfiles",
|
||||
type: "longtext",
|
||||
nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Organization",
|
||||
table: "InsigniaManageOrganiations",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "รหัสหน่วยงาน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Root",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RootId",
|
||||
table: "InsigniaRequestProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Root",
|
||||
table: "InsigniaNoteProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RootId",
|
||||
table: "InsigniaNoteProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BorrowOrganization",
|
||||
table: "InsigniaManageProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ReturnOrganization",
|
||||
table: "InsigniaManageProfiles");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Organization",
|
||||
table: "InsigniaManageOrganiations");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5763,6 +5763,10 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("Organization")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รหัสหน่วยงาน");
|
||||
|
||||
b.Property<Guid>("OrganizationId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("รหัสหน่วยงาน");
|
||||
|
|
@ -5791,6 +5795,9 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnType("datetime(6)")
|
||||
.HasComment("ยืมวันที่");
|
||||
|
||||
b.Property<string>("BorrowOrganization")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("BorrowOrganizationId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Fk Table OrganizationOrganization Borrow");
|
||||
|
|
@ -5843,6 +5850,9 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
.HasColumnType("datetime(6)")
|
||||
.HasComment("คืนวันที่");
|
||||
|
||||
b.Property<string>("ReturnOrganization")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("ReturnOrganizationId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Fk Table OrganizationOrganization Return");
|
||||
|
|
@ -6153,6 +6163,12 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
b.Property<Guid>("RequestInsigniaId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Root")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("RootId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<double?>("Salary")
|
||||
.HasColumnType("double");
|
||||
|
||||
|
|
@ -6497,6 +6513,12 @@ namespace BMA.EHR.Infrastructure.Migrations
|
|||
b.Property<Guid>("RequestInsigniaId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Root")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("RootId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<double?>("Salary")
|
||||
.HasColumnType("double");
|
||||
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
.Select(p => new
|
||||
{
|
||||
Id = p.Id,
|
||||
OrganizationOrganization = _userProfileRepository.GetOc(p.OrganizationId, 0, AccessToken) == null ? "" : _userProfileRepository.GetOc(p.OrganizationId, 0, AccessToken)!.Root,
|
||||
OrganizationOrganization = p.Organization,
|
||||
Total = p.Total,
|
||||
Allocate = p.InsigniaManageProfiles.Where(x => x.Status == false).Count(),
|
||||
Remain = p.Total - p.InsigniaManageProfiles.Where(x => x.Status == false).Count(),
|
||||
|
|
@ -312,36 +312,26 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
|
||||
var organization = _userProfileRepository.GetOc(req.OrganizationOrganizationId, 0, AccessToken);
|
||||
|
||||
//var organization = await _context.Organizations.AsQueryable()
|
||||
// .Include(x => x.OrganizationOrganization)
|
||||
// .FirstOrDefaultAsync(x => x.Id == req.OrganizationOrganizationId);
|
||||
if (organization == null)
|
||||
return Error(GlobalMessages.OrganizationNotFound);
|
||||
//if (organization.OrganizationOrganization == null)
|
||||
// return Error(GlobalMessages.OrganizationNotFound);
|
||||
|
||||
var insigniaManage = await _context.InsigniaManages.AsQueryable()
|
||||
.Include(x => x.InsigniaManageOrganiations)
|
||||
//.ThenInclude(x => x.OrganizationOrganization)
|
||||
.FirstOrDefaultAsync(x => x.Id == req.insigniaManageId);
|
||||
if (insigniaManage == null)
|
||||
return Error(GlobalMessages.InsigniaManageNotFound);
|
||||
|
||||
var insigniaManageOrganiation = await _context.InsigniaManageOrganiations.AsQueryable()
|
||||
.FirstOrDefaultAsync(x => x.OrganizationId == organization.RootId && x.InsigniaManage == insigniaManage);
|
||||
.FirstOrDefaultAsync(x => x.OrganizationId == req.OrganizationOrganizationId && x.InsigniaManage == insigniaManage);
|
||||
if (insigniaManageOrganiation != null)
|
||||
return Error(GlobalMessages.InsigniaManageOrgDupicate);
|
||||
|
||||
var total = insigniaManage.InsigniaManageOrganiations.Where(x => x.OrganizationId != organization.RootId).Sum(x => x.Total);
|
||||
var total = insigniaManage.InsigniaManageOrganiations.Where(x => x.OrganizationId != req.OrganizationOrganizationId).Sum(x => x.Total);
|
||||
if (req.Total + total > insigniaManage.Total)
|
||||
return Error(GlobalMessages.InsigniaManageOrgLimit);
|
||||
var root = _userProfileRepository.GetOc(req.OrganizationOrganizationId, 0, AccessToken)?.Root ?? null;
|
||||
await _context.InsigniaManageOrganiations.AddAsync(
|
||||
new InsigniaManageOrganiation
|
||||
{
|
||||
//OrganizationOrganization = organization.OrganizationOrganization,
|
||||
OrganizationId = organization.RootId ?? Guid.Empty,
|
||||
OrganizationId = req.OrganizationOrganizationId,
|
||||
Organization = root,
|
||||
Total = req.Total,
|
||||
InsigniaManage = insigniaManage,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
|
|
@ -404,7 +394,6 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var uppdated = await _context.InsigniaManageOrganiations.AsQueryable()
|
||||
//.Include(x => x.OrganizationOrganization)
|
||||
.Include(x => x.InsigniaManage)
|
||||
.FirstOrDefaultAsync(x => x.Id == insigniaManageOrgId);
|
||||
if (uppdated == null)
|
||||
|
|
@ -412,7 +401,6 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
|
||||
var insigniaManage = await _context.InsigniaManages.AsQueryable()
|
||||
.Include(x => x.InsigniaManageOrganiations)
|
||||
//.ThenInclude(x => x.OrganizationOrganization)
|
||||
.FirstOrDefaultAsync(x => x.Id == uppdated.InsigniaManage.Id);
|
||||
if (insigniaManage == null)
|
||||
return Error(GlobalMessages.InsigniaManageNotFound);
|
||||
|
|
@ -496,26 +484,6 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
if (insigniaNoteProfile.Status != "DONE")
|
||||
return Error(GlobalMessages.InsigniaNoBorrow);
|
||||
|
||||
var userProfile = _userProfileRepository.GetOfficerProfileById(insigniaNoteProfile.ProfileId.Value, AccessToken);
|
||||
|
||||
//var _organization = await _context.Organizations.AsQueryable()
|
||||
// .FirstOrDefaultAsync(x => x.Id == insigniaNoteProfile.Profile.OcId);
|
||||
|
||||
//TODO : Hardcode OCId ต้องแก้ให้ดึงมาจากคน Login
|
||||
var user_oc = _userProfileRepository.GetUserOCId(userProfile.Keycloak.Value, AccessToken);
|
||||
if (req.BorrowOrganizationId == null) req.BorrowOrganizationId = user_oc;
|
||||
//if (req.BorrowOrganizationId == null) req.BorrowOrganizationId = Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3");
|
||||
|
||||
var organization = _userProfileRepository.GetOc(req.BorrowOrganizationId.Value, 0, AccessToken);
|
||||
//if (organization == null)
|
||||
// return Error(GlobalMessages.OrganizationNotFound);
|
||||
|
||||
//var organization = await _context.Organizations.AsQueryable()
|
||||
// .Include(x => x.OrganizationOrganization)
|
||||
// .FirstOrDefaultAsync(x => x.Id == _organization.OrganizationAgencyId);
|
||||
//if (organization == null)
|
||||
// return Error(GlobalMessages.OrganizationNotFound);
|
||||
|
||||
var insigniaManage = await _context.InsigniaManages.AsQueryable()
|
||||
.FirstOrDefaultAsync(x => x.Year == insigniaNoteProfile.InsigniaNote.Year && x.Insignia == insigniaNoteProfile.RequestInsignia);
|
||||
if (insigniaManage == null)
|
||||
|
|
@ -523,7 +491,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
|
||||
var insigniaManageOrganiation = await _context.InsigniaManageOrganiations.AsQueryable()
|
||||
.Include(x => x.InsigniaManageProfiles)
|
||||
.FirstOrDefaultAsync(x => x.OrganizationId == organization.RootId && x.InsigniaManage == insigniaManage);
|
||||
.FirstOrDefaultAsync(x => x.OrganizationId == insigniaNoteProfile.RootId && x.InsigniaManage == insigniaManage);
|
||||
if (insigniaManageOrganiation == null)
|
||||
return Error(GlobalMessages.InsigniaManageOrgNotFound);
|
||||
|
||||
|
|
@ -540,7 +508,8 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
{
|
||||
Status = false,
|
||||
InsigniaManageOrganiation = insigniaManageOrganiation,
|
||||
BorrowOrganizationId = organization.RootId,
|
||||
BorrowOrganizationId = insigniaNoteProfile.RootId,
|
||||
BorrowOrganization = insigniaNoteProfile.Root,
|
||||
BorrowDate = req.BorrowDate,
|
||||
InsigniaNoteProfile = insigniaNoteProfile,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
|
|
@ -575,26 +544,14 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var uppdated = await _context.InsigniaManageProfiles.AsQueryable()
|
||||
//.Include(x => x.BorrowOrganization)
|
||||
.FirstOrDefaultAsync(x => x.Id == insigniaManageProfileId);
|
||||
if (uppdated == null)
|
||||
return Error(GlobalMessages.InsigniaManageNotFound);
|
||||
|
||||
uppdated.Status = true;
|
||||
uppdated.ReturnDate = req.ReturnDate;
|
||||
// if (req.ReturnOrganizationId == Guid.Parse("00000000-0000-0000-0000-000000000000"))
|
||||
// {
|
||||
uppdated.ReturnOrganizationId = uppdated.BorrowOrganizationId;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var organization = await _context.Organizations.AsQueryable()
|
||||
// .Include(x => x.OrganizationOrganization)
|
||||
// .FirstOrDefaultAsync(x => x.Id == req.ReturnOrganizationId);
|
||||
// if (organization == null)
|
||||
// return Error(GlobalMessages.OrganizationNotFound);
|
||||
// uppdated.ReturnOrganization = organization.OrganizationOrganization;
|
||||
// }
|
||||
uppdated.ReturnOrganization = uppdated.BorrowOrganization;
|
||||
uppdated.ReturnReason = req.ReturnReason;
|
||||
uppdated.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
uppdated.LastUpdateUserId = UserId ?? "";
|
||||
|
|
@ -637,9 +594,17 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
.Select(p => new
|
||||
{
|
||||
Id = p.Id,
|
||||
BorrowOrganization = p.BorrowOrganizationId == null ? null : _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken),
|
||||
ReturnOrganization = p.ReturnOrganizationId == null ? null : _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken),
|
||||
Profile = p.InsigniaNoteProfile.ProfileId == null ? null : _userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken),
|
||||
BorrowOrganization = p.BorrowOrganization,
|
||||
BorrowOrganizationId = p.BorrowOrganizationId,
|
||||
ReturnOrganization = p.ReturnOrganization,
|
||||
ReturnOrganizationId = p.ReturnOrganizationId,
|
||||
Profile = p.InsigniaNoteProfile!.ProfileId ?? Guid.Empty,
|
||||
CitizenId = p.InsigniaNoteProfile!.CitizenId ?? string.Empty,
|
||||
Prefix = p.InsigniaNoteProfile!.Prefix ?? string.Empty,
|
||||
FirstName = p.InsigniaNoteProfile!.FirstName ?? string.Empty,
|
||||
LastName = p.InsigniaNoteProfile!.LastName ?? string.Empty,
|
||||
ProfileType = p.InsigniaNoteProfile!.ProfileType ?? string.Empty,
|
||||
Position = p.InsigniaNoteProfile!.Position ?? string.Empty,
|
||||
|
||||
Status = p.Status,
|
||||
BorrowDate = p.BorrowDate,
|
||||
|
|
@ -675,21 +640,21 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
{
|
||||
p.Id,
|
||||
p.Status,
|
||||
BorrowOrganization = p.BorrowOrganization == null ? "" : p.BorrowOrganization.Root,
|
||||
BorrowOrganizationId = p.BorrowOrganization == null ? Guid.Empty : p.BorrowOrganization.RootId,
|
||||
BorrowOrganization = p.BorrowOrganization,
|
||||
BorrowOrganizationId = p.BorrowOrganizationId,
|
||||
p.BorrowDate,
|
||||
p.ReturnDate,
|
||||
ReturnOrganization = p.ReturnOrganization == null ? "" : p.ReturnOrganization.Root,
|
||||
ReturnOrganizationId = p.ReturnOrganization == null ? Guid.Empty : p.ReturnOrganization.RootId,
|
||||
ReturnOrganization = p.ReturnOrganization,
|
||||
ReturnOrganizationId = p.ReturnOrganizationId,
|
||||
p.ReturnReason,
|
||||
p.LastUpdatedAt,
|
||||
p.CreatedAt,
|
||||
p.InsigniaNoteProfileId,
|
||||
CitizenId = p.Profile == null ? "" : p.Profile.CitizenId,
|
||||
Prefix = p.Profile == null ? "" : p.Profile.Prefix,
|
||||
Position = p.Profile == null ? "" : p.Profile.Position,
|
||||
FullName = p.Profile == null ? "" : $"{p.Profile.Prefix}{p.Profile.FirstName} {p.Profile.LastName}",
|
||||
ProfileType = p.Profile == null ? "" : p.Profile.ProfileType,
|
||||
CitizenId = p.CitizenId,
|
||||
Prefix = p.Prefix,
|
||||
Position = p.Position,
|
||||
FullName = $"{p.Prefix}{p.FirstName} {p.LastName}",
|
||||
ProfileType = p.ProfileType,
|
||||
p.RequestInsignia,
|
||||
p.RequestInsigniaId,
|
||||
p.RequestInsigniaShortName,
|
||||
|
|
@ -712,51 +677,6 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
})
|
||||
.ToList();
|
||||
|
||||
//var data = await _context.InsigniaManageProfiles.AsQueryable()
|
||||
// .Where(x => x.InsigniaNoteProfile.RequestInsignia.InsigniaType == insigniaType)
|
||||
// .Where(x => year == 0 ? x.Id != null : x.InsigniaManageOrganiation.InsigniaManage.Year == year)
|
||||
// .OrderByDescending(x => x.CreatedAt)
|
||||
// .Select(p => new
|
||||
// {
|
||||
// Id = p.Id,
|
||||
// Status = p.Status,
|
||||
// BorrowOrganization = _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken) == null ? null : _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken).Root,
|
||||
// BorrowOrganizationId = _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken) == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken).RootId,
|
||||
// BorrowDate = p.BorrowDate,
|
||||
// ReturnDate = p.ReturnDate,
|
||||
// ReturnOrganization = _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken) == null ? null : _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken).Root,
|
||||
// ReturnOrganizationId = _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken) == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken).RootId,
|
||||
// ReturnReason = p.ReturnReason,
|
||||
// LastUpdatedAt = p.LastUpdatedAt,
|
||||
// CreatedAt = p.CreatedAt,
|
||||
|
||||
// InsigniaNoteProfileId = p.InsigniaNoteProfile.Id,
|
||||
// Prefix = _userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).Prefix,
|
||||
// Position = _userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).Position,
|
||||
// _userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).CitizenId,
|
||||
// _userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).ProfileType,
|
||||
// FullName = $"{_userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).Prefix}{_userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).FirstName} {_userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).LastName}",
|
||||
// RequestInsignia = p.InsigniaNoteProfile.RequestInsignia == null ? null : p.InsigniaNoteProfile.RequestInsignia.Name,
|
||||
// RequestInsigniaId = p.InsigniaNoteProfile.RequestInsignia == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.InsigniaNoteProfile.RequestInsignia.Id,
|
||||
// RequestInsigniaShortName = p.InsigniaNoteProfile.RequestInsignia == null ? null : p.InsigniaNoteProfile.RequestInsignia.ShortName,
|
||||
// p.InsigniaNoteProfile.DateReceive,
|
||||
// p.InsigniaNoteProfile.OrganizationOrganizationSend,
|
||||
// p.InsigniaNoteProfile.OrganizationOrganizationReceive,
|
||||
// InsigniaNoteProfileStatus = p.InsigniaNoteProfile.Status,
|
||||
// p.InsigniaNoteProfile.Issue,
|
||||
// p.InsigniaNoteProfile.Date,
|
||||
// p.InsigniaNoteProfile.VolumeNo,
|
||||
// p.InsigniaNoteProfile.Section,
|
||||
// p.InsigniaNoteProfile.Page,
|
||||
// p.InsigniaNoteProfile.No,
|
||||
// p.InsigniaNoteProfile.DatePayment,
|
||||
// p.InsigniaNoteProfile.TypePayment,
|
||||
// p.InsigniaNoteProfile.Address,
|
||||
// p.InsigniaNoteProfile.Number,
|
||||
// p.InsigniaNoteProfile.Salary,
|
||||
// })
|
||||
// .ToListAsync();
|
||||
|
||||
return Success(data);
|
||||
}
|
||||
|
||||
|
|
@ -778,12 +698,12 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
{
|
||||
Id = p.Id,
|
||||
Status = p.Status,
|
||||
BorrowOrganization = _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken) == null ? null : _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken).Root,
|
||||
BorrowOrganizationId = _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken) == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken).RootId,
|
||||
BorrowOrganization = p.BorrowOrganization,
|
||||
BorrowOrganizationId = p.BorrowOrganizationId,
|
||||
BorrowDate = p.BorrowDate,
|
||||
ReturnDate = p.ReturnDate,
|
||||
ReturnOrganization = _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken) == null ? null : _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken).Root,
|
||||
ReturnOrganizationId = _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken) == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken).RootId,
|
||||
ReturnOrganization = p.ReturnOrganization,
|
||||
ReturnOrganizationId = p.ReturnOrganizationId,
|
||||
ReturnReason = p.ReturnReason,
|
||||
LastUpdatedAt = p.LastUpdatedAt,
|
||||
CreatedAt = p.CreatedAt,
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var insigniaPeriods = await _context.InsigniaPeriods.AsQueryable()
|
||||
// .Where(x => x.Type == type)
|
||||
.OrderByDescending(x => x.Year)
|
||||
.ThenByDescending(x => x.StartDate)
|
||||
.Select(p => new
|
||||
|
|
@ -234,7 +233,6 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
|
||||
RevisionId = revisionId ?? Guid.Empty
|
||||
};
|
||||
await _context.InsigniaPeriods.AddAsync(period);
|
||||
|
|
@ -248,7 +246,6 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
period.ReliefDoc = doc;
|
||||
}
|
||||
|
||||
// await _context.InsigniaPeriods.AddAsync(period);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return Success();
|
||||
|
|
|
|||
|
|
@ -57,87 +57,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
}
|
||||
else
|
||||
{
|
||||
// var request = _context.InsigniaRequestProfiles
|
||||
// .Include(x => x.Request)
|
||||
// .ThenInclude(x => x.Period)
|
||||
// .Include(x => x.RequestInsignia)
|
||||
// .ThenInclude(x => x.InsigniaType)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.AcademicStanding)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Position)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.Insignias)
|
||||
// .ThenInclude(x => x.Insignia)
|
||||
// .ThenInclude(x => x.InsigniaType)
|
||||
// .Include(x => x.Profile)
|
||||
// .ThenInclude(x => x.PositionNumber)
|
||||
// .Where(x => x.Request.Period.Id == result.PeriodId)
|
||||
// .Where(x => x.Request.RequestStatus == "st5p")
|
||||
// .Where(x => x.IsApprove)
|
||||
// .Select(p => new
|
||||
// {
|
||||
// Profile = p.Profile.Id,
|
||||
// Name = $"{p.Profile.Prefix} {p.Profile.FirstName} {p.Profile.LastName}",
|
||||
// Insignia = p.RequestInsignia,
|
||||
// Type = p.RequestInsignia.InsigniaType,
|
||||
// IsApprove = p.IsApprove,
|
||||
// InsigniaId = p.RequestInsignia.Id,
|
||||
// Year = p.Request.Period.Year,
|
||||
// Special = p.Special,
|
||||
// LastInsignia = p.Profile.Insignias.AsQueryable()
|
||||
// .Include(x => x.Insignia)
|
||||
// .Where(x => x.Insignia.Id == p.RequestInsignia.Id)
|
||||
// .Where(x => x.Year == p.Request.Period.Year)
|
||||
// .FirstOrDefault()
|
||||
// })
|
||||
// .ToList()
|
||||
// .Select(r => new InsigniaReceiveResponse
|
||||
// {
|
||||
// Profile = r.Profile,
|
||||
// Name = r.Name,
|
||||
// Insignia = r.Insignia.Name,
|
||||
// TypeId = r.Type == null ? null : r.Type.Id,
|
||||
// TypeName = r.Type == null ? "" : r.Type.Description,
|
||||
// IsApprove = r.IsApprove,
|
||||
// InsigniaId = r.InsigniaId,
|
||||
// InsigniaPage = r.LastInsignia == null ? "" : r.LastInsignia.Page,
|
||||
// InsigniaNo = r.LastInsignia == null ? "" : r.LastInsignia.No,
|
||||
// InsigniaIssue = r.LastInsignia == null ? "" : r.LastInsignia.Issue,
|
||||
// InsigniaVolumeno = r.LastInsignia == null ? "" : r.LastInsignia.VolumeNo,
|
||||
// InsigniaVolume = r.LastInsignia == null ? "" : r.LastInsignia.Volume,
|
||||
// InsigniaSection = r.LastInsignia == null ? "" : r.LastInsignia.Section,
|
||||
// InsigniaDatereceive = r.LastInsignia == null ? null : r.LastInsignia.DateReceive,
|
||||
// InsigniaDateannounce = r.LastInsignia == null ? null : r.LastInsignia.DateAnnounce,
|
||||
// Special = r.Special
|
||||
// })
|
||||
// .ToList()
|
||||
// .GroupBy(r => new { r.TypeId, r.TypeName })
|
||||
// .Select(r => new
|
||||
// {
|
||||
// TypeId = r.Key.TypeId,
|
||||
// InsigniaIssue = r.Where(r => r.InsigniaIssue != "").FirstOrDefault() != null ? r.Where(r => r.InsigniaIssue != "").FirstOrDefault().InsigniaIssue : "",
|
||||
// InsigniaVolumeno = r.Where(r => r.InsigniaIssue != "").FirstOrDefault() != null ? r.Where(r => r.InsigniaIssue != "").FirstOrDefault().InsigniaVolumeno : null,
|
||||
// InsigniaVolume = r.Where(r => r.InsigniaIssue != "").FirstOrDefault() != null ? r.Where(r => r.InsigniaIssue != "").FirstOrDefault().InsigniaVolume : "",
|
||||
// InsigniaSection = r.Where(r => r.InsigniaIssue != "").FirstOrDefault() != null ? r.Where(r => r.InsigniaIssue != "").FirstOrDefault().InsigniaSection : "",
|
||||
// InsigniaDatereceive = r.Where(r => r.InsigniaIssue != "").FirstOrDefault() != null ? r.Where(r => r.InsigniaIssue != "").FirstOrDefault().InsigniaDatereceive : null,
|
||||
// InsigniaDateannounce = r.Where(r => r.InsigniaIssue != "").FirstOrDefault() != null ? r.Where(r => r.InsigniaIssue != "").FirstOrDefault().InsigniaDateannounce : null,
|
||||
// TypeName = r.Key.TypeName,
|
||||
// Profile = r.Select(r => new
|
||||
// {
|
||||
// Profile = r.Profile,
|
||||
// Name = r.Name,
|
||||
// Insignia = r.Insignia,
|
||||
// InsigniaId = r.InsigniaId,
|
||||
// InsigniaPage = r.InsigniaPage,
|
||||
// InsigniaNo = r.InsigniaNo,
|
||||
// //Special = bool.Parse(r.Special)
|
||||
// }).ToList(),
|
||||
// Docs = new List<dynamic>()
|
||||
// });
|
||||
|
||||
return Success();
|
||||
// return Success(request);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -179,68 +99,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
|||
|
||||
}, AccessToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// foreach (var i in items.Profile)
|
||||
// {
|
||||
// var profile = _context.Profiles.AsQueryable()
|
||||
// .Include(x => x.Insignias)
|
||||
// .ThenInclude(x => x.Insignia)
|
||||
// .Where(x => x.Id == i.FkProfileId)
|
||||
// .FirstOrDefault();
|
||||
// if (profile != null)
|
||||
// {
|
||||
// var kp7 = profile.Insignias.AsQueryable()
|
||||
// .Where(x => x.Insignia.Id == i.Kp7InsigniaId)
|
||||
// .FirstOrDefault();
|
||||
|
||||
// if (kp7 != null)
|
||||
// {
|
||||
// // exit item update to database
|
||||
// kp7.DateReceive = items.InsigniaDatereceive.Value;
|
||||
// kp7.Level = items.InsigniaLevel;
|
||||
// kp7.Issue = items.InsigniaIssue;
|
||||
// kp7.VolumeNo = items.InsigniaVolumeno.Value.ToString();
|
||||
// kp7.Volume = items.InsigniaVolume;
|
||||
// kp7.Section = items.InsigniaSection;
|
||||
// kp7.DateAnnounce = items.InsigniaDateannounce.Value;
|
||||
// kp7.Page = i.InsigniaPage;
|
||||
// kp7.No = i.InsigniaNo;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // insert new item to kp7
|
||||
// var insignia_item = _context.Insignias.FirstOrDefault(x => x.Id == i.Kp7InsigniaId);
|
||||
// var result = _repository.GetInsigniaRequest(type, items.OCId);
|
||||
|
||||
// var period = _context.InsigniaPeriods.FirstOrDefault(x => x.Id == result.PeriodId);
|
||||
|
||||
// kp7 = new Models.HR.ProfileInsignia
|
||||
// {
|
||||
// Order = profile.Insignias.ToList().Count + 1,
|
||||
// Year = period.Year,
|
||||
// Insignia = insignia_item,
|
||||
// DateReceive = items.InsigniaDatereceive.Value,
|
||||
// DateStamp = DateTime.Now,
|
||||
// Level = items.InsigniaLevel,
|
||||
// Issue = items.InsigniaIssue,
|
||||
// VolumeNo = items.InsigniaVolumeno.Value.ToString(),
|
||||
// Volume = items.InsigniaVolume,
|
||||
// Section = items.InsigniaSection,
|
||||
// DateAnnounce = items.InsigniaDateannounce.Value,
|
||||
// Page = i.InsigniaPage,
|
||||
// No = i.InsigniaNo,
|
||||
// };
|
||||
// profile.Insignias.Add(kp7);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// return NotFound("Profile not found!!!");
|
||||
// }
|
||||
}
|
||||
//_context.SaveChanges();
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -9,7 +9,6 @@ namespace BMA.EHR.Insignia.Service.Requests
|
|||
public Guid insigniaId { get; set; }
|
||||
public Guid insigniaPeriodId { get; set; }
|
||||
public string? Reason { get; set; }
|
||||
|
||||
public Guid OcId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -850,7 +850,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
no = count,
|
||||
fullName = $"{p.Prefix}{p.FirstName} {p.LastName}",// _userProfileRepository.GetUserFullName(p.Keycloak ?? Guid.Empty, AccessToken),
|
||||
position = p.Position == null ? "" : p.Position,
|
||||
//positionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||
//positionLevel = p.PosLevel == null ? "" : p.PosLevel,
|
||||
//posNo = p.ProfileSalary == null ? "" : p.ProfileSalary.PosNo,
|
||||
positionLevel = p.PositionLevel == null ? "" : p.PositionLevel,
|
||||
posNo = p.PosNo == null ? "" : p.PosNo,
|
||||
|
|
@ -1084,7 +1084,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
//var profile = await _userProfileRepository.SearchProfile(null, null, null);
|
||||
var profile = await _userProfileRepository.GetProfileWithKeycloak(AccessToken);
|
||||
if(profile.Count > 0)
|
||||
if (profile.Count > 0)
|
||||
{
|
||||
profile = profile.Where(p => p.IsLeave == false).ToList();
|
||||
}
|
||||
|
|
@ -1232,12 +1232,12 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
workTotal += 1;
|
||||
if (!timeStamps.IsLocationCheckIn)
|
||||
{
|
||||
if(timeStamps.CheckInLocationName == "ปฏิบัติงานที่บ้าน")
|
||||
if (timeStamps.CheckInLocationName == "ปฏิบัติงานที่บ้าน")
|
||||
wfhTotal += 1;
|
||||
else if (timeStamps.CheckInLocationName == "ไปประชุม/อบรม/สัมมนา/ปฏิบัติงานที่บ้านนอกสถานที่")
|
||||
seminarTotal += 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveRequest.LeaveTypeCode = leaveType.Code;
|
||||
leaveRequest.Dear = approver;
|
||||
leaveRequest.PositionName = profile.Position == null ? "" : profile.Position;
|
||||
leaveRequest.PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel.PosLevelName;
|
||||
leaveRequest.PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel;
|
||||
leaveRequest.OrganizationName = userOc;
|
||||
|
||||
|
||||
|
|
@ -376,7 +376,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leave.CitizenId = profile.CitizenId;
|
||||
|
||||
leave.PositionName = profile.Position == null ? "" : profile.Position;
|
||||
leave.PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel.PosLevelName;
|
||||
leave.PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel;
|
||||
leave.OrganizationName = profile.Root ?? "";
|
||||
|
||||
|
||||
|
|
@ -628,7 +628,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
oldData.LeaveTypeCode = leaveType.Code;
|
||||
oldData.Dear = approver;
|
||||
oldData.PositionName = profile.Position == null ? "" : profile.Position;
|
||||
oldData.PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel.PosLevelName;
|
||||
oldData.PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel;
|
||||
oldData.OrganizationName = profile.Oc ?? "";
|
||||
|
||||
_context.Entry(oldData.Type).State = Microsoft.EntityFrameworkCore.EntityState.Detached;
|
||||
|
|
@ -729,7 +729,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
Dear = profile.Commander ?? "",
|
||||
PositionName = profile.Position == null ? "" : profile.Position,
|
||||
PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel.PosLevelName,
|
||||
PositionLevelName = profile.PosLevel == null ? "" : profile.PosLevel,
|
||||
OrganizationName = profile.Root ?? "", //profile.Oc ?? "",
|
||||
|
||||
LeaveLimit = leaveType.Limit,
|
||||
|
|
@ -1574,8 +1574,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
refId = id,
|
||||
sysName = "SYS_LEAVE_LIST",
|
||||
posLevelName = profile.PosLevel?.PosLevelName ?? "",
|
||||
posTypeName = profile.PosType?.PosTypeName ?? "",
|
||||
posLevelName = profile.PosLevel ?? "",
|
||||
posTypeName = profile.PosType ?? "",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue