コード例 #1
0
        private string GetCleanRateByDeviceModel(double?current, Guid deviceModelId)
        {
            if (deviceModelId == Guid.Empty)
            {
                return("无数据");
            }
            var rater = (CleanessRate)PlatformCaches.GetCache($"CleanessRate-{deviceModelId}").CacheItem;

            return(Lampblack.GetCleanessRate(current, rater));
        }
コード例 #2
0
        /// <summary>
        /// 获取清洁度值
        /// </summary>
        /// <param name="current"></param>
        /// <param name="deviceIdentity"></param>
        /// <returns></returns>
        private string GetCleanRate(double?current, long deviceIdentity)
        {
            var model = Repo <RestaurantDeviceRepository>()
                        .GetDeviceIncludesByIdentity(deviceIdentity, new List <string> {
                "LampblackDeviceModel"
            })
                        .LampblackDeviceModel;

            var rater = (CleanessRate)PlatformCaches.GetCache($"CleanessRate-{model.Id}").CacheItem;

            return(Lampblack.GetCleanessRate(current, rater));
        }