예제 #1
0
        private ListViewModel GetAllotListViewModel()
        {
            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.GetWxAllotsAsync(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.FromShelfName,
                    ToShelf      = item.ToShelfName,
                    Quantity     = item.Quantity.ToString("F3"),
                    CreateWorker = item.WorkerName,
                });
                total += item.Quantity;
            }
            vm.TodaySummary = string.Format("今日笔数({0})  调拨总重({1:F3})", items.Count, total);

            return(vm);
        }