Commit 28ddeae2 by wyc

加载默认考勤(补充限制)

parent 7cb504e1
...@@ -723,10 +723,10 @@ public ApiResponse AttendanceTypeBatch(int allotId, int hospitalId, SaveCollectD ...@@ -723,10 +723,10 @@ public ApiResponse AttendanceTypeBatch(int allotId, int hospitalId, SaveCollectD
return new ApiResponse(ResponseType.WarningTable, "验证不通过,当前操作已拒绝", error); return new ApiResponse(ResponseType.WarningTable, "验证不通过,当前操作已拒绝", error);
perfoPperAttendanceTypeRepository.RemoveRange(oldAttendanceType.ToArray()); perfoPperAttendanceTypeRepository.RemoveRange(oldAttendanceType.ToArray());
List<per_attendance_type> addAttendanceType = new List<per_attendance_type>(); List<per_attendance_type> addAttendanceType = new List<per_attendance_type>();
int idMax = perfoPperAttendanceTypeRepository.GetEntities().Max(w => w.Id); int idMax = perfoPperAttendanceTypeRepository.GetEntities().Max(w => w.Id);
foreach (var data in newAttendanceType) foreach (var data in newAttendanceType)
{ {
data.Id = ++idMax; data.Id = ++idMax;
data.AllotId = allotId; data.AllotId = allotId;
data.HospitalId = hospitalId; data.HospitalId = hospitalId;
addAttendanceType.Add(data); addAttendanceType.Add(data);
...@@ -756,6 +756,9 @@ public ApiResponse GetAttendanceReplenishment(int allotId, int userid) ...@@ -756,6 +756,9 @@ public ApiResponse GetAttendanceReplenishment(int allotId, int userid)
.GetEntity(g => g.AllotId == allotId && g.IsDefault == (int)Attendance.Default.默认) .GetEntity(g => g.AllotId == allotId && g.IsDefault == (int)Attendance.Default.默认)
?? throw new PerformanceException("未设置默认类型"); ?? throw new PerformanceException("未设置默认类型");
var allot = perforPerallotRepository.GetEntity(w => w.ID == allotId) ?? throw new PerformanceException("当前绩效记录不存在"); ;
var days = DateTime.DaysInMonth(allot.Year, allot.Month);
//查询全部考勤上报内容 //查询全部考勤上报内容
var attendanceDepts = _perforPerAttendanceDeptRepository.GetEntities(t => t.AllotId == allotId); var attendanceDepts = _perforPerAttendanceDeptRepository.GetEntities(t => t.AllotId == allotId);
...@@ -770,7 +773,7 @@ public ApiResponse GetAttendanceReplenishment(int allotId, int userid) ...@@ -770,7 +773,7 @@ public ApiResponse GetAttendanceReplenishment(int allotId, int userid)
?.Where(w => w.PersonnelNumber == item.PersonnelNumber && w.UnitType != item.UnitType && w.AccountingUnit != item.AccountingUnit) ?.Where(w => w.PersonnelNumber == item.PersonnelNumber && w.UnitType != item.UnitType && w.AccountingUnit != item.AccountingUnit)
.ToList(); .ToList();
for (int day = 1; day <= 31; day++) for (int day = 1; day <= days; day++)
{ {
string dayPropertyName = $"Day{day:00}"; string dayPropertyName = $"Day{day:00}";
int? dayValue = (int?)typeof(per_attendance_dept).GetProperty(dayPropertyName)?.GetValue(item); int? dayValue = (int?)typeof(per_attendance_dept).GetProperty(dayPropertyName)?.GetValue(item);
......
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