| | |
| | | } |
| | | } |
| | | |
| | | func ProgressCacheGet(deviceID string, channel int32) (*model.ProductionProgress, bool) { |
| | | if v, ok := defaultCacheStore.Get(fmt.Sprintf(CurrentProgressCacheKey, deviceID, channel)); ok { |
| | | return v.(*model.ProductionProgress), ok |
| | | } |
| | | return nil, false |
| | | } |
| | | |
| | | func ProgressCacheSet(deviceID string, channel int32, value *model.ProductionProgress) { |
| | | defaultCacheStore.Add(fmt.Sprintf(CurrentProgressCacheKey, deviceID, channel), value) |
| | | } |
| | | |
| | | func ProgressCacheUnset(deviceID string, channel int32) { |
| | | defaultCacheStore.Remove(fmt.Sprintf(CurrentProgressCacheKey, deviceID, channel)) |
| | | } |
| | |
| | | return err |
| | | } |
| | | |
| | | err = NewProgressService().UpdateProgressByProceduresId(procedure.ID, int64(params.ReportAmount)) |
| | | err = NewProgressService().UpdateProgressByProceduresId(procedure.ID, params.ReportAmount) |
| | | |
| | | return nil |
| | | } |