private ListViewModel GetInspectListViewModel() { var obj = GetObject(); if (obj == null) { return(null); } ListViewModel vm = new ListViewModel(); vm.PlaceInfo = TaskManager.GetObjectPlaceInfo(obj.Id); var ret = TaskManager.GetObjectCollateral(obj.Id); vm.Collateral = string.Format("类型:{0} 库存:{1:F3} 黄线:{2}", ret.Item1, ret.Item2, ret.Item3); var items = _taskAppService.GetWxInspectsAsync(obj.Id).Result; vm.Items = new List <ItemInfo>(); double total = 0.0; foreach (var item in items) { vm.Items.Add(new ItemInfo { CreateTime = item.CreateTime.ToString("HH:mm:ss"), Shelf = item.ShelfName, Quantity = item.Purity.ToString("F2"), CreateWorker = item.WorkerName, }); total += item.Purity; } vm.TodaySummary = string.Format("今日笔数({0}) 平均纯度({1:F2})", items.Count, total / items.Count); return(vm); }