AttendDay

This commit is contained in:
jiangyong 2025-03-05 23:41:21 +08:00
parent 17e2f347cb
commit d3a04a8662
1 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"enterprise/common/registry"
log "github.com/sirupsen/logrus"
"github.com/spf13/cast"
"strings"
"time"
)
@ -29,6 +30,14 @@ func (s *SalaryCalculator1002) Calculate(salary *model.StaffSalary) {
return
}
if salary.UserName == "luoyi" {
salary.AttendDay = float64(salary.ShouldDay - 3)
} else if strings.ToLower(salary.UserName) == "wangyan" {
salary.AttendDay = float64(salary.ShouldDay) - 3.5
} else if strings.ToLower(salary.UserName) == "zhouhong" {
salary.AttendDay = float64(salary.ShouldDay) - 3.5
}
salary.AttendSalary = cast.ToFloat64(userSlary.Base) * (salary.AttendDay / float64(salary.ShouldDay))
salary.TargetSalary = cast.ToFloat64(userSlary.Target)