12345678910111213141516171819202122232425262728293031323334 |
- package routers
- import (
- // "github.com/robfig/cron"
- "time"
- "github.com/robfig/cron/v3"
- "kpt.xdmy/apiserver/service"
- "kpt.xdmy/pkg/log"
- )
- func SapJobInit(s *service.Service) {
- svc = s
- c := cron.New()
- // 02:00
- if _, e := c.AddFunc("00 00 02 * * *", jobMaterial); e != nil {
- log.Error("jobMaterial", e)
- }
- if _, e := c.AddFunc("00 00 02 * * *", jobTransfer); e != nil {
- log.Error("transfer", e)
- }
- c.Start()
- }
- func jobMaterial() {
- t := time.Now()
- var code string
- svc.SapMaterial(t, code)
- }
- func jobTransfer() {
-
- }
|