This commit is contained in:
jiangyong 2025-04-04 09:01:52 +08:00
parent 7443a95a24
commit 68e58ce194
2 changed files with 8 additions and 3 deletions

View File

@ -122,14 +122,16 @@ func (s *Staff) PayStaffSalary(corpId int64, month string) {
log.Errorf("db error :%s", err.Error())
continue
}
if staffUser.GetConfig().PayChannel != model.StaffSalaryPaymentAlipay {
continue
}
message := make([]string, 0)
message = append(message, fmt.Sprintf("【工资发放】[%s]", staffUser.Realname))
message = append(message, fmt.Sprintf("【支付宝工资发放】[%s]", staffUser.Realname))
message = append(message, fmt.Sprintf("实发工资:%.2f", staffSalary.GetRealSalary()))
message = append(message, fmt.Sprintf(`<a href="%s">查看明细</a>`, staffSalary.GetBillUrl()))
if staffUser.Username == "jiangyong" {
err = service.NewPay().Pay(corp, staffUser, model.StaffSalaryPaymentAlipay, "", int64(100*staffSalary.GetRealSalary()))
err = service.NewPay().Pay(corp, staffUser, fmt.Sprintf("[%s]工资", staffSalary.Month), model.StaffSalaryPaymentAlipay, int64(100*staffSalary.GetRealSalary()))
if err == nil {
staffSalary.Status = model.StaffSalaryStatusPayed
message = append(message, "发放成功")

View File

@ -19,6 +19,9 @@ func InitCorp1002(cron *gocron.Scheduler) {
corpId := int64(1002)
staff := new(Staff)
cron.Every(1).Day().At("09:00").Do(func() {
go NewStaff().MontorWorkAge(corpId)
})
//同步每日考勤数据
cron.Every(1).Day().At("05:00").Do(func() {
checkIn := NewCheckin(corpId)