找到已收货的箱子
This commit is contained in:
@@ -32,7 +32,9 @@ namespace WMS.Web.Api.Controllers
|
||||
private readonly IInStockTaskService _inStockTaskService;
|
||||
private readonly IInStockTaskRepositories _inStockTaskRepositories;
|
||||
private readonly IInventoryDetailsRepositories _inventoryDetailsRepositories;
|
||||
private readonly IInStockRepositories _inStockRepositories;
|
||||
public InStockTaskController(
|
||||
IInStockRepositories inStockRepositories,
|
||||
IOptions<QiniuOptions> option,
|
||||
IExportExcelService exportExcelService,
|
||||
ILoginService loginService,
|
||||
@@ -41,6 +43,7 @@ namespace WMS.Web.Api.Controllers
|
||||
IInventoryDetailsRepositories inventoryDetailsRepositories,
|
||||
IInStockService inStockService)
|
||||
{
|
||||
_inStockRepositories = inStockRepositories;
|
||||
_inventoryDetailsRepositories = inventoryDetailsRepositories;
|
||||
this._option = option?.Value;
|
||||
this._exportExcelService = exportExcelService;
|
||||
@@ -186,6 +189,32 @@ namespace WMS.Web.Api.Controllers
|
||||
return ResultList<SourceBillNoQueryResponse>.ReSuccess(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 来源单-已收货未入库的箱集合-采购上架使用-pad
|
||||
/// </summary>
|
||||
/// <param name="taskId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("GetReceiveBox/{taskId}")]
|
||||
public async Task<ResultList<ReceiveBoxResponse>> GetReceiveBox([FromRoute] int taskId)
|
||||
{
|
||||
//找到收货的箱子
|
||||
var receiveBoxList= await _inStockTaskRepositories.GetReceiveBox(taskId);
|
||||
|
||||
//找到已入库的箱子
|
||||
var instockBoxList= await _inStockRepositories.GetInstockBox(taskId);
|
||||
if (receiveBoxList.Count!=0 && instockBoxList.Count != 0)
|
||||
{
|
||||
//剔除已入库的箱子
|
||||
foreach (var item in instockBoxList.Distinct().ToList())
|
||||
{
|
||||
receiveBoxList.Remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
return ResultList<ReceiveBoxResponse>.ReSuccess(receiveBoxList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 来源单-编号模糊查询-非采购上架使用-pad
|
||||
/// </summary>
|
||||
|
||||
@@ -244,6 +244,13 @@
|
||||
<param name="sourceBillNo">来源单号</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.InStockTaskController.GetReceiveBox(System.Int32)">
|
||||
<summary>
|
||||
来源单-已收货未入库的箱集合-采购上架使用-pad
|
||||
</summary>
|
||||
<param name="taskId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.InStockTaskController.GetSourceOrderNoPurchaseBy(WMS.Web.Core.Dto.InStockTask.InStockTaskBillNoQueryRequest)">
|
||||
<summary>
|
||||
来源单-编号模糊查询-非采购上架使用-pad
|
||||
|
||||
@@ -1917,6 +1917,26 @@
|
||||
明细
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.InStockTask.ReceiveBoxResponse">
|
||||
<summary>
|
||||
收货箱
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.ReceiveBoxResponse.TaskId">
|
||||
<summary>
|
||||
任务ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.ReceiveBoxResponse.BoxId">
|
||||
<summary>
|
||||
箱ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.ReceiveBoxResponse.BoxBillNo">
|
||||
<summary>
|
||||
箱编码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.InStockTask.SourceBillNoNoPurchaseQueryResponse">
|
||||
<summary>
|
||||
来源单模糊查询响应-非采购-对象
|
||||
@@ -4233,12 +4253,17 @@
|
||||
物料对应的仓位有哪些
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.MaterialSubStock.MaterialNumber">
|
||||
<summary>
|
||||
物料编码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.MaterialSubStock.SubStockCode">
|
||||
<summary>
|
||||
仓位编码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.MaterialSubStock.SubStockName">
|
||||
<member name="P:WMS.Web.Core.Dto.MaterialSubStock.SubStock">
|
||||
<summary>
|
||||
仓位名称
|
||||
</summary>
|
||||
|
||||
@@ -2532,6 +2532,13 @@
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.IInStockRepositories.GetInstockBox(System.Int32)">
|
||||
<summary>
|
||||
获取-已入库的箱
|
||||
</summary>
|
||||
<param name="taskId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Infrastructure.IInStockTaskBoxRepositories">
|
||||
<summary>
|
||||
箱与任务单绑定(收货)关系表-仓储接口
|
||||
@@ -2649,6 +2656,13 @@
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.IInStockTaskRepositories.GetReceiveBox(System.Int32)">
|
||||
<summary>
|
||||
获取-已收货的箱子
|
||||
</summary>
|
||||
<param name="taskId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.IInStockTaskRepositories.AddRange(System.Collections.Generic.List{WMS.Web.Domain.Entitys.InStockTask},System.Boolean)">
|
||||
<summary>
|
||||
批量添加
|
||||
@@ -2729,6 +2743,15 @@
|
||||
<param name="orgCodes"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.IInventoryDetailsRepositories.GetMaterialSubStocks(System.Collections.Generic.List{System.String},System.Collections.Generic.List{System.String},System.Int32)">
|
||||
<summary>
|
||||
获取物料对应的仓位集合
|
||||
</summary>
|
||||
<param name="materialNumbers"></param>
|
||||
<param name="stockCodes"></param>
|
||||
<param name="companyId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Infrastructure.IInventoryInOutDetailsRepositories">
|
||||
<summary>
|
||||
物料收发明细-仓储接口
|
||||
|
||||
27
src/WMS.Web.Core/Dto/InStockTask/ReceiveBoxResponse.cs
Normal file
27
src/WMS.Web.Core/Dto/InStockTask/ReceiveBoxResponse.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WMS.Web.Core.Dto.InStockTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 收货箱
|
||||
/// </summary>
|
||||
public class ReceiveBoxResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务ID
|
||||
/// </summary>
|
||||
public int TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 箱ID
|
||||
/// </summary>
|
||||
public int BoxId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 箱编码
|
||||
/// </summary>
|
||||
public string BoxBillNo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Dto.InStock;
|
||||
using WMS.Web.Core.Dto.InStockTask;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
|
||||
@@ -73,5 +74,12 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<InStock>> GetList(List<int> ids);
|
||||
|
||||
/// <summary>
|
||||
/// 获取-已入库的箱
|
||||
/// </summary>
|
||||
/// <param name="taskId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<ReceiveBoxResponse>> GetInstockBox(int taskId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,13 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
/// <returns></returns>
|
||||
Task<List<SourceBillNoNoPurchaseQueryResponse>> GetListInfoBy(InStockTaskBillNoQueryRequest dto);
|
||||
|
||||
/// <summary>
|
||||
/// 获取-已收货的箱子
|
||||
/// </summary>
|
||||
/// <param name="taskId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<ReceiveBoxResponse>> GetReceiveBox(int taskId);
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
/// </summary>
|
||||
|
||||
@@ -12,6 +12,7 @@ using WMS.Web.Core.Dto.Erp;
|
||||
using WMS.Web.Core.Dto.Erp.Org;
|
||||
using WMS.Web.Core.Dto.Erp.Supplier;
|
||||
using WMS.Web.Core.Dto.InStock;
|
||||
using WMS.Web.Core.Dto.InStockTask;
|
||||
using WMS.Web.Core.Help;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
@@ -254,6 +255,20 @@ namespace WMS.Web.Repositories
|
||||
return res.Clone();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取-已入库的箱
|
||||
/// </summary>
|
||||
/// <param name="taskId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ReceiveBoxResponse>> GetInstockBox(int taskId)
|
||||
{
|
||||
return await _context.InStockDetails.Where(x => x.TaskId == taskId).Select(x => new ReceiveBoxResponse()
|
||||
{
|
||||
TaskId=x.TaskId,
|
||||
BoxId=x.BoxId
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 列表-分页
|
||||
/// </summary>
|
||||
|
||||
@@ -165,9 +165,9 @@ namespace WMS.Web.Repositories
|
||||
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||
.Where(w => EF.Functions.Like(w.order.SourceBillNo, "%" + dto.SourceBillNo + "%")
|
||||
&& w.order.Type == InstockType.Purchase
|
||||
&& (w.order.Status == InstockStatus.Part || w.order.Status == InstockStatus.Wait || w.order.Status== InstockStatus.WaitInStock)
|
||||
&& w.detail.AccruedQty>0
|
||||
&& w.detail.IsRepeal!=true);
|
||||
&& (w.order.Status == InstockStatus.Part || w.order.Status == InstockStatus.Wait || w.order.Status == InstockStatus.WaitInStock)
|
||||
&& w.detail.AccruedQty > 0
|
||||
&& w.detail.IsRepeal != true);
|
||||
|
||||
//仓库
|
||||
if (!string.IsNullOrEmpty(dto.StockCode))
|
||||
@@ -183,15 +183,15 @@ namespace WMS.Web.Repositories
|
||||
StockCode = s.detail.StockCode,
|
||||
StockName = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, _loginRepositories.CompanyId, s.detail.StockCode + s.detail.OrgCode),
|
||||
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.detail.MaterialNumber),
|
||||
MaterialNumber = s.detail.MaterialNumber,
|
||||
MaterialNumber = s.detail.MaterialNumber,
|
||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.detail.MaterialNumber),
|
||||
Qty = s.detail.AccruedQty,
|
||||
DeliveredQty = s.detail.DeliveredQty,
|
||||
ReceiveQty = s.detail.ReceiveQty,
|
||||
//采购:可入库数量=应入库数量-收货数量-已交数量+该明细的入库数量之和;
|
||||
AvailableQty = s.detail.AccruedQty - s.detail.ReceiveQty - (s.detail.DeliveredQty> s.detail.RealityQty? s.detail.DeliveredQty : s.detail.RealityQty),
|
||||
AvailableQty = s.detail.AccruedQty - s.detail.ReceiveQty - (s.detail.DeliveredQty > s.detail.RealityQty ? s.detail.DeliveredQty : s.detail.RealityQty),
|
||||
Remark = s.detail.Remark,
|
||||
ErpDetailId=s.detail.ErpDetailId
|
||||
ErpDetailId = s.detail.ErpDetailId
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace WMS.Web.Repositories
|
||||
|
||||
//这里只查状态为:部分入库和等待收货
|
||||
var task_query = _context.InStockTask
|
||||
.Where(w => EF.Functions.Like(w.SourceBillNo, "%" + dto.SourceBillNo + "%") && w.Type!= InstockType.Purchase && (w.Status == InstockStatus.Part || w.Status == InstockStatus.Wait || w.Status==InstockStatus.WaitInStock));
|
||||
.Where(w => EF.Functions.Like(w.SourceBillNo, "%" + dto.SourceBillNo + "%") && w.Type != InstockType.Purchase && (w.Status == InstockStatus.Part || w.Status == InstockStatus.Wait || w.Status == InstockStatus.WaitInStock));
|
||||
|
||||
//找到头列表
|
||||
var taskList = await task_query
|
||||
@@ -243,7 +243,7 @@ namespace WMS.Web.Repositories
|
||||
{
|
||||
var ids = taskList.Select(x => x.Id).ToList();
|
||||
//找明细
|
||||
var query = _context.InStockTaskDetails.Where(x => ids.Contains(x.Fid) && x.AccruedQty>0 && x.IsRepeal!=true);
|
||||
var query = _context.InStockTaskDetails.Where(x => ids.Contains(x.Fid) && x.AccruedQty > 0 && x.IsRepeal != true);
|
||||
|
||||
//仓库
|
||||
if (!string.IsNullOrEmpty(dto.StockCode))
|
||||
@@ -255,19 +255,19 @@ namespace WMS.Web.Repositories
|
||||
DetailsId = s.Id,
|
||||
SupplierId = s.SupplierId,
|
||||
OrgId = s.OrgId,
|
||||
OrgCode=s.OrgCode,
|
||||
OrgCode = s.OrgCode,
|
||||
StockCode = s.StockCode,
|
||||
StockName = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, _loginRepositories.CompanyId, s.StockCode+s.OrgCode),
|
||||
StockName = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, _loginRepositories.CompanyId, s.StockCode + s.OrgCode),
|
||||
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.MaterialNumber),
|
||||
MaterialNumber = s.MaterialNumber,
|
||||
MaterialNumber = s.MaterialNumber,
|
||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.MaterialNumber),
|
||||
Qty = s.AccruedQty,
|
||||
DeliveredQty = s.DeliveredQty,
|
||||
//非采购:可入库数量=应入库数量-收货数量;
|
||||
AvailableQty = s.AccruedQty - s.ReceiveQty,
|
||||
Remark = s.Remark,
|
||||
ErpDetailId=s.ErpDetailId
|
||||
}).Where(x=>x.AvailableQty>0).ToListAsync();
|
||||
ErpDetailId = s.ErpDetailId
|
||||
}).Where(x => x.AvailableQty > 0).ToListAsync();
|
||||
|
||||
//找箱
|
||||
var task_box = await _context.InstockTaskBox.Where(x => ids.Contains(x.TaskId))
|
||||
@@ -299,6 +299,20 @@ namespace WMS.Web.Repositories
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取-已收货的箱子
|
||||
/// </summary>
|
||||
/// <param name="taskId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ReceiveBoxResponse>> GetReceiveBox(int taskId)
|
||||
{
|
||||
return await _context.InstockTaskBox.Where(x => x.TaskId == taskId).Select(x => new ReceiveBoxResponse()
|
||||
{
|
||||
TaskId = x.TaskId,
|
||||
BoxId = x.BoxId,
|
||||
BoxBillNo = x.BoxBillNo
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
|
||||
Reference in New Issue
Block a user