Commit 023d7e0b by ruyun.zhang

考勤下发月末BUG修复

parent 60f64e12
...@@ -844,9 +844,10 @@ public ApiResponse<List<AttendanceStatistics>> GetAttendanceStatistics(int allot ...@@ -844,9 +844,10 @@ public ApiResponse<List<AttendanceStatistics>> GetAttendanceStatistics(int allot
{ {
var begDate = attendances.ElementAt(i).AttendanceDate.Date; var begDate = attendances.ElementAt(i).AttendanceDate.Date;
var endDate = attendances.ElementAt(i + 1).AttendanceDate.Date; var endDate = attendances.ElementAt(i + 1).AttendanceDate.Date;
var lastDayOfMonth = new DateTime(begDate.Year, begDate.Month, 1).AddMonths(1).AddDays(-1).Date;
// 调入科室需要额外减去1天作为上一个科室结束时间 // 调入科室需要额外减去1天作为上一个科室结束时间
var days = attendances.ElementAt(i + 1).Source == Attendance.Type.调入.ToString() ? -1 : 0; var days = attendances.ElementAt(i + 1).Source == Attendance.Type.调入.ToString() ? -1 : 0;
if (endDate > begDate) if (endDate > begDate || begDate == lastDayOfMonth)
{ {
var stat = new AttendanceStatistics var stat = new AttendanceStatistics
{ {
......
...@@ -463,8 +463,8 @@ public IEnumerable<dynamic> QueryAttendanceIssue(int allotId, List<string> unitT ...@@ -463,8 +463,8 @@ public IEnumerable<dynamic> QueryAttendanceIssue(int allotId, List<string> unitT
} }
if (!string.IsNullOrEmpty(accountingUnit)) if (!string.IsNullOrEmpty(accountingUnit))
{ {
sql += " and accountingUnit like @accountingUnit"; sql += " and accountingUnit = @accountingUnit";
parameters.Add("@accountingUnit", $"%{accountingUnit}%"); parameters.Add("@accountingUnit", $"accountingUnit");
} }
if (!string.IsNullOrEmpty(personnelNameOrNumber)) if (!string.IsNullOrEmpty(personnelNameOrNumber))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment