988 lines
54 KiB
C#
988 lines
54 KiB
C#
using Amazon.Internal;
|
|
// using BMA.EHR.Core;
|
|
using BMA.EHR.Organization.Service.Extensions;
|
|
using BMA.EHR.Profile.Service.Services;
|
|
using BMA.EHR.Report.Service.Data;
|
|
using Microsoft.CodeAnalysis.CSharp;
|
|
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 " Private "
|
|
|
|
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;
|
|
}
|
|
|
|
private async Task<List<Guid>> GetAllIdByRootAsync(Guid id)
|
|
{
|
|
try
|
|
{
|
|
var ret = new List<Guid>();
|
|
|
|
var oc = await _context.Organizations
|
|
.Select(x => new { x.Id, x.ParentId })
|
|
.FirstOrDefaultAsync(x => x.Id == id);
|
|
if (oc == null)
|
|
throw new Exception("ไม่พบข้อมูลในระบบ");
|
|
ret.Add(oc.Id);
|
|
|
|
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)
|
|
{
|
|
ret.AddRange(await GetAllIdByRootAsync(item.Id));
|
|
}
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
catch
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
private async Task<List<OrganizationItem>> GetAllOcItemByRootAsync(Guid id, string level = "1")
|
|
{
|
|
try
|
|
{
|
|
var ret = new List<OrganizationItem>();
|
|
|
|
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("ไม่พบข้อมูลในระบบ");
|
|
var thisLevel = level;
|
|
//var thisLevel = oc.OrganizationOrder.Value;
|
|
ret.Add(new OrganizationItem { Id = oc.Id, Order = thisLevel.ToString() });
|
|
|
|
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;
|
|
foreach (var item in child)
|
|
{
|
|
ret.AddRange(await GetAllOcItemByRootAsync(item.Id, $"{thisLevel}-{c}"));
|
|
c++;
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
catch
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
private async Task<Guid> GetOrgIdByOrgPositionId(Guid orgPositionId)
|
|
{
|
|
var data = await _applicationDbContext.OrganizationPositions.FirstOrDefaultAsync(x => x.Id == orgPositionId);
|
|
|
|
return data is null ? Guid.Empty : data.OrganizationId.Value;
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region " Report Query "
|
|
|
|
public async Task<IEnumerable<dynamic>?> GetOrganizationTypes(string type)
|
|
{
|
|
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);
|
|
|
|
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 orgWithOrder = new List<OrganizationItem>();
|
|
orgWithOrder = await GetAllOcItemByRootAsync(ocId);
|
|
|
|
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,
|
|
PositionTypeId = x.PositionType == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.PositionType.Id,
|
|
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();
|
|
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
|
|
|
|
join orgOrder in orgWithOrder on op.OrganizationId equals orgOrder.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 = orgOrder.Order,
|
|
PositionType = pt.Name,
|
|
IsDirector = pm.IsDirector.Value ? 0 : 1,
|
|
GovernmentCode = sn.GovernmentCode == null || sn.GovernmentCode == "" ? sn.AgencyCode : sn.GovernmentCode
|
|
}).ToList()
|
|
.OrderBy(x => x.OcOrder).ThenBy(x => GetPosnoIntFromPosNo(x.PositionNumber))
|
|
.ToList();
|
|
|
|
return data;
|
|
}
|
|
|
|
public async Task<List<Account2ResultItem>> GetReport2Query(Guid organizationId)
|
|
{
|
|
var organizations = new List<Guid>();
|
|
organizations = await GetAllIdByRootAsync(organizationId);
|
|
|
|
var orgWithOrder = new List<OrganizationItem>();
|
|
orgWithOrder = await GetAllOcItemByRootAsync(organizationId);
|
|
|
|
var ocIdList = _profileService.GetAllIdByRoot(organizationId);
|
|
var RootOcName = _profileService.GetOrganizationNameFullPath(organizationId, false, false);
|
|
|
|
var prefixes = await _applicationDbContext.Prefixes.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
|
|
.Select(x => new
|
|
{
|
|
x.Id,
|
|
x.PositionPathId,
|
|
x.PositionPathSideId,
|
|
x.PositionExecutiveId,
|
|
x.PositionExecutiveSideId,
|
|
PositionTypeId = x.PositionType == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.PositionType.Id,
|
|
x.PositionPathSideObject,
|
|
x.PositionExecutiveSideObject,
|
|
x.IsDirector,
|
|
x.Qualification
|
|
})
|
|
.ToListAsync();
|
|
|
|
var profiles = await _applicationDbContext.Profiles.Include(x => x.PositionLevel).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
|
|
.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
|
|
where organizations.Contains(op.OrganizationId == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : op.OrganizationId.Value)
|
|
join oc in orgData on op?.OrganizationId equals oc?.Id
|
|
join pp in profilePositions on op?.Id equals pp?.OrganizationPositionId into ppGroup
|
|
from pp in ppGroup.DefaultIfEmpty()
|
|
join pn in positionNumbers on op?.PositionNumberId equals pn?.Id into pnGroup
|
|
from pn in pnGroup.DefaultIfEmpty()
|
|
join os in organizationShortNames on pn?.OrganizationShortNameId equals os?.Id into osGroup
|
|
from os in osGroup.DefaultIfEmpty()
|
|
join pm in positionMasters on op?.PositionMasterId equals pm?.Id into pmGroup
|
|
from pm in pmGroup.DefaultIfEmpty()
|
|
join pPath in positionPaths on pm?.PositionPathId equals pPath?.Id into pPathGroup
|
|
from pPath in pPathGroup.DefaultIfEmpty()
|
|
|
|
join ps in positionPathSides on pm?.PositionPathSideId equals ps?.Id into psGroup
|
|
from ps in psGroup.DefaultIfEmpty()
|
|
join pe in positionExecutives on pm?.PositionExecutiveId equals pe?.Id into peGroup
|
|
from pe in peGroup.DefaultIfEmpty()
|
|
join pes in positionExecutiveSides on pm?.PositionExecutiveSideId equals pes?.Id into pesGroup
|
|
from pes in pesGroup.DefaultIfEmpty()
|
|
|
|
join pt in positionTypes on pm?.PositionTypeId equals pt?.Id into ptGroup
|
|
from pt in ptGroup.DefaultIfEmpty()
|
|
|
|
|
|
join p in profiles on pp?.ProfileId equals p?.Id into pGroup
|
|
from p in pGroup.DefaultIfEmpty()
|
|
join pf in prefixes on p?.PrefixId equals pf?.Id into pfGroup
|
|
from pf in pfGroup.DefaultIfEmpty()
|
|
join rp in report2s on pn?.Id equals rp?.PositionNumId into rpGroup
|
|
from rp in rpGroup.DefaultIfEmpty()
|
|
join pnNew in positionNumbers on rp == null ? op?.PositionNumberId : rp?.PositionNumId equals pnNew?.Id into pnNewGroup
|
|
from pnNew in pnNewGroup.DefaultIfEmpty()
|
|
join ppNew in positionPaths on rp == null ? pm?.PositionPathId : rp?.PositionPathId equals ppNew?.Id into ppNewGroup
|
|
from ppNew in ppNewGroup.DefaultIfEmpty()
|
|
join plNew in positionLevels on rp == null ? (p?.PositionLevel == null ? null : p?.PositionLevel.Id) : rp?.PositionLevelId equals plNew?.Id into plNewGroup
|
|
from plNew in plNewGroup.DefaultIfEmpty()
|
|
|
|
join psNew in positionPathSides on rp == null ? pm?.PositionPathSideId : rp?.PositionPathSideId equals psNew?.Id into psNewGroup
|
|
from psNew in psNewGroup.DefaultIfEmpty()
|
|
join peNew in positionExecutives on rp == null ? pm?.PositionExecutiveId : rp?.PositionExecutiveId equals peNew?.Id into peNewGroup
|
|
from peNew in peNewGroup.DefaultIfEmpty()
|
|
join pesNew in positionExecutiveSides on rp == null ? pm?.PositionExecutiveSideId : rp?.PositionExecutiveSideId equals pesNew?.Id into pesNewGroup
|
|
from pesNew in pesNewGroup.DefaultIfEmpty()
|
|
|
|
join ptNew in positionTypes on rp == null ? pm?.PositionTypeId : rp?.PositionTypeId equals ptNew?.Id into ptNewGroup
|
|
from ptNew in ptNewGroup.DefaultIfEmpty()
|
|
|
|
//join orgOrder in orgWithOrder on op.OrganizationId equals orgOrder.Id
|
|
|
|
|
|
select new
|
|
{
|
|
ProfilePositionId = pp == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : pp.Id,
|
|
ProfileId = p == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Id,
|
|
Prefix = pf == null ? null : pf.Name,
|
|
FirstName = p == null ? null : p.FirstName,
|
|
LastName = p == null ? null : p.LastName,
|
|
PositionNumberOld = rp == null ? (pn == null ? null : pn.Name) : rp.PositionNumOld,
|
|
PositionPathOld = rp == null ? (pPath == null ? null : pPath.Name) : rp.PositionPathOld,
|
|
PositionLevelOld = rp == null ? (p == null ? null : p.PositionLevel?.Name) : rp.PositionLevelOld,
|
|
PositionNumberIdNew = pnNew == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : pnNew.Id,
|
|
PositionNumberNew = pnNew == null ? null : pnNew.Name,
|
|
PositionPathNew = ppNew == null ? null : ppNew.Name,
|
|
PositionLevelNew = plNew == null ? null : plNew.Name,
|
|
PositionMasterId = pm == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : pm.Id,
|
|
Qualification = pm == null ? null : pm.Qualification,
|
|
OrganizationShortName = os == null ? null : os.Name,
|
|
Change = rp == null ? null : (rp == null ? null : rp.Status),
|
|
StatusPosition = p == null ? false : true,
|
|
Report2 = rp,
|
|
ocId = op.OrganizationId,
|
|
ocIdNew = rp == null ? op.OrganizationId : GetOrgIdByOrgPositionId(rp.OrganizationPositionId.Value).Result,
|
|
PositionPathSideOld = rp == null ? (ps == null ? null : ps.Name) : rp.PositionPathSideOld,
|
|
PositionPathSideNew = psNew == null ? null : psNew.Name,
|
|
PositionExecutiveOld = rp == null ? (pe == null ? null : pe.Name) : rp.PositionExecutiveOld,
|
|
PositionExecutiveNew = peNew == null ? null : peNew.Name,
|
|
PositionExecutiveSideOld = rp == null ? (pes == null ? null : pes.Name) : rp.PositionExecutiveSideOld,
|
|
PositionExecutiveSideNew = pesNew == null ? null : pesNew.Name,
|
|
Remark = op.PositionUserNote ?? "",
|
|
//OcOrder = orgOrder.Order,
|
|
PositonTypeOld = rp == null ? (pt == null ? null : pt.Name) : rp.PositionTypeOld,
|
|
PositionTypeNew = ptNew == null ? null : ptNew.Name,
|
|
|
|
})
|
|
.ToList();
|
|
//.OrderBy(x => x.OcOrder).ThenBy(x => GetPosnoIntFromPosNo(x.PositionNumberOld))
|
|
//.ToList();
|
|
|
|
var results = new List<Account2ResultItem>();
|
|
|
|
var PositionLevels = await _applicationDbContext.PositionLevels
|
|
.ToListAsync();
|
|
|
|
foreach (var r in raw_results.ToList())
|
|
{
|
|
var salaryRecord = _applicationDbContext.ProfileSalaries.AsQueryable()
|
|
.Include(p => p.Profile)
|
|
.OrderByDescending(x => x.Date)
|
|
.FirstOrDefault(x => x.Profile.Id == r.ProfileId);
|
|
|
|
var lastEducation = _applicationDbContext.ProfileEducations.AsQueryable()
|
|
.Include(p => p.Profile)
|
|
.OrderByDescending(x => x.FinishDate)
|
|
.FirstOrDefault(x => x.Profile.Id == r.ProfileId);
|
|
//.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
|
|
|
var allLevel = await _applicationDbContext.AvailablePositionLevels.ToListAsync();
|
|
|
|
var data = new Account2ResultItem
|
|
{
|
|
Id = r.Report2 == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : r.Report2.Id,
|
|
RootOcId = organizationId,
|
|
RootOcName = RootOcName,
|
|
OcId = r.ocId.Value,
|
|
OcFullName = _profileService.FindOCFullPathWithNewLine(r.ocId.Value, false, suppress: RootOcName),
|
|
OcName = _profileService.GetOrganizationName(r.ocId.Value),
|
|
|
|
ShortName = GetShortNameFromPosNo(r.PositionNumberOld),
|
|
PositionNumber = r.PositionNumberOld,
|
|
PositionLevel = r.PositionLevelOld,
|
|
PositionName = r.PositionPathOld,
|
|
PositionSide = r.PositionPathSideOld,
|
|
PositionExecutive = r.PositionExecutiveOld,
|
|
PositionExecutiveSide = r.PositionExecutiveSideOld,
|
|
Remark = r.Remark,
|
|
PositionType = r.PositonTypeOld,
|
|
|
|
OcIdNew = r.ocIdNew.Value,
|
|
OcFullNameNew = _profileService.FindOCFullPathWithNewLine(r.ocIdNew.Value, false, suppress: RootOcName),
|
|
OcNameNew = _profileService.GetOrganizationName(r.ocIdNew.Value),
|
|
|
|
ShortNameNew = GetShortNameFromPosNo(r.PositionNumberNew),
|
|
|
|
PositionNumberNew = r.PositionNumberNew,
|
|
PositionLevelNew = r.PositionLevelNew,
|
|
PositionNameNew = r.PositionPathNew,
|
|
PositionSideNew = r.PositionPathSideNew,
|
|
PositionExecutiveNew = r.PositionExecutiveNew,
|
|
PositionExecutiveSideNew = r.PositionExecutiveSideNew,
|
|
PositionTypeNew = r.PositionTypeNew,
|
|
|
|
Prefix = r.Prefix,
|
|
FirstName = r.FirstName,
|
|
LastName = r.LastName,
|
|
Degree = lastEducation == null ? r.Qualification : lastEducation.Degree,
|
|
|
|
Salary = salaryRecord == null || salaryRecord.Amount == null ? 0 : (int)salaryRecord.Amount!.Value,
|
|
SalaryPosition = salaryRecord == null || salaryRecord.PositionSalaryAmount == null ? 0 : (int)salaryRecord.PositionSalaryAmount!.Value,
|
|
OcOrder = orgWithOrder.Where(x => x.Id == r.ocIdNew).FirstOrDefault() == null ? "0" : orgWithOrder.Where(x => x.Id == r.ocIdNew).FirstOrDefault().Order
|
|
};
|
|
results.Add(data);
|
|
}
|
|
// results = results.Sort()
|
|
return results;
|
|
}
|
|
|
|
public async Task<List<Account2ResultItem>> GetReport2QueryOld(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.Include(x => x.PositionType).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.Include(x => x.PositionLevel).Include(x => x.PosNo).ToListAsync();
|
|
var report2 = await _context.Report2s.ToListAsync();
|
|
|
|
var profile_data = (from p in profiles
|
|
join pf in prefixes on p.PrefixId equals pf.Id
|
|
join ps in profilePositions on p.Id equals ps.ProfileId
|
|
select new
|
|
{
|
|
p.Id,
|
|
p.CitizenId,
|
|
Prefix = pf.Name,
|
|
p.FirstName,
|
|
p.LastName,
|
|
p.PositionLine,
|
|
p.Position,
|
|
p.PositionPathSide,
|
|
p.PositionType,
|
|
PositionLevel = p.PositionLevel?.Name,
|
|
p.PositionExecutive,
|
|
p.PositionExecutiveSide,
|
|
PosNo = p.PosNo?.Name,
|
|
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,
|
|
OrganizationPositionId = ps.OrganizationPositionId
|
|
}).ToList();
|
|
|
|
|
|
//var report2_raw_data = (from r in _context.Report2s.AsNoTracking().ToList()
|
|
// //join opos in _context.ProfilePositions.AsNoTracking().ToList() on r.OrganizationPositionId equals opos.OrganizationPositionId into r_opos_join
|
|
// //from opos_join in r_opos_join.DefaultIfEmpty()
|
|
|
|
// 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 = r.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.OrganizationPositionId equals r_raw.OrganizationPositionId 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?.Name : r.PositionPath,
|
|
PositionPathSide = r == null ? pf.PositionPathSide : r.PositionPathSide,
|
|
PositionType = r == null ? pf.PositionType?.Name : 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.OrganizationId.Value,
|
|
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),
|
|
PositionNameOld = r == null ? pf.PosNo : r.PositionPathOld,
|
|
}).ToList();
|
|
|
|
//var report2_data = (from r in _context.Report2s.ToList()
|
|
// join ppos in _context.ProfilePositions.ToList() on r.OrganizationPositionId equals ppos.OrganizationPositionId
|
|
// join org_pos in _context.OrganizationPositions.ToList() on ppos.OrganizationPositionId equals org_pos.Id
|
|
// join pf_raw in profile_data.ToList() on r.OrganizationPositionId equals pf_raw.OrganizationPositionId into pf1
|
|
// from pf in pf1.DefaultIfEmpty()
|
|
|
|
// select new
|
|
// {
|
|
// Id = r.Id,
|
|
// ProfilePositionId = r.ProfilePositionId,
|
|
// CitizenId = pf is null ? GetCitizenId(ppos.ProfileId.Value) : pf.CitizenId,
|
|
// Prefix = pf is null ? GetPrefix(ppos.ProfileId.Value) : pf.Prefix,
|
|
// FirstName = pf is null ? GetFirstName(ppos.ProfileId.Value) : pf.FirstName,
|
|
// LastName = pf is null ? GetLastName(ppos.ProfileId.Value) : pf.LastName,
|
|
// OrganizationName = r.OrganizationOrganization,
|
|
// ShortName = r.OrganizationShortName,
|
|
// 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,
|
|
// OcId = org_pos.OrganizationId.Value,
|
|
// OrganizationPositionId = r.OrganizationPositionId,
|
|
// Degree = pf.Degree,
|
|
// Salary = pf.Salary,
|
|
// SalaryPosition = pf.SalaryPosition,
|
|
|
|
// ShortNameOld = GetShortNameFromPosNo(r.PositionNumOld),
|
|
// PositionNumberOld = r.PositionNumOld,
|
|
// PositionNumberOldInt = GetPosnoIntFromPosNo(r.PositionNumOld),
|
|
// PositionNameOld = r.PositionPathOld,
|
|
// }).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 data2 = (from op in organizationPositions
|
|
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
|
|
{
|
|
ShortNameNew = rp2_dt == null ? "" : rp2_dt.ShortName,
|
|
PositionNumberNew = rp2_dt == null ? "" : rp2_dt.PositionNumber,
|
|
Prefix = rp2_dt == null ? "" : rp2_dt.Prefix,
|
|
FirstName = rp2_dt == null ? "" : rp2_dt.FirstName,
|
|
LastName = rp2_dt == null ? "" : rp2_dt.LastName,
|
|
}
|
|
).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 = rp2_dt == null ? sn.Name : rp2_dt.ShortNameOld,
|
|
|
|
PositionNumber = rp2_dt == null ? pn.Name : rp2_dt.PositionNumberOld,
|
|
PositionLevel = rp2_dt == null ? _profileService.GetPositionLevel(pm.Id) : rp2_dt.PositionLevel,
|
|
|
|
PositionName = rp2_dt == null ? $"{pp.Name}\r\n" : $"{rp2_dt.PositionNameOld}\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.ToString(),
|
|
PositionType = pm.PositionType?.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,
|
|
|
|
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 || rp2_dt.Salary == null ? 0 : (int)rp2_dt.Salary!.Value,
|
|
SalaryPosition = rp2_dt == null || rp2_dt.SalaryPosition == null ? 0 : (int)rp2_dt.SalaryPosition!.Value,
|
|
|
|
|
|
}).ToList();
|
|
|
|
return data;
|
|
}
|
|
catch
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
}
|
|
|
|
public class Account1ResultItem
|
|
{
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid RootOcId { get; set; }
|
|
|
|
public string RootOcName { get; set; } = string.Empty;
|
|
|
|
public Guid OcId { get; set; }
|
|
|
|
public string OcFullName { get; set; } = string.Empty;
|
|
|
|
public string OcName { get; set; } = string.Empty;
|
|
|
|
public string ShortName { get; set; } = string.Empty;
|
|
|
|
public string PositionNumber { get; set; } = string.Empty;
|
|
|
|
public string PositionName { get; set; } = string.Empty;
|
|
|
|
public string PositionSide { get; set; } = string.Empty;
|
|
|
|
public string PositionLevel { get; set; } = string.Empty;
|
|
|
|
public string PositionExecutive { get; set; } = string.Empty;
|
|
|
|
public string PositionExecutiveSide { get; set; } = string.Empty;
|
|
|
|
public string Remark { get; set; } = string.Empty;
|
|
|
|
public string OcOrder { get; set; } = "0";
|
|
|
|
public int PositionNumberInt { get; set; } = 0;
|
|
|
|
public string PositionType { get; set; } = string.Empty;
|
|
|
|
public int IsDirector { get; set; } = 0;
|
|
|
|
public string GovernmentCode { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class Account2ResultItem
|
|
{
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid RootOcId { get; set; }
|
|
|
|
public string RootOcName { get; set; } = string.Empty;
|
|
|
|
public Guid OcId { get; set; }
|
|
|
|
public string OcFullName { get; set; } = string.Empty;
|
|
|
|
public string OcName { get; set; } = string.Empty;
|
|
|
|
public string ShortName { get; set; } = string.Empty;
|
|
|
|
public string PositionNumber { get; set; } = string.Empty;
|
|
|
|
public string PositionName { get; set; } = string.Empty;
|
|
|
|
public string PositionSide { get; set; } = string.Empty;
|
|
|
|
public string PositionLevel { get; set; } = string.Empty;
|
|
|
|
public string PositionExecutive { get; set; } = string.Empty;
|
|
|
|
public string PositionExecutiveSide { get; set; } = string.Empty;
|
|
|
|
public string Remark { get; set; } = string.Empty;
|
|
|
|
public string OcOrder { get; set; } = "0";
|
|
|
|
public int PositionNumberInt { get; set; } = 0;
|
|
|
|
public string PositionType { get; set; } = string.Empty;
|
|
|
|
// new
|
|
public Guid RootOcIdNew { get; set; }
|
|
|
|
public string RootOcNameNew { get; set; } = string.Empty;
|
|
|
|
public Guid OcIdNew { get; set; }
|
|
|
|
public string OcFullNameNew { get; set; } = string.Empty;
|
|
|
|
public string OcNameNew { get; set; } = string.Empty;
|
|
|
|
public string ShortNameNew { get; set; } = string.Empty;
|
|
|
|
public string PositionNumberNew { get; set; } = string.Empty;
|
|
|
|
public string PositionNameNew { get; set; } = string.Empty;
|
|
|
|
public string PositionSideNew { get; set; } = string.Empty;
|
|
|
|
public string PositionLevelNew { get; set; } = string.Empty;
|
|
|
|
public string PositionExecutiveNew { get; set; } = string.Empty;
|
|
|
|
public string PositionExecutiveSideNew { get; set; } = string.Empty;
|
|
|
|
public int PositionNumberIntNew { get; set; } = 0;
|
|
|
|
public string PositionTypeNew { get; set; } = string.Empty;
|
|
|
|
// name
|
|
public string Prefix { get; set; } = string.Empty;
|
|
|
|
public string FirstName { get; set; } = string.Empty;
|
|
|
|
public string LastName { get; set; } = string.Empty;
|
|
|
|
public string Degree { get; set; } = string.Empty;
|
|
|
|
public int Salary { get; set; } = 0;
|
|
|
|
public int SalaryPosition { 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 string Order { get; set; } = "0";
|
|
}
|
|
}
|