diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs index d2af958f..6c6b3e9a 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs @@ -1,4 +1,5 @@ -using System; +using Magicodes.ExporterAndImporter.Core; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; @@ -53,10 +54,10 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput [Display(Name = "备注")] public string Remark1 { set; get; } - [Display(Name = "状态")] + [ExporterHeader(DisplayName = "状态",IsIgnore =true)] public int State { set; get; } - [Display(Name = "过账日期")] + [ExporterHeader(DisplayName = "账期",IsIgnore =true)] public DateTime AccountDate { set; get; } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs index cdf3721c..2a055a01 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs @@ -161,30 +161,44 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [UnitOfWork(false)] virtual public async Task OutputAsync(WmsRequestDetailReportDto input) { - //if (!string.IsNullOrEmpty(input.Client)) - //{ - // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Client", Logic = EnumFilterLogic.And, Value = input.Client }); - //} + if (string.IsNullOrEmpty(input.Type)) + { + throw new BusinessException("8989", "出库类型必须填写!"); + return false; + } - //if (!string.IsNullOrEmpty(input.Type)) - //{ - // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Type", Logic = EnumFilterLogic.And, Value = input.Type }); - //} - //if (!string.IsNullOrEmpty(input.MaterialGroup)) - //{ - // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.MaterialGroup }); - //} + if (!string.IsNullOrEmpty(input.Client)) + { + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Client", Logic = EnumFilterLogic.And, Value = input.Client }); + } + if (!string.IsNullOrEmpty(input.Type)) + { + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Type", Logic = EnumFilterLogic.And, Value = input.Type }); + } + if (!string.IsNullOrEmpty(input.MaterialGroup)) + { + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.MaterialGroup }); + } + if (!string.IsNullOrEmpty(input.BillNum)) + { + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); + } + //if (!string.IsNullOrEmpty(input.)) + //{ + // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.BillNum }); + //} input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });//不能跨区间出库 var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, 0, true); - var count = entities.GroupBy(p => new { p.MaterialGroupCode, p.Type, p.ClientCode }).Count(); + entities = entities.Where(p => p.OutputQty != 0).ToList(); + var count = entities.GroupBy(p => new { p.Type, p.ClientCode }).Count(); if (count > 1) { @@ -214,6 +228,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS 0, true); var dtoDetails = ObjectMapper.Map, List>(entities); + + dtoDetails= dtoDetails.OrderBy( p => p.Type ).ThenBy(p=> p.BillNum).ToList(); + IExporter _excel = new ExcelExporter(); byte[] result = null; var _fileName = string.Format("汇总合计报表_{0}.xlsx", Guid.NewGuid().ToString());