| | |
| | | |
| | | func InitTask() error { |
| | | s := gocron.NewScheduler(time.UTC) |
| | | _, err := s.Every(2).Seconds().StartImmediately().Do(func() { |
| | | _, err := s.Every(10).Seconds().StartImmediately().Do(func() { |
| | | plcConfig, code := service.NewDevicePlcService().GetDevicePlc() |
| | | if code != ecode.OK { |
| | | return |
| | |
| | | StartTime int64 `gorm:"comment:计划开始时间" json:"startTime"` |
| | | EndTime int64 `gorm:"comment:计划结束时间" json:"endTime"` |
| | | Status OrderStatus |
| | | StatusList []OrderStatus |
| | | } |
| | | |
| | | OrderSearch struct { |
| | |
| | | Preload bool |
| | | StartTimeMax int64 |
| | | StartTimeMin int64 |
| | | StatusList []OrderStatus |
| | | } |
| | | ) |
| | | |
| | |
| | | } |
| | | |
| | | if len(slf.StatusList) != 0 { |
| | | db = db.Where("status != ?", slf.StatusList) |
| | | db = db.Where("status in ?", slf.StatusList) |
| | | } |
| | | |
| | | if slf.StartTimeMax != 0 { |