1
heshaofeng
2026-01-30 d58d59407f6d15980356473e2e570fe4a3318e29
1
已修改6个文件
209 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Allocate/Dt_AllocateOrderDetail.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
@@ -335,14 +335,13 @@
          align: "left",
          bind: { key: "orderDetailStatusEnum", data: [] },
        },
        // {
        //   field: "returnToMESStatus",
        //   title: "回传状态",
        //   type: "string",
        //   width: 90,
        //   align: "left",
        //   bind: { key: "returnStatus", data: [{ key: 0, value: "未回传" }, { key: 1, value: "已回传成功" }, { key: 2, value: "回传失败" }] }
        // },
        {
          field: "palletCode",
          title: "已组托盘号",
          type: "string",
          width: 100,
          align: "left",
        },
        {
          field: "creater",
          title: "创建人",
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs
@@ -453,19 +453,138 @@
            Type t = typeof(TEntity);
            if (pageData.Value == null) return new PageGridData<object>(total: 0, null);
            string keyName = t.GetKeyName();
            ////生成查询条件
            //Expression<Func<TEntity, bool>> whereExpression = keyName.CreateExpression<TEntity>(pageData.Value, LinqExpressionType.Equal);
            int totalCount = 0;
            PropertyInfo propertyInfo = t.GetProperties().FirstOrDefault(x => x.GetCustomAttribute<Navigate>() != null);
            List<ExpandoObject> detailList = new List<ExpandoObject>();
            if (propertyInfo != null)
            {
                Type detailType = propertyInfo.PropertyType.GetGenericArguments()[0];
                Navigate navigate = propertyInfo.GetCustomAttribute<Navigate>();
                List<ExpandoObject> list = BaseDal.Db.Queryable(detailType.Name, "detail").Where(navigate.GetName(), "=", pageData.Value).ToPageList(pageData.Page, pageData.Rows, ref totalCount);
                return new PageGridData<ExpandoObject>(totalCount, list);
                detailList = BaseDal.Db.Queryable(detailType.Name, "detail")
                    .Where(navigate.GetName(), "=", pageData.Value)
                    .ToPageList(pageData.Page, pageData.Rows, ref totalCount);
                if (detailList.Any())
                {
                    // 1. æå–明细有效barcode
                    List<string> allBarcodes = new List<string>();
                    foreach (var expando in detailList)
                    {
                        var detailDict = (IDictionary<string, object>)expando;
                        if (detailDict.ContainsKey("barcode") && detailDict["barcode"] != null)
                        {
                            string barcodeValue = (detailDict["barcode"] as string)?.Trim() ?? string.Empty;
                            if (!string.IsNullOrWhiteSpace(barcodeValue))
                            {
                                allBarcodes.Add(barcodeValue);
            }
            return new PageGridData<object>(total: 0, null);
                        }
                    }
                    if (allBarcodes.Count == 0)
                    {
                        foreach (var expando in detailList)
                        {
                            var detailDict = (IDictionary<string, object>)expando;
                            detailDict["palletCode"] = "";
                        }
                        return new PageGridData<ExpandoObject>(totalCount, detailList);
                    }
                    // 2. æŸ¥åº“存明细表,获取barcode â†’ StockId映射
                    Dictionary<string, object> barcodeToStockIdDict = new Dictionary<string, object>();
                    var distinctBarcodes = allBarcodes.Distinct().ToList();
                    var barcodeStockIdList = BaseDal.Db.Queryable("Dt_StockInfoDetail", "sd")
                        .In("sd.barcode", distinctBarcodes)
                        .Select("sd.barcode, sd.StockId")
                        .ToList();
                    foreach (var item in barcodeStockIdList)
                    {
                        if (item == null) continue;
                        var itemDict = (IDictionary<string, object>)item;
                        if (itemDict.ContainsKey("barcode") && itemDict["barcode"] != null)
                        {
                            string barcode = (itemDict["barcode"] as string)?.Trim() ?? string.Empty;
                            object stockId = itemDict.ContainsKey("StockId") ? itemDict["StockId"] : null;
                            if (!string.IsNullOrWhiteSpace(barcode) && !barcodeToStockIdDict.ContainsKey(barcode))
                            {
                                barcodeToStockIdDict.Add(barcode, stockId);
                            }
                        }
                    }
                    if (barcodeToStockIdDict.Count == 0)
                    {
                        foreach (var expando in detailList)
                        {
                            var detailDict = (IDictionary<string, object>)expando;
                            detailDict["palletCode"] = "";
                        }
                        return new PageGridData<ExpandoObject>(totalCount, detailList);
                    }
                    Dictionary<object, string> stockIdToPalletDict = new Dictionary<object, string>();
                    var allStockIds = barcodeToStockIdDict.Values.Distinct().ToList();
                    var stockIdPalletList = BaseDal.Db.Queryable("Dt_StockInfo", "s")
                        .In("s.Id", allStockIds)
                        .Select("s.Id, s.PalletCode")
                        .ToList();
                    // æå– PalletCode
                    foreach (var item in stockIdPalletList)
                    {
                        if (item == null) continue;
                        var itemDict = (IDictionary<string, object>)item;
                        if (itemDict.ContainsKey("Id") && itemDict["Id"] != null)
                        {
                            object stockId = itemDict["Id"];
                            string palletCode = itemDict.ContainsKey("PalletCode") && itemDict["PalletCode"] != null
                                ? (itemDict["PalletCode"] as string)?.Trim() ?? string.Empty
                                : string.Empty;
                            if (!stockIdToPalletDict.ContainsKey(stockId))
                            {
                                stockIdToPalletDict.Add(stockId, palletCode);
                            }
                        }
                    }
                    // 5. ç»™æ˜Žç»†çš„palletCode字段赋值主表的PalletCode值
                    foreach (var expando in detailList)
                    {
                        var detailDict = (IDictionary<string, object>)expando;
                        string palletValue = string.Empty;
                        if (detailDict.ContainsKey("barcode") && detailDict["barcode"] != null)
                        {
                            string barcode = (detailDict["barcode"] as string)?.Trim() ?? string.Empty;
                            // é€šè¿‡barcode获取StockId
                            if (!string.IsNullOrWhiteSpace(barcode) && barcodeToStockIdDict.TryGetValue(barcode, out var stockId))
                            {
                                // é€šè¿‡StockId获取主表的PalletCode
                                stockIdToPalletDict.TryGetValue(stockId, out palletValue);
                            }
                        }
                        // åŠ¨æ€æ›´æ–°/添加palletCode字段
                        if (detailDict.ContainsKey("palletCode"))
                        {
                            detailDict["palletCode"] = palletValue;
                        }
                        else
                        {
                            detailDict.Add("palletCode", palletValue);
                        }
                    }
                }
            }
            return new PageGridData<ExpandoObject>(totalCount, detailList);
        }
        /// <summary>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs
