现在项目需求,需要从多张表中获取数据,组装到一个实体对象中,并通过计算统计出每个员工的考勤记录。(全凭自己思考做的,不足的地方希望各位大神指正!毕竟自己能力有限,思考不全

考勤统计列表:

明细列表:

如下代码:

  /// <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#考勤统计的更多相关文章

  1. 考勤输入导入OA平台与考勤统计报表导出功能源代码

    注:以某某公司为例,每日签到时间为8点整   每日签退时间为17点30分 规则:公司签到签退时间在OA平台中可以视实际情况调整,当天有请假并通过工作流审批通过为有效,当天因公外出并通过工作流审批通过为 ...

  2. 一个关于考勤统计的sql研究

    在这里,我们要做一个简单的员工考勤记录查询系统的后台数据库.业务需求如下所示:      1.统计每天来的最早.来的最晚.走的最早.走得最晚的人的姓名           1.1 统计每天来得最早的人 ...

  3. .Net语言 APP开发平台——Smobiler学习日志:SmoOne新增考勤功能

    大家好!SmoOne这次新增了考勤功能,大家打开SmoOne应用便可体验,无需重新下载更新.如果没有下载SmoOne客户端,可以在apps.smobiler.com进行下载安装. 另外,SmoOne开 ...

  4. WinForm调用钉钉获取考勤结果

    关注点: 1.钉钉AccessToken的获取和防止过期 2.使用TPL并行编程调用钉钉接口 需求详解 公司前台有个大屏,领导想显示全部员工的考勤结果统计情况和车间的实时监控视频,还有车间的看板.简单 ...

  5. 基于JSP的学生考勤管理系统(MySQL版)

    介绍:基于JSP的学生考勤管理系统(MySQL版)1.包含源程序,数据库脚本.代码和数据库脚本都有详细注释.2.课题设计仅供参考学习使用,可以在此基础上进行扩展完善.开发环境:Eclipse ,MyS ...

  6. poi导出word、excel

    在实际的项目开发中,经常会有一些涉及到导入导出的文档的功能.apache开源项目之一poi对此有很好的支持,对之前的使用做一些简要的总结. 1,导入jar 为了保证对格式的兼容性,在项目的pom.xm ...

  7. 基于spring4.0配置分布式ehcache,以及相关使用

    说明:本文是基于RMI手动同步的方式,使用程序动态注入配置缓存,抛弃传统的ehcache.xml配置方式 1,注入cacheManager管理所有缓存,添加各个缓存名及相关参数配置: 思路大致是: 在 ...

  8. OA系统如何使用考勤机数据

    通达OA系统使用考勤机数据目前有两种方法可以实现:一种是通过进行二次开发,将通达OA系统与考勤机结合起来使用:另一种是通过将考勤机的数据导出再导入OA系统中.进行二次开发的话,需要和定制开发工程师联系 ...

  9. 团队作业8——第二次项目冲刺(Beta阶段)Day1--5.18

    1.展开站立式会议: 会议内容:①团队里的新成员做简单的自我介绍. ②讨论每天的任务分配问题. ③提出一个严格要求:博客一定要及时发布,并及时提交作业,遇到困难可以提出来一起解决. ④就现阶段的项目进 ...

随机推荐

  1. Linux-(lsof,ifconfig,route)

    lsof命令 1.命令格式: lsof [参数][文件] 2.命令功能: lsof(list open files)是一个列出当前系统打开文件的工具.在linux环境下,任何事物都以文件的形式存在,通 ...

  2. JVM几种垃圾回收器介绍

    整理自:http://www.cnblogs.com/lspz/p/6397649.html 一.如何回收? 1.1 垃圾收集算法: (1)标记-清除(Mark-Sweep)算法 这是最基础的算法,就 ...

  3. PTA (Advanced Level) 1008 Elevator

    Elevator The highest building in our city has only one elevator. A request list is made up with Npos ...

  4. Tomcat学习总结(14)—— Tomcat常见面试题

    一.Tomcat的缺省是多少,怎么修改 Tomcat的缺省端口号是8080. 修改Tomcat端口号: 1.找到Tomcat目录下的conf文件夹 2.进入conf文件夹里面找到server.xml文 ...

  5. Log4j和Log4j2的区别

    Log4j是Apache的一个开源项目,我们不去考究它的起源时间,但是据我了解,log4j 1已经不再更新了. 下面我就以列举的方式来浅谈log4j和log4j 2的不同之处. 一.配置文件类型 lo ...

  6. VMware12 克隆虚拟机并且重新分配ip、mac

    记录如何快速拷贝一台虚拟机,并且重新分配IP.mac等方便自己做实验: 环境:VMWare12  .Redhat6.8 Step1.克隆虚拟机 虚拟机处于未打开状态,右击管理—>克隆 弹出克隆界 ...

  7. linux下开启、关闭、重启mysql服务

    linux下开启.关闭.重启mysql服务命令 一. 启动1.使用 service 启动:service mysql start2.使用 mysqld 脚本启动:/etc/inint.d/mysql ...

  8. 统计频率(map映照容器的使用)

    问题描述  AOA非常喜欢阅读莎士比亚的诗,莎士比亚的诗中有种无形的魅力吸引着他!他认为莎士比亚的诗中之所以些的如此传神,应该是他的构词非常好!所以AOA想知道,在莎士比亚的书中,每个单词出现的频率各 ...

  9. [日常] Go语言圣经--接口约定习题2

    练习 7.3: 为在gopl.io/ch4/treesort (§4.4)的*tree类型实现一个String方法去展示tree类型的值序列. package main import( "f ...

  10. Java基础——JSP(一)

    一.JSP的由来 在很多动态网页中,绝大多部分内容是不变的,只有局部内容需要动态产生和改变.例如, 一个新闻的浏览次数,只有这个次数是动态改变的,而Servlet程序返回客户端的代码全是java程序动 ...