From e1a61b66e1feaea22ac276d4ca082139d928f7ea Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Mon, 7 Apr 2025 14:50:11 +0800 Subject: [PATCH] send --- worker/staff.go | 5 +++-- worker/worker.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/worker/staff.go b/worker/staff.go index 0bdc36e..e32adc3 100644 --- a/worker/staff.go +++ b/worker/staff.go @@ -129,8 +129,9 @@ func (s *Staff) PayStaffSalary(corpId int64, month string) { message = append(message, fmt.Sprintf("【支付宝工资发放】[%s]", staffUser.Realname)) message = append(message, fmt.Sprintf("实发工资:%.2f", staffSalary.GetRealSalary())) message = append(message, fmt.Sprintf(`查看明细`, staffSalary.GetBillUrl())) - - if staffUser.Username == "jiangyong" { + nowDay := time.Now().Day() + isSend := (staffSalary.CorpId == 1000 && nowDay == 10) || (staffSalary.CorpId == 1002 && nowDay == 14) + if isSend || staffUser.Username == "jiangyong" { err = service.NewPay().Pay(corp, staffUser, fmt.Sprintf("[%s]工资", staffSalary.Month), model.StaffSalaryPaymentAlipay, diff --git a/worker/worker.go b/worker/worker.go index a74fe29..0b56dea 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -52,7 +52,7 @@ func InitCorp1002(cron *gocron.Scheduler) { }) //10号晚上8点发送工资单 - cron.Every(1).Month(4).At("09:40").Do(func() { + cron.Every(1).Month(14).At("20:00").Do(func() { go staff.SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601")) go staff.PayStaffSalary(corpId, time.Now().AddDate(0, -1, 0).Format("200601")) }) @@ -93,7 +93,7 @@ func InitCorp1000(cron *gocron.Scheduler) { }) //10号晚上8点发送工资单 - cron.Every(1).Month(4).At("09:40").Do(func() { + cron.Every(1).Month(7).At("20:00").Do(func() { go NewStaff().SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601")) go NewStaff().PayStaffSalary(corpId, time.Now().AddDate(0, -1, 0).Format("200601")) })