change fore new field
This commit is contained in:
parent
d5670f11fd
commit
0324e4c270
12 changed files with 754 additions and 534 deletions
|
|
@ -1,11 +1,9 @@
|
|||
|
||||
using BMA.EHR.Organization.Service.Models;
|
||||
using BMA.EHR.Report.Service.Models;
|
||||
using BMA.EHR.MetaData.Service.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace BMA.EHR.Profile.Service.Models
|
||||
namespace BMA.EHR.Organization.Service.Models
|
||||
{
|
||||
public class AvailablePositionLevelEntity : EntityBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Report.Service.Models;
|
||||
using BMA.EHR.MetaData.Service.Models;
|
||||
|
||||
namespace BMA.EHR.Profile.Service.Models
|
||||
namespace BMA.EHR.Organization.Service.Models
|
||||
{
|
||||
public class OrganizationEntity : EntityBase
|
||||
{
|
||||
|
|
@ -67,6 +67,21 @@ namespace BMA.EHR.Profile.Service.Models
|
|||
|
||||
[Column(Order = 13), Comment("OrganizationUserNote")]
|
||||
public string? OrganizationUserNote { get; set; }
|
||||
|
||||
[Column(Order = 14), Comment("หน่วยงาน")]
|
||||
public string? Agency { get; set; }
|
||||
|
||||
[Column(Order = 15), Comment("ส่วนราชการ")]
|
||||
public string? Government { get; set; }
|
||||
|
||||
[Column(Order = 16), Comment("ฝ่าย/ส่วน")]
|
||||
public string? Department { get; set; }
|
||||
|
||||
[Column(Order = 17), Comment("กอง")]
|
||||
public string? Pile { get; set; }
|
||||
|
||||
public Guid? OrganizationStatusId { get; set; }
|
||||
|
||||
public List<OrganizationEntity> Organizations { get; } = new();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
using BMA.EHR.Organization.Service.Models;
|
||||
using BMA.EHR.Report.Service.Models;
|
||||
using BMA.EHR.MetaData.Service.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace BMA.EHR.Profile.Service.Models
|
||||
namespace BMA.EHR.Organization.Service.Models
|
||||
{
|
||||
public class OrganizationPositionEntity : EntityBase
|
||||
{
|
||||
|
||||
[ForeignKey("PositionMasterId")]
|
||||
public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; }
|
||||
|
||||
|
|
@ -28,5 +28,12 @@ namespace BMA.EHR.Profile.Service.Models
|
|||
|
||||
[Column(Order = 6), Comment("PositionNumberId")]
|
||||
public Guid? PositionNumberId { get; set; }
|
||||
|
||||
[Column(Order = 7), Comment("ติดเงื่อนไข")]
|
||||
public bool? IsCondition { get; set; }
|
||||
|
||||
[Column(Order = 8), Comment("รายละเอียดเงื่อนไข")]
|
||||
public string? ConditionNote { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
17
Models/OrganizationPublishFileEntity.cs
Normal file
17
Models/OrganizationPublishFileEntity.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using BMA.EHR.MetaData.Service.Models;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace BMA.EHR.Organization.Service.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// เก็บข้อมูลไฟล์ structure ที่ถูกสร้างตอนทำการ publish
|
||||
/// </summary>
|
||||
public class OrganizationPublishFileEntity : EntityBase
|
||||
{
|
||||
[Required]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
15
Models/OrganizationPublishHistoryEntity.cs
Normal file
15
Models/OrganizationPublishHistoryEntity.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using BMA.EHR.MetaData.Service.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace BMA.EHR.Organization.Service.Models
|
||||
{
|
||||
public class OrganizationPublishHistoryEntity : EntityBase
|
||||
{
|
||||
[Column(Order = 1), Comment("รายละเอียดการแก้ไข")]
|
||||
public string Detail { get; set; } = string.Empty;
|
||||
|
||||
[Column(Order = 2), Comment("เก็บ Object ที่มีการอัพเดตในระบบ")]
|
||||
public string ObjectValue { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
|
@ -73,7 +73,7 @@ namespace BMA.EHR.Organization.Service.Models
|
|||
public string? PositionExecutiveSideObject { get; set; }
|
||||
|
||||
//public List<AvailablePositionLevelEntity> AvailablePositionLevels { get; } = new();
|
||||
//public List<PositionMasterHistoryEntity> PositionMasterHistorys { get; } = new();
|
||||
public List<PositionMasterHistoryEntity> PositionMasterHistorys { get; } = new();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
54
Models/PositionMasterHistoryEntity.cs
Normal file
54
Models/PositionMasterHistoryEntity.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.MetaData.Service.Models;
|
||||
|
||||
namespace BMA.EHR.Organization.Service.Models
|
||||
{
|
||||
public class PositionMasterHistoryEntity : EntityBase
|
||||
{
|
||||
[Column(Order = 2), Comment("Position")]
|
||||
public string? Position { get; set; }
|
||||
|
||||
[Column(Order = 3), Comment("PositionPath")]
|
||||
public string? PositionPath { get; set; }
|
||||
|
||||
[Column(Order = 4), Comment("PositionType")]
|
||||
public string? PositionType { get; set; }
|
||||
|
||||
[Column(Order = 5), Comment("PositionExecutive")]
|
||||
public string? PositionExecutive { get; set; }
|
||||
|
||||
[Column(Order = 6), Comment("PositionExecutiveSide")]
|
||||
public string? PositionExecutiveSide { get; set; }
|
||||
|
||||
[Column(Order = 7), Comment("PositionPathSide")]
|
||||
public string? PositionPathSide { get; set; }
|
||||
|
||||
[Column(Order = 8), Comment("PositionLine")]
|
||||
public string? PositionLine { get; set; }
|
||||
|
||||
[Column(Order = 10), Comment("PositionStatus")]
|
||||
public string? PositionStatus { get; set; }
|
||||
|
||||
[Column(Order = 11), Comment("PositionCondition")]
|
||||
public string? PositionCondition { get; set; }
|
||||
|
||||
[Column(Order = 12), Comment("PositionLevel")]
|
||||
public string? PositionLevel { get; set; }
|
||||
|
||||
[Column(Order = 13), Comment("PositionMasterUserNote")]
|
||||
public string? PositionMasterUserNote { get; set; }
|
||||
|
||||
[Column(Order = 14), Comment("IsDirector")]
|
||||
public bool? IsDirector { get; set; }
|
||||
|
||||
[Column(Order = 15), Comment("คุณวุฒิ")]
|
||||
public string? Qualification { get; set; }
|
||||
public PositionMasterEntity? PositionMasterEntity { get; set; }
|
||||
|
||||
public string? PositionPathSideObject { get; set; }
|
||||
|
||||
public string? PositionExecutiveSideObject { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Report.Service.Models;
|
||||
using BMA.EHR.MetaData.Service.Models;
|
||||
|
||||
namespace BMA.EHR.Profile.Service.Models
|
||||
namespace BMA.EHR.Organization.Service.Models
|
||||
{
|
||||
public class PositionNumberEntity : EntityBase
|
||||
{
|
||||
|
|
@ -16,5 +16,9 @@ namespace BMA.EHR.Profile.Service.Models
|
|||
|
||||
[Column(Order = 3), Comment("Shortname")]
|
||||
public Guid? OrganizationShortNameId { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using BMA.EHR.MetaData.Service.Models;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Report.Service.Models;
|
||||
|
||||
namespace BMA.EHR.Profile.Service.Models
|
||||
namespace BMA.EHR.Organization.Service.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Link Profile กับ OrganizationPosition
|
||||
|
|
|
|||
|
|
@ -107,12 +107,16 @@ namespace BMA.EHR.Report.Service.Services
|
|||
{
|
||||
var ret = new List<Guid>();
|
||||
|
||||
var oc = await _context.Organizations.FirstOrDefaultAsync(x => x.Id == id);
|
||||
var oc = await _context.Organizations
|
||||
.Select(x => new { x.Id, x.ParentId })
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (oc == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
ret.Add(oc.Id);
|
||||
|
||||
var child = await _context.Organizations.AsQueryable().Where(x => x.ParentId == id).ToListAsync();
|
||||
var child = await _context.Organizations.AsQueryable()
|
||||
.Select(x => new { x.Id, x.ParentId })
|
||||
.Where(x => x.ParentId == id).ToListAsync();
|
||||
if (child.Any())
|
||||
{
|
||||
foreach (var item in child)
|
||||
|
|
@ -135,14 +139,18 @@ namespace BMA.EHR.Report.Service.Services
|
|||
{
|
||||
var ret = new List<OrganizationItem>();
|
||||
|
||||
var oc = await _context.Organizations.FirstOrDefaultAsync(x => x.Id == id);
|
||||
var oc = await _context.Organizations
|
||||
.Select(x => new { x.Id, x.ParentId, x.OrganizationOrder })
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (oc == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
var thisLevel = level;
|
||||
//var thisLevel = oc.OrganizationOrder.Value;
|
||||
ret.Add(new OrganizationItem { Id = oc.Id, Order = thisLevel.ToString() });
|
||||
|
||||
var child = await _context.Organizations.AsQueryable().Where(x => x.ParentId == id).OrderBy(x => x.OrganizationOrder).ToListAsync();
|
||||
var child = await _context.Organizations.AsQueryable()
|
||||
.Select(x => new { x.Id, x.ParentId, x.OrganizationOrder })
|
||||
.Where(x => x.ParentId == id).OrderBy(x => x.OrganizationOrder).ToListAsync();
|
||||
if (child.Any())
|
||||
{
|
||||
var c = 1;
|
||||
|
|
@ -176,7 +184,14 @@ namespace BMA.EHR.Report.Service.Services
|
|||
|
||||
public async Task<IEnumerable<dynamic>?> GetOrganizationTypes(string type)
|
||||
{
|
||||
var Organizations = await _context.Organizations.ToListAsync();
|
||||
var Organizations = await _context.Organizations
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,
|
||||
OrganizationOrganizationId = x.OrganizationOrganizationId,
|
||||
OrganizationTypeId = x.OrganizationTypeId,
|
||||
OrganizationOrder = x.OrganizationOrder
|
||||
}).ToListAsync();
|
||||
|
||||
var OrganizationOrganizations = await _context.OrganizationOrganizations.ToListAsync();
|
||||
var OrganizationTypes = await _context.OrganizationTypes.FirstOrDefaultAsync(x => x.Name == type);
|
||||
|
|
@ -208,9 +223,41 @@ namespace BMA.EHR.Report.Service.Services
|
|||
var orgWithOrder = new List<OrganizationItem>();
|
||||
orgWithOrder = await GetAllOcItemByRootAsync(ocId);
|
||||
|
||||
var organizationPositions = await _context.OrganizationPositions.ToListAsync();
|
||||
var positionMasters = await _context.PositionMasters.ToListAsync();
|
||||
var organizations = await _context.Organizations.ToListAsync();
|
||||
var organizationPositions = await _context.OrganizationPositions
|
||||
.Select(x => new
|
||||
{
|
||||
x.Id, x.OrganizationId,
|
||||
x.PositionUserNote,
|
||||
x.PositionMasterId,
|
||||
x.PositionNumberId
|
||||
}).ToListAsync();
|
||||
|
||||
var positionMasters = await _context.PositionMasters
|
||||
.Select(x => new
|
||||
{
|
||||
x.Id,
|
||||
x.PositionPathId,
|
||||
x.PositionPathSideId,
|
||||
x.PositionExecutiveId,
|
||||
x.PositionExecutiveSideId,
|
||||
x.PositionTypeId,
|
||||
x.PositionPathSideObject,
|
||||
x.PositionExecutiveSideObject,
|
||||
x.IsDirector
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
var organizations = await _context.Organizations
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,
|
||||
OrganizationOrganizationId = x.OrganizationOrganizationId,
|
||||
OrganizationTypeId = x.OrganizationTypeId,
|
||||
OrganizationOrder = x.OrganizationOrder,
|
||||
OrganizationShortNameId = x.OrganizationShortNameId
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
var organizationOrganizations = await _applicationDbContext.OrganizationOrganizations.ToListAsync();
|
||||
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
||||
var positionNumbers = await _context.PositionNumbers.ToListAsync();
|
||||
|
|
@ -278,19 +325,59 @@ namespace BMA.EHR.Report.Service.Services
|
|||
var RootOcName = _profileService.GetOrganizationNameFullPath(organizationId, false, false);
|
||||
|
||||
var prefixes = await _applicationDbContext.Prefixes.ToListAsync();
|
||||
var organizationPositions = await _context.OrganizationPositions.ToListAsync();
|
||||
|
||||
|
||||
//var organizationPositions = await _context.OrganizationPositions.ToListAsync();
|
||||
var organizationPositions = await _context.OrganizationPositions
|
||||
.Select(x => new
|
||||
{
|
||||
x.Id,
|
||||
x.OrganizationId,
|
||||
x.PositionUserNote,
|
||||
x.PositionMasterId,
|
||||
x.PositionNumberId
|
||||
}).ToListAsync();
|
||||
|
||||
var profilePositions = await _context.ProfilePositions.ToListAsync();
|
||||
var positionNumbers = await _context.PositionNumbers.ToListAsync();
|
||||
var positionPaths = await _applicationDbContext.PositionPaths.ToListAsync();
|
||||
var positionLevels = await _applicationDbContext.PositionLevels.ToListAsync();
|
||||
var positionMasters = await _context.PositionMasters.ToListAsync();
|
||||
|
||||
//var positionMasters = await _context.PositionMasters.ToListAsync();
|
||||
var positionMasters = await _context.PositionMasters
|
||||
.Select(x => new
|
||||
{
|
||||
x.Id,
|
||||
x.PositionPathId,
|
||||
x.PositionPathSideId,
|
||||
x.PositionExecutiveId,
|
||||
x.PositionExecutiveSideId,
|
||||
x.PositionTypeId,
|
||||
x.PositionPathSideObject,
|
||||
x.PositionExecutiveSideObject,
|
||||
x.IsDirector,
|
||||
x.Qualification
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
var profiles = await _applicationDbContext.Profiles.ToListAsync();
|
||||
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
||||
var report2s = await _context.Report2s.ToListAsync();
|
||||
var positionPathSides = await _applicationDbContext.PositionPathSides.ToListAsync();
|
||||
var positionExecutiveSides = await _applicationDbContext.PositionExecutiveSides.ToListAsync();
|
||||
var positionExecutives = await _applicationDbContext.PositionExecutives.ToListAsync();
|
||||
var orgData = await _applicationDbContext.Organizations.ToListAsync();
|
||||
|
||||
var orgData = await _applicationDbContext.Organizations
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,
|
||||
OrganizationOrganizationId = x.OrganizationOrganizationId,
|
||||
OrganizationTypeId = x.OrganizationTypeId,
|
||||
OrganizationOrder = x.OrganizationOrder,
|
||||
OrganizationShortNameId = x.OrganizationShortNameId
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
var positionTypes = await _applicationDbContext.PositionTypes.ToListAsync();
|
||||
|
||||
var raw_results = (from op in organizationPositions
|
||||
|
|
@ -455,7 +542,6 @@ namespace BMA.EHR.Report.Service.Services
|
|||
try
|
||||
{
|
||||
|
||||
|
||||
var ocIdList = _profileService.GetAllIdByRoot(ocId);
|
||||
var RootOcName = _profileService.GetOrganizationNameFullPath(ocId, false, false);
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -14,9 +14,9 @@
|
|||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"MongoConnection": "mongodb://admin:adminVM123@127.0.0.1:27017",
|
||||
"RecruitConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||
"RecruitConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||
"EHRConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||
"ExamConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||
"ExamConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||
},
|
||||
"Jwt": {
|
||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue