hutongqing
2024-12-14 e7cf443b37f8f4d8a1bc4fe4cd6f058f39e5c7f5
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
文件名从 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoService.cs 修改
@@ -6,7 +6,6 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.StockEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
@@ -23,7 +22,17 @@
{
    public partial class StockInfoService : ServiceBase<Dt_StockInfo, IStockInfoRepository>, IStockInfoService
    {
        private readonly IMapper _mapper;
        private readonly IBasicRepository _basicRepository;
        public IStockInfoRepository Repository => BaseDal;
        public StockInfoService(IStockInfoRepository BaseDal, IMapper mapper, IBasicRepository basicRepository) : base(BaseDal)
        {
            _mapper = mapper;
            _basicRepository = basicRepository;
        }
        public List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, float needQuantity, out float residueQuantity)
        {
            List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>();
@@ -100,5 +109,12 @@
            residueQuantity = needQuantity;
            return outStocks;
        }
        public List<Dt_StockInfo> GetUseableStocks(string materielCode, int warehoseId)
        {
            List<string> locationCodes = _basicRepository.LocationInfoRepository.GetCanOutLocationCodes(warehoseId);
            return BaseDal.GetStockInfos(materielCode, locationCodes);
        }
    }
}