zhangqian
2023-12-01 02f1a1173684cce572f5488edb4c928c5b1c386e
重构生产进度存储和同步
2个文件已修改
13 ■■■■■ 已修改文件
service/cache_store.go 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/report_work.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/cache_store.go
@@ -145,17 +145,6 @@
    }
}
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))
}
service/report_work.go
@@ -92,7 +92,7 @@
        return err
    }
    err = NewProgressService().UpdateProgressByProceduresId(procedure.ID, int64(params.ReportAmount))
    err = NewProgressService().UpdateProgressByProceduresId(procedure.ID, params.ReportAmount)
    return nil
}