修复bug

This commit is contained in:
18942506660
2024-04-03 11:07:35 +08:00
parent f9ce3ebec9
commit 2f0e379087
4 changed files with 19 additions and 4 deletions

View File

@@ -92,6 +92,11 @@ namespace WMS.Web.Domain.Entitys
///</summary> ///</summary>
[Column("CustomerId")] [Column("CustomerId")]
public int CustomerId { get; set; } = 0; public int CustomerId { get; set; } = 0;
/// <summary>
/// 是否出库
///</summary>
[Column("IsOutStock")]
public bool? IsOutStock { get; set; } = false;
/// <summary> /// <summary>
/// 操作(绑定箱信息) /// 操作(绑定箱信息)
@@ -126,6 +131,8 @@ namespace WMS.Web.Domain.Entitys
this.CustomerId = outStock.ReceiptCustomerId; this.CustomerId = outStock.ReceiptCustomerId;
this.OutStockTime = DateTime.Now; this.OutStockTime = DateTime.Now;
} }
//标识出库
this.IsOutStock = true;
} }
/// <summary> /// <summary>
/// 入库 /// 入库

View File

@@ -81,5 +81,10 @@ namespace WMS.Web.Domain.Entitys
///</summary> ///</summary>
[Column("CustomerId")] [Column("CustomerId")]
public int CustomerId { get; set; } = 0; public int CustomerId { get; set; } = 0;
/// <summary>
/// 是否出库
///</summary>
[Column("IsOutStock")]
public bool? IsOutStock { get; set; } = false;
} }
} }

View File

@@ -393,7 +393,10 @@ namespace WMS.Web.Domain.Services
//if (backRecord.Type == BackRecordType.InstockOff) //if (backRecord.Type == BackRecordType.InstockOff)
// entity.UnBind(); // entity.UnBind();
if (backRecord.Type == BackRecordType.OutstockOn) if (backRecord.Type == BackRecordType.OutstockOn)
{
entity.Bind(detail.BoxId, box.CompleteCartonTime); entity.Bind(detail.BoxId, box.CompleteCartonTime);
entity.IsOutStock = false;//标识出库状态
}
//记录序列号操作日志 //记录序列号操作日志

View File

@@ -248,7 +248,7 @@ namespace WMS.Web.Repositories
.SelectMany(x => x.boxInventory.DefaultIfEmpty(), (p, boxInventory) => new { p.serial, boxInventory }) .SelectMany(x => x.boxInventory.DefaultIfEmpty(), (p, boxInventory) => new { p.serial, boxInventory })
.GroupJoin(_context.Box, s => s.serial.BoxId, box => box.Id, (s, box) => new { s.serial, s.boxInventory, box }) .GroupJoin(_context.Box, s => s.serial.BoxId, box => box.Id, (s, box) => new { s.serial, s.boxInventory, box })
.SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial, p.boxInventory, box }) .SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial, p.boxInventory, box })
.FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber)); .FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber) && w.serial.IsOutStock != true);
if (entity == null || entity.serial == null) if (entity == null || entity.serial == null)
{ {
if (IsOps) if (IsOps)
@@ -289,13 +289,13 @@ namespace WMS.Web.Repositories
//.SelectMany(x => x.boxInventory.DefaultIfEmpty(), (p, boxInventory) => new { p.serial, boxInventory }) //.SelectMany(x => x.boxInventory.DefaultIfEmpty(), (p, boxInventory) => new { p.serial, boxInventory })
//.GroupJoin(_context.Box, s => s.serial.BoxId, box => box.Id, (s, box) => new { s.serial, s.boxInventory, box }) //.GroupJoin(_context.Box, s => s.serial.BoxId, box => box.Id, (s, box) => new { s.serial, s.boxInventory, box })
//.SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial, p.boxInventory, box }) //.SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial, p.boxInventory, box })
.FirstOrDefaultAsync(w => serialNumber.Equals(w.SerialNumber)); .FirstOrDefaultAsync(w => serialNumber.Equals(w.SerialNumber) && w.IsOutStock != true);
if (entity == null) return null; if (entity == null) return null;
response.IsOldOps = true; response.IsOldOps = true;
response.IsBoxInventory = true;//如果是老ops序列号 默认有库存 response.IsBoxInventory = true;//如果是老ops序列号 默认有库存
response.BoxId = 0; response.BoxId = 0;
response.BoxBillNo = ""; response.BoxBillNo = "";
response.SubStockCode = ""; response.SubStockCode = "";
response.SerialNumber = entity.SerialNumber; response.SerialNumber = entity.SerialNumber;
response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.MaterialNumber); response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.MaterialNumber);
response.MaterialNumber = entity.MaterialNumber; response.MaterialNumber = entity.MaterialNumber;