盘料盒散料盒入库 更新交易记录
入库单据异常处理
This commit is contained in:
1 parent
caab84071c
commit
40a6810713
3 files changed
+37
-29
No files matched your search
@@ -137,13 +137,14 @@ namespace HHWMS.Web.Controllers
|
||||
return JsonMore(null, 500, $"尺寸{item.Key}的盘料盒无法满足入库需求,剩余数量{num}");
|
||||
|
||||
}*/
|
||||
var receiptHeaderList = _unitWork.Find<ReceiptHeader>(x =>
|
||||
data.Select(x => x.ReceiptCode).ToList().Contains(x.Code))
|
||||
.Include(x => x.ReceiptDetails).ToList();
|
||||
|
||||
using (var tran = Wtm.DC.Database.BeginTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
var receiptHeaderList = _unitWork.Find<ReceiptHeader>(x =>
|
||||
data.Select(x => x.ReceiptCode).ToList().Contains(x.Code))
|
||||
.Include(x => x.ReceiptDetails).ToList();
|
||||
// 查找明细,修改对应状态,并且 绑定物料周转箱
|
||||
foreach (Binding item in data)
|
||||
{
|
||||
@@ -157,6 +158,7 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
receipt.CompletedQty = receipt.Qty;
|
||||
receipt.Status = ReceiptStatusEnum.收完;
|
||||
_unitWork.Update(receipt);
|
||||
if (!header.ReceiptDetails.Any(x => x.Status < ReceiptStatusEnum.收完))
|
||||
{
|
||||
header.FirstStatus = ReceiptStatusEnum.收完;
|
||||
@@ -168,7 +170,6 @@ namespace HHWMS.Web.Controllers
|
||||
throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的明细!");
|
||||
}
|
||||
|
||||
_unitWork.Update(receipt);
|
||||
// 新建库存
|
||||
var inventory = new Inventory
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user