增加序列号冻结启用

This commit is contained in:
18942506660
2024-04-07 16:47:30 +08:00
parent 235ca654e8
commit 40e4b7a1d1
8 changed files with 85 additions and 26 deletions

View File

@@ -93,10 +93,10 @@ namespace WMS.Web.Domain.Entitys
[Column("CustomerId")]
public int CustomerId { get; set; } = 0;
/// <summary>
/// 是否出库
/// 是否删除
///</summary>
[Column("IsOutStock")]
public bool? IsOutStock { get; set; } = false;
[Column("IsDelete")]
public bool? IsDelete { get; set; } = false;
/// <summary>
/// 操作(绑定箱信息)
@@ -132,7 +132,7 @@ namespace WMS.Web.Domain.Entitys
this.OutStockTime = DateTime.Now;
}
//标识出库
this.IsOutStock = true;
this.IsDelete = true;
}
/// <summary>
/// 入库
@@ -146,5 +146,44 @@ namespace WMS.Web.Domain.Entitys
this.InStockTime = DateTime.Now;
}
}
/// <summary>
/// 移箱
/// </summary>
/// <param name="type"></param>
public void MoveBox(MoveBoxType type)
{
//拣货出库, 整箱移货下架, 入库回退下架---- 序列号状态失效
//盘点, 整箱移货上架, 出库回退上架----序列号正常可用
this.IsDelete = type == MoveBoxType.Up ? false : true;
}
/// <summary>
/// 出入库回退
/// </summary>
/// <param name="type"></param>
/// <param name="boxId"></param>
public void BackRecord(BackRecordType type, int boxId)
{
//拣货出库, 整箱移货下架, 入库回退下架---- 序列号状态失效
//盘点, 整箱移货上架, 出库回退上架----序列号正常可用
if (BackRecordType.OutstockOn == type)
{
this.BoxId = boxId;
this.IsDelete = false;
}
else
this.IsDelete = true;
}
/// <summary>
/// 盘点
/// </summary>
public void TakeStock(int boxId)
{
//拣货出库, 整箱移货下架, 入库回退下架---- 序列号状态失效
//盘点, 整箱移货上架, 出库回退上架----序列号正常可用
this.BoxId = boxId;
this.IsDelete = false;
}
}
}

View File

@@ -84,7 +84,7 @@ namespace WMS.Web.Domain.Entitys
/// <summary>
/// 是否出库
///</summary>
[Column("IsOutStock")]
public bool? IsOutStock { get; set; } = false;
[Column("IsDelete")]
public bool? IsDelete { get; set; } = false;
}
}

View File

@@ -21,7 +21,7 @@ namespace WMS.Web.Domain.Infrastructure
/// <returns></returns>
Task<bool> AddRange(List<SerialNumbers> entitys, bool isTransaction = true);
//根据序列号模糊搜索信息
Task<MaterialResponse> GetSerialNumber(string serialNumber, string orgCode, bool IsOps = false, bool isOutBackRecord = false);
Task<MaterialResponse> GetSerialNumber(string serialNumber, string orgCode, bool IsOps = false, bool IsIncludeDelete = false);
//根据序列号搜索信息
Task<SerialNumbersResponse> Get(string serialNumber);
/// 查询实体集合

View File

@@ -130,7 +130,7 @@ namespace WMS.Web.Domain.Services
var moveBoxRecord = moveBoxRecords.FirstOrDefault(f => f.BoxId == entity.BoxId);
//修改序列号和箱绑定关系
//entity.Bind(moveBoxRecord.BoxId);
entity.MoveBox(moveBoxRecord.Type);
//记录序列号操作日志
SerialNumberOperate op = new SerialNumberOperate()
{
@@ -392,11 +392,13 @@ namespace WMS.Web.Domain.Services
if (box == null) continue;
//if (backRecord.Type == BackRecordType.InstockOff)
// entity.UnBind();
if (backRecord.Type == BackRecordType.OutstockOn)
{
entity.Bind(detail.BoxId, box.CompleteCartonTime);
entity.IsOutStock = false;//标识出库状态
}
entity.BackRecord(backRecord.Type, detail.BoxId);
//if (backRecord.Type == BackRecordType.OutstockOn)
//{
// entity.Bind(detail.BoxId, box.CompleteCartonTime);
// entity.IsDelete = false;//解冻
//}
//记录序列号操作日志
@@ -477,8 +479,8 @@ namespace WMS.Web.Domain.Services
}
else
{
s_entity.TakeStock(takeStockDetail.BoxId);
if (s_entity.BoxId == takeStockDetail.BoxId) continue;
s_entity.BoxId = takeStockDetail.BoxId;
var takeStock = takeStocks.FirstOrDefault(w => w.Details.FirstOrDefault(w => w.SerialNumbers.Contains(s)) != null);
//记录序列号操作日志