zhangqian
2023-10-17 f75b6f9ee6b2c542d52b4a11113bd281b421c4c0
service/progress.go
@@ -1,6 +1,7 @@
package service
import (
   "apsClient/conf"
   "apsClient/model"
   "errors"
   "github.com/jinzhu/gorm"
@@ -54,7 +55,7 @@
   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")
      }
@@ -71,3 +72,9 @@
   }
   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
}