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

考勤判断修改

黑艺新账号
liangkun пре 1 година
родитељ
комит
95d787c3f0
4 измењених фајлова са 65 додато и 15 уклоњено
  1. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs
  2. +11
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionEntity.cs
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs
  4. +52
    -13
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionBLL.cs Прегледај датотеку

@@ -166,7 +166,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

public string IsAttendance()
public ADR_RestrictionEntity IsAttendance()
{
try
{


+ 11
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionEntity.cs Прегледај датотеку

@@ -147,6 +147,17 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
[Column("ATYPE")]
public int AType { get; set; }

/// <summary>
/// 当前签到状态(1正常打卡,2迟到打卡,3早退打卡,4外勤打卡,5不在考勤时间范围)
/// </summary>
[NotMapped]
public int AttendanceType { get; set; }
/// <summary>
/// 当前签到状态描述
/// </summary>
[NotMapped]
public string AttendanceTypeString { get; set; }

#endregion

#region 扩展操作


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionIBLL.cs Прегледај датотеку

@@ -55,7 +55,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// <returns></returns>
bool ClockIn(decimal ALon, decimal ALat, bool AIsOut, string ARemark, string ADPhoto, string ClockPlace);

string IsAttendance();
ADR_RestrictionEntity IsAttendance();
#endregion

ADR_RestrictionEntity GetADR_RestrictionEntityEnabled();


+ 52
- 13
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ADR_Restriction/ADR_RestrictionService.cs Прегледај датотеку

@@ -1063,14 +1063,16 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}


/// <summary>
/// 判断当前时间是否可以打卡
/// </summary>
/// <returns></returns>
public string IsAttendance()
public ADR_RestrictionEntity IsAttendance()
{
try
{
var adrresult = new ADR_RestrictionEntity();
var userinfo = LoginUserInfo.Get();
var empinfo = BaseRepository("").FindEntity<EmpInfoEntity>(m=>m.EmpNo==userinfo.account);
//当前服务器日期
@@ -1105,7 +1107,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
//小于上班考勤开始时间或大于下班考勤结束时间,(超出打卡时间范围黄色)
if (datetimenow < signInStartTime || datetimenow > signOutEndTime)
{
return "yellow";
adrresult.AttendanceType =5;
adrresult.AttendanceTypeString= "不在考勤时间范围";
return adrresult;
}
string strTimeYear = (datetimenow.Year).ToString();
string strTimeMonth = (datetimenow.Month).ToString("d2");
@@ -1138,17 +1142,27 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
//上班 大于上班开始时间 小于上班最晚签到时间,已经打卡是红色
if (datetimenow > signInStartTime && datetimenow < workDateTimeFree && attendancerecordList.Count(x => x.ADType == "1") > 0)
{
return "red";
adrresult.AttendanceType = 3;
adrresult.AttendanceTypeString = "早退打卡";
adrresult.WorkTime = attendancerecordList.OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
return adrresult;
}
//超过上班最晚签到时间 小于下班最早签退时间,黄色
else if (datetimenow > workDateTimeFree && datetimenow < offworkDateTimeFree)
{
return "yellow";
adrresult.AttendanceType = 2;
adrresult.AttendanceTypeString = "迟到打卡";
return adrresult;
}
//下班
else if (datetimenow > offworkDateTimeFree && datetimenow < signOutEndTime && attendancerecordList.Count(x => x.ADType == "2") > 0)
{
return "red";
//更新最晚下班时间
adrresult.AttendanceType = 1;
adrresult.AttendanceTypeString = "正常打卡";
adrresult.WorkTime = attendancerecordList.Where(m=>m.ADType=="1").OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
adrresult.CloseTime = attendancerecordList.Where(m => m.ADType == "2").OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
return adrresult;
}
}
else//四次打卡
@@ -1183,38 +1197,61 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
//上班 大于上班开始时间 小于上班最晚签到时间,已经打卡是红色
if (datetimenow > signInStartTime && datetimenow < workDateTimeFree && attendancerecordList.Count(x => x.ADType == "1") > 0)
{
return "red";
adrresult.AttendanceType = 3;
adrresult.AttendanceTypeString = "早退打卡";
adrresult.WorkTime = attendancerecordList.OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
return adrresult;
}
//超过上班最晚签到时间 小于中午下班最早签退时间,黄色
else if (datetimenow > workDateTimeFree && datetimenow < offworkDateTimelunchFree)
{
return "yellow";
adrresult.AttendanceType = 2;
adrresult.AttendanceTypeString = "迟到打卡";
return adrresult;
}
//中午下班 大于中午下班最早签退时间 小于中午下班结束时间
else if (datetimenow > offworkDateTimelunchFree && datetimenow < offworkendlunch && attendancerecordList.Count(x => x.ADType == "8") > 0)
{
return "red";
//更新最晚下班时间
adrresult.AttendanceType = 1;
adrresult.AttendanceTypeString = "正常打卡";
adrresult.WorkTime = attendancerecordList.Where(m => m.ADType == "1").OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
adrresult.CloseTime = attendancerecordList.Where(m => m.ADType == "8").OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
return adrresult;
}
//超过中午下班结束时间 小于中午上班开始时间
else if (datetimenow > offworkendlunch && datetimenow < workstartlunch)
{
return "yellow";
adrresult.AttendanceType = 2;
adrresult.AttendanceTypeString = "迟到打卡";
return adrresult;
}
//中午上班 大于中午上班开始时间,小于中午上班最晚签到时间
else if (datetimenow > workstartlunch && datetimenow < workDateTimelunchFree &&
attendancerecordList.Count(x => x.ADType == "7") > 0)
{
return "red";
adrresult.AttendanceType = 1;
adrresult.AttendanceTypeString = "正常打卡";
adrresult.WorkTime = attendancerecordList.Where(m => m.ADType == "7").OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
return adrresult;
}
//大于中午上班最晚签到时间 小于下午下班最早签退时间
else if (datetimenow > workDateTimelunchFree && datetimenow < offworkDateTimeFree)
{
return "yellow";
adrresult.AttendanceType = 3;
adrresult.AttendanceTypeString = "早退打卡";
adrresult.WorkTime = attendancerecordList.Where(m => m.ADType == "7").OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
adrresult.CloseTime = attendancerecordList.Where(m => m.ADType == "8").OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
return adrresult;
}
//下班 大于下班最早签退时间,小于 下班结束时间
else if (datetimenow > offworkDateTimeFree && datetimenow < signOutEndTime && attendancerecordList.Count(x => x.ADType == "2") > 0)
{
return "red";
adrresult.AttendanceType = 1;
adrresult.AttendanceTypeString = "正常打卡";
adrresult.WorkTime = attendancerecordList.Where(m => m.ADType == "7").OrderByDescending(m => m.ADTime).First().ADTime.Value.ToString();
return adrresult;
}

}
@@ -1287,7 +1324,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
//}
#endregion

return "blue";
adrresult.AttendanceType = 1;
adrresult.AttendanceTypeString = "正常打卡";
return adrresult;
}
catch (Exception ex)
{


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