列表字段填充

This commit is contained in:
18942506660
2023-10-30 09:58:57 +08:00
parent d11e15200d
commit 1b50d73935
5 changed files with 56 additions and 37 deletions

View File

@@ -12,6 +12,7 @@ using WMS.Web.Core.Help;
using WMS.Web.Domain.Entitys; using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure; using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService.Public; using WMS.Web.Domain.IService.Public;
using WMS.Web.Domain.Values.Single;
using WMS.Web.Repositories.Configuration; using WMS.Web.Repositories.Configuration;
namespace WMS.Web.Repositories namespace WMS.Web.Repositories
@@ -22,15 +23,17 @@ namespace WMS.Web.Repositories
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly RepositoryDbContext _context; private readonly RepositoryDbContext _context;
private readonly ISingleDataService _singleDataService; private readonly ISingleDataService _singleDataService;
private readonly ILoginRepositories _loginRepositories;
public ChangeBoxRecordRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider, public ChangeBoxRecordRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider,
ISingleDataService singleDataService) ISingleDataService singleDataService, ILoginRepositories loginRepositories)
{ {
_context = context; _context = context;
_mapper = mapper; _mapper = mapper;
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_singleDataService = singleDataService; _singleDataService = singleDataService;
_loginRepositories = loginRepositories;
} }
/// <summary> /// <summary>
/// 新增 /// 新增
@@ -89,13 +92,13 @@ namespace WMS.Web.Repositories
MaterialName = "", MaterialName = "",
MaterialNumber = "", MaterialNumber = "",
Specifications = "", Specifications = "",
Stock = "", Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.StockId),
SerialNumber = "", SerialNumber = "",
SrcBox = "", SrcBox = "",
DestBox = "", DestBox = "",
SrcSubStock = "", SrcSubStock = "",
DestSubStock = "", DestSubStock = "",
Creator = "", Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.CreatorId),
CreateTime =s.CreateTime.DateToStringSeconds() CreateTime =s.CreateTime.DateToStringSeconds()
#endregion #endregion

View File

@@ -6,11 +6,13 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using WMS.Web.Core;
using WMS.Web.Core.Dto.MoveBoxRecord; using WMS.Web.Core.Dto.MoveBoxRecord;
using WMS.Web.Core.Help; using WMS.Web.Core.Help;
using WMS.Web.Domain.Entitys; using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure; using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService.Public; using WMS.Web.Domain.IService.Public;
using WMS.Web.Domain.Values.Single;
using WMS.Web.Repositories.Configuration; using WMS.Web.Repositories.Configuration;
namespace WMS.Web.Repositories namespace WMS.Web.Repositories
@@ -21,15 +23,17 @@ namespace WMS.Web.Repositories
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly RepositoryDbContext _context; private readonly RepositoryDbContext _context;
private readonly ISingleDataService _singleDataService; private readonly ISingleDataService _singleDataService;
private readonly ILoginRepositories _loginRepositories;
public MoveBoxRecordRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider, public MoveBoxRecordRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider,
ISingleDataService singleDataService) ISingleDataService singleDataService, ILoginRepositories loginRepositories)
{ {
_context = context; _context = context;
_mapper = mapper; _mapper = mapper;
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_singleDataService = singleDataService; _singleDataService = singleDataService;
_loginRepositories = loginRepositories;
} }
/// <summary> /// <summary>
/// 新增 /// 新增
@@ -89,9 +93,9 @@ namespace WMS.Web.Repositories
SrcSubStock = "", SrcSubStock = "",
Specifications = "", Specifications = "",
DestSubStock = "", DestSubStock = "",
Qty = 0, Qty = s.Qty,
Type = "", Type = s.Type.GetRemark(),
Creator = "", Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.CreatorId),
CreateTime = s.CreateTime.DateToStringSeconds() CreateTime = s.CreateTime.DateToStringSeconds()
#endregion #endregion

View File

