fix คำนวนเครื่องราชย์ลูกจ้าง
This commit is contained in:
parent
2ad923c737
commit
5770b41ad7
1 changed files with 38 additions and 14 deletions
|
|
@ -361,7 +361,13 @@ namespace BMA.EHR.Application.Repositories
|
||||||
var jtmRoyal = await _dbContext.Set<Insignia>().FirstOrDefaultAsync(x => x.Name.Contains("จัตุรถาภรณ์มงกุฎไทย"));
|
var jtmRoyal = await _dbContext.Set<Insignia>().FirstOrDefaultAsync(x => x.Name.Contains("จัตุรถาภรณ์มงกุฎไทย"));
|
||||||
|
|
||||||
var s2 = (from p in allProfilesByRoot
|
var s2 = (from p in allProfilesByRoot
|
||||||
where !(p.ProfileInsignia.Where(x => x.InsigniaId != coinInsignia.Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId == bcpRoyal.Id)
|
where p.ProfileInsignia != null
|
||||||
|
&& p.ProfileInsignia.Count > 0
|
||||||
|
&& (p.ProfileInsignia.Where(x => x.InsigniaId.Value != coinInsignia.Id &&
|
||||||
|
x.InsigniaId.Value == bcpRoyal.Id)
|
||||||
|
.ToList()
|
||||||
|
.Count() == 0)
|
||||||
|
//where !(p.ProfileInsignia.Where(x => x.InsigniaId != coinInsignia.Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId == bcpRoyal.Id)
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
ProfileId = p.Id,
|
ProfileId = p.Id,
|
||||||
|
|
@ -433,7 +439,13 @@ namespace BMA.EHR.Application.Repositories
|
||||||
|
|
||||||
|
|
||||||
var s3 = (from p in allProfilesByRoot
|
var s3 = (from p in allProfilesByRoot
|
||||||
where !(p.ProfileInsignia.Where(x => x.InsigniaId != coinInsignia.Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId == jtmRoyal.Id)
|
where p.ProfileInsignia != null
|
||||||
|
&& p.ProfileInsignia.Count > 0
|
||||||
|
&& (p.ProfileInsignia.Where(x => x.InsigniaId.Value != coinInsignia.Id &&
|
||||||
|
x.InsigniaId.Value == jtmRoyal.Id)
|
||||||
|
.ToList()
|
||||||
|
.Count() == 0)
|
||||||
|
//where !(p.ProfileInsignia.Where(x => x.InsigniaId != coinInsignia.Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId == jtmRoyal.Id)
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
ProfileId = p.Id,
|
ProfileId = p.Id,
|
||||||
|
|
@ -551,8 +563,8 @@ namespace BMA.EHR.Application.Repositories
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Check ว่าชั้นที่ขอสูงกว่าชั้นที่เคยได้รับแล้วหรือไม่?
|
// Check ว่าชั้นที่ขอสูงกว่าชั้นที่เคยได้รับแล้วหรือไม่?
|
||||||
if (!IsHigherLevel2(r.LastInsignia, r.RequestInsignia.Name))
|
//if (!IsHigherLevel2(r.LastInsignia, r.RequestInsignia.Name))
|
||||||
continue;
|
// continue;
|
||||||
|
|
||||||
if (old == null)
|
if (old == null)
|
||||||
{
|
{
|
||||||
|
|
@ -666,7 +678,13 @@ namespace BMA.EHR.Application.Repositories
|
||||||
var jtmRoyal = await _dbContext.Set<Insignia>().FirstOrDefaultAsync(x => x.Name.Contains("จัตุรถาภรณ์มงกุฎไทย"));
|
var jtmRoyal = await _dbContext.Set<Insignia>().FirstOrDefaultAsync(x => x.Name.Contains("จัตุรถาภรณ์มงกุฎไทย"));
|
||||||
|
|
||||||
var s2 = (from p in allProfilesByRoot
|
var s2 = (from p in allProfilesByRoot
|
||||||
where !(p.ProfileInsignia.Where(x => x.InsigniaId != coinInsignia.Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId == jtmRoyal.Id)
|
where p.ProfileInsignia != null
|
||||||
|
&& p.ProfileInsignia.Count > 0
|
||||||
|
&& (p.ProfileInsignia.Where(x => x.InsigniaId.Value != coinInsignia.Id &&
|
||||||
|
x.InsigniaId.Value == jtmRoyal.Id)
|
||||||
|
.ToList()
|
||||||
|
.Count() == 0)
|
||||||
|
//where !(p.ProfileInsignia.Where(x => x.InsigniaId != coinInsignia.Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId == jtmRoyal.Id)
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
ProfileId = p.Id,
|
ProfileId = p.Id,
|
||||||
|
|
@ -738,7 +756,13 @@ namespace BMA.EHR.Application.Repositories
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var s3 = (from p in allProfilesByRoot
|
var s3 = (from p in allProfilesByRoot
|
||||||
where !(p.ProfileInsignia.Where(x => x.InsigniaId != coinInsignia.Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId == jtcRoyal.Id)
|
where p.ProfileInsignia != null
|
||||||
|
&& p.ProfileInsignia.Count > 0
|
||||||
|
&& (p.ProfileInsignia.Where(x => x.InsigniaId.Value != coinInsignia.Id &&
|
||||||
|
x.InsigniaId.Value == jtcRoyal.Id)
|
||||||
|
.ToList()
|
||||||
|
.Count() == 0)
|
||||||
|
//where !(p.ProfileInsignia.Where(x => x.InsigniaId != coinInsignia.Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId == jtcRoyal.Id)
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
ProfileId = p.Id,
|
ProfileId = p.Id,
|
||||||
|
|
@ -856,8 +880,8 @@ namespace BMA.EHR.Application.Repositories
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Check ว่าชั้นที่ขอสูงกว่าชั้นที่เคยได้รับแล้วหรือไม่?
|
// Check ว่าชั้นที่ขอสูงกว่าชั้นที่เคยได้รับแล้วหรือไม่?
|
||||||
if (!IsHigherLevel2(r.LastInsignia, r.RequestInsignia.Name))
|
//if (!IsHigherLevel2(r.LastInsignia, r.RequestInsignia.Name))
|
||||||
continue;
|
// continue;
|
||||||
|
|
||||||
if (old == null)
|
if (old == null)
|
||||||
{
|
{
|
||||||
|
|
@ -942,12 +966,12 @@ namespace BMA.EHR.Application.Repositories
|
||||||
where p.ProfileDateAppoint <= new DateTime(period.Year - 5, 5, 29)
|
where p.ProfileDateAppoint <= new DateTime(period.Year - 5, 5, 29)
|
||||||
&& p.LastInsigniaId == Guid.Parse("00000000-0000-0000-0000-000000000000")
|
&& p.LastInsigniaId == Guid.Parse("00000000-0000-0000-0000-000000000000")
|
||||||
&& p.PositionLevelName == "ปฏิบัติงาน" // ปฏิบัติงาน
|
&& p.PositionLevelName == "ปฏิบัติงาน" // ปฏิบัติงาน
|
||||||
&& p.ProfileInsignia != null
|
&& p.ProfileInsignia == null
|
||||||
&& p.ProfileInsignia.Count > 0
|
//&& p.ProfileInsignia.Count > 0
|
||||||
&& (p.ProfileInsignia.Where(x => x.InsigniaId.Value != GetInsigniaByName("เหรียญจักรพรรดิมาลา").Id &&
|
//&& p.ProfileInsignia.Where(x => x.InsigniaId.Value != GetInsigniaByName("เหรียญจักรพรรดิมาลา").Id &&
|
||||||
x.InsigniaId.Value == GetInsigniaByName("เบญจมาภรณ์มงกุฎไทย").Id)
|
// x.InsigniaId.Value == GetInsigniaByName("เบญจมาภรณ์มงกุฎไทย").Id)
|
||||||
.ToList()
|
// .ToList()
|
||||||
.Count() == 0)
|
// .Count() == 0)
|
||||||
select p)
|
select p)
|
||||||
.ToList()
|
.ToList()
|
||||||
.Select(p => new InsigniaResultSet
|
.Select(p => new InsigniaResultSet
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue