增加PC载具物料绑定记录表(载具绑定)、erp调拨订单、报表bug
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Tnb.WarehouseMgr
|
||||
material_specification = JObject.Parse(input.queryJson).Value<string>(nameof(WmsCarryCode.material_specification));
|
||||
}
|
||||
|
||||
IEnumerable<WmsStockReportH?> result;
|
||||
List<WmsStockReportH?> result = new List<WmsStockReportH?>();
|
||||
if (string.IsNullOrEmpty(supplier_code))
|
||||
{
|
||||
List<WmsStockReportH> items = await _db.Queryable<WmsCarryCode>().InnerJoin<WmsCarryH>((a, b) => a.carry_id == b.id)
|
||||
@@ -76,12 +76,14 @@ namespace Tnb.WarehouseMgr
|
||||
List<WmsCarryCode> carryCodes = await _db.Queryable<WmsCarryCode>().ToListAsync();
|
||||
var storeMap = items.DistinctBy(x => new { x.warehouse_id, x.material_id, x.code_batch }).ToDictionary(x => new { x.warehouse_id, x.material_id, x.code_batch }, x => x);
|
||||
|
||||
result = items.GroupBy(g => new { g.warehouse_id, g.material_id, g.code_batch }).Select(itGroup =>
|
||||
var group = items.GroupBy(g => new { g.warehouse_id, g.material_id, g.code_batch });
|
||||
foreach (var itGroup in group)
|
||||
{
|
||||
_ = storeMap.TryGetValue(itGroup.Key, out WmsStockReportH? stockReport);
|
||||
|
||||
List<WmsCarryCode> curCarryCodes = carryCodes.FindAll(x => x.warehouse_id == itGroup.Key.warehouse_id && x.material_id == itGroup.Key.material_id
|
||||
&& x.code_batch == itGroup.Key.code_batch);
|
||||
stockReport.codeqty = 0;
|
||||
curCarryCodes.ForEach(x =>
|
||||
{
|
||||
stockReport.codeqty += x.codeqty;
|
||||
@@ -102,8 +104,9 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
// stockReport.codeqty += x.codeqty;
|
||||
//});
|
||||
return stockReport;
|
||||
});
|
||||
//return stockReport;
|
||||
result.Add(stockReport);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -134,19 +137,21 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
List<WmsCarryCode> carryCodes = await _db.Queryable<WmsCarryCode>().ToListAsync();
|
||||
var storeMap = items.DistinctBy(x => new { x.warehouse_id, x.material_id, x.code_batch, x.supplier_code }).ToDictionary(x => new { x.warehouse_id, x.material_id, x.code_batch, x.supplier_code }, x => x);
|
||||
|
||||
result = items.GroupBy(g => new { g.warehouse_id, g.material_id, g.code_batch, g.supplier_code }).Select(itGroup =>
|
||||
|
||||
var group = items.GroupBy(g => new { g.warehouse_id, g.material_id, g.code_batch, g.supplier_code });
|
||||
foreach (var itGroup in group)
|
||||
{
|
||||
_ = storeMap.TryGetValue(itGroup.Key, out WmsStockReportH? stockReport);
|
||||
|
||||
List<WmsStockReportCode> curCarryCodes = carryCodes.Adapt<List<WmsStockReportCode>>().FindAll(x => x.warehouse_id == itGroup.Key.warehouse_id && x.material_id == itGroup.Key.material_id
|
||||
&& x.code_batch == itGroup.Key.code_batch && x.supplier_code == itGroup.Key.supplier_code);
|
||||
stockReport.codeqty = 0;
|
||||
curCarryCodes.ForEach(x =>
|
||||
{
|
||||
stockReport.codeqty += x.codeqty;
|
||||
});
|
||||
return stockReport;
|
||||
});
|
||||
result.Add(stockReport);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user