shouldday=22

This commit is contained in:
jiangyong 2025-03-23 00:24:36 +08:00
parent a5792bb3b2
commit 30d062ebec
1 changed files with 4 additions and 5 deletions

View File

@ -74,6 +74,10 @@ func (s *StaffSalary) CalcSalary(salary *model.StaffSalary, month string) (*mode
if isEntryMonth || isLeaveMonth {
salary.ShouldDay = int(s.getTotalWorkDayMax(s.user.CorpId, month))
}
//当月的应出勤天数按22天算
if cast.ToInt(month) >= cast.ToInt(time.Now().Format("200601")) {
salary.ShouldDay = 22
}
holiday, surplusHoliday := s.getRealVacationDay(month)
realWorkDays := s.getRealWorkDay(month)
@ -296,11 +300,6 @@ func (s *StaffSalary) getRealWorkDay(month string) float64 {
}
func (s *StaffSalary) getTotalWorkDay(corpId int64, username, month string) int64 {
//当月的应出勤天数按22天算
if cast.ToInt(month) >= cast.ToInt(time.Now().Format("200601")) {
return 22
}
checkins, _ := dao.NewCheckinDao().Query(corpId, username, month, false)
return int64(len(checkins))
}