Fix Bug กรองวันที่ #1630, #1631

This commit is contained in:
Bright 2025-07-21 14:03:09 +07:00
parent 3384c520d7
commit 1aadb82acd
2 changed files with 9 additions and 6 deletions

View file

@ -142,15 +142,17 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
{ {
data_search = data_search data_search = data_search
.Where(x => .Where(x =>
//วันที่รับเรือง
(!req.dateReceivedStart.HasValue || !req.dateReceivedEnd.HasValue || (!req.dateReceivedStart.HasValue || !req.dateReceivedEnd.HasValue ||
(x.DateReceived.HasValue && (x.DateReceived.HasValue &&
x.DateReceived.Value.Date >= req.dateReceivedStart.Value.Date && x.DateReceived.Value.Date >= req.dateReceivedStart.Value.Date &&
x.DateReceived.Value.Date <= req.dateReceivedEnd.Value.Date)) x.DateReceived.Value.Date <= req.dateReceivedEnd.Value.Date))
&& &&
//วันที่สอบสวน
(!req.disciplinaryDateStart.HasValue || !req.disciplinaryDateEnd.HasValue || (!req.disciplinaryDateStart.HasValue || !req.disciplinaryDateEnd.HasValue ||
(x.DateConsideration.HasValue && (x.DisciplinaryDateStart.HasValue && x.DisciplinaryDateEnd.HasValue &&
x.DateConsideration.Value.Date >= req.disciplinaryDateStart.Value.Date && x.DisciplinaryDateStart.Value.Date >= req.disciplinaryDateStart.Value.Date &&
x.DateConsideration.Value.Date <= req.disciplinaryDateEnd.Value.Date)) x.DisciplinaryDateEnd.Value.Date <= req.disciplinaryDateEnd.Value.Date))
&& &&
(string.IsNullOrEmpty(req.respondentType) || x.RespondentType == req.respondentType) (string.IsNullOrEmpty(req.respondentType) || x.RespondentType == req.respondentType)
&& &&
@ -173,6 +175,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
DisciplinaryFaultLevel = x.DisciplinaryFaultLevel,//ระดับโทษความผิด DisciplinaryFaultLevel = x.DisciplinaryFaultLevel,//ระดับโทษความผิด
DisciplinaryCaseFault = x.DisciplinaryCaseFault,//กรณีความผิด DisciplinaryCaseFault = x.DisciplinaryCaseFault,//กรณีความผิด
Status = x.Status,//สถานะหรือผลการสอบสวน Status = x.Status,//สถานะหรือผลการสอบสวน
DateReceived = x.DateReceived, //วันที่รับเรื่อง
CreatedAt = x.CreatedAt,//วันที่สร้างเรื่องสอบสวน CreatedAt = x.CreatedAt,//วันที่สร้างเรื่องสอบสวน
DisciplinaryDateStart = x.DisciplinaryDateStart, //วันที่เริ่มการสอบสวน DisciplinaryDateStart = x.DisciplinaryDateStart, //วันที่เริ่มการสอบสวน
DisciplinaryDateEnd = x.DisciplinaryDateEnd, //วันที่สิ้นสุดการสอบสวน DisciplinaryDateEnd = x.DisciplinaryDateEnd, //วันที่สิ้นสุดการสอบสวน

View file

@ -169,9 +169,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
data_search = data_search data_search = data_search
.Where(x => .Where(x =>
(!req.disciplinaryDateStart.HasValue || !req.disciplinaryDateEnd.HasValue || (!req.disciplinaryDateStart.HasValue || !req.disciplinaryDateEnd.HasValue ||
(x.DateReceived.HasValue && (x.DisciplinaryDateStart.HasValue && x.DisciplinaryDateEnd.HasValue &&
x.DateReceived.Value.Date >= req.disciplinaryDateStart.Value.Date && x.DisciplinaryDateStart.Value.Date >= req.disciplinaryDateStart.Value.Date &&
x.DateReceived.Value.Date <= req.disciplinaryDateEnd.Value.Date)) x.DisciplinaryDateEnd.Value.Date <= req.disciplinaryDateEnd.Value.Date))
&& &&
(string.IsNullOrEmpty(req.respondentType) || x.RespondentType == req.respondentType) (string.IsNullOrEmpty(req.respondentType) || x.RespondentType == req.respondentType)
&& &&