fix : Insignia Request Controlle
(แสดงข้อมูลของผู้ขอ)
This commit is contained in:
parent
cdfb282c32
commit
c37c8b8330
2 changed files with 457 additions and 432 deletions
|
|
@ -971,7 +971,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
var s2 = (from p in allProfilesByRoot
|
var s2 = (from p in allProfilesByRoot
|
||||||
where p.PosType.PosTypeName == "ทั่วไป"
|
where p.PosType.PosTypeName == "ทั่วไป"
|
||||||
&& p.PosLevel.PosLevelName == "ปฏิบัติงาน"
|
&& p.PosLevel.PosLevelName == "ปฏิบัติงาน"
|
||||||
&& 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)
|
||||||
.OrderByDescending(x => x.Year)
|
.OrderByDescending(x => x.Year)
|
||||||
|
|
@ -1521,7 +1521,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
|
|
||||||
PosNo = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? "" : p.ProfileSalary!.OrderByDescending(x => x.Order).FirstOrDefault()!.PosNo,
|
PosNo = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? "" : p.ProfileSalary!.OrderByDescending(x => x.Order).FirstOrDefault()!.PosNo,
|
||||||
Gender = p.Gender == null ? null : p.Gender,
|
Gender = p.Gender == null ? null : p.Gender,
|
||||||
IsHigherLevel = p.ProfileInsignia.Where(x => x.InsigniaId.Value != GetInsigniaByName("เหรียญจักรพรรดิมาลา").Id).FirstOrDefault() == null ? true :
|
IsHigherLevel = p.ProfileInsignia.Where(x => x.InsigniaId.Value != GetInsigniaByName("เหรียญจักรพรรดิมาลา").Id).FirstOrDefault() == null ? true :
|
||||||
IsHigherLevel(GetInsigniaById(p.ProfileInsignia
|
IsHigherLevel(GetInsigniaById(p.ProfileInsignia
|
||||||
.Where(x => x.InsigniaId.Value != GetInsigniaByName("เหรียญจักรพรรดิมาลา").Id)
|
.Where(x => x.InsigniaId.Value != GetInsigniaByName("เหรียญจักรพรรดิมาลา").Id)
|
||||||
.OrderByDescending(x => x.Year)
|
.OrderByDescending(x => x.Year)
|
||||||
|
|
@ -1532,7 +1532,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault().Date
|
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault().Date
|
||||||
})
|
})
|
||||||
.ToList()
|
.ToList()
|
||||||
.Select(p => new InsigniaResultSet
|
.Select(p => new InsigniaResultSet
|
||||||
|
|
@ -1741,7 +1741,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
|
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault().Date
|
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault().Date
|
||||||
})
|
})
|
||||||
|
|
@ -2173,7 +2173,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ชำนาญการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "ชำนาญการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ชำนาญการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "ชำนาญการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -2560,7 +2560,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ชำนาญการพิเศษ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "ชำนาญการพิเศษ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ชำนาญการพิเศษ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "ชำนาญการพิเศษ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -2785,7 +2785,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "เชี่ยวชาญ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "เชี่ยวชาญ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "เชี่ยวชาญ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "เชี่ยวชาญ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -2862,7 +2862,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "เชี่ยวชาญ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "เชี่ยวชาญ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "เชี่ยวชาญ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "เชี่ยวชาญ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -3106,7 +3106,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ทรงคุณวุฒิ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "ทรงคุณวุฒิ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ทรงคุณวุฒิ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "ทรงคุณวุฒิ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -3357,7 +3357,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ทรงคุณวุฒิ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "ทรงคุณวุฒิ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ทรงคุณวุฒิ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "ทรงคุณวุฒิ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -3439,7 +3439,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "อาวุโส").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -3762,7 +3762,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -3907,7 +3907,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -3984,7 +3984,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -4062,7 +4062,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "อำนวยการ").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -4223,7 +4223,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ทวีติยาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -4300,7 +4300,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -4377,7 +4377,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "ต้น" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -4507,7 +4507,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์มงกุฎไทย").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -4589,7 +4589,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("ประถมาภรณ์ช้างเผือก").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -4671,7 +4671,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
PositionLevel = p.PosLevel == null ? "" : p.PosLevel.PosLevelName,
|
||||||
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
PositionType = p.PosType == null ? "" : p.PosType.PosTypeName,
|
||||||
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
FirstPositonLevelDate = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault() == null ? null :
|
||||||
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
p.ProfileSalary.Where(x => x.PositionLevel == "สูง" && x.PositionType == "บริหาร").OrderBy(p => p.Date).FirstOrDefault().Date,
|
||||||
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
FirstRecvInsigniaYear = p.ProfileInsignia.Count == 0 ? 0 :
|
||||||
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("มหาวชิรมงกุฎ").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
p.ProfileInsignia.Where(x => x.InsigniaId.Value == GetInsigniaByName("มหาวชิรมงกุฎ").Id).OrderBy(x => x.Year).FirstOrDefault() == null ? 0 :
|
||||||
|
|
@ -5288,7 +5288,7 @@ namespace BMA.EHR.Application.Repositories
|
||||||
|
|
||||||
var result_candidate = new List<InsigniaResultSet>();
|
var result_candidate = new List<InsigniaResultSet>();
|
||||||
|
|
||||||
if (ocId != Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3")) return result_candidate;
|
//if (ocId != Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3")) return result_candidate;
|
||||||
|
|
||||||
var type_coin = await GetCoinCandidate(periodId, ocId);
|
var type_coin = await GetCoinCandidate(periodId, ocId);
|
||||||
var employee_type1 = await GetEmployeeInsignia_Type1(periodId, ocId);
|
var employee_type1 = await GetEmployeeInsignia_Type1(periodId, ocId);
|
||||||
|
|
@ -5528,11 +5528,11 @@ namespace BMA.EHR.Application.Repositories
|
||||||
GetInsigniaById(p.ProfileInsignia.Where(x => x.InsigniaId.Value != GetInsigniaByName("เหรียญจักรพรรดิมาลา").Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId.Value).Id,
|
GetInsigniaById(p.ProfileInsignia.Where(x => x.InsigniaId.Value != GetInsigniaByName("เหรียญจักรพรรดิมาลา").Id).OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId.Value).Id,
|
||||||
Salary = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? 0 : p.ProfileSalary!.OrderByDescending(x => x.Order).FirstOrDefault()!.Amount,
|
Salary = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? 0 : p.ProfileSalary!.OrderByDescending(x => x.Order).FirstOrDefault()!.Amount,
|
||||||
//SalaryCondition = p.ProfileSalary == null ? 0 : p.ProfileSalary.Amount,
|
//SalaryCondition = p.ProfileSalary == null ? 0 : p.ProfileSalary.Amount,
|
||||||
SalaryCondition = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? 0 :
|
SalaryCondition = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? 0 :
|
||||||
p.ProfileSalary.Where(x => x.Date.Value <= new DateTime(period.Year, 4, 29)).OrderByDescending(x => x.Order).FirstOrDefault() != null ?
|
p.ProfileSalary.Where(x => x.Date.Value <= new DateTime(period.Year, 4, 29)).OrderByDescending(x => x.Order).FirstOrDefault() != null ?
|
||||||
p.ProfileSalary.Where(x => x.Date.Value <= new DateTime(period.Year, 4, 29)).OrderByDescending(x => x.Order).FirstOrDefault().Amount :
|
p.ProfileSalary.Where(x => x.Date.Value <= new DateTime(period.Year, 4, 29)).OrderByDescending(x => x.Order).FirstOrDefault().Amount :
|
||||||
p.ProfileSalary.OrderBy(x => x.Order).FirstOrDefault().Amount,
|
p.ProfileSalary.OrderBy(x => x.Order).FirstOrDefault().Amount,
|
||||||
PostionSalaryAmount = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? 0 :
|
PostionSalaryAmount = p.ProfileSalary == null || p.ProfileSalary.Count == 0 ? 0 :
|
||||||
p.ProfileSalary!.OrderByDescending(x => x.Order).FirstOrDefault()!.PositionSalaryAmount,
|
p.ProfileSalary!.OrderByDescending(x => x.Order).FirstOrDefault()!.PositionSalaryAmount,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -5768,46 +5768,20 @@ namespace BMA.EHR.Application.Repositories
|
||||||
var id = await GetRequestId(period, ocId);
|
var id = await GetRequestId(period, ocId);
|
||||||
if (id != null)
|
if (id != null)
|
||||||
{
|
{
|
||||||
var result = (_dbContext.Set<InsigniaRequestProfile>()
|
var raw_result = _dbContext.Set<InsigniaRequestProfile>()
|
||||||
.Include(x => x.Request)
|
.Include(x => x.Request)
|
||||||
.Include(x => x.RequestInsignia)
|
.Include(x => x.RequestInsignia)
|
||||||
.ThenInclude(x => x.InsigniaType)
|
.ThenInclude(x => x.InsigniaType)
|
||||||
//.Include(x => x.Profile)
|
|
||||||
//.ThenInclude(x => x.Salaries)
|
.Where(h => status.Trim().ToUpper() == "ALL" ? h.Status != null : h.Status == status.Trim().ToUpper())
|
||||||
//.Include(x => x.Profile)
|
.Where(h => h.Request.Id == id)
|
||||||
//.ThenInclude(x => x.Position)
|
.ToList();
|
||||||
//.Include(x => x.Profile)
|
|
||||||
//.ThenInclude(x => x.PositionEmployeePosition)
|
var pre_result = raw_result
|
||||||
//.Include(x => x.Profile)
|
.Select(h => new
|
||||||
//.ThenInclude(x => x.PosNo)
|
|
||||||
//.Include(x => x.Profile)
|
|
||||||
//.ThenInclude(x => x.PositionLevel)
|
|
||||||
//.Include(x => x.Profile)
|
|
||||||
//.ThenInclude(x => x.PositionType)
|
|
||||||
//.Include(x => x.Profile)
|
|
||||||
//.ThenInclude(x => x.Prefix)
|
|
||||||
////.Include(x => x.Profile)
|
|
||||||
////.ThenInclude(x => x.OrganizationOrganization)
|
|
||||||
//.Include(x => x.Profile)
|
|
||||||
//.ThenInclude(x => x.PositionLevel)
|
|
||||||
//.Include(x => x.Profile)
|
|
||||||
//.ThenInclude(x => x.Insignias)
|
|
||||||
//.ThenInclude(x => x.Insignia)
|
|
||||||
.Where(h => status.Trim().ToUpper() == "ALL" ? h.Status != null : h.Status == status.Trim().ToUpper())
|
|
||||||
.Where(h => h.Request.Id == id)
|
|
||||||
.ToList()
|
|
||||||
.Select(h => new InsigniaRequestItem
|
|
||||||
{
|
{
|
||||||
Id = h.Id,
|
Id = h.Id,
|
||||||
CitizenId = _userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).CitizenId,
|
Profile = _userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken),
|
||||||
ProfileId = _userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).Id,
|
|
||||||
ProfileType = _userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).ProfileType,
|
|
||||||
FullName = $"{_userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).Prefix}{_userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).FirstName} {_userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).LastName}",
|
|
||||||
Position = _userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).Position,
|
|
||||||
PosNo = _userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PosNo,
|
|
||||||
Rank = _userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PositionLevel,
|
|
||||||
Salary = _userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().Amount.ToString(),
|
|
||||||
LastInsignia = GetInsigniaById(_userProfileRepository.GetOfficerProfileById(h.ProfileId, AccessToken).ProfileInsignia.OrderByDescending(x => x.Year).FirstOrDefault().Id.Value).Name,
|
|
||||||
RequestInsignia = h.RequestInsignia.Name,
|
RequestInsignia = h.RequestInsignia.Name,
|
||||||
RequestInsigniaShortName = h.RequestInsignia.ShortName,
|
RequestInsigniaShortName = h.RequestInsignia.ShortName,
|
||||||
Level = h.RequestInsignia.InsigniaType.Name,
|
Level = h.RequestInsignia.InsigniaType.Name,
|
||||||
|
|
@ -5820,7 +5794,40 @@ namespace BMA.EHR.Application.Repositories
|
||||||
MarkLeave = h.MarkLeave,
|
MarkLeave = h.MarkLeave,
|
||||||
MarkRate = h.MarkRate,
|
MarkRate = h.MarkRate,
|
||||||
// Docs = GetDocFile(h.Profile.Id),
|
// Docs = GetDocFile(h.Profile.Id),
|
||||||
MatchingConditions = h.MatchingConditions == null ? null : JsonConvert.DeserializeObject<List<MatchingCondition>>(h.MatchingConditions)
|
MatchingConditions = h.MatchingConditions == null || h.MatchingConditions == "" ? null : JsonConvert.DeserializeObject<List<MatchingCondition>>(h.MatchingConditions)
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
var result = (pre_result
|
||||||
|
.Select(h => new InsigniaRequestItem
|
||||||
|
{
|
||||||
|
Id = h.Id,
|
||||||
|
CitizenId = h.Profile.CitizenId,
|
||||||
|
ProfileId = h.Profile.Id,
|
||||||
|
ProfileType = h.Profile.ProfileType,
|
||||||
|
FullName = $"{h.Profile.Prefix}{h.Profile.FirstName} {h.Profile.LastName}",
|
||||||
|
Position = h.Profile.Position,
|
||||||
|
PosNo = h.Profile.ProfileSalary == null || h.Profile.ProfileSalary.Count == 0 ? "" :
|
||||||
|
h.Profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PosNo,
|
||||||
|
Rank = h.Profile.PosLevel.PosLevelName,
|
||||||
|
|
||||||
|
Salary = h.Profile.ProfileSalary == null || h.Profile.ProfileSalary.Count == 0 ? "0" :
|
||||||
|
h.Profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().Amount.ToString(),
|
||||||
|
LastInsignia = h.Profile.ProfileInsignia == null || h.Profile.ProfileInsignia.Count == 0 ? "" :
|
||||||
|
GetInsigniaById(h.Profile.ProfileInsignia.OrderByDescending(x => x.Year).FirstOrDefault().Id.Value).Name,
|
||||||
|
RequestInsignia = h.RequestInsignia,
|
||||||
|
RequestInsigniaShortName = h.RequestInsigniaShortName,
|
||||||
|
Level = h.Level,
|
||||||
|
IsApprove = h.IsApprove,
|
||||||
|
RequestDate = h.RequestDate,
|
||||||
|
Status = h.Status,
|
||||||
|
RequestNote = h.RequestNote,
|
||||||
|
Reason = h.Reason,
|
||||||
|
MarkDiscipline = h.MarkDiscipline,
|
||||||
|
MarkLeave = h.MarkLeave,
|
||||||
|
MarkRate = h.MarkRate,
|
||||||
|
// Docs = GetDocFile(h.Profile.Id),
|
||||||
|
MatchingConditions = h.MatchingConditions
|
||||||
})).ToList();
|
})).ToList();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
|
|
@ -422,10 +422,12 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
var result = await _repository.GetInsigniaRequest(insigniaPeriodId, ocId);
|
var result = await _repository.GetInsigniaRequest(insigniaPeriodId, ocId);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
// Guid period = result.PeriodId;
|
Guid period = result.PeriodId;
|
||||||
// var periodName = result.Name;
|
var periodName = result.Name;
|
||||||
// string requestStatus = result.RequestStatus;
|
string requestStatus = result.RequestStatus;
|
||||||
// string requestNote = result.RequestNote;
|
string requestNote = result.RequestNote;
|
||||||
|
|
||||||
|
|
||||||
var resend = new InsigniaResults
|
var resend = new InsigniaResults
|
||||||
{
|
{
|
||||||
PeriodId = result.PeriodId,
|
PeriodId = result.PeriodId,
|
||||||
|
|
@ -444,14 +446,16 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
return Success(resend);
|
return Success(resend);
|
||||||
if (RoleInsignia2 == true && (result.RequestStatus == "st1" || result.RequestStatus == "st2"))
|
if (RoleInsignia2 == true && (result.RequestStatus == "st1" || result.RequestStatus == "st2"))
|
||||||
return Success(resend);
|
return Success(resend);
|
||||||
// var candidate = await _repository.GetInsigniaCandidateBKK(period, ocId);
|
|
||||||
|
|
||||||
// // ตรวจสอบว่ารายการอยู่ใน table insignia_request_new
|
// Jack Remark Remove เพื่อให้เรียกขข้อมูลออกมาเร็สวขึ้น
|
||||||
// if (requestStatus == null)
|
//var candidate = await _repository.GetInsigniaCandidateBKK(period, ocId);
|
||||||
// {
|
|
||||||
// // บันทึกรายชื่อ
|
//// ตรวจสอบว่ารายการอยู่ใน table insignia_request_new
|
||||||
// await _repository.InsertCandidate(period, ocId, candidate);
|
//if (requestStatus == null)
|
||||||
// }
|
//{
|
||||||
|
// // บันทึกรายชื่อ
|
||||||
|
// await _repository.InsertCandidate(period, ocId, candidate);
|
||||||
|
//}
|
||||||
if (role.Trim().ToUpper() == "OFFICER")
|
if (role.Trim().ToUpper() == "OFFICER")
|
||||||
{
|
{
|
||||||
resend.Items = await _repository.InsigniaHasProfile(result.PeriodId, ocId, status);
|
resend.Items = await _repository.InsigniaHasProfile(result.PeriodId, ocId, status);
|
||||||
|
|
@ -459,132 +463,136 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// var passData = _context.InsigniaRequests.AsQueryable()
|
var passData = _context.InsigniaRequests.AsQueryable()
|
||||||
// .Include(x => x.Organization)
|
//.Include(x => x.Organization)
|
||||||
// .Include(x => x.RequestProfiles)
|
.Include(x => x.RequestProfiles)
|
||||||
// .Where(x => x.Organization.Id == ocId)
|
.Where(x => x.OrganizationId == ocId)
|
||||||
// .Where(x => x.Period.Id == period)
|
.Where(x => x.Period.Id == period)
|
||||||
// .Select(ir => new
|
.Select(ir => new
|
||||||
// {
|
{
|
||||||
// requstID = ir.Id,
|
requstID = ir.Id,
|
||||||
// requstStatus = ir.RequestStatus,
|
requstStatus = ir.RequestStatus,
|
||||||
// requstStatusName = GetRequestlStatusText(ir.RequestStatus),
|
requstStatusName = GetRequestlStatusText(ir.RequestStatus),
|
||||||
// fkInstituteId = -1,
|
fkInstituteId = -1,
|
||||||
// // fkDivisionId = ir.Organization.Id,
|
// fkDivisionId = ir.Organization.Id,
|
||||||
// // fkDivision = ir.Organization.Name,
|
// fkDivision = ir.Organization.Name,
|
||||||
// fkInstitute = "",
|
fkInstitute = "",
|
||||||
// fkPeriodId = ir.Period.Id,
|
fkPeriodId = ir.Period.Id,
|
||||||
// insigniaRequestHasProfile = ir.RequestProfiles.AsQueryable()
|
insigniaRequestHasProfile = ir.RequestProfiles.AsQueryable()
|
||||||
// .Include(x => x.Profile)
|
//.Include(x => x.Profile)
|
||||||
// .ThenInclude(x => x.Position)
|
//.ThenInclude(x => x.Position)
|
||||||
// .Include(x => x.Profile)
|
//.Include(x => x.Profile)
|
||||||
// // .ThenInclude(x => x.PositionNumber)
|
// .ThenInclude(x => x.PositionNumber)
|
||||||
// .Include(x => x.Profile)
|
//.Include(x => x.Profile)
|
||||||
// // .ThenInclude(x => x.AcademicStanding)
|
// .ThenInclude(x => x.AcademicStanding)
|
||||||
// .Include(x => x.RequestInsignia)
|
.Include(x => x.RequestInsignia)
|
||||||
// .ThenInclude(x => x.InsigniaType)
|
.ThenInclude(x => x.InsigniaType)
|
||||||
// .Select(irp => new
|
.Select(irp => new
|
||||||
// {
|
{
|
||||||
// request_id = irp.Request.Id,
|
request_id = irp.Request.Id,
|
||||||
// isApprove = irp.IsApprove,
|
isApprove = irp.IsApprove,
|
||||||
// statusInstitute = irp.IsApprove.ToString(),
|
statusInstitute = irp.IsApprove.ToString(),
|
||||||
// request_date = irp.RequestDate,
|
request_date = irp.RequestDate,
|
||||||
// profileId = irp.Profile.Id,
|
profileId = irp.ProfileId,
|
||||||
// // prefix = irp.Profile.Prefix,
|
prefix = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).Prefix, //irp.Profile.Prefix,
|
||||||
// firstname = irp.Profile.FirstName,
|
firstname = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).FirstName, //irp.Profile.FirstName,
|
||||||
// lastname = irp.Profile.LastName,
|
lastname = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).LastName, //irp.Profile.LastName,
|
||||||
// // posno = irp.Profile.PositionNumber.Id,
|
posno = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).ProfileSalary.Count == 0 ||
|
||||||
// type = irp.Profile.ProfileType,
|
_userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).ProfileSalary == null ? "" :
|
||||||
// // position = irp.Profile.Position.Name,
|
_userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PosNo,// irp.Profile.PositionNumber.Id,
|
||||||
// // rank = $"{irp.Profile.PositionType.Name}/{irp.Profile.PositionLevel.Name}",
|
type = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).ProfileType, //irp.Profile.ProfileType,
|
||||||
// instituteName = "",
|
position = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).Position, // irp.Profile.Position.Name,
|
||||||
// instituteId = -1,
|
rank = $"{_userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).PosType.PosTypeName}/{_userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).PosLevel.PosLevelName}", // $"{irp.Profile.PositionType.Name}/{irp.Profile.PositionLevel.Name}",
|
||||||
// // divisionName = irp.Profile.OrganizationOrganization.Name,
|
instituteName = "",
|
||||||
// // divisionId = irp.Profile.OrganizationOrganization.Id,
|
instituteId = -1,
|
||||||
// lastInsigniaName = "",
|
// divisionName = irp.Profile.OrganizationOrganization.Name,
|
||||||
// requestInsigniaLevel = irp.RequestInsignia.InsigniaType.Name,
|
// divisionId = irp.Profile.OrganizationOrganization.Id,
|
||||||
// requestInsigniaName = irp.RequestInsignia.Name,
|
lastInsigniaName = "",
|
||||||
// requestQua = irp.QualificationStatus,
|
requestInsigniaLevel = irp.RequestInsignia.InsigniaType.Name,
|
||||||
// requestDoc = irp.DocumentStatus,
|
requestInsigniaName = irp.RequestInsignia.Name,
|
||||||
// requestNote = irp.Note,
|
requestQua = "",// irp.QualificationStatus,
|
||||||
// requestSalary = irp.Salary,
|
requestDoc = "", //irp.DocumentStatus,
|
||||||
// matchingConditions = JsonConvert.DeserializeObject<List<MatchingCondition>>(irp.MatchingConditions)
|
requestNote = "", // irp.Note,
|
||||||
// })
|
requestSalary = irp.Salary,
|
||||||
// .Where(x => x.isApprove)
|
matchingConditions = JsonConvert.DeserializeObject<List<MatchingCondition>>(irp.MatchingConditions)
|
||||||
// .OrderBy(y => y.profileId)
|
})
|
||||||
// .ToList()
|
.Where(x => x.isApprove)
|
||||||
// })
|
.OrderBy(y => y.profileId)
|
||||||
// .ToList()
|
.ToList()
|
||||||
// .FirstOrDefault();
|
})
|
||||||
|
.ToList()
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
// var failData = _context.InsigniaRequests.AsQueryable()
|
var failData = _context.InsigniaRequests.AsQueryable()
|
||||||
// .Include(x => x.Organization)
|
//.Include(x => x.Organization)
|
||||||
// .Include(x => x.RequestProfiles)
|
.Include(x => x.RequestProfiles)
|
||||||
// .Where(x => x.Organization.Id == ocId)
|
.Where(x => x.OrganizationId == ocId)
|
||||||
// .Where(x => x.Period.Id == period)
|
.Where(x => x.Period.Id == period)
|
||||||
// .Select(ir => new
|
.Select(ir => new
|
||||||
// {
|
{
|
||||||
// requstID = ir.Id,
|
requstID = ir.Id,
|
||||||
// requstStatus = ir.RequestStatus,
|
requstStatus = ir.RequestStatus,
|
||||||
// requstStatusName = GetRequestlStatusText(ir.RequestStatus),
|
requstStatusName = GetRequestlStatusText(ir.RequestStatus),
|
||||||
// fkInstituteId = -1,
|
fkInstituteId = -1,
|
||||||
// // fkDivisionId = ir.Organization.Id,
|
// fkDivisionId = ir.Organization.Id,
|
||||||
// // fkDivision = ir.Organization.Name,
|
// fkDivision = ir.Organization.Name,
|
||||||
// fkInstitute = "",
|
fkInstitute = "",
|
||||||
// fkPeriodId = ir.Period.Id,
|
fkPeriodId = ir.Period.Id,
|
||||||
// insigniaRequestHasProfile = ir.RequestProfiles.AsQueryable()
|
insigniaRequestHasProfile = ir.RequestProfiles.AsQueryable()
|
||||||
// .Include(x => x.Profile)
|
//.Include(x => x.Profile)
|
||||||
// .ThenInclude(x => x.Position)
|
//.ThenInclude(x => x.Position)
|
||||||
// .Include(x => x.Profile)
|
//.Include(x => x.Profile)
|
||||||
// // .ThenInclude(x => x.PositionNumber)
|
// .ThenInclude(x => x.PositionNumber)
|
||||||
// .Include(x => x.Profile)
|
//.Include(x => x.Profile)
|
||||||
// // .ThenInclude(x => x.AcademicStanding)
|
// .ThenInclude(x => x.AcademicStanding)
|
||||||
// .Include(x => x.RequestInsignia)
|
.Include(x => x.RequestInsignia)
|
||||||
// .ThenInclude(x => x.InsigniaType)
|
.ThenInclude(x => x.InsigniaType)
|
||||||
// .Select(irp => new
|
.Select(irp => new
|
||||||
// {
|
{
|
||||||
// request_id = irp.Request.Id,
|
request_id = irp.Request.Id,
|
||||||
// isApprove = irp.IsApprove,
|
isApprove = irp.IsApprove,
|
||||||
// statusInstitute = irp.IsApprove.ToString(),
|
statusInstitute = irp.IsApprove.ToString(),
|
||||||
// request_date = irp.RequestDate,
|
request_date = irp.RequestDate,
|
||||||
// profileId = irp.Profile.Id,
|
profileId = irp.ProfileId,
|
||||||
// // prefix = irp.Profile.Prefix,
|
prefix = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).Prefix, //irp.Profile.Prefix,
|
||||||
// firstname = irp.Profile.FirstName,
|
firstname = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).FirstName, //irp.Profile.FirstName,
|
||||||
// lastname = irp.Profile.LastName,
|
lastname = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).LastName, //irp.Profile.LastName,
|
||||||
// // posno = irp.Profile.PositionNumber.Id,
|
posno = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).ProfileSalary.Count == 0 ||
|
||||||
// type = irp.Profile.ProfileType,
|
_userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).ProfileSalary == null ? "" :
|
||||||
// // position = irp.Profile.Position.Name,
|
_userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PosNo,// irp.Profile.PositionNumber.Id,
|
||||||
// // rank = irp.Profile.AcademicStanding.Name,
|
type = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).ProfileType, //irp.Profile.ProfileType,
|
||||||
// instituteName = "",
|
position = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).Position, // irp.Profile.Position.Name,
|
||||||
// instituteId = -1,
|
rank = $"{_userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).PosType.PosTypeName}/{_userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken).PosLevel.PosLevelName}", // $"{irp.Profile.PositionType.Name}/{irp.Profile.PositionLevel.Name}",
|
||||||
// // divisionName = irp.Profile.OrganizationOrganization.Name,
|
instituteName = "",
|
||||||
// // divisionId = irp.Profile.OrganizationOrganization.Id,
|
instituteId = -1,
|
||||||
// lastInsigniaName = "",
|
// divisionName = irp.Profile.OrganizationOrganization.Name,
|
||||||
// requestInsigniaLevel = irp.RequestInsignia.InsigniaType.Name,
|
// divisionId = irp.Profile.OrganizationOrganization.Id,
|
||||||
// requestInsigniaName = irp.RequestInsignia.Name,
|
lastInsigniaName = "",
|
||||||
// requestQua = irp.QualificationStatus,
|
requestInsigniaLevel = irp.RequestInsignia.InsigniaType.Name,
|
||||||
// requestDoc = irp.DocumentStatus,
|
requestInsigniaName = irp.RequestInsignia.Name,
|
||||||
// requestNote = irp.Note,
|
requestQua = "", //irp.QualificationStatus,
|
||||||
// requestSalary = irp.Salary,
|
requestDoc = "", //irp.DocumentStatus,
|
||||||
// matchingConditions = JsonConvert.DeserializeObject<List<MatchingCondition>>(irp.MatchingConditions)
|
requestNote = "", //irp.Note,
|
||||||
// })
|
requestSalary = irp.Salary,
|
||||||
// .Where(x => !x.isApprove)
|
matchingConditions = JsonConvert.DeserializeObject<List<MatchingCondition>>(irp.MatchingConditions)
|
||||||
// .OrderBy(y => y.profileId)
|
})
|
||||||
// .ToList()
|
.Where(x => !x.isApprove)
|
||||||
// })
|
.OrderBy(y => y.profileId)
|
||||||
// .ToList()
|
.ToList()
|
||||||
// .FirstOrDefault();
|
})
|
||||||
|
.ToList()
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
// var period_data = (from p in _context.InsigniaPeriods.AsQueryable()
|
var period_data = (from p in _context.InsigniaPeriods.AsQueryable()
|
||||||
// where p.Id == period
|
where p.Id == period
|
||||||
// select new
|
select new
|
||||||
// {
|
{
|
||||||
// periodName = p.Name,
|
periodName = p.Name,
|
||||||
// periodYear = p.Year,
|
periodYear = p.Year,
|
||||||
// }).FirstOrDefault();
|
}).FirstOrDefault();
|
||||||
|
|
||||||
// return Success(new { passData = passData, failData = failData, period = period_data });
|
return Success(new { passData = passData, failData = failData, period = period_data });
|
||||||
return Success();
|
//return Success();
|
||||||
}
|
}
|
||||||
// select data to display
|
// select data to display
|
||||||
}
|
}
|
||||||
|
|
@ -635,34 +643,34 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// #region " บันทึกหมายเหตุ "
|
#region " บันทึกหมายเหตุ "
|
||||||
|
|
||||||
// [HttpPut("note/{profileId}")]
|
[HttpPut("note/{profileId}")]
|
||||||
// public async Task<ActionResult<ResponseObject>> SaveNote(Guid profileId, SaveRequsetNote items)
|
public async Task<ActionResult<ResponseObject>> SaveNote(Guid profileId, SaveRequsetNote items)
|
||||||
// {
|
{
|
||||||
// var id = await _repository.GetRequestId(items.PeriodId, items.OcId);
|
var id = await _repository.GetRequestId(items.PeriodId, items.OcId);
|
||||||
// var note = _context.InsigniaRequestProfiles.AsQueryable()
|
var note = _context.InsigniaRequestProfiles.AsQueryable()
|
||||||
// .Where(d => d.Profile.Id == profileId && d.Request.Id == id).FirstOrDefault();
|
.Where(d => d.ProfileId == profileId && d.Request.Id == id).FirstOrDefault();
|
||||||
// if (note != null)
|
//if (note != null)
|
||||||
// note.Note = items.Note;
|
// note.Note = items.Note;
|
||||||
// _context.SaveChanges();
|
_context.SaveChanges();
|
||||||
// return Success();
|
return Success();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// #endregion
|
#endregion
|
||||||
|
|
||||||
// #region " บันทึกรายชื่อครูในการขอยื่นเครื่องราชฯ เเต่ยังไม่ส่งไปยัง ผอ.โรงเรียน "
|
#region " บันทึกรายชื่อครูในการขอยื่นเครื่องราชฯ เเต่ยังไม่ส่งไปยัง ผอ.โรงเรียน "
|
||||||
|
|
||||||
// [HttpPut("approve/{ocId:length(36)}")]
|
[HttpPut("approve/{ocId:length(36)}")]
|
||||||
// public async Task<ActionResult<ResponseObject>> SaveRequestList(Guid id, Guid ocId, InsigniaApproveRequest items)
|
public async Task<ActionResult<ResponseObject>> SaveRequestList(Guid id, Guid ocId, InsigniaApproveRequest items)
|
||||||
// {
|
{
|
||||||
// var result = await _repository.GetInsigniaRequest(id, ocId);
|
var result = await _repository.GetInsigniaRequest(id, ocId);
|
||||||
// if (result != null)
|
if (result != null)
|
||||||
// await _repository.SaveAprove(result.PeriodId, ocId, items);
|
await _repository.SaveAprove(result.PeriodId, ocId);
|
||||||
// return Success();
|
return Success();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// #endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// เปลี่ยน status เป็น st3 การเจ้าหน้าที่อนุมัติ "
|
/// เปลี่ยน status เป็น st3 การเจ้าหน้าที่อนุมัติ "
|
||||||
|
|
@ -845,48 +853,49 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
// #region " เปลี่ยน status สำหรับ ผอ.สำนัก "
|
#region " เปลี่ยน status สำหรับ ผอ.สำนัก "
|
||||||
|
|
||||||
// [HttpPost("status/director/approve/{ocId:length(36)}")]
|
[HttpPost("status/director/approve/{ocId:length(36)}")]
|
||||||
// public async Task<ActionResult<ResponseObject>> ChangeStatusToSt5p(Guid id, Guid ocId)
|
public async Task<ActionResult<ResponseObject>> ChangeStatusToSt5p(Guid id, Guid ocId)
|
||||||
// {
|
{
|
||||||
// var result = await _repository.GetInsigniaRequest(id, ocId);
|
var result = await _repository.GetInsigniaRequest(id, ocId);
|
||||||
// if (result == null)
|
if (result == null)
|
||||||
// return Error(GlobalMessages.InsigniaRequestNotFound);
|
return Error(GlobalMessages.InsigniaRequestNotFound);
|
||||||
// var requestId = await _repository.GetRequestId(result.PeriodId, ocId);
|
var requestId = await _repository.GetRequestId(result.PeriodId, ocId);
|
||||||
// if (requestId == null)
|
if (requestId == null)
|
||||||
// return Error(GlobalMessages.InsigniaRequestNotFound);
|
return Error(GlobalMessages.InsigniaRequestNotFound);
|
||||||
// var requestNew = await _context.InsigniaRequests.FirstOrDefaultAsync(i => i.Id == requestId);
|
var requestNew = await _context.InsigniaRequests.FirstOrDefaultAsync(i => i.Id == requestId);
|
||||||
// if (requestNew != null)
|
if (requestNew != null)
|
||||||
// {
|
{
|
||||||
// requestNew.RequestStatus = "st5p";
|
requestNew.RequestStatus = "st5p";
|
||||||
// _context.SaveChanges();
|
_context.SaveChanges();
|
||||||
// return Success();
|
return Success();
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// return Error(GlobalMessages.InsigniaRequestNotFound);
|
return Error(GlobalMessages.InsigniaRequestNotFound);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// [HttpPost("status/director/reject/{ocId:length(36)}")]
|
[HttpPost("status/director/reject/{ocId:length(36)}")]
|
||||||
// public async Task<ActionResult<ResponseObject>> ChangeStatusToSt1(Guid id, Guid ocId)
|
public async Task<ActionResult<ResponseObject>> ChangeStatusToSt1(Guid id, Guid ocId)
|
||||||
// {
|
{
|
||||||
// var result = await _repository.GetInsigniaRequest(id, ocId);
|
var result = await _repository.GetInsigniaRequest(id, ocId);
|
||||||
// if (result == null)
|
if (result == null)
|
||||||
// return Error(GlobalMessages.InsigniaRequestNotFound);
|
return Error(GlobalMessages.InsigniaRequestNotFound);
|
||||||
// var requestId = await _repository.GetRequestId(result.PeriodId, ocId);
|
var requestId = await _repository.GetRequestId(result.PeriodId, ocId);
|
||||||
// if (requestId == null)
|
if (requestId == null)
|
||||||
// return Error(GlobalMessages.InsigniaRequestNotFound);
|
return Error(GlobalMessages.InsigniaRequestNotFound);
|
||||||
// var requestNew = await _context.InsigniaRequests.FirstOrDefaultAsync(i => i.Id == requestId);
|
var requestNew = await _context.InsigniaRequests.FirstOrDefaultAsync(i => i.Id == requestId);
|
||||||
// if (requestNew != null)
|
if (requestNew != null)
|
||||||
// {
|
{
|
||||||
// requestNew.RequestStatus = "st1";
|
requestNew.RequestStatus = "st1";
|
||||||
// _context.SaveChanges();
|
_context.SaveChanges();
|
||||||
// return Success();
|
return Success();
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// return Error(GlobalMessages.InsigniaRequestNotFound);
|
return Error(GlobalMessages.InsigniaRequestNotFound);
|
||||||
// }
|
}
|
||||||
// #endregion
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ย้ายขอมูลไปเป็น คนที่ไม่ยื่นขอ
|
/// ย้ายขอมูลไปเป็น คนที่ไม่ยื่นขอ
|
||||||
|
|
@ -1061,7 +1070,9 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.ProfileId == profile.Id && x.Request.Period == insigniaPeriod);
|
var insigniaRequestProfile = await _context.InsigniaRequestProfiles.FirstOrDefaultAsync(x => x.ProfileId == profile.Id && x.Request.Period == insigniaPeriod);
|
||||||
if (insigniaRequestProfile != null)
|
if (insigniaRequestProfile != null)
|
||||||
return Error(GlobalMessages.InsigniaRequestProfileDupicate);
|
return Error(GlobalMessages.InsigniaRequestProfileDupicate);
|
||||||
// var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod);
|
|
||||||
|
//var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod);
|
||||||
|
|
||||||
//var _orgProfile = await _context.ProfilePositions
|
//var _orgProfile = await _context.ProfilePositions
|
||||||
// .Where(x => x.ProfileId == profile.Id)
|
// .Where(x => x.ProfileId == profile.Id)
|
||||||
// .Where(x => x.OrganizationPosition != null)
|
// .Where(x => x.OrganizationPosition != null)
|
||||||
|
|
@ -1071,7 +1082,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
// .FirstOrDefaultAsync();
|
// .FirstOrDefaultAsync();
|
||||||
//var _org = await _context.Organizations
|
//var _org = await _context.Organizations
|
||||||
// .FirstOrDefaultAsync(x => x.Id == _orgProfile);
|
// .FirstOrDefaultAsync(x => x.Id == _orgProfile);
|
||||||
var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod); // && x.OrganizationId == _org);
|
var insigniaRequest = await _context.InsigniaRequests.FirstOrDefaultAsync(x => x.Period == insigniaPeriod && x.OrganizationId == insigniaRequestProfile!.Request.OrganizationId);
|
||||||
if (insigniaRequest == null)
|
if (insigniaRequest == null)
|
||||||
{
|
{
|
||||||
//var orgProfile = await _context.ProfilePositions
|
//var orgProfile = await _context.ProfilePositions
|
||||||
|
|
@ -1086,43 +1097,46 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
//var org = await _context.Organizations
|
//var org = await _context.Organizations
|
||||||
// .FirstOrDefaultAsync(x => x.Id == orgProfile);
|
// .FirstOrDefaultAsync(x => x.Id == orgProfile);
|
||||||
|
|
||||||
// var org = _userProfileRepository.GetOc(orgProfile.Value, 0, AccessToken);
|
var org = _userProfileRepository.GetOc(insigniaRequestProfile!.Request.OrganizationId, 0, AccessToken);
|
||||||
|
|
||||||
// if (org == null)
|
if (org == null)
|
||||||
// return Error(GlobalMessages.OrganizationNotFound);
|
return Error(GlobalMessages.OrganizationNotFound);
|
||||||
// insigniaRequest = new InsigniaRequest
|
insigniaRequest = new InsigniaRequest
|
||||||
// {
|
{
|
||||||
// Period = insigniaPeriod,
|
Period = insigniaPeriod,
|
||||||
// OrganizationId = org.RootId.Value,
|
OrganizationId = org!.RootId.Value,
|
||||||
// RequestStatus = "st1",
|
RequestStatus = "st1",
|
||||||
// RequestNote = "",
|
RequestNote = "",
|
||||||
// CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
// CreatedUserId = UserId ?? "",
|
CreatedUserId = UserId ?? "",
|
||||||
// CreatedAt = DateTime.Now,
|
CreatedAt = DateTime.Now,
|
||||||
// LastUpdateFullName = FullName ?? "System Administrator",
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
// LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
// LastUpdatedAt = DateTime.Now,
|
LastUpdatedAt = DateTime.Now,
|
||||||
// };
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//await _context.AddAsync(new InsigniaRequestProfile
|
|
||||||
//{
|
await _context.AddAsync(new InsigniaRequestProfile
|
||||||
// Status = "PENDING",
|
{
|
||||||
// Profile = profile,
|
Status = "PENDING",
|
||||||
// RequestInsignia = insignia,
|
ProfileId = profile.Id,
|
||||||
// Request = insigniaRequest,
|
RequestInsignia = insignia,
|
||||||
// Reason = req.Reason,
|
Request = insigniaRequest,
|
||||||
// RequestDate = DateTime.Now,
|
Reason = req.Reason,
|
||||||
// MatchingConditions = System.Text.Json.JsonSerializer.Serialize(new List<dynamic>()), // serialize to string
|
RequestDate = DateTime.Now,
|
||||||
// Salary = profile.Salaries.Count() == 0 ? null : profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount,
|
MatchingConditions = System.Text.Json.JsonSerializer.Serialize(new List<dynamic>()), // serialize to string
|
||||||
// CreatedFullName = FullName ?? "System Administrator",
|
Salary = profile.ProfileSalary == null || profile.ProfileSalary.Count == 0 ? 0 :
|
||||||
// CreatedUserId = UserId ?? "",
|
profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().Amount, //profile.Salaries.Count() == 0 ? null : profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount,
|
||||||
// CreatedAt = DateTime.Now,
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
// LastUpdateFullName = FullName ?? "System Administrator",
|
CreatedUserId = UserId ?? "",
|
||||||
// LastUpdateUserId = UserId ?? "",
|
CreatedAt = DateTime.Now,
|
||||||
// LastUpdatedAt = DateTime.Now,
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
//});
|
LastUpdateUserId = UserId ?? "",
|
||||||
//await _context.SaveChangesAsync();
|
LastUpdatedAt = DateTime.Now,
|
||||||
|
});
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1265,26 +1279,26 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// รายชื่อผู้ได้รับเครื่องราชส่งข้อมูลไปบันทึกผลได้รับเครื่องราช(อัพเดทstatus)
|
/// รายชื่อผู้ได้รับเครื่องราชส่งข้อมูลไปบันทึกผลได้รับเครื่องราช(อัพเดทstatus)
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// /// <param name="insigniaPeriodId">Id รอบการยื่นขอ</param>
|
/// <param name="insigniaPeriodId">Id รอบการยื่นขอ</param>
|
||||||
// /// <returns></returns>
|
/// <returns></returns>
|
||||||
// /// <response code="200"></response>
|
/// <response code="200"></response>
|
||||||
// /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
// /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
// /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
// [HttpGet("send/note/{insigniaPeriodId:length(36)}")]
|
[HttpGet("send/note/{insigniaPeriodId:length(36)}")]
|
||||||
// public async Task<ActionResult<ResponseObject>> SendPeriodToNoteUpdateStatus(Guid insigniaPeriodId)
|
public async Task<ActionResult<ResponseObject>> SendPeriodToNoteUpdateStatus(Guid insigniaPeriodId)
|
||||||
// {
|
{
|
||||||
// var insigniaPeriod = await _context.InsigniaPeriods
|
var insigniaPeriod = await _context.InsigniaPeriods
|
||||||
// .FirstOrDefaultAsync(x => x.Id == insigniaPeriodId);
|
.FirstOrDefaultAsync(x => x.Id == insigniaPeriodId);
|
||||||
// if (insigniaPeriod == null)
|
if (insigniaPeriod == null)
|
||||||
// return Error(GlobalMessages.InsigniaRequestNotFound);
|
return Error(GlobalMessages.InsigniaRequestNotFound);
|
||||||
// insigniaPeriod.IsLock = true;
|
insigniaPeriod.IsLock = true;
|
||||||
// await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
// return Success();
|
return Success();
|
||||||
// }
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// list รอบบันทึกผลการได้รับพระราชทานเครื่องราชอิสริยสภรณ์/การจ่ายใบกำกับ
|
/// list รอบบันทึกผลการได้รับพระราชทานเครื่องราชอิสริยสภรณ์/การจ่ายใบกำกับ
|
||||||
|
|
@ -1517,16 +1531,18 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
[HttpPut("note/{insigniaNoteId:length(36)}")]
|
[HttpPut("note/{insigniaNoteId:length(36)}")]
|
||||||
public async Task<ActionResult<ResponseObject>> AddNoteProfile([FromBody] InsigniaNoteRequest req, Guid insigniaNoteId)
|
public async Task<ActionResult<ResponseObject>> AddNoteProfile([FromBody] InsigniaNoteRequest req, Guid insigniaNoteId)
|
||||||
{
|
{
|
||||||
var profile = await _context.Profiles
|
var profile = _userProfileRepository.GetOfficerProfileByCitizenId(req.CitizanId, AccessToken);
|
||||||
.Include(x => x.Salaries)
|
|
||||||
.FirstOrDefaultAsync(x => x.CitizenId == req.CitizanId);
|
|
||||||
if (profile == null)
|
if (profile == null)
|
||||||
return Error(GlobalMessages.DataNotFound);
|
return Error(GlobalMessages.DataNotFound);
|
||||||
|
|
||||||
var insignia = await _context.Insignias
|
var insignia = await _context.Insignias
|
||||||
.Include(x => x.InsigniaType)
|
.Include(x => x.InsigniaType)
|
||||||
.FirstOrDefaultAsync(x => x.Id == req.InsigniaId);
|
.FirstOrDefaultAsync(x => x.Id == req.InsigniaId);
|
||||||
if (insignia == null)
|
if (insignia == null)
|
||||||
return Error(GlobalMessages.InsigniaNotFound);
|
return Error(GlobalMessages.InsigniaNotFound);
|
||||||
|
|
||||||
var insigniaNote = await _context.InsigniaNotes
|
var insigniaNote = await _context.InsigniaNotes
|
||||||
.Include(x => x.InsigniaNoteProfiles)
|
.Include(x => x.InsigniaNoteProfiles)
|
||||||
//.ThenInclude(x => x.Profile)
|
//.ThenInclude(x => x.Profile)
|
||||||
|
|
@ -1534,118 +1550,120 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
if (insigniaNote == null)
|
if (insigniaNote == null)
|
||||||
return Error(GlobalMessages.InsigniaRequestNotFound);
|
return Error(GlobalMessages.InsigniaRequestNotFound);
|
||||||
|
|
||||||
//var profileInsignia = insigniaNote.InsigniaNoteProfiles.FirstOrDefault(x => x.Profile.CitizenId == req.CitizanId);
|
var profileInsignia = insigniaNote.InsigniaNoteProfiles.FirstOrDefault(x => x.ProfileId == profile.Id);
|
||||||
//if (profileInsignia == null)
|
|
||||||
//{
|
if (profileInsignia == null)
|
||||||
// var insigniaNoteProfile = new InsigniaNoteProfile
|
{
|
||||||
// {
|
var insigniaNoteProfile = new InsigniaNoteProfile
|
||||||
// Salary = profile.Salaries.Count() == 0 ? null : profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount,
|
{
|
||||||
// IsApprove = true,
|
Salary = profile.ProfileSalary == null || profile.ProfileSalary.Count() == 0 ? null : profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().Amount,
|
||||||
// Status = "PENDING",
|
IsApprove = true,
|
||||||
// Profile = profile,
|
Status = "PENDING",
|
||||||
// Issue = req.Issue,
|
ProfileId = profile.Id,
|
||||||
// Number = req.Number,
|
Issue = req.Issue,
|
||||||
// DateReceive = req.DateReceive,
|
Number = req.Number,
|
||||||
// Date = req.Date,
|
DateReceive = req.DateReceive,
|
||||||
// VolumeNo = req.VolumeNo,
|
Date = req.Date,
|
||||||
// Section = req.Section,
|
VolumeNo = req.VolumeNo,
|
||||||
// Page = req.Page,
|
Section = req.Section,
|
||||||
// No = req.No,
|
Page = req.Page,
|
||||||
// DatePayment = req.DatePayment,
|
No = req.No,
|
||||||
// TypePayment = req.TypePayment,
|
DatePayment = req.DatePayment,
|
||||||
// Address = req.Address,
|
TypePayment = req.TypePayment,
|
||||||
// RequestInsignia = insignia,
|
Address = req.Address,
|
||||||
// OrganizationOrganizationReceive = req.OrganizationOrganizationReceive,
|
RequestInsignia = insignia,
|
||||||
// OrganizationOrganizationSend = req.OrganizationOrganizationSend,
|
OrganizationOrganizationReceive = req.OrganizationOrganizationReceive,
|
||||||
// InsigniaNote = insigniaNote,
|
OrganizationOrganizationSend = req.OrganizationOrganizationSend,
|
||||||
// CreatedFullName = FullName ?? "System Administrator",
|
InsigniaNote = insigniaNote,
|
||||||
// CreatedUserId = UserId ?? "",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
// CreatedAt = DateTime.Now,
|
CreatedUserId = UserId ?? "",
|
||||||
// LastUpdateFullName = FullName ?? "System Administrator",
|
CreatedAt = DateTime.Now,
|
||||||
// LastUpdateUserId = UserId ?? "",
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
// LastUpdatedAt = DateTime.Now,
|
LastUpdateUserId = UserId ?? "",
|
||||||
// };
|
LastUpdatedAt = DateTime.Now,
|
||||||
// if (req.DateReceive != null && req.Date != null)
|
};
|
||||||
// {
|
if (req.DateReceive != null && req.Date != null)
|
||||||
// insigniaNoteProfile.Status = "DONE";
|
{
|
||||||
// await _context.ProfileInsignias.AddAsync(new ProfileInsignia
|
insigniaNoteProfile.Status = "DONE";
|
||||||
// {
|
await _context.ProfileInsignias.AddAsync(new ProfileInsignia
|
||||||
// Year = insigniaNote.Year,
|
{
|
||||||
// No = req.No,
|
Year = insigniaNote.Year,
|
||||||
// Issue = req.VolumeNo,
|
No = req.No,
|
||||||
// VolumeNo = req.VolumeNo,
|
Issue = req.VolumeNo,
|
||||||
// // Volume = req.Volume,
|
VolumeNo = req.VolumeNo,
|
||||||
// Section = req.Section,
|
// Volume = req.Volume,
|
||||||
// Page = req.Page,
|
Section = req.Section,
|
||||||
// DateAnnounce = req.Date,
|
Page = req.Page,
|
||||||
// ReceiveDate = req.DateReceive,
|
DateAnnounce = req.Date,
|
||||||
// InsigniaType = insignia.InsigniaType == null ? null : insignia.InsigniaType.Name,
|
ReceiveDate = req.DateReceive,
|
||||||
// Insignia = insignia,
|
InsigniaType = insignia.InsigniaType == null ? null : insignia.InsigniaType.Name,
|
||||||
// // RefCommandNo = req.RefCommandNo,
|
Insignia = insignia,
|
||||||
// // RefCommandDate = req.RefCommandDate,
|
// RefCommandNo = req.RefCommandNo,
|
||||||
// Profile = profile,
|
// RefCommandDate = req.RefCommandDate,
|
||||||
// CreatedFullName = FullName ?? "System Administrator",
|
ProfileId = profile.Id,
|
||||||
// CreatedUserId = UserId ?? "",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
// CreatedAt = DateTime.Now,
|
CreatedUserId = UserId ?? "",
|
||||||
// LastUpdateFullName = FullName ?? "System Administrator",
|
CreatedAt = DateTime.Now,
|
||||||
// LastUpdateUserId = UserId ?? "",
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
// LastUpdatedAt = DateTime.Now,
|
LastUpdateUserId = UserId ?? "",
|
||||||
// });
|
LastUpdatedAt = DateTime.Now,
|
||||||
// }
|
});
|
||||||
// await _context.InsigniaNoteProfiles.AddAsync(insigniaNoteProfile);
|
}
|
||||||
//}
|
await _context.InsigniaNoteProfiles.AddAsync(insigniaNoteProfile);
|
||||||
//else
|
}
|
||||||
//{
|
else
|
||||||
// profileInsignia.DatePayment = req.DatePayment;
|
{
|
||||||
// profileInsignia.TypePayment = req.TypePayment;
|
profileInsignia.DatePayment = req.DatePayment;
|
||||||
// profileInsignia.Address = req.Address;
|
profileInsignia.TypePayment = req.TypePayment;
|
||||||
// if (profileInsignia.Status != "DONE")
|
profileInsignia.Address = req.Address;
|
||||||
// {
|
if (profileInsignia.Status != "DONE")
|
||||||
// profileInsignia.Issue = req.Issue;
|
{
|
||||||
// profileInsignia.Number = req.Number;
|
profileInsignia.Issue = req.Issue;
|
||||||
// profileInsignia.DateReceive = req.DateReceive;
|
profileInsignia.Number = req.Number;
|
||||||
// profileInsignia.Date = req.Date;
|
profileInsignia.DateReceive = req.DateReceive;
|
||||||
// profileInsignia.VolumeNo = req.VolumeNo;
|
profileInsignia.Date = req.Date;
|
||||||
// profileInsignia.Section = req.Section;
|
profileInsignia.VolumeNo = req.VolumeNo;
|
||||||
// profileInsignia.Page = req.Page;
|
profileInsignia.Section = req.Section;
|
||||||
// profileInsignia.No = req.No;
|
profileInsignia.Page = req.Page;
|
||||||
// // profileInsignia.DatePayment = req.DatePayment;
|
profileInsignia.No = req.No;
|
||||||
// // profileInsignia.TypePayment = req.TypePayment;
|
// profileInsignia.DatePayment = req.DatePayment;
|
||||||
// // profileInsignia.Address = req.Address;
|
// profileInsignia.TypePayment = req.TypePayment;
|
||||||
// profileInsignia.RequestInsignia = insignia;
|
// profileInsignia.Address = req.Address;
|
||||||
// profileInsignia.LastUpdateFullName = FullName ?? "System Administrator";
|
profileInsignia.RequestInsignia = insignia;
|
||||||
// profileInsignia.LastUpdateUserId = UserId ?? "";
|
profileInsignia.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
// profileInsignia.LastUpdatedAt = DateTime.Now;
|
profileInsignia.LastUpdateUserId = UserId ?? "";
|
||||||
// if (req.DateReceive != null && req.Date != null)
|
profileInsignia.LastUpdatedAt = DateTime.Now;
|
||||||
// {
|
if (req.DateReceive != null && req.Date != null)
|
||||||
// profileInsignia.Status = "DONE";
|
{
|
||||||
// await _context.ProfileInsignias.AddAsync(new ProfileInsignia
|
profileInsignia.Status = "DONE";
|
||||||
// {
|
await _context.ProfileInsignias.AddAsync(new ProfileInsignia
|
||||||
// Year = insigniaNote.Year,
|
{
|
||||||
// No = req.No,
|
Year = insigniaNote.Year,
|
||||||
// Issue = req.VolumeNo,
|
No = req.No,
|
||||||
// VolumeNo = req.VolumeNo,
|
Issue = req.VolumeNo,
|
||||||
// // Volume = req.Volume,
|
VolumeNo = req.VolumeNo,
|
||||||
// Section = req.Section,
|
//Volume = req.Volume,
|
||||||
// Page = req.Page,
|
Section = req.Section,
|
||||||
// DateAnnounce = req.Date,
|
Page = req.Page,
|
||||||
// ReceiveDate = req.DateReceive,
|
DateAnnounce = req.Date,
|
||||||
// InsigniaType = insignia.InsigniaType == null ? null : insignia.InsigniaType.Name,
|
ReceiveDate = req.DateReceive,
|
||||||
// Insignia = insignia,
|
InsigniaType = insignia.InsigniaType == null ? null : insignia.InsigniaType.Name,
|
||||||
// // RefCommandNo = req.RefCommandNo,
|
Insignia = insignia,
|
||||||
// // RefCommandDate = req.RefCommandDate,
|
// RefCommandNo = req.RefCommandNo,
|
||||||
// ProfileId = profile.Id,
|
// RefCommandDate = req.RefCommandDate,
|
||||||
// CreatedFullName = FullName ?? "System Administrator",
|
ProfileId = profile.Id,
|
||||||
// CreatedUserId = UserId ?? "",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
// CreatedAt = DateTime.Now,
|
CreatedUserId = UserId ?? "",
|
||||||
// LastUpdateFullName = FullName ?? "System Administrator",
|
CreatedAt = DateTime.Now,
|
||||||
// LastUpdateUserId = UserId ?? "",
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
// LastUpdatedAt = DateTime.Now,
|
LastUpdateUserId = UserId ?? "",
|
||||||
// });
|
LastUpdatedAt = DateTime.Now,
|
||||||
// }
|
});
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
//await _context.SaveChangesAsync();
|
}
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue