优化接口
This commit is contained in:
@@ -2694,6 +2694,19 @@
|
|||||||
<param name="dto"></param>
|
<param name="dto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Domain.IService.IInStockTaskBoxService">
|
||||||
|
<summary>
|
||||||
|
任务单的箱收货记录服务
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.IService.IInStockTaskBoxService.UnBind(System.Collections.Generic.List{System.Int32},System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
解绑-收货的箱子
|
||||||
|
</summary>
|
||||||
|
<param name="boxIds"></param>
|
||||||
|
<param name="isTransaction"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.IService.IInStockTaskService">
|
<member name="T:WMS.Web.Domain.IService.IInStockTaskService">
|
||||||
<summary>
|
<summary>
|
||||||
入库任务单-服务接口
|
入库任务单-服务接口
|
||||||
@@ -4049,6 +4062,19 @@
|
|||||||
<param name="billNo"></param>
|
<param name="billNo"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Domain.Services.InStockTaskBoxService">
|
||||||
|
<summary>
|
||||||
|
任务单的箱收货记录服务
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.InStockTaskBoxService.UnBind(System.Collections.Generic.List{System.Int32},System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
解绑-收货的箱子
|
||||||
|
</summary>
|
||||||
|
<param name="boxIds"></param>
|
||||||
|
<param name="isTransaction"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Services.InStockTaskService">
|
<member name="T:WMS.Web.Domain.Services.InStockTaskService">
|
||||||
<summary>
|
<summary>
|
||||||
入库任务单-服务
|
入库任务单-服务
|
||||||
|
|||||||
22
src/WMS.Web.Domain/IService/IInStockTaskBoxService.cs
Normal file
22
src/WMS.Web.Domain/IService/IInStockTaskBoxService.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Internal.Results;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.IService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 任务单的箱收货记录服务
|
||||||
|
/// </summary>
|
||||||
|
public interface IInStockTaskBoxService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 解绑-收货的箱子
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="boxIds"></param>
|
||||||
|
/// <param name="isTransaction"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Result> UnBind(List<int> boxIds, bool isTransaction = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
54
src/WMS.Web.Domain/Services/InStockTaskBoxService.cs
Normal file
54
src/WMS.Web.Domain/Services/InStockTaskBoxService.cs
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Internal.Results;
|
||||||
|
using WMS.Web.Domain.Infrastructure;
|
||||||
|
using WMS.Web.Domain.IService;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 任务单的箱收货记录服务
|
||||||
|
/// </summary>
|
||||||
|
public class InStockTaskBoxService: IInStockTaskBoxService
|
||||||
|
{
|
||||||
|
private readonly IInStockTaskBoxRepositories _inStockTaskBoxRepositories;
|
||||||
|
private readonly IBoxInventoryRepositories _boxInventoryRepositories;
|
||||||
|
public InStockTaskBoxService(IInStockTaskBoxRepositories inStockTaskBoxRepositories, IBoxInventoryRepositories boxInventoryRepositories)
|
||||||
|
{
|
||||||
|
_inStockTaskBoxRepositories = inStockTaskBoxRepositories;
|
||||||
|
_boxInventoryRepositories = boxInventoryRepositories;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 解绑-收货的箱子
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="boxIds"></param>
|
||||||
|
/// <param name="isTransaction"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<Result> UnBind(List<int> boxIds, bool isTransaction = true)
|
||||||
|
{
|
||||||
|
var delete_ids = new List<int>();
|
||||||
|
var t_boxIds = boxIds.Distinct().ToList();
|
||||||
|
var list= await _inStockTaskBoxRepositories.GetListBy(t_boxIds);
|
||||||
|
var boxInvetList = await _boxInventoryRepositories.GetList(t_boxIds);
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
var isHave= boxInvetList.Where(x => x.BoxId == item.BoxId).Any();
|
||||||
|
if (!isHave)
|
||||||
|
delete_ids.Add(item.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (delete_ids.Count != 0)
|
||||||
|
{
|
||||||
|
var isSuccess= await _inStockTaskBoxRepositories.DeleteRange(delete_ids, isTransaction);
|
||||||
|
if (!isSuccess)
|
||||||
|
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
|
}
|
||||||
|
return Result.ReSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -295,6 +295,7 @@ namespace WMS.Web.Repositories.DependencyInjection
|
|||||||
Services.AddTransient<IBoxInventoryService, BoxInventoryService>();
|
Services.AddTransient<IBoxInventoryService, BoxInventoryService>();
|
||||||
Services.AddTransient<IInventoryInOutDetailsService, InventoryInOutDetailsService>();
|
Services.AddTransient<IInventoryInOutDetailsService, InventoryInOutDetailsService>();
|
||||||
Services.AddTransient<IInventoryDetailsService, InventoryDetailsService>();
|
Services.AddTransient<IInventoryDetailsService, InventoryDetailsService>();
|
||||||
|
Services.AddTransient<IInStockTaskBoxService, InStockTaskBoxService>();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user