From 68e58ce1948b890b64adc64ce5b963b400269569 Mon Sep 17 00:00:00 2001 From: jiangyong Date: Fri, 4 Apr 2025 09:01:52 +0800 Subject: [PATCH] alipay --- worker/staff.go | 8 +++++--- worker/worker.go | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/worker/staff.go b/worker/staff.go index ef8e8ba..263ac09 100644 --- a/worker/staff.go +++ b/worker/staff.go @@ -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(`查看明细`, 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, "发放成功") diff --git a/worker/worker.go b/worker/worker.go index f77cf00..4547bd3 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -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)