优化接口

This commit is contained in:
tongfei
2023-11-22 09:57:00 +08:00
parent b1c557c876
commit 935963aa18
8 changed files with 60 additions and 5 deletions

View File

@@ -2170,6 +2170,16 @@
目标箱ID
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.Inventory.BoxInventoryChangeGenerateDto.StockCode">
<summary>
目标箱的仓库(可为空:当目标箱不需要上架时候)
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.Inventory.BoxInventoryChangeGenerateDto.SubStockId">
<summary>
目标箱的仓位(可为空:当目标箱不需要上架时候)
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.Inventory.BoxInventoryChangeGenerateDto.TargetBoxOrgCode">
<summary>
目标箱组织编码

View File

@@ -1796,6 +1796,13 @@
<param name="dto"></param>
<returns></returns>
</member>
<member name="M:WMS.Web.Domain.Infrastructure.IInStockRepositories.IsExistBy(System.Int32)">
<summary>
箱是否存在于入库单明细中;(箱是否被上架了)
</summary>
<param name="boxId"></param>
<returns></returns>
</member>
<member name="M:WMS.Web.Domain.Infrastructure.IInStockRepositories.Add(WMS.Web.Domain.Entitys.InStock,System.Boolean)">
<summary>
添加

View File

@@ -24,6 +24,16 @@ namespace WMS.Web.Core.Dto.Inventory
/// </summary>
public int TargetBoxId { get; set; }
/// <summary>
/// 目标箱的仓库(可为空:当目标箱不需要上架时候)
/// </summary>
public string StockCode { get; set; }
/// <summary>
/// 目标箱的仓位(可为空:当目标箱不需要上架时候)
/// </summary>
public int? SubStockId { get; set; }
/// <summary>
/// 目标箱组织编码
/// </summary>

View File

@@ -21,6 +21,13 @@ namespace WMS.Web.Domain.Infrastructure
/// <returns></returns>
Task<(List<InStockQueryResponse> list,int total)> GetPagedList(InStockQueryRequest dto);
/// <summary>
/// 箱是否存在于入库单明细中;(箱是否被上架了)
/// </summary>
/// <param name="boxId"></param>
/// <returns></returns>
Task<bool> IsExistBy(int boxId);
/// <summary>
/// 添加
/// </summary>

View File

@@ -95,10 +95,15 @@ namespace WMS.Web.Domain.Services
var tagBox = targetBoxInventorys.Where(x => x.BoxId == dto.TargetBoxId).FirstOrDefault();
if (tagBox == null)
{
var newTagBox = new BoxInventory();
newTagBox.BoxId = dto.TargetBoxId;
newTagBox.Details =_mapper.Map<List<BoxInventoryDetails>>(dto.Details);
add_entitys.Add(newTagBox);
if (!string.IsNullOrEmpty(dto.StockCode) && dto.SubStockId.HasValue)
{
var newTagBox = new BoxInventory();
newTagBox.StockCode = dto.StockCode;
newTagBox.SubStockId = dto.SubStockId.Value;
newTagBox.BoxId = dto.TargetBoxId;
newTagBox.Details = _mapper.Map<List<BoxInventoryDetails>>(dto.Details);
add_entitys.Add(newTagBox);
}
}
else
{

View File

@@ -160,6 +160,11 @@ namespace WMS.Web.Domain.Services
if (box == null)
return Result<InStockTaskInfoDto>.ReFailure(ResultCodes.BoxNoData);
//2.1判断箱是否上架过了
var isExist = await _inStockRepositories.IsExistBy(box.Id);
if(isExist)
return Result<InStockTaskInfoDto>.ReFailure(ResultCodes.BoxIsTrueShelf);
//3.组装返回数据
var result = _mapper.Map<InStockTaskInfoDto>(tast);
result.BoxId = box.Id;

View File

@@ -32,6 +32,7 @@ namespace WMS.Web.Domain.Values
public static ValueTuple<int, string> OutStockTaskRepeal = (70005, "任务单已作废");
public static ValueTuple<int, string> MergeNumberError = (70006, "必须选择两个及以上的单合并");
public static ValueTuple<int, string> BoxIsTrueShelf = (80000, "该箱已上架,请选择其它箱进行上架!");
public static ValueTuple<int, string> BoxNoData = (80000, "箱信息不存在");
public static ValueTuple<int, string> BoxMateriaNoData = (800010, "箱对应物料信息不存在");
public static ValueTuple<int, string> MateriaNoData = (800011, "物料信息不存在");

View File

@@ -135,6 +135,16 @@ namespace WMS.Web.Repositories
return (list, total);
}
/// <summary>
/// 箱是否存在于入库单明细中;(箱是否被上架了)
/// </summary>
/// <param name="boxId"></param>
/// <returns></returns>
public async Task<bool> IsExistBy(int boxId)
{
return await _context.InStockDetails.Where(x => x.BoxId == boxId).AnyAsync();
}
/// <summary>
/// 新增
/// </summary>