销售发货接口、原材料仓优化调整、日志优化

This commit is contained in:
2024-07-29 15:49:52 +08:00
parent 0e09a8187c
commit b1027b6e49
15 changed files with 393 additions and 76 deletions

View File

@@ -59,7 +59,7 @@ namespace Tnb.WarehouseMgr
&& ((!string.IsNullOrEmpty(b.carry_code) && b.carry_status != "0" && b.carry_status != "6") || string.IsNullOrEmpty(b.carry_code)))
.WhereIF(!string.IsNullOrEmpty(warehouse_id), (a, b, c, d) => c.id == warehouse_id)
.WhereIF(!string.IsNullOrEmpty(carry_code), (a, b, c, d) => b.carry_code.Contains(carry_code))
.WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e, f) => f.code.Contains(material_code))
.WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e, f) => e.material_code.Contains(material_code))
.OrderByDescending((a, b, c, d, e, f) => b.carry_code)
.Select((a, b, c, d, e, f) => new WmsCarryStockReport
{
@@ -83,9 +83,9 @@ namespace Tnb.WarehouseMgr
creator = e.create_id,
bind_time = e.create_time != null ? e.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
})
.OrderBy((a) => a.location_code)
.ToListAsync();
// 料架
List<WmsCarryStockReport> items_LJ = await _db.Queryable<BasLocation>()
.LeftJoin<WmsCarryH>((a, b) => b.location_id == a.id)
@@ -123,14 +123,15 @@ namespace Tnb.WarehouseMgr
creator = f.create_id,
bind_time = f.create_time != null ? f.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
})
.OrderBy((a) => a.location_code)
.ToListAsync();
items.AddRange(items_LJ);
// d.carrystd_name != "料架"
var storeMap = items.DistinctBy(x => new { x.carry_id }).ToDictionary(x => new { x.carry_id }, x => x);
var storeMap = items.DistinctBy(x => new { x.carry_id,x.location_code }).ToDictionary(x => new { x.carry_id, x.location_code }, x => x);
IEnumerable<WmsCarryStockReportH> result = items.GroupBy(g => new { g.carry_id }).Select(itGroup =>
IEnumerable<WmsCarryStockReportH> result = items.GroupBy(g => new { g.carry_id, g.location_code }).Select(itGroup =>
{
_ = storeMap.TryGetValue(itGroup.Key, out WmsCarryStockReport? report);
WmsCarryStockReportH stockReport = report.Adapt<WmsCarryStockReportH>();