@@ -12,6 +12,7 @@
using System.Data;
using System.Linq;
using System.Net;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.AllocateEnum;
@@ -95,8 +96,10 @@
                
                var details = _inboundOrderDetailRepository.QueryData(x => (x.OutBoxbarcodes == palletDto.Barcode|| x.Barcode == palletDto.Barcode) && x.OrderDetailStatus == (int)InOrderStatusEnum.未开始);
                if (details.Count() <= 0)
                {
                    var inbounddetail =_inboundOrderDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode || x.OutBoxbarcodes == palletDto.Barcode);
                    if(inbounddetail == null)
                    {
@@ -124,7 +127,7 @@
                   var palletId = _stockInfoDetailRepository.QueryFirst(x => x.Barcode == palletDto.Barcode);
                    if (palletId == null)
                    {
                        return content.Error($"条码条码{palletDto.Barcode}不存在");
                        return content.Error($"条码{palletDto.Barcode}已组盘");
                    }
                    var pallet =_stockInfoRepository.QueryFirst(x => x.Id == palletId.StockId);
                    return content.Error($"条码{palletDto.Barcode}已经组到{pallet.PalletCode}",detail);   
@@ -285,7 +288,16 @@
                {
                    return content.Error("已上架的托盘不能再次组盘");
                }
                var nullpallet = _stockInfoRepository.QueryFirst(x => x.PalletType == -1 && x.PalletCode == palletDto.PalletCode);
                if (nullpallet != null)
                {
                    return content.Error($"该托盘{palletDto.PalletCode}已经进行空托组盘,不能在进行组盘");
                }
                var outbundPallet = _stockInfoRepository.QueryFirst(x => x.StockStatus == (int)StockStatusEmun.出库完成 && x.PalletCode == palletDto.PalletCode);
                if (outbundPallet != null)
                {
                    return content.Error($"该托盘{palletDto.PalletCode}未进行取空箱,不能进行组盘");
                }
                if (_stockService.StockInfoDetailService.ExistBarcodes(palletDto.Barcode))
                {
                    return content.Error($"{palletDto.Barcode} æ¡ç åœ¨åº“存中已存在");
@@ -927,5 +939,8 @@
                return content.Error(ex.Message);
            }
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Model/Models/Allocate/Dt_AllocateOrderDetail.cs
@@ -131,5 +131,11 @@
        [SugarColumn(IsNullable = true, ColumnDescription = "过期日期")]
        public DateTime ValidDate { get; set; }
        /// <summary>
        /// æ‰˜ç›˜ç¼–号
        /// </summary>
        [SugarColumn(IsIgnore = true, IsNullable = true)]
        public string Pallet { get; set; }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs
@@ -151,5 +151,11 @@
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "过期日期")]
        public DateTime ValidDate { get; set; }
        /// <summary>
        /// æ‰˜ç›˜ç¼–号
        /// </summary>
        [SugarColumn(IsIgnore = true, IsNullable = true)]
        public string Pallet { get; set; }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs
@@ -399,6 +399,40 @@
                            string returnToMESStatus = returnToMESStatusParam.Value.ToString().Trim();
                            sugarQueryable1 = sugarQueryable1.Where(x => x.ReturnToMESStatus.Equals(returnToMESStatus));
                        }
                        var createDateParams = searchParametersList
                    .Where(x => x.Name.Equals("createDate", StringComparison.OrdinalIgnoreCase)
                                && !string.IsNullOrEmpty(x.Value?.ToString()))
                    .ToList();
                        DateTime? minCreateDate = null;
                        DateTime? maxCreateDate = null;
                        foreach (var dateParam in createDateParams)
                        {
                            if (DateTime.TryParse(dateParam.Value.ToString(), out DateTime dateValue))
                            {
                                LinqExpressionType expressionType = dateParam.DisplayType.GetLinqCondition();
                                switch (expressionType)
                                {
                                    case LinqExpressionType.ThanOrEqual:
                                        minCreateDate = dateValue;
                                        break;
                                    case LinqExpressionType.LessThanOrEqual:
                                        maxCreateDate = dateValue;
                                        break;
                                }
                            }
                        }
                        if (minCreateDate.HasValue)
                        {
                            sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate >= minCreateDate.Value);
                        }
                        if (maxCreateDate.HasValue)
                        {
                            sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate <= maxCreateDate.Value);
                        }
                    }
                }
                catch { }