|
@ -161,30 +161,44 @@ namespace Win.Sfs.SettleAccount.Entities.WMS |
|
|
[UnitOfWork(false)] |
|
|
[UnitOfWork(false)] |
|
|
virtual public async Task<bool> OutputAsync(WmsRequestDetailReportDto input) |
|
|
virtual public async Task<bool> OutputAsync(WmsRequestDetailReportDto input) |
|
|
{ |
|
|
{ |
|
|
//if (!string.IsNullOrEmpty(input.Client))
|
|
|
if (string.IsNullOrEmpty(input.Type)) |
|
|
//{
|
|
|
{ |
|
|
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Client", Logic = EnumFilterLogic.And, Value = input.Client });
|
|
|
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))
|
|
|
if (!string.IsNullOrEmpty(input.Client)) |
|
|
//{
|
|
|
{ |
|
|
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.MaterialGroup });
|
|
|
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 });//不能跨区间出库
|
|
|
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, |
|
|
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, |
|
|
0, true); |
|
|
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) |
|
|
if (count > 1) |
|
|
{ |
|
|
{ |
|
@ -214,6 +228,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS |
|
|
0, true); |
|
|
0, true); |
|
|
|
|
|
|
|
|
var dtoDetails = ObjectMapper.Map<List<WmsDetailReport>, List<WmsDetailReportDto>>(entities); |
|
|
var dtoDetails = ObjectMapper.Map<List<WmsDetailReport>, List<WmsDetailReportDto>>(entities); |
|
|
|
|
|
|
|
|
|
|
|
dtoDetails= dtoDetails.OrderBy( p => p.Type ).ThenBy(p=> p.BillNum).ToList(); |
|
|
|
|
|
|
|
|
IExporter _excel = new ExcelExporter(); |
|
|
IExporter _excel = new ExcelExporter(); |
|
|
byte[] result = null; |
|
|
byte[] result = null; |
|
|
var _fileName = string.Format("汇总合计报表_{0}.xlsx", Guid.NewGuid().ToString()); |
|
|
var _fileName = string.Format("汇总合计报表_{0}.xlsx", Guid.NewGuid().ToString()); |
|
|