新增明细 加判断条件

计数页面修改
散料入新增条件
出库单据接口 修改判断条件
This commit is contained in:
zgf committed 2023-11-24 15:39:45 +08:00
1 parent 4334683c6f
commit 1365920fee
15 files changed
+66 -32

No files matched your search

@@ -24,8 +24,10 @@ namespace HHWMS.Web
try
{
var _unitwork = new UnitWork(Wtm);
List<Inventory> inventories = _unitwork.Find<Inventory>(x => x.Status == "0").ToList();
var Invs = inventories.Take(5).ToList();
List<Inventory> inventories = _unitwork.Find<Inventory>(x => x.Status == "0"
&& x.TaskStatus == InventoryTaskStatus.无任务)
.ToList();
var Invs = inventories.Take(20).ToList();
var bizData = new InStore
{
@@ -28,7 +28,7 @@ namespace HHWMS.Web
var _unitwork = new UnitWork(Wtm);
var PTask = _unitwork.Find<TaskHeader>(x =>x.TaskNo.Contains("PLoop")).Include(x => x.TaskDetails).ToList();
var STask = _unitwork.Find<TaskHeader>(x => x.TaskNo.Contains("SLoop")).Include(x => x.TaskDetails).ToList();
//var STask = _unitwork.Find<TaskHeader>(x => x.TaskNo.Contains("SLoop")).Include(x => x.TaskDetails).ToList();
//没有盘料循环任务
if (PTask.Count() == 0)
{
@@ -100,7 +100,7 @@ namespace HHWMS.Web
if (station != null && count > 0)
{
var container = _unitwork.Find<Location>(x => x.Row == station.Row && x.Type == LocationTypeEnum.盘料库位
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop && x.Height < inventory.Qty)
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop && x.Height < 1)
.OrderBy(x => x.Height).FirstOrDefault();
if (Length == 23 && container == null && station.Row == 3)
{
@@ -108,7 +108,7 @@ namespace HHWMS.Web
&& x.Status != LocationStatus.任务锁 && x.Row == 1).FirstOrDefault();
container = _unitwork.Find<Location>(x => x.Row == station.Row && x.Type == LocationTypeEnum.盘料库位
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop && x.Height < inventory.Qty)
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop && x.Height < 1)
.OrderBy(x => x.Height).FirstOrDefault();
}
if (station != null && container != null)
@@ -195,7 +195,7 @@ namespace HHWMS.Web
var locCon = _unitwork.Find<Location>(x => x.Type == Inventory.ZoneCode
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器)
&& x.Length == Length
&& x.Height < Inventory.Qty).Count();
&& x.Height < 1).Count();
if (locCon == 0)
{
Inventory.Qty += 1;
@@ -269,7 +269,7 @@ namespace HHWMS.Web
}
}
}
if (STask.Count() ==0)
/*if (STask.Count() ==0)
{
Location location = _unitwork.Find<Location>(x => x.Type == LocationTypeEnum.散料库站台 && !string.IsNullOrEmpty(x.ContainerCode)).FirstOrDefault();
//创建入库任务
@@ -327,7 +327,7 @@ namespace HHWMS.Web
_unitwork.Add(task);
}
}
}
}*/
#region 更新时间
var job = _unitwork.FindSingle<SysJob>(x => x.JobName == context.JobDetail.Key.Name);
@@ -41,7 +41,7 @@ namespace HHWMS.Web
}
else if (task.TaskType == TaskTypeEnum.盘料出库)
{
//if(OutGenTask(task, _unitwork))
// OutGenTask(task, _unitwork);
count = task.TaskDetails.Where(x => x.Status <= TaskStatusEnum.待下发).Count();
}
else if (task.TaskType == TaskTypeEnum.散料盒出库)
@@ -109,7 +109,7 @@ namespace HHWMS.Web
}
else
{
task.ErrorMsg += ",任务下发失败,失败原因:";
task.ErrorMsg += $",任务下发失败,失败原因:{res.Msg}";
_unitwork.Update(task);
continue;
}
@@ -117,9 +117,9 @@ namespace HHWMS.Web
}
catch (Exception ex)
{
task.ErrorMsg += ex.Message;
task.ErrorMsg += $"任务下发失败:{ex.Message}";
}
if (task.TaskDetails.Count(x => x.Status == TaskStatusEnum.新建) == 0 && (task.TaskType == TaskTypeEnum.盘料入库 || task.TaskType == TaskTypeEnum.盘料出库))
if (task.TaskDetails.Count(x => x.Status == TaskStatusEnum.待下发) == 0 && (task.TaskType == TaskTypeEnum.盘料入库 || task.TaskType == TaskTypeEnum.盘料出库))
{
task.Status = TaskStatusEnum.已下发;
}