wangxinhui
2026-03-17 89bccb9b8fb1070f7ac5f36510c868fecead9384
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs
@@ -59,6 +59,10 @@
                {
                    return content.Error($"生成任务失败");
                }
                tasks.ForEach(x =>
                {
                    x.Grade = 99;
                });
                stockInfos.ForEach(x =>
                {
                    x.StockStatus = StockStatusEmun.出库锁定.ObjToInt();
@@ -679,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);
@@ -700,6 +704,7 @@
                {
                    tasks.AddRange(result.Item1);
                }
                content.Message = result.Item6;
                //处理出库数据
                return GenerateOutboundTaskDataUpdate(tasks, stockInfos, outSGOrderDetails, outStockLockInfos, locationInfos);
            }
@@ -717,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));
@@ -737,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)
            {
                //获取任务
@@ -771,7 +776,7 @@
                throw new Exception("无库存");
            }
            return (tasks, stockInfos, orderDetails, outStockLockInfos, locationInfos);
            return (tasks, stockInfos, orderDetails, outStockLockInfos, locationInfos, result.Item5);
        }
        /// <summary>
        /// å¤„理出库数据
@@ -893,11 +898,13 @@
                    }
                }
                #endregion
                List<Dt_OutLineView> outLineViewsDel = _outboundRepository.OutLineViewRepository.QueryData(x => stockInfos.Select(x=>x.PalletCode).Contains(x.PalletCode));
                _unitOfWorkManage.BeginTran();
                _stockRepository.StockInfoRepository.UpdateData(stockInfos);
                _outboundRepository.OutStockLockInfoRepository.UpdateData(outStockLockInfos);
                _outboundRepository.OutSGOrderRepository.UpdateData(outSGOrders);
                _outboundRepository.OutSGOrderDetailRepository.UpdateData(orderDetails);
                _outboundRepository.OutLineViewRepository.DeleteData(outLineViewsDel);
                _unitOfWorkManage.CommitTran();
                content.OK(ExistNoCodes.Count>0 ? string.Join(",", ExistNoCodes)+"老厂可扣库存不存在" : "");
            }