Merge branch 'master' of git.u8t.cn:jiangyong/enterprise
This commit is contained in:
commit
4fa4327845
1
go.mod
1
go.mod
|
@ -28,6 +28,7 @@ require (
|
|||
require (
|
||||
github.com/ArtisanCloud/PowerLibs/v3 v3.2.3 // 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/loader v0.1.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
|
|
|
@ -16,6 +16,9 @@ import (
|
|||
type Staff struct {
|
||||
}
|
||||
|
||||
func NewStaff() *Staff {
|
||||
return &Staff{}
|
||||
}
|
||||
func (s *Staff) MontorWorkAge(corpId int64) {
|
||||
staffs, err := dao.NewStaffUserDao().Query(corpId, model.StaffUserStatusOnline)
|
||||
if err != nil {
|
||||
|
|
|
@ -57,9 +57,8 @@ func InitCorp1002(cron *gocron.Scheduler) {
|
|||
|
||||
func InitCorp1000(cron *gocron.Scheduler) {
|
||||
corpId := int64(1000)
|
||||
staff := new(Staff)
|
||||
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号计算工资信息
|
||||
cron.Every(1).Month(1, 2, 3, 4, 5, 6, 7, 8, 9).At("06:00").Do(func() {
|
||||
go staff.SyncStaffSalary(corpId, "")
|
||||
//go staff.SyncStaffSalary(1002, "")
|
||||
go NewStaff().SyncStaffSalary(corpId, "")
|
||||
})
|
||||
|
||||
//10号晚上8点发送工资单
|
||||
cron.Every(1).Month(10).At("20:00").Do(func() {
|
||||
go staff.SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
||||
//go staff.SendStaffSalaryBill(1002, time.Now().AddDate(0, -1, 0).Format("200601"))
|
||||
go NewStaff().SendStaffSalaryBill(corpId, time.Now().AddDate(0, -1, 0).Format("200601"))
|
||||
})
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue