1
heshaofeng
2026-01-22 51bd4ac4f323fab99ff9ac20763ca15af0e53a57
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundQueryService.cs
@@ -4,6 +4,7 @@
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using SqlSugar.Extensions;
using WIDESEA_Common.StockEnum;
using WIDESEA_Core;
using WIDESEA_DTO.CalcOut;
@@ -70,13 +71,28 @@
                    .QueryData(x => x.PalletCode == palletCode && x.OrderNo == orderNo);
                bool isMatMixed = false;
                bool orderOver = false;
                decimal sumQty = 0;
                if (stockInfo != null && stockInfo.Details != null && stockInfo.Details.Any())
                {
                    if (outStockLockInfos.FirstOrDefault() != null)
                    {
                        bool includeBatchNo = !string.IsNullOrEmpty(outStockLockInfos.FirstOrDefault().BatchNo);
                        bool includeSupplyCode = !string.IsNullOrEmpty(outStockLockInfos.FirstOrDefault().SupplyCode);
                        var orderId = outStockLockInfos.FirstOrDefault().OrderDetailIds.Split(",");
                        foreach (var item in orderId)
                        {
                            Dt_OutboundOrderDetail outboundOrderDetail = _outboundRepository.Db.Queryable<Dt_OutboundOrderDetail>().Where(x=>x.Id == item.ObjToInt()).First();
                            if(outboundOrderDetail == null)
                            {
                                return WebResponseContent.Instance.Error("该托盘的出库明细未找到");
                            }
                            sumQty += (outboundOrderDetail.OrderQuantity - outboundOrderDetail.OverOutQuantity - outboundOrderDetail.MoveQty);
                        }
                        if(sumQty < outStockLockInfos.FirstOrDefault().AssignQuantity)
                        {
                            orderOver = true;
                        }
                        if (includeBatchNo && includeSupplyCode)
                        {
                            isMatMixed = stockInfo.Details.GroupBy(x => new
@@ -131,7 +147,7 @@
                
                return WebResponseContent.Instance.OK(data: new { outStockLockInfos, stockInfo, isMatMixed });
                return WebResponseContent.Instance.OK(data: new { outStockLockInfos, stockInfo, isMatMixed, orderOver });
            }
            catch (Exception ex)
            {