优化接口
This commit is contained in:
@@ -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>
|
||||
目标箱组织编码
|
||||
|
||||
@@ -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>
|
||||
添加
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -153,13 +153,18 @@ namespace WMS.Web.Domain.Services
|
||||
//1.先判断:箱号已经绑定了入库任务单中;备注:业务说法就是箱是否收货了
|
||||
var tast = await _inStockTaskRepositories.GetBy(boxBillNo);
|
||||
if (tast == null)
|
||||
return Result<InStockTaskInfoDto>.ReFailure(ResultCodes.Box_NoBind_Task_Data);
|
||||
return Result<InStockTaskInfoDto>.ReFailure(ResultCodes.Box_NoBind_Task_Data);
|
||||
|
||||
//2.找到箱对应的物料信息
|
||||
var box = await _boxRepositories.GetByNo(boxBillNo);
|
||||
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;
|
||||
|
||||
@@ -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, "物料信息不存在");
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user