@@ -6,12 +6,14 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using WMS.Web.Core;
using WMS.Web.Core.Dto.OutStock; using WMS.Web.Core.Dto.OutStock;
using WMS.Web.Core.Help; using WMS.Web.Core.Help;
using WMS.Web.Domain.Entitys; using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure; using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService.Public; using WMS.Web.Domain.IService.Public;
using WMS.Web.Domain.Mappers; using WMS.Web.Domain.Mappers;
using WMS.Web.Domain.Values.Single;
using WMS.Web.Repositories.Configuration; using WMS.Web.Repositories.Configuration;
namespace WMS.Web.Repositories namespace WMS.Web.Repositories
@@ -22,15 +24,17 @@ namespace WMS.Web.Repositories
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly RepositoryDbContext _context; private readonly RepositoryDbContext _context;
private readonly ISingleDataService _singleDataService; private readonly ISingleDataService _singleDataService;
private readonly ILoginRepositories _loginRepositories;
public OutStockRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider, public OutStockRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider,
ISingleDataService singleDataService) ISingleDataService singleDataService, ILoginRepositories loginRepositories)
{ {
_context = context; _context = context;
_mapper = mapper; _mapper = mapper;
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_singleDataService = singleDataService; _singleDataService = singleDataService;
_loginRepositories = loginRepositories;
} }
/// <summary> /// <summary>
/// 新增 /// 新增
@@ -88,22 +92,22 @@ namespace WMS.Web.Repositories
var list = await query.Select(s => new OutStockQueryInfoResponse() var list = await query.Select(s => new OutStockQueryInfoResponse()
{ {
#region dto组装 #region dto组装
Id = 0, Id = s.order.Id,
BillNo=s.order.BillNo, BillNo=s.order.BillNo,
Status = "", Status = s.order.Status.GetRemark(),
Type = "", Type = s.order.Type.GetRemark(),
Creator = "", Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.order.CreatorId),
CreateTime=s.order.CreateTime.DateToStringSeconds(), CreateTime=s.order.CreateTime.DateToStringSeconds(),
SuccessSync = s.order.SuccessSync, SuccessSync = s.order.SuccessSync,
Stock = "", Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.detail.StockId),
SourceBillNo="", SourceBillNo=s.detail.SourceBillNo,
SaleBillNo = "", SaleBillNo = s.detail.SaleBillNo,
DeliveryOrg = "", DeliveryOrg = "",
ReceiptCustomer = "", ReceiptCustomer = "",
MaterialName = "", MaterialName = "",
MaterialNumber = "", MaterialNumber = "",
Specifications = "", Specifications = "",
Qty=0 Qty=s.detail.Qty
#endregion #endregion
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync(); }).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();

View File

