Merge branch 'develop' into working
This commit is contained in:
commit
3bb92d337a
23 changed files with 1539 additions and 570 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -223,7 +223,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
||||||
}
|
}
|
||||||
if (IsSendMail == true)
|
if (IsSendMail == true)
|
||||||
{
|
{
|
||||||
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com");
|
var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId}";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
if (_res.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
|
||||||
|
if (org != null && org.result != null)
|
||||||
|
_emailSenderService.SendMail(Subject, Body, org.result);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
//}
|
//}
|
||||||
|
|
@ -250,25 +265,40 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
||||||
LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
LastUpdatedAt = DateTime.Now,
|
LastUpdatedAt = DateTime.Now,
|
||||||
});
|
});
|
||||||
/* if (IsSendInbox == true)
|
/* if (IsSendInbox == true)
|
||||||
{
|
{
|
||||||
_dbContext.Set<Inbox>().Add(new Inbox
|
_dbContext.Set<Inbox>().Add(new Inbox
|
||||||
{
|
{
|
||||||
Subject = Subject,
|
Subject = Subject,
|
||||||
Body = Body,
|
Body = Body,
|
||||||
ReceiverUserId = ReceiverUserId,
|
ReceiverUserId = ReceiverUserId,
|
||||||
Payload = Payload,
|
Payload = Payload,
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
CreatedUserId = UserId ?? "",
|
CreatedUserId = UserId ?? "",
|
||||||
CreatedAt = DateTime.Now,
|
CreatedAt = DateTime.Now,
|
||||||
LastUpdateFullName = FullName ?? "System Administrator",
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
LastUpdatedAt = DateTime.Now,
|
LastUpdatedAt = DateTime.Now,
|
||||||
});
|
});
|
||||||
}*/
|
}*/
|
||||||
if (IsSendMail == true)
|
if (IsSendMail == true)
|
||||||
{
|
{
|
||||||
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com");
|
var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId}";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
if (_res.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
|
||||||
|
if (org != null && org.result != null)
|
||||||
|
_emailSenderService.SendMail(Subject, Body, org.result);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
@ -327,7 +357,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
||||||
}
|
}
|
||||||
if (IsSendMail == true)
|
if (IsSendMail == true)
|
||||||
{
|
{
|
||||||
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com");
|
var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId}";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
if (_res.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
|
||||||
|
if (org != null && org.result != null)
|
||||||
|
_emailSenderService.SendMail(Subject, Body, org.result);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
|
|
@ -343,6 +388,11 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
||||||
public Guid ReceiverUserId { get; set; }
|
public Guid ReceiverUserId { get; set; }
|
||||||
public string NotiLink { get; set; }
|
public string NotiLink { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ResultRequest
|
||||||
|
{
|
||||||
|
public string result { get; set; }
|
||||||
|
}
|
||||||
public async Task PushNotificationsLinkAsync(NotisLinkRequest[] ReceiverUserIds, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false)
|
public async Task PushNotificationsLinkAsync(NotisLinkRequest[] ReceiverUserIds, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
@ -380,7 +430,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
||||||
}
|
}
|
||||||
if (IsSendMail == true)
|
if (IsSendMail == true)
|
||||||
{
|
{
|
||||||
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com");
|
var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId.ReceiverUserId}";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
if (_res.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
|
||||||
|
if (org != null && org.result != null)
|
||||||
|
_emailSenderService.SendMail(Subject, Body, org.result);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
|
|
@ -435,7 +500,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
||||||
}
|
}
|
||||||
if (data.IsSendMail == true)
|
if (data.IsSendMail == true)
|
||||||
{
|
{
|
||||||
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com");
|
var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{data.ReceiverUserId}";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
if (_res.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
|
||||||
|
if (org != null && org.result != null)
|
||||||
|
_emailSenderService.SendMail(Subject, Body, org.result);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
|
|
@ -482,7 +562,22 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
|
||||||
}
|
}
|
||||||
if (IsSendMail == true)
|
if (IsSendMail == true)
|
||||||
{
|
{
|
||||||
_emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com");
|
var apiUrl = $"{_configuration["API"]}/org/dotnet/email/{ReceiverUserId}";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
if (_res.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var org = JsonConvert.DeserializeObject<ResultRequest>(_result);
|
||||||
|
if (org != null && org.result != null)
|
||||||
|
_emailSenderService.SendMail(Subject, Body, org.result);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ namespace BMA.EHR.Application.Responses.Profiles
|
||||||
public Guid? LastUpdateUserId { get; set; }
|
public Guid? LastUpdateUserId { get; set; }
|
||||||
public string? CreatedFullName { get; set; }
|
public string? CreatedFullName { get; set; }
|
||||||
public string? LastUpdateFullName { get; set; }
|
public string? LastUpdateFullName { get; set; }
|
||||||
public string PosNo { get; set; } = string.Empty;
|
public string? PosNo { get; set; } = string.Empty;
|
||||||
|
|
||||||
public double? Amount { get; set; }
|
public double? Amount { get; set; }
|
||||||
|
|
||||||
|
|
@ -102,15 +102,15 @@ namespace BMA.EHR.Application.Responses.Profiles
|
||||||
|
|
||||||
public double? MouthSalaryAmount { get; set; }
|
public double? MouthSalaryAmount { get; set; }
|
||||||
|
|
||||||
public int Order { get; set; }
|
public int? Order { get; set; }
|
||||||
|
|
||||||
public DateTime? Date { get; set; }
|
public DateTime? Date { get; set; }
|
||||||
|
|
||||||
public string PositionLevel { get; set; } = string.Empty;
|
public string? PositionLevel { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string PositionType { get; set; } = string.Empty;
|
public string? PositionType { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string Position { get; set; } = string.Empty;
|
public string? Position { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1039,13 +1039,15 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new {
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
fullName = _null,
|
result.Add(new {
|
||||||
positionname = r.RemarkHorizontal,
|
fullName = _null,
|
||||||
positionno = _null,
|
positionname = r.RemarkHorizontal,
|
||||||
organizationname = _null,
|
positionno = _null,
|
||||||
salary = _null,
|
organizationname = _null,
|
||||||
});
|
salary = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,16 +14,16 @@
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"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=53636;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;",
|
//"DefaultConnection": "server=hrms.chin.in.th;user=root;password=adminVM123;port=53636;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;",
|
"DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;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;",
|
"ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;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;",
|
"LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;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;"
|
"DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
|
||||||
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr"
|
"Issuer": "https://hrms-id.chin.in.th/realms/hrms"
|
||||||
},
|
},
|
||||||
"EPPlus": {
|
"EPPlus": {
|
||||||
"ExcelPackage": {
|
"ExcelPackage": {
|
||||||
|
|
@ -42,9 +42,9 @@
|
||||||
},
|
},
|
||||||
"Protocol": "HTTPS",
|
"Protocol": "HTTPS",
|
||||||
"Node": {
|
"Node": {
|
||||||
"API": "https://bma-ehr.frappet.synology.me/api/v1/probation"
|
"API": "https://hrms.chin.in.th/api/v1/probation"
|
||||||
},
|
},
|
||||||
"API": "https://bma-ehr.frappet.synology.me/api/v1",
|
"API": "https://hrms.chin.in.th/api/v1",
|
||||||
"RabbitMQ": {
|
"RabbitMQ": {
|
||||||
"URL": "localhost",
|
"URL": "localhost",
|
||||||
"UserName": "frappet",
|
"UserName": "frappet",
|
||||||
|
|
|
||||||
97
BMA.EHR.MetaData.Service/Controllers/MainController.cs
Normal file
97
BMA.EHR.MetaData.Service/Controllers/MainController.cs
Normal file
|
|
@ -0,0 +1,97 @@
|
||||||
|
using BMA.EHR.Domain.Common;
|
||||||
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
|
using BMA.EHR.MetaData.Service.Request;
|
||||||
|
using BMA.EHR.MetaData.Service.Services;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
|
||||||
|
namespace BMA.EHR.MetaData.Service.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/v{version:apiVersion}/metadata/main")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
|
[ApiController]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[Authorize]
|
||||||
|
[SwaggerTag("จัดการข้อมูลตำแหน่ง เพื่อนำไปใช้งานในระบบ")]
|
||||||
|
public class MainController : BaseController
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly BloodGroupService _bloodGroupService;
|
||||||
|
private readonly EducationLevelService _educationLevelService;
|
||||||
|
private readonly GenderService _genderService;
|
||||||
|
private readonly ProvinceService _provinceService;
|
||||||
|
private readonly PrefixService _prefixService;
|
||||||
|
private readonly RelationshipService _relationshipService;
|
||||||
|
private readonly ReligionService _religionService;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destructor "
|
||||||
|
|
||||||
|
public MainController(
|
||||||
|
BloodGroupService bloodGroupService,
|
||||||
|
ProvinceService provinceService,
|
||||||
|
EducationLevelService educationLevelService,
|
||||||
|
GenderService genderService,
|
||||||
|
PrefixService prefixService,
|
||||||
|
RelationshipService relationshipService,
|
||||||
|
ReligionService religionService)
|
||||||
|
{
|
||||||
|
_bloodGroupService = bloodGroupService;
|
||||||
|
_provinceService = provinceService;
|
||||||
|
_educationLevelService = educationLevelService;
|
||||||
|
_genderService = genderService;
|
||||||
|
_prefixService = prefixService;
|
||||||
|
_relationshipService = relationshipService;
|
||||||
|
_religionService = religionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// อ่านข้อมูล ข้อมูลเกี่ยวกับบุคคล
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">อ่านข้อมูล ข้อมูลเกี่ยวกับบุคคล สำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("person")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetsMainPersonAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var bloodGroups = await _bloodGroupService.GetsAsync(showAll: false);
|
||||||
|
var provinces = await _provinceService.GetsAsync(showAll: false);
|
||||||
|
var educationLevels = await _educationLevelService.GetsAsync(showAll: false);
|
||||||
|
var genders = await _genderService.GetsAsync(showAll: false);
|
||||||
|
var prefixs = await _prefixService.GetsAsync(showAll: false);
|
||||||
|
var relationships = await _relationshipService.GetsAsync(showAll: false);
|
||||||
|
var religions = await _religionService.GetsAsync(showAll: false);
|
||||||
|
|
||||||
|
return Success(new
|
||||||
|
{
|
||||||
|
bloodGroups,
|
||||||
|
provinces,
|
||||||
|
educationLevels,
|
||||||
|
genders,
|
||||||
|
prefixs,
|
||||||
|
relationships,
|
||||||
|
religions,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -89,6 +89,14 @@ var builder = WebApplication.CreateBuilder(args);
|
||||||
builder.Services.AddTransient<PositionPathService>();
|
builder.Services.AddTransient<PositionPathService>();
|
||||||
builder.Services.AddTransient<PositionPathSideService>();
|
builder.Services.AddTransient<PositionPathSideService>();
|
||||||
builder.Services.AddTransient<PositionTypeService>();
|
builder.Services.AddTransient<PositionTypeService>();
|
||||||
|
|
||||||
|
builder.Services.AddTransient<BloodGroupService>();
|
||||||
|
builder.Services.AddTransient<EducationLevelService>();
|
||||||
|
builder.Services.AddTransient<GenderService>();
|
||||||
|
builder.Services.AddTransient<ProvinceService>();
|
||||||
|
builder.Services.AddTransient<PrefixService>();
|
||||||
|
builder.Services.AddTransient<RelationshipService>();
|
||||||
|
builder.Services.AddTransient<ReligionService>();
|
||||||
builder.Services.AddControllers(options =>
|
builder.Services.AddControllers(options =>
|
||||||
{
|
{
|
||||||
options.SuppressAsyncSuffixInActionNames = false;
|
options.SuppressAsyncSuffixInActionNames = false;
|
||||||
|
|
|
||||||
92
BMA.EHR.MetaData.Service/Services/BloodGroupService.cs
Normal file
92
BMA.EHR.MetaData.Service/Services/BloodGroupService.cs
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
namespace BMA.EHR.MetaData.Service.Services
|
||||||
|
{
|
||||||
|
public class BloodGroupService
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ApplicationDBContext _context;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
private readonly ILogger<BloodGroupService> _logger;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destructor "
|
||||||
|
|
||||||
|
public BloodGroupService(ApplicationDBContext context,
|
||||||
|
IHttpContextAccessor httpContextAccessor,
|
||||||
|
ILogger<BloodGroupService> logger)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||||
|
|
||||||
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task<IEnumerable<BloodGroup>> GetsAsync(bool showAll = true)
|
||||||
|
{
|
||||||
|
if (showAll)
|
||||||
|
return await _context.BloodGroups.AsQueryable()
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
else
|
||||||
|
return await _context.BloodGroups.AsQueryable()
|
||||||
|
.Where(p => p.IsActive)
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<BloodGroup?> GetByIdAsync(Guid id)
|
||||||
|
{
|
||||||
|
return await _context.BloodGroups.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAsync(Guid id, BloodGroup updated)
|
||||||
|
{
|
||||||
|
var existData = await _context.BloodGroups.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (existData != null)
|
||||||
|
{
|
||||||
|
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
|
||||||
|
{
|
||||||
|
existData.Name = updated.Name;
|
||||||
|
existData.IsActive = updated.IsActive;
|
||||||
|
existData.LastUpdatedAt = DateTime.Now;
|
||||||
|
existData.LastUpdateUserId = UserId ?? "";
|
||||||
|
existData.LastUpdateFullName = FullName ?? "";
|
||||||
|
}
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task CreateAsync(BloodGroup inserted)
|
||||||
|
{
|
||||||
|
inserted.CreatedUserId = UserId ?? "";
|
||||||
|
inserted.CreatedFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.CreatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.LastUpdateUserId = UserId ?? "";
|
||||||
|
|
||||||
|
await _context.BloodGroups.AddAsync(inserted);
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
90
BMA.EHR.MetaData.Service/Services/EducationLevelService.cs
Normal file
90
BMA.EHR.MetaData.Service/Services/EducationLevelService.cs
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BMA.EHR.MetaData.Service.Services
|
||||||
|
{
|
||||||
|
public class EducationLevelService
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ApplicationDBContext _context;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destructor "
|
||||||
|
|
||||||
|
public EducationLevelService(ApplicationDBContext context,
|
||||||
|
IHttpContextAccessor httpContextAccessor)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||||
|
|
||||||
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task<IEnumerable<EducationLevel>> GetsAsync(bool showAll = true)
|
||||||
|
{
|
||||||
|
if (showAll)
|
||||||
|
return await _context.EducationLevels.AsQueryable()
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
else
|
||||||
|
return await _context.EducationLevels.AsQueryable()
|
||||||
|
.Where(p => p.IsActive)
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<EducationLevel?> GetByIdAsync(Guid id)
|
||||||
|
{
|
||||||
|
return await _context.EducationLevels.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAsync(Guid id, EducationLevel updated)
|
||||||
|
{
|
||||||
|
var existData = await _context.EducationLevels.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (existData != null)
|
||||||
|
{
|
||||||
|
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
|
||||||
|
{
|
||||||
|
existData.Name = updated.Name;
|
||||||
|
existData.IsActive = updated.IsActive;
|
||||||
|
existData.LastUpdatedAt = DateTime.Now;
|
||||||
|
existData.LastUpdateUserId = UserId ?? "";
|
||||||
|
existData.LastUpdateFullName = FullName ?? "";
|
||||||
|
}
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task CreateAsync(EducationLevel inserted)
|
||||||
|
{
|
||||||
|
inserted.CreatedUserId = UserId ?? "";
|
||||||
|
inserted.CreatedFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.CreatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.LastUpdateUserId = UserId ?? "";
|
||||||
|
|
||||||
|
await _context.EducationLevels.AddAsync(inserted);
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
90
BMA.EHR.MetaData.Service/Services/GenderService.cs
Normal file
90
BMA.EHR.MetaData.Service/Services/GenderService.cs
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BMA.EHR.MetaData.Service.Services
|
||||||
|
{
|
||||||
|
public class GenderService
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ApplicationDBContext _context;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destructor "
|
||||||
|
|
||||||
|
public GenderService(ApplicationDBContext context,
|
||||||
|
IHttpContextAccessor httpContextAccessor)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||||
|
|
||||||
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task<IEnumerable<Gender>> GetsAsync(bool showAll = true)
|
||||||
|
{
|
||||||
|
if (showAll)
|
||||||
|
return await _context.Genders.AsQueryable()
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
else
|
||||||
|
return await _context.Genders.AsQueryable()
|
||||||
|
.Where(p => p.IsActive)
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Gender?> GetByIdAsync(Guid id)
|
||||||
|
{
|
||||||
|
return await _context.Genders.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAsync(Guid id, Gender updated)
|
||||||
|
{
|
||||||
|
var existData = await _context.Genders.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (existData != null)
|
||||||
|
{
|
||||||
|
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
|
||||||
|
{
|
||||||
|
existData.Name = updated.Name;
|
||||||
|
existData.IsActive = updated.IsActive;
|
||||||
|
existData.LastUpdatedAt = DateTime.Now;
|
||||||
|
existData.LastUpdateUserId = UserId ?? "";
|
||||||
|
existData.LastUpdateFullName = FullName ?? "";
|
||||||
|
}
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task CreateAsync(Gender inserted)
|
||||||
|
{
|
||||||
|
inserted.CreatedUserId = UserId ?? "";
|
||||||
|
inserted.CreatedFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.CreatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.LastUpdateUserId = UserId ?? "";
|
||||||
|
|
||||||
|
await _context.Genders.AddAsync(inserted);
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
90
BMA.EHR.MetaData.Service/Services/PrefixService.cs
Normal file
90
BMA.EHR.MetaData.Service/Services/PrefixService.cs
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BMA.EHR.MetaData.Service.Services
|
||||||
|
{
|
||||||
|
public class PrefixService
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ApplicationDBContext _context;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destructor "
|
||||||
|
|
||||||
|
public PrefixService(ApplicationDBContext context,
|
||||||
|
IHttpContextAccessor httpContextAccessor)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||||
|
|
||||||
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task<IEnumerable<Prefix>> GetsAsync(bool showAll = true)
|
||||||
|
{
|
||||||
|
if (showAll)
|
||||||
|
return await _context.Prefixes.AsQueryable()
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
else
|
||||||
|
return await _context.Prefixes.AsQueryable()
|
||||||
|
.Where(p => p.IsActive)
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Prefix?> GetByIdAsync(Guid id)
|
||||||
|
{
|
||||||
|
return await _context.Prefixes.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAsync(Guid id, Prefix updated)
|
||||||
|
{
|
||||||
|
var existData = await _context.Prefixes.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (existData != null)
|
||||||
|
{
|
||||||
|
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
|
||||||
|
{
|
||||||
|
existData.Name = updated.Name;
|
||||||
|
existData.IsActive = updated.IsActive;
|
||||||
|
existData.LastUpdateUserId = UserId ?? "";
|
||||||
|
existData.LastUpdateFullName = FullName ?? "";
|
||||||
|
existData.LastUpdatedAt = DateTime.Now;
|
||||||
|
}
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task CreateAsync(Prefix inserted)
|
||||||
|
{
|
||||||
|
inserted.CreatedUserId = UserId ?? "";
|
||||||
|
inserted.CreatedFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.CreatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.LastUpdateUserId = UserId ?? "";
|
||||||
|
|
||||||
|
await _context.Prefixes.AddAsync(inserted);
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
93
BMA.EHR.MetaData.Service/Services/ProvinceService.cs
Normal file
93
BMA.EHR.MetaData.Service/Services/ProvinceService.cs
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BMA.EHR.MetaData.Service.Services
|
||||||
|
{
|
||||||
|
public class ProvinceService
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ApplicationDBContext _context;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destructor "
|
||||||
|
|
||||||
|
public ProvinceService(ApplicationDBContext context,
|
||||||
|
IHttpContextAccessor httpContextAccessor)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||||
|
|
||||||
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task<IEnumerable<Province>> GetsAsync(bool showAll = true)
|
||||||
|
{
|
||||||
|
if (showAll)
|
||||||
|
return await _context.Provinces.AsQueryable()
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
else
|
||||||
|
return await _context.Provinces.AsQueryable()
|
||||||
|
.Where(p => p.IsActive)
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Province?> GetByIdAsync(Guid id)
|
||||||
|
{
|
||||||
|
return await _context.Provinces
|
||||||
|
.AsQueryable()
|
||||||
|
.Include(x => x.Districts)
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAsync(Guid id, Province updated)
|
||||||
|
{
|
||||||
|
var existData = await _context.Provinces.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (existData != null)
|
||||||
|
{
|
||||||
|
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
|
||||||
|
{
|
||||||
|
existData.Name = updated.Name;
|
||||||
|
existData.IsActive = updated.IsActive;
|
||||||
|
existData.LastUpdatedAt = DateTime.Now;
|
||||||
|
existData.LastUpdateUserId = UserId ?? "";
|
||||||
|
existData.LastUpdateFullName = FullName ?? "";
|
||||||
|
}
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task CreateAsync(Province inserted)
|
||||||
|
{
|
||||||
|
inserted.CreatedUserId = UserId ?? "";
|
||||||
|
inserted.CreatedFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.CreatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.LastUpdateUserId = UserId ?? "";
|
||||||
|
|
||||||
|
await _context.Provinces.AddAsync(inserted);
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
89
BMA.EHR.MetaData.Service/Services/RelationshipService.cs
Normal file
89
BMA.EHR.MetaData.Service/Services/RelationshipService.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BMA.EHR.MetaData.Service.Services;
|
||||||
|
|
||||||
|
public class RelationshipService
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ApplicationDBContext _context;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destructor "
|
||||||
|
|
||||||
|
public RelationshipService(ApplicationDBContext context,
|
||||||
|
IHttpContextAccessor httpContextAccessor)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||||
|
|
||||||
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task<IEnumerable<Relationship>> GetsAsync(bool showAll = true)
|
||||||
|
{
|
||||||
|
if (showAll)
|
||||||
|
return await _context.Relationships.AsQueryable()
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
else
|
||||||
|
return await _context.Relationships.AsQueryable()
|
||||||
|
.Where(p => p.IsActive)
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Relationship?> GetByIdAsync(Guid id)
|
||||||
|
{
|
||||||
|
return await _context.Relationships.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAsync(Guid id, Relationship updated)
|
||||||
|
{
|
||||||
|
var existData = await _context.Relationships.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (existData != null)
|
||||||
|
{
|
||||||
|
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
|
||||||
|
{
|
||||||
|
existData.Name = updated.Name;
|
||||||
|
existData.IsActive = updated.IsActive;
|
||||||
|
existData.LastUpdateUserId = UserId ?? "";
|
||||||
|
existData.LastUpdateFullName = FullName ?? "";
|
||||||
|
existData.LastUpdatedAt = DateTime.Now;
|
||||||
|
}
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task CreateAsync(Relationship inserted)
|
||||||
|
{
|
||||||
|
inserted.CreatedUserId = UserId ?? "";
|
||||||
|
inserted.CreatedFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.CreatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.LastUpdateUserId = UserId ?? "";
|
||||||
|
|
||||||
|
await _context.Relationships.AddAsync(inserted);
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
90
BMA.EHR.MetaData.Service/Services/ReligionService.cs
Normal file
90
BMA.EHR.MetaData.Service/Services/ReligionService.cs
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
using BMA.EHR.Domain.Models.MetaData;
|
||||||
|
using BMA.EHR.Infrastructure.Persistence;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BMA.EHR.MetaData.Service.Services
|
||||||
|
{
|
||||||
|
public class ReligionService
|
||||||
|
{
|
||||||
|
#region " Fields "
|
||||||
|
|
||||||
|
private readonly ApplicationDBContext _context;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Constructor and Destructor "
|
||||||
|
|
||||||
|
public ReligionService(ApplicationDBContext context,
|
||||||
|
IHttpContextAccessor httpContextAccessor)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Properties "
|
||||||
|
|
||||||
|
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||||
|
|
||||||
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region " Methods "
|
||||||
|
|
||||||
|
public async Task<IEnumerable<Religion>> GetsAsync(bool showAll = true)
|
||||||
|
{
|
||||||
|
if (showAll)
|
||||||
|
return await _context.Religions.AsQueryable()
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
else
|
||||||
|
return await _context.Religions.AsQueryable()
|
||||||
|
.Where(p => p.IsActive)
|
||||||
|
.OrderBy(d => d.Name)
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Religion?> GetByIdAsync(Guid id)
|
||||||
|
{
|
||||||
|
return await _context.Religions.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAsync(Guid id, Religion updated)
|
||||||
|
{
|
||||||
|
var existData = await _context.Religions.FirstOrDefaultAsync(x => x.Id == id);
|
||||||
|
if (existData != null)
|
||||||
|
{
|
||||||
|
if (existData.Name != updated.Name || existData.IsActive != updated.IsActive)
|
||||||
|
{
|
||||||
|
existData.Name = updated.Name;
|
||||||
|
existData.IsActive = updated.IsActive;
|
||||||
|
existData.LastUpdateUserId = UserId ?? "";
|
||||||
|
existData.LastUpdateFullName = FullName ?? "";
|
||||||
|
existData.LastUpdatedAt = DateTime.Now;
|
||||||
|
}
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task CreateAsync(Religion inserted)
|
||||||
|
{
|
||||||
|
inserted.CreatedUserId = UserId ?? "";
|
||||||
|
inserted.CreatedFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.CreatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdatedAt = DateTime.Now;
|
||||||
|
inserted.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
inserted.LastUpdateUserId = UserId ?? "";
|
||||||
|
|
||||||
|
await _context.Religions.AddAsync(inserted);
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -844,27 +844,29 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldOc = _null,
|
Education = _null,
|
||||||
OldPositionType = _null,
|
OldOc = _null,
|
||||||
OldPositionLevel = _null,
|
OldPositionType = _null,
|
||||||
OldPositionNumber = _null,
|
OldPositionLevel = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
LeaveDate = _null,
|
OldSalary = _null,
|
||||||
NewOc = _null,
|
LeaveDate = _null,
|
||||||
NewPositionType = _null,
|
NewOc = _null,
|
||||||
NewPositionLevel = _null,
|
NewPositionType = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
AppointDate = _null,
|
NewSalary = _null,
|
||||||
CommandExcecuteDate = _null,
|
AppointDate = _null,
|
||||||
RemarkHorizontal = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -1054,27 +1056,29 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldOc = _null,
|
Education = _null,
|
||||||
OldPositionType = _null,
|
OldOc = _null,
|
||||||
OldPositionLevel = _null,
|
OldPositionType = _null,
|
||||||
OldPositionNumber = _null,
|
OldPositionLevel = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
LeaveDate = _null,
|
OldSalary = _null,
|
||||||
NewOc = _null,
|
LeaveDate = _null,
|
||||||
NewPositionType = _null,
|
NewOc = _null,
|
||||||
NewPositionLevel = _null,
|
NewPositionType = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
AppointDate = _null,
|
NewSalary = _null,
|
||||||
CommandExcecuteDate = _null,
|
AppointDate = _null,
|
||||||
RemarkHorizontal = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -1261,21 +1265,23 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
OldOrganization = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldPositionLevel = _null,
|
OldOrganization = _null,
|
||||||
OldPositionNumber = _null,
|
OldPositionLevel = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
NewOc = _null,
|
OldSalary = _null,
|
||||||
NewPositionLevel = _null,
|
NewOc = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
RemarkHorizontal = _null,
|
NewSalary = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -1464,21 +1470,23 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
OldOc = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldPositionNumber = _null,
|
OldOc = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
NewOc = _null,
|
OldSalary = _null,
|
||||||
NewPositionNumber = _null,
|
NewOc = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
ReportingDate = _null,
|
NewSalary = _null,
|
||||||
CommandExcecuteDate = _null,
|
ReportingDate = _null,
|
||||||
RemarkHorizontal = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -1678,26 +1686,28 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldOc = _null,
|
Education = _null,
|
||||||
OldPositionType = _null,
|
OldOc = _null,
|
||||||
OldPositionLevel = _null,
|
OldPositionType = _null,
|
||||||
OldPositionNumber = _null,
|
OldPositionLevel = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
NewOc = _null,
|
OldSalary = _null,
|
||||||
NewPositionType = _null,
|
NewOc = _null,
|
||||||
NewPositionLevel = _null,
|
NewPositionType = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
AppointDate = _null,
|
NewSalary = _null,
|
||||||
CommandExcecuteDate = _null,
|
AppointDate = _null,
|
||||||
RemarkHorizontal = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,10 +161,10 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
if (org.result.isOfficer == false)
|
if (org.result.isOfficer == false)
|
||||||
{
|
{
|
||||||
rootId = org.result.rootId == null ? "" : org.result.rootId;
|
rootId = org.result.rootId == null ? "" : org.result.rootId;
|
||||||
child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
|
// child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
|
||||||
child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
|
// child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
|
||||||
child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
|
// child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
|
||||||
child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
|
// child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
|
||||||
var data1 = await _context.PlacementProfiles
|
var data1 = await _context.PlacementProfiles
|
||||||
.Where(x => x.Placement.Id == examId)
|
.Where(x => x.Placement.Id == examId)
|
||||||
.Where(x => x.Draft == true)
|
.Where(x => x.Draft == true)
|
||||||
|
|
@ -633,10 +633,10 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
if (org.result.isOfficer == false)
|
if (org.result.isOfficer == false)
|
||||||
{
|
{
|
||||||
rootId = org.result.rootId == null ? "" : org.result.rootId;
|
rootId = org.result.rootId == null ? "" : org.result.rootId;
|
||||||
child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
|
// child1Id = org.result.child1Id == null ? "" : org.result.child1Id;
|
||||||
child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
|
// child2Id = org.result.child2Id == null ? "" : org.result.child2Id;
|
||||||
child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
|
// child3Id = org.result.child3Id == null ? "" : org.result.child3Id;
|
||||||
child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
|
// child4Id = org.result.child4Id == null ? "" : org.result.child4Id;
|
||||||
var placement = await _context.Placements
|
var placement = await _context.Placements
|
||||||
.Where(x => x.Id == examId)
|
.Where(x => x.Id == examId)
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
|
|
@ -727,7 +727,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
.FirstOrDefaultAsync(x => x.Id == req.PersonalId);
|
.FirstOrDefaultAsync(x => x.Id == req.PersonalId);
|
||||||
if (person == null)
|
if (person == null)
|
||||||
return Error(GlobalMessages.DataNotFound, 404);
|
return Error(GlobalMessages.DataNotFound, 404);
|
||||||
|
bool? _nullBool = null;
|
||||||
person.OrganizationPosition = null;
|
person.OrganizationPosition = null;
|
||||||
person.PositionNumber = null;
|
person.PositionNumber = null;
|
||||||
person.PositionPath = null;
|
person.PositionPath = null;
|
||||||
|
|
@ -762,7 +762,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
person.child4ShortName = null;
|
person.child4ShortName = null;
|
||||||
person.orgRevisionId = null;
|
person.orgRevisionId = null;
|
||||||
person.posMasterNo = null;
|
person.posMasterNo = null;
|
||||||
person.positionName = null;
|
//person.positionName = null;
|
||||||
person.positionField = null;
|
person.positionField = null;
|
||||||
person.posTypeId = null;
|
person.posTypeId = null;
|
||||||
person.posTypeName = null;
|
person.posTypeName = null;
|
||||||
|
|
@ -772,7 +772,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
person.nodeId = null;
|
person.nodeId = null;
|
||||||
person.posmasterId = null;
|
person.posmasterId = null;
|
||||||
person.positionId = null;
|
person.positionId = null;
|
||||||
person.Draft = false;
|
person.Draft = _nullBool;
|
||||||
person.typeCommand = null;
|
person.typeCommand = null;
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
@ -1623,27 +1623,30 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "")
|
||||||
{
|
{
|
||||||
No = _null,
|
result.Add(new
|
||||||
FullName = r.RemarkHorizontal,
|
{
|
||||||
Education = _null,
|
No = _null,
|
||||||
PositionName = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
ExamNumber = _null,
|
Education = _null,
|
||||||
PlacementName = _null,
|
PositionName = _null,
|
||||||
Oc = _null,
|
ExamNumber = _null,
|
||||||
PositionType = _null,
|
PlacementName = _null,
|
||||||
PositionLevel = _null,
|
Oc = _null,
|
||||||
PositionNumber = _null,
|
PositionType = _null,
|
||||||
Salary = _null,
|
PositionLevel = _null,
|
||||||
AppointDate = _null,
|
PositionNumber = _null,
|
||||||
CommandExcecuteDate = _null,
|
Salary = _null,
|
||||||
OccupationPosition = _null,
|
AppointDate = _null,
|
||||||
PositionCandidate = _null,
|
CommandExcecuteDate = _null,
|
||||||
OcCandidate = _null,
|
OccupationPosition = _null,
|
||||||
RemarkHorizontal = _null,
|
PositionCandidate = _null,
|
||||||
RemarkVertical = _null,
|
OcCandidate = _null,
|
||||||
});
|
RemarkHorizontal = _null,
|
||||||
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -1927,26 +1930,28 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
PositionName = _null,
|
Education = _null,
|
||||||
ExamNumber = _null,
|
PositionName = _null,
|
||||||
PlacementName = _null,
|
ExamNumber = _null,
|
||||||
Oc = _null,
|
PlacementName = _null,
|
||||||
PositionType = _null,
|
Oc = _null,
|
||||||
PositionLevel = _null,
|
PositionType = _null,
|
||||||
PositionNumber = _null,
|
PositionLevel = _null,
|
||||||
Salary = _null,
|
PositionNumber = _null,
|
||||||
AppointDate = _null,
|
Salary = _null,
|
||||||
CommandExcecuteDate = _null,
|
AppointDate = _null,
|
||||||
OccupationPosition = _null,
|
CommandExcecuteDate = _null,
|
||||||
PositionCandidate = _null,
|
OccupationPosition = _null,
|
||||||
RemarkHorizontal = _null,
|
PositionCandidate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -2250,28 +2255,30 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldOc = _null,
|
Education = _null,
|
||||||
OldPositionType = _null,
|
OldOc = _null,
|
||||||
OldPositionLevel = _null,
|
OldPositionType = _null,
|
||||||
OldPositionNumber = _null,
|
OldPositionLevel = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
OldPosition = _null,
|
OldSalary = _null,
|
||||||
NewOc = _null,
|
OldPosition = _null,
|
||||||
NewPosition = _null,
|
NewOc = _null,
|
||||||
NewPositionType = _null,
|
NewPosition = _null,
|
||||||
NewPositionLevel = _null,
|
NewPositionType = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
AppointDate = _null,
|
NewSalary = _null,
|
||||||
CommandExcecuteDate = _null,
|
AppointDate = _null,
|
||||||
RemarkHorizontal = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -2476,28 +2483,30 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldOc = _null,
|
Education = _null,
|
||||||
OldPosition = _null,
|
OldOc = _null,
|
||||||
OldPositionType = _null,
|
OldPosition = _null,
|
||||||
OldPositionLevel = _null,
|
OldPositionType = _null,
|
||||||
OldPositionNumber = _null,
|
OldPositionLevel = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
NewOc = _null,
|
OldSalary = _null,
|
||||||
NewPosition = _null,
|
NewOc = _null,
|
||||||
NewPositionType = _null,
|
NewPosition = _null,
|
||||||
NewPositionLevel = _null,
|
NewPositionType = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
AppointDate = _null,
|
NewSalary = _null,
|
||||||
CommandExcecuteDate = _null,
|
AppointDate = _null,
|
||||||
RemarkHorizontal = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -2693,26 +2702,28 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldOc = _null,
|
Education = _null,
|
||||||
OldPositionType = _null,
|
OldOc = _null,
|
||||||
OldPositionLevel = _null,
|
OldPositionType = _null,
|
||||||
OldPositionNumber = _null,
|
OldPositionLevel = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
LeaveDate = _null,
|
OldSalary = _null,
|
||||||
NewOc = _null,
|
LeaveDate = _null,
|
||||||
NewPositionType = _null,
|
NewOc = _null,
|
||||||
NewPositionLevel = _null,
|
NewPositionType = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
AppointDate = _null,
|
NewSalary = _null,
|
||||||
RemarkHorizontal = _null,
|
AppointDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -628,18 +628,20 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
PositionName = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
Organization = _null,
|
PositionName = _null,
|
||||||
StartDate = _null,
|
Organization = _null,
|
||||||
EndDate = _null,
|
StartDate = _null,
|
||||||
Reason = _null,
|
EndDate = _null,
|
||||||
RemarkHorizontal = _null,
|
Reason = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -974,26 +974,28 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldOrg = _null,
|
Education = _null,
|
||||||
OldOc = _null,
|
OldOrg = _null,
|
||||||
OldPositionType = _null,
|
OldOc = _null,
|
||||||
OldPositionLevel = _null,
|
OldPositionType = _null,
|
||||||
OldSalary = _null,
|
OldPositionLevel = _null,
|
||||||
NewOc = _null,
|
OldSalary = _null,
|
||||||
NewPositionType = _null,
|
NewOc = _null,
|
||||||
NewPositionLevel = _null,
|
NewPositionType = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
AppointDate = _null,
|
NewSalary = _null,
|
||||||
CommandExcecuteDate = _null,
|
AppointDate = _null,
|
||||||
RemarkHorizontal = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -838,22 +838,24 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
OldOc = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
PositionType = _null,
|
OldOc = _null,
|
||||||
PositionLevel = _null,
|
PositionType = _null,
|
||||||
PositionNumber = _null,
|
PositionLevel = _null,
|
||||||
Salary = _null,
|
PositionNumber = _null,
|
||||||
ReceiveOrganizationName = _null,
|
Salary = _null,
|
||||||
ActiveDate = _null,
|
ReceiveOrganizationName = _null,
|
||||||
CommandExcecuteDate = _null,
|
ActiveDate = _null,
|
||||||
Reason = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkHorizontal = _null,
|
Reason = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1280,5 +1280,49 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return Success(true);
|
return Success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// report1
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("report1")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> report1(string? nodeId = null, int? node = 0, DateOnly? startDate = null, DateOnly? startEnd = null)
|
||||||
|
{
|
||||||
|
var data = new
|
||||||
|
{
|
||||||
|
template = "retirement01",
|
||||||
|
reportName = "xlsx-report",
|
||||||
|
data = ""
|
||||||
|
};
|
||||||
|
|
||||||
|
return Success(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// report2
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("report2")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> report2(string? nodeId = null, int? node = 0, DateOnly? startDate = null, DateOnly? startEnd = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
var data = new
|
||||||
|
{
|
||||||
|
template = "retirement02",
|
||||||
|
reportName = "xlsx-report",
|
||||||
|
data = ""
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
return Success(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
var child2Id = "";
|
var child2Id = "";
|
||||||
var child3Id = "";
|
var child3Id = "";
|
||||||
var child4Id = "";
|
var child4Id = "";
|
||||||
var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position";
|
var apiUrl = $"{_configuration["API"]}/org/permission/checkOrg/{UserId}";
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
|
@ -721,27 +721,29 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldOc = _null,
|
Education = _null,
|
||||||
OldPositionType = _null,
|
OldOc = _null,
|
||||||
OldPositionLevel = _null,
|
OldPositionType = _null,
|
||||||
OldPositionNumber = _null,
|
OldPositionLevel = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
LeaveDate = _null,
|
OldSalary = _null,
|
||||||
NewOc = _null,
|
LeaveDate = _null,
|
||||||
NewPositionType = _null,
|
NewOc = _null,
|
||||||
NewPositionLevel = _null,
|
NewPositionType = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
AppointDate = _null,
|
NewSalary = _null,
|
||||||
CommandExcecuteDate = _null,
|
AppointDate = _null,
|
||||||
RemarkHorizontal = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -925,28 +927,30 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
Education = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
OldOc = _null,
|
Education = _null,
|
||||||
OldPositionType = _null,
|
OldOc = _null,
|
||||||
OldPositionLevel = _null,
|
OldPositionType = _null,
|
||||||
OldPositionNumber = _null,
|
OldPositionLevel = _null,
|
||||||
OldSalary = _null,
|
OldPositionNumber = _null,
|
||||||
LeaveDate = _null,
|
OldSalary = _null,
|
||||||
MilitaryDate = _null,
|
LeaveDate = _null,
|
||||||
NewOc = _null,
|
MilitaryDate = _null,
|
||||||
NewPositionType = _null,
|
NewOc = _null,
|
||||||
NewPositionLevel = _null,
|
NewPositionType = _null,
|
||||||
NewPositionNumber = _null,
|
NewPositionLevel = _null,
|
||||||
NewSalary = _null,
|
NewPositionNumber = _null,
|
||||||
AppointDate = _null,
|
NewSalary = _null,
|
||||||
CommandExcecuteDate = _null,
|
AppointDate = _null,
|
||||||
RemarkHorizontal = _null,
|
CommandExcecuteDate = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2394,22 +2394,24 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
CitizenId = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
PositionName = _null,
|
CitizenId = _null,
|
||||||
Organization = _null,
|
PositionName = _null,
|
||||||
PositionLevel = _null,
|
Organization = _null,
|
||||||
PositionType = _null,
|
PositionLevel = _null,
|
||||||
PositionNumber = _null,
|
PositionType = _null,
|
||||||
ActiveDate = _null,
|
PositionNumber = _null,
|
||||||
Salary = _null,
|
ActiveDate = _null,
|
||||||
Remark = _null,
|
Salary = _null,
|
||||||
RemarkHorizontal = _null,
|
Remark = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -2575,22 +2577,24 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
CitizenId = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
PositionName = _null,
|
CitizenId = _null,
|
||||||
Organization = _null,
|
PositionName = _null,
|
||||||
PositionLevel = _null,
|
Organization = _null,
|
||||||
PositionType = _null,
|
PositionLevel = _null,
|
||||||
PositionNumber = _null,
|
PositionType = _null,
|
||||||
ActiveDate = _null,
|
PositionNumber = _null,
|
||||||
Salary = _null,
|
ActiveDate = _null,
|
||||||
Remark = _null,
|
Salary = _null,
|
||||||
RemarkHorizontal = _null,
|
Remark = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2337,22 +2337,24 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
CitizenId = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
PositionName = _null,
|
CitizenId = _null,
|
||||||
Organization = _null,
|
PositionName = _null,
|
||||||
PositionLevel = _null,
|
Organization = _null,
|
||||||
PositionType = _null,
|
PositionLevel = _null,
|
||||||
PositionNumber = _null,
|
PositionType = _null,
|
||||||
ActiveDate = _null,
|
PositionNumber = _null,
|
||||||
Salary = _null,
|
ActiveDate = _null,
|
||||||
Remark = _null,
|
Salary = _null,
|
||||||
RemarkHorizontal = _null,
|
Remark = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
@ -2518,22 +2520,24 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
{
|
{
|
||||||
result.Add(r);
|
result.Add(r);
|
||||||
string? _null = null;
|
string? _null = null;
|
||||||
result.Add(new
|
if (r.RemarkHorizontal != null && r.RemarkHorizontal != "") {
|
||||||
{
|
result.Add(new
|
||||||
No = _null,
|
{
|
||||||
FullName = r.RemarkHorizontal,
|
No = _null,
|
||||||
CitizenId = _null,
|
FullName = r.RemarkHorizontal,
|
||||||
PositionName = _null,
|
CitizenId = _null,
|
||||||
Organization = _null,
|
PositionName = _null,
|
||||||
PositionLevel = _null,
|
Organization = _null,
|
||||||
PositionType = _null,
|
PositionLevel = _null,
|
||||||
PositionNumber = _null,
|
PositionType = _null,
|
||||||
ActiveDate = _null,
|
PositionNumber = _null,
|
||||||
Salary = _null,
|
ActiveDate = _null,
|
||||||
Remark = _null,
|
Salary = _null,
|
||||||
RemarkHorizontal = _null,
|
Remark = _null,
|
||||||
RemarkVertical = _null,
|
RemarkHorizontal = _null,
|
||||||
});
|
RemarkVertical = _null,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Success(result);
|
return Success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue