Ver Fonte

调整 invlist 过滤和排序逻辑

注释掉了原有的 invlist 过滤条件,该条件是基于产品时间和当前时间的小时差值以及当前小时在特定范围内进行过滤。
修改了 invlist 的排序逻辑,原先是先按 Depth 排序再按 ProductTime.Day 降序排序,现在改为先按 Depth 排序再按 ProductTime.Day 降序排序。
注释掉了按小时判断是否扭转的条件,并恢复了按 ProductTime 小于 startTime 的条件进行流转的逻辑。
林豪 左 há 8 meses atrás
pai
commit
312b171065
1 ficheiros alterados com 4 adições e 4 exclusões
  1. 4 4
      wms.service/Service/SXService.cs

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

@@ -844,7 +844,7 @@ namespace wms.service.Service
                 int endhour = int.Parse(TorschkDate.Default3);
 
                 //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);
+                //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 });
@@ -853,7 +853,7 @@ namespace wms.service.Service
                     return res;
                 }
                 var startTime = DateTime.Now.Date.AddDays(-1).AddMilliseconds(-1);
-                invlist = invlist.Where(x => x.ProductTime < startTime).ToList().OrderBy(p => p.Depth).OrderByDescending(p => p.ProductTime.Day);
+                invlist = invlist.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))
@@ -936,8 +936,8 @@ namespace wms.service.Service
                     var time1 = item.HoldTime + decimal.Parse(TorschkDate.SContent); //时效上限
                     var time2 = item.HoldTime - decimal.Parse(TorschkDate.Default1); //时效下限
                                                                                      //|| (decimal.Parse((DateTime.Now - item.ProductTime).TotalHours.ToString("f2")) > 72 && decimal.Parse((DateTime.Now - item.ProductTime).TotalHours.ToString("f2")) > item.HoldTime)
-                    if (decimal.Parse((DateTime.Now - item.ProductTime).TotalHours.ToString("f2")) >= time2) //按小时判断是否扭转的方式应客户要求停用-2024-12-24
-                                                                                                             //if (item.ProductTime <= startTime) //时间在此范围即可流转,例:3号标记的检测盘(00:00到23:59之间),5号全部出库进行检测(7点开始出
+                                                                                     //if (decimal.Parse((DateTime.Now - item.ProductTime).TotalHours.ToString("f2")) >= time2) //按小时判断是否扭转的方式应客户要求停用-2024-12-24
+                    if (item.ProductTime <= startTime) //时间在此范围即可流转,例:3号标记的检测盘(00:00到23:59之间),5号全部出库进行检测(7点开始出
                     {
                         var inv = _billInvnowrepository.GetSingle(p =>
                             p.ContGrpBarCode == item.ContGrpBarCode &&