Преглед изворни кода

【增加】处理授课考勤异常数据方法;

黑龙江艺术高中职
dyy пре 1 месец
родитељ
комит
3b5ecd8e4f
7 измењених фајлова са 120 додато и 0 уклоњено
  1. +14
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachAttendanceController.cs
  2. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml
  3. +10
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.js
  4. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
  5. +24
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs
  6. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs
  7. +60
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs

+ 14
- 0
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("保存成功!");
}

/// <summary>
/// 授课时间变动后异常处理
/// <summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DoHandleError()
{
aDR_RestrictionIBLL.DoHandleError();
return Success("成功!");
}
#endregion

}


+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml Прегледај датотеку

@@ -44,6 +44,9 @@
<div class=" btn-group btn-group-sm">
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div>
<div class=" btn-group btn-group-sm">
@*<a id="lr_handleError" class="btn btn-default">授课时间变动后异常处理</a>*@
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>


+ 10
- 0
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 () {


+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config Прегледај датотеку

@@ -180,5 +180,8 @@
<add key="ChannelId" value="49"/>
<add key="ApiKey" value="fafc361a-40c1-4060-8eee-ea796640c39c"/>
<add key="Ports" value="192.168.50.127:8007"/>

<add key="clockTime1" value="2024-10-10"/>
<add key="clockTime2" value="2024-10-15"/>
</appSettings>

+ 24
- 0
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
}
}


/// <summary>
/// 授课时间变动后异常处理
/// </summary>
/// <returns></returns>
public void DoHandleError()
{
try
{
aDR_RestrictionService.DoHandleError();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}


+ 6
- 0
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
/// <returns></returns>
bool ClockInTeacher(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace, string LessonSortNo, string ALTId, string AlTOEId,string Img);


/// <summary>
/// 授课时间变动后异常处理
/// </summary>
/// <param name="keyValue">主键</param>
void DoHandleError();
}
}

+ 60
- 0
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
}
}

/// <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; }

}

}
}

Loading…
Откажи
Сачувај