|
@@ -845,7 +845,8 @@ namespace wms.service.Service
|
|
|
res.ResMsg = ResponseStatusCodeEnum.NotEnoughStock.GetDescription() + "没有需要扭转检测的工字轮";
|
|
|
return res;
|
|
|
}
|
|
|
- invlist = invlist.OrderBy(p => p.Depth).ThenByDescending(p => p.ProductTime.Day);
|
|
|
+ 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);
|
|
|
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))
|
|
@@ -914,6 +915,7 @@ namespace wms.service.Service
|
|
|
//{
|
|
|
int pp = 0;
|
|
|
//invlist = invlist.Where(p => p.Floor == floor);
|
|
|
+
|
|
|
foreach (var item in invlist)
|
|
|
{
|
|
|
if (item.TorsChkValue != null)
|
|
@@ -925,11 +927,10 @@ namespace wms.service.Service
|
|
|
// break;
|
|
|
//}
|
|
|
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
|
|
|
- var startTime = DateTime.Now.Date.AddDays(-1).AddMilliseconds(-1);
|
|
|
- var endTime = startTime.AddDays(+1).AddMilliseconds(-1);
|
|
|
+ //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点开始出
|
|
|
{
|
|
|
var inv = _billInvnowrepository.GetSingle(p =>
|
|
@@ -1462,27 +1463,26 @@ namespace wms.service.Service
|
|
|
.With(SqlWith.NoLock)
|
|
|
.Where(p => p.IsStop == LocationStop.LocationInvoke.GetHashCode() && p.StateNum == LocationState.LocationState_Empty);
|
|
|
|
|
|
+ var cell = new List<BaseWarecell>();
|
|
|
+
|
|
|
// 获取禁用的巷道信息
|
|
|
var disabletunnels = _sysconfigrepository.GetList(p => p.SType == "InStop" && !string.IsNullOrEmpty(p.SContent));
|
|
|
if (disabletunnels != null && disabletunnels.Any())
|
|
|
{
|
|
|
- // 先提取禁用的巷道数据到集合中
|
|
|
- var disableTunnelIds = new HashSet<(int Tunnel, int Floor)>();
|
|
|
+ // 先提取禁用的巷道数据到集合中,item1 为巷道,item2 为楼层
|
|
|
+ var disableTunnels = new List<Tuple<int, int>>();
|
|
|
|
|
|
foreach (var item in disabletunnels)
|
|
|
{
|
|
|
var distun = int.Parse(item.Default1);
|
|
|
var disfloor = int.Parse(item.Default2);
|
|
|
- disableTunnelIds.Add((distun, disfloor));
|
|
|
+ disableTunnels.Add(new Tuple<int, int>(distun, disfloor));
|
|
|
+ cellQuery.Where(x => x.Tunnel != distun && x.Floor != disfloor);
|
|
|
}
|
|
|
-
|
|
|
- // 在数据库查询时进行过滤,避免多次遍历 cell 列表
|
|
|
- cellQuery = cellQuery.Where(p => disableTunnelIds.All(x => x.Tunnel != p.Tunnel && x.Floor != p.Floor));
|
|
|
+ // 执行查询,获取最终的 cell 列表
|
|
|
+ cell = cellQuery.Clone().ToList();
|
|
|
}
|
|
|
-
|
|
|
- // 执行查询,获取最终的 cell 列表
|
|
|
- var cell = cellQuery.ToList();
|
|
|
-
|
|
|
+ else cell = cellQuery.ToList();
|
|
|
time2.Stop();
|
|
|
bool isTobeTors = false;
|
|
|
int tun = 2;
|