Browse Source

优化 invlist 排序逻辑,增加过滤条件

修改了 invlist 的排序逻辑,增加了一个过滤条件。原代码中,invlist 被转换为列表后按 Depth 升序排列,再按 ProductTime.Day 降序排列。修改后的代码在转换为列表之前,先过滤出 ProductTime 小于等于 startTime 的项,然后再按 Depth 升序排列,再按 ProductTime.Day 降序排列。
林豪 左 9 months ago
parent
commit
78cc8fab50
1 changed files with 1 additions and 1 deletions
  1. 1 1
      wms.service/Service/SXService.cs

+ 1 - 1
wms.service/Service/SXService.cs

@@ -853,7 +853,7 @@ namespace wms.service.Service
                     return res;
                 }
                 var startTime = DateTime.Now.Date.AddDays(-1).AddMilliseconds(-1);
-                invlist = invlist.ToList().OrderBy(p => p.Depth).ThenByDescending(p => p.ProductTime.Day);
+                invlist = invlist.Where(x=>x.ProductTime<=startTime).ToList().OrderBy(p => p.Depth).ThenByDescending(p => p.ProductTime.Day);
                 var tasklist = _taskrepository.AsQueryable().With(SqlWith.NoLock).Where(p => p.BusType == SxTaskBusType.TaskBusType_SX_TorCheckStockOut.GetDescription() && p.Type == TaskType.OutDepot).ToList();
                 var torTaskCount = _sysconfigrepository.GetFirst(p => p.Code == "TorTaskCount").SContent;
                 if (tasklist.Any() && tasklist.Count > int.Parse(torTaskCount))