แก้ไขรายงาน บช 2 3
This commit is contained in:
parent
b88727a0ee
commit
411d59d1a5
5 changed files with 563 additions and 357 deletions
|
|
@ -103,10 +103,12 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
PositionLevel = d.PositionLevel,
|
||||
Remark = d.Remark,
|
||||
PositionType = d.PositionType,
|
||||
IsDirector = d.IsDirector,
|
||||
GovernmentCode = d.GovernmentCode,
|
||||
});
|
||||
}
|
||||
|
||||
var items = result_data.OrderBy(x => x.OcOrder).ThenBy(x => x.PositionNumberInt).ToList();
|
||||
var items = result_data.OrderBy(x => x.GovernmentCode).ThenBy(x => x.PositionNumberInt).ToList();
|
||||
|
||||
var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Organization", $"rptAccount1.trdp");
|
||||
ReportPackager reportPackager = new ReportPackager();
|
||||
|
|
@ -209,7 +211,7 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
}
|
||||
|
||||
|
||||
var items = result_data.OrderBy(x => x.OcOrder).ThenBy(x => x.PositionNumberInt).ToList();
|
||||
var items = result_data.OrderBy(x => x.GovernmentCode).ThenBy(x => x.PositionNumberInt).ToList();
|
||||
|
||||
var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Organization", $"rptAccount2.trdp");
|
||||
ReportPackager reportPackager = new ReportPackager();
|
||||
|
|
@ -314,7 +316,7 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
}
|
||||
|
||||
|
||||
var items = result_data.OrderBy(x => x.OcOrder).ThenBy(x => x.PositionNumberInt).ToList();
|
||||
var items = result_data.OrderBy(x => x.GovernmentCode).ThenBy(x => x.PositionNumberInt).ToList();
|
||||
|
||||
var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Organization", $"rptAccount3.trdp");
|
||||
ReportPackager reportPackager = new ReportPackager();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,34 @@ namespace BMA.EHR.Organization.Service.Models.Report2
|
|||
{
|
||||
public class Report2 : EntityBase
|
||||
{
|
||||
[Comment("รหัสส่วนราชการเดิม")]
|
||||
public string? OrganizationShortNameOld { get; set; }
|
||||
public string? GovernmentCodeOld { get; set; }
|
||||
|
||||
[Comment("ชื่อหน่วยงานเดิม")]
|
||||
public string? OrganizationOrganizationOld { get; set; }
|
||||
|
||||
[Comment("ตำแหน่งเลขที่เดิม")]
|
||||
public string? PositionNumOld { get; set; }
|
||||
|
||||
[Comment("ประเภทตำแหน่งเดิม")]
|
||||
public string? PositionTypeOld { get; set; }
|
||||
|
||||
[Comment("ตำแหน่งทางการบริหารเดิม")]
|
||||
public string? PositionExecutiveOld { get; set; }
|
||||
|
||||
[Comment("ด้านทางบริหารเดิม")]
|
||||
public string? PositionExecutiveSideOld { get; set; }
|
||||
|
||||
[Comment("ตำแหน่งในสายงานเดิม")]
|
||||
public string? PositionPathOld { get; set; }
|
||||
|
||||
[Comment("ด้าน/สาขาเดิม")]
|
||||
public string? PositionPathSideOld { get; set; }
|
||||
|
||||
[Comment("ระดับตำแหน่งเดิม")]
|
||||
public string? PositionLevelOld { get; set; }
|
||||
|
||||
[Comment("รหัสส่วนราชการ")]
|
||||
public Guid? OrganizationShortNameId { get; set; }
|
||||
public string? OrganizationShortName { get; set; }
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -4,426 +4,602 @@ using BMA.EHR.Organization.Service.Extensions;
|
|||
using BMA.EHR.Profile.Service.Services;
|
||||
using BMA.EHR.Report.Service.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace BMA.EHR.Report.Service.Services
|
||||
{
|
||||
public class OrganizationReportService
|
||||
{
|
||||
#region " Fields "
|
||||
|
||||
private readonly EHRDbContext _context;
|
||||
private readonly EHRDbContext _applicationDbContext;
|
||||
private readonly ProfileService _profileService;
|
||||
|
||||
#endregion
|
||||
|
||||
#region " Constructor and Destructor "
|
||||
|
||||
public OrganizationReportService(EHRDbContext context,
|
||||
EHRDbContext applicationDbContext,
|
||||
ProfileService profileService)
|
||||
{
|
||||
_context = context;
|
||||
_applicationDbContext = applicationDbContext;
|
||||
_profileService = profileService;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region " Methods "
|
||||
|
||||
#region " Report Query "
|
||||
|
||||
public async Task<IEnumerable<dynamic>?> GetOrganizationTypes(string type)
|
||||
{
|
||||
var Organizations = await _context.Organizations.ToListAsync();
|
||||
|
||||
var OrganizationOrganizations = await _context.OrganizationOrganizations.ToListAsync();
|
||||
var OrganizationTypes = await _context.OrganizationTypes.FirstOrDefaultAsync(x => x.Name == type);
|
||||
|
||||
if (OrganizationTypes == null)
|
||||
{
|
||||
throw new Exception("Invalid Organization type.");
|
||||
}
|
||||
|
||||
var dataType = (from o in Organizations
|
||||
join os in OrganizationOrganizations on o.OrganizationOrganizationId equals os.Id into os1
|
||||
from os in os1.DefaultIfEmpty()
|
||||
where o.OrganizationTypeId == OrganizationTypes.Id && os != null
|
||||
orderby o.OrganizationOrder
|
||||
select new
|
||||
{
|
||||
organizationId = o.Id,
|
||||
organizationName = os.Name
|
||||
}).ToList();
|
||||
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public async Task<List<Account1ResultItem>> GetReport1Query(Guid ocId)
|
||||
{
|
||||
var ocIdList = _profileService.GetAllIdByRoot(ocId);
|
||||
var RootOcName = _profileService.GetOrganizationNameFullPath(ocId, false, false);
|
||||
|
||||
var organizationPositions = await _context.OrganizationPositions.ToListAsync();
|
||||
var positionMasters = await _context.PositionMasters.ToListAsync();
|
||||
var organizations = await _context.Organizations.ToListAsync();
|
||||
var organizationOrganizations = await _applicationDbContext.OrganizationOrganizations.ToListAsync();
|
||||
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
||||
var positionNumbers = await _context.PositionNumbers.ToListAsync();
|
||||
var executivePositions = await _applicationDbContext.PositionExecutives.ToListAsync();
|
||||
var executivePositionSide = await _applicationDbContext.PositionExecutiveSides.ToListAsync();
|
||||
var positionPaths = await _applicationDbContext.PositionPaths.ToListAsync();
|
||||
var positionPathSides = await _applicationDbContext.PositionPathSides.ToListAsync();
|
||||
var positionTypes = await _applicationDbContext.PositionTypes.ToListAsync();
|
||||
|
||||
var data = (from op in organizationPositions
|
||||
join pm in positionMasters on op.PositionMasterId equals pm.Id
|
||||
join oc in organizations on op.OrganizationId equals oc.Id
|
||||
join oc_n in organizationOrganizations on oc.OrganizationOrganizationId equals oc_n.Id
|
||||
join sn in organizationShortNames on oc.OrganizationShortNameId equals sn.Id
|
||||
join pn in positionNumbers on op.PositionNumberId equals pn.Id
|
||||
join pp in positionPaths on pm.PositionPathId equals pp.Id
|
||||
join pps in positionPathSides on pm.PositionPathSideId equals pps.Id into pp_pps_join
|
||||
from pp_pps in pp_pps_join.DefaultIfEmpty()
|
||||
join ex_p in executivePositions on pm.PositionExecutiveId equals ex_p.Id into pm_exp_join
|
||||
from pm_exp in pm_exp_join.DefaultIfEmpty()
|
||||
join ex_p_s in executivePositionSide on pm.PositionExecutiveSideId equals ex_p_s.Id into pm_exp_s_join
|
||||
from pm_exp_s in pm_exp_s_join.DefaultIfEmpty()
|
||||
join pt in positionTypes on pm.PositionTypeId equals pt.Id
|
||||
where ocIdList.Contains((Guid)op.OrganizationId)
|
||||
select new Account1ResultItem
|
||||
{
|
||||
Id = op.Id,
|
||||
RootOcId = ocId,
|
||||
RootOcName = RootOcName,
|
||||
OcId = op.OrganizationId.Value,
|
||||
OcFullName = _profileService.FindOCFullPathWithNewLine(op.OrganizationId.Value, false, suppress: RootOcName),
|
||||
OcName = _profileService.GetOrganizationName(op.OrganizationId.Value),
|
||||
ShortName = sn.Name,
|
||||
PositionNumber = pn.Name,
|
||||
PositionLevel = _profileService.GetPositionLevel(pm.Id),
|
||||
PositionName = $"{pp.Name}\r\n",
|
||||
PositionSide = pm.PositionPathSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionPathSideObject>>(pm.PositionPathSideObject).GetNameList(),
|
||||
PositionExecutive = pm_exp == null ? "" : $"{pm_exp.Name}\r\n",
|
||||
PositionExecutiveSide = pm.PositionExecutiveSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionExecutiveSideObject>>(pm.PositionExecutiveSideObject).GetNameList(),
|
||||
Remark = op.PositionUserNote,
|
||||
OcOrder = oc.OrganizationOrder.Value,
|
||||
PositionType = pt.Name
|
||||
}).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public async Task<List<Account2ResultItem>> GetReport2Query(Guid ocId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var ocIdList = _profileService.GetAllIdByRoot(ocId);
|
||||
var RootOcName = _profileService.GetOrganizationNameFullPath(ocId, false, false);
|
||||
|
||||
var organizationPositions = await _context.OrganizationPositions.ToListAsync();
|
||||
var positionMasters = await _context.PositionMasters.ToListAsync();
|
||||
var organizations = await _context.Organizations.ToListAsync();
|
||||
var organizationOrganizations = await _applicationDbContext.OrganizationOrganizations.ToListAsync();
|
||||
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
||||
var positionNumbers = await _context.PositionNumbers.ToListAsync();
|
||||
var executivePositions = await _applicationDbContext.PositionExecutives.ToListAsync();
|
||||
var executivePositionSide = await _applicationDbContext.PositionExecutiveSides.ToListAsync();
|
||||
var positionPaths = await _applicationDbContext.PositionPaths.ToListAsync();
|
||||
var positionPathSides = await _applicationDbContext.PositionPathSides.ToListAsync();
|
||||
var positionTypes = await _applicationDbContext.PositionTypes.ToListAsync();
|
||||
var profilePositions = await _context.ProfilePositions.ToListAsync();
|
||||
var prefixes = await _context.Prefixes.ToListAsync();
|
||||
var profiles = await _context.Profiles.ToListAsync();
|
||||
var report2 = await _context.Report2s.ToListAsync();
|
||||
|
||||
var profile_data = (from p in _context.Profiles
|
||||
join pf in _context.Prefixes on p.PrefixId equals pf.Id
|
||||
select new
|
||||
{
|
||||
p.Id,
|
||||
p.CitizenId,
|
||||
Prefix = pf.Name,
|
||||
p.FirstName,
|
||||
p.LastName,
|
||||
p.PositionLine,
|
||||
p.Position,
|
||||
p.PositionPathSide,
|
||||
p.PositionType,
|
||||
p.PositionLevel,
|
||||
p.PositionExecutive,
|
||||
p.PositionExecutiveSide,
|
||||
p.PosNo,
|
||||
p.OrganizationShortName,
|
||||
Degree = p.Educations == null || p.Educations.Count == 0 ? "" : $"{p.Educations.OrderBy(x => x.StartDate).Last().Degree}\r\n({p.Educations.OrderBy(x => x.StartDate).Last().Field})",
|
||||
Salary = p.Salaries == null || p.Salaries.Count == 0 ? 0 : p.Salaries.OrderBy(x => x.Date).Last().Amount,
|
||||
SalaryPosition = p.Salaries == null || p.Salaries.Count == 0 ? 0 : p.Salaries.OrderBy(x => x.Date).Last().PositionSalaryAmount,
|
||||
|
||||
}).ToList();
|
||||
|
||||
|
||||
var report2_data = (from org_pos in _context.OrganizationPositions.ToList()
|
||||
join ppos in _context.ProfilePositions.ToList() on org_pos.Id equals ppos.OrganizationPositionId
|
||||
join pf in profile_data.ToList() on ppos.ProfileId equals pf.Id
|
||||
join r_raw in _context.Report2s.ToList() on ppos.Id equals r_raw.ProfilePositionId into r_join
|
||||
from r in r_join.DefaultIfEmpty()
|
||||
select new
|
||||
{
|
||||
//Id = r.Id,
|
||||
ProfilePositionId = ppos.Id,
|
||||
CitizenId = pf.CitizenId,
|
||||
Prefix = pf.Prefix,
|
||||
FirstName = pf.FirstName,
|
||||
LastName = pf.LastName,
|
||||
OrganizationName = r == null ? "" : r.OrganizationOrganization,
|
||||
ShortName = r == null ? pf.OrganizationShortName : r.OrganizationShortName,
|
||||
PositionNumber = r == null ? pf.PosNo : r.PositionNum,
|
||||
PositionPath = r == null ? pf.Position : r.PositionPath,
|
||||
PositionPathSide = r == null ? pf.PositionPathSide : r.PositionPathSide,
|
||||
PositionType = r == null ? pf.PositionType : r.PositionType,
|
||||
PositionLevel = r == null ? pf.PositionLevel : r.PositionLevel,
|
||||
PositionExecutive = r == null ? pf.PositionExecutive : r.PositionExecutive,
|
||||
PositionExecutiveSide = r == null ? pf.PositionExecutiveSide : r.PositionExecutiveSide,
|
||||
OcId = org_pos.Id,
|
||||
OrganizationPositionId = ppos.OrganizationPositionId,
|
||||
Degree = pf.Degree,
|
||||
Salary = pf.Salary,
|
||||
SalaryPosition = pf.SalaryPosition,
|
||||
}).ToList();
|
||||
|
||||
//var report2_data = (from r in _context.Report2s.ToList()
|
||||
// join ppos in _context.ProfilePositions.ToList() on r.ProfilePositionId equals ppos.Id
|
||||
// join org_pos in _context.OrganizationPositions.ToList() on ppos.OrganizationPositionId equals org_pos.Id
|
||||
// join pf in profile_data.ToList() on ppos.ProfileId equals pf.Id
|
||||
// select new
|
||||
// {
|
||||
// Id = r.Id,
|
||||
// ProfilePositionId = r.ProfilePositionId,
|
||||
// CitizenId = pf.CitizenId,
|
||||
// Prefix = pf.Prefix,
|
||||
// FirstName = pf.FirstName,
|
||||
// LastName = pf.LastName,
|
||||
// OrganizationName = r.OrganizationOrganization,
|
||||
// ShortName = r.OrganizationShortName,
|
||||
// PositionNumber = r.PositionNum,
|
||||
// PositionPath = r.PositionPath,
|
||||
// PositionPathSide = r.PositionPathSide,
|
||||
// PositionType = r.PositionType,
|
||||
// PositionLevel = r.PositionLevel,
|
||||
// PositionExecutive = r.PositionExecutive,
|
||||
// PositionExecutiveSide = r.PositionExecutiveSide,
|
||||
// OcId = org_pos.Id,
|
||||
// OrganizationPositionId = ppos.OrganizationPositionId,
|
||||
// Degree = pf.Degree,
|
||||
// Salary = pf.Salary,
|
||||
// SalaryPosition = pf.SalaryPosition,
|
||||
// }).ToList();
|
||||
|
||||
|
||||
|
||||
var data = (from op in organizationPositions
|
||||
join pm in positionMasters on op.PositionMasterId equals pm.Id
|
||||
join oc in organizations on op.OrganizationId equals oc.Id
|
||||
join oc_n in organizationOrganizations on oc.OrganizationOrganizationId equals oc_n.Id
|
||||
join sn in organizationShortNames on oc.OrganizationShortNameId equals sn.Id
|
||||
join pn in positionNumbers on op.PositionNumberId equals pn.Id
|
||||
join pp in positionPaths on pm.PositionPathId equals pp.Id
|
||||
join pps in positionPathSides on pm.PositionPathSideId equals pps.Id into pp_pps_join
|
||||
from pp_pps in pp_pps_join.DefaultIfEmpty()
|
||||
join ex_p in executivePositions on pm.PositionExecutiveId equals ex_p.Id into pm_exp_join
|
||||
from pm_exp in pm_exp_join.DefaultIfEmpty()
|
||||
join ex_p_s in executivePositionSide on pm.PositionExecutiveSideId equals ex_p_s.Id into pm_exp_s_join
|
||||
from pm_exp_s in pm_exp_s_join.DefaultIfEmpty()
|
||||
join pt in positionTypes on pm.PositionTypeId equals pt.Id
|
||||
join rp2 in report2_data.ToList() on op.Id equals rp2.OrganizationPositionId into rp2_join
|
||||
from rp2_dt in rp2_join.DefaultIfEmpty()
|
||||
|
||||
where ocIdList.Contains((Guid)op.OrganizationId)
|
||||
select new Account2ResultItem
|
||||
{
|
||||
Id = op.Id,
|
||||
RootOcId = ocId,
|
||||
RootOcName = RootOcName,
|
||||
OcId = op.OrganizationId.Value,
|
||||
OcFullName = _profileService.FindOCFullPathWithNewLine(op.OrganizationId.Value, false, suppress: RootOcName),
|
||||
OcName = _profileService.GetOrganizationName(op.OrganizationId.Value),
|
||||
ShortName = sn.Name,
|
||||
PositionNumber = pn.Name,
|
||||
PositionLevel = rp2_dt == null ? _profileService.GetPositionLevel(pm.Id) : rp2_dt.PositionLevel,
|
||||
|
||||
PositionName = $"{pp.Name}\r\n",
|
||||
PositionSide = pm.PositionPathSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionPathSideObject>>(pm.PositionPathSideObject).GetNameList(),
|
||||
PositionExecutive = pm_exp == null ? "" : $"{pm_exp.Name}\r\n",
|
||||
PositionExecutiveSide = pm.PositionExecutiveSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionExecutiveSideObject>>(pm.PositionExecutiveSideObject).GetNameList(),
|
||||
Remark = op.PositionUserNote,
|
||||
OcOrder = oc.OrganizationOrder.Value,
|
||||
PositionType = pt.Name,
|
||||
|
||||
|
||||
OcIdNew = rp2_dt == null ? op.OrganizationId.Value : rp2_dt.OcId,
|
||||
OcFullNameNew = _profileService.FindOCFullPathWithNewLine(op.OrganizationId.Value, false, suppress: RootOcName),
|
||||
OcNameNew = rp2_dt == null ? _profileService.GetOrganizationName(op.OrganizationId.Value) : _profileService.GetOrganizationName(rp2_dt.OcId),
|
||||
ShortNameNew = rp2_dt == null ? "" : rp2_dt.ShortName,
|
||||
PositionNumberNew = rp2_dt == null ? "" : rp2_dt.PositionNumber,
|
||||
PositionLevelNew = rp2_dt == null ? "" : rp2_dt.PositionLevel,
|
||||
PositionNameNew = rp2_dt == null ? "" : rp2_dt.PositionPath,
|
||||
PositionSideNew = rp2_dt == null ? "" : rp2_dt.PositionPathSide,
|
||||
PositionExecutiveNew = rp2_dt == null ? "" : rp2_dt.PositionExecutive,
|
||||
PositionExecutiveSideNew = rp2_dt == null ? "" : rp2_dt.PositionExecutiveSide,
|
||||
PositionTypeNew = rp2_dt == null ? "" : rp2_dt.PositionType,
|
||||
public class OrganizationReportService
|
||||
{
|
||||
#region " Fields "
|
||||
|
||||
private readonly EHRDbContext _context;
|
||||
private readonly EHRDbContext _applicationDbContext;
|
||||
private readonly ProfileService _profileService;
|
||||
|
||||
#endregion
|
||||
|
||||
#region " Constructor and Destructor "
|
||||
|
||||
public OrganizationReportService(EHRDbContext context,
|
||||
EHRDbContext applicationDbContext,
|
||||
ProfileService profileService)
|
||||
{
|
||||
_context = context;
|
||||
_applicationDbContext = applicationDbContext;
|
||||
_profileService = profileService;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region " Methods "
|
||||
|
||||
#region " Report Query "
|
||||
|
||||
public async Task<IEnumerable<dynamic>?> GetOrganizationTypes(string type)
|
||||
{
|
||||
var Organizations = await _context.Organizations.ToListAsync();
|
||||
|
||||
var OrganizationOrganizations = await _context.OrganizationOrganizations.ToListAsync();
|
||||
var OrganizationTypes = await _context.OrganizationTypes.FirstOrDefaultAsync(x => x.Name == type);
|
||||
|
||||
if (OrganizationTypes == null)
|
||||
{
|
||||
throw new Exception("Invalid Organization type.");
|
||||
}
|
||||
|
||||
var dataType = (from o in Organizations
|
||||
join os in OrganizationOrganizations on o.OrganizationOrganizationId equals os.Id into os1
|
||||
from os in os1.DefaultIfEmpty()
|
||||
where o.OrganizationTypeId == OrganizationTypes.Id && os != null
|
||||
orderby o.OrganizationOrder
|
||||
select new
|
||||
{
|
||||
organizationId = o.Id,
|
||||
organizationName = os.Name
|
||||
}).ToList();
|
||||
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public async Task<List<Account1ResultItem>> GetReport1Query(Guid ocId)
|
||||
{
|
||||
var ocIdList = _profileService.GetAllIdByRoot(ocId);
|
||||
var RootOcName = _profileService.GetOrganizationNameFullPath(ocId, false, false);
|
||||
|
||||
var organizationPositions = await _context.OrganizationPositions.ToListAsync();
|
||||
var positionMasters = await _context.PositionMasters.ToListAsync();
|
||||
var organizations = await _context.Organizations.ToListAsync();
|
||||
var organizationOrganizations = await _applicationDbContext.OrganizationOrganizations.ToListAsync();
|
||||
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
||||
var positionNumbers = await _context.PositionNumbers.ToListAsync();
|
||||
var executivePositions = await _applicationDbContext.PositionExecutives.ToListAsync();
|
||||
var executivePositionSide = await _applicationDbContext.PositionExecutiveSides.ToListAsync();
|
||||
var positionPaths = await _applicationDbContext.PositionPaths.ToListAsync();
|
||||
var positionPathSides = await _applicationDbContext.PositionPathSides.ToListAsync();
|
||||
var positionTypes = await _applicationDbContext.PositionTypes.ToListAsync();
|
||||
|
||||
var data = (from op in organizationPositions
|
||||
join pm in positionMasters on op.PositionMasterId equals pm.Id
|
||||
join oc in organizations on op.OrganizationId equals oc.Id
|
||||
join oc_n in organizationOrganizations on oc.OrganizationOrganizationId equals oc_n.Id
|
||||
join sn in organizationShortNames on oc.OrganizationShortNameId equals sn.Id
|
||||
join pn in positionNumbers on op.PositionNumberId equals pn.Id
|
||||
join pp in positionPaths on pm.PositionPathId equals pp.Id
|
||||
join pps in positionPathSides on pm.PositionPathSideId equals pps.Id into pp_pps_join
|
||||
from pp_pps in pp_pps_join.DefaultIfEmpty()
|
||||
join ex_p in executivePositions on pm.PositionExecutiveId equals ex_p.Id into pm_exp_join
|
||||
from pm_exp in pm_exp_join.DefaultIfEmpty()
|
||||
join ex_p_s in executivePositionSide on pm.PositionExecutiveSideId equals ex_p_s.Id into pm_exp_s_join
|
||||
from pm_exp_s in pm_exp_s_join.DefaultIfEmpty()
|
||||
join pt in positionTypes on pm.PositionTypeId equals pt.Id
|
||||
where ocIdList.Contains((Guid)op.OrganizationId)
|
||||
select new Account1ResultItem
|
||||
{
|
||||
Id = op.Id,
|
||||
RootOcId = ocId,
|
||||
RootOcName = RootOcName,
|
||||
OcId = op.OrganizationId.Value,
|
||||
OcFullName = _profileService.FindOCFullPathWithNewLine(op.OrganizationId.Value, false, suppress: RootOcName),
|
||||
OcName = _profileService.GetOrganizationName(op.OrganizationId.Value),
|
||||
ShortName = sn.Name,
|
||||
PositionNumber = pn.Name,
|
||||
PositionLevel = _profileService.GetPositionLevel(pm.Id),
|
||||
PositionName = $"{pp.Name}\r\n",
|
||||
PositionSide = pm.PositionPathSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionPathSideObject>>(pm.PositionPathSideObject).GetNameList(),
|
||||
PositionExecutive = pm_exp == null ? "" : $"{pm_exp.Name}\r\n",
|
||||
PositionExecutiveSide = pm.PositionExecutiveSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionExecutiveSideObject>>(pm.PositionExecutiveSideObject).GetNameList(),
|
||||
Remark = op.PositionUserNote,
|
||||
OcOrder = oc.OrganizationOrder.Value,
|
||||
PositionType = pt.Name,
|
||||
IsDirector = pm.IsDirector.Value ? 0 : 1,
|
||||
GovernmentCode = sn.GovernmentCode == null || sn.GovernmentCode == "" ? sn.AgencyCode : sn.GovernmentCode
|
||||
}).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
private string GetShortNameFromPosNo(string posno)
|
||||
{
|
||||
if (string.IsNullOrEmpty(posno)) return "";
|
||||
var posArray = posno.Split('.');
|
||||
var ret = string.Empty;
|
||||
|
||||
for (var i = 0; i < posArray.Length - 1; i++)
|
||||
{
|
||||
ret += $"{posArray[i]}.";
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private int GetPosnoIntFromPosNo(string posno)
|
||||
{
|
||||
if (string.IsNullOrEmpty(posno)) return 999;
|
||||
var posArray = posno.Split('.');
|
||||
|
||||
return Convert.ToInt32(posArray.Last());
|
||||
}
|
||||
|
||||
private Guid GetOcId(Guid shortNameId, Guid nameId)
|
||||
{
|
||||
var data = _context.Organizations.AsNoTracking()
|
||||
.FirstOrDefault(x => x.OrganizationShortNameId == shortNameId &&
|
||||
x.OrganizationOrganizationId == nameId);
|
||||
if (data == null) return Guid.Empty;
|
||||
else return data.Id;
|
||||
}
|
||||
|
||||
private string GetCitizenId(Guid profileId)
|
||||
{
|
||||
var data = _context.Profiles.AsNoTracking().FirstOrDefault(x => x.Id == profileId);
|
||||
|
||||
return data == null ? "" : data.CitizenId;
|
||||
}
|
||||
private string GetPrefix(Guid profileId)
|
||||
{
|
||||
var data = _context.Profiles.AsNoTracking().FirstOrDefault(x => x.Id == profileId);
|
||||
if (data == null) return "";
|
||||
|
||||
var prefix = _context.Prefixes.AsNoTracking().FirstOrDefault(x => x.Id == data.PrefixId);
|
||||
|
||||
return prefix == null ? "" : prefix.Name;
|
||||
}
|
||||
|
||||
private string GetFirstName(Guid profileId)
|
||||
{
|
||||
var data = _context.Profiles.AsNoTracking().FirstOrDefault(x => x.Id == profileId);
|
||||
|
||||
return data == null ? "" : data.FirstName;
|
||||
}
|
||||
|
||||
private string GetLastName(Guid profileId)
|
||||
{
|
||||
var data = _context.Profiles.AsNoTracking().FirstOrDefault(x => x.Id == profileId);
|
||||
|
||||
return data == null ? "" : data.LastName;
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<Account2ResultItem>> GetReport2Query(Guid ocId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var ocIdList = _profileService.GetAllIdByRoot(ocId);
|
||||
var RootOcName = _profileService.GetOrganizationNameFullPath(ocId, false, false);
|
||||
|
||||
var organizationPositions = await _context.OrganizationPositions.ToListAsync();
|
||||
var positionMasters = await _context.PositionMasters.ToListAsync();
|
||||
var organizations = await _context.Organizations.ToListAsync();
|
||||
var organizationOrganizations = await _applicationDbContext.OrganizationOrganizations.ToListAsync();
|
||||
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
||||
var positionNumbers = await _context.PositionNumbers.ToListAsync();
|
||||
var executivePositions = await _applicationDbContext.PositionExecutives.ToListAsync();
|
||||
var executivePositionSide = await _applicationDbContext.PositionExecutiveSides.ToListAsync();
|
||||
var positionPaths = await _applicationDbContext.PositionPaths.ToListAsync();
|
||||
var positionPathSides = await _applicationDbContext.PositionPathSides.ToListAsync();
|
||||
var positionTypes = await _applicationDbContext.PositionTypes.ToListAsync();
|
||||
var profilePositions = await _context.ProfilePositions.ToListAsync();
|
||||
var prefixes = await _context.Prefixes.ToListAsync();
|
||||
var profiles = await _context.Profiles.ToListAsync();
|
||||
var report2 = await _context.Report2s.ToListAsync();
|
||||
|
||||
var profile_data = (from p in _context.Profiles
|
||||
join pf in _context.Prefixes on p.PrefixId equals pf.Id
|
||||
select new
|
||||
{
|
||||
p.Id,
|
||||
p.CitizenId,
|
||||
Prefix = pf.Name,
|
||||
p.FirstName,
|
||||
p.LastName,
|
||||
p.PositionLine,
|
||||
p.Position,
|
||||
p.PositionPathSide,
|
||||
p.PositionType,
|
||||
p.PositionLevel,
|
||||
p.PositionExecutive,
|
||||
p.PositionExecutiveSide,
|
||||
p.PosNo,
|
||||
p.OrganizationShortName,
|
||||
Degree = p.Educations == null || p.Educations.Count == 0 ? "" : $"{p.Educations.OrderBy(x => x.StartDate).Last().Degree}\r\n({p.Educations.OrderBy(x => x.StartDate).Last().Field})",
|
||||
Salary = p.Salaries == null || p.Salaries.Count == 0 ? 0 : p.Salaries.OrderBy(x => x.Date).Last().Amount,
|
||||
SalaryPosition = p.Salaries == null || p.Salaries.Count == 0 ? 0 : p.Salaries.OrderBy(x => x.Date).Last().PositionSalaryAmount,
|
||||
|
||||
}).ToList();
|
||||
|
||||
|
||||
var report2_raw_data = (from r in _context.Report2s.AsNoTracking().ToList()
|
||||
join ppos in _context.ProfilePositions.AsNoTracking().ToList() on r.ProfilePositionId equals ppos.Id into r_ppos_join
|
||||
from ppos_join in r_ppos_join.DefaultIfEmpty()
|
||||
//join pf in profile_data.ToList() on ppos_join.ProfileId equals pf.Id into r_pf_join
|
||||
//from pf_join in r_pf_join.DefaultIfEmpty()
|
||||
select new
|
||||
{
|
||||
Id = r.Id,
|
||||
ProfilePositionId = ppos_join == null ? Guid.Empty : ppos_join.Id,
|
||||
CitizenId = ppos_join != null ? GetCitizenId(ppos_join.ProfileId.Value) : "",
|
||||
Prefix = ppos_join != null ? GetPrefix(ppos_join.ProfileId.Value) : "",
|
||||
FirstName = ppos_join != null ? GetFirstName(ppos_join.ProfileId.Value) : "",
|
||||
LastName = ppos_join != null ? GetLastName(ppos_join.ProfileId.Value) : "",
|
||||
// new
|
||||
OrganizationName = r.OrganizationOrganization,
|
||||
ShortName = GetShortNameFromPosNo(r.PositionNum),
|
||||
PositionNumber = r.PositionNum,
|
||||
PositionNumberInt = GetPosnoIntFromPosNo(r.PositionNum),
|
||||
PositionPath = r.PositionPath,
|
||||
PositionPathSide = r.PositionPathSide,
|
||||
PositionType = r.PositionType,
|
||||
PositionLevel = r.PositionLevel,
|
||||
PositionExecutive = r.PositionExecutive,
|
||||
PositionExecutiveSide = r.PositionExecutiveSide,
|
||||
|
||||
OrganizationPositionId = ppos_join == null ? Guid.Empty : ppos_join.OrganizationPositionId,
|
||||
|
||||
// old
|
||||
OcId = GetOcId(r.OrganizationShortNameId.Value, r.OrganizationOrganizationId.Value),
|
||||
Degree = ppos_join == null ? "" : (profile_data.Where(x => x.Id == ppos_join.ProfileId).FirstOrDefault().Degree),
|
||||
Salary = ppos_join == null ? 0 : (profile_data.Where(x => x.Id == ppos_join.ProfileId).FirstOrDefault().Salary),
|
||||
SalaryPosition = ppos_join == null ? 0 : (profile_data.Where(x => x.Id == ppos_join.ProfileId).FirstOrDefault().SalaryPosition),
|
||||
|
||||
ShortNameOld = GetShortNameFromPosNo(r.PositionNumOld),
|
||||
PositionNumberOld = r.PositionNumOld,
|
||||
PositionNumberOldInt = GetPosnoIntFromPosNo(r.PositionNumOld),
|
||||
GovCode = r.GovernmentCodeOld,
|
||||
GovCodeNew = r.GovernmentCode,
|
||||
PositionName = r.PositionPath,
|
||||
PositionNameOld = r.PositionPathOld,
|
||||
|
||||
|
||||
PositionPathOld = r.PositionPathOld,
|
||||
PositionPathSideOld = r.PositionPathSideOld,
|
||||
PositionTypeOld = r.PositionTypeOld,
|
||||
PositionLevelOld = r.PositionLevelOld,
|
||||
PositionExecutiveOld = r.PositionExecutiveOld,
|
||||
PositionExecutiveSideOld = r.PositionExecutiveSideOld,
|
||||
}).ToList();
|
||||
|
||||
|
||||
//var report2_data = (from org_pos in _context.OrganizationPositions.ToList()
|
||||
// join ppos in _context.ProfilePositions.ToList() on org_pos.Id equals ppos.OrganizationPositionId
|
||||
// join pf in profile_data.ToList() on ppos.ProfileId equals pf.Id
|
||||
// join r_raw in _context.Report2s.ToList() on ppos.Id equals r_raw.ProfilePositionId into r_join
|
||||
// from r in r_join.DefaultIfEmpty()
|
||||
// select new
|
||||
// {
|
||||
// //Report2Id = r.Id,
|
||||
// ProfilePositionId = ppos.Id,
|
||||
// CitizenId = pf.CitizenId,
|
||||
// Prefix = pf.Prefix,
|
||||
// FirstName = pf.FirstName,
|
||||
// LastName = pf.LastName,
|
||||
// OrganizationName = r == null ? "" : r.OrganizationOrganization,
|
||||
// ShortName = r == null ? pf.OrganizationShortName : GetShortNameFromPosNo(r.PositionNum),
|
||||
// PositionNumber = r == null ? pf.PosNo : r.PositionNum,
|
||||
// PositionNumberInt = r == null ? GetPosnoIntFromPosNo(pf.PosNo) : GetPosnoIntFromPosNo(r.PositionNum),
|
||||
// PositionPath = r == null ? pf.Position : r.PositionPath,
|
||||
// PositionPathSide = r == null ? pf.PositionPathSide : r.PositionPathSide,
|
||||
// PositionType = r == null ? pf.PositionType : r.PositionType,
|
||||
// PositionLevel = r == null ? pf.PositionLevel : r.PositionLevel,
|
||||
// PositionExecutive = r == null ? pf.PositionExecutive : r.PositionExecutive,
|
||||
// PositionExecutiveSide = r == null ? pf.PositionExecutiveSide : r.PositionExecutiveSide,
|
||||
// OcId = org_pos.Id,
|
||||
// OrganizationPositionId = ppos.OrganizationPositionId,
|
||||
// Degree = pf.Degree,
|
||||
// Salary = pf.Salary,
|
||||
// SalaryPosition = pf.SalaryPosition,
|
||||
|
||||
// ShortNameOld = r == null ? pf.OrganizationShortName : GetShortNameFromPosNo(r.PositionNumOld),
|
||||
// PositionNumberOld = r == null ? pf.PosNo : r.PositionNumOld,
|
||||
// PositionNumberOldInt = r == null ? GetPosnoIntFromPosNo(pf.PosNo) : GetPosnoIntFromPosNo(r.PositionNumOld),
|
||||
|
||||
// }).ToList();
|
||||
|
||||
//var report2_data = (from r in _context.Report2s.ToList()
|
||||
// join ppos in _context.ProfilePositions.ToList() on r.ProfilePositionId equals ppos.Id
|
||||
// join org_pos in _context.OrganizationPositions.ToList() on ppos.OrganizationPositionId equals org_pos.Id
|
||||
// join pf in profile_data.ToList() on ppos.ProfileId equals pf.Id
|
||||
// select new
|
||||
// {
|
||||
// Id = r.Id,
|
||||
// ProfilePositionId = r.ProfilePositionId,
|
||||
// CitizenId = pf.CitizenId,
|
||||
// Prefix = pf.Prefix,
|
||||
// FirstName = pf.FirstName,
|
||||
// LastName = pf.LastName,
|
||||
// OrganizationName = r.OrganizationOrganization,
|
||||
// ShortName = r.OrganizationShortName,
|
||||
// PositionNumber = r.PositionNum,
|
||||
// PositionPath = r.PositionPath,
|
||||
// PositionPathSide = r.PositionPathSide,
|
||||
// PositionType = r.PositionType,
|
||||
// PositionLevel = r.PositionLevel,
|
||||
// PositionExecutive = r.PositionExecutive,
|
||||
// PositionExecutiveSide = r.PositionExecutiveSide,
|
||||
// OcId = org_pos.Id,
|
||||
// OrganizationPositionId = ppos.OrganizationPositionId,
|
||||
// Degree = pf.Degree,
|
||||
// Salary = pf.Salary,
|
||||
// SalaryPosition = pf.SalaryPosition,
|
||||
// }).ToList();
|
||||
|
||||
|
||||
var data2 = (from r in report2_raw_data
|
||||
where ocIdList.Contains(r.OcId)
|
||||
select new Account2ResultItem
|
||||
{
|
||||
Id = r.Id,
|
||||
RootOcId = ocId,
|
||||
RootOcName = RootOcName,
|
||||
GovernmentCode = r.GovCode,
|
||||
OcId = r.OcId,
|
||||
OcFullName = _profileService.FindOCFullPathWithNewLine(r.OcId, false, suppress: RootOcName),
|
||||
OcName = _profileService.GetOrganizationName(r.OcId),
|
||||
ShortName = r.ShortNameOld,
|
||||
PositionNumber = r.PositionNumberOld,
|
||||
PositionLevel = r.PositionLevelOld,
|
||||
PositionName = $"{r.PositionNameOld}\r\n",
|
||||
PositionSide = r.PositionPathSideOld,
|
||||
PositionExecutive = r.PositionExecutiveOld,
|
||||
PositionExecutiveSide = r.PositionExecutiveSideOld,
|
||||
Remark = "",
|
||||
PositionType = r.PositionTypeOld,
|
||||
OcIdNew = r.OcId,
|
||||
OcFullNameNew = _profileService.FindOCFullPathWithNewLine(r.OcId, false, suppress: RootOcName),
|
||||
OcNameNew = _profileService.GetOrganizationName(r.OcId),
|
||||
ShortNameNew = r.ShortName,
|
||||
PositionNumberNew = r.PositionNumber,
|
||||
PositionLevelNew = r.PositionLevel,
|
||||
PositionNameNew = $"{r.PositionName}\r\n",
|
||||
PositionSideNew = r.PositionPathSide,
|
||||
PositionExecutiveNew = r.PositionExecutive,
|
||||
PositionExecutiveSideNew = r.PositionExecutiveSide,
|
||||
PositionTypeNew = r.PositionType,
|
||||
|
||||
|
||||
PositionNumberInt = r.PositionNumberOldInt,
|
||||
PositionNumberIntNew = r.PositionNumberInt,
|
||||
|
||||
|
||||
Prefix = r.Prefix,
|
||||
FirstName = r.FirstName,
|
||||
LastName = r.LastName,
|
||||
Degree = r.Degree,
|
||||
|
||||
Salary = Convert.ToInt32(r.Salary),
|
||||
SalaryPosition = Convert.ToInt32(r.SalaryPosition)
|
||||
|
||||
}).ToList();
|
||||
|
||||
//var data = (from op in organizationPositions
|
||||
// join pm in positionMasters on op.PositionMasterId equals pm.Id
|
||||
// join oc in organizations on op.OrganizationId equals oc.Id
|
||||
// join oc_n in organizationOrganizations on oc.OrganizationOrganizationId equals oc_n.Id
|
||||
// join sn in organizationShortNames on oc.OrganizationShortNameId equals sn.Id
|
||||
// join pn in positionNumbers on op.PositionNumberId equals pn.Id
|
||||
// join pp in positionPaths on pm.PositionPathId equals pp.Id
|
||||
// join pps in positionPathSides on pm.PositionPathSideId equals pps.Id into pp_pps_join
|
||||
// from pp_pps in pp_pps_join.DefaultIfEmpty()
|
||||
// join ex_p in executivePositions on pm.PositionExecutiveId equals ex_p.Id into pm_exp_join
|
||||
// from pm_exp in pm_exp_join.DefaultIfEmpty()
|
||||
// join ex_p_s in executivePositionSide on pm.PositionExecutiveSideId equals ex_p_s.Id into pm_exp_s_join
|
||||
// from pm_exp_s in pm_exp_s_join.DefaultIfEmpty()
|
||||
// join pt in positionTypes on pm.PositionTypeId equals pt.Id
|
||||
// join rp2 in report2_raw_data.ToList() on op.Id equals rp2.OrganizationPositionId into rp2_join
|
||||
// from rp2_dt in rp2_join.DefaultIfEmpty()
|
||||
|
||||
// where ocIdList.Contains((Guid)op.OrganizationId)
|
||||
// select new Account2ResultItem
|
||||
// {
|
||||
// Id = op.Id,
|
||||
// RootOcId = ocId,
|
||||
// RootOcName = RootOcName,
|
||||
// OcId = op.OrganizationId.Value,
|
||||
// OcFullName = _profileService.FindOCFullPathWithNewLine(op.OrganizationId.Value, false, suppress: RootOcName),
|
||||
// OcName = _profileService.GetOrganizationName(op.OrganizationId.Value),
|
||||
// ShortName = sn.Name,
|
||||
// PositionNumber = pn.Name,
|
||||
// PositionLevel = rp2_dt == null ? _profileService.GetPositionLevel(pm.Id) : rp2_dt.PositionLevel,
|
||||
|
||||
// PositionName = $"{pp.Name}\r\n",
|
||||
// PositionSide = pm.PositionPathSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionPathSideObject>>(pm.PositionPathSideObject).GetNameList(),
|
||||
// PositionExecutive = pm_exp == null ? "" : $"{pm_exp.Name}\r\n",
|
||||
// PositionExecutiveSide = pm.PositionExecutiveSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionExecutiveSideObject>>(pm.PositionExecutiveSideObject).GetNameList(),
|
||||
// Remark = op.PositionUserNote,
|
||||
// OcOrder = oc.OrganizationOrder.Value,
|
||||
// PositionType = pt.Name,
|
||||
|
||||
Prefix = rp2_dt == null ? "" : rp2_dt.Prefix,
|
||||
FirstName = rp2_dt == null ? "" : rp2_dt.FirstName,
|
||||
LastName = rp2_dt == null ? "" : rp2_dt.LastName,
|
||||
Degree = rp2_dt == null ? (pm == null ? "" : pm.Qualification) : rp2_dt.Degree,
|
||||
|
||||
Salary = rp2_dt == null ? 0 : (int)rp2_dt.Salary.Value,
|
||||
SalaryPosition = rp2_dt == null ? 0 : (int)rp2_dt.SalaryPosition.Value,
|
||||
// OcIdNew = rp2_dt == null ? op.OrganizationId.Value : rp2_dt.OcId,
|
||||
// OcFullNameNew = _profileService.FindOCFullPathWithNewLine(op.OrganizationId.Value, false, suppress: RootOcName),
|
||||
// OcNameNew = rp2_dt == null ? _profileService.GetOrganizationName(op.OrganizationId.Value) : _profileService.GetOrganizationName(rp2_dt.OcId),
|
||||
// ShortNameNew = rp2_dt == null ? "" : rp2_dt.ShortName,
|
||||
// PositionNumberNew = rp2_dt == null ? "" : rp2_dt.PositionNumber,
|
||||
// PositionLevelNew = rp2_dt == null ? "" : rp2_dt.PositionLevel,
|
||||
// PositionNameNew = rp2_dt == null ? "" : rp2_dt.PositionPath,
|
||||
// PositionSideNew = rp2_dt == null ? "" : rp2_dt.PositionPathSide,
|
||||
// PositionExecutiveNew = rp2_dt == null ? "" : rp2_dt.PositionExecutive,
|
||||
// PositionExecutiveSideNew = rp2_dt == null ? "" : rp2_dt.PositionExecutiveSide,
|
||||
// PositionTypeNew = rp2_dt == null ? "" : rp2_dt.PositionType,
|
||||
|
||||
// Prefix = rp2_dt == null ? "" : rp2_dt.Prefix,
|
||||
// FirstName = rp2_dt == null ? "" : rp2_dt.FirstName,
|
||||
// LastName = rp2_dt == null ? "" : rp2_dt.LastName,
|
||||
// Degree = rp2_dt == null ? (pm == null ? "" : pm.Qualification) : rp2_dt.Degree,
|
||||
|
||||
}).ToList();
|
||||
// Salary = rp2_dt == null ? 0 : (int)rp2_dt.Salary.Value,
|
||||
// SalaryPosition = rp2_dt == null ? 0 : (int)rp2_dt.SalaryPosition.Value,
|
||||
|
||||
return data;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
// }).ToList();
|
||||
|
||||
#endregion
|
||||
}
|
||||
return data2;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public class Account1ResultItem
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
#endregion
|
||||
|
||||
public Guid RootOcId { get; set; }
|
||||
#endregion
|
||||
}
|
||||
|
||||
public string RootOcName { get; set; } = string.Empty;
|
||||
public class Account1ResultItem
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid OcId { get; set; }
|
||||
public Guid RootOcId { get; set; }
|
||||
|
||||
public string OcFullName { get; set; } = string.Empty;
|
||||
public string RootOcName { get; set; } = string.Empty;
|
||||
|
||||
public string OcName { get; set; } = string.Empty;
|
||||
public Guid OcId { get; set; }
|
||||
|
||||
public string ShortName { get; set; } = string.Empty;
|
||||
public string OcFullName { get; set; } = string.Empty;
|
||||
|
||||
public string PositionNumber { get; set; } = string.Empty;
|
||||
public string OcName { get; set; } = string.Empty;
|
||||
|
||||
public string PositionName { get; set; } = string.Empty;
|
||||
public string ShortName { get; set; } = string.Empty;
|
||||
|
||||
public string PositionSide { get; set; } = string.Empty;
|
||||
public string PositionNumber { get; set; } = string.Empty;
|
||||
|
||||
public string PositionLevel { get; set; } = string.Empty;
|
||||
public string PositionName { get; set; } = string.Empty;
|
||||
|
||||
public string PositionExecutive { get; set; } = string.Empty;
|
||||
public string PositionSide { get; set; } = string.Empty;
|
||||
|
||||
public string PositionExecutiveSide { get; set; } = string.Empty;
|
||||
public string PositionLevel { get; set; } = string.Empty;
|
||||
|
||||
public string Remark { get; set; } = string.Empty;
|
||||
public string PositionExecutive { get; set; } = string.Empty;
|
||||
|
||||
public int OcOrder { get; set; } = 0;
|
||||
public string PositionExecutiveSide { get; set; } = string.Empty;
|
||||
|
||||
public int PositionNumberInt { get; set; } = 0;
|
||||
public string Remark { get; set; } = string.Empty;
|
||||
|
||||
public string PositionType { get; set; } = string.Empty;
|
||||
}
|
||||
public int OcOrder { get; set; } = 0;
|
||||
|
||||
public class Account2ResultItem
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public int PositionNumberInt { get; set; } = 0;
|
||||
|
||||
public Guid RootOcId { get; set; }
|
||||
public string PositionType { get; set; } = string.Empty;
|
||||
|
||||
public string RootOcName { get; set; } = string.Empty;
|
||||
public int IsDirector { get; set; } = 0;
|
||||
|
||||
public Guid OcId { get; set; }
|
||||
public string GovernmentCode { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public string OcFullName { get; set; } = string.Empty;
|
||||
public class Account2ResultItem
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string OcName { get; set; } = string.Empty;
|
||||
public Guid RootOcId { get; set; }
|
||||
|
||||
public string ShortName { get; set; } = string.Empty;
|
||||
public string RootOcName { get; set; } = string.Empty;
|
||||
|
||||
public string PositionNumber { get; set; } = string.Empty;
|
||||
public Guid OcId { get; set; }
|
||||
|
||||
public string PositionName { get; set; } = string.Empty;
|
||||
public string OcFullName { get; set; } = string.Empty;
|
||||
|
||||
public string PositionSide { get; set; } = string.Empty;
|
||||
public string OcName { get; set; } = string.Empty;
|
||||
|
||||
public string PositionLevel { get; set; } = string.Empty;
|
||||
public string ShortName { get; set; } = string.Empty;
|
||||
|
||||
public string PositionExecutive { get; set; } = string.Empty;
|
||||
public string PositionNumber { get; set; } = string.Empty;
|
||||
|
||||
public string PositionExecutiveSide { get; set; } = string.Empty;
|
||||
public string PositionName { get; set; } = string.Empty;
|
||||
|
||||
public string Remark { get; set; } = string.Empty;
|
||||
public string PositionSide { get; set; } = string.Empty;
|
||||
|
||||
public int OcOrder { get; set; } = 0;
|
||||
public string PositionLevel { get; set; } = string.Empty;
|
||||
|
||||
public int PositionNumberInt { get; set; } = 0;
|
||||
public string PositionExecutive { get; set; } = string.Empty;
|
||||
|
||||
public string PositionType { get; set; } = string.Empty;
|
||||
public string PositionExecutiveSide { get; set; } = string.Empty;
|
||||
|
||||
// new
|
||||
public Guid RootOcIdNew { get; set; }
|
||||
public string Remark { get; set; } = string.Empty;
|
||||
|
||||
public string RootOcNameNew { get; set; } = string.Empty;
|
||||
public int OcOrder { get; set; } = 0;
|
||||
|
||||
public Guid OcIdNew { get; set; }
|
||||
public int PositionNumberInt { get; set; } = 0;
|
||||
|
||||
public string OcFullNameNew { get; set; } = string.Empty;
|
||||
public string PositionType { get; set; } = string.Empty;
|
||||
|
||||
public string OcNameNew { get; set; } = string.Empty;
|
||||
// new
|
||||
public Guid RootOcIdNew { get; set; }
|
||||
|
||||
public string ShortNameNew { get; set; } = string.Empty;
|
||||
public string RootOcNameNew { get; set; } = string.Empty;
|
||||
|
||||
public string PositionNumberNew { get; set; } = string.Empty;
|
||||
public Guid OcIdNew { get; set; }
|
||||
|
||||
public string PositionNameNew { get; set; } = string.Empty;
|
||||
public string OcFullNameNew { get; set; } = string.Empty;
|
||||
|
||||
public string PositionSideNew { get; set; } = string.Empty;
|
||||
public string OcNameNew { get; set; } = string.Empty;
|
||||
|
||||
public string PositionLevelNew { get; set; } = string.Empty;
|
||||
public string ShortNameNew { get; set; } = string.Empty;
|
||||
|
||||
public string PositionExecutiveNew { get; set; } = string.Empty;
|
||||
public string PositionNumberNew { get; set; } = string.Empty;
|
||||
|
||||
public string PositionExecutiveSideNew { get; set; } = string.Empty;
|
||||
public string PositionNameNew { get; set; } = string.Empty;
|
||||
|
||||
public int PositionNumberIntNew { get; set; } = 0;
|
||||
public string PositionSideNew { get; set; } = string.Empty;
|
||||
|
||||
public string PositionTypeNew { get; set; } = string.Empty;
|
||||
public string PositionLevelNew { get; set; } = string.Empty;
|
||||
|
||||
// name
|
||||
public string Prefix { get; set; } = string.Empty;
|
||||
public string PositionExecutiveNew { get; set; } = string.Empty;
|
||||
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
public string PositionExecutiveSideNew { get; set; } = string.Empty;
|
||||
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
public int PositionNumberIntNew { get; set; } = 0;
|
||||
|
||||
public string Degree { get; set; } = string.Empty;
|
||||
public string PositionTypeNew { get; set; } = string.Empty;
|
||||
|
||||
public int Salary { get; set; } = 0;
|
||||
// name
|
||||
public string Prefix { get; set; } = string.Empty;
|
||||
|
||||
public int SalaryPosition { get; set; } = 0;
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
public string Degree { get; set; } = string.Empty;
|
||||
|
||||
public class OrganizationItem
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public int Salary { get; set; } = 0;
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public int SalaryPosition { get; set; } = 0;
|
||||
|
||||
public int Order { get; set; } = 0;
|
||||
}
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
|
||||
public string GovernmentCode { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
public class OrganizationItem
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public int Order { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"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;",
|
||||
"EHRConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;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;"
|
||||
},
|
||||
"Jwt": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue