แก้ model
This commit is contained in:
parent
d8031bff98
commit
a31b72316e
8 changed files with 48 additions and 46 deletions
|
|
@ -519,10 +519,10 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
OcFullPath = _profileService.GetOrganizationNameFullPath(p.OcId.Value, false, false),
|
OcFullPath = _profileService.GetOrganizationNameFullPath(p.OcId.Value, false, false),
|
||||||
}).FirstOrDefault();
|
}).FirstOrDefault();
|
||||||
|
|
||||||
var salary = (from s in _context.ProfileSalaries
|
var salary = (from s in _context.ProfileSalaries.Include(x => x.PositionLevel)
|
||||||
join pos in _context.PositionPaths on s.PositionId equals pos.Id
|
join pos in _context.PositionPaths on s.PositionId equals pos.Id
|
||||||
join pos_no in _context.PositionNumbers on s.PosNoId equals pos_no.Id
|
join pos_no in _context.PositionNumbers on s.PosNoId equals pos_no.Id
|
||||||
join pos_lv in _context.PositionLevels on s.PositionLevelId equals pos_lv.Id
|
// join pos_lv in _context.PositionLevels on s.PositionLevelId equals pos_lv.Id
|
||||||
join pos_type in _context.PositionTypes on s.PositionTypeId equals pos_type.Id
|
join pos_type in _context.PositionTypes on s.PositionTypeId equals pos_type.Id
|
||||||
where s.Profile.Id == id
|
where s.Profile.Id == id
|
||||||
orderby s.Date.Value
|
orderby s.Date.Value
|
||||||
|
|
@ -531,11 +531,11 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
SalaryDate = s.Date == null ? "" : s.Date == new DateTime(1, 1, 1) ? "" : s.Date.Value.ToThaiShortDate(),
|
SalaryDate = s.Date == null ? "" : s.Date == new DateTime(1, 1, 1) ? "" : s.Date.Value.ToThaiShortDate(),
|
||||||
Position = s.SalaryClass,
|
Position = s.SalaryClass,
|
||||||
PosNo = pos_no.Name,
|
PosNo = pos_no.Name,
|
||||||
Rank = pos_lv.Name,
|
Rank = s.PositionLevel == null ? null : s.PositionLevel.Name,
|
||||||
Salary = s.Amount == null ? "" : s.Amount.ToString().ToInteger().ToNumericText(),
|
Salary = s.Amount == null ? "" : s.Amount.ToString().ToInteger().ToNumericText(),
|
||||||
RefAll = s.SalaryRef,
|
RefAll = s.SalaryRef,
|
||||||
PositionType = pos_type.Name,
|
PositionType = pos_type.Name,
|
||||||
PositionLevel = pos_lv.Name,
|
PositionLevel = s.PositionLevel == null ? null : s.PositionLevel.Name,
|
||||||
PositionAmount = s.PositionSalaryAmount == null ? "" : s.PositionSalaryAmount.Value.ToString().ToInteger().ToNumericText(),
|
PositionAmount = s.PositionSalaryAmount == null ? "" : s.PositionSalaryAmount.Value.ToString().ToInteger().ToNumericText(),
|
||||||
FullName = profile2.FullName,
|
FullName = profile2.FullName,
|
||||||
OcFullPath = profile2.OcFullPath
|
OcFullPath = profile2.OcFullPath
|
||||||
|
|
@ -899,10 +899,10 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
OcFullPath = _profileService.GetOrganizationNameFullPath(p.OcId.Value, false, false),
|
OcFullPath = _profileService.GetOrganizationNameFullPath(p.OcId.Value, false, false),
|
||||||
}).FirstOrDefault();
|
}).FirstOrDefault();
|
||||||
|
|
||||||
var salary = (from s in _context.ProfileSalaries
|
var salary = (from s in _context.ProfileSalaries.Include(x => x.PositionLevel)
|
||||||
join pos in _context.PositionPaths on s.PositionId equals pos.Id
|
join pos in _context.PositionPaths on s.PositionId equals pos.Id
|
||||||
join pos_no in _context.PositionNumbers on s.PosNoId equals pos_no.Id
|
join pos_no in _context.PositionNumbers on s.PosNoId equals pos_no.Id
|
||||||
join pos_lv in _context.PositionLevels on s.PositionLevelId equals pos_lv.Id
|
// join pos_lv in _context.PositionLevels on s.PositionLevelId equals pos_lv.Id
|
||||||
join pos_type in _context.PositionTypes on s.PositionTypeId equals pos_type.Id
|
join pos_type in _context.PositionTypes on s.PositionTypeId equals pos_type.Id
|
||||||
where s.Profile.Id == id
|
where s.Profile.Id == id
|
||||||
orderby s.Date.Value
|
orderby s.Date.Value
|
||||||
|
|
@ -911,11 +911,11 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
SalaryDate = s.Date == null ? "" : s.Date == new DateTime(1, 1, 1) ? "" : s.Date.Value.ToThaiShortDate(),
|
SalaryDate = s.Date == null ? "" : s.Date == new DateTime(1, 1, 1) ? "" : s.Date.Value.ToThaiShortDate(),
|
||||||
Position = s.SalaryClass,
|
Position = s.SalaryClass,
|
||||||
PosNo = pos_no.Name,
|
PosNo = pos_no.Name,
|
||||||
Rank = pos_lv.Name,
|
Rank = s.PositionLevel == null ? null : s.PositionLevel.Name,
|
||||||
Salary = s.Amount == null ? "" : s.Amount.ToString().ToInteger().ToNumericText(),
|
Salary = s.Amount == null ? "" : s.Amount.ToString().ToInteger().ToNumericText(),
|
||||||
RefAll = s.SalaryRef,
|
RefAll = s.SalaryRef,
|
||||||
PositionType = pos_type.Name,
|
PositionType = pos_type.Name,
|
||||||
PositionLevel = pos_lv.Name,
|
PositionLevel = s.PositionLevel == null ? null : s.PositionLevel.Name,
|
||||||
PositionAmount = s.PositionSalaryAmount == null ? "" : s.PositionSalaryAmount.Value.ToString().ToInteger().ToNumericText(),
|
PositionAmount = s.PositionSalaryAmount == null ? "" : s.PositionSalaryAmount.Value.ToString().ToInteger().ToNumericText(),
|
||||||
FullName = profile2.FullName,
|
FullName = profile2.FullName,
|
||||||
OcFullPath = profile2.OcFullPath
|
OcFullPath = profile2.OcFullPath
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,6 @@ namespace BMA.EHR.Organization.Service.Models
|
||||||
public Guid? PositionMasterId { get; set; }
|
public Guid? PositionMasterId { get; set; }
|
||||||
|
|
||||||
[Column(Order = 3), Comment("PositionLevelId")]
|
[Column(Order = 3), Comment("PositionLevelId")]
|
||||||
public Guid? PositionLevelId { get; set; }
|
public PositionLevel? PositionLevel { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using BMA.EHR.MetaData.Service.Models;
|
using BMA.EHR.MetaData.Service.Models;
|
||||||
|
using BMA.EHR.Organization.Service.Models;
|
||||||
using BMA.EHR.Recruit.Service.Models.Documents;
|
using BMA.EHR.Recruit.Service.Models.Documents;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
|
@ -137,17 +138,20 @@ namespace BMA.EHR.Profile.Service.Models.HR
|
||||||
public Guid? OrganizationOrganizationId { get; set; }
|
public Guid? OrganizationOrganizationId { get; set; }
|
||||||
public string? OrganizationOrganization { get; set; }
|
public string? OrganizationOrganization { get; set; }
|
||||||
public Guid? PositionId { get; set; }
|
public Guid? PositionId { get; set; }
|
||||||
public string? Position { get; set; }
|
// public string? Position { get; set; }
|
||||||
public Guid? PosNoId { get; set; }
|
public PositionPath? Position { get; set; }
|
||||||
public string? PosNo { get; set; }
|
// public Guid? PosNoId { get; set; }
|
||||||
|
public PositionNumberEntity? PosNo { get; set; }
|
||||||
|
// public string? PosNo { get; set; }
|
||||||
public Guid? PositionLineId { get; set; }
|
public Guid? PositionLineId { get; set; }
|
||||||
public string? PositionLine { get; set; }
|
public string? PositionLine { get; set; }
|
||||||
public Guid? PositionPathSideId { get; set; }
|
public Guid? PositionPathSideId { get; set; }
|
||||||
public string? PositionPathSide { get; set; }
|
public string? PositionPathSide { get; set; }
|
||||||
public Guid? PositionTypeId { get; set; }
|
// public Guid? PositionTypeId { get; set; }
|
||||||
public string? PositionType { get; set; }
|
// public string? PositionType { get; set; }
|
||||||
public Guid? PositionLevelId { get; set; }
|
public PositionType? PositionType { get; set; }
|
||||||
public string? PositionLevel { get; set; }
|
// public Guid? PositionLevelId { get; set; }
|
||||||
|
public PositionLevel? PositionLevel { get; set; }
|
||||||
public Guid? PositionExecutiveId { get; set; }
|
public Guid? PositionExecutiveId { get; set; }
|
||||||
public string? PositionExecutive { get; set; }
|
public string? PositionExecutive { get; set; }
|
||||||
public Guid? PositionExecutiveSideId { get; set; }
|
public Guid? PositionExecutiveSideId { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace BMA.EHR.Profile.Service.Models.HR
|
||||||
public Guid? PositionLineId { get; set; }
|
public Guid? PositionLineId { get; set; }
|
||||||
public Guid? PositionPathSideId { get; set; }
|
public Guid? PositionPathSideId { get; set; }
|
||||||
public Guid? PositionTypeId { get; set; }
|
public Guid? PositionTypeId { get; set; }
|
||||||
public Guid? PositionLevelId { get; set; }
|
public PositionLevel? PositionLevel { get; set; }
|
||||||
public Guid? PositionExecutiveId { get; set; }
|
public Guid? PositionExecutiveId { get; set; }
|
||||||
public Guid? PositionExecutiveSideId { get; set; }
|
public Guid? PositionExecutiveSideId { get; set; }
|
||||||
public string? SalaryClass { get; set; }
|
public string? SalaryClass { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace BMA.EHR.Organization.Service.Models
|
||||||
//public PositionType? PositionType_PositionTypeId { get; set; }
|
//public PositionType? PositionType_PositionTypeId { get; set; }
|
||||||
|
|
||||||
[Column(Order = 4), Comment("PositionTypeId")]
|
[Column(Order = 4), Comment("PositionTypeId")]
|
||||||
public Guid? PositionTypeId { get; set; }
|
public PositionType? PositionType { get; set; }
|
||||||
|
|
||||||
//[ForeignKey("PositionExecutiveId")]
|
//[ForeignKey("PositionExecutiveId")]
|
||||||
//public PositionExecutive? PositionExecutive_PositionExecutiveId { get; set; }
|
//public PositionExecutive? PositionExecutive_PositionExecutiveId { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace BMA.EHR.Organization.Service.Models.Report2
|
||||||
public string? OldPositionNum { get; set; }
|
public string? OldPositionNum { get; set; }
|
||||||
|
|
||||||
[Comment("ประเภทตำแหน่ง กำหนดเดิม")]
|
[Comment("ประเภทตำแหน่ง กำหนดเดิม")]
|
||||||
public Guid? OldPositionTypeId { get; set; }
|
// public Guid? OldPositionTypeId { get; set; }
|
||||||
public string? OldPositionType { get; set; }
|
public string? OldPositionType { get; set; }
|
||||||
|
|
||||||
[Comment("ตำแหน่งทางการบริหาร กำหนดเดิม")]
|
[Comment("ตำแหน่งทางการบริหาร กำหนดเดิม")]
|
||||||
|
|
@ -52,7 +52,7 @@ namespace BMA.EHR.Organization.Service.Models.Report2
|
||||||
public string? OldPositionPathSide { get; set; }
|
public string? OldPositionPathSide { get; set; }
|
||||||
|
|
||||||
[Comment("ระดับตำแหน่ง กำหนดเดิม")]
|
[Comment("ระดับตำแหน่ง กำหนดเดิม")]
|
||||||
public Guid? OldPositionLevelId { get; set; }
|
// public Guid? OldPositionLevelId { get; set; }
|
||||||
public string? OldPositionLevel { get; set; }
|
public string? OldPositionLevel { get; set; }
|
||||||
|
|
||||||
[Comment("รหัสส่วนราชการ กำหนดใหม่")]
|
[Comment("รหัสส่วนราชการ กำหนดใหม่")]
|
||||||
|
|
|
||||||
|
|
@ -224,10 +224,11 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
orgWithOrder = await GetAllOcItemByRootAsync(ocId);
|
orgWithOrder = await GetAllOcItemByRootAsync(ocId);
|
||||||
|
|
||||||
var organizationPositions = await _context.OrganizationPositions
|
var organizationPositions = await _context.OrganizationPositions
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
x.Id, x.OrganizationId,
|
x.Id,
|
||||||
x.PositionUserNote,
|
x.OrganizationId,
|
||||||
|
x.PositionUserNote,
|
||||||
x.PositionMasterId,
|
x.PositionMasterId,
|
||||||
x.PositionNumberId
|
x.PositionNumberId
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
@ -240,11 +241,11 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
x.PositionPathSideId,
|
x.PositionPathSideId,
|
||||||
x.PositionExecutiveId,
|
x.PositionExecutiveId,
|
||||||
x.PositionExecutiveSideId,
|
x.PositionExecutiveSideId,
|
||||||
x.PositionTypeId,
|
PositionTypeId = x.PositionType == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.PositionType.Id,
|
||||||
x.PositionPathSideObject,
|
x.PositionPathSideObject,
|
||||||
x.PositionExecutiveSideObject,
|
x.PositionExecutiveSideObject,
|
||||||
x.IsDirector
|
x.IsDirector
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
var organizations = await _context.Organizations
|
var organizations = await _context.Organizations
|
||||||
|
|
@ -352,7 +353,7 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
x.PositionPathSideId,
|
x.PositionPathSideId,
|
||||||
x.PositionExecutiveId,
|
x.PositionExecutiveId,
|
||||||
x.PositionExecutiveSideId,
|
x.PositionExecutiveSideId,
|
||||||
x.PositionTypeId,
|
PositionTypeId = x.PositionType == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.PositionType.Id,
|
||||||
x.PositionPathSideObject,
|
x.PositionPathSideObject,
|
||||||
x.PositionExecutiveSideObject,
|
x.PositionExecutiveSideObject,
|
||||||
x.IsDirector,
|
x.IsDirector,
|
||||||
|
|
@ -360,13 +361,13 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
var profiles = await _applicationDbContext.Profiles.ToListAsync();
|
var profiles = await _applicationDbContext.Profiles.Include(x => x.PositionLevel).ToListAsync();
|
||||||
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
||||||
var report2s = await _context.Report2s.ToListAsync();
|
var report2s = await _context.Report2s.ToListAsync();
|
||||||
var positionPathSides = await _applicationDbContext.PositionPathSides.ToListAsync();
|
var positionPathSides = await _applicationDbContext.PositionPathSides.ToListAsync();
|
||||||
var positionExecutiveSides = await _applicationDbContext.PositionExecutiveSides.ToListAsync();
|
var positionExecutiveSides = await _applicationDbContext.PositionExecutiveSides.ToListAsync();
|
||||||
var positionExecutives = await _applicationDbContext.PositionExecutives.ToListAsync();
|
var positionExecutives = await _applicationDbContext.PositionExecutives.ToListAsync();
|
||||||
|
|
||||||
var orgData = await _applicationDbContext.Organizations
|
var orgData = await _applicationDbContext.Organizations
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
|
|
@ -415,7 +416,7 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
from pnNew in pnNewGroup.DefaultIfEmpty()
|
from pnNew in pnNewGroup.DefaultIfEmpty()
|
||||||
join ppNew in positionPaths on rp == null ? pm?.PositionPathId : rp?.PositionPathId equals ppNew?.Id into ppNewGroup
|
join ppNew in positionPaths on rp == null ? pm?.PositionPathId : rp?.PositionPathId equals ppNew?.Id into ppNewGroup
|
||||||
from ppNew in ppNewGroup.DefaultIfEmpty()
|
from ppNew in ppNewGroup.DefaultIfEmpty()
|
||||||
join plNew in positionLevels on rp == null ? p?.PositionLevelId : rp?.PositionLevelId equals plNew?.Id into plNewGroup
|
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()
|
from plNew in plNewGroup.DefaultIfEmpty()
|
||||||
|
|
||||||
join psNew in positionPathSides on rp == null ? pm?.PositionPathSideId : rp?.PositionPathSideId equals psNew?.Id into psNewGroup
|
join psNew in positionPathSides on rp == null ? pm?.PositionPathSideId : rp?.PositionPathSideId equals psNew?.Id into psNewGroup
|
||||||
|
|
@ -440,7 +441,7 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
LastName = p == null ? null : p.LastName,
|
LastName = p == null ? null : p.LastName,
|
||||||
PositionNumberOld = rp == null ? (pn == null ? null : pn.Name) : rp.PositionNumOld,
|
PositionNumberOld = rp == null ? (pn == null ? null : pn.Name) : rp.PositionNumOld,
|
||||||
PositionPathOld = rp == null ? (pPath == null ? null : pPath.Name) : rp.PositionPathOld,
|
PositionPathOld = rp == null ? (pPath == null ? null : pPath.Name) : rp.PositionPathOld,
|
||||||
PositionLevelOld = rp == null ? (p == null ? null : p.PositionLevel) : rp.PositionLevelOld,
|
PositionLevelOld = rp == null ? (p == null ? null : p.PositionLevel?.Name) : rp.PositionLevelOld,
|
||||||
PositionNumberIdNew = pnNew == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : pnNew.Id,
|
PositionNumberIdNew = pnNew == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : pnNew.Id,
|
||||||
PositionNumberNew = pnNew == null ? null : pnNew.Name,
|
PositionNumberNew = pnNew == null ? null : pnNew.Name,
|
||||||
PositionPathNew = ppNew == null ? null : ppNew.Name,
|
PositionPathNew = ppNew == null ? null : ppNew.Name,
|
||||||
|
|
@ -546,7 +547,7 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
var RootOcName = _profileService.GetOrganizationNameFullPath(ocId, false, false);
|
var RootOcName = _profileService.GetOrganizationNameFullPath(ocId, false, false);
|
||||||
|
|
||||||
var organizationPositions = await _context.OrganizationPositions.ToListAsync();
|
var organizationPositions = await _context.OrganizationPositions.ToListAsync();
|
||||||
var positionMasters = await _context.PositionMasters.ToListAsync();
|
var positionMasters = await _context.PositionMasters.Include(x => x.PositionType).ToListAsync();
|
||||||
var organizations = await _context.Organizations.ToListAsync();
|
var organizations = await _context.Organizations.ToListAsync();
|
||||||
var organizationOrganizations = await _applicationDbContext.OrganizationOrganizations.ToListAsync();
|
var organizationOrganizations = await _applicationDbContext.OrganizationOrganizations.ToListAsync();
|
||||||
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
var organizationShortNames = await _applicationDbContext.OrganizationShortNames.ToListAsync();
|
||||||
|
|
@ -558,7 +559,7 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
var positionTypes = await _applicationDbContext.PositionTypes.ToListAsync();
|
var positionTypes = await _applicationDbContext.PositionTypes.ToListAsync();
|
||||||
var profilePositions = await _context.ProfilePositions.ToListAsync();
|
var profilePositions = await _context.ProfilePositions.ToListAsync();
|
||||||
var prefixes = await _context.Prefixes.ToListAsync();
|
var prefixes = await _context.Prefixes.ToListAsync();
|
||||||
var profiles = await _context.Profiles.ToListAsync();
|
var profiles = await _context.Profiles.Include(x => x.PositionLevel).Include(x => x.PosNo).ToListAsync();
|
||||||
var report2 = await _context.Report2s.ToListAsync();
|
var report2 = await _context.Report2s.ToListAsync();
|
||||||
|
|
||||||
var profile_data = (from p in profiles
|
var profile_data = (from p in profiles
|
||||||
|
|
@ -575,10 +576,10 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
p.Position,
|
p.Position,
|
||||||
p.PositionPathSide,
|
p.PositionPathSide,
|
||||||
p.PositionType,
|
p.PositionType,
|
||||||
p.PositionLevel,
|
PositionLevel = p.PositionLevel?.Name,
|
||||||
p.PositionExecutive,
|
p.PositionExecutive,
|
||||||
p.PositionExecutiveSide,
|
p.PositionExecutiveSide,
|
||||||
p.PosNo,
|
PosNo = p.PosNo?.Name,
|
||||||
p.OrganizationShortName,
|
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})",
|
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,
|
Salary = p.Salaries == null || p.Salaries.Count == 0 ? 0 : p.Salaries.OrderBy(x => x.Date).Last().Amount,
|
||||||
|
|
@ -658,9 +659,9 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
ShortName = r == null ? pf.OrganizationShortName : GetShortNameFromPosNo(r.PositionNum),
|
ShortName = r == null ? pf.OrganizationShortName : GetShortNameFromPosNo(r.PositionNum),
|
||||||
PositionNumber = r == null ? pf.PosNo : r.PositionNum,
|
PositionNumber = r == null ? pf.PosNo : r.PositionNum,
|
||||||
PositionNumberInt = r == null ? GetPosnoIntFromPosNo(pf.PosNo) : GetPosnoIntFromPosNo(r.PositionNum),
|
PositionNumberInt = r == null ? GetPosnoIntFromPosNo(pf.PosNo) : GetPosnoIntFromPosNo(r.PositionNum),
|
||||||
PositionPath = r == null ? pf.Position : r.PositionPath,
|
PositionPath = r == null ? pf.Position?.Name : r.PositionPath,
|
||||||
PositionPathSide = r == null ? pf.PositionPathSide : r.PositionPathSide,
|
PositionPathSide = r == null ? pf.PositionPathSide : r.PositionPathSide,
|
||||||
PositionType = r == null ? pf.PositionType : r.PositionType,
|
PositionType = r == null ? pf.PositionType?.Name : r.PositionType,
|
||||||
PositionLevel = r == null ? pf.PositionLevel : r.PositionLevel,
|
PositionLevel = r == null ? pf.PositionLevel : r.PositionLevel,
|
||||||
PositionExecutive = r == null ? pf.PositionExecutive : r.PositionExecutive,
|
PositionExecutive = r == null ? pf.PositionExecutive : r.PositionExecutive,
|
||||||
PositionExecutiveSide = r == null ? pf.PositionExecutiveSide : r.PositionExecutiveSide,
|
PositionExecutiveSide = r == null ? pf.PositionExecutiveSide : r.PositionExecutiveSide,
|
||||||
|
|
@ -788,7 +789,7 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
from pm_exp in pm_exp_join.DefaultIfEmpty()
|
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
|
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()
|
from pm_exp_s in pm_exp_s_join.DefaultIfEmpty()
|
||||||
join pt in positionTypes on pm.PositionTypeId equals pt.Id
|
// 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
|
join rp2 in report2_data.ToList() on op.Id equals rp2.OrganizationPositionId into rp2_join
|
||||||
from rp2_dt in rp2_join.DefaultIfEmpty()
|
from rp2_dt in rp2_join.DefaultIfEmpty()
|
||||||
|
|
||||||
|
|
@ -812,7 +813,7 @@ namespace BMA.EHR.Report.Service.Services
|
||||||
PositionExecutiveSide = pm.PositionExecutiveSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionExecutiveSideObject>>(pm.PositionExecutiveSideObject).GetNameList(),
|
PositionExecutiveSide = pm.PositionExecutiveSideObject is null ? "" : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PositionExecutiveSideObject>>(pm.PositionExecutiveSideObject).GetNameList(),
|
||||||
Remark = op.PositionUserNote,
|
Remark = op.PositionUserNote,
|
||||||
OcOrder = oc.OrganizationOrder.Value.ToString(),
|
OcOrder = oc.OrganizationOrder.Value.ToString(),
|
||||||
PositionType = pt.Name,
|
PositionType = pm.PositionType?.Name,
|
||||||
|
|
||||||
|
|
||||||
OcIdNew = rp2_dt == null ? op.OrganizationId.Value : rp2_dt.OcId,
|
OcIdNew = rp2_dt == null ? op.OrganizationId.Value : rp2_dt.OcId,
|
||||||
|
|
|
||||||
|
|
@ -409,10 +409,11 @@ namespace BMA.EHR.Profile.Service.Services
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var level = (from alv in _context.AvailablePositionLevels
|
var level = (from alv in _context.AvailablePositionLevels.Include(x => x.PositionLevel)
|
||||||
join lv in _context.PositionLevels on alv.PositionLevelId equals lv.Id
|
// join lv in _context.PositionLevels on alv.PositionLevelId equals lv.Id
|
||||||
where alv.PositionMasterId == id
|
where alv.PositionMasterId == id
|
||||||
select lv.Name).ToList();
|
where alv.PositionLevel != null
|
||||||
|
select alv.PositionLevel.Name).ToList();
|
||||||
|
|
||||||
|
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue