Browse Source

调整 invlist 过滤条件和排序方式

注释掉了原有的 invlist 过滤条件,客户要求所有未扭转在库内的工字轮都要扭转。
修改了 invlist 的排序方式,将 ProductTime.Day 的排序从升序改为降序。
林豪 左 9 months ago
parent
commit
adc2ab0aa4
1 changed files with 3 additions and 2 deletions
  1. 3 2
      wms.service/Service/SXService.cs

+ 3 - 2
wms.service/Service/SXService.cs

@@ -836,7 +836,8 @@ namespace wms.service.Service
                 int srarthour = int.Parse(TorschkDate.Default2);
                 int endhour = int.Parse(TorschkDate.Default3);
 
-                invlist = invlist.ToList().Where(p => decimal.Parse((DateTime.Now - p.ProductTime).TotalHours.ToString("f2")) >= (p.HoldTime - decimal.Parse(TorschkDate.Default1)) && DateTime.Now.Hour >= srarthour && DateTime.Now.Hour <= endhour);
+                //2025-01-02 客户要求所有未扭转在库内的工字轮都要扭转
+                //invlist = invlist.ToList().Where(p => decimal.Parse((DateTime.Now - p.ProductTime).TotalHours.ToString("f2")) >= (p.HoldTime - decimal.Parse(TorschkDate.Default1)) && DateTime.Now.Hour >= srarthour && DateTime.Now.Hour <= endhour);
                 if (!invlist.Any())
                 {
                     RedisHelper.Set("Sx:WMSErrorInfo:TorsChkEquip1", new RedisErrorInfo() { Equip = "TorsChkEquip1", Con = ResponseStatusCodeEnum.NotEnoughStock.GetDescription() + "没有需要扭转检测的工字轮", Time = DateTime.Now });
@@ -844,7 +845,7 @@ namespace wms.service.Service
                     res.ResMsg = ResponseStatusCodeEnum.NotEnoughStock.GetDescription() + "没有需要扭转检测的工字轮";
                     return res;
                 }
-                invlist = invlist.OrderBy(p => p.Depth).ThenBy(p => p.ProductTime.Day);
+                invlist = invlist.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))