去重
This commit is contained in:
@@ -707,8 +707,16 @@ namespace WMS.Web.Domain.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
string hadsavel = "";
|
||||
foreach (var s in d.SerialNumberList)
|
||||
{
|
||||
//先跟据条码查询对应的
|
||||
List<string> l= new List<string>();
|
||||
l.Add(s.ToString());
|
||||
|
||||
var serialNumbers = await _outStockTaskRepositories.GetEntityList(l);
|
||||
// hadsavel = hadsavel + serialNumbers[0].TwoSerialNumber;
|
||||
list.Add(new ExportInfoResponse()
|
||||
{
|
||||
SourceBillNo = response.SourceBillNo,
|
||||
@@ -727,15 +735,26 @@ namespace WMS.Web.Domain.Services
|
||||
BoxWeight = d.BoxWeight,
|
||||
Qty = d.Qty,
|
||||
AccruedQty = d.AccruedQty,
|
||||
SerialNumbers = s
|
||||
SerialNumbers = serialNumbers[0].TwoSerialNumber
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var list2 = list.GroupBy(p => new { p.SourceBillNo, p.SaleBillNo,p.ReceiptCustomer, p.CreateTime, p.BoxBillNo, p.Specifications, p.MaterialName, p.MaterialNumber, p.BarCode, p.IndexNumber, p.BoxLength, p.BoxWide, p.BoxHigh, p.BoxWeight, p.Qty, p.AccruedQty, p.SerialNumbers }) // Group by Name and Age properties
|
||||
.Select(g => g.First()) // Select the first item of each group (arbitrary choice)
|
||||
.ToList(); // Convert back to list if needed. If you only need the distinct items, you can skip this step.
|
||||
|
||||
// list.Distinct().ToList();
|
||||
|
||||
var _exportExcelService = scope.ServiceProvider.GetRequiredService<IExportExcelService>();
|
||||
await _exportExcelService.Export(list, fileName, loginInfo.UserInfo.StaffId, loginInfo.UserInfo.CompanyId, FileDownLoadOrderType.OutStockTaskInfo);
|
||||
await _exportExcelService.Export(list2, fileName, loginInfo.UserInfo.StaffId, loginInfo.UserInfo.CompanyId, FileDownLoadOrderType.OutStockTaskInfo);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user