diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml index 0f5e3ee8f..4fec33d86 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.cshtml @@ -19,11 +19,11 @@
上午签到有效时间*
- +
-*
- +
@@ -32,11 +32,11 @@
下午签退有效时间*
- +
-*
- +
打卡次数*
@@ -48,11 +48,11 @@
中午签退有效时间*
- +
-*
- +
中午上班时间*
@@ -60,11 +60,11 @@
中午签到有效时间*
- +
-*
- +
@@ -82,6 +82,10 @@
未签退,记为*
+
+
+
考勤人员类型*
+
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js index a4a33cc17..4fc573603 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Form.js @@ -17,6 +17,7 @@ var bootstrap = function ($, learun) { bind: function () { $('#NoSignIn').lrDataItemSelect({ code: 'ADStatus' }); $('#NoSignOut').lrDataItemSelect({ code: 'ADStatus' }); + $('#AType').lrDataItemSelect({ code: 'AType' }); $('#ClockTime').lrselect({ data: [{ 'value': '二次打卡', text: '二次打卡' }, { 'value': '四次打卡', text: '四次打卡' }], value: "value", diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js index 2ba26bc5d..2751a6e1f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/Index.js @@ -76,7 +76,7 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/GetPageList', headData: [ { label: "上班时间", name: "WorkTime", width: 100, align: "left" }, @@ -118,6 +118,17 @@ var bootstrap = function ($, learun) { }); } }, + { + label: "考勤人员类型", name: "AType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'AType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, { label: "是否启用", name: "REnable", width: 100, align: "left", formatter: function (val) { return val ? "" : ""; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AttendanceApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AttendanceApi.cs index 8bef8976c..1c1e43934 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AttendanceApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/AttendanceApi.cs @@ -62,7 +62,7 @@ namespace Learun.Application.WebApi.Modules { Attendance parameter = this.GetReqData(); - adr_RestrictionBLL.ClockIn(); + adr_RestrictionBLL.ClockIn(parameter.ALon, parameter.ALat, parameter.AIsOut, parameter.ARemark,parameter.ADPhoto,parameter.ClockPlace); return Success("打卡成功"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs index 1a17778f6..9791da744 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/ADR_Record/ADR_RecordEntity.cs @@ -79,16 +79,24 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// [Column("ADPHOTO")] public string ADPhoto { get; set; } - + /// + /// 经度 + /// [Column("ALON")] public decimal ALon { get; set; } - + /// + /// 纬度 + /// [Column("ALAT")] public decimal ALat { get; set; } - + /// + /// 是否外勤 + /// [Column("AISOUT")] public bool AIsOut { get; set; } - + /// + /// 备注 + /// [Column("AREMARK")] public string ARemark { get; set; } #endregion 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 840f7d603..aa70dad5f 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 @@ -147,11 +147,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 考勤打卡 /// /// - public bool ClockIn() + public bool ClockIn(decimal ALon, decimal ALat,bool AIsOut,string ARemark,string ADPhoto,string ClockPlace) { try { - return aDR_RestrictionService.ClockIn(); + return aDR_RestrictionService.ClockIn(ALon,ALat,AIsOut,ARemark,ADPhoto,ClockPlace); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionEntity.cs index e9e8fc197..fc365774e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionEntity.cs @@ -141,6 +141,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement [Column("BLUETOOTHID")] public string BlueToothId { get; set; } + /// + /// 考勤类型(1正常,2全天考勤) + /// + [Column("ATYPE")] + public int AType { get; set; } #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 e41848f98..75dc6b1ef 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 @@ -53,7 +53,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 考勤打卡 /// /// - bool ClockIn(); + bool ClockIn(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace); string IsAttendance(); #endregion 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 e343a8d10..1d1548666 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 @@ -33,28 +33,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement try { var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" - t.ID, - t.WorkTime, - t.CloseTime, - t.SignInStartTime, - t.SignInEndTime, - t.SignOutStartTime, - t.SignOutEndTime, - t.LateOvertime, - t.LeaveOverTime, - t.NoSignIn, - t.REnable, - t.ClockTime, - t.SignInStartTime2, - t.SignInEndTime2, - t.NoonWorkTime, - t.NoonCloseTime, - t.SignOutStartTime2, - t.SignOutEndTime2, - t.NoSignOut - "); + strSql.Append("SELECT * "); strSql.Append(" FROM ADR_Restriction t "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); @@ -135,8 +114,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - var sql = "UPDATE dbo.ADR_Restriction SET REnable='false'"; - db.ExecuteBySql(sql); + //var sql = "UPDATE dbo.ADR_Restriction SET REnable='false'"; + //db.ExecuteBySql(sql); var entity = db.FindEntity(a => a.ID == keyValue); entity.REnable = true; db.Update(entity); @@ -193,7 +172,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 考勤打卡 /// /// - public bool ClockIn() + public bool ClockIn(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace) { try { @@ -418,6 +397,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement adrRecordEntity.ADYear = strTimeYear; adrRecordEntity.ADMonth = strTimeMonth; adrRecordEntity.ADDay = strTimeDay; + adrRecordEntity.ALon = ALon; + adrRecordEntity.ALat = ALat; + adrRecordEntity.AIsOut = AIsOut; + adrRecordEntity.ARemark = ARemark; + adrRecordEntity.ADPhoto = ADPhoto; + adrRecordEntity.ClockPlace = ClockPlace; ////记录日志 //ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity(); //adrDeviceLogEntity.Create(); @@ -454,10 +439,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement return true; } //考勤记录 - this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto) values(" + + this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" + "'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + "'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.ADYear + "'," + - "'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "')"); + "'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "',"+adrRecordEntity.ALon+","+adrRecordEntity.ALat+","+adrRecordEntity.AIsOut+",'"+adrRecordEntity.ARemark+"')"); return true; } #endregion @@ -533,6 +518,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement adrRecordEntity.ADYear = strTimeYear; adrRecordEntity.ADMonth = strTimeMonth; adrRecordEntity.ADDay = strTimeDay; + adrRecordEntity.ALon = ALon; + adrRecordEntity.ALat = ALat; + adrRecordEntity.AIsOut = AIsOut; + adrRecordEntity.ARemark = ARemark; + adrRecordEntity.ADPhoto = ADPhoto; + adrRecordEntity.ClockPlace = ClockPlace; ////记录日志 //ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity(); //adrDeviceLogEntity.Create(); @@ -563,10 +554,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } else { - this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto) values(" + + this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" + "'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + "'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.ADYear + "'," + - "'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "')"); + "'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + "," + adrRecordEntity.AIsOut + ",'" + adrRecordEntity.ARemark + "')"); return true; } } @@ -627,6 +618,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement adrRecordEntity.ADYear = strTimeYear; adrRecordEntity.ADMonth = strTimeMonth; adrRecordEntity.ADDay = strTimeDay; + adrRecordEntity.ALon = ALon; + adrRecordEntity.ALat = ALat; + adrRecordEntity.AIsOut = AIsOut; + adrRecordEntity.ARemark = ARemark; + adrRecordEntity.ADPhoto = ADPhoto; + adrRecordEntity.ClockPlace = ClockPlace; ////记录日志 //ADR_DeviceLogEntity adrDeviceLogEntity = new ADR_DeviceLogEntity(); //adrDeviceLogEntity.Create(); @@ -647,10 +644,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var attendancerecordlist = this.BaseRepository("CollegeMIS").FindList("select * from ADR_Record where ADYear='" + strTimeYear + "' and ADMonth='" + strTimeMonth + "' and ADDay='" + strTimeDay + "' and UserNo='" + EmpNo + "'").ToList(); if (attendancerecordlist.Count(m => m.ADType == "7") == 0) { - this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto) values(" + + this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" + "'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + "'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.ADYear + "'," + - "'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "')"); + "'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + "," + adrRecordEntity.AIsOut + ",'" + adrRecordEntity.ARemark + "')"); } return true; } @@ -975,6 +972,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement adrRecordEntity.ADYear = strTimeYear; adrRecordEntity.ADMonth = strTimeMonth; adrRecordEntity.ADDay = strTimeDay; + adrRecordEntity.ALon = ALon; + adrRecordEntity.ALat = ALat; + adrRecordEntity.AIsOut = AIsOut; + adrRecordEntity.ARemark = ARemark; + adrRecordEntity.ADPhoto = ADPhoto; + adrRecordEntity.ClockPlace = ClockPlace; //adrRecordEntity.ADPhoto = str; ////记录日志 //ADR_DeviceLogEntity adrDeviceLogEntitylateorleave = new ADR_DeviceLogEntity(); @@ -1030,10 +1033,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement return true; } //考勤记录 - this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto) values(" + + this.BaseRepository("CollegeMIS").ExecuteBySql("insert into ADR_Record(ID, UserNo, ADType, ADTime, ClockTime, ClockStatus, ClockPlace, ADYear, ADMonth, ADDay, ADPhoto,ALon,ALat,AIsOut,ARemark) values(" + "'" + adrRecordEntity.ID + "','" + adrRecordEntity.UserNo + "','" + adrRecordEntity.ADType + "','" + adrRecordEntity.ADTime + "'," + "'" + adrRecordEntity.ClockTime + "','" + adrRecordEntity.ClockStatus + "','" + adrRecordEntity.ClockPlace + "','" + adrRecordEntity.ADYear + "'," + - "'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "')"); + "'" + adrRecordEntity.ADMonth + "','" + adrRecordEntity.ADDay + "','" + adrRecordEntity.ADPhoto + "'," + adrRecordEntity.ALon + "," + adrRecordEntity.ALat + "," + adrRecordEntity.AIsOut + ",'" + adrRecordEntity.ARemark + "')"); return true; } @@ -1068,6 +1071,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { try { + var userinfo = LoginUserInfo.Get(); + var empinfo = BaseRepository("").FindEntity(m=>m.EmpNo==userinfo.account); //当前服务器日期 var datenow = DateTime.Now.ToString("yyyy-MM-dd"); @@ -1075,7 +1080,16 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var EmpNo = LoginUserInfo.Get().account; //首先获取考勤规则 - var attendancerulEntity = this.BaseRepository("CollegeMIS").FindEntity(m => m.REnable == true); + ADR_RestrictionEntity attendancerulEntity =null; + //代课老师全天可以考勤 + if (empinfo.IsHasLesson==true) + { + attendancerulEntity = this.BaseRepository("CollegeMIS").FindEntity(m => m.REnable == true&&m.AType==2); + } + else + { + attendancerulEntity = this.BaseRepository("CollegeMIS").FindEntity(m => m.REnable == true && m.AType == 1); + } //上班时间 DateTime workDateTime = Convert.ToDateTime(datenow + " " + attendancerulEntity.WorkTime); //上班考勤时间段