Commit 1d5f4195 by 1391696987

wuzhou分支修复考勤保存不传时间报错,考勤/调入时间超出天数,无考勤类型展示不出表格bug

parent 88f655c2
...@@ -18,8 +18,8 @@ public class per_attendance_vacation ...@@ -18,8 +18,8 @@ public class per_attendance_vacation
public string PersonnelNumber { get; set; } //工号 public string PersonnelNumber { get; set; } //工号
public string PersonnelName { get; set; } //姓名 public string PersonnelName { get; set; } //姓名
public int TypeId { get; set; } //per_attendance_type表中ID public int TypeId { get; set; } //per_attendance_type表中ID
public DateTime BegDate { get; set; } //开始时间 public DateTime? BegDate { get; set; } //开始时间
public DateTime EndDate { get; set; } //结束时间 public DateTime? EndDate { get; set; } //结束时间
} }
} }
...@@ -257,7 +257,7 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ ...@@ -257,7 +257,7 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
{ "调入组别", newAttendanceVacatione[i].CallInUnitType??"" }, { "调入组别", newAttendanceVacatione[i].CallInUnitType??"" },
{ "调入时间", newAttendanceVacatione[i].CallInDate.ToString()??"" }, { "调入时间", newAttendanceVacatione[i].CallInDate.ToString()??"" },
{ "来源", "粘贴数据" }, { "来源", "粘贴数据" },
{ "错误原因", "调入时间不在当前绩效月份范围内" }, { "错误原因", $"调入时间不在当前绩效月份范围内,已超出{SplitEveryDay(dt.AddDays(-1),newAttendanceVacatione[i].CallInDate.Value).Count-1}" },
}); });
} }
...@@ -422,8 +422,8 @@ public HandsonTable GetAttendanceVacationHandsonTable(int allotId) ...@@ -422,8 +422,8 @@ public HandsonTable GetAttendanceVacationHandsonTable(int allotId)
t.PersonnelName, t.PersonnelName,
t.PersonnelNumber, t.PersonnelNumber,
t.AttendanceName, t.AttendanceName,
BegDate = t.BegDate.ToString("d"), BegDate = t.BegDate > DateTime.MinValue ? t.BegDate?.ToString("d") : t.BegDate.ToString(),
EndDate = t.EndDate.ToString("d") EndDate = t.EndDate > DateTime.MinValue ? t.EndDate?.ToString("d") : t.EndDate.ToString()
}); });
if (convertDate == null) if (convertDate == null)
return handson; return handson;
...@@ -458,7 +458,7 @@ public ApiResponse<List<RecordAttendcance>> GetAttendanceVacation(int allotId) ...@@ -458,7 +458,7 @@ public ApiResponse<List<RecordAttendcance>> GetAttendanceVacation(int allotId)
var vacatione = perfoPperAttendanceVacationeRepository.GetEntities(t => t.AllotId == allotId); var vacatione = perfoPperAttendanceVacationeRepository.GetEntities(t => t.AllotId == allotId);
var type = perfoPperAttendanceTypeRepository.GetEntities(t => t.AllotId == allotId); var type = perfoPperAttendanceTypeRepository.GetEntities(t => t.AllotId == allotId);
if (type.Count == 0) if (type.Count == 0)
return new ApiResponse<List<RecordAttendcance>>(ResponseType.Fail, "没有考勤类型"); return new ApiResponse<List<RecordAttendcance>>(ResponseType.Fail, new List<RecordAttendcance>());
var data = from a in vacatione var data = from a in vacatione
join b in type on a.TypeId equals b.Id into temp join b in type on a.TypeId equals b.Id into temp
...@@ -500,8 +500,8 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData ...@@ -500,8 +500,8 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData
PersonnelNumber = w["PersonnelNumber"], PersonnelNumber = w["PersonnelNumber"],
PersonnelName = w["PersonnelName"], PersonnelName = w["PersonnelName"],
AttendanceName = w["AttendanceName"], AttendanceName = w["AttendanceName"],
BegDate = ConvertHelper.To<DateTime>(w["BegDate"]), BegDate = ConvertHelper.To<DateTime?>(w["BegDate"]),
EndDate = ConvertHelper.To<DateTime>(w["EndDate"]), EndDate = ConvertHelper.To<DateTime?>(w["EndDate"]),
}); });
var jsons = JsonHelper.Serialize(convertDicData); var jsons = JsonHelper.Serialize(convertDicData);
...@@ -582,8 +582,8 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData ...@@ -582,8 +582,8 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData
} }
DateTime dt = new DateTime(per_allot.Year, per_allot.Month, 1); DateTime dt = new DateTime(per_allot.Year, per_allot.Month, 1).AddMonths(1);
if (newAttendanceVacatione[i].BegDate >= dt && newAttendanceVacatione[i].EndDate > dt.AddMonths(1)) if (newAttendanceVacatione[i].BegDate >= dt && newAttendanceVacatione[i].EndDate > dt)
{ {
error.Add(new Dictionary<string, string> error.Add(new Dictionary<string, string>
{ {
...@@ -594,7 +594,7 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData ...@@ -594,7 +594,7 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData
{ "开始日期", newAttendanceVacatione[i].BegDate.ToString()??"" }, { "开始日期", newAttendanceVacatione[i].BegDate.ToString()??"" },
{ "结束日期", newAttendanceVacatione[i].EndDate.ToString()??"" }, { "结束日期", newAttendanceVacatione[i].EndDate.ToString()??"" },
{ "来源", "粘贴数据" }, { "来源", "粘贴数据" },
{ "错误原因", "考勤时间不在该绩效月份内" }, { "错误原因", $"考勤时间不在该绩效月份内,已超出{SplitEveryDay(dt.AddDays(-1),newAttendanceVacatione[i].EndDate.Value).Count-1}" },
}); });
} }
if (newAttendanceVacatione[i].BegDate > newAttendanceVacatione[i].EndDate) if (newAttendanceVacatione[i].BegDate > newAttendanceVacatione[i].EndDate)
...@@ -713,7 +713,7 @@ public ApiResponse<List<AttendanceStatistics>> GetAttendanceStatistics(int allot ...@@ -713,7 +713,7 @@ public ApiResponse<List<AttendanceStatistics>> GetAttendanceStatistics(int allot
{ {
w.PersonnelNumber, w.PersonnelNumber,
Type = types.FirstOrDefault(p => p.Id == w.TypeId)?.AttendanceName ?? "考勤类型缺失", Type = types.FirstOrDefault(p => p.Id == w.TypeId)?.AttendanceName ?? "考勤类型缺失",
Dates = SplitEveryDay(w.BegDate.Date, w.EndDate.Date), Dates = SplitEveryDay(w.BegDate.Value.Date, w.EndDate.Value.Date),
Remark = types.FirstOrDefault(p => p.Id == w.TypeId)?.IsDeduction == (int)Attendance.Deduction.核减 ? "核减" : "不核减", Remark = types.FirstOrDefault(p => p.Id == w.TypeId)?.IsDeduction == (int)Attendance.Deduction.核减 ? "核减" : "不核减",
}); });
......
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