@@ -6,12 +6,14 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using WMS.Web.Core;
using WMS.Web.Core.Dto.OutStockTask; using WMS.Web.Core.Dto.OutStockTask;
using WMS.Web.Core.Help; using WMS.Web.Core.Help;
using WMS.Web.Domain.Entitys; using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure; using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService.Public; using WMS.Web.Domain.IService.Public;
using WMS.Web.Domain.Mappers; using WMS.Web.Domain.Mappers;
using WMS.Web.Domain.Values.Single;
using WMS.Web.Repositories.Configuration; using WMS.Web.Repositories.Configuration;
namespace WMS.Web.Repositories namespace WMS.Web.Repositories
@@ -22,15 +24,17 @@ namespace WMS.Web.Repositories
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly RepositoryDbContext _context; private readonly RepositoryDbContext _context;
private readonly ISingleDataService _singleDataService; private readonly ISingleDataService _singleDataService;
private readonly ILoginRepositories _loginRepositories;
public OutStockTaskRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider, public OutStockTaskRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider,
ISingleDataService singleDataService) ISingleDataService singleDataService, ILoginRepositories loginRepositories)
{ {
_context = context; _context = context;
_mapper = mapper; _mapper = mapper;
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_singleDataService = singleDataService; _singleDataService = singleDataService;
_loginRepositories = loginRepositories;
} }
/// <summary> /// <summary>
/// 新增 /// 新增
@@ -172,15 +176,15 @@ namespace WMS.Web.Repositories
var list = await query.Select(s => new OutStockTaskQueryInfoResponse() var list = await query.Select(s => new OutStockTaskQueryInfoResponse()
{ {
#region dto组装 #region dto组装
Id = 0, Id = s.order.Id,
DetailId=0, DetailId=s.detail.Id,
BillNo =s.order.BillNo, BillNo =s.order.BillNo,
Status = "", Status = s.order.Status.GetRemark(),
Type = "", Type = s.order.Type.GetRemark(),
CreateTime = s.order.OperateTime.DateToStringSeconds(), CreateTime = s.order.OperateTime.DateToStringSeconds(),
Stock = "", Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.detail.StockId),
SourceBillNo = "", SourceBillNo = s.detail.SourceBillNo,
SaleBillNo = "", SaleBillNo = s.detail.SaleBillNo,
DeliveryOrg = "", DeliveryOrg = "",
ReceiptCustomer = "", ReceiptCustomer = "",
MaterialName = "", MaterialName = "",

View File

@@ -6,30 +6,34 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using WMS.Web.Core;
using WMS.Web.Core.Dto.TakeStock; using WMS.Web.Core.Dto.TakeStock;
using WMS.Web.Core.Help; using WMS.Web.Core.Help;
using WMS.Web.Domain.Entitys; using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure; using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService.Public; using WMS.Web.Domain.IService.Public;
using WMS.Web.Domain.Values.Single;
using WMS.Web.Repositories.Configuration; using WMS.Web.Repositories.Configuration;
namespace WMS.Web.Repositories namespace WMS.Web.Repositories
{ {
public class TakeStockRepositories: ITakeStockRepositories public class TakeStockRepositories : ITakeStockRepositories
{ {
private readonly IMapper _mapper; private readonly IMapper _mapper;
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly RepositoryDbContext _context; private readonly RepositoryDbContext _context;
private readonly ISingleDataService _singleDataService; private readonly ISingleDataService _singleDataService;
private readonly ILoginRepositories _loginRepositories;
public TakeStockRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider, public TakeStockRepositories(RepositoryDbContext context, IMapper mapper, IServiceProvider serviceProvider,
ISingleDataService singleDataService) ISingleDataService singleDataService, ILoginRepositories loginRepositories)
{ {
_context = context; _context = context;
_mapper = mapper; _mapper = mapper;
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_singleDataService = singleDataService; _singleDataService = singleDataService;
_loginRepositories = loginRepositories;
} }
/// <summary> /// <summary>
/// 新增 /// 新增
@@ -87,19 +91,19 @@ namespace WMS.Web.Repositories
var list = await query.Select(s => new TakeStockQueryInfoResponse() var list = await query.Select(s => new TakeStockQueryInfoResponse()
{ {
#region dto组装 #region dto组装
Id = 0, Id = s.order.Id,
BillNo = "", BillNo = s.order.BillNo,
Unit = "", Unit = _singleDataService.GetSingleData(SingleAction.Units, _loginRepositories.CompanyId, s.detail.UnitId),
Stock = "", Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.detail.StockId),
SubStock = "", SubStock = "",
BeforeQty = 0, BeforeQty = s.detail.BeforeQty,
AfterQty = 0, AfterQty = s.detail.AfterQty,
FinalQty = 0, FinalQty = s.detail.FinalQty,
ResultType="", ResultType = s.detail.ResultType.GetRemark(),
Remark="", Remark = s.detail.Remark,
Creator = "", Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.order.CreatorId),
Date = s.order.Date.DateToStringSeconds(), Date = s.order.Date.DateToStringSeconds(),
SuccessSync=s.order.SuccessSync SuccessSync = s.order.SuccessSync
#endregion #endregion
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync(); }).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();