1002
This commit is contained in:
parent
ce00a2bc89
commit
65228e00d2
|
@ -4,8 +4,8 @@ address = "0.0.0.0:9283"
|
|||
log_level = 6
|
||||
|
||||
[mysql]
|
||||
host = "192.168.2.50"
|
||||
port = 13308
|
||||
host = "14.22.113.49"
|
||||
port = 9352
|
||||
user = "root"
|
||||
pass = "ZW5aaGVuMIIBIj"
|
||||
db = "enterprise"
|
||||
|
|
3
go.mod
3
go.mod
|
@ -75,6 +75,9 @@ require (
|
|||
github.com/spf13/afero v1.11.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/tidwall/gjson v1.17.1 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.0 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.12 // indirect
|
||||
github.com/wechatpay-apiv3/wechatpay-go v0.2.18 // indirect
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"enterprise/common/registry"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cast"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -30,22 +29,22 @@ func (s *SalaryCalculator1002) Calculate(salary *model.StaffSalary) {
|
|||
return
|
||||
}
|
||||
|
||||
fullAttendSalary := float64(0)
|
||||
|
||||
//特殊情况
|
||||
if salary.Month == "202502" {
|
||||
salary.ShouldDay = 21
|
||||
if salary.Username == "luoyi" {
|
||||
salary.AttendDay = float64(salary.ShouldDay - 5)
|
||||
} else if strings.ToLower(salary.Username) == "wangyan" {
|
||||
salary.AttendDay = float64(salary.ShouldDay) - 5.6
|
||||
} else if strings.ToLower(salary.Username) == "zhouhong" {
|
||||
salary.AttendDay = float64(salary.ShouldDay) - 5.6
|
||||
} else if strings.ToLower(salary.Username) == "chenmin" {
|
||||
salary.AttendDay = 19
|
||||
} else if strings.ToLower(salary.Username) == "xushiyu" {
|
||||
salary.AttendDay = 7
|
||||
}
|
||||
}
|
||||
|
||||
salary.AttendSalary = cast.ToFloat64(userSlary.Base) * (salary.AttendDay / float64(salary.ShouldDay))
|
||||
if salary.AttendDay == float64(salary.ShouldDay) {
|
||||
fullAttendSalary = 500
|
||||
}
|
||||
//特殊情况
|
||||
if salary.Month == "202502" && (salary.Username == "luoyi" || salary.Username == "zhouhong" || salary.Username == "wangyan") {
|
||||
fullAttendSalary = 500
|
||||
}
|
||||
|
||||
salary.AttendSalary = (cast.ToFloat64(userSlary.Base)-500)*(salary.AttendDay/float64(salary.ShouldDay)) + fullAttendSalary
|
||||
salary.TargetSalary = cast.ToFloat64(userSlary.Target)
|
||||
|
||||
// 1.订单
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
"enterprise/common/dao"
|
||||
"enterprise/common/model"
|
||||
"enterprise/common/registry"
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/smbrave/goutil"
|
||||
"github.com/spf13/cast"
|
||||
|
@ -63,7 +64,7 @@ func (s *StaffSalary) CalcSalary(salary *model.StaffSalary, month string) (*mode
|
|||
holiday, surplusHoliday := s.getRealVacationDay(month)
|
||||
realWorkDays := s.getRealWorkDay(month)
|
||||
approvalCheckinDay := s.getApprovalCheckinDay(s.user.CorpId, s.user.Username, month)
|
||||
|
||||
fmt.Println(s.user.Username, realWorkDays, holiday, surplusHoliday)
|
||||
salary.HolidayDay = holiday
|
||||
salary.AttendDay = realWorkDays + surplusHoliday
|
||||
salary.Salary = cast.ToFloat64(userSalary.Base) + cast.ToFloat64(userSalary.Target)
|
||||
|
|
Loading…
Reference in New Issue