1
wangxinhui
2026-03-13 83748b08c2016120e914f669f1b8d376846abf01
1
已修改4个文件
29 ■■■■■ 文件已修改
项目代码/WMS/WMSServices/WIDESEA_IOutboundService/IOutSGOrderDetailService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_IOutboundService/IOutSGOrderDetailService.cs
@@ -19,7 +19,7 @@
        /// </summary>
        /// <param name="outboundOrderDetails"></param>
        /// <returns></returns>
        (List<Dt_StockInfo>, List<Dt_OutSGOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(List<Dt_OutSGOrderDetail> outboundOrderDetails);
        (List<Dt_StockInfo>, List<Dt_OutSGOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>,string) AssignStockOutbound(List<Dt_OutSGOrderDetail> outboundOrderDetails);
        /// <summary>
        /// å‡ºåº“库存分配后,更新数据库数据
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs
@@ -45,13 +45,13 @@
        /// <summary>
        /// åˆ†é…åº“å­˜
        /// </summary>
        public (List<Dt_StockInfo>, List<Dt_OutSGOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(List<Dt_OutSGOrderDetail> outboundOrderDetails)
        public (List<Dt_StockInfo>, List<Dt_OutSGOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>,string) AssignStockOutbound(List<Dt_OutSGOrderDetail> outboundOrderDetails)
        {
            if (!outboundOrderDetails.Any())
            {
                throw new Exception($"未找到出库单明细信息");
            }
            string message = "";
            //获取所有排程主表
            List<Dt_OutSGOrder> outBSTOrders = _outboundRepository.OutSGOrderRepository.QueryData(x => outboundOrderDetails.Select(x=>x.OutSGOrderId).Distinct().Contains(x.Id));
            List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>();
@@ -74,14 +74,18 @@
            foreach (var item in groupDetails)
            {
                decimal needQuantity = item.XqLen;
                //获取所有条码
                List<string> palletCodes = outStocks.Select(x => x.PalletCode).ToList();
                //获取老厂缓存可用库存
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseOldCacheStocks(item.MaterialNo, item.Width) ?? new List<Dt_StockInfo>();
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseOldCacheStocks(item.MaterialNo, item.Width).Where(x => !palletCodes.Contains(x.PalletCode)).ToList() ?? new List<Dt_StockInfo>();
                //获取立库可用库存
                stockInfos.AddRange(_stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId).Where(x=>!outStocks.Select(x=>x.PalletCode).Contains(x.PalletCode)).ToList());
                stockInfos.AddRange(_stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId).Where(x=>!palletCodes.Contains(x.PalletCode)).ToList());
                if (!stockInfos.Any())
                {
                    message += $"物料:{item.MaterialNo},幅宽:{item.Width}无库存;";
                    continue;
                }
                //分配实际库存
                List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutOldStocks(stockInfos, needQuantity).ToList();
                //添加库存分配
@@ -143,7 +147,7 @@
                locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Where(x=>!x.LocationCode.IsNullOrEmpty() && !locationInfos.Select(x=>x.LocationCode).Contains(x.LocationCode)).Select(x => x.LocationCode).ToList()));
            }
            return (outStocks, outboundOrderDetails, outStockLockInfos, locationInfos);
            return (outStocks, outboundOrderDetails, outStockLockInfos, locationInfos, message);
        }
        /// <summary>
        /// å‡ºåº“库存分配后,更新数据库数据
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -365,6 +365,10 @@
                    throw new Exception($"未找到条码{stockInfoOld.PalletCode}一期ERP库存不存在");
                }
                BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"一期ERP未返回{stockInfoOld.PalletCode}的库存信息");
                if (stockInfoOld.StockLength <= 0 || bSTStockInfoDTO.StockMeter<=0)
                {
                    throw new Exception($"{stockInfoOld.RfidCode}绑定条码{stockInfoOld.PalletCode}库存为0");
                }
                stockInfoOld.IsPick = WhetherEnum.False.ObjToInt();
                decimal stockLength = bSTStockInfoDTO.StockMeter;
                decimal errWeight = Math.Abs(weight - bSTStockInfoDTO.Qty);
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs
@@ -683,7 +683,7 @@
                List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>();
                List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
                //生成任务、库存等信息
                (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutSGOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutSGTaskDataHandle(keys);
                (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutSGOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?,string) result = OutSGTaskDataHandle(keys);
                if (result.Item2 != null && result.Item2.Count > 0)
                {
                    stockInfos.AddRange(result.Item2);
@@ -704,6 +704,7 @@
                {
                    tasks.AddRange(result.Item1);
                }
                content.Message = result.Item6;
                //处理出库数据
                return GenerateOutboundTaskDataUpdate(tasks, stockInfos, outSGOrderDetails, outStockLockInfos, locationInfos);
            }
@@ -721,7 +722,7 @@
        /// <param name="stockSelectViews"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutSGOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) OutSGTaskDataHandle(int[] keys)
        public (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutSGOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?,string) OutSGTaskDataHandle(int[] keys)
        {
            List<Dt_Task> tasks = new List<Dt_Task>();
            List<Dt_OutSGOrderDetail> outSGOrderDetails = _outboundRepository.OutSGOrderDetailRepository.QueryData(x => keys.Contains(x.Id));
@@ -741,7 +742,7 @@
            List<Dt_LocationInfo>? locationInfos = null;
            //分配库存
            (List<Dt_StockInfo>, List<Dt_OutSGOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutSGOrderDetailService.AssignStockOutbound(outSGOrderDetails);
            (List<Dt_StockInfo>, List<Dt_OutSGOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>,string) result = _outboundService.OutSGOrderDetailService.AssignStockOutbound(outSGOrderDetails);
            if (result.Item1 != null && result.Item1.Count > 0)
            {
                //获取任务
@@ -775,7 +776,7 @@
                throw new Exception("无库存");
            }
            return (tasks, stockInfos, orderDetails, outStockLockInfos, locationInfos);
            return (tasks, stockInfos, orderDetails, outStockLockInfos, locationInfos, result.Item5);
        }
        /// <summary>
        /// å¤„理出库数据