diff --git a/service/staff.go b/service/staff.go index 0933ebf..5bef6ab 100644 --- a/service/staff.go +++ b/service/staff.go @@ -263,6 +263,12 @@ func (s *Staff) getRealWorkDay(entryDate, leaveDate, username, month string) flo continue } + ////有请假申请的不算出勤 + approvalVacation, _ := dao.NewApprovalVacationDao().GetByUsernameDay(username, checkin.Day) + if approvalVacation != nil { + continue + } + //有补卡申请就直接算出勤 approvalCheckin, _ := dao.NewApprovalCheckinDao().GetByUsernameDay(username, checkin.Day) if approvalCheckin != nil { @@ -271,12 +277,6 @@ func (s *Staff) getRealWorkDay(entryDate, leaveDate, username, month string) flo continue } - ////有请假申请的不算出勤 - approvalVacation, _ := dao.NewApprovalVacationDao().GetByUsernameDay(username, checkin.Day) - if approvalVacation != nil { - continue - } - // 迟到的按时间折算 if strings.Contains(checkin.Exception, "上班打卡:时间异常") { stTime := time.Unix(checkin.StartTime, 0)