|
|
@@ -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<ADR_RestrictionEntity>(a => a.ID == keyValue); |
|
|
|
entity.REnable = true; |
|
|
|
db.Update(entity); |
|
|
@@ -193,7 +172,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
/// 考勤打卡 |
|
|
|
/// </summary> |
|
|
|
/// <returns></returns> |
|
|
|
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<ADR_RecordEntity>("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<EmpInfoEntity>(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<ADR_RestrictionEntity>(m => m.REnable == true); |
|
|
|
ADR_RestrictionEntity attendancerulEntity =null; |
|
|
|
//代课老师全天可以考勤 |
|
|
|
if (empinfo.IsHasLesson==true) |
|
|
|
{ |
|
|
|
attendancerulEntity = this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m => m.REnable == true&&m.AType==2); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
attendancerulEntity = this.BaseRepository("CollegeMIS").FindEntity<ADR_RestrictionEntity>(m => m.REnable == true && m.AType == 1); |
|
|
|
} |
|
|
|
//上班时间 |
|
|
|
DateTime workDateTime = Convert.ToDateTime(datenow + " " + attendancerulEntity.WorkTime); |
|
|
|
//上班考勤时间段 |
|
|
|