| | |
| | | package service |
| | | |
| | | import ( |
| | | "apsClient/conf" |
| | | "apsClient/model" |
| | | "errors" |
| | | "github.com/jinzhu/gorm" |
| | |
| | | var ok bool |
| | | progressCache, ok = ProgressCacheGet(channel) |
| | | if !ok { |
| | | progressCache, err = model.NewProductionProgressSearch(nil).SetChannel(channel).SetOrder("id desc").First() |
| | | progressCache, err = model.NewProductionProgressSearch(nil).SetDeviceId(conf.Conf.System.DeviceId).SetChannel(channel).SetOrder("id desc").First() |
| | | if err == gorm.ErrRecordNotFound { |
| | | return nil, errors.New("progress not found") |
| | | } |
| | |
| | | } |
| | | return |
| | | } |
| | | |
| | | // GetProgressList 获取待同步进度工序 |
| | | func (slf ProgressService) GetProgressList() (progressList []*model.ProductionProgress, err error) { |
| | | progressList, err = model.NewProductionProgressSearch(nil).SetUnFinished().SetOrder("id desc").SetPage(1, 100).FindNotTotal() |
| | | return |
| | | } |