entrydate
This commit is contained in:
parent
d8e971ec74
commit
29c02b6064
|
@ -187,7 +187,7 @@ func (s *Staff) SyncStaffSalary(month string) {
|
|||
|
||||
// 打卡正常天数+补卡天数 为正常出勤天数
|
||||
totalDays := s.getTotalWorkDay(staff.Username, month)
|
||||
realWorkDays := s.getRealWorkDay(staff.Username, month)
|
||||
realWorkDays := s.getRealWorkDay(staff.EntryDate, staff.Username, month)
|
||||
approvalCheckinDay := s.getApprovalCheckinDay(staff.Username, month)
|
||||
extra := make(map[string]interface{})
|
||||
salary.BaseSalary = cast.ToFloat64(staff.Salary)
|
||||
|
@ -265,7 +265,7 @@ func (s *Staff) getApprovalCheckinDay(username, month string) int {
|
|||
return approvalDay
|
||||
}
|
||||
|
||||
func (s *Staff) getRealWorkDay(username, month string) float64 {
|
||||
func (s *Staff) getRealWorkDay(entryDate, username, month string) float64 {
|
||||
realWorkdays := float64(0)
|
||||
userCheckins, err := dao.NewCheckinDao().Query(username, month, false)
|
||||
if err != nil {
|
||||
|
@ -285,6 +285,12 @@ func (s *Staff) getRealWorkDay(username, month string) float64 {
|
|||
continue
|
||||
}
|
||||
|
||||
//入职当天考勤异常忽略
|
||||
if checkin.Day == entryDate {
|
||||
realWorkdays += 1
|
||||
continue
|
||||
}
|
||||
|
||||
// 迟到的按时间折算
|
||||
if strings.Contains(checkin.Exception, "上班打卡:时间异常") {
|
||||
stTime := time.Unix(checkin.StartTime, 0)
|
||||
|
|
Loading…
Reference in New Issue