c#考勤统计
现在项目需求,需要从多张表中获取数据,组装到一个实体对象中,并通过计算统计出每个员工的考勤记录。(全凭自己思考做的,不足的地方希望各位大神指正!毕竟自己能力有限,思考不全)
考勤统计列表:
明细列表:
如下代码:
/// <summary>
/// 获取考勤列表
/// </summary>
/// <param name="dto"></param>
/// <param name="Page"></param>
/// <param name="PageSize"></param>
/// <returns></returns>
public ResultEntity<List<AttendCountDTO>> QueryAttendList(SearchAttendCountDTO dto, int Page, int PageSize)
{
#region 获取当前年月日
var FirstDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + " -01"); //当前月第一天
var NowDate = DateTime.Now;
#endregion var lists = new List<AttendCountDTO>();
DepartRepository departRepository = new DepartRepository();
AttendCountRepository attendCountRepository = new AttendCountRepository();
HolidayRepository holidayRepository = new HolidayRepository();
DPEAssRepository dpeAssRepository = new DPEAssRepository();
PostRepository postRepository = new PostRepository();
AttendEditorRepository attendEditorRepository = new AttendEditorRepository();
AttendancesRepository attendRepository = new AttendancesRepository();
GetWorkDays workDays = new GetWorkDays();
var allEmployees = attendCountRepository.QueryAllEmployee(dto); //所有员工
var allEmployeeIds = allEmployees.Select(f => f.Id).ToList(); //所有员工Id
var allAttendEntities = attendRepository.GetAllAttendancesById(allEmployeeIds); //所有员工的所有考勤
var allOffWorkEntities = attendRepository.GetAllOffWork(allEmployeeIds); //所有员工的所有考勤
var allDPEEntities = dpeAssRepository.GetAllDPEAssById(allEmployeeIds); //获得所有员工关联表
var allDPEIds = allDPEEntities.Select(f => f.PostId).ToList(); //获得所有员工关联表的岗位Id
var allPostEntities = postRepository.GetAllPostById(allDPEIds); //获得所有员工的岗位信息
var allDepartIds = allPostEntities.Select(f => f.DepartmentId).ToList(); //获得所有员工岗位的部门Id
var allDepartEntities = departRepository.QueryAllDepart(allDepartIds); //获得所有员工的部门信息
var allAttendConfigEntities = attendEditorRepository.GetAllAttendancesConfigById(allDepartIds); //获得所有员工的考勤配置信息 if (allEmployees.Count() > )
{
foreach (var Employee in allEmployees)
{
AttendCountDTO attendCountDTO = new AttendCountDTO(); #region 获得部门名称,和该部门的上班下班时间
string[] WorkDayNums = null;
int NoWorkDayNum = ;
var workStartTime = new DateTime(, , , , , );
var workEndTime = new DateTime(, , , , , );
var dpeass = allDPEEntities.Where(f => f.EmployeeId == Employee.Id).FirstOrDefault();
if (dpeass != null)
{
var post = allPostEntities.Where(f => f.Id == dpeass.PostId).FirstOrDefault();
if (post != null)
{
if (string.IsNullOrEmpty(dto.Position) || post.Name == dto.Position)
{
attendCountDTO.Position = post.Name;
var department = allDepartEntities.Where(f => f.Id == post.DepartmentId).FirstOrDefault(); //获取员工所属的部门
if (department != null)
{
if (string.IsNullOrEmpty(dto.DepartmentName) || department.Name.Contains(dto.DepartmentName))
{
attendCountDTO.DepartmentName = department.Name;
attendCountDTO.DepartmentId = department.Id;
var attendConfig = allAttendConfigEntities.Where(f => f.DepartmentId == department.Id).FirstOrDefault();
if (attendConfig != null)
{
workStartTime = DateTime.Parse(attendConfig.StartTime); //该部门的上班时间和下班时间
workEndTime = DateTime.Parse(attendConfig.EndTime); #region 工作日
string workDay = attendConfig.WorkDays;
string WorkDay = workDay.Substring(, workDay.Length - );
WorkDayNums = WorkDay.Split(',');
NoWorkDayNum = - WorkDayNums.Count(); //该员工所在部门的一周非工作天数
#endregion
}
}
else
{
continue;
}
}
}
else
{
continue;
}
}
}
#endregion #region 根据当天时刻修正次数
int Modify = ;
var time = DateTime.Parse(NowDate.ToString("HH:mm:ss"));
var startTime = DateTime.Parse(workStartTime.ToString("HH:mm:ss"));
var endTime = DateTime.Parse(workEndTime.ToString("HH:mm:ss"));
if (time <= startTime) //当前时间在第二天中午之前,为为一天,中午12点后计算结果为2天,则需要对考勤次数进行修正。
{
Modify = ;
}
else if (time >= startTime && time <= DateTime.Parse("12:00:00"))
{
Modify = -;
}
else if (time >= DateTime.Parse("12:00:00") && time < endTime)
{
Modify = ;
}
else if (time >= endTime)
{
Modify = ;
}
#endregion DateTime firstDate = FirstDate;
var applyTime = Employee.EntryDate; //员工入职时间
if (applyTime.HasValue && applyTime >= FirstDate) //如果员工是这个月内刚入职的,取入职时间
{
firstDate = DateTime.Parse(applyTime.Value.ToString("yyyy-MM-dd"));
}
var attendEntities = allAttendEntities.Where(f => f.CreaterId == Employee.Id && (f.CreateDate >= firstDate && f.CreateDate <= NowDate)).OrderBy(f =>f.CreateDate).ToList();
var attendCounts = attendEntities.Count(); //当前月实际打卡的次数 #region //实际打卡的天数
List<string> list = new List<string>();
foreach (var attend in attendEntities)
{
var attendDay = attend.CreateDate.ToLongDateString();
list.Add(attendDay);
}
attendCountDTO.ActualDays = list.Distinct().Count(); //实际打卡的天数
#endregion #region 应打卡的天数
int days = ;
int AllDay = ;
var nowTime = DateTime.Now; if (applyTime != null)
{
attendCountDTO.OutHiredate = applyTime == null ? "" : DateTime.Parse(applyTime.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
attendCountDTO.Hiredate = applyTime;
if (NoWorkDayNum == )
{
AllDay = workDays.GetNoHolidayWorkDay(firstDate,NowDate);
}
else
{
AllDay = workDays.GetDate(firstDate, NowDate, WorkDayNums); //获取到(设置的指定的工作日)所有天数
//AllDay = workDays.GetWorkDay(firstDate, NowDate, NoWorkDayNum); //获取工作天数(已去除设置的非工作日)
} var holidayDays = holidayRepository.GetHolidayByTime(firstDate, nowTime); //当月所有的节假日
if (holidayDays.Count() > )
{
holidayDays.ForEach(f =>
{
TimeSpan ts = f.EndTime - f.BeginTime;
days += ts.Days;
});
}
#region 请假的天数
int offWorkDay = ;
DateTime? validEndTime = null;
var OffWorkEntitys = allOffWorkEntities.Where(f => f.CreaterId == Employee.Id
&& f.StartTime >= firstDate && f.StartTime <= nowTime).ToList();
if (OffWorkEntitys.Count() > )
{
foreach (var item in OffWorkEntitys)
{
if (item.EndTime > nowTime) //如果请假的结束时间大于当前考勤的统计时间,取当前时间,
{
validEndTime = nowTime;
}
else
{
validEndTime = item.EndTime; //如果请假的结束时间小于等于当前考勤的统计时间,取请假的结束时间,
}
TimeSpan? t1 = validEndTime - item.StartTime;
offWorkDay += t1.Value.Days;
}
}
#endregion attendCountDTO.ShouldDays = AllDay - days - offWorkDay; //应打卡的天数(工作日天数-法定节假日天数 - 请假天数)
#endregion
attendCountDTO.AbsenteeismDays = attendCountDTO.ShouldDays - attendCountDTO.ActualDays; //应打天数-实打天数
attendCountDTO.ShouldAttendCounts = (attendCountDTO.ShouldDays * ) - Modify; //应打考勤的次数
attendCountDTO.NoAttendCounts = attendCountDTO.ShouldAttendCounts - attendCounts; //未打卡的次数(应打卡的次数-实际打卡的次数)
} #region 判断迟到还是早退,以及次数
//var entitys = GetResignInfo(Employee.Id); //所有考勤次数
int lateCount = ;
int earlyLeaveCount = ;
int AllCounts = attendEntities.Count();
for (int i = ; i < AllCounts; i++)
{
if (i == && i + == AllCounts) //只打卡了一次 (第一种情况) 只判断是否迟到
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ;
}
if (i == && i + < AllCounts) //打卡多次,这是第一次 (第二种情况)
{
if (attendEntities[i].CreateDate.ToLongDateString() == attendEntities[i + ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ;
}
else if (attendEntities[i].CreateDate.ToLongDateString() != attendEntities[i + ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ;
}
}
if (i > && i + < AllCounts) //打卡多次,既不是第一次,也不是最后一次 (第三种情况)
{
if (attendEntities[i].CreateDate.ToLongDateString() == attendEntities[i - ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours <= workEndTime.TimeOfDay.TotalHours) earlyLeaveCount += ; //打卡了两次,这是下午一次
}
if (attendEntities[i].CreateDate.ToLongDateString() == attendEntities[i + ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours > workStartTime.TimeOfDay.TotalHours) lateCount += ; //打卡了两次,这是上午一次
}
if (attendEntities[i].CreateDate.ToLongDateString() != attendEntities[i - ].CreateDate.ToLongDateString() && attendEntities[i].CreateDate.ToLongDateString() != attendEntities[i + ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ; //只打卡一次,大于上午上班时间,即迟到
}
}
if (i > && i + == AllCounts) //打卡多次,这是是最后一次 (第四种情况)
{
if (attendEntities[i].CreateDate.ToLongDateString() == attendEntities[i - ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours <= workEndTime.TimeOfDay.TotalHours) earlyLeaveCount += ; //打卡了两次,这是下午一次
}
if (attendEntities[i].CreateDate.ToLongDateString() != attendEntities[i - ].CreateDate.ToLongDateString())
{
if (attendEntities[i].CreateDate.TimeOfDay.TotalHours >= workStartTime.TimeOfDay.TotalHours) lateCount += ;
}
}
} attendCountDTO.LateCounts = lateCount;
attendCountDTO.EarlyLeaveCounts = earlyLeaveCount;
attendCountDTO.Id = Employee.Id;
attendCountDTO.Name = Employee.Name;
attendCountDTO.PhoneNumber = Employee.Phone; lists.Add(attendCountDTO);
#endregion
}
}
DateTime? EndTime = null;
if (dto.EndTime.HasValue)
{
EndTime = dto.EndTime.Value.AddDays();
}
var filterEmployees = lists.Where(f => (string.IsNullOrEmpty(dto.DepartmentName) || (!string.IsNullOrEmpty(f.DepartmentName) && f.DepartmentName.Contains(dto.DepartmentName)))
&& (string.IsNullOrEmpty(dto.Position) || f.Position == dto.Position)
&& (!dto.StartTime.HasValue || f.Hiredate >= dto.StartTime)
&& (!EndTime.HasValue || f.Hiredate <= EndTime)).ToList();
var filterEmployee = filterEmployees.OrderBy(f => f.Hiredate).Skip((Page - ) * PageSize).ToList();
var resultEntity = GetResultEntity(filterEmployee);
resultEntity.Count = filterEmployees.Count();
return resultEntity;
} /// <summary>
/// 获取考勤详情
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
public ResultEntity<List<AttendCountDetailDTO>> QueryAttendDetailList(AttendDetailDTO param)
{
var lists = new List<AttendCountDetailDTO>();
AttendEditorRepository attendEditorRepository = new AttendEditorRepository();
AttendancesRepository attendRepositry = new AttendancesRepository();
AttendancesConfig attendConfig = new AttendancesConfig();
var attendEditor = attendEditorRepository.GetAttendancesConfigById(param.DepartmentId); //设置的规定考勤
if (attendEditor == null)
{
attendConfig.StartTime = "09:00:00";
attendConfig.EndTime = "18:00:00";
}
else
{
attendConfig.StartTime = attendEditor.StartTime;
attendConfig.EndTime = attendEditor.EndTime;
} var attends = attendRepositry.GetAttendancesById(param.Id); //实际员工打卡信息
var DetailCount = attends.Count(); //考勤次数
for (int i = ; i < attends.Count(); i++)
{
AttendCountDetailDTO dto = new AttendCountDetailDTO();
dto.AttendDate = attends[i].CreateDate.ToString("yyyy-MM-dd HH:mm:ss");
dto.ActualAttendTime = attends[i].CreateDate.ToLongTimeString().ToString();
if (DetailCount ==) //只打卡了一次
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if (attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
} if (i == && i + < DetailCount) //打卡多次,这是第一次 (第二种情况)
{
if (attends[i].CreateDate.ToLongDateString() == attends[i + ].CreateDate.ToLongDateString())
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if ( attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
} else if (attends[i].CreateDate.ToLongDateString() != attends[i + ].CreateDate.ToLongDateString())
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if ( attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
}
} if (i > && i + < DetailCount) //打卡多次,既不是第一次,也不是最后一次 (第三种情况)
{
if (attends[i].CreateDate.ToLongDateString() == attends[i - ].CreateDate.ToLongDateString()) //打卡了两次,这是下午一次
{
if (attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.EndTime).TimeOfDay.TotalHours)
{
dto.IsRarlyLeave = true;
}
else
{
dto.IsRarlyLeave = false; }
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
}
if (attends[i].CreateDate.ToLongDateString() == attends[i + ].CreateDate.ToLongDateString()) //打卡了两次,这是上午一次
{
if ( attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
}
if (attends[i].CreateDate.ToLongDateString() != attends[i - ].CreateDate.ToLongDateString() && attends[i].CreateDate.ToLongDateString() != attends[i + ].CreateDate.ToLongDateString()) //一天只打卡了一次,
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if (attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true;
}
}
} if (i > && i + == DetailCount) //打卡多次,这是是最后一次 (第四种情况)
{
if (attends[i].CreateDate.ToLongDateString() == attends[i - ].CreateDate.ToLongDateString()) //打卡了两次,这是下午一次
{
if (attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.EndTime).TimeOfDay.TotalHours)
{
dto.IsRarlyLeave = true;
}
else
{
dto.IsRarlyLeave = false; }
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
}
if (attends[i].CreateDate.ToLongDateString() != attends[i - ].CreateDate.ToLongDateString()) //只打卡了一次
{
if (int.Parse(attends[i].CreateDate.ToString("HH")) >= && int.Parse(attends[i].CreateDate.ToString("HH")) <= )
{
dto.AttendType = "上午考勤";
}
else
{
dto.AttendType = "下午考勤";
}
if ( attends[i].CreateDate.TimeOfDay.TotalHours <= DateTime.Parse(attendConfig.StartTime).TimeOfDay.TotalHours)
{
dto.IsLate = false;
}
else
{
dto.IsLate = true; }
}
}
dto.Address = attends[i].Addr;
dto.Picture = attends[i].GPS;
dto.AttendRemark = attends[i].Description;
lists.Add(dto);
}
var resultEntity = GetResultEntity(lists);
resultEntity.Count = lists.Count();
return resultEntity;
}
注意:1、工作日不是周一到周五,而是系统配置,即周一到周日中任意某天都可能是工作日。
2、节假日也是由系统配置。
3、统计的是当月月初到查看的此刻的统计数据,(如果员工是新员工,即入职时间在当月月初之后,已新员工入职时间算起)
4、一天控制写入两次打卡记录,上午一次,下午一次(上午以最早打卡时间为准,下午以最晚打卡时间为准)
5、一天如果只打卡了一次,只判断是否迟到。
6、上下班时间由该员工所在部门的系统配置,配置了就按配置时间,否则按写死的默认值。
计算一个月中工作日天数的代码:(分别是计算传统的周一到周五的工作日,和指定时间的工作日天数(本人项目))
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace HYSMA.AppSrv.AttendManage.AttendCase
{
/// <summary>
/// 取工作日
/// </summary>
public class GetWorkDays
{
/// <summary>
/// 根据时间差,获取工作日天数(除去了周六周日)
/// </summary>
/// <param name="StartTime"></param>
/// <param name="EndTime"></param>
/// <returns></returns>
public int GetWorkDay(DateTime StartTime, DateTime EndTime)
{
DateTime start = StartTime;
DateTime end = EndTime;
TimeSpan span = end - start;
//int totleDay=span.Days;
//DateTime spanNu = DateTime.Now.Subtract(span);
int AllDays = Convert.ToInt32(span.TotalDays) + ;//差距的所有天数
int totleWeek = AllDays / ;//差别多少周
int yuDay = AllDays % ; //除了整个星期的天数
int lastDay = ;
if (yuDay == ) //正好整个周
{
lastDay = AllDays - (totleWeek * );
}
else
{
int weekDay = ;
int endWeekDay = ; //多余的天数有几天是周六或者周日
switch (start.DayOfWeek)
{
case DayOfWeek.Monday:
weekDay = ;
break;
case DayOfWeek.Tuesday:
weekDay = ;
break;
case DayOfWeek.Wednesday:
weekDay = ;
break;
case DayOfWeek.Thursday:
weekDay = ;
break;
case DayOfWeek.Friday:
weekDay = ;
break;
case DayOfWeek.Saturday:
weekDay = ;
break;
case DayOfWeek.Sunday:
weekDay = ;
break;
}
if ((weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ) || (weekDay == && yuDay >= ))
{
endWeekDay = ;
}
if ((weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ) || (weekDay == && yuDay < ))
{
endWeekDay = ;
}
lastDay = AllDays - (totleWeek * ) - endWeekDay;
}
return lastDay;
} /// <summary>
/// 获取工作日天数(无节假日)
/// </summary>
/// <param name="StartTime"></param>
/// <param name="EndTime"></param>
/// <returns></returns>
public int GetNoHolidayWorkDay(DateTime StartTime, DateTime EndTime)
{
TimeSpan t = EndTime - StartTime;
var tatalDay = Convert.ToInt32(t.TotalDays); return tatalDay;
} /// <summary>
/// 获取一个时间段中(周一有几天,周二有几天,周三有几天。。。。到周日)(从而获取工作日天数)
/// </summary>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <param name="workDay">从数据库中取得的设置的工作日时间(如:周一,周三,周五,周日)</param>
/// <returns></returns>
public int GetDate(DateTime startDate, DateTime endDate ,string[] workDay) //这里的workDay数组是我从数据库中取得的字符串(原始格式类似:"周一,周三,周六..."),通过split分割而成的。以便进行操作
{
int mondayCount = , tuesdayCount = , wednesdayCount = , thursdayCount = , fridayCount = , satursdayCount = , sundayCount = ;//每个星期日(星期一,星期二...)的总天数 int LastDay = ;
DateTime startDT = startDate; //开始时间
DateTime endDT = endDate; //结束时间
TimeSpan dt = endDT - startDT;
int dayCount = Convert.ToInt32(dt.TotalDays); //总天数 (后一个日期在中午12点之前,这天不算,超过12点,加上这一天)
for (int i = ; i < dayCount; i++)
{
switch (startDT.AddDays(i).DayOfWeek)
{
case DayOfWeek.Monday:
mondayCount += ;
break;
case DayOfWeek.Tuesday:
tuesdayCount += ;
break;
case DayOfWeek.Wednesday:
wednesdayCount += ;
break;
case DayOfWeek.Thursday:
thursdayCount += ;
break;
case DayOfWeek.Friday:
fridayCount += ;
break;
case DayOfWeek.Saturday:
satursdayCount += ;
break;
case DayOfWeek.Sunday:
sundayCount += ;
break;
}
} foreach (var item in workDay)
{
switch (item)
{
case "周一":
LastDay += mondayCount;
break;
case "周二":
LastDay += tuesdayCount;
break;
case "周三":
LastDay += wednesdayCount;
break;
case "周四":
LastDay += thursdayCount;
break;
case "周五":
LastDay += fridayCount;
break;
case "周六":
LastDay += satursdayCount;
break;
case "周日":
LastDay += sundayCount;
break;
}
}
//int lastDays = mondayCount + tuesdayCount + wednesdayCount + thursdayCount + fridayCount + satursdayCount + sundayCount;
return LastDay;
}
}
}
c#考勤统计的更多相关文章
- 考勤输入导入OA平台与考勤统计报表导出功能源代码
注:以某某公司为例,每日签到时间为8点整 每日签退时间为17点30分 规则:公司签到签退时间在OA平台中可以视实际情况调整,当天有请假并通过工作流审批通过为有效,当天因公外出并通过工作流审批通过为 ...
- 一个关于考勤统计的sql研究
在这里,我们要做一个简单的员工考勤记录查询系统的后台数据库.业务需求如下所示: 1.统计每天来的最早.来的最晚.走的最早.走得最晚的人的姓名 1.1 统计每天来得最早的人 ...
- .Net语言 APP开发平台——Smobiler学习日志:SmoOne新增考勤功能
大家好!SmoOne这次新增了考勤功能,大家打开SmoOne应用便可体验,无需重新下载更新.如果没有下载SmoOne客户端,可以在apps.smobiler.com进行下载安装. 另外,SmoOne开 ...
- WinForm调用钉钉获取考勤结果
关注点: 1.钉钉AccessToken的获取和防止过期 2.使用TPL并行编程调用钉钉接口 需求详解 公司前台有个大屏,领导想显示全部员工的考勤结果统计情况和车间的实时监控视频,还有车间的看板.简单 ...
- 基于JSP的学生考勤管理系统(MySQL版)
介绍:基于JSP的学生考勤管理系统(MySQL版)1.包含源程序,数据库脚本.代码和数据库脚本都有详细注释.2.课题设计仅供参考学习使用,可以在此基础上进行扩展完善.开发环境:Eclipse ,MyS ...
- poi导出word、excel
在实际的项目开发中,经常会有一些涉及到导入导出的文档的功能.apache开源项目之一poi对此有很好的支持,对之前的使用做一些简要的总结. 1,导入jar 为了保证对格式的兼容性,在项目的pom.xm ...
- 基于spring4.0配置分布式ehcache,以及相关使用
说明:本文是基于RMI手动同步的方式,使用程序动态注入配置缓存,抛弃传统的ehcache.xml配置方式 1,注入cacheManager管理所有缓存,添加各个缓存名及相关参数配置: 思路大致是: 在 ...
- OA系统如何使用考勤机数据
通达OA系统使用考勤机数据目前有两种方法可以实现:一种是通过进行二次开发,将通达OA系统与考勤机结合起来使用:另一种是通过将考勤机的数据导出再导入OA系统中.进行二次开发的话,需要和定制开发工程师联系 ...
- 团队作业8——第二次项目冲刺(Beta阶段)Day1--5.18
1.展开站立式会议: 会议内容:①团队里的新成员做简单的自我介绍. ②讨论每天的任务分配问题. ③提出一个严格要求:博客一定要及时发布,并及时提交作业,遇到困难可以提出来一起解决. ④就现阶段的项目进 ...
随机推荐
- mac mysql5.5升级5.7记录
先删除当前的mysql文件 打开终端窗口 使用mysqldump备份你的数据库将文本文件! 停止数据库服务器 sudo rm /usr/local/mysql sudo rm -rf /usr/loc ...
- JAVA与DOM解析器基础 学习笔记
要求 必备知识 JAVA基础知识.XML基础知识. 开发环境 MyEclipse10 资料下载 源码下载 文件对象模型(Document Object Model,简称DOM),是W3C组织推荐的 ...
- curl常用命令【转】
原文地址: http://www.thegeekstuff.com/2012/04/curl-examples/ 下载单个文件,默认将输出打印到标准输出中(STDOUT)中 curl http://w ...
- Docker: vmware企业级docker镜像私服--Harbor的搭建
1.下载harbor,地址https://github.com/vmware/harbor2.进入harbor-master/Deploy目录,修改harbor.cfg文件,主要修改以下信息 ...
- [Golang] GOROOT、GOPATH和Project目录说明
go env环境查看 用go env 可查看当前go环境变量. $ go env GOARCH="amd64" GOBIN="" GOEXE="&qu ...
- Python web 框架之 Django 基础搭建服务
1. 需要安装 Python 和 Django 环境,Python 环境的安装我就不在多说了 2. 安装框架 Django Django 安装,推荐先装个 pip吧,easyinstall也可以,然后 ...
- 第3章:Hadoop分布式文件系统(2)
数据流 读取文件数据的剖析 为了知道客户端与HDFS,NameNode,DataNode交互过程中数据的流向,请看图3-2,这张图显示了读取文件过程中主要的事件顺序. 客户端通过调用FileSyste ...
- javascript 易错点、难点笔记
本文主要记录在学习过程中遇到的JavaScript难点或者容易疏忽的细节,也方便自己日后翻阅学习. 1.arr.length === + arr.length arr.length === + arr ...
- MVC应用程序的jQuery代码重构
先看看这篇<在jQuery定义自己函数>http://www.cnblogs.com/insus/p/3415444.html 程序越看越是有重构的地方. 先看1部分,由于在#16代码有宣 ...
- 手机调试 --- 通过chrome测试手机网站
移动端有时候我们要调试手机网站. Chrome怎么调试手机页面呢? 毕竟有时候手机支持的JS度跟PC不一样.最开始就遇见了.手机端浏览器不支持执行string.includes. PC端支持该函数, ...