|
|
@@ -2302,6 +2302,66 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 授课时间变动后异常处理 |
|
|
|
/// </summary> |
|
|
|
/// <returns></returns> |
|
|
|
public void DoHandleError() |
|
|
|
{ |
|
|
|
var clockTime1 = Config.GetValue("clockTime1"); |
|
|
|
var clockTime2 = Config.GetValue("clockTime2"); |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
var list = this.BaseRepository("CollegeMIS").FindList<HandleErrorModel>($@"select * from |
|
|
|
( |
|
|
|
select t.EmpNo,t.EmpName,CONVERT(date,t.ClockTime) as clockdate,count(t.ID) as total, |
|
|
|
sum(case when t.ADType=1 then 1 else 0 end) as total1,sum(case when t.ADType=2 then 1 else 0 end) as total2, |
|
|
|
(select count(al.ALTId) from ArrangeLessonTerm al where al.AcademicYearNo='24-25' and al.Semester='1' and al.LessonDate=CONVERT(date,t.ClockTime) and al.EmpNo=t.EmpNo)*2 as arrangetotal |
|
|
|
from Teach_Attendance t |
|
|
|
left join ArrangeLessonTerm a on t.ALTId=a.ALTId |
|
|
|
where a.AcademicYearNo='24-25' and a.Semester='1' and CONVERT(date,a.InsertDate)='2024-10-05' |
|
|
|
and CONVERT(date,t.ADTime)>='{clockTime1}' and CONVERT(date,t.ADTime)<='{clockTime2}' |
|
|
|
group by CONVERT(date,t.ClockTime),t.EmpNo,t.EmpName |
|
|
|
)as bb |
|
|
|
where bb.total1!=bb.total2 or bb.total!=bb.arrangetotal |
|
|
|
order by bb.clockdate,bb.EmpNo"); |
|
|
|
|
|
|
|
foreach (var item in list) |
|
|
|
{ |
|
|
|
var day = item.clockdate.Day < 10 ? "0" + item.clockdate.Day.ToString() : item.clockdate.Day.ToString(); |
|
|
|
var adr_recordEntity = this.BaseRepository("CollegeMIS").FindEntity<ADR_RecordEntity>(x => x.ADType == "2" && x.UserNo == item.EmpNo && x.ADYear == item.clockdate.Year.ToString() && x.ADMonth == item.clockdate.Month.ToString() && x.ADDay == day); |
|
|
|
if (adr_recordEntity != null) |
|
|
|
{ |
|
|
|
adr_recordEntity.UserName = item.EmpName; |
|
|
|
ClockInModifyTeachAttendance(adr_recordEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
if (ex is ExceptionEx) |
|
|
|
{ |
|
|
|
throw; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw ExceptionEx.ThrowServiceException(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public class HandleErrorModel |
|
|
|
{ |
|
|
|
public string EmpNo { get; set; } |
|
|
|
public string EmpName { get; set; } |
|
|
|
public DateTime clockdate { get; set; } |
|
|
|
public int total { get; set; } |
|
|
|
public int total1 { get; set; } |
|
|
|
public int total2 { get; set; } |
|
|
|
public int arrangetotal { get; set; } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |