作者 yangfu

fix: 打卡工时修改

@@ -182,9 +182,13 @@ func (productAttendanceRecord *ProductAttendanceRecord) AttendanceBreakTime(prod @@ -182,9 +182,13 @@ func (productAttendanceRecord *ProductAttendanceRecord) AttendanceBreakTime(prod
182 checkSignIn, checkSignOut time.Time 182 checkSignIn, checkSignOut time.Time
183 ) 183 )
184 checkSignIn = v.GetCheckBeginTime(signIn.Local()) 184 checkSignIn = v.GetCheckBeginTime(signIn.Local())
185 - checkSignOut = checkSignIn //v.GetCheckEndTime(signIn.Local())  
186 - if xtime.BeforeEqual(signIn.Local(), checkSignIn) && xtime.AfterEqual(signOut.Local(), checkSignOut) {  
187 - bt += v.BreakTime 185 + checkSignOut = v.GetCheckEndTime(signIn.Local())
  186 + if xtime.BeforeEqual(signIn.Local(), checkSignIn) && xtime.AfterEqual(signOut.Local(), checkSignIn) {
  187 + if xtime.AfterEqual(signOut.Local(), checkSignOut) {
  188 + bt += v.BreakTime
  189 + } else {
  190 + bt += utils.Round(signOut.Local().Sub(checkSignIn).Hours(), 2)
  191 + }
188 } 192 }
189 log.Logger.Debug(fmt.Sprintf("range(%v,%v) actual(%v,%v) break_time:%v", checkSignIn, checkSignOut, signIn.Local(), signOut.Local(), bt)) 193 log.Logger.Debug(fmt.Sprintf("range(%v,%v) actual(%v,%v) break_time:%v", checkSignIn, checkSignOut, signIn.Local(), signOut.Local(), bt))
190 } 194 }