Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
This commit is contained in:
commit
41474b407d
29 changed files with 39708 additions and 3703 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,13 +1,14 @@
|
||||||
using BMA.EHR.Application.Common.Interfaces;
|
using BMA.EHR.Application.Common.Interfaces;
|
||||||
|
using BMA.EHR.Application.Responses.Organizations;
|
||||||
using BMA.EHR.Application.Responses.Profiles;
|
using BMA.EHR.Application.Responses.Profiles;
|
||||||
using BMA.EHR.Domain.Models.HR;
|
using BMA.EHR.Domain.Models.HR;
|
||||||
using BMA.EHR.Domain.Models.MetaData;
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
using BMA.EHR.Domain.Models.Organizations;
|
using BMA.EHR.Domain.Models.Organizations;
|
||||||
using BMA.EHR.Domain.Shared;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
namespace BMA.EHR.Application.Repositories
|
namespace BMA.EHR.Application.Repositories
|
||||||
{
|
{
|
||||||
|
|
@ -60,6 +61,70 @@ namespace BMA.EHR.Application.Repositories
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<GetProfileByRootIdDto>> GetOfficerProfileByRootIdAsync(Guid rootId, string? accessToken)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var apiPath = $"{_configuration["API"]}/org/dotnet/root/officer/{rootId}";
|
||||||
|
|
||||||
|
|
||||||
|
var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "");
|
||||||
|
if (apiResult != null)
|
||||||
|
{
|
||||||
|
var raw = JsonConvert.DeserializeObject<GetProfileByRootIdResultDto>(apiResult);
|
||||||
|
if (raw != null)
|
||||||
|
return raw.Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<GetProfileByRootIdDto>> GetEmployeeProfileByRootIdAsync(Guid rootId, string? accessToken)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var apiPath = $"{_configuration["API"]}/org/dotnet/root/employee/{rootId}";
|
||||||
|
|
||||||
|
|
||||||
|
var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "");
|
||||||
|
if (apiResult != null)
|
||||||
|
{
|
||||||
|
var raw = JsonConvert.DeserializeObject<GetProfileByRootIdResultDto>(apiResult);
|
||||||
|
if (raw != null)
|
||||||
|
return raw.Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<GetProfileByKeycloakIdDto?> GetProfileByKeycloakIdAsync(Guid keycloakId, string? accessToken)
|
public async Task<GetProfileByKeycloakIdDto?> GetProfileByKeycloakIdAsync(Guid keycloakId, string? accessToken)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -266,7 +331,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var apiPath = $"{_configuration["API"]}/org/dotnet/keycloak";
|
var apiPath = $"{_configuration["API"]}/org/dotnet/user-fullname/{keycloakId}";
|
||||||
|
|
||||||
var apiResult = GetExternalAPIAsync(apiPath, accessToken ?? "");
|
var apiResult = GetExternalAPIAsync(apiPath, accessToken ?? "");
|
||||||
if (apiResult.Result != null)
|
if (apiResult.Result != null)
|
||||||
|
|
@ -349,6 +414,102 @@ namespace BMA.EHR.Application.Repositories
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GetOrganizationResponseDTO? GetOc(Guid ocId, int level, string? accessToken)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var apiPath = $"{_configuration["API"]}/org/find/all";
|
||||||
|
var body = new
|
||||||
|
{
|
||||||
|
nodeId = ocId,
|
||||||
|
node = level
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
var apiResult = PostExternalAPIAsync(apiPath, accessToken ?? "", body).Result;
|
||||||
|
if (apiResult != null)
|
||||||
|
{
|
||||||
|
var raw = JsonConvert.DeserializeObject<GetOrganizationResponseResultDTO>(apiResult);
|
||||||
|
if (raw != null && raw.Result != null)
|
||||||
|
{
|
||||||
|
return raw.Result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetProfileByIdDto GetOfficerProfileById(Guid id, string? accessToken)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var apiPath = $"{_configuration["API"]}/org/profile/{id}";
|
||||||
|
|
||||||
|
var apiResult = GetExternalAPIAsync(apiPath, accessToken ?? "");
|
||||||
|
if (apiResult.Result != null)
|
||||||
|
{
|
||||||
|
var raw = JsonConvert.DeserializeObject<GetProfileByIdResultDto>(apiResult.Result);
|
||||||
|
if (raw != null)
|
||||||
|
return raw.Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetProfileByIdDto GetEmployeeProfileById(Guid id, string? accessToken)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var apiPath = $"{_configuration["API"]}/org/profile-employee/{id}";
|
||||||
|
|
||||||
|
var apiResult = GetExternalAPIAsync(apiPath, accessToken ?? "");
|
||||||
|
if (apiResult.Result != null)
|
||||||
|
{
|
||||||
|
var raw = JsonConvert.DeserializeObject<GetProfileByIdResultDto>(apiResult.Result);
|
||||||
|
if (raw != null)
|
||||||
|
return raw.Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetProfileByIdDto GetOfficerProfileByCitizenId(string citizenId, string? accessToken)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var apiPath = $"{_configuration["API"]}/org/dotnet/citizenId/{citizenId}";
|
||||||
|
|
||||||
|
var apiResult = GetExternalAPIAsync(apiPath, accessToken ?? "");
|
||||||
|
if (apiResult.Result != null)
|
||||||
|
{
|
||||||
|
var raw = JsonConvert.DeserializeObject<GetProfileByIdResultDto>(apiResult.Result);
|
||||||
|
if (raw != null)
|
||||||
|
return raw.Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,9 @@ namespace BMA.EHR.Application.Requests
|
||||||
public string LastInsignia { get; set; }
|
public string LastInsignia { get; set; }
|
||||||
public Guid? LastInsigniaId { get; set; }
|
public Guid? LastInsigniaId { get; set; }
|
||||||
|
|
||||||
public Guid PosNo { get; set; }
|
//public Guid PosNo { get; set; }
|
||||||
|
|
||||||
|
public string PosNo { get; set; }
|
||||||
|
|
||||||
public InsigniaItem RequestInsignia { get; set; }
|
public InsigniaItem RequestInsignia { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Application.Responses.Organizations
|
||||||
|
{
|
||||||
|
public class GetOrganizationResponseDTO
|
||||||
|
{
|
||||||
|
public Guid? RootId { get; set; }
|
||||||
|
|
||||||
|
public string? Root { get; set; }
|
||||||
|
|
||||||
|
public string? RootShortName { get; set; }
|
||||||
|
|
||||||
|
public Guid? Child1Id { get; set; }
|
||||||
|
|
||||||
|
public string? Child1 { get; set; }
|
||||||
|
|
||||||
|
public string? Child1ShortName { get; set; }
|
||||||
|
|
||||||
|
public Guid? Child2Id { get; set; }
|
||||||
|
|
||||||
|
public string? Child2 { get; set; }
|
||||||
|
|
||||||
|
public string? Child2ShortName { get; set; }
|
||||||
|
|
||||||
|
public Guid? Child3Id { get; set; }
|
||||||
|
|
||||||
|
public string? Child3 { get; set; }
|
||||||
|
|
||||||
|
public string? Child3ShortName { get; set; }
|
||||||
|
|
||||||
|
public Guid? Child4Id { get; set; }
|
||||||
|
|
||||||
|
public string? Child4 { get; set; }
|
||||||
|
|
||||||
|
public string? Child4ShortName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
namespace BMA.EHR.Application.Responses.Organizations
|
||||||
|
{
|
||||||
|
public class GetOrganizationResponseResultDTO
|
||||||
|
{
|
||||||
|
public string Message { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public int Status { get; set; } = -1;
|
||||||
|
|
||||||
|
public GetOrganizationResponseDTO? Result { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
42
BMA.EHR.Application/Responses/Profiles/GetProfileByIdDto.cs
Normal file
42
BMA.EHR.Application/Responses/Profiles/GetProfileByIdDto.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
namespace BMA.EHR.Application.Responses.Profiles
|
||||||
|
{
|
||||||
|
public class GetProfileByIdDto
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public string? Prefix { get; set; }
|
||||||
|
public string? FirstName { get; set; }
|
||||||
|
public string? LastName { get; set; }
|
||||||
|
public string? CitizenId { get; set; }
|
||||||
|
|
||||||
|
public DateTime BirthDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public DateTime? DateStart { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public DateTime? DateAppoint { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public string? Position { get; set; }
|
||||||
|
|
||||||
|
public Guid? OcId { get; set; }
|
||||||
|
|
||||||
|
public PosType? PosType { get; set; }
|
||||||
|
|
||||||
|
public PosLevel? PosLevel { get; set; }
|
||||||
|
|
||||||
|
public string? Oc { get; set; }
|
||||||
|
|
||||||
|
public List<ProfileSalaryResult>? ProfileSalary { get; set; }
|
||||||
|
|
||||||
|
public List<ProfileInsignia>? ProfileInsignia { get; set; }
|
||||||
|
|
||||||
|
public Guid? Keycloak { get; set; }
|
||||||
|
|
||||||
|
public string? PosNo { get; set; }
|
||||||
|
|
||||||
|
public string? PosNoEmployee { get; set; }
|
||||||
|
|
||||||
|
public string? Gender { get; set; }
|
||||||
|
|
||||||
|
public string ProfileType { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
namespace BMA.EHR.Application.Responses.Profiles
|
||||||
|
{
|
||||||
|
public class GetProfileByIdResultDto
|
||||||
|
{
|
||||||
|
public string Message { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public int Status { get; set; } = -1;
|
||||||
|
|
||||||
|
public GetProfileByIdDto? Result { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -27,14 +27,18 @@ namespace BMA.EHR.Application.Responses.Profiles
|
||||||
|
|
||||||
public string? Oc { get; set; }
|
public string? Oc { get; set; }
|
||||||
|
|
||||||
public List<ProfileSalary> Salaries { get; set; } = new();
|
public ProfileSalaryResult? ProfileSalary { get; set; }
|
||||||
|
|
||||||
public Guid? Keycloak { get; set; }
|
public ProfileInsignia? ProfileInsignia { get; set; }
|
||||||
|
|
||||||
|
public Guid? Keycloak { get; set; }
|
||||||
|
|
||||||
public string? PosNo { get; set; }
|
public string? PosNo { get; set; }
|
||||||
|
|
||||||
public string? PosNoEmployee { get; set; }
|
public string? PosNoEmployee { get; set; }
|
||||||
|
|
||||||
|
public string? Gender { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PosLevel
|
public class PosLevel
|
||||||
|
|
@ -61,4 +65,45 @@ namespace BMA.EHR.Application.Responses.Profiles
|
||||||
public string LastUpdateFullName { get; set; }
|
public string LastUpdateFullName { get; set; }
|
||||||
public string PosTypeName { get; set; }
|
public string PosTypeName { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ProfileSalaryResult
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
public DateTime? CreatedAt { get; set; }
|
||||||
|
public Guid? CreatedUserId { get; set; }
|
||||||
|
public DateTime? LastUpdatedAt { get; set; }
|
||||||
|
public Guid? LastUpdateUserId { get; set; }
|
||||||
|
public string? CreatedFullName { get; set; }
|
||||||
|
public string? LastUpdateFullName { get; set; }
|
||||||
|
public string PosNo { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public double? Amount { get; set; }
|
||||||
|
|
||||||
|
public double? PositionSalaryAmount { get; set; }
|
||||||
|
|
||||||
|
public double? MouthSalaryAmount { get; set; }
|
||||||
|
|
||||||
|
public int Order { get; set; }
|
||||||
|
|
||||||
|
public DateTime? Date { get; set; }
|
||||||
|
|
||||||
|
public string PositionLevel { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string PositionType { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProfileInsignia
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
public DateTime? CreatedAt { get; set; }
|
||||||
|
public Guid? CreatedUserId { get; set; }
|
||||||
|
public DateTime? LastUpdatedAt { get; set; }
|
||||||
|
public Guid? LastUpdateUserId { get; set; }
|
||||||
|
public string? CreatedFullName { get; set; }
|
||||||
|
public string? LastUpdateFullName { get; set; }
|
||||||
|
|
||||||
|
public int? Year { get; set; }
|
||||||
|
|
||||||
|
public Guid? InsigniaId { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BMA.EHR.Application.Responses.Profiles
|
||||||
|
{
|
||||||
|
public class GetProfileByRootIdDto
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public string? Prefix { get; set; }
|
||||||
|
public string? FirstName { get; set; }
|
||||||
|
public string? LastName { get; set; }
|
||||||
|
public string? CitizenId { get; set; }
|
||||||
|
|
||||||
|
public DateTime BirthDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public DateTime? DateStart { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public DateTime? DateAppoint { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
public string? Position { get; set; }
|
||||||
|
|
||||||
|
public Guid? OcId { get; set; }
|
||||||
|
|
||||||
|
public PosType? PosType { get; set; }
|
||||||
|
|
||||||
|
public PosLevel? PosLevel { get; set; }
|
||||||
|
|
||||||
|
public string? Oc { get; set; }
|
||||||
|
|
||||||
|
public List<ProfileSalaryResult>? ProfileSalary { get; set; }
|
||||||
|
|
||||||
|
public List<ProfileInsignia>? ProfileInsignia { get; set; }
|
||||||
|
|
||||||
|
public Guid? Keycloak { get; set; }
|
||||||
|
|
||||||
|
public string? PosNo { get; set; }
|
||||||
|
|
||||||
|
public string? PosNoEmployee { get; set; }
|
||||||
|
|
||||||
|
public string? Gender { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
namespace BMA.EHR.Application.Responses.Profiles
|
||||||
|
{
|
||||||
|
public class GetProfileByRootIdResultDto
|
||||||
|
{
|
||||||
|
public string Message { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public int Status { get; set; } = -1;
|
||||||
|
|
||||||
|
public List<GetProfileByRootIdDto> Result { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -35,7 +35,9 @@ namespace BMA.EHR.Domain.Models.HR
|
||||||
[Comment("เอกสารอ้างอิง (ลงวันที่)")]
|
[Comment("เอกสารอ้างอิง (ลงวันที่)")]
|
||||||
public DateTime? RefCommandDate { get; set; }
|
public DateTime? RefCommandDate { get; set; }
|
||||||
public virtual List<ProfileInsigniaHistory> ProfileInsigniaHistorys { get; set; } = new List<ProfileInsigniaHistory>();
|
public virtual List<ProfileInsigniaHistory> ProfileInsigniaHistorys { get; set; } = new List<ProfileInsigniaHistory>();
|
||||||
public virtual Profile? Profile { get; set; }
|
//public virtual Profile? Profile { get; set; }
|
||||||
|
|
||||||
|
public Guid ProfileId { get; set; } // link to profile
|
||||||
|
|
||||||
[Comment("หมายเหตุ")]
|
[Comment("หมายเหตุ")]
|
||||||
public string? Note { get; set; }
|
public string? Note { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
using BMA.EHR.Domain.Models.Base;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using BMA.EHR.Domain.Models.Base;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using BMA.EHR.Domain.Models.Documents;
|
|
||||||
using BMA.EHR.Domain.Models.MetaData;
|
|
||||||
|
|
||||||
namespace BMA.EHR.Domain.Models.Insignias
|
namespace BMA.EHR.Domain.Models.Insignias
|
||||||
{
|
{
|
||||||
|
|
@ -11,8 +7,9 @@ namespace BMA.EHR.Domain.Models.Insignias
|
||||||
{
|
{
|
||||||
[Comment("จำนวนทั้งหมด")]
|
[Comment("จำนวนทั้งหมด")]
|
||||||
public int Total { get; set; }
|
public int Total { get; set; }
|
||||||
[Comment("Fk Table OrganizationOrganization")]
|
[Comment("รหัสหน่วยงาน")]
|
||||||
public OrganizationOrganization OrganizationOrganization { get; set; }
|
public Guid OrganizationId { get; set; }
|
||||||
|
//public OrganizationOrganization OrganizationOrganization { get; set; }
|
||||||
[Comment("Fk Table InsigniaManage")]
|
[Comment("Fk Table InsigniaManage")]
|
||||||
public InsigniaManage InsigniaManage { get; set; }
|
public InsigniaManage InsigniaManage { get; set; }
|
||||||
public virtual List<InsigniaManageProfile> InsigniaManageProfiles { get; set; } = new List<InsigniaManageProfile>();
|
public virtual List<InsigniaManageProfile> InsigniaManageProfiles { get; set; } = new List<InsigniaManageProfile>();
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,27 @@ namespace BMA.EHR.Domain.Models.Insignias
|
||||||
{
|
{
|
||||||
[Comment("สถานะการคืน")]
|
[Comment("สถานะการคืน")]
|
||||||
public bool Status { get; set; }
|
public bool Status { get; set; }
|
||||||
|
|
||||||
[Comment("ยืมวันที่")]
|
[Comment("ยืมวันที่")]
|
||||||
public DateTime? BorrowDate { get; set; }
|
public DateTime? BorrowDate { get; set; }
|
||||||
|
|
||||||
[Comment("Fk Table OrganizationOrganization Borrow")]
|
[Comment("Fk Table OrganizationOrganization Borrow")]
|
||||||
public OrganizationOrganization? BorrowOrganization { get; set; }
|
//public OrganizationOrganization? BorrowOrganization { get; set; }
|
||||||
|
public Guid? BorrowOrganizationId { get; set; }
|
||||||
|
|
||||||
[Comment("คืนวันที่")]
|
[Comment("คืนวันที่")]
|
||||||
public DateTime? ReturnDate { get; set; }
|
public DateTime? ReturnDate { get; set; }
|
||||||
|
|
||||||
[Comment("Fk Table OrganizationOrganization Return")]
|
[Comment("Fk Table OrganizationOrganization Return")]
|
||||||
public OrganizationOrganization? ReturnOrganization { get; set; }
|
//public OrganizationOrganization? ReturnOrganization { get; set; }
|
||||||
|
public Guid? ReturnOrganizationId { get; set; }
|
||||||
|
|
||||||
[Comment("เหตุผลคืน")]
|
[Comment("เหตุผลคืน")]
|
||||||
public string? ReturnReason { get; set; }
|
public string? ReturnReason { get; set; }
|
||||||
|
|
||||||
[Comment("Fk Table InsigniaNoteProfile")]
|
[Comment("Fk Table InsigniaNoteProfile")]
|
||||||
public InsigniaNoteProfile InsigniaNoteProfile { get; set; }
|
public InsigniaNoteProfile InsigniaNoteProfile { get; set; }
|
||||||
|
|
||||||
[Comment("Fk Table InsigniaManageOrganiation")]
|
[Comment("Fk Table InsigniaManageOrganiation")]
|
||||||
public InsigniaManageOrganiation InsigniaManageOrganiation { get; set; }
|
public InsigniaManageOrganiation InsigniaManageOrganiation { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,11 @@ namespace BMA.EHR.Domain.Models.Insignias
|
||||||
public Document? DocReturnInsignia { get; set; }
|
public Document? DocReturnInsignia { get; set; }
|
||||||
[Comment("หน่วยงานคืนเครื่องราชฯ")]
|
[Comment("หน่วยงานคืนเครื่องราชฯ")]
|
||||||
public OrganizationEntity? OrgReturnInsignia { get; set; }
|
public OrganizationEntity? OrgReturnInsignia { get; set; }
|
||||||
public Profile Profile { get; set; }
|
|
||||||
|
|
||||||
|
public Guid? ProfileId { get; set; }
|
||||||
|
|
||||||
|
//public Profile Profile { get; set; }
|
||||||
public Insignia RequestInsignia { get; set; }
|
public Insignia RequestInsignia { get; set; }
|
||||||
public InsigniaNote InsigniaNote { get; set; }
|
public InsigniaNote InsigniaNote { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,9 @@ namespace BMA.EHR.Domain.Models.Insignias
|
||||||
|
|
||||||
public InsigniaPeriod Period { get; set; }
|
public InsigniaPeriod Period { get; set; }
|
||||||
|
|
||||||
public OrganizationEntity Organization { get; set; }
|
//public OrganizationEntity Organization { get; set; }
|
||||||
[Comment("Fk Id Document")]
|
public Guid OrganizationId { get; set; }
|
||||||
|
|
||||||
public Document? Document { get; set; }
|
public Document? Document { get; set; }
|
||||||
|
|
||||||
public virtual List<InsigniaRequestProfile> RequestProfiles { get; set; } = new List<InsigniaRequestProfile>();
|
public virtual List<InsigniaRequestProfile> RequestProfiles { get; set; } = new List<InsigniaRequestProfile>();
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,9 @@ namespace BMA.EHR.Domain.Models.Insignias
|
||||||
[Comment("แจ้งเตือน ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)")]
|
[Comment("แจ้งเตือน ผลการประเมินการปฏิบัติราชการในรอบ 5 ปี ต่ำกว่าระดับดี (น้อยกว่าร้อยละ 70)")]
|
||||||
public bool? MarkRate { get; set; } = false;
|
public bool? MarkRate { get; set; } = false;
|
||||||
|
|
||||||
public Profile Profile { get; set; }
|
//public Profile Profile { get; set; }
|
||||||
|
public Guid ProfileId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public Insignia RequestInsignia { get; set; }
|
public Insignia RequestInsignia { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ namespace BMA.EHR.Domain.Models.Organizations
|
||||||
{
|
{
|
||||||
public OrganizationPositionEntity? OrganizationPosition { get; set; }
|
public OrganizationPositionEntity? OrganizationPosition { get; set; }
|
||||||
|
|
||||||
public Profile? Profile { get; set; }
|
public Profile? Profile { get; set; }
|
||||||
|
|
||||||
public bool IsActive { get; set; } = true;
|
public bool IsActive { get; set; } = true;
|
||||||
public bool IsPublished { get; set; } = true;
|
public bool IsPublished { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17926
BMA.EHR.Infrastructure/Migrations/20240624034856_Change Org Link to GUID.Designer.cs
generated
Normal file
17926
BMA.EHR.Infrastructure/Migrations/20240624034856_Change Org Link to GUID.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,153 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class ChangeOrgLinktoGUID : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_InsigniaManageOrganiations_OrganizationOrganizations_Organiz~",
|
||||||
|
table: "InsigniaManageOrganiations");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_InsigniaManageProfiles_OrganizationOrganizations_BorrowOrgan~",
|
||||||
|
table: "InsigniaManageProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_InsigniaManageProfiles_OrganizationOrganizations_ReturnOrgan~",
|
||||||
|
table: "InsigniaManageProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_InsigniaManageProfiles_BorrowOrganizationId",
|
||||||
|
table: "InsigniaManageProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_InsigniaManageProfiles_ReturnOrganizationId",
|
||||||
|
table: "InsigniaManageProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_InsigniaManageOrganiations_OrganizationOrganizationId",
|
||||||
|
table: "InsigniaManageOrganiations");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "OrganizationOrganizationId",
|
||||||
|
table: "InsigniaManageOrganiations");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "ReturnOrganizationId",
|
||||||
|
table: "InsigniaManageProfiles",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
comment: "Fk Table OrganizationOrganization Return",
|
||||||
|
collation: "ascii_general_ci",
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "char(36)",
|
||||||
|
oldNullable: true)
|
||||||
|
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "BorrowOrganizationId",
|
||||||
|
table: "InsigniaManageProfiles",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
comment: "Fk Table OrganizationOrganization Borrow",
|
||||||
|
collation: "ascii_general_ci",
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "char(36)",
|
||||||
|
oldNullable: true)
|
||||||
|
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "OrganizationId",
|
||||||
|
table: "InsigniaManageOrganiations",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
comment: "รหัสหน่วยงาน",
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "OrganizationId",
|
||||||
|
table: "InsigniaManageOrganiations");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "ReturnOrganizationId",
|
||||||
|
table: "InsigniaManageProfiles",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci",
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "char(36)",
|
||||||
|
oldNullable: true,
|
||||||
|
oldComment: "Fk Table OrganizationOrganization Return")
|
||||||
|
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "BorrowOrganizationId",
|
||||||
|
table: "InsigniaManageProfiles",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci",
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "char(36)",
|
||||||
|
oldNullable: true,
|
||||||
|
oldComment: "Fk Table OrganizationOrganization Borrow")
|
||||||
|
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "OrganizationOrganizationId",
|
||||||
|
table: "InsigniaManageOrganiations",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_InsigniaManageProfiles_BorrowOrganizationId",
|
||||||
|
table: "InsigniaManageProfiles",
|
||||||
|
column: "BorrowOrganizationId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_InsigniaManageProfiles_ReturnOrganizationId",
|
||||||
|
table: "InsigniaManageProfiles",
|
||||||
|
column: "ReturnOrganizationId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_InsigniaManageOrganiations_OrganizationOrganizationId",
|
||||||
|
table: "InsigniaManageOrganiations",
|
||||||
|
column: "OrganizationOrganizationId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_InsigniaManageOrganiations_OrganizationOrganizations_Organiz~",
|
||||||
|
table: "InsigniaManageOrganiations",
|
||||||
|
column: "OrganizationOrganizationId",
|
||||||
|
principalTable: "OrganizationOrganizations",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_InsigniaManageProfiles_OrganizationOrganizations_BorrowOrgan~",
|
||||||
|
table: "InsigniaManageProfiles",
|
||||||
|
column: "BorrowOrganizationId",
|
||||||
|
principalTable: "OrganizationOrganizations",
|
||||||
|
principalColumn: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_InsigniaManageProfiles_OrganizationOrganizations_ReturnOrgan~",
|
||||||
|
table: "InsigniaManageProfiles",
|
||||||
|
column: "ReturnOrganizationId",
|
||||||
|
principalTable: "OrganizationOrganizations",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
17900
BMA.EHR.Infrastructure/Migrations/20240624175204_Change insignia profile Link to GUID.Designer.cs
generated
Normal file
17900
BMA.EHR.Infrastructure/Migrations/20240624175204_Change insignia profile Link to GUID.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,149 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class ChangeinsigniaprofileLinktoGUID : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_InsigniaNoteProfiles_Profiles_ProfileId",
|
||||||
|
table: "InsigniaNoteProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_InsigniaRequestProfiles_Profiles_ProfileId",
|
||||||
|
table: "InsigniaRequestProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_InsigniaRequests_Organizations_OrganizationId",
|
||||||
|
table: "InsigniaRequests");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_ProfileInsignias_Profiles_ProfileId",
|
||||||
|
table: "ProfileInsignias");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_InsigniaRequests_OrganizationId",
|
||||||
|
table: "InsigniaRequests");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_InsigniaRequestProfiles_ProfileId",
|
||||||
|
table: "InsigniaRequestProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_InsigniaNoteProfiles_ProfileId",
|
||||||
|
table: "InsigniaNoteProfiles");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "ProfileId",
|
||||||
|
table: "ProfileInsignias",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
collation: "ascii_general_ci",
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "char(36)",
|
||||||
|
oldNullable: true)
|
||||||
|
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "ProfileId",
|
||||||
|
table: "InsigniaNoteProfiles",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci",
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "char(36)")
|
||||||
|
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_ProfileInsignias_Profiles_ProfileId",
|
||||||
|
table: "ProfileInsignias",
|
||||||
|
column: "ProfileId",
|
||||||
|
principalTable: "Profiles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_ProfileInsignias_Profiles_ProfileId",
|
||||||
|
table: "ProfileInsignias");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "ProfileId",
|
||||||
|
table: "ProfileInsignias",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci",
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "char(36)")
|
||||||
|
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "ProfileId",
|
||||||
|
table: "InsigniaNoteProfiles",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
collation: "ascii_general_ci",
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "char(36)",
|
||||||
|
oldNullable: true)
|
||||||
|
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_InsigniaRequests_OrganizationId",
|
||||||
|
table: "InsigniaRequests",
|
||||||
|
column: "OrganizationId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_InsigniaRequestProfiles_ProfileId",
|
||||||
|
table: "InsigniaRequestProfiles",
|
||||||
|
column: "ProfileId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_InsigniaNoteProfiles_ProfileId",
|
||||||
|
table: "InsigniaNoteProfiles",
|
||||||
|
column: "ProfileId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_InsigniaNoteProfiles_Profiles_ProfileId",
|
||||||
|
table: "InsigniaNoteProfiles",
|
||||||
|
column: "ProfileId",
|
||||||
|
principalTable: "Profiles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_InsigniaRequestProfiles_Profiles_ProfileId",
|
||||||
|
table: "InsigniaRequestProfiles",
|
||||||
|
column: "ProfileId",
|
||||||
|
principalTable: "Profiles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_InsigniaRequests_Organizations_OrganizationId",
|
||||||
|
table: "InsigniaRequests",
|
||||||
|
column: "OrganizationId",
|
||||||
|
principalTable: "Organizations",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_ProfileInsignias_Profiles_ProfileId",
|
||||||
|
table: "ProfileInsignias",
|
||||||
|
column: "ProfileId",
|
||||||
|
principalTable: "Profiles",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3983,7 +3983,7 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.HasColumnType("varchar(30)")
|
.HasColumnType("varchar(30)")
|
||||||
.HasComment("หน้า");
|
.HasComment("หน้า");
|
||||||
|
|
||||||
b.Property<Guid?>("ProfileId")
|
b.Property<Guid>("ProfileId")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.Property<DateTime?>("ReceiveDate")
|
b.Property<DateTime?>("ReceiveDate")
|
||||||
|
|
@ -5755,8 +5755,9 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.HasColumnOrder(102)
|
.HasColumnOrder(102)
|
||||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||||
|
|
||||||
b.Property<Guid>("OrganizationOrganizationId")
|
b.Property<Guid>("OrganizationId")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("รหัสหน่วยงาน");
|
||||||
|
|
||||||
b.Property<int>("Total")
|
b.Property<int>("Total")
|
||||||
.HasColumnType("int")
|
.HasColumnType("int")
|
||||||
|
|
@ -5766,8 +5767,6 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
|
||||||
b.HasIndex("InsigniaManageId");
|
b.HasIndex("InsigniaManageId");
|
||||||
|
|
||||||
b.HasIndex("OrganizationOrganizationId");
|
|
||||||
|
|
||||||
b.ToTable("InsigniaManageOrganiations");
|
b.ToTable("InsigniaManageOrganiations");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -5785,7 +5784,8 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.HasComment("ยืมวันที่");
|
.HasComment("ยืมวันที่");
|
||||||
|
|
||||||
b.Property<Guid?>("BorrowOrganizationId")
|
b.Property<Guid?>("BorrowOrganizationId")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("Fk Table OrganizationOrganization Borrow");
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
b.Property<DateTime>("CreatedAt")
|
||||||
.HasColumnType("datetime(6)")
|
.HasColumnType("datetime(6)")
|
||||||
|
|
@ -5836,7 +5836,8 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.HasComment("คืนวันที่");
|
.HasComment("คืนวันที่");
|
||||||
|
|
||||||
b.Property<Guid?>("ReturnOrganizationId")
|
b.Property<Guid?>("ReturnOrganizationId")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)")
|
||||||
|
.HasComment("Fk Table OrganizationOrganization Return");
|
||||||
|
|
||||||
b.Property<string>("ReturnReason")
|
b.Property<string>("ReturnReason")
|
||||||
.HasColumnType("longtext")
|
.HasColumnType("longtext")
|
||||||
|
|
@ -5848,14 +5849,10 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("BorrowOrganizationId");
|
|
||||||
|
|
||||||
b.HasIndex("InsigniaManageOrganiationId");
|
b.HasIndex("InsigniaManageOrganiationId");
|
||||||
|
|
||||||
b.HasIndex("InsigniaNoteProfileId");
|
b.HasIndex("InsigniaNoteProfileId");
|
||||||
|
|
||||||
b.HasIndex("ReturnOrganizationId");
|
|
||||||
|
|
||||||
b.ToTable("InsigniaManageProfiles");
|
b.ToTable("InsigniaManageProfiles");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -6097,7 +6094,7 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.HasColumnType("longtext")
|
.HasColumnType("longtext")
|
||||||
.HasComment("หน้าที่");
|
.HasComment("หน้าที่");
|
||||||
|
|
||||||
b.Property<Guid>("ProfileId")
|
b.Property<Guid?>("ProfileId")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.Property<DateTime?>("RequestDate")
|
b.Property<DateTime?>("RequestDate")
|
||||||
|
|
@ -6138,8 +6135,6 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
|
||||||
b.HasIndex("OrgReturnInsigniaId");
|
b.HasIndex("OrgReturnInsigniaId");
|
||||||
|
|
||||||
b.HasIndex("ProfileId");
|
|
||||||
|
|
||||||
b.HasIndex("RequestInsigniaId");
|
b.HasIndex("RequestInsigniaId");
|
||||||
|
|
||||||
b.ToTable("InsigniaNoteProfiles");
|
b.ToTable("InsigniaNoteProfiles");
|
||||||
|
|
@ -6310,8 +6305,6 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
b.HasIndex("DocumentId");
|
||||||
|
|
||||||
b.HasIndex("OrganizationId");
|
|
||||||
|
|
||||||
b.HasIndex("PeriodId");
|
b.HasIndex("PeriodId");
|
||||||
|
|
||||||
b.ToTable("InsigniaRequests");
|
b.ToTable("InsigniaRequests");
|
||||||
|
|
@ -6413,8 +6406,6 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("ProfileId");
|
|
||||||
|
|
||||||
b.HasIndex("RequestId");
|
b.HasIndex("RequestId");
|
||||||
|
|
||||||
b.HasIndex("RequestInsigniaId");
|
b.HasIndex("RequestInsigniaId");
|
||||||
|
|
@ -16445,13 +16436,13 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("InsigniaId");
|
.HasForeignKey("InsigniaId");
|
||||||
|
|
||||||
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
|
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", null)
|
||||||
.WithMany("Insignias")
|
.WithMany("Insignias")
|
||||||
.HasForeignKey("ProfileId");
|
.HasForeignKey("ProfileId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
b.Navigation("Insignia");
|
b.Navigation("Insignia");
|
||||||
|
|
||||||
b.Navigation("Profile");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.HR.ProfileInsigniaHistory", b =>
|
||||||
|
|
@ -16651,23 +16642,11 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "OrganizationOrganization")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("OrganizationOrganizationId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("InsigniaManage");
|
b.Navigation("InsigniaManage");
|
||||||
|
|
||||||
b.Navigation("OrganizationOrganization");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManageProfile", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManageProfile", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "BorrowOrganization")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("BorrowOrganizationId");
|
|
||||||
|
|
||||||
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaManageOrganiation", "InsigniaManageOrganiation")
|
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaManageOrganiation", "InsigniaManageOrganiation")
|
||||||
.WithMany("InsigniaManageProfiles")
|
.WithMany("InsigniaManageProfiles")
|
||||||
.HasForeignKey("InsigniaManageOrganiationId")
|
.HasForeignKey("InsigniaManageOrganiationId")
|
||||||
|
|
@ -16680,17 +16659,9 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("BMA.EHR.Domain.Models.MetaData.OrganizationOrganization", "ReturnOrganization")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ReturnOrganizationId");
|
|
||||||
|
|
||||||
b.Navigation("BorrowOrganization");
|
|
||||||
|
|
||||||
b.Navigation("InsigniaManageOrganiation");
|
b.Navigation("InsigniaManageOrganiation");
|
||||||
|
|
||||||
b.Navigation("InsigniaNoteProfile");
|
b.Navigation("InsigniaNoteProfile");
|
||||||
|
|
||||||
b.Navigation("ReturnOrganization");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaNoteDoc", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaNoteDoc", b =>
|
||||||
|
|
@ -16736,12 +16707,6 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("OrgReturnInsigniaId");
|
.HasForeignKey("OrgReturnInsigniaId");
|
||||||
|
|
||||||
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ProfileId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("BMA.EHR.Domain.Models.MetaData.Insignia", "RequestInsignia")
|
b.HasOne("BMA.EHR.Domain.Models.MetaData.Insignia", "RequestInsignia")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("RequestInsigniaId")
|
.HasForeignKey("RequestInsigniaId")
|
||||||
|
|
@ -16758,8 +16723,6 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
|
||||||
b.Navigation("OrgReturnInsignia");
|
b.Navigation("OrgReturnInsignia");
|
||||||
|
|
||||||
b.Navigation("Profile");
|
|
||||||
|
|
||||||
b.Navigation("RequestInsignia");
|
b.Navigation("RequestInsignia");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -16778,12 +16741,6 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("DocumentId");
|
.HasForeignKey("DocumentId");
|
||||||
|
|
||||||
b.HasOne("BMA.EHR.Domain.Models.Organizations.OrganizationEntity", "Organization")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("OrganizationId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaPeriod", "Period")
|
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaPeriod", "Period")
|
||||||
.WithMany("InsigniaRequests")
|
.WithMany("InsigniaRequests")
|
||||||
.HasForeignKey("PeriodId")
|
.HasForeignKey("PeriodId")
|
||||||
|
|
@ -16792,19 +16749,11 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
|
||||||
b.Navigation("Document");
|
b.Navigation("Document");
|
||||||
|
|
||||||
b.Navigation("Organization");
|
|
||||||
|
|
||||||
b.Navigation("Period");
|
b.Navigation("Period");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaRequestProfile", b =>
|
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaRequestProfile", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("BMA.EHR.Domain.Models.HR.Profile", "Profile")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ProfileId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaRequest", "Request")
|
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaRequest", "Request")
|
||||||
.WithMany("RequestProfiles")
|
.WithMany("RequestProfiles")
|
||||||
.HasForeignKey("RequestId")
|
.HasForeignKey("RequestId")
|
||||||
|
|
@ -16817,8 +16766,6 @@ namespace BMA.EHR.Infrastructure.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.Navigation("Profile");
|
|
||||||
|
|
||||||
b.Navigation("Request");
|
b.Navigation("Request");
|
||||||
|
|
||||||
b.Navigation("RequestInsignia");
|
b.Navigation("RequestInsignia");
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ using BMA.EHR.Domain.Models.Commands.Core;
|
||||||
using BMA.EHR.Domain.Models.Documents;
|
using BMA.EHR.Domain.Models.Documents;
|
||||||
using BMA.EHR.Domain.Models.HR;
|
using BMA.EHR.Domain.Models.HR;
|
||||||
using BMA.EHR.Domain.Models.Insignias;
|
using BMA.EHR.Domain.Models.Insignias;
|
||||||
using BMA.EHR.Domain.Models.Leave;
|
|
||||||
using BMA.EHR.Domain.Models.MetaData;
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
using BMA.EHR.Domain.Models.Notifications;
|
using BMA.EHR.Domain.Models.Notifications;
|
||||||
using BMA.EHR.Domain.Models.OrganizationEmployee;
|
using BMA.EHR.Domain.Models.OrganizationEmployee;
|
||||||
|
|
|
||||||
|
|
@ -28,18 +28,21 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
private readonly InsigniaPeriodsRepository _repository;
|
private readonly InsigniaPeriodsRepository _repository;
|
||||||
private readonly NotificationRepository _repositoryNoti;
|
private readonly NotificationRepository _repositoryNoti;
|
||||||
|
private readonly UserProfileRepository _userProfileRepository;
|
||||||
|
|
||||||
public InsigniaManageController(ApplicationDBContext context,
|
public InsigniaManageController(ApplicationDBContext context,
|
||||||
MinIOService documentService,
|
MinIOService documentService,
|
||||||
InsigniaPeriodsRepository repository,
|
InsigniaPeriodsRepository repository,
|
||||||
NotificationRepository repositoryNoti,
|
NotificationRepository repositoryNoti,
|
||||||
IHttpContextAccessor httpContextAccessor)
|
IHttpContextAccessor httpContextAccessor,
|
||||||
|
UserProfileRepository userProfileRepository)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_documentService = documentService;
|
_documentService = documentService;
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
_repositoryNoti = repositoryNoti;
|
_repositoryNoti = repositoryNoti;
|
||||||
_httpContextAccessor = httpContextAccessor;
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
_userProfileRepository = userProfileRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region " Properties "
|
#region " Properties "
|
||||||
|
|
@ -48,6 +51,8 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
|
|
||||||
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
|
||||||
|
private string? AccessToken => _httpContextAccessor?.HttpContext?.Request.Headers["Authorization"];
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -246,7 +251,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
.Select(p => new
|
.Select(p => new
|
||||||
{
|
{
|
||||||
Id = p.Id,
|
Id = p.Id,
|
||||||
OrganizationOrganization = p.OrganizationOrganization.Name,
|
OrganizationOrganization = _userProfileRepository.GetOc(p.OrganizationId, 0, AccessToken) == null ? "" : _userProfileRepository.GetOc(p.OrganizationId, 0, AccessToken)!.Root,
|
||||||
Total = p.Total,
|
Total = p.Total,
|
||||||
Allocate = p.InsigniaManageProfiles.Where(x => x.Status == false).Count(),
|
Allocate = p.InsigniaManageProfiles.Where(x => x.Status == false).Count(),
|
||||||
Remain = p.Total - p.InsigniaManageProfiles.Where(x => x.Status == false).Count(),
|
Remain = p.Total - p.InsigniaManageProfiles.Where(x => x.Status == false).Count(),
|
||||||
|
|
@ -254,8 +259,6 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
CreatedAt = p.CreatedAt,
|
CreatedAt = p.CreatedAt,
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
// if (insigniaManageOrg == null)
|
|
||||||
// return Error(GlobalMessages.InsigniaManageOrgNotFound);
|
|
||||||
return Success(insigniaManageOrg);
|
return Success(insigniaManageOrg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -270,33 +273,37 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
[HttpPost("org")]
|
[HttpPost("org")]
|
||||||
public async Task<ActionResult<ResponseObject>> PostOrganization([FromBody] InsigniaManageOrganizationRequest req)
|
public async Task<ActionResult<ResponseObject>> PostOrganization([FromBody] InsigniaManageOrganizationRequest req)
|
||||||
{
|
{
|
||||||
var organization = await _context.Organizations.AsQueryable()
|
|
||||||
.Include(x => x.OrganizationOrganization)
|
var organization = _userProfileRepository.GetOc(req.OrganizationOrganizationId, 0, AccessToken);
|
||||||
.FirstOrDefaultAsync(x => x.Id == req.OrganizationOrganizationId);
|
|
||||||
|
//var organization = await _context.Organizations.AsQueryable()
|
||||||
|
// .Include(x => x.OrganizationOrganization)
|
||||||
|
// .FirstOrDefaultAsync(x => x.Id == req.OrganizationOrganizationId);
|
||||||
if (organization == null)
|
if (organization == null)
|
||||||
return Error(GlobalMessages.OrganizationNotFound);
|
return Error(GlobalMessages.OrganizationNotFound);
|
||||||
if (organization.OrganizationOrganization == null)
|
//if (organization.OrganizationOrganization == null)
|
||||||
return Error(GlobalMessages.OrganizationNotFound);
|
// return Error(GlobalMessages.OrganizationNotFound);
|
||||||
|
|
||||||
var insigniaManage = await _context.InsigniaManages.AsQueryable()
|
var insigniaManage = await _context.InsigniaManages.AsQueryable()
|
||||||
.Include(x => x.InsigniaManageOrganiations)
|
.Include(x => x.InsigniaManageOrganiations)
|
||||||
.ThenInclude(x => x.OrganizationOrganization)
|
//.ThenInclude(x => x.OrganizationOrganization)
|
||||||
.FirstOrDefaultAsync(x => x.Id == req.insigniaManageId);
|
.FirstOrDefaultAsync(x => x.Id == req.insigniaManageId);
|
||||||
if (insigniaManage == null)
|
if (insigniaManage == null)
|
||||||
return Error(GlobalMessages.InsigniaManageNotFound);
|
return Error(GlobalMessages.InsigniaManageNotFound);
|
||||||
|
|
||||||
var insigniaManageOrganiation = await _context.InsigniaManageOrganiations.AsQueryable()
|
var insigniaManageOrganiation = await _context.InsigniaManageOrganiations.AsQueryable()
|
||||||
.FirstOrDefaultAsync(x => x.OrganizationOrganization == organization.OrganizationOrganization && x.InsigniaManage == insigniaManage);
|
.FirstOrDefaultAsync(x => x.OrganizationId == organization.RootId && x.InsigniaManage == insigniaManage);
|
||||||
if (insigniaManageOrganiation != null)
|
if (insigniaManageOrganiation != null)
|
||||||
return Error(GlobalMessages.InsigniaManageOrgDupicate);
|
return Error(GlobalMessages.InsigniaManageOrgDupicate);
|
||||||
|
|
||||||
var total = insigniaManage.InsigniaManageOrganiations.Where(x => x.OrganizationOrganization != organization.OrganizationOrganization).Sum(x => x.Total);
|
var total = insigniaManage.InsigniaManageOrganiations.Where(x => x.OrganizationId != organization.RootId).Sum(x => x.Total);
|
||||||
if (req.Total + total > insigniaManage.Total)
|
if (req.Total + total > insigniaManage.Total)
|
||||||
return Error(GlobalMessages.InsigniaManageOrgLimit);
|
return Error(GlobalMessages.InsigniaManageOrgLimit);
|
||||||
await _context.InsigniaManageOrganiations.AddAsync(
|
await _context.InsigniaManageOrganiations.AddAsync(
|
||||||
new InsigniaManageOrganiation
|
new InsigniaManageOrganiation
|
||||||
{
|
{
|
||||||
OrganizationOrganization = organization.OrganizationOrganization,
|
//OrganizationOrganization = organization.OrganizationOrganization,
|
||||||
|
OrganizationId = organization.RootId ?? Guid.Empty,
|
||||||
Total = req.Total,
|
Total = req.Total,
|
||||||
InsigniaManage = insigniaManage,
|
InsigniaManage = insigniaManage,
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
|
@ -346,7 +353,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
public async Task<ActionResult<ResponseObject>> PutOrganization([FromBody] InsigniaManageOrganizationUpdateRequest req, Guid insigniaManageOrgId)
|
public async Task<ActionResult<ResponseObject>> PutOrganization([FromBody] InsigniaManageOrganizationUpdateRequest req, Guid insigniaManageOrgId)
|
||||||
{
|
{
|
||||||
var uppdated = await _context.InsigniaManageOrganiations.AsQueryable()
|
var uppdated = await _context.InsigniaManageOrganiations.AsQueryable()
|
||||||
.Include(x => x.OrganizationOrganization)
|
//.Include(x => x.OrganizationOrganization)
|
||||||
.Include(x => x.InsigniaManage)
|
.Include(x => x.InsigniaManage)
|
||||||
.FirstOrDefaultAsync(x => x.Id == insigniaManageOrgId);
|
.FirstOrDefaultAsync(x => x.Id == insigniaManageOrgId);
|
||||||
if (uppdated == null)
|
if (uppdated == null)
|
||||||
|
|
@ -354,7 +361,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
|
|
||||||
var insigniaManage = await _context.InsigniaManages.AsQueryable()
|
var insigniaManage = await _context.InsigniaManages.AsQueryable()
|
||||||
.Include(x => x.InsigniaManageOrganiations)
|
.Include(x => x.InsigniaManageOrganiations)
|
||||||
.ThenInclude(x => x.OrganizationOrganization)
|
//.ThenInclude(x => x.OrganizationOrganization)
|
||||||
.FirstOrDefaultAsync(x => x.Id == uppdated.InsigniaManage.Id);
|
.FirstOrDefaultAsync(x => x.Id == uppdated.InsigniaManage.Id);
|
||||||
if (insigniaManage == null)
|
if (insigniaManage == null)
|
||||||
return Error(GlobalMessages.InsigniaManageNotFound);
|
return Error(GlobalMessages.InsigniaManageNotFound);
|
||||||
|
|
@ -420,23 +427,25 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
var insigniaNoteProfile = await _context.InsigniaNoteProfiles.AsQueryable()
|
var insigniaNoteProfile = await _context.InsigniaNoteProfiles.AsQueryable()
|
||||||
.Include(x => x.RequestInsignia)
|
.Include(x => x.RequestInsignia)
|
||||||
.Include(x => x.InsigniaNote)
|
.Include(x => x.InsigniaNote)
|
||||||
.Include(x => x.Profile)
|
//.Include(x => x.Profile)
|
||||||
.FirstOrDefaultAsync(x => x.Id == req.InsigniaNoteProfileId);
|
.FirstOrDefaultAsync(x => x.Id == req.InsigniaNoteProfileId);
|
||||||
if (insigniaNoteProfile == null)
|
if (insigniaNoteProfile == null)
|
||||||
return Error(GlobalMessages.InsigniaRequestProfileNotFound);
|
return Error(GlobalMessages.InsigniaRequestProfileNotFound);
|
||||||
if (insigniaNoteProfile.Status != "DONE")
|
if (insigniaNoteProfile.Status != "DONE")
|
||||||
return Error(GlobalMessages.InsigniaNoBorrow);
|
return Error(GlobalMessages.InsigniaNoBorrow);
|
||||||
|
|
||||||
var _organization = await _context.Organizations.AsQueryable()
|
//var _organization = await _context.Organizations.AsQueryable()
|
||||||
.FirstOrDefaultAsync(x => x.Id == insigniaNoteProfile.Profile.OcId);
|
// .FirstOrDefaultAsync(x => x.Id == insigniaNoteProfile.Profile.OcId);
|
||||||
if (_organization == null)
|
|
||||||
return Error(GlobalMessages.OrganizationNotFound);
|
|
||||||
|
|
||||||
var organization = await _context.Organizations.AsQueryable()
|
var organization = _userProfileRepository.GetOc(req.BorrowOrganizationId.Value, 0, AccessToken);
|
||||||
.Include(x => x.OrganizationOrganization)
|
//if (organization == null)
|
||||||
.FirstOrDefaultAsync(x => x.Id == _organization.OrganizationAgencyId);
|
// return Error(GlobalMessages.OrganizationNotFound);
|
||||||
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()
|
var insigniaManage = await _context.InsigniaManages.AsQueryable()
|
||||||
.FirstOrDefaultAsync(x => x.Year == insigniaNoteProfile.InsigniaNote.Year && x.Insignia == insigniaNoteProfile.RequestInsignia);
|
.FirstOrDefaultAsync(x => x.Year == insigniaNoteProfile.InsigniaNote.Year && x.Insignia == insigniaNoteProfile.RequestInsignia);
|
||||||
|
|
@ -445,7 +454,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
|
|
||||||
var insigniaManageOrganiation = await _context.InsigniaManageOrganiations.AsQueryable()
|
var insigniaManageOrganiation = await _context.InsigniaManageOrganiations.AsQueryable()
|
||||||
.Include(x => x.InsigniaManageProfiles)
|
.Include(x => x.InsigniaManageProfiles)
|
||||||
.FirstOrDefaultAsync(x => x.OrganizationOrganization == organization.OrganizationOrganization && x.InsigniaManage == insigniaManage);
|
.FirstOrDefaultAsync(x => x.OrganizationId == organization.RootId && x.InsigniaManage == insigniaManage);
|
||||||
if (insigniaManageOrganiation == null)
|
if (insigniaManageOrganiation == null)
|
||||||
return Error(GlobalMessages.InsigniaManageOrgNotFound);
|
return Error(GlobalMessages.InsigniaManageOrgNotFound);
|
||||||
|
|
||||||
|
|
@ -462,7 +471,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
{
|
{
|
||||||
Status = false,
|
Status = false,
|
||||||
InsigniaManageOrganiation = insigniaManageOrganiation,
|
InsigniaManageOrganiation = insigniaManageOrganiation,
|
||||||
BorrowOrganization = organization.OrganizationOrganization,
|
BorrowOrganizationId = organization.RootId,
|
||||||
BorrowDate = req.BorrowDate,
|
BorrowDate = req.BorrowDate,
|
||||||
InsigniaNoteProfile = insigniaNoteProfile,
|
InsigniaNoteProfile = insigniaNoteProfile,
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
|
@ -492,7 +501,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
var uppdated = await _context.InsigniaManageProfiles.AsQueryable()
|
var uppdated = await _context.InsigniaManageProfiles.AsQueryable()
|
||||||
.Include(x => x.BorrowOrganization)
|
//.Include(x => x.BorrowOrganization)
|
||||||
.FirstOrDefaultAsync(x => x.Id == insigniaManageProfileId);
|
.FirstOrDefaultAsync(x => x.Id == insigniaManageProfileId);
|
||||||
if (uppdated == null)
|
if (uppdated == null)
|
||||||
return Error(GlobalMessages.InsigniaManageNotFound);
|
return Error(GlobalMessages.InsigniaManageNotFound);
|
||||||
|
|
@ -501,7 +510,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
uppdated.ReturnDate = req.ReturnDate;
|
uppdated.ReturnDate = req.ReturnDate;
|
||||||
// if (req.ReturnOrganizationId == Guid.Parse("00000000-0000-0000-0000-000000000000"))
|
// if (req.ReturnOrganizationId == Guid.Parse("00000000-0000-0000-0000-000000000000"))
|
||||||
// {
|
// {
|
||||||
uppdated.ReturnOrganization = uppdated.BorrowOrganization;
|
uppdated.ReturnOrganizationId = uppdated.BorrowOrganizationId;
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
|
|
@ -547,22 +556,22 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
{
|
{
|
||||||
Id = p.Id,
|
Id = p.Id,
|
||||||
Status = p.Status,
|
Status = p.Status,
|
||||||
BorrowOrganization = p.BorrowOrganization == null ? null : p.BorrowOrganization.Name,
|
BorrowOrganization = _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken) == null ? null : _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken).Root,
|
||||||
BorrowOrganizationId = p.BorrowOrganization == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.BorrowOrganization.Id,
|
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,
|
BorrowDate = p.BorrowDate,
|
||||||
ReturnDate = p.ReturnDate,
|
ReturnDate = p.ReturnDate,
|
||||||
ReturnOrganization = p.ReturnOrganization == null ? null : p.ReturnOrganization.Name,
|
ReturnOrganization = _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken) == null ? null : _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken).Root,
|
||||||
ReturnOrganizationId = p.ReturnOrganization == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.ReturnOrganization.Id,
|
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,
|
ReturnReason = p.ReturnReason,
|
||||||
LastUpdatedAt = p.LastUpdatedAt,
|
LastUpdatedAt = p.LastUpdatedAt,
|
||||||
CreatedAt = p.CreatedAt,
|
CreatedAt = p.CreatedAt,
|
||||||
|
|
||||||
InsigniaNoteProfileId = p.InsigniaNoteProfile.Id,
|
InsigniaNoteProfileId = p.InsigniaNoteProfile.Id,
|
||||||
Prefix = p.InsigniaNoteProfile.Profile.Prefix == null ? null : p.InsigniaNoteProfile.Profile.Prefix.Name,
|
Prefix = _userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).Prefix,
|
||||||
Position = p.InsigniaNoteProfile.Profile.Position == null ? null : p.InsigniaNoteProfile.Profile.Position.Name,
|
Position = _userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).Position,
|
||||||
p.InsigniaNoteProfile.Profile.CitizenId,
|
_userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).CitizenId,
|
||||||
p.InsigniaNoteProfile.Profile.ProfileType,
|
_userProfileRepository.GetOfficerProfileById(p.InsigniaNoteProfile.ProfileId.Value, AccessToken).ProfileType,
|
||||||
FullName = $"{(p.InsigniaNoteProfile.Profile.Prefix == null ? null : p.InsigniaNoteProfile.Profile.Prefix.Name)}{p.InsigniaNoteProfile.Profile.FirstName} {p.InsigniaNoteProfile.Profile.LastName}",
|
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,
|
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,
|
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,
|
RequestInsigniaShortName = p.InsigniaNoteProfile.RequestInsignia == null ? null : p.InsigniaNoteProfile.RequestInsignia.ShortName,
|
||||||
|
|
@ -604,12 +613,12 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
{
|
{
|
||||||
Id = p.Id,
|
Id = p.Id,
|
||||||
Status = p.Status,
|
Status = p.Status,
|
||||||
BorrowOrganization = p.BorrowOrganization == null ? null : p.BorrowOrganization.Name,
|
BorrowOrganization = _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken) == null ? null : _userProfileRepository.GetOc(p.BorrowOrganizationId!.Value, 0, AccessToken).Root,
|
||||||
BorrowOrganizationId = p.BorrowOrganization == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.BorrowOrganization.Id,
|
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,
|
BorrowDate = p.BorrowDate,
|
||||||
ReturnDate = p.ReturnDate,
|
ReturnDate = p.ReturnDate,
|
||||||
ReturnOrganization = p.ReturnOrganization == null ? null : p.ReturnOrganization.Name,
|
ReturnOrganization = _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken) == null ? null : _userProfileRepository.GetOc(p.ReturnOrganizationId!.Value, 0, AccessToken).Root,
|
||||||
ReturnOrganizationId = p.ReturnOrganization == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.ReturnOrganization.Id,
|
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,
|
ReturnReason = p.ReturnReason,
|
||||||
LastUpdatedAt = p.LastUpdatedAt,
|
LastUpdatedAt = p.LastUpdatedAt,
|
||||||
CreatedAt = p.CreatedAt,
|
CreatedAt = p.CreatedAt,
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -15,10 +15,10 @@
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
|
//"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.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;",
|
"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;",
|
||||||
"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;",
|
"ExamConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"LeaveConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"DisciplineConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
"DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
|
|
@ -39,5 +39,9 @@
|
||||||
"Hour": "08",
|
"Hour": "08",
|
||||||
"Minute": "00"
|
"Minute": "00"
|
||||||
},
|
},
|
||||||
"Protocol": "HTTPS"
|
"Protocol": "HTTPS",
|
||||||
|
"Node": {
|
||||||
|
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
||||||
|
},
|
||||||
|
"API": "https://bma-ehr.frappet.synology.me/api/v1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -893,7 +893,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
fullName = _userProfileRepository.GetUserFullName(p.Keycloak ?? Guid.Empty, AccessToken),
|
fullName = _userProfileRepository.GetUserFullName(p.Keycloak ?? Guid.Empty, AccessToken),
|
||||||
position = p.Position == null ? "" : p.Position,
|
position = p.Position == null ? "" : p.Position,
|
||||||
positionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
positionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
posNo = p.PosNo ?? "",
|
posNo = p.ProfileSalary == null ? "" : p.ProfileSalary.PosNo,
|
||||||
reason = "",
|
reason = "",
|
||||||
|
|
||||||
sickDayCount = sickDayCount,
|
sickDayCount = sickDayCount,
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
break;
|
break;
|
||||||
case "LV-008":
|
case "LV-008":
|
||||||
{
|
{
|
||||||
var lastSalary = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSalary = profile.ProfileSalary;
|
||||||
|
|
||||||
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
||||||
leaveRequest.LeaveSalaryText =
|
leaveRequest.LeaveSalaryText =
|
||||||
|
|
@ -273,7 +273,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
break;
|
break;
|
||||||
case "LV-010":
|
case "LV-010":
|
||||||
{
|
{
|
||||||
var lastSalary = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSalary = profile.ProfileSalary;
|
||||||
|
|
||||||
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
||||||
leaveRequest.LeaveSalaryText =
|
leaveRequest.LeaveSalaryText =
|
||||||
|
|
@ -479,7 +479,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
break;
|
break;
|
||||||
case "LV-008":
|
case "LV-008":
|
||||||
{
|
{
|
||||||
var lastSalary = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSalary = profile.ProfileSalary;
|
||||||
|
|
||||||
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
||||||
leaveRequest.LeaveSalaryText =
|
leaveRequest.LeaveSalaryText =
|
||||||
|
|
@ -499,7 +499,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
break;
|
break;
|
||||||
case "LV-010":
|
case "LV-010":
|
||||||
{
|
{
|
||||||
var lastSalary = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSalary = profile.ProfileSalary;
|
||||||
|
|
||||||
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
leaveRequest.LeaveSalary = lastSalary == null ? 0 : (int)lastSalary.Amount.Value;
|
||||||
leaveRequest.LeaveSalaryText =
|
leaveRequest.LeaveSalaryText =
|
||||||
|
|
@ -611,7 +611,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
var sumLeave = await _leaveRequestRepository.GetSumLeaveByTypeForUserAsync(userId, req.Type, thisYear);
|
var sumLeave = await _leaveRequestRepository.GetSumLeaveByTypeForUserAsync(userId, req.Type, thisYear);
|
||||||
var restOldDay = await _leaveRequestRepository.GetRestDayTotalByYearForUserAsync(userId, thisYear - 1);
|
var restOldDay = await _leaveRequestRepository.GetRestDayTotalByYearForUserAsync(userId, thisYear - 1);
|
||||||
|
|
||||||
var lastSalary = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSalary = profile.ProfileSalary;
|
||||||
|
|
||||||
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||||
var approver = string.Empty;
|
var approver = string.Empty;
|
||||||
|
|
@ -922,7 +922,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
||||||
var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
||||||
|
|
||||||
var lastSalary = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSalary = profile.ProfileSalary;
|
||||||
var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount ?? 0;
|
var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount ?? 0;
|
||||||
|
|
||||||
var lastLeaveRequest =
|
var lastLeaveRequest =
|
||||||
|
|
@ -1416,7 +1416,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
||||||
var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
||||||
|
|
||||||
var lastSalary = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault();
|
var lastSalary = profile.ProfileSalary;
|
||||||
var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount ?? 0;
|
var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount ?? 0;
|
||||||
|
|
||||||
var lastLeaveRequest =
|
var lastLeaveRequest =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue