盘料盒散料盒入库 更新交易记录

入库单据异常处理
This commit is contained in:
zhougf committed 2024-05-10 13:22:31 +08:00
1 parent caab84071c
commit 40a6810713
3 files changed
+37 -29

No files matched your search

+14 -22
View File
@@ -133,15 +133,6 @@ namespace HHWMS.Web
tasktolocatioin.ContainerCode = task.ContainerCode;
_unitwork.Update(tasktolocatioin);
_unitwork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode)
&& string.IsNullOrEmpty(x.SourceCode),
x => new Inventory
{
LocationCode = tasktolocatioin.Code,
TaskStatus = InventoryTaskStatus.无任务,
UpdateTime = DateTime.Now,
UpdateBy = "wcs"
});
break;
case TaskTypeEnum.散料盒出库:
// 更新库位
@@ -194,16 +185,6 @@ namespace HHWMS.Web
}
_unitwork.Update(tasktolocatioin);
_unitwork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode)
&& string.IsNullOrEmpty(x.SourceCode),
x => new Inventory
{
LocationCode = tasktolocatioin.Code,
TaskStatus = InventoryTaskStatus.无任务,
UpdateTime = DateTime.Now,
UpdateBy = "wcs"
});
break;
case TaskTypeEnum.盘料盒出库:
// 更新库位
@@ -375,9 +356,10 @@ namespace HHWMS.Web
if (task.TaskType == TaskTypeEnum.盘料盒入库
|| task.TaskType == TaskTypeEnum.散料盒入库)
{
var invList = _unitwork.Find<Inventory>(x => x.ContainerCode == task.ContainerCode
&& x.TaskStatus == InventoryTaskStatus.任务中
&& string.IsNullOrEmpty(x.SourceCode))
var invList = _unitwork.Find<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode)
&& x.TaskStatus.Equals(InventoryTaskStatus.任务中)
&& string.IsNullOrEmpty(x.SourceCode)
)
.ToList();
var listInvtran = new List<InventoryTransaction>();
foreach (var inv in invList)
@@ -403,6 +385,16 @@ namespace HHWMS.Web
});
}
_unitwork.BatchAdd(listInvtran.ToArray());
_unitwork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode)
&& string.IsNullOrEmpty(x.SourceCode),
x => new Inventory
{
LocationCode = tasktolocatioin.Code,
TaskStatus = InventoryTaskStatus.无任务,
UpdateTime = DateTime.Now,
UpdateBy = "wcs"
});
}
_unitwork.Update(task);
if (task.Status == TaskStatusEnum.完成)