This commit is contained in:
jiangyong 2025-03-11 00:49:14 +08:00
parent ce00a2bc89
commit 61345b4bdf
3 changed files with 7 additions and 6 deletions

1
go.mod
View File

@ -28,6 +28,7 @@ require (
require ( require (
github.com/ArtisanCloud/PowerLibs/v3 v3.2.3 // indirect github.com/ArtisanCloud/PowerLibs/v3 v3.2.3 // indirect
github.com/ArtisanCloud/PowerSocialite/v3 v3.0.7 // indirect github.com/ArtisanCloud/PowerSocialite/v3 v3.0.7 // indirect
github.com/Knetic/govaluate v3.0.0+incompatible // indirect
github.com/bytedance/sonic v1.11.6 // indirect github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect

View File

@ -16,6 +16,9 @@ import (
type Staff struct { type Staff struct {
} }
func NewStaff() *Staff {
return &Staff{}
}
func (s *Staff) MontorWorkAge(corpId int64) { func (s *Staff) MontorWorkAge(corpId int64) {
staffs, err := dao.NewStaffUserDao().Query(corpId, model.StaffUserStatusOnline) staffs, err := dao.NewStaffUserDao().Query(corpId, model.StaffUserStatusOnline)
if err != nil { if err != nil {

View File

@ -57,9 +57,8 @@ func InitCorp1002(cron *gocron.Scheduler) {
func InitCorp1000(cron *gocron.Scheduler) { func InitCorp1000(cron *gocron.Scheduler) {
corpId := int64(1000) corpId := int64(1000)
staff := new(Staff)
cron.Every(1).Day().At("09:00").Do(func() { cron.Every(1).Day().At("09:00").Do(func() {
go staff.MontorWorkAge(corpId) go NewStaff().MontorWorkAge(corpId)
}) })
//同步每日考勤数据 //同步每日考勤数据
@ -87,14 +86,12 @@ func InitCorp1000(cron *gocron.Scheduler) {
// 1号计算工资信息 // 1号计算工资信息
cron.Every(1).Month(1, 2, 3, 4, 5, 6, 7, 8, 9).At("06:00").Do(func() { cron.Every(1).Month(1, 2, 3, 4, 5, 6, 7, 8, 9).At("06:00").Do(func() {
go staff.SyncStaffSalary(corpId, "") go NewStaff().SyncStaffSalary(corpId, "")
//go staff.SyncStaffSalary(1002, "")
}) })
//10号晚上8点发送工资单 //10号晚上8点发送工资单
cron.Every(1).Month(10).At("20:00").Do(func() { cron.Every(1).Month(10).At("20:00").Do(func() {
go staff.SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601")) go NewStaff().SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
//go staff.SendStaffSalaryBill(1002, time.Now().AddDate(0, -1, 0).Format("200601"))
}) })
} }