| | |
| | | |
| | | return new PageGridData<StockInfoDetailWithPalletDto> { Rows = dtoList, Total = lists.Total, Summary = lists.Summary }; |
| | | } |
| | | |
| | | public PageGridData<StockDetailDtO> GetPageDataByMateriel(PageDataOptions options) |
| | | { |
| | | PageGridData<Dt_StockInfoDetail> lists = base.GetPageData(options); |
| | | |
| | | List<StockDetailDtO> dtoList = lists.Rows.GroupBy(detail => new { detail.MaterielCode, detail.BatchNo, detail.SupplyCode }).Select(group => |
| | | { |
| | | var firstItem = group.First(); |
| | | return new StockDetailDtO |
| | | { |
| | | Id = firstItem.Id, |
| | | StockId = firstItem.StockId, |
| | | MaterielCode = group.Key.MaterielCode, |
| | | MaterielName = firstItem.MaterielName, |
| | | OrderNo = firstItem.OrderNo, |
| | | BatchNo = group.Key.BatchNo, |
| | | ProductionDate = firstItem.ProductionDate, |
| | | EffectiveDate = firstItem.EffectiveDate, |
| | | SerialNumber = firstItem.SerialNumber, |
| | | // 鏍稿績锛氬褰撳墠鍒嗙粍鐨凷tockQuantity姹傚拰 |
| | | StockQuantity = group.Sum(item => item.StockQuantity), |
| | | OutboundQuantity = firstItem.OutboundQuantity, |
| | | Status = firstItem.Status, |
| | | Unit = firstItem.Unit, |
| | | InboundOrderRowNo = firstItem.InboundOrderRowNo, |
| | | SupplyCode = group.Key.SupplyCode, |
| | | WarehouseCode = firstItem.WarehouseCode, |
| | | Barcode = firstItem.Barcode, |
| | | BusinessType = firstItem.BusinessType, |
| | | Remark = firstItem.Remark |
| | | }; |
| | | }).ToList(); |
| | | |
| | | |
| | | return new PageGridData<StockDetailDtO> { Rows = dtoList, Total = lists.Total, Summary = lists.Summary }; |
| | | } |
| | | } |
| | | } |
| | | |