From d1a2afa67032339c2eb1019a02c6b6d036c0bdb1 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期一, 23 九月 2024 09:09:40 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs |   43 +++++++++++++++++++------------------------
 1 files changed, 19 insertions(+), 24 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
index df24206..ca20254 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
@@ -23,24 +23,19 @@
     public class StockInfoService : ServiceBase<Dt_StockInfo, IStockInfoRepository>, IStockInfoService
     {
         private readonly IMapper _mapper;
-        private readonly IStockQuantityChangeRecordService _stockQuantityChangeRecordService;
-        private readonly IStockInfoDetailRepository _stockInfoDetailRepository;
-        private readonly IWarehouseRepository _warehouseRepository;
-        private readonly IRoadwayInfoRepository _roadwayInfoRepository;
-        private readonly IAreaInfoRepository _areaInfoRepository;
-        private readonly ILocationInfoRepository _locationInfoRepository;
+
+        private readonly IBasicRepository _basicRepository;
+        private readonly IStockRepository _stockRepository;
+        private readonly IRecordService _recordService;
 
         public IStockInfoRepository Repository => BaseDal;
 
-        public StockInfoService(IStockInfoRepository BaseDal, IMapper mapper, IStockQuantityChangeRecordService stockQuantityChangeRecordService, IStockInfoDetailRepository stockInfoDetailRepository, IWarehouseRepository warehouseRepository, IRoadwayInfoRepository roadwayInfoRepository, IAreaInfoRepository areaInfoRepository, ILocationInfoRepository locationInfoRepository) : base(BaseDal)
+        public StockInfoService(IStockInfoRepository BaseDal, IMapper mapper, IBasicRepository basicRepository, IStockRepository stockRepository,IRecordService recordService) : base(BaseDal)
         {
             _mapper = mapper;
-            _stockQuantityChangeRecordService = stockQuantityChangeRecordService;
-            _stockInfoDetailRepository = stockInfoDetailRepository;
-            _warehouseRepository = warehouseRepository;
-            _roadwayInfoRepository = roadwayInfoRepository;
-            _areaInfoRepository = areaInfoRepository;
-            _locationInfoRepository = locationInfoRepository;
+            _basicRepository = basicRepository;
+            _stockRepository = stockRepository;
+            _recordService = recordService;
         }
 
         public Dt_StockInfo? GetStockByPalletCode(string palletCode)
@@ -48,7 +43,7 @@
             Dt_StockInfo stockInfo = BaseDal.QueryFirst(x => x.PalletCode == palletCode);
             if (stockInfo != null)
             {
-                stockInfo.Details = _stockInfoDetailRepository.QueryData(x => x.StockId == stockInfo.Id);
+                stockInfo.Details = _stockRepository.StockInfoDetailRepository.QueryData(x => x.StockId == stockInfo.Id);
             }
             return stockInfo;
         }
@@ -78,7 +73,7 @@
                 {
                     if (stockInfo.Details[i].Id == 0)
                     {
-                        details.Add(_stockInfoDetailRepository.Db.Insertable(stockInfo.Details[i]).ExecuteReturnEntity());
+                        details.Add(_stockRepository.StockInfoDetailRepository.Db.Insertable(stockInfo.Details[i]).ExecuteReturnEntity());
                     }
 
                 }
@@ -97,31 +92,31 @@
             }
             //_stockQuantityChangeRecordRepository.AddData(stockQuantityChangeRecords);
             stockInfo.Details = details;
-            _stockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.MaterielGroup);
+            _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.MaterielGroup);
         }
 
         public List<Dt_StockInfo> GetUseableStocks(string materielCode)
         {
-            List<string> roadways = _roadwayInfoRepository.CanOutRoadwayNos;
+            List<string> roadways = _basicRepository.RoadwayInfoRepository.CanOutRoadwayNos;
 
-            List<int> warehouseIds = _warehouseRepository.EnableWarehouseIds;
+            List<int> warehouseIds = _basicRepository.WarehouseRepository.EnableWarehouseIds;
 
-            List<int> areaIds = _areaInfoRepository.GetEnableAreaIds(warehouseIds);
+            List<int> areaIds = _basicRepository.AreaInfoRepository.GetEnableAreaIds(warehouseIds);
 
-            List<string> locationCodes = _locationInfoRepository.GetCanOutLocationCodes(roadways, areaIds);
+            List<string> locationCodes = _basicRepository.LocationInfoRepository.GetCanOutLocationCodes(roadways, areaIds);
 
             return BaseDal.GetStockInfos(materielCode, locationCodes);
         }
 
         public List<StockSelectViewDTO> GetStockSelectViews(string materielCode)
         {
-            List<string> roadways = _roadwayInfoRepository.CanOutRoadwayNos;
+            List<string> roadways = _basicRepository.RoadwayInfoRepository.CanOutRoadwayNos;
 
-            List<int> warehouseIds = _warehouseRepository.EnableWarehouseIds;
+            List<int> warehouseIds = _basicRepository.WarehouseRepository.EnableWarehouseIds;
 
-            List<int> areaIds = _areaInfoRepository.GetEnableAreaIds(warehouseIds);
+            List<int> areaIds = _basicRepository.AreaInfoRepository.GetEnableAreaIds(warehouseIds);
 
-            List<string> locationCodes = _locationInfoRepository.GetCanOutLocationCodes(roadways, areaIds);
+            List<string> locationCodes = _basicRepository.LocationInfoRepository.GetCanOutLocationCodes(roadways, areaIds);
 
             return BaseDal.QueryTabs<Dt_StockInfo, Dt_StockInfoDetail, StockSelectViewDTO>((a, b) => a.Id == b.StockId, (a, b) => new StockSelectViewDTO
             {

--
Gitblit v1.9.3