增加日志

This commit is contained in:
18942506660
2024-05-07 17:39:38 +08:00
parent 380e7cb15a
commit 557348cf99

View File

@@ -180,7 +180,7 @@ namespace WMS.Web.Repositories
.GroupJoin(_context.InStockTaskDetails, p => p.detail.TaskDetailId, ts => ts.Id, (p, ts) => new { p.detail, p.order, p.box, ts })
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, taskDet) => new { p.detail, p.order, p.box, taskDet })
.GroupJoin(_context.InstockTaskBox, p => p.detail.BoxId, ts => ts.BoxId, (p, ts) => new { p.detail, p.order, p.box,p.taskDet, ts })
.GroupJoin(_context.InstockTaskBox, p => p.detail.BoxId, ts => ts.BoxId, (p, ts) => new { p.detail, p.order, p.box, p.taskDet, ts })
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, taskBox) => new { p.detail, p.order, p.box, p.taskDet, taskBox })
.Where(x => x.detail.TaskId == entity.Id).Select(x => new InStockTaskBoxInfoDto()
{
@@ -197,8 +197,8 @@ namespace WMS.Web.Repositories
ReceiveQty = x.detail.Qty,
ShelfTime = x.order.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
Shelfer = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, x.order.CreatorId),
Receiver = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, x.taskBox.ReceiverId??0),
ReceiveTime =x.taskBox.CreateTime.HasValue? x.taskBox.CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss"):"",
Receiver = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, x.taskBox.ReceiverId ?? 0),
ReceiveTime = x.taskBox.CreateTime.HasValue ? x.taskBox.CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
SerialNumbers = (string.Join(",", x.detail.SerialNumbers).TrimEnd(','))
}).ToListAsync();
@@ -218,7 +218,7 @@ namespace WMS.Web.Repositories
BoxBillNo = x.box.BoxBillNo,
SaleBillNo = x.taskDet.SaleBillNo,
Method = InventoryInOutMethod.Box.GetRemark(),
MethodForInt =(int)InventoryInOutMethod.Box,
MethodForInt = (int)InventoryInOutMethod.Box,
Qty = x.detail.ReceiveQty,
ReceiveQty = x.detail.ReceiveQty,
RealityQty = 0,
@@ -241,7 +241,7 @@ namespace WMS.Web.Repositories
if (current_box != null)
{
var current_boxDet = current_box.Details.Where(d => d.MaterialNumber == x.MaterialNumber).FirstOrDefault();
if (current_boxDet!=null && x.MethodForInt == (int)InventoryInOutMethod.Product && current_boxDet.Qty != 0)
if (current_boxDet != null && x.MethodForInt == (int)InventoryInOutMethod.Product && current_boxDet.Qty != 0)
x.Qty = current_boxDet.Qty;
}
});
@@ -500,8 +500,9 @@ namespace WMS.Web.Repositories
_transaction.Commit();
return true;
}
catch
catch (Exception ex)
{
Console.WriteLine($"入库任务单插入失败:{ex.Message}");
if (_transaction != null)
_transaction.Rollback();
return false;