优化接口
This commit is contained in:
@@ -2170,6 +2170,16 @@
|
|||||||
目标箱ID
|
目标箱ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</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">
|
<member name="P:WMS.Web.Core.Dto.Inventory.BoxInventoryChangeGenerateDto.TargetBoxOrgCode">
|
||||||
<summary>
|
<summary>
|
||||||
目标箱组织编码
|
目标箱组织编码
|
||||||
|
|||||||
@@ -1796,6 +1796,13 @@
|
|||||||
<param name="dto"></param>
|
<param name="dto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</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)">
|
<member name="M:WMS.Web.Domain.Infrastructure.IInStockRepositories.Add(WMS.Web.Domain.Entitys.InStock,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
添加
|
添加
|
||||||
|
|||||||
@@ -24,6 +24,16 @@ namespace WMS.Web.Core.Dto.Inventory
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int TargetBoxId { get; set; }
|
public int TargetBoxId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 目标箱的仓库(可为空:当目标箱不需要上架时候)
|
||||||
|
/// </summary>
|
||||||
|
public string StockCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 目标箱的仓位(可为空:当目标箱不需要上架时候)
|
||||||
|
/// </summary>
|
||||||
|
public int? SubStockId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 目标箱组织编码
|
/// 目标箱组织编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ namespace WMS.Web.Domain.Infrastructure
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<(List<InStockQueryResponse> list,int total)> GetPagedList(InStockQueryRequest dto);
|
Task<(List<InStockQueryResponse> list,int total)> GetPagedList(InStockQueryRequest dto);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 箱是否存在于入库单明细中;(箱是否被上架了)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="boxId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> IsExistBy(int boxId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加
|
/// 添加
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -94,12 +94,17 @@ namespace WMS.Web.Domain.Services
|
|||||||
//2.2找到要改变的目标箱数据:备注(目标箱库存可能不存在库存,就要新增)
|
//2.2找到要改变的目标箱数据:备注(目标箱库存可能不存在库存,就要新增)
|
||||||
var tagBox = targetBoxInventorys.Where(x => x.BoxId == dto.TargetBoxId).FirstOrDefault();
|
var tagBox = targetBoxInventorys.Where(x => x.BoxId == dto.TargetBoxId).FirstOrDefault();
|
||||||
if (tagBox == null)
|
if (tagBox == null)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(dto.StockCode) && dto.SubStockId.HasValue)
|
||||||
{
|
{
|
||||||
var newTagBox = new BoxInventory();
|
var newTagBox = new BoxInventory();
|
||||||
|
newTagBox.StockCode = dto.StockCode;
|
||||||
|
newTagBox.SubStockId = dto.SubStockId.Value;
|
||||||
newTagBox.BoxId = dto.TargetBoxId;
|
newTagBox.BoxId = dto.TargetBoxId;
|
||||||
newTagBox.Details =_mapper.Map<List<BoxInventoryDetails>>(dto.Details);
|
newTagBox.Details = _mapper.Map<List<BoxInventoryDetails>>(dto.Details);
|
||||||
add_entitys.Add(newTagBox);
|
add_entitys.Add(newTagBox);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var tag_update_entity = tagBox;
|
var tag_update_entity = tagBox;
|
||||||
|
|||||||
@@ -160,6 +160,11 @@ namespace WMS.Web.Domain.Services
|
|||||||
if (box == null)
|
if (box == null)
|
||||||
return Result<InStockTaskInfoDto>.ReFailure(ResultCodes.BoxNoData);
|
return Result<InStockTaskInfoDto>.ReFailure(ResultCodes.BoxNoData);
|
||||||
|
|
||||||
|
//2.1判断箱是否上架过了
|
||||||
|
var isExist = await _inStockRepositories.IsExistBy(box.Id);
|
||||||
|
if(isExist)
|
||||||
|
return Result<InStockTaskInfoDto>.ReFailure(ResultCodes.BoxIsTrueShelf);
|
||||||
|
|
||||||
//3.组装返回数据
|
//3.组装返回数据
|
||||||
var result = _mapper.Map<InStockTaskInfoDto>(tast);
|
var result = _mapper.Map<InStockTaskInfoDto>(tast);
|
||||||
result.BoxId = box.Id;
|
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> OutStockTaskRepeal = (70005, "任务单已作废");
|
||||||
public static ValueTuple<int, string> MergeNumberError = (70006, "必须选择两个及以上的单合并");
|
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> BoxNoData = (80000, "箱信息不存在");
|
||||||
public static ValueTuple<int, string> BoxMateriaNoData = (800010, "箱对应物料信息不存在");
|
public static ValueTuple<int, string> BoxMateriaNoData = (800010, "箱对应物料信息不存在");
|
||||||
public static ValueTuple<int, string> MateriaNoData = (800011, "物料信息不存在");
|
public static ValueTuple<int, string> MateriaNoData = (800011, "物料信息不存在");
|
||||||
|
|||||||
@@ -135,6 +135,16 @@ namespace WMS.Web.Repositories
|
|||||||
return (list, total);
|
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>
|
||||||
/// 新增
|
/// 新增
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user