仓储查询条件添加
This commit is contained in:
@@ -85,6 +85,36 @@
|
||||
<member name="P:ERP.AccessResult.AccessToken">
|
||||
<remarks/>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.Basics.SysStaffResponse">
|
||||
<summary>
|
||||
员工响应
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.Basics.SysStaffResponse.Id">
|
||||
<summary>
|
||||
StaffID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.Basics.SysStaffResponse.Name">
|
||||
<summary>
|
||||
名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.Basics.SysStaffResponse.DeptId">
|
||||
<summary>
|
||||
部门ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.Basics.SysStaffResponse.Telephone">
|
||||
<summary>
|
||||
电话
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.Basics.SysStaffResponse.Disable">
|
||||
<summary>
|
||||
是否禁用:true为禁用,false为启用
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.ChangeBoxRecord.ChangeBoxRecordQueryRequest">
|
||||
<summary>
|
||||
改箱列表请求
|
||||
@@ -92,12 +122,12 @@
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.ChangeBoxRecord.ChangeBoxRecordQueryRequest.SrcBox">
|
||||
<summary>
|
||||
原箱子ID
|
||||
原箱子
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.ChangeBoxRecord.ChangeBoxRecordQueryRequest.DestBox">
|
||||
<summary>
|
||||
目标箱子ID
|
||||
目标箱子
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.ChangeBoxRecord.ChangeBoxRecordQueryRequest.StockId">
|
||||
@@ -955,11 +985,6 @@
|
||||
用户在单点中维一ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.MoveBoxRecord.MoveBoxRecordQueryInfoResponse.Specifications">
|
||||
<summary>
|
||||
规格型号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.MoveBoxRecord.MoveBoxRecordQueryInfoResponse.Box">
|
||||
<summary>
|
||||
箱号
|
||||
|
||||
@@ -963,6 +963,18 @@
|
||||
备注
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Infrastructure.IBasicsRepositories">
|
||||
<summary>
|
||||
基础数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Infrastructure.IBasicsRepositories.GetStaffListAsync(System.Int32)">
|
||||
<summary>
|
||||
获取所有人员-根据主体
|
||||
</summary>
|
||||
<param name="CompanyId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Infrastructure.IInStockRepositories">
|
||||
<summary>
|
||||
wms入库单-仓储接口
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// 盘点日期
|
||||
/// </summary>
|
||||
[Column("Date")]
|
||||
public DateTime Date { get; set; }
|
||||
public DateTime Date { get; set; } = DateTime.Now;
|
||||
/// <summary>
|
||||
/// 盘点人员
|
||||
/// </summary>
|
||||
|
||||
@@ -12,28 +12,30 @@ using WMS.Web.Core.Help;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
using WMS.Web.Domain.Values;
|
||||
using WMS.Web.Domain.Values.Single;
|
||||
using WMS.Web.Repositories.Configuration;
|
||||
|
||||
namespace WMS.Web.Repositories
|
||||
{
|
||||
public class MoveBoxRecordRepositories: IMoveBoxRecordRepositories
|
||||
public class MoveBoxRecordRepositories : IMoveBoxRecordRepositories
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly RepositoryDbContext _context;
|
||||
private readonly ISingleDataService _singleDataService;
|
||||
private readonly ILoginRepositories _loginRepositories;
|
||||
|
||||
private readonly IBasicsRepositories _basicsRepositories;
|
||||
|
||||
public MoveBoxRecordRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider,
|
||||
ISingleDataService singleDataService, ILoginRepositories loginRepositories)
|
||||
ISingleDataService singleDataService, ILoginRepositories loginRepositories, IBasicsRepositories basicsRepositories)
|
||||
{
|
||||
_context = context;
|
||||
_mapper = mapper;
|
||||
_serviceProvider = serviceProvider;
|
||||
_singleDataService = singleDataService;
|
||||
_loginRepositories = loginRepositories;
|
||||
_basicsRepositories = basicsRepositories;
|
||||
}
|
||||
/// <summary>
|
||||
/// 新增
|
||||
@@ -76,12 +78,25 @@ namespace WMS.Web.Repositories
|
||||
/// <returns></returns>
|
||||
public async Task<(List<MoveBoxRecordQueryInfoResponse> list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto)
|
||||
{
|
||||
List<int> ids = new List<int>();
|
||||
if (!string.IsNullOrEmpty(dto.Creator))
|
||||
{
|
||||
var staffList = await _basicsRepositories.GetStaffListAsync(_loginRepositories.CompanyId);
|
||||
ids = staffList.Where(w => EF.Functions.Like(w.Name, "%" + dto.Creator + "%")).Select(s => s.Id).ToList();
|
||||
}
|
||||
|
||||
var query = _context.MoveBoxRecord
|
||||
.GroupJoin(_context.Box, moveBox => moveBox.BoxId, box => box.Id, (moveBox, box) => new { moveBox, box })
|
||||
.SelectMany(x => x.box.DefaultIfEmpty(), (d, box) => new { d.moveBox, box })
|
||||
.OrderByDescending(o => o.moveBox.Id)
|
||||
.Where(adv => 1 == 1);
|
||||
|
||||
if (ids.Count() > 0)
|
||||
query = query.Where(w => ids.Contains(w.moveBox.CreatorId));
|
||||
if (!string.IsNullOrEmpty(dto.Box))
|
||||
query = query.Where(w => EF.Functions.Like(w.box.BoxBillNo, "%" + dto.Box + "%"));
|
||||
if (dto.Type != null)
|
||||
query = query.Where(w => w.moveBox.Type == (MoveBoxType)dto.Type);
|
||||
if (dto.CreateBeginDate != null)
|
||||
query = query.Where(w => w.moveBox.CreateTime >= dto.CreateBeginDate);
|
||||
if (dto.CreateEndDate != null)
|
||||
|
||||
@@ -13,28 +13,30 @@ using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
using WMS.Web.Domain.Mappers;
|
||||
using WMS.Web.Domain.Values;
|
||||
using WMS.Web.Domain.Values.Single;
|
||||
using WMS.Web.Repositories.Configuration;
|
||||
|
||||
namespace WMS.Web.Repositories
|
||||
{
|
||||
public class OutStockRepositories: IOutStockRepositories
|
||||
public class OutStockRepositories : IOutStockRepositories
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly RepositoryDbContext _context;
|
||||
private readonly ISingleDataService _singleDataService;
|
||||
private readonly ILoginRepositories _loginRepositories;
|
||||
|
||||
private readonly IBasicsRepositories _basicsRepositories;
|
||||
|
||||
public OutStockRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider,
|
||||
ISingleDataService singleDataService, ILoginRepositories loginRepositories)
|
||||
ISingleDataService singleDataService, ILoginRepositories loginRepositories, IBasicsRepositories basicsRepositories)
|
||||
{
|
||||
_context = context;
|
||||
_mapper = mapper;
|
||||
_serviceProvider = serviceProvider;
|
||||
_singleDataService = singleDataService;
|
||||
_loginRepositories = loginRepositories;
|
||||
_basicsRepositories = basicsRepositories;
|
||||
}
|
||||
/// <summary>
|
||||
/// 新增
|
||||
@@ -77,12 +79,33 @@ namespace WMS.Web.Repositories
|
||||
/// <returns></returns>
|
||||
public async Task<(List<OutStockQueryInfoResponse> list, int total)> GetListAsync(OutStockQueryRequest dto)
|
||||
{
|
||||
List<int> ids = new List<int>();
|
||||
if (!string.IsNullOrEmpty(dto.Creator))
|
||||
{
|
||||
var staffList = await _basicsRepositories.GetStaffListAsync(_loginRepositories.CompanyId);
|
||||
ids = staffList.Where(w => EF.Functions.Like(w.Name, "%" + dto.Creator + "%")).Select(s => s.Id).ToList();
|
||||
}
|
||||
|
||||
var query = _context.OutStockDetails
|
||||
.GroupJoin(_context.OutStock, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
||||
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||
.OrderByDescending(o => o.order.Id)
|
||||
.Where(adv => 1 == 1);
|
||||
|
||||
//if (!string.IsNullOrEmpty(dto.ReceiptCustomer))
|
||||
//if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
||||
if (ids.Count() > 0)
|
||||
query = query.Where(w => ids.Contains(w.order.CreatorId));
|
||||
if (!string.IsNullOrEmpty(dto.SourceBillNo))
|
||||
query = query.Where(w => EF.Functions.Like(w.detail.SourceBillNo, "%" + dto.SourceBillNo + "%"));
|
||||
if (dto.Type != null)
|
||||
query = query.Where(w => w.order.Type == (OrderType)dto.Type);
|
||||
if (dto.SuccessSync != null)
|
||||
query = query.Where(w => w.order.SuccessSync == dto.SuccessSync);
|
||||
if (dto.DeliveryOrgId != null)
|
||||
query = query.Where(w => w.detail.DeliveryOrgId == dto.DeliveryOrgId);
|
||||
if (dto.StockId != null)
|
||||
query = query.Where(w => w.detail.StockId == dto.StockId);
|
||||
if (dto.CreateBeginDate != null)
|
||||
query = query.Where(w => w.order.CreateTime >= dto.CreateBeginDate);
|
||||
if (dto.CreateEndDate != null)
|
||||
@@ -93,21 +116,21 @@ namespace WMS.Web.Repositories
|
||||
{
|
||||
#region dto组装
|
||||
Id = s.order.Id,
|
||||
BillNo=s.order.BillNo,
|
||||
BillNo = s.order.BillNo,
|
||||
Status = s.order.Status.GetRemark(),
|
||||
Type = s.order.Type.GetRemark(),
|
||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.order.CreatorId),
|
||||
CreateTime=s.order.CreateTime.DateToStringSeconds(),
|
||||
CreateTime = s.order.CreateTime.DateToStringSeconds(),
|
||||
SuccessSync = s.order.SuccessSync,
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.detail.StockId),
|
||||
SourceBillNo=s.detail.SourceBillNo,
|
||||
SourceBillNo = s.detail.SourceBillNo,
|
||||
SaleBillNo = s.detail.SaleBillNo,
|
||||
DeliveryOrg = "",
|
||||
ReceiptCustomer = _singleDataService.GetSingleData(SingleAction.Customers, _loginRepositories.CompanyId, s.detail.ReceiptCustomerId),
|
||||
MaterialName = "",
|
||||
MaterialNumber = "",
|
||||
Specifications = "",
|
||||
Qty=s.detail.Qty
|
||||
Qty = s.detail.Qty
|
||||
#endregion
|
||||
|
||||
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
@@ -127,7 +150,7 @@ namespace WMS.Web.Repositories
|
||||
try
|
||||
{
|
||||
List<int> list = entitys.Select(s => s.Id).ToList();
|
||||
|
||||
|
||||
var res = await _context.OutStock
|
||||
.Include(s => s.Details)
|
||||
.Where(f => list.Contains(f.Id)).ToListAsync();
|
||||
|
||||
@@ -13,6 +13,7 @@ using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
using WMS.Web.Domain.Mappers;
|
||||
using WMS.Web.Domain.Values;
|
||||
using WMS.Web.Domain.Values.Single;
|
||||
using WMS.Web.Repositories.Configuration;
|
||||
|
||||
@@ -167,6 +168,20 @@ namespace WMS.Web.Repositories
|
||||
.OrderByDescending(o => o.order.Id)
|
||||
.Where(adv => 1 == 1);
|
||||
|
||||
//if (!string.IsNullOrEmpty(dto.ReceiptCustomer))
|
||||
//if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
||||
if (dto.Ids.Count() > 0)
|
||||
query = query.Where(w => dto.Ids.Contains(w.detail.Id));
|
||||
if (!string.IsNullOrEmpty(dto.SourceBillNo))
|
||||
query = query.Where(w => EF.Functions.Like(w.detail.SourceBillNo, "%" + dto.SourceBillNo + "%"));
|
||||
if (dto.Type != null)
|
||||
query = query.Where(w => w.order.Type == (OrderType)dto.Type);
|
||||
if (dto.Status != null)
|
||||
query = query.Where(w => w.order.Status == (OutStockStatus)dto.Status);
|
||||
if (dto.DeliveryOrgId != null)
|
||||
query = query.Where(w => w.detail.DeliveryOrgId == dto.DeliveryOrgId);
|
||||
if (dto.StockId != null)
|
||||
query = query.Where(w => w.detail.StockId == dto.StockId);
|
||||
if (dto.CreateBeginDate != null)
|
||||
query = query.Where(w => w.order.OperateTime >= dto.CreateBeginDate);
|
||||
if (dto.CreateEndDate != null)
|
||||
|
||||
@@ -12,6 +12,7 @@ using WMS.Web.Core.Help;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
using WMS.Web.Domain.Values;
|
||||
using WMS.Web.Domain.Values.Single;
|
||||
using WMS.Web.Repositories.Configuration;
|
||||
|
||||
@@ -82,6 +83,12 @@ namespace WMS.Web.Repositories
|
||||
.OrderByDescending(o => o.order.Id)
|
||||
.Where(adv => 1 == 1);
|
||||
|
||||
if (dto.ResultType != null)
|
||||
query = query.Where(w => w.detail.ResultType == (TakeStockType)dto.ResultType);
|
||||
if (!string.IsNullOrEmpty(dto.BillNo))
|
||||
query = query.Where(w => EF.Functions.Like(w.order.BillNo, "%" + dto.BillNo + "%"));
|
||||
if (dto.StockId != null)
|
||||
query = query.Where(w => w.detail.StockId == dto.StockId);
|
||||
if (dto.DateBeginDate != null)
|
||||
query = query.Where(w => w.order.Date >= dto.DateBeginDate);
|
||||
if (dto.DateEndDate != null)
|
||||
|
||||
Reference in New Issue
Block a user