From da58f97834d2bdaeb10e677bab7bdd372a778041 Mon Sep 17 00:00:00 2001 From: Huangxiaoqiang-03 <1247017146@qq.com> Date: 星期四, 31 十月 2024 16:01:47 +0800 Subject: [PATCH] 添加PDA,添加堆垛机调度 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoService.cs | 28 +++++++--------------------- 1 files changed, 7 insertions(+), 21 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoService.cs" index 7372c41..26386bf 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Service/StockInfoService.cs" @@ -22,6 +22,11 @@ { public partial class StockInfoService : ServiceBase<Dt_StockInfo, IStockInfoRepository>, IStockInfoService { + /// <summary> + /// 鏍规嵁鎵樼洏鍙锋煡璇㈠簱瀛� + /// </summary> + /// <param name="palletCode"></param> + /// <returns></returns> public Dt_StockInfo? GetStockByPalletCode(string palletCode) { Dt_StockInfo stockInfo = BaseDal.QueryFirst(x => x.PalletCode == palletCode); @@ -39,14 +44,6 @@ if (stockInfo.Id == 0) { BaseDal.Db.InsertNav(stockInfo).Include(x => x.Details).ExecuteCommand(); - //stockQuantityChangeRecords = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(stockInfo.Details); - //stockQuantityChangeRecords.ForEach(x => - //{ - // x.PalleCode = stockInfo.PalletCode; - // x.BeforeQuantity = 0; - // x.ChangeQuantity = x.AfterQuantity - x.BeforeQuantity; - // x.ChangeType = StockChangeType.MaterielGroup.ObjToInt(); - //}); details = stockInfo.Details; } else @@ -62,19 +59,7 @@ } - //stockQuantityChangeRecords = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(stockInfo.Details); - //int index = 0; - //stockQuantityChangeRecords.ForEach(x => - //{ - // x.PalleCode = stockInfo.PalletCode; - // x.BeforeQuantity = 0; - // x.ChangeQuantity = x.AfterQuantity - x.BeforeQuantity; - // x.ChangeType = StockChangeType.MaterielGroup.ObjToInt(); - // x.StockDetailId = - // index++; - //}); } - //_stockQuantityChangeRecordRepository.AddData(stockQuantityChangeRecords); stockInfo.Details = details; _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.MaterielGroup); } @@ -91,7 +76,6 @@ return BaseDal.GetStockInfos(materielCode, locationCodes); } - public List<StockSelectViewDTO> GetStockSelectViews(string materielCode) { List<string> roadways = _basicRepository.RoadwayInfoRepository.CanOutRoadwayNos; @@ -101,6 +85,7 @@ List<int> areaIds = _basicRepository.AreaInfoRepository.GetEnableAreaIds(warehouseIds); 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 { @@ -129,6 +114,7 @@ int index = 0; while (needQuantity > 0) { + Dt_StockInfo stockInfo = stockInfos[index]; decimal useableStockQuantity = stockInfo.Details.Where(x => x.MaterielCode == materielCode).Sum(x => x.StockQuantity - x.OutboundQuantity); if (useableStockQuantity < needQuantity) -- Gitblit v1.9.3