From 3b5ecd8e4f67beda4457c49152ba85339e54b48e Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Thu, 24 Oct 2024 15:19:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=8E=88=E8=AF=BE=E8=80=83=E5=8B=A4=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=96=B9=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TeachAttendanceController.cs | 14 +++++ .../StatisticDetailIndex.cshtml | 3 + .../TeachAttendance/StatisticDetailIndex.js | 10 ++++ .../XmlConfig/system.config | 3 + .../ADR_Restriction/ADR_RestrictionBLL.cs | 24 ++++++++ .../ADR_Restriction/ADR_RestrictionIBLL.cs | 6 ++ .../ADR_Restriction/ADR_RestrictionService.cs | 60 +++++++++++++++++++ 7 files changed, 120 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachAttendanceController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachAttendanceController.cs index cf75f1e40..22442bf3a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachAttendanceController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachAttendanceController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using Learun.Application.TwoDevelopment.PersonnelManagement; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -16,6 +17,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class TeachAttendanceController : MvcControllerBase { private TeachAttendanceIBLL teachAttendanceIBLL = new TeachAttendanceBLL(); + private ADR_RestrictionIBLL aDR_RestrictionIBLL = new ADR_RestrictionBLL(); #region 视图功能 @@ -148,6 +150,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers teachAttendanceIBLL.SaveEntity(keyValue,entity); return Success("保存成功!"); } + + /// + /// 授课时间变动后异常处理 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoHandleError() + { + aDR_RestrictionIBLL.DoHandleError(); + return Success("成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml index fa0aab9f8..e61ba3dda 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml @@ -44,6 +44,9 @@
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.js index 5eb760f28..40a04b202 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.js @@ -63,6 +63,16 @@ var bootstrap = function ($, learun) { }); //考勤状态 $('#ClockStatus').lrDataItemSelect({ code: 'ADStatus' }); + // 授课时间变动后异常处理 + $('#lr_handleError').on('click', function () { + learun.layerConfirm('是否确认处理!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/TeachAttendance/DoHandleError', {}, function () { + refreshGirdData(); + }); + } + }); + }); }, // 初始化列表 initGird: function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config index b7eed8e98..7485bf014 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -180,5 +180,8 @@ + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs index 65ff66790..16b6ccc0f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs @@ -338,6 +338,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + + /// + /// 授课时间变动后异常处理 + /// + /// + public void DoHandleError() + { + try + { + aDR_RestrictionService.DoHandleError(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs index e41ba6455..f51fa74b2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs @@ -84,5 +84,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// bool ClockInTeacher(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace, string LessonSortNo, string ALTId, string AlTOEId,string Img); + + /// + /// 授课时间变动后异常处理 + /// + /// 主键 + void DoHandleError(); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs index 4cc9a8a58..dfef4658f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs @@ -2302,6 +2302,66 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 授课时间变动后异常处理 + /// + /// + public void DoHandleError() + { + var clockTime1 = Config.GetValue("clockTime1"); + var clockTime2 = Config.GetValue("clockTime2"); + + try + { + var list = this.BaseRepository("CollegeMIS").FindList($@"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(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; } + + } } }