增加序列号冻结启用
This commit is contained in:
@@ -489,18 +489,18 @@ namespace WMS.Web.Api.Controllers
|
|||||||
/// <param name="serialNumber">序列号或规格型号或物料编码</param>
|
/// <param name="serialNumber">序列号或规格型号或物料编码</param>
|
||||||
/// <param name="orgCode">组织编码</param>
|
/// <param name="orgCode">组织编码</param>
|
||||||
/// <param name="IsOps">是否需要支持老ops条码查询</param>
|
/// <param name="IsOps">是否需要支持老ops条码查询</param>
|
||||||
/// <param name="IsOutBackRecord">出库回退上架 true 其他false或不传</param>
|
/// <param name="IsIncludeDelete">出库回退上架 true 其他false或不传</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("GetMaterial")]
|
[Route("GetMaterial")]
|
||||||
public async Task<Result<MaterialResponse>> GetMaterial([FromQuery] string serialNumber, [FromQuery] string orgCode = null, [FromQuery] bool IsOps = false, [FromQuery] bool IsOutBackRecord = false)
|
public async Task<Result<MaterialResponse>> GetMaterial([FromQuery] string serialNumber, [FromQuery] string orgCode = null, [FromQuery] bool IsOps = false, [FromQuery] bool IsIncludeDelete = false)
|
||||||
{
|
{
|
||||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||||
return Result<MaterialResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
return Result<MaterialResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||||
|
|
||||||
_logger.LogInformation($"请求序列号信息:{serialNumber} 组织:{orgCode}");
|
_logger.LogInformation($"请求序列号信息:{serialNumber} 组织:{orgCode}");
|
||||||
var res = await _serialNumbersRepositories.GetSerialNumber(serialNumber, orgCode,IsOps);
|
var res = await _serialNumbersRepositories.GetSerialNumber(serialNumber, orgCode,IsOps, IsIncludeDelete);
|
||||||
if (res == null) return Result<MaterialResponse>.ReFailure(ResultCodes.MateriaNoData);
|
if (res == null) return Result<MaterialResponse>.ReFailure(ResultCodes.MateriaNoData);
|
||||||
|
|
||||||
_logger.LogInformation($"请求序列号信息结果:{res.MaterialNumber}");
|
_logger.LogInformation($"请求序列号信息结果:{res.MaterialNumber}");
|
||||||
|
|||||||
@@ -677,7 +677,7 @@
|
|||||||
<param name="serialNumber">序列号或规格型号或物料编码</param>
|
<param name="serialNumber">序列号或规格型号或物料编码</param>
|
||||||
<param name="orgCode">组织编码</param>
|
<param name="orgCode">组织编码</param>
|
||||||
<param name="IsOps">是否需要支持老ops条码查询</param>
|
<param name="IsOps">是否需要支持老ops条码查询</param>
|
||||||
<param name="IsOutBackRecord">出库回退上架 true 其他false或不传</param>
|
<param name="IsIncludeDelete">出库回退上架 true 其他false或不传</param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Api.Controllers.SysConfigController.GetMaterialList(System.String)">
|
<member name="M:WMS.Web.Api.Controllers.SysConfigController.GetMaterialList(System.String)">
|
||||||
|
|||||||
@@ -2117,9 +2117,9 @@
|
|||||||
收货客户
|
收货客户
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Domain.Entitys.SerialNumbers.IsOutStock">
|
<member name="P:WMS.Web.Domain.Entitys.SerialNumbers.IsDelete">
|
||||||
<summary>
|
<summary>
|
||||||
是否出库
|
是否删除
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.Bind(System.Int32,System.DateTime)">
|
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.Bind(System.Int32,System.DateTime)">
|
||||||
@@ -2145,6 +2145,24 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="inStockBillNo">出库单号</param>
|
<param name="inStockBillNo">出库单号</param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.MoveBox(WMS.Web.Domain.Values.MoveBoxType)">
|
||||||
|
<summary>
|
||||||
|
移箱
|
||||||
|
</summary>
|
||||||
|
<param name="type"></param>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.BackRecord(WMS.Web.Domain.Values.BackRecordType,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
出入库回退
|
||||||
|
</summary>
|
||||||
|
<param name="type"></param>
|
||||||
|
<param name="boxId"></param>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.TakeStock(System.Int32)">
|
||||||
|
<summary>
|
||||||
|
盘点
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Entitys.SerialNumbers_Ops">
|
<member name="T:WMS.Web.Domain.Entitys.SerialNumbers_Ops">
|
||||||
<summary>
|
<summary>
|
||||||
老ops序列码
|
老ops序列码
|
||||||
@@ -2215,7 +2233,7 @@
|
|||||||
收货客户
|
收货客户
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Domain.Entitys.SerialNumbers_Ops.IsOutStock">
|
<member name="P:WMS.Web.Domain.Entitys.SerialNumbers_Ops.IsDelete">
|
||||||
<summary>
|
<summary>
|
||||||
是否出库
|
是否出库
|
||||||
</summary>
|
</summary>
|
||||||
|
|||||||
@@ -93,10 +93,10 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
[Column("CustomerId")]
|
[Column("CustomerId")]
|
||||||
public int CustomerId { get; set; } = 0;
|
public int CustomerId { get; set; } = 0;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否出库
|
/// 是否删除
|
||||||
///</summary>
|
///</summary>
|
||||||
[Column("IsOutStock")]
|
[Column("IsDelete")]
|
||||||
public bool? IsOutStock { get; set; } = false;
|
public bool? IsDelete { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作(绑定箱信息)
|
/// 操作(绑定箱信息)
|
||||||
@@ -132,7 +132,7 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
this.OutStockTime = DateTime.Now;
|
this.OutStockTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
//标识出库
|
//标识出库
|
||||||
this.IsOutStock = true;
|
this.IsDelete = true;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 入库
|
/// 入库
|
||||||
@@ -146,5 +146,44 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
this.InStockTime = DateTime.Now;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否出库
|
/// 是否出库
|
||||||
///</summary>
|
///</summary>
|
||||||
[Column("IsOutStock")]
|
[Column("IsDelete")]
|
||||||
public bool? IsOutStock { get; set; } = false;
|
public bool? IsDelete { get; set; } = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace WMS.Web.Domain.Infrastructure
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<bool> AddRange(List<SerialNumbers> entitys, bool isTransaction = true);
|
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);
|
Task<SerialNumbersResponse> Get(string serialNumber);
|
||||||
/// 查询实体集合
|
/// 查询实体集合
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
var moveBoxRecord = moveBoxRecords.FirstOrDefault(f => f.BoxId == entity.BoxId);
|
var moveBoxRecord = moveBoxRecords.FirstOrDefault(f => f.BoxId == entity.BoxId);
|
||||||
//修改序列号和箱绑定关系
|
//修改序列号和箱绑定关系
|
||||||
//entity.Bind(moveBoxRecord.BoxId);
|
//entity.Bind(moveBoxRecord.BoxId);
|
||||||
|
entity.MoveBox(moveBoxRecord.Type);
|
||||||
//记录序列号操作日志
|
//记录序列号操作日志
|
||||||
SerialNumberOperate op = new SerialNumberOperate()
|
SerialNumberOperate op = new SerialNumberOperate()
|
||||||
{
|
{
|
||||||
@@ -392,11 +392,13 @@ namespace WMS.Web.Domain.Services
|
|||||||
if (box == null) continue;
|
if (box == null) continue;
|
||||||
//if (backRecord.Type == BackRecordType.InstockOff)
|
//if (backRecord.Type == BackRecordType.InstockOff)
|
||||||
// entity.UnBind();
|
// entity.UnBind();
|
||||||
if (backRecord.Type == BackRecordType.OutstockOn)
|
|
||||||
{
|
entity.BackRecord(backRecord.Type, detail.BoxId);
|
||||||
entity.Bind(detail.BoxId, box.CompleteCartonTime);
|
//if (backRecord.Type == BackRecordType.OutstockOn)
|
||||||
entity.IsOutStock = false;//标识出库状态
|
//{
|
||||||
}
|
// entity.Bind(detail.BoxId, box.CompleteCartonTime);
|
||||||
|
// entity.IsDelete = false;//解冻
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
//记录序列号操作日志
|
//记录序列号操作日志
|
||||||
@@ -477,8 +479,8 @@ namespace WMS.Web.Domain.Services
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
s_entity.TakeStock(takeStockDetail.BoxId);
|
||||||
if (s_entity.BoxId == takeStockDetail.BoxId) continue;
|
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);
|
var takeStock = takeStocks.FirstOrDefault(w => w.Details.FirstOrDefault(w => w.SerialNumbers.Contains(s)) != null);
|
||||||
//记录序列号操作日志
|
//记录序列号操作日志
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ namespace WMS.Web.Repositories
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serialNumbers"></param>
|
/// <param name="serialNumbers"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<MaterialResponse> GetSerialNumber(string serialNumber, string orgCode, bool IsOps = false, bool isOutBackRecord = false)
|
public async Task<MaterialResponse> GetSerialNumber(string serialNumber, string orgCode, bool IsOps = false, bool IsIncludeDelete = false)
|
||||||
{
|
{
|
||||||
MaterialResponse response = new MaterialResponse();
|
MaterialResponse response = new MaterialResponse();
|
||||||
var materials_result = await _erpService.BillQueryForMaterial();
|
var materials_result = await _erpService.BillQueryForMaterial();
|
||||||
@@ -249,12 +249,12 @@ namespace WMS.Web.Repositories
|
|||||||
.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 })
|
||||||
.Where(w => serialNumber.Equals(w.serial.SerialNumber));
|
.Where(w => serialNumber.Equals(w.serial.SerialNumber));
|
||||||
if (isOutBackRecord == false) res = res.Where(w => w.serial.IsOutStock != true);
|
if (IsIncludeDelete == false) res = res.Where(w => w.serial.IsDelete != true);
|
||||||
var entity = await res.FirstOrDefaultAsync();
|
var entity = await res.FirstOrDefaultAsync();
|
||||||
if (entity == null || entity.serial == null)
|
if (entity == null || entity.serial == null)
|
||||||
{
|
{
|
||||||
if (IsOps)
|
if (IsOps)
|
||||||
return await GetSerialNumber_Ops(serialNumber, isOutBackRecord);
|
return await GetSerialNumber_Ops(serialNumber, IsIncludeDelete);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -278,7 +278,7 @@ namespace WMS.Web.Repositories
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serialNumbers"></param>
|
/// <param name="serialNumbers"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<MaterialResponse> GetSerialNumber_Ops(string serialNumber, bool isOutBackRecord = false)
|
private async Task<MaterialResponse> GetSerialNumber_Ops(string serialNumber, bool IsIncludeDelete = false)
|
||||||
{
|
{
|
||||||
MaterialResponse response = new MaterialResponse();
|
MaterialResponse response = new MaterialResponse();
|
||||||
var materials_result = await _erpService.BillQueryForMaterial();
|
var materials_result = await _erpService.BillQueryForMaterial();
|
||||||
@@ -292,7 +292,7 @@ namespace WMS.Web.Repositories
|
|||||||
//.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 })
|
||||||
.Where(w => serialNumber.Equals(w.SerialNumber));
|
.Where(w => serialNumber.Equals(w.SerialNumber));
|
||||||
if (isOutBackRecord == false) res = res.Where(w => w.IsOutStock != true);
|
if (IsIncludeDelete == false) res = res.Where(w => w.IsDelete != true);
|
||||||
var entity = await res.FirstOrDefaultAsync();
|
var entity = await res.FirstOrDefaultAsync();
|
||||||
if (entity == null) return null;
|
if (entity == null) return null;
|
||||||
response.IsOldOps = true;
|
response.IsOldOps = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user