1

作为我正在研究的项目的一部分,我需要一些建议。

问题:我收到一份包含员工时钟记录的报告。我需要根据班次设置确定当天的第一个时钟输入。例如,班次 A 从上午 8:00 开始,到下午 17:00 结束。这很困难,但是如果这个人加班到第二天早上 1:00,然后在 7:30 再次打卡,7:45 打卡,7:48 打卡,会发生什么。如何确定当天的第一个打卡时间?

如果这个人正常工作,我可以计算得很好,但是如果加班到第二天会发生什么?

4

1 回答 1

0

通常,考勤是通过特定员工的时间 IN 加上他在工作上花费的时间,然后是时间 OUT 来衡量的。像这样的东西(只是一个伪代码)

employee_checks_in_event = in_time (a timer is started at this point)
fixed_out_time = expected_out_time (this is the normal out time of employee)
if employee_checks_in_again:
    in_time = new_in_time # here the employee may have overlapped next shift IN time due to overtime
employee_checks_out_event = out_time - in_time (lets call it time_spent)
if time_spent < fixed_out_time:
    employee_left_early
else:
    we know employee completed his time and maybe he over-timed as well.
    time_spent = over_time

现在您有了员工的 time_spent,您可以跟踪第二天的签到时间并确保它们不重叠。请记住,您将不得不以某种方式区分 IN 和 OUT 时间。

另一种方法是将签到和签出放在一个完全独立的时钟中,这样可以很容易地确定进出时间,并且维护加班会容易得多。

于 2014-11-26T18:28:02.307